@ckeditor/ckeditor5-real-time-collaboration 41.3.1 → 41.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,4 +2,4 @@
2
2
  /*!
3
3
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
4
4
  * For licensing, see LICENSE.md.
5
- */(()=>{var __webpack_modules__={310:e=>{"use strict";e.exports=function(e,t){var n=new Array(arguments.length-1),r=0,s=2,o=!0;for(;s<arguments.length;)n[r++]=arguments[s++];return new Promise((function(s,i){n[r]=function(e){if(o)if(o=!1,e)i(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];s.apply(null,t)}};try{e.apply(t||null,n)}catch(e){o&&(o=!1,i(e))}}))}},662:(e,t)=>{"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),s=new Array(123),o=0;o<64;)s[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;n.encode=function(e,t,n){for(var s,o=null,i=[],a=0,c=0;t<n;){var d=e[t++];switch(c){case 0:i[a++]=r[d>>2],s=(3&d)<<4,c=1;break;case 1:i[a++]=r[s|d>>4],s=(15&d)<<2,c=2;break;case 2:i[a++]=r[s|d>>6],i[a++]=r[63&d],c=0}a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0)}return c&&(i[a++]=r[s],i[a++]=61,1===c&&(i[a++]=61)),o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))};var i="invalid encoding";n.decode=function(e,t,n){for(var r,o=n,a=0,c=0;c<e.length;){var d=e.charCodeAt(c++);if(61===d&&a>1)break;if(void 0===(d=s[d]))throw Error(i);switch(a){case 0:r=d,a=1;break;case 1:t[n++]=r<<2|(48&d)>>4,r=d,a=2;break;case 2:t[n++]=(15&r)<<4|(60&d)>>2,r=d,a=3;break;case 3:t[n++]=(3&r)<<6|d,a=0}}if(1===a)throw Error(i);return n-o},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},707:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}},365:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function s(e,r,s){t[0]=e,r[s]=n[0],r[s+1]=n[1],r[s+2]=n[2],r[s+3]=n[3]}function o(e,r,s){t[0]=e,r[s]=n[3],r[s+1]=n[2],r[s+2]=n[1],r[s+3]=n[0]}function i(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function a(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?s:o,e.writeFloatBE=r?o:s,e.readFloatLE=r?i:a,e.readFloatBE=r?a:i}():function(){function t(e,t,n,r){var s=t<0?1:0;if(s&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((s<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((s<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var o=Math.floor(Math.log(t)/Math.LN2);e((s<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,n,r)}}function i(e,t,n){var r=e(t,n),s=2*(r>>31)+1,o=r>>>23&255,i=8388607&r;return 255===o?i?NaN:s*(1/0):0===o?1401298464324817e-60*s*i:s*Math.pow(2,o-150)*(i+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,r),e.readFloatLE=i.bind(null,s),e.readFloatBE=i.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function s(e,r,s){t[0]=e,r[s]=n[0],r[s+1]=n[1],r[s+2]=n[2],r[s+3]=n[3],r[s+4]=n[4],r[s+5]=n[5],r[s+6]=n[6],r[s+7]=n[7]}function o(e,r,s){t[0]=e,r[s]=n[7],r[s+1]=n[6],r[s+2]=n[5],r[s+3]=n[4],r[s+4]=n[3],r[s+5]=n[2],r[s+6]=n[1],r[s+7]=n[0]}function i(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function a(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?s:o,e.writeDoubleBE=r?o:s,e.readDoubleLE=r?i:a,e.readDoubleBE=r?a:i}():function(){function t(e,t,n,r,s,o){var i=r<0?1:0;if(i&&(r=-r),0===r)e(0,s,o+t),e(1/r>0?0:2147483648,s,o+n);else if(isNaN(r))e(0,s,o+t),e(2146959360,s,o+n);else if(r>17976931348623157e292)e(0,s,o+t),e((i<<31|2146435072)>>>0,s,o+n);else{var a;if(r<22250738585072014e-324)e((a=r/5e-324)>>>0,s,o+t),e((i<<31|a/4294967296)>>>0,s,o+n);else{var c=Math.floor(Math.log(r)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=r*Math.pow(2,-c))>>>0,s,o+t),e((i<<31|c+1023<<20|1048576*a&1048575)>>>0,s,o+n)}}}function i(e,t,n,r,s){var o=e(r,s+t),i=e(r,s+n),a=2*(i>>31)+1,c=i>>>20&2047,d=4294967296*(1048575&i)+o;return 2047===c?d?NaN:a*(1/0):0===c?5e-324*a*d:a*Math.pow(2,c-1075)*(d+4503599627370496)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=i.bind(null,s,0,4),e.readDoubleBE=i.bind(null,o,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function r(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function s(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},230:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},319:e=>{"use strict";e.exports=function(e,t,n){var r=n||8192,s=r>>>1,o=null,i=r;return function(n){if(n<1||n>s)return e(n);i+n>r&&(o=e(r),i=0);var a=t.call(o,i,i+=n);return 7&i&&(i=1+(7|i)),a}}},742:(e,t)=>{"use strict";var n=t;n.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return"";for(var r,s=null,o=[],i=0;t<n;)(r=e[t++])<128?o[i++]=r:r>191&&r<224?o[i++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[i++]=55296+(r>>10),o[i++]=56320+(1023&r)):o[i++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],i>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),i=0);return s?(i&&s.push(String.fromCharCode.apply(String,o.slice(0,i))),s.join("")):String.fromCharCode.apply(String,o.slice(0,i))},n.write=function(e,t,n){for(var r,s,o=n,i=0;i<e.length;++i)(r=e.charCodeAt(i))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(s=e.charCodeAt(i+1)))?(r=65536+((1023&r)<<10)+(1023&s),++i,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-o}},106:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(433),s=n.n(r)()((function(e){return e[1]}));s.push([e.id,".ck.ck-balloon-panel.ck-tooltip{z-index:calc(var(--ck-z-dialog) + 100)}:root{--ck-color-presence-list-dropdown-background:#fff;--ck-color-presence-list-dropdown-arrow-border:#ebebeb;--ck-presence-list-dropdown-list-max-width:250px;--ck-presence-list-dropdown-list-min-width:180px;--ck-presence-list-users-tooltip-max-width:120px;--ck-presence-list-users-tooltip-min-width:25px}.ck.ck-presence-list{align-items:center;display:flex;font-size:var(--ck-font-size-base);margin-right:var(--ck-spacing-standard);transition:margin-right .2s ease-in-out}.ck.ck-presence-list *{box-sizing:border-box}.ck.ck-presence-list__list{display:flex;justify-content:flex-end}.ck.ck-presence-list__counter{color:var(--ck-color-base-text);margin-right:var(--ck-spacing-large)}.ck.ck-presence-list__counter--hidden{display:none}.ck.ck-presence-list__list-item{background:none;border:0;color:inherit;font:inherit;margin-left:var(--ck-spacing-standard);outline:none;padding:0;position:relative}.ck.ck-presence-list__list-item:last-child{margin-left:0;order:-1}.ck.ck-tooltip.ck-presence-list__list-item__tooltip>.ck-tooltip__text{display:inline-block;max-width:var(--ck-presence-list-users-tooltip-max-width);overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.ck.ck-presence-list__marker{display:block;height:3px;margin-top:3px;position:relative;width:100%}.ck-presence-list__balloon button.ck-presence-list__dropdown-list-item *,.ck-presence-list__list button.ck-presence-list__list-item *{cursor:pointer}.ck.ck-presence-list--collapsed .ck-presence-list__list{min-width:calc(var(--ck-user-avatar-size)*2)}.ck.ck-presence-list--collapsed .ck-presence-list__list *{cursor:pointer;transition:all .4s ease-in-out}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item{margin-left:calc(var(--ck-user-avatar-size)*-1 + 7px)}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:last-child{order:unset}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(2){opacity:.75}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(3){opacity:.55}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(4){opacity:.35}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(5){opacity:.15}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(n+6){display:none}.ck.ck-presence-list__balloon{--ck-color-panel-border:var(--ck-color-presence-list-dropdown-arrow-border);--ck-color-panel-background:var(--ck-color-presence-list-dropdown-background);animation:fadeIn .3s ease-in-out;background-color:var(--ck-color-presence-list-dropdown-background);border:0;opacity:1}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-wrapper{border-radius:var(--ck-border-radius);max-height:80vh;max-width:var(--ck-presence-list-dropdown-list-max-width);min-width:var(--ck-presence-list-dropdown-list-min-width);overflow-x:hidden;overflow-y:auto}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item{align-items:center;background:none;border:0;color:inherit;display:flex;font:inherit;outline:none;padding:var(--ck-spacing-standard);position:relative}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item:first-of-type .ck-presence-list__marker{border-top-left-radius:var(--ck-border-radius)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item:last-of-type .ck-presence-list__marker{border-bottom-left-radius:var(--ck-border-radius)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list .ck-user__full-name{color:var(--ck-color-base-text);margin-left:var(--ck-spacing-standard);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list .ck.ck-presence-list__marker{height:100%;left:0;margin:0;position:absolute;width:3px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}",""]);const o=s},535:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(433),s=n.n(r)()((function(e){return e[1]}));s.push([e.id,".ck .ck-user__marker-dot{border-radius:50%;cursor:default;display:block;height:var(--ck-user-dot-size);left:50%;position:absolute;top:calc((var(--ck-user-dot-size)/2)*-1);transform:translate(-50%,-50%);width:var(--ck-user-dot-size)}.ck .ck-user__marker-tooltip{color:#fff;display:none;font-family:Georgia,sans-serif;font-size:var(--ck-font-size-base);font-style:normal;font-weight:400;left:0;line-height:1;opacity:0;padding:var(--ck-spacing-small);position:absolute;top:-20px;transition:opacity .2s linear,transform .3s ease-in-out;white-space:nowrap;z-index:99999}.ck .ck-user__marker-line{bottom:0;height:100%;position:absolute;width:0}.ck .ck-user__marker{cursor:default;display:inline;position:relative}.ck .ck-user__marker.ck-user__marker_hovered .ck-user__marker-dot{width:0}.ck .ck-user__marker.ck-user__marker_hovered .ck-user__marker-tooltip{animation:fadeInLeft .3s ease-in-out;display:block;opacity:1}.ck .ck-placeholder .ck-user__marker{display:none}@keyframes fadeInLeft{0%{opacity:0;transform:translateX(-10px)}to{opacity:1;transform:translateX(0)}}",""]);const o=s},433:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var s={};if(r)for(var o=0;o<this.length;o++){var i=this[o][0];null!=i&&(s[i]=!0)}for(var a=0;a<e.length;a++){var c=[].concat(e[a]);r&&s[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},199:(e,t,n)=>{"use strict";e.exports=n(995)},995:(e,t,n)=>{"use strict";var r=t;function s(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(6),r.BufferWriter=n(623),r.Reader=n(366),r.BufferReader=n(895),r.util=n(737),r.rpc=n(178),r.roots=n(156),r.configure=s,s()},366:(e,t,n)=>{"use strict";e.exports=c;var r,s=n(737),o=s.LongBits,i=s.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var d,u="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},l=function(){return s.Buffer?function(e){return(c.create=function(e){return s.Buffer.isBuffer(e)?new r(e):u(e)})(e)}:u};function p(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new o(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}c.create=l(),c.prototype._slice=s.Array.prototype.subarray||s.Array.prototype.slice,c.prototype.uint32=(d=4294967295,function(){if(d=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return d;if(d=(d|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return d;if(d=(d|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return d;if(d=(d|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return d;if(d=(d|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return d;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return d}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return h(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|h(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=s.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=s.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw a(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,n);if(t===n){var r=s.Buffer;return r?r.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,n)},c.prototype.string=function(){var e=this.bytes();return i.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){r=e,c.create=l(),r._configure();var t=s.Long?"toLong":"toNumber";s.merge(c.prototype,{int64:function(){return p.call(this)[t](!1)},uint64:function(){return p.call(this)[t](!0)},sint64:function(){return p.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},895:(e,t,n)=>{"use strict";e.exports=o;var r=n(366);(o.prototype=Object.create(r.prototype)).constructor=o;var s=n(737);function o(e){r.call(this,e)}o._configure=function(){s.Buffer&&(o.prototype._slice=s.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},156:e=>{"use strict";e.exports={}},178:(e,t,n)=>{"use strict";t.Service=n(418)},418:(e,t,n)=>{"use strict";e.exports=s;var r=n(737);function s(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(s.prototype=Object.create(r.EventEmitter.prototype)).constructor=s,s.prototype.rpcCall=function e(t,n,s,o,i){if(!o)throw TypeError("request must be specified");var a=this;if(!i)return r.asPromise(e,a,t,n,s,o);if(a.rpcImpl)try{return a.rpcImpl(t,n[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,n){if(e)return a.emit("error",e,t),i(e);if(null!==n){if(!(n instanceof s))try{n=s[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return a.emit("error",e,t),i(e)}return a.emit("data",n,t),i(null,n)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){i(e)}),0)}else setTimeout((function(){i(Error("already ended"))}),0)},s.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},130:(e,t,n)=>{"use strict";e.exports=s;var r=n(737);function s(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=s.zero=new s(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var i=s.zeroHash="\0\0\0\0\0\0\0\0";s.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new s(n,r)},s.from=function(e){if("number"==typeof e)return s.fromNumber(e);if(r.isString(e)){if(!r.Long)return s.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new s(e.low>>>0,e.high>>>0):o},s.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},s.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;s.fromHash=function(e){return e===i?o:new s((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},s.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},s.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},s.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},s.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},737:function(e,t,n){"use strict";var r=t;function s(e,t,n){for(var r=Object.keys(t),s=0;s<r.length;++s)void 0!==e[r[s]]&&n||(e[r[s]]=t[r[s]]);return e}function o(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&s(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}r.asPromise=n(310),r.base64=n(662),r.EventEmitter=n(707),r.float=n(365),r.inquire=n(230),r.utf8=n(742),r.pool=n(319),r.LongBits=n(130),r.isNode=Boolean(void 0!==n.g&&n.g&&n.g.process&&n.g.process.versions&&n.g.process.versions.node),r.global=r.isNode&&n.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=s,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=o,r.ProtocolError=o("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},6:(e,t,n)=>{"use strict";e.exports=l;var r,s=n(737),o=s.LongBits,i=s.base64,a=s.utf8;function c(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function d(){}function u(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new c(d,0,0),this.tail=this.head,this.states=null}var p=function(){return s.Buffer?function(){return(l.create=function(){return new r})()}:function(){return new l}};function h(e,t,n){t[n]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function y(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}l.create=p(),l.alloc=function(e){return new s.Array(e)},s.Array!==Array&&(l.alloc=s.pool(l.alloc,s.Array.prototype.subarray)),l.prototype._push=function(e,t,n){return this.tail=this.tail.next=new c(e,t,n),this.len+=t,this},f.prototype=Object.create(c.prototype),f.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(m,10,o.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=o.from(e);return this._push(m,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(m,t.length(),t)},l.prototype.bool=function(e){return this._push(h,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=o.from(e);return this._push(y,4,t.lo)._push(y,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(s.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(s.float.writeDoubleLE,8,e)};var g=s.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};l.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(s.isString(e)){var n=l.alloc(t=i.length(e));i.decode(e,n,0),e=n}return this.uint32(t)._push(g,t,e)},l.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(h,1,0)},l.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new c(d,0,0),this.len=0,this},l.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 c(d,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},l._configure=function(e){r=e,l.create=p(),r._configure()}},623:(e,t,n)=>{"use strict";e.exports=o;var r=n(6);(o.prototype=Object.create(r.prototype)).constructor=o;var s=n(737);function o(){r.call(this)}function i(e,t,n){e.length<40?s.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}o._configure=function(){o.alloc=s._Buffer_allocUnsafe,o.writeBytesBuffer=s.Buffer&&s.Buffer.prototype instanceof Uint8Array&&"set"===s.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},o.prototype.bytes=function(e){s.isString(e)&&(e=s._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=s.Buffer.byteLength(e);return this.uint32(t),t&&this._push(i,t,e),this},o._configure()},553:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function r(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function s(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var r,o,i=[];for(o in"string"!=typeof t&&(t="?"),e)if(n.call(e,o)){if((r=e[o])||null!=r&&!isNaN(r)||(r=""),o=s(o),r=s(r),null===o||null===r)continue;i.push(o+"="+r)}return i.length?t+i.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,s={};t=n.exec(e);){var o=r(t[1]),i=r(t[2]);null===o||null===i||o in s||(s[o]=i)}return s}},696:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},673:(e,t,n)=>{"use strict";var r,s=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function a(e){for(var t=-1,n=0;n<i.length;n++)if(i[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},r=[],s=0;s<e.length;s++){var o=e[s],c=t.base?o[0]+t.base:o[0],d=n[c]||0,u="".concat(c," ").concat(d);n[c]=d+1;var l=a(u),p={css:o[1],media:o[2],sourceMap:o[3]};-1!==l?(i[l].references++,i[l].updater(p)):i.push({identifier:u,updater:y(p,t),references:1}),r.push(u)}return r}function d(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var s=n.nc;s&&(r.nonce=s)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var i=o(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var u,l=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function p(e,t,n,r){var s=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=l(t,s);else{var o=document.createTextNode(s),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(o,i[t]):e.appendChild(o)}}function h(e,t,n){var r=n.css,s=n.media,o=n.sourceMap;if(s?e.setAttribute("media",s):e.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var f=null,m=0;function y(e,t){var n,r,s;if(t.singleton){var o=m++;n=f||(f=d(t)),r=p.bind(null,n,o,!1),s=p.bind(null,n,o,!0)}else n=d(t),r=h.bind(null,n,t),s=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else s()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=s());var n=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var s=a(n[r]);i[s].references--}for(var o=c(e,t),d=0;d<n.length;d++){var u=a(n[d]);0===i[u].references&&(i[u].updater(),i.splice(u,1))}n=o}}}},835:(e,t,n)=>{"use strict";var r=n(696),s=n(553),o=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,d=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,u=/^[a-zA-Z]:/;function l(e){return(e||"").toString().replace(o,"")}var p=[["#","hash"],["?","query"],function(e,t){return m(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function f(e){var t,r=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},s={},o=typeof(e=e||r);if("blob:"===e.protocol)s=new g(unescape(e.pathname),{});else if("string"===o)for(t in s=new g(e,{}),h)delete s[t];else if("object"===o){for(t in e)t in h||(s[t]=e[t]);void 0===s.slashes&&(s.slashes=a.test(e.href))}return s}function m(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function y(e,t){e=(e=l(e)).replace(i,""),t=t||{};var n,r=d.exec(e),s=r[1]?r[1].toLowerCase():"",o=!!r[2],a=!!r[3],c=0;return o?a?(n=r[2]+r[3]+r[4],c=r[2].length+r[3].length):(n=r[2]+r[4],c=r[2].length):a?(n=r[3]+r[4],c=r[3].length):n=r[4],"file:"===s?c>=2&&(n=n.slice(2)):m(s)?n=r[4]:s?o&&(n=n.slice(2)):c>=2&&m(t.protocol)&&(n=r[4]),{protocol:s,slashes:o||m(s),slashesCount:c,rest:n}}function g(e,t,n){if(e=(e=l(e)).replace(i,""),!(this instanceof g))return new g(e,t,n);var o,a,c,d,h,b,O=p.slice(),w=typeof t,I=this,v=0;for("object"!==w&&"string"!==w&&(n=t,t=null),n&&"function"!=typeof n&&(n=s.parse),o=!(a=y(e||"",t=f(t))).protocol&&!a.slashes,I.slashes=a.slashes||o&&t.slashes,I.protocol=a.protocol||t.protocol||"",e=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||u.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!m(I.protocol)))&&(O[3]=[/(.*)/,"pathname"]);v<O.length;v++)"function"!=typeof(d=O[v])?(c=d[0],b=d[1],c!=c?I[b]=e:"string"==typeof c?~(h="@"===c?e.lastIndexOf(c):e.indexOf(c))&&("number"==typeof d[2]?(I[b]=e.slice(0,h),e=e.slice(h+d[2])):(I[b]=e.slice(h),e=e.slice(0,h))):(h=c.exec(e))&&(I[b]=h[1],e=e.slice(0,h.index)),I[b]=I[b]||o&&d[3]&&t[b]||"",d[4]&&(I[b]=I[b].toLowerCase())):e=d(e,I);n&&(I.query=n(I.query)),o&&t.slashes&&"/"!==I.pathname.charAt(0)&&(""!==I.pathname||""!==t.pathname)&&(I.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,s=n[r-1],o=!1,i=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),i++):i&&(0===r&&(o=!0),n.splice(r,1),i--);return o&&n.unshift(""),"."!==s&&".."!==s||n.push(""),n.join("/")}(I.pathname,t.pathname)),"/"!==I.pathname.charAt(0)&&m(I.protocol)&&(I.pathname="/"+I.pathname),r(I.port,I.protocol)||(I.host=I.hostname,I.port=""),I.username=I.password="",I.auth&&(~(h=I.auth.indexOf(":"))?(I.username=I.auth.slice(0,h),I.username=encodeURIComponent(decodeURIComponent(I.username)),I.password=I.auth.slice(h+1),I.password=encodeURIComponent(decodeURIComponent(I.password))):I.username=encodeURIComponent(decodeURIComponent(I.auth)),I.auth=I.password?I.username+":"+I.password:I.username),I.origin="file:"!==I.protocol&&m(I.protocol)&&I.host?I.protocol+"//"+I.host:"null",I.href=I.toString()}g.prototype={set:function(e,t,n){var o=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||s.parse)(t)),o[e]=t;break;case"port":o[e]=t,r(t,o.protocol)?t&&(o.host=o.hostname+":"+t):(o.host=o.hostname,o[e]="");break;case"hostname":o[e]=t,o.port&&(t+=":"+o.port),o.host=t;break;case"host":o[e]=t,c.test(t)?(t=t.split(":"),o.port=t.pop(),o.hostname=t.join(":")):(o.hostname=t,o.port="");break;case"protocol":o.protocol=t.toLowerCase(),o.slashes=!n;break;case"pathname":case"hash":if(t){var i="pathname"===e?"/":"#";o[e]=t.charAt(0)!==i?i+t:t}else o[e]=t;break;case"username":case"password":o[e]=encodeURIComponent(t);break;case"auth":var a=t.indexOf(":");~a?(o.username=t.slice(0,a),o.username=encodeURIComponent(decodeURIComponent(o.username)),o.password=t.slice(a+1),o.password=encodeURIComponent(decodeURIComponent(o.password))):o.username=encodeURIComponent(decodeURIComponent(t))}for(var d=0;d<p.length;d++){var u=p[d];u[4]&&(o[u[1]]=o[u[1]].toLowerCase())}return o.auth=o.password?o.username+":"+o.password:o.username,o.origin="file:"!==o.protocol&&m(o.protocol)&&o.host?o.protocol+"//"+o.host:"null",o.href=o.toString(),o},toString:function(e){e&&"function"==typeof e||(e=s.stringify);var t,n=this,r=n.host,o=n.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var i=o+(n.protocol&&n.slashes||m(n.protocol)?"//":"");return n.username?(i+=n.username,n.password&&(i+=":"+n.password),i+="@"):n.password?(i+=":"+n.password,i+="@"):"file:"!==n.protocol&&m(n.protocol)&&!r&&"/"!==n.pathname&&(i+="@"),(":"===r[r.length-1]||c.test(n.hostname)&&!n.port)&&(r+=":"),i+=r+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(i+=n.hash),i}},g.extractProtocol=y,g.location=f,g.trimLeft=l,g.qs=s,e.exports=g},211:(e,t,n)=>{e.exports=n(312)("./src/collaboration-core.js")},782:(e,t,n)=>{e.exports=n(237)("./src/core.js")},783:(e,t,n)=>{e.exports=n(237)("./src/engine.js")},311:(e,t,n)=>{e.exports=n(237)("./src/ui.js")},584:(e,t,n)=>{e.exports=n(237)("./src/utils.js")},312:e=>{"use strict";e.exports=CKEditor5.collaborationDll},237:e=>{"use strict";e.exports=CKEditor5.dll}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nc=void 0;var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CloudServicesCommentsAdapter:()=>uc,CloudServicesRevisionHistoryAdapter:()=>Dc,CloudServicesTrackChangesAdapter:()=>bc,PresenceList:()=>Id,RealTimeCollaborationClient:()=>$a,RealTimeCollaborativeComments:()=>Ac,RealTimeCollaborativeEditing:()=>ic,RealTimeCollaborativeRevisionHistory:()=>Bc,RealTimeCollaborativeTrackChanges:()=>kc});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{Decoder:()=>me,Encoder:()=>he,PacketType:()=>pe,protocol:()=>le});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{Decoder:()=>jt,Encoder:()=>Et});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{AttributeOperation:()=>Rr,Element:()=>Gr,InsertOperation:()=>Dr,MarkerOperation:()=>Nr,MergeOperation:()=>xr,MoveOperation:()=>Vr,Position:()=>qr,Range:()=>Lr,RenameOperation:()=>Mr,RootAttributeOperation:()=>Br,RootOperation:()=>Ur,SplitOperation:()=>Jr,default:()=>jr});var r=__webpack_require__(782),s=__webpack_require__(584),o=__webpack_require__(311),i=__webpack_require__(783);const a=Object.create(null);a.open="0",a.close="1",a.ping="2",a.pong="3",a.message="4",a.upgrade="5",a.noop="6";const c=Object.create(null);Object.keys(a).forEach((e=>{c[a[e]]=e}));const d={type:"error",data:"parser error"},u="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),l="function"==typeof ArrayBuffer,p=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)},h=({type:e,data:t},n,r)=>{return u&&t instanceof Blob?n?r(t):p(t,r):l&&(t instanceof ArrayBuffer||(s=t,"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer))?n?r(t):p(new Blob([t]),r):r(a[e]+(t||""));var s},f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)m[f.charCodeAt(e)]=e;const y="function"==typeof ArrayBuffer,g=(e,t)=>{if(y){const n=(e=>{let t,n,r,s,o,i=.75*e.length,a=e.length,c=0;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);const d=new ArrayBuffer(i),u=new Uint8Array(d);for(t=0;t<a;t+=4)n=m[e.charCodeAt(t)],r=m[e.charCodeAt(t+1)],s=m[e.charCodeAt(t+2)],o=m[e.charCodeAt(t+3)],u[c++]=n<<2|r>>4,u[c++]=(15&r)<<4|s>>2,u[c++]=(3&s)<<6|63&o;return d})(e);return b(n,t)}return{base64:!0,data:e}},b=(e,t)=>"blob"===t&&e instanceof ArrayBuffer?new Blob([e]):e,O=(e,t)=>{if("string"!=typeof e)return{type:"message",data:b(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:g(e.substring(1),t)};return c[n]?e.length>1?{type:c[n],data:e.substring(1)}:{type:c[n]}:d},w=String.fromCharCode(30);function I(e){if(e)return function(e){for(var t in I.prototype)e[t]=I.prototype[t];return e}(e)}I.prototype.on=I.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},I.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},I.prototype.off=I.prototype.removeListener=I.prototype.removeAllListeners=I.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<r.length;s++)if((n=r[s])===t||n.fn===t){r.splice(s,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},I.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var s=(n=n.slice(0)).length;r<s;++r)n[r].apply(this,t)}return this},I.prototype.emitReserved=I.prototype.emit,I.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},I.prototype.hasListeners=function(e){return!!this.listeners(e).length};const v="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function S(e,...t){return t.reduce(((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const A=v.setTimeout,P=v.clearTimeout;function T(e,t){t.useNativeTimers?(e.setTimeoutFn=A.bind(v),e.clearTimeoutFn=P.bind(v)):(e.setTimeoutFn=v.setTimeout.bind(v),e.clearTimeoutFn=v.clearTimeout.bind(v))}class _ extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class k extends I{constructor(e){super(),this.writable=!1,T(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new _(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=O(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}}const C="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),E=64,j={};let R,D=0,N=0;function x(e){let t="";do{t=C[e%E]+t,e=Math.floor(e/E)}while(e>0);return t}function V(){const e=x(+new Date);return e!==R?(D=0,R=e):e+"."+x(D++)}for(;N<E;N++)j[C[N]]=N;function M(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}let B=!1;try{B="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}const U=B;function J(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||U))return new XMLHttpRequest}catch(e){}if(!t)try{return new(v[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}function q(){}const L=null!=new J({xdomain:!1}).responseType;class G extends I{constructor(e,t){super(),T(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.create()}create(){const e=S(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const t=this.xhr=new J(e);try{t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&t.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(e){}if("POST"===this.method)try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{t.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{4===t.readyState&&(200===t.status||1223===t.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof t.status?t.status:0)}),0))},t.send(this.data)}catch(e){return void this.setTimeoutFn((()=>{this.onError(e)}),0)}"undefined"!=typeof document&&(this.index=G.requestsCount++,G.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=q,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete G.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(G.requestsCount=0,G.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",Y);else if("function"==typeof addEventListener){addEventListener("onpagehide"in v?"pagehide":"unload",Y,!1)}function Y(){for(let e in G.requests)G.requests.hasOwnProperty(e)&&G.requests[e].abort()}const z="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),F=v.WebSocket||v.MozWebSocket,H="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const K={websocket:class extends k{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,n=H?{}:S(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=H?new F(e,t,n):t?new F(e,t):new F(e)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType||"arraybuffer",this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;h(n,this.supportsBinary,(e=>{try{this.ws.send(e)}catch(e){}r&&z((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const t=this.opts.secure?"wss":"ws";let n="";this.opts.port&&("wss"===t&&443!==Number(this.opts.port)||"ws"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=V()),this.supportsBinary||(e.b64=1);const r=M(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}check(){return!!F}},polling:class extends k{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==t}const t=e&&e.forceBase64;this.supportsBinary=L&&!t}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(e++,this.once("pollComplete",(function(){--e||t()}))),this.writable||(e++,this.once("drain",(function(){--e||t()})))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const n=e.split(w),r=[];for(let e=0;e<n.length;e++){const s=O(n[e],t);if(r.push(s),"error"===s.type)break}return r})(e,this.socket.binaryType).forEach((e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach(((e,o)=>{h(e,!1,(e=>{r[o]=e,++s===n&&t(r.join(w))}))}))})(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){let e=this.query||{};const t=this.opts.secure?"https":"http";let n="";!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=V()),this.supportsBinary||e.sid||(e.b64=1),this.opts.port&&("https"===t&&443!==Number(this.opts.port)||"http"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port);const r=M(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new G(this.uri(),e)}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}},W=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Q=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Z(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=W.exec(e||""),o={},i=14;for(;i--;)o[Q[i]]=s[i]||"";return-1!=n&&-1!=r&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=function(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,o.path),o.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}(0,o.query),o}class $ extends I{constructor(e,t={}){super(),this.writeBuffer=[],e&&"object"==typeof e&&(t=e,e=null),e?(e=Z(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=Z(t.host).host),T(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},n=e.split("&");for(let e=0,r=n.length;e<r;e++){let r=n[e].split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new K[e](n)}open(){let e;if(this.opts.rememberUpgrade&&$.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(e){let t=this.createTransport(e),n=!1;$.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",(e=>{if(!n)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;$.priorWebsocketSuccess="websocket"===t.name,this.transport.pause((()=>{n||"closed"!==this.readyState&&(d(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}})))};function s(){n||(n=!0,d(),t.close(),t=null)}const o=e=>{const n=new Error("probe error: "+e);n.transport=t.name,s(),this.emitReserved("upgradeError",n)};function i(){o("transport closed")}function a(){o("socket closed")}function c(e){t&&e.name!==t.name&&s()}const d=()=>{t.removeListener("open",r),t.removeListener("error",o),t.removeListener("close",i),this.off("close",a),this.off("upgrading",c)};t.once("open",r),t.once("error",o),t.once("close",i),this.once("close",a),this.once("upgrading",c),t.open()}onOpen(){if(this.readyState="open",$.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let n=0;n<this.writeBuffer.length;n++){const r=this.writeBuffer[n].data;if(r&&(e+="string"==typeof(t=r)?function(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}(t):Math.ceil(1.33*(t.byteLength||t.size))),n>0&&e>this.maxPayload)return this.writeBuffer.slice(0,n);e+=2}var t;return this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const s={type:e,data:t,options:n};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(e){$.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let n=0;const r=e.length;for(;n<r;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}$.protocol=4;$.protocol;const X="function"==typeof ArrayBuffer,ee=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,te=Object.prototype.toString,ne="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===te.call(Blob),re="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===te.call(File);function se(e){return X&&(e instanceof ArrayBuffer||ee(e))||ne&&e instanceof Blob||re&&e instanceof File}function oe(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(oe(e[t]))return!0;return!1}if(se(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return oe(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&oe(e[t]))return!0;return!1}function ie(e){const t=[],n=e.data,r=e;return r.data=ae(n,t),r.attachments=t.length,{packet:r,buffers:t}}function ae(e,t){if(!e)return e;if(se(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=ae(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=ae(e[r],t));return n}return e}function ce(e,t){return e.data=de(e.data,t),delete e.attachments,e}function de(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=de(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=de(e[n],t));return e}const ue=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],le=5;var pe;!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(pe||(pe={}));class he{constructor(e){this.replacer=e}encode(e){return e.type!==pe.EVENT&&e.type!==pe.ACK||!oe(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===pe.EVENT?pe.BINARY_EVENT:pe.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==pe.BINARY_EVENT&&e.type!==pe.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=ie(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}}function fe(e){return"[object Object]"===Object.prototype.toString.call(e)}class me extends I{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===pe.BINARY_EVENT;n||t.type===pe.BINARY_ACK?(t.type=n?pe.EVENT:pe.ACK,this.reconstructor=new ye(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!se(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===pe[n.type])throw new Error("unknown packet type "+n.type);if(n.type===pe.BINARY_EVENT||n.type===pe.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const s=e.substring(r,t);if(s!=Number(s)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(s)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!me.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case pe.CONNECT:return fe(t);case pe.DISCONNECT:return void 0===t;case pe.CONNECT_ERROR:return"string"==typeof t||fe(t);case pe.EVENT:case pe.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===ue.indexOf(t[0]));case pe.ACK:case pe.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class ye{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=ce(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function ge(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const be=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Oe extends I{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[ge(e,"open",this.onopen.bind(this)),ge(e,"packet",this.onpacket.bind(this)),ge(e,"error",this.onerror.bind(this)),ge(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(be.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const n={type:pe.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[e]=t);const s=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,new Error("operation has timed out"))}),r);this.acks[e]=(...e)=>{this.io.clearTimeoutFn(s),t.apply(this,[null,...e])}}emitWithAck(e,...t){const n=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise(((r,s)=>{t.push(((e,t)=>n?e?s(e):r(t):r(e))),this.emit(e,...t)}))}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push(((e,...r)=>{if(n!==this._queue[0])return;return null!==e?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...r)),n.pending=!1,this._drainQueue()})),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth((e=>{this._sendConnectPacket(e)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:pe.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case pe.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case pe.EVENT:case pe.BINARY_EVENT:this.onevent(e);break;case pe.ACK:case pe.BINARY_ACK:this.onack(e);break;case pe.DISCONNECT:this.ondisconnect();break;case pe.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:pe.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:pe.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function we(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}we.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=1&Math.floor(10*t)?e+n:e-n}return 0|Math.min(e,this.max)},we.prototype.reset=function(){this.attempts=0},we.prototype.setMin=function(e){this.ms=e},we.prototype.setMax=function(e){this.max=e},we.prototype.setJitter=function(e){this.jitter=e};class Ie extends I{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&"object"==typeof t&&(n=t,t=void 0),(n=n||{}).path=n.path||"/socket.io",this.opts=n,T(this,n),this.reconnection(!1!==n.reconnection),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(r=n.randomizationFactor)&&void 0!==r?r:.5),this.backoff=new we({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==n.timeout?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||e;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=!1!==n.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new $(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=ge(t,"open",(function(){n.onopen(),e&&e()})),s=ge(t,"error",(t=>{n.cleanup(),n._readyState="closed",this.emitReserved("error",t),e?e(t):n.maybeReconnectOnOpen()}));if(!1!==this._timeout){const e=this._timeout;0===e&&r();const n=this.setTimeoutFn((()=>{r(),t.close(),t.emit("error",new Error("timeout"))}),e);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}return this.subs.push(r),this.subs.push(s),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(ge(e,"ping",this.onping.bind(this)),ge(e,"data",this.ondata.bind(this)),ge(e,"error",this.onerror.bind(this)),ge(e,"close",this.onclose.bind(this)),ge(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){z((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Oe(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const e of t){if(this.nsps[e].active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach((e=>e())),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn((()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()})))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const ve={};function Se(e,t){"object"==typeof e&&(t=e,e=void 0);const n=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),r=Z(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),r=n.source,s=n.id,o=n.path,i=ve[s]&&o in ve[s].nsps;let a;return t.forceNew||t["force new connection"]||!1===t.multiplex||i?a=new Ie(r,t):(ve[s]||(ve[s]=new Ie(r,t)),a=ve[s]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}Object.assign(Se,{Manager:Ie,Socket:Oe,io:Se,connect:Se});var Ae=__webpack_require__(835);class Pe{constructor(...e){}}class Te extends Pe{constructor(...e){super()}static fromJSON(e){throw new TypeError("Must be implemented in a child class!")}}Te.TYPE="1000";class _e extends Te{constructor(e,t,n){super(),this.type=e,this.socketId=t,this.data=n}toJSON(){return{type:this.type,socketId:this.socketId,data:this.data}}static fromJSON(e){return new _e(e.type,e.socketId,e.data)}}_e.DESCRIPTOR_NAME="ChannelMessage",_e.DESCRIPTOR={fields:{type:{type:"uint32",id:1},socketId:{type:"string",id:2},data:{type:"bytes",id:3}}};var ke=__webpack_require__(199);const Ce=ke.Reader,Ee=ke.Writer,je=ke.util,Re=ke.roots.default||(ke.roots.default={}),De=(Re.OperationMetadataDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.userId="",e.prototype.type="",e.prototype.createdAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(18).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(26).string(e.createdAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.OperationMetadataDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.userId=e.string();break;case 2:r.type=e.string();break;case 3:r.createdAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.userId&&e.hasOwnProperty("userId")&&!je.isString(e.userId)?"userId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!je.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!je.isString(e.createdAt)?"createdAt: string expected":null},e.fromObject=function(e){if(e instanceof Re.OperationMetadataDescriptor)return e;let t=new Re.OperationMetadataDescriptor;return null!=e.userId&&(t.userId=String(e.userId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.userId="",n.type="",n.createdAt=""),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/OperationMetadataDescriptor"},e})(),Re.CollaborativeEditingConnectMessage=(()=>{function e(e){if(this.buffers=[],this.types=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.bundleVersion="",e.prototype.buffers=je.emptyArray,e.prototype.types=je.emptyArray,e.prototype.lastOperationId="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(18).string(e.bundleVersion),null!=e.buffers&&e.buffers.length)for(let n=0;n<e.buffers.length;++n)t.uint32(26).bytes(e.buffers[n]);if(null!=e.types&&e.types.length){t.uint32(34).fork();for(let n=0;n<e.types.length;++n)t.uint32(e.types[n]);t.ldelim()}return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(42).string(e.lastOperationId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CollaborativeEditingConnectMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.bundleVersion=e.string();break;case 3:r.buffers&&r.buffers.length||(r.buffers=[]),r.buffers.push(e.bytes());break;case 4:if(r.types&&r.types.length||(r.types=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.types.push(e.uint32())}else r.types.push(e.uint32());break;case 5:r.lastOperationId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!je.isString(e.id))return"id: string expected";if(null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!je.isString(e.bundleVersion))return"bundleVersion: string expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(let t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||je.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)if(!je.isInteger(e.types[t]))return"types: integer[] expected"}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!je.isString(e.lastOperationId)?"lastOperationId: string expected":null},e.fromObject=function(e){if(e instanceof Re.CollaborativeEditingConnectMessage)return e;let t=new Re.CollaborativeEditingConnectMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingConnectMessage.buffers: array expected");t.buffers=[];for(let n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?je.base64.decode(e.buffers[n],t.buffers[n]=je.newBuffer(je.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingConnectMessage.types: array expected");t.types=[];for(let n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[]),t.defaults&&(n.id="",n.bundleVersion="",n.lastOperationId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),e.buffers&&e.buffers.length){n.buffers=[];for(let r=0;r<e.buffers.length;++r)n.buffers[r]=t.bytes===String?je.base64.encode(e.buffers[r],0,e.buffers[r].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[r]):e.buffers[r]}if(e.types&&e.types.length){n.types=[];for(let t=0;t<e.types.length;++t)n.types[t]=e.types[t]}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingConnectMessage"},e})(),Re.CollaborativeEditingReconnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.bundleVersion="",e.prototype.lastKnowVersion=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(18).string(e.bundleVersion),null!=e.lastKnowVersion&&Object.hasOwnProperty.call(e,"lastKnowVersion")&&t.uint32(24).uint32(e.lastKnowVersion),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CollaborativeEditingReconnectMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.bundleVersion=e.string();break;case 3:r.lastKnowVersion=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!je.isString(e.id)?"id: string expected":null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!je.isString(e.bundleVersion)?"bundleVersion: string expected":null!=e.lastKnowVersion&&e.hasOwnProperty("lastKnowVersion")&&!je.isInteger(e.lastKnowVersion)?"lastKnowVersion: integer expected":null},e.fromObject=function(e){if(e instanceof Re.CollaborativeEditingReconnectMessage)return e;let t=new Re.CollaborativeEditingReconnectMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),null!=e.lastKnowVersion&&(t.lastKnowVersion=e.lastKnowVersion>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.bundleVersion="",n.lastKnowVersion=0),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),null!=e.lastKnowVersion&&e.hasOwnProperty("lastKnowVersion")&&(n.lastKnowVersion=e.lastKnowVersion),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingReconnectMessage"},e})(),Re.CollaborativeEditingUpdateMessage=(()=>{function e(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.baseVersion=0,e.prototype.buffers=je.emptyArray,e.prototype.types=je.emptyArray,e.prototype.metadata=je.emptyArray,e.prototype.lastOperationId="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.baseVersion&&Object.hasOwnProperty.call(e,"baseVersion")&&t.uint32(16).uint32(e.baseVersion),null!=e.buffers&&e.buffers.length)for(let n=0;n<e.buffers.length;++n)t.uint32(26).bytes(e.buffers[n]);if(null!=e.types&&e.types.length){t.uint32(34).fork();for(let n=0;n<e.types.length;++n)t.uint32(e.types[n]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(let n=0;n<e.metadata.length;++n)Re.OperationMetadataDescriptor.encode(e.metadata[n],t.uint32(50).fork()).ldelim();return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(58).string(e.lastOperationId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CollaborativeEditingUpdateMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.baseVersion=e.uint32();break;case 3:r.buffers&&r.buffers.length||(r.buffers=[]),r.buffers.push(e.bytes());break;case 4:if(r.types&&r.types.length||(r.types=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.types.push(e.uint32())}else r.types.push(e.uint32());break;case 6:r.metadata&&r.metadata.length||(r.metadata=[]),r.metadata.push(Re.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 7:r.lastOperationId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!je.isString(e.id))return"id: string expected";if(null!=e.baseVersion&&e.hasOwnProperty("baseVersion")&&!je.isInteger(e.baseVersion))return"baseVersion: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(let t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||je.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)if(!je.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(let t=0;t<e.metadata.length;++t){let n=Re.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!je.isString(e.lastOperationId)?"lastOperationId: string expected":null},e.fromObject=function(e){if(e instanceof Re.CollaborativeEditingUpdateMessage)return e;let t=new Re.CollaborativeEditingUpdateMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.baseVersion&&(t.baseVersion=e.baseVersion>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingUpdateMessage.buffers: array expected");t.buffers=[];for(let n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?je.base64.decode(e.buffers[n],t.buffers[n]=je.newBuffer(je.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingUpdateMessage.types: array expected");t.types=[];for(let n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingUpdateMessage.metadata: array expected");t.metadata=[];for(let n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingUpdateMessage.metadata: object expected");t.metadata[n]=Re.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.id="",n.baseVersion=0,n.lastOperationId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.baseVersion&&e.hasOwnProperty("baseVersion")&&(n.baseVersion=e.baseVersion),e.buffers&&e.buffers.length){n.buffers=[];for(let r=0;r<e.buffers.length;++r)n.buffers[r]=t.bytes===String?je.base64.encode(e.buffers[r],0,e.buffers[r].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[r]):e.buffers[r]}if(e.types&&e.types.length){n.types=[];for(let t=0;t<e.types.length;++t)n.types[t]=e.types[t]}if(e.metadata&&e.metadata.length){n.metadata=[];for(let r=0;r<e.metadata.length;++r)n.metadata[r]=Re.OperationMetadataDescriptor.toObject(e.metadata[r],t)}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingUpdateMessage"},e})(),Re.GetDocumentDetailsMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.prototype.environmentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.environmentId&&Object.hasOwnProperty.call(e,"environmentId")&&t.uint32(18).string(e.environmentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.GetDocumentDetailsMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.documentId=e.string();break;case 2:r.environmentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId)?"documentId: string expected":null!=e.environmentId&&e.hasOwnProperty("environmentId")&&!je.isString(e.environmentId)?"environmentId: string expected":null},e.fromObject=function(e){if(e instanceof Re.GetDocumentDetailsMessage)return e;let t=new Re.GetDocumentDetailsMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.environmentId&&(t.environmentId=String(e.environmentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId="",n.environmentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.environmentId&&e.hasOwnProperty("environmentId")&&(n.environmentId=e.environmentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetDocumentDetailsMessage"},e})(),Re.CollaborativeEditingConnectResponse=(()=>{function e(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.channel="",e.prototype.offset=0,e.prototype.version=0,e.prototype.buffers=je.emptyArray,e.prototype.types=je.emptyArray,e.prototype.metadata=je.emptyArray,e.prototype.initData="",e.prototype.isInitialized=!1,e.prototype.sessionId="",e.prototype.lastOperationId="",e.prototype.sessionCreatedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.offset&&Object.hasOwnProperty.call(e,"offset")&&t.uint32(16).uint32(e.offset),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&t.uint32(24).uint32(e.version),null!=e.buffers&&e.buffers.length)for(let n=0;n<e.buffers.length;++n)t.uint32(34).bytes(e.buffers[n]);if(null!=e.types&&e.types.length){t.uint32(42).fork();for(let n=0;n<e.types.length;++n)t.uint32(e.types[n]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(let n=0;n<e.metadata.length;++n)Re.OperationMetadataDescriptor.encode(e.metadata[n],t.uint32(58).fork()).ldelim();return null!=e.initData&&Object.hasOwnProperty.call(e,"initData")&&t.uint32(66).string(e.initData),null!=e.isInitialized&&Object.hasOwnProperty.call(e,"isInitialized")&&t.uint32(72).bool(e.isInitialized),null!=e.sessionId&&Object.hasOwnProperty.call(e,"sessionId")&&t.uint32(82).string(e.sessionId),null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(90).string(e.lastOperationId),null!=e.sessionCreatedAt&&Object.hasOwnProperty.call(e,"sessionCreatedAt")&&t.uint32(98).string(e.sessionCreatedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CollaborativeEditingConnectResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.channel=e.string();break;case 2:r.offset=e.uint32();break;case 3:r.version=e.uint32();break;case 4:r.buffers&&r.buffers.length||(r.buffers=[]),r.buffers.push(e.bytes());break;case 5:if(r.types&&r.types.length||(r.types=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.types.push(e.uint32())}else r.types.push(e.uint32());break;case 7:r.metadata&&r.metadata.length||(r.metadata=[]),r.metadata.push(Re.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 8:r.initData=e.string();break;case 9:r.isInitialized=e.bool();break;case 10:r.sessionId=e.string();break;case 11:r.lastOperationId=e.string();break;case 12:r.sessionCreatedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!je.isString(e.channel))return"channel: string expected";if(null!=e.offset&&e.hasOwnProperty("offset")&&!je.isInteger(e.offset))return"offset: integer expected";if(null!=e.version&&e.hasOwnProperty("version")&&!je.isInteger(e.version))return"version: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(let t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||je.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)if(!je.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(let t=0;t<e.metadata.length;++t){let n=Re.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.initData&&e.hasOwnProperty("initData")&&!je.isString(e.initData)?"initData: string expected":null!=e.isInitialized&&e.hasOwnProperty("isInitialized")&&"boolean"!=typeof e.isInitialized?"isInitialized: boolean expected":null!=e.sessionId&&e.hasOwnProperty("sessionId")&&!je.isString(e.sessionId)?"sessionId: string expected":null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!je.isString(e.lastOperationId)?"lastOperationId: string expected":null!=e.sessionCreatedAt&&e.hasOwnProperty("sessionCreatedAt")&&!je.isString(e.sessionCreatedAt)?"sessionCreatedAt: string expected":null},e.fromObject=function(e){if(e instanceof Re.CollaborativeEditingConnectResponse)return e;let t=new Re.CollaborativeEditingConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),null!=e.offset&&(t.offset=e.offset>>>0),null!=e.version&&(t.version=e.version>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingConnectResponse.buffers: array expected");t.buffers=[];for(let n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?je.base64.decode(e.buffers[n],t.buffers[n]=je.newBuffer(je.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingConnectResponse.types: array expected");t.types=[];for(let n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingConnectResponse.metadata: array expected");t.metadata=[];for(let n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingConnectResponse.metadata: object expected");t.metadata[n]=Re.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.initData&&(t.initData=String(e.initData)),null!=e.isInitialized&&(t.isInitialized=Boolean(e.isInitialized)),null!=e.sessionId&&(t.sessionId=String(e.sessionId)),null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),null!=e.sessionCreatedAt&&(t.sessionCreatedAt=String(e.sessionCreatedAt)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.channel="",n.offset=0,n.version=0,n.initData="",n.isInitialized=!1,n.sessionId="",n.lastOperationId="",n.sessionCreatedAt=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),null!=e.offset&&e.hasOwnProperty("offset")&&(n.offset=e.offset),null!=e.version&&e.hasOwnProperty("version")&&(n.version=e.version),e.buffers&&e.buffers.length){n.buffers=[];for(let r=0;r<e.buffers.length;++r)n.buffers[r]=t.bytes===String?je.base64.encode(e.buffers[r],0,e.buffers[r].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[r]):e.buffers[r]}if(e.types&&e.types.length){n.types=[];for(let t=0;t<e.types.length;++t)n.types[t]=e.types[t]}if(e.metadata&&e.metadata.length){n.metadata=[];for(let r=0;r<e.metadata.length;++r)n.metadata[r]=Re.OperationMetadataDescriptor.toObject(e.metadata[r],t)}return null!=e.initData&&e.hasOwnProperty("initData")&&(n.initData=e.initData),null!=e.isInitialized&&e.hasOwnProperty("isInitialized")&&(n.isInitialized=e.isInitialized),null!=e.sessionId&&e.hasOwnProperty("sessionId")&&(n.sessionId=e.sessionId),null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),null!=e.sessionCreatedAt&&e.hasOwnProperty("sessionCreatedAt")&&(n.sessionCreatedAt=e.sessionCreatedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingConnectResponse"},e})(),Re.CollaborativeEditingResponse=(()=>{function e(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.version=0,e.prototype.buffers=je.emptyArray,e.prototype.types=je.emptyArray,e.prototype.metadata=je.emptyArray,e.prototype.lastOperationId="",e.prototype.lastOperationAcceptedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&t.uint32(8).uint32(e.version),null!=e.buffers&&e.buffers.length)for(let n=0;n<e.buffers.length;++n)t.uint32(18).bytes(e.buffers[n]);if(null!=e.types&&e.types.length){t.uint32(26).fork();for(let n=0;n<e.types.length;++n)t.uint32(e.types[n]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(let n=0;n<e.metadata.length;++n)Re.OperationMetadataDescriptor.encode(e.metadata[n],t.uint32(42).fork()).ldelim();return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(50).string(e.lastOperationId),null!=e.lastOperationAcceptedAt&&Object.hasOwnProperty.call(e,"lastOperationAcceptedAt")&&t.uint32(58).string(e.lastOperationAcceptedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CollaborativeEditingResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.version=e.uint32();break;case 2:r.buffers&&r.buffers.length||(r.buffers=[]),r.buffers.push(e.bytes());break;case 3:if(r.types&&r.types.length||(r.types=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.types.push(e.uint32())}else r.types.push(e.uint32());break;case 5:r.metadata&&r.metadata.length||(r.metadata=[]),r.metadata.push(Re.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 6:r.lastOperationId=e.string();break;case 7:r.lastOperationAcceptedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.version&&e.hasOwnProperty("version")&&!je.isInteger(e.version))return"version: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(let t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||je.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)if(!je.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(let t=0;t<e.metadata.length;++t){let n=Re.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!je.isString(e.lastOperationId)?"lastOperationId: string expected":null!=e.lastOperationAcceptedAt&&e.hasOwnProperty("lastOperationAcceptedAt")&&!je.isString(e.lastOperationAcceptedAt)?"lastOperationAcceptedAt: string expected":null},e.fromObject=function(e){if(e instanceof Re.CollaborativeEditingResponse)return e;let t=new Re.CollaborativeEditingResponse;if(null!=e.version&&(t.version=e.version>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingResponse.buffers: array expected");t.buffers=[];for(let n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?je.base64.decode(e.buffers[n],t.buffers[n]=je.newBuffer(je.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingResponse.types: array expected");t.types=[];for(let n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingResponse.metadata: array expected");t.metadata=[];for(let n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingResponse.metadata: object expected");t.metadata[n]=Re.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),null!=e.lastOperationAcceptedAt&&(t.lastOperationAcceptedAt=String(e.lastOperationAcceptedAt)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.version=0,n.lastOperationId="",n.lastOperationAcceptedAt=""),null!=e.version&&e.hasOwnProperty("version")&&(n.version=e.version),e.buffers&&e.buffers.length){n.buffers=[];for(let r=0;r<e.buffers.length;++r)n.buffers[r]=t.bytes===String?je.base64.encode(e.buffers[r],0,e.buffers[r].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[r]):e.buffers[r]}if(e.types&&e.types.length){n.types=[];for(let t=0;t<e.types.length;++t)n.types[t]=e.types[t]}if(e.metadata&&e.metadata.length){n.metadata=[];for(let r=0;r<e.metadata.length;++r)n.metadata[r]=Re.OperationMetadataDescriptor.toObject(e.metadata[r],t)}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),null!=e.lastOperationAcceptedAt&&e.hasOwnProperty("lastOperationAcceptedAt")&&(n.lastOperationAcceptedAt=e.lastOperationAcceptedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingResponse"},e})(),Re.GetDocumentDetailsResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.lastDocumentSessionId="",e.prototype.lastDocumentSessionOperationId="",e.prototype.currentDocumentSessionId="",e.prototype.currentDocumentSessionVersion=0,e.prototype.currentDocumentSessionOperationId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.lastDocumentSessionId&&Object.hasOwnProperty.call(e,"lastDocumentSessionId")&&t.uint32(10).string(e.lastDocumentSessionId),null!=e.lastDocumentSessionOperationId&&Object.hasOwnProperty.call(e,"lastDocumentSessionOperationId")&&t.uint32(18).string(e.lastDocumentSessionOperationId),null!=e.currentDocumentSessionId&&Object.hasOwnProperty.call(e,"currentDocumentSessionId")&&t.uint32(26).string(e.currentDocumentSessionId),null!=e.currentDocumentSessionVersion&&Object.hasOwnProperty.call(e,"currentDocumentSessionVersion")&&t.uint32(32).uint32(e.currentDocumentSessionVersion),null!=e.currentDocumentSessionOperationId&&Object.hasOwnProperty.call(e,"currentDocumentSessionOperationId")&&t.uint32(42).string(e.currentDocumentSessionOperationId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.GetDocumentDetailsResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.lastDocumentSessionId=e.string();break;case 2:r.lastDocumentSessionOperationId=e.string();break;case 3:r.currentDocumentSessionId=e.string();break;case 4:r.currentDocumentSessionVersion=e.uint32();break;case 5:r.currentDocumentSessionOperationId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.lastDocumentSessionId&&e.hasOwnProperty("lastDocumentSessionId")&&!je.isString(e.lastDocumentSessionId)?"lastDocumentSessionId: string expected":null!=e.lastDocumentSessionOperationId&&e.hasOwnProperty("lastDocumentSessionOperationId")&&!je.isString(e.lastDocumentSessionOperationId)?"lastDocumentSessionOperationId: string expected":null!=e.currentDocumentSessionId&&e.hasOwnProperty("currentDocumentSessionId")&&!je.isString(e.currentDocumentSessionId)?"currentDocumentSessionId: string expected":null!=e.currentDocumentSessionVersion&&e.hasOwnProperty("currentDocumentSessionVersion")&&!je.isInteger(e.currentDocumentSessionVersion)?"currentDocumentSessionVersion: integer expected":null!=e.currentDocumentSessionOperationId&&e.hasOwnProperty("currentDocumentSessionOperationId")&&!je.isString(e.currentDocumentSessionOperationId)?"currentDocumentSessionOperationId: string expected":null},e.fromObject=function(e){if(e instanceof Re.GetDocumentDetailsResponse)return e;let t=new Re.GetDocumentDetailsResponse;return null!=e.lastDocumentSessionId&&(t.lastDocumentSessionId=String(e.lastDocumentSessionId)),null!=e.lastDocumentSessionOperationId&&(t.lastDocumentSessionOperationId=String(e.lastDocumentSessionOperationId)),null!=e.currentDocumentSessionId&&(t.currentDocumentSessionId=String(e.currentDocumentSessionId)),null!=e.currentDocumentSessionVersion&&(t.currentDocumentSessionVersion=e.currentDocumentSessionVersion>>>0),null!=e.currentDocumentSessionOperationId&&(t.currentDocumentSessionOperationId=String(e.currentDocumentSessionOperationId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.lastDocumentSessionId="",n.lastDocumentSessionOperationId="",n.currentDocumentSessionId="",n.currentDocumentSessionVersion=0,n.currentDocumentSessionOperationId=""),null!=e.lastDocumentSessionId&&e.hasOwnProperty("lastDocumentSessionId")&&(n.lastDocumentSessionId=e.lastDocumentSessionId),null!=e.lastDocumentSessionOperationId&&e.hasOwnProperty("lastDocumentSessionOperationId")&&(n.lastDocumentSessionOperationId=e.lastDocumentSessionOperationId),null!=e.currentDocumentSessionId&&e.hasOwnProperty("currentDocumentSessionId")&&(n.currentDocumentSessionId=e.currentDocumentSessionId),null!=e.currentDocumentSessionVersion&&e.hasOwnProperty("currentDocumentSessionVersion")&&(n.currentDocumentSessionVersion=e.currentDocumentSessionVersion),null!=e.currentDocumentSessionOperationId&&e.hasOwnProperty("currentDocumentSessionOperationId")&&(n.currentDocumentSessionOperationId=e.currentDocumentSessionOperationId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetDocumentDetailsResponse"},e})(),Re.CommentDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentId="",e.prototype.commentThreadId="",e.prototype.userId="",e.prototype.content="",e.prototype.documentId="",e.prototype.createdAt="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(10).string(e.commentId),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(18).string(e.commentThreadId),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(26).string(e.userId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(34).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(42).string(e.documentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CommentDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentId=e.string();break;case 2:r.commentThreadId=e.string();break;case 3:r.userId=e.string();break;case 4:r.content=e.string();break;case 5:r.documentId=e.string();break;case 6:r.createdAt=e.string();break;case 7:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!je.isString(e.commentId)?"commentId: string expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!je.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.userId&&e.hasOwnProperty("userId")&&!je.isString(e.userId)?"userId: string expected":null!=e.content&&e.hasOwnProperty("content")&&!je.isString(e.content)?"content: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId)?"documentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!je.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!je.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof Re.CommentDescriptor)return e;let t=new Re.CommentDescriptor;return null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentId="",n.commentThreadId="",n.userId="",n.content="",n.documentId="",n.createdAt="",n.attributes=""),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentDescriptor"},e})(),Re.CommentsThreadDescriptor=(()=>{function e(e){if(this.comments=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.comments=je.emptyArray,e.prototype.resolvedAt="",e.prototype.resolvedBy="",e.prototype.context="",e.prototype.createdAt="",e.prototype.deletedAt="",e.prototype.attributes="",e.prototype.unlinkedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.comments&&e.comments.length)for(let n=0;n<e.comments.length;++n)Re.CommentDescriptor.encode(e.comments[n],t.uint32(18).fork()).ldelim();return null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(26).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(34).string(e.resolvedBy),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(42).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(58).string(e.deletedAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),null!=e.unlinkedAt&&Object.hasOwnProperty.call(e,"unlinkedAt")&&t.uint32(74).string(e.unlinkedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CommentsThreadDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.comments&&r.comments.length||(r.comments=[]),r.comments.push(Re.CommentDescriptor.decode(e,e.uint32()));break;case 3:r.resolvedAt=e.string();break;case 4:r.resolvedBy=e.string();break;case 5:r.context=e.string();break;case 6:r.createdAt=e.string();break;case 7:r.deletedAt=e.string();break;case 8:r.attributes=e.string();break;case 9:r.unlinkedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!je.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(let t=0;t<e.comments.length;++t){let n=Re.CommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!je.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!je.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.context&&e.hasOwnProperty("context")&&!je.isString(e.context)?"context: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!je.isString(e.createdAt)?"createdAt: string expected":null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!je.isString(e.deletedAt)?"deletedAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!je.isString(e.attributes)?"attributes: string expected":null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&!je.isString(e.unlinkedAt)?"unlinkedAt: string expected":null},e.fromObject=function(e){if(e instanceof Re.CommentsThreadDescriptor)return e;let t=new Re.CommentsThreadDescriptor;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsThreadDescriptor.comments: array expected");t.comments=[];for(let n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsThreadDescriptor.comments: object expected");t.comments[n]=Re.CommentDescriptor.fromObject(e.comments[n])}}return null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.unlinkedAt&&(t.unlinkedAt=String(e.unlinkedAt)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.commentThreadId="",n.resolvedAt="",n.resolvedBy="",n.context="",n.createdAt="",n.deletedAt="",n.attributes="",n.unlinkedAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),e.comments&&e.comments.length){n.comments=[];for(let r=0;r<e.comments.length;++r)n.comments[r]=Re.CommentDescriptor.toObject(e.comments[r],t)}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&(n.unlinkedAt=e.unlinkedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsThreadDescriptor"},e})(),Re.CommentThreadAddedCommentDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentId="",e.prototype.createdAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(10).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(18).string(e.createdAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CommentThreadAddedCommentDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentId=e.string();break;case 2:r.createdAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!je.isString(e.commentId)?"commentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!je.isString(e.createdAt)?"createdAt: string expected":null},e.fromObject=function(e){if(e instanceof Re.CommentThreadAddedCommentDescriptor)return e;let t=new Re.CommentThreadAddedCommentDescriptor;return null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentId="",n.createdAt=""),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentThreadAddedCommentDescriptor"},e})(),Re.CommentsV2AddCommentMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.content="",e.prototype.documentId="",e.prototype.commentId="",e.prototype.createdAt="",e.prototype.userId="",e.prototype.attributes="",e.prototype.commentThread=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(18).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(26).string(e.documentId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(34).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(42).string(e.createdAt),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(50).string(e.userId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.commentThread&&Object.hasOwnProperty.call(e,"commentThread")&&Re.CommentsThreadDescriptor.encode(e.commentThread,t.uint32(66).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CommentsV2AddCommentMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.content=e.string();break;case 3:r.documentId=e.string();break;case 4:r.commentId=e.string();break;case 5:r.createdAt=e.string();break;case 6:r.userId=e.string();break;case 7:r.attributes=e.string();break;case 8:r.commentThread=Re.CommentsThreadDescriptor.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!je.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.content&&e.hasOwnProperty("content")&&!je.isString(e.content))return"content: string expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId))return"documentId: string expected";if(null!=e.commentId&&e.hasOwnProperty("commentId")&&!je.isString(e.commentId))return"commentId: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!je.isString(e.createdAt))return"createdAt: string expected";if(null!=e.userId&&e.hasOwnProperty("userId")&&!je.isString(e.userId))return"userId: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!je.isString(e.attributes))return"attributes: string expected";if(null!=e.commentThread&&e.hasOwnProperty("commentThread")){let t=Re.CommentsThreadDescriptor.verify(e.commentThread);if(t)return"commentThread."+t}return null},e.fromObject=function(e){if(e instanceof Re.CommentsV2AddCommentMessage)return e;let t=new Re.CommentsV2AddCommentMessage;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.commentThread){if("object"!=typeof e.commentThread)throw TypeError(".CommentsV2AddCommentMessage.commentThread: object expected");t.commentThread=Re.CommentsThreadDescriptor.fromObject(e.commentThread)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.content="",n.documentId="",n.commentId="",n.createdAt="",n.userId="",n.attributes="",n.commentThread=null),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.commentThread&&e.hasOwnProperty("commentThread")&&(n.commentThread=Re.CommentsThreadDescriptor.toObject(e.commentThread,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentMessage"},e})(),Re.CommentsV2AddCommentThreadMessage=(()=>{function e(e){if(this.comments=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.prototype.commentThreadId="",e.prototype.context="",e.prototype.createdAt="",e.prototype.resolvedAt="",e.prototype.resolvedBy="",e.prototype.attributes="",e.prototype.deletedAt="",e.prototype.comments=je.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(18).string(e.commentThreadId),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(26).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(42).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(50).string(e.resolvedBy),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(66).string(e.deletedAt),null!=e.comments&&e.comments.length)for(let n=0;n<e.comments.length;++n)Re.CommentDescriptor.encode(e.comments[n],t.uint32(74).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CommentsV2AddCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.documentId=e.string();break;case 2:r.commentThreadId=e.string();break;case 3:r.context=e.string();break;case 4:r.createdAt=e.string();break;case 5:r.resolvedAt=e.string();break;case 6:r.resolvedBy=e.string();break;case 7:r.attributes=e.string();break;case 8:r.deletedAt=e.string();break;case 9:r.comments&&r.comments.length||(r.comments=[]),r.comments.push(Re.CommentDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId))return"documentId: string expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!je.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.context&&e.hasOwnProperty("context")&&!je.isString(e.context))return"context: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!je.isString(e.createdAt))return"createdAt: string expected";if(null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!je.isString(e.resolvedAt))return"resolvedAt: string expected";if(null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!je.isString(e.resolvedBy))return"resolvedBy: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!je.isString(e.attributes))return"attributes: string expected";if(null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!je.isString(e.deletedAt))return"deletedAt: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(let t=0;t<e.comments.length;++t){let n=Re.CommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null},e.fromObject=function(e){if(e instanceof Re.CommentsV2AddCommentThreadMessage)return e;let t=new Re.CommentsV2AddCommentThreadMessage;if(null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2AddCommentThreadMessage.comments: array expected");t.comments=[];for(let n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsV2AddCommentThreadMessage.comments: object expected");t.comments[n]=Re.CommentDescriptor.fromObject(e.comments[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.documentId="",n.commentThreadId="",n.context="",n.createdAt="",n.resolvedAt="",n.resolvedBy="",n.attributes="",n.deletedAt=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),e.comments&&e.comments.length){n.comments=[];for(let r=0;r<e.comments.length;++r)n.comments[r]=Re.CommentDescriptor.toObject(e.comments[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentThreadMessage"},e})(),Re.CommentsV2ReopenCommentThreadMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CommentsV2ReopenCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!je.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof Re.CommentsV2ReopenCommentThreadMessage)return e;let t=new Re.CommentsV2ReopenCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ReopenCommentThreadMessage"},e})(),Re.CommentsV2ResolveCommentThreadMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.prototype.resolvedBy="",e.prototype.resolvedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(26).string(e.resolvedBy),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(34).string(e.resolvedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CommentsV2ResolveCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;case 3:r.resolvedBy=e.string();break;case 4:r.resolvedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!je.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId)?"documentId: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!je.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!je.isString(e.resolvedAt)?"resolvedAt: string expected":null},e.fromObject=function(e){if(e instanceof Re.CommentsV2ResolveCommentThreadMessage)return e;let t=new Re.CommentsV2ResolveCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.resolvedBy="",n.resolvedAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ResolveCommentThreadMessage"},e})(),Re.CommentsV2UpdateCommentThreadMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.prototype.context="",e.prototype.attributes="",e.prototype.unlinkedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(26).string(e.context),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(34).string(e.attributes),null!=e.unlinkedAt&&Object.hasOwnProperty.call(e,"unlinkedAt")&&t.uint32(42).string(e.unlinkedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CommentsV2UpdateCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;case 3:r.context=e.string();break;case 4:r.attributes=e.string();break;case 5:r.unlinkedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!je.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId)?"documentId: string expected":null!=e.context&&e.hasOwnProperty("context")&&!je.isString(e.context)?"context: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!je.isString(e.attributes)?"attributes: string expected":null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&!je.isString(e.unlinkedAt)?"unlinkedAt: string expected":null},e.fromObject=function(e){if(e instanceof Re.CommentsV2UpdateCommentThreadMessage)return e;let t=new Re.CommentsV2UpdateCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.context&&(t.context=String(e.context)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.unlinkedAt&&(t.unlinkedAt=String(e.unlinkedAt)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.context="",n.attributes="",n.unlinkedAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&(n.unlinkedAt=e.unlinkedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2UpdateCommentThreadMessage"},e})(),Re.CommentsV2ConnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CommentsV2ConnectMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.documentId=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof Re.CommentsV2ConnectMessage)return e;let t=new Re.CommentsV2ConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ConnectMessage"},e})(),Re.CommentsV2GetCommentThreadMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CommentsV2GetCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!je.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof Re.CommentsV2GetCommentThreadMessage)return e;let t=new Re.CommentsV2GetCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetCommentThreadMessage"},e})(),Re.CommentsV2GetDocumentThreadsMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CommentsV2GetDocumentThreadsMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.documentId=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof Re.CommentsV2GetDocumentThreadsMessage)return e;let t=new Re.CommentsV2GetDocumentThreadsMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetDocumentThreadsMessage"},e})(),Re.CommentsV2RemoveCommentMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.commentId="",e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(26).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CommentsV2RemoveCommentMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.commentId=e.string();break;case 3:r.documentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!je.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!je.isString(e.commentId)?"commentId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof Re.CommentsV2RemoveCommentMessage)return e;let t=new Re.CommentsV2RemoveCommentMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2RemoveCommentMessage"},e})(),Re.CommentsV2RemoveCommentThreadMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CommentsV2RemoveCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!je.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof Re.CommentsV2RemoveCommentThreadMessage)return e;let t=new Re.CommentsV2RemoveCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2RemoveCommentThreadMessage"},e})(),Re.CommentsV2UpdateCommentMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.commentId="",e.prototype.content="",e.prototype.documentId="",e.prototype.attributes="",e.prototype.isAttributesUpdated=!1,e.prototype.commentThread=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(26).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(34).string(e.documentId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(42).string(e.attributes),null!=e.isAttributesUpdated&&Object.hasOwnProperty.call(e,"isAttributesUpdated")&&t.uint32(48).bool(e.isAttributesUpdated),null!=e.commentThread&&Object.hasOwnProperty.call(e,"commentThread")&&Re.CommentsThreadDescriptor.encode(e.commentThread,t.uint32(58).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CommentsV2UpdateCommentMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.commentId=e.string();break;case 3:r.content=e.string();break;case 4:r.documentId=e.string();break;case 5:r.attributes=e.string();break;case 6:r.isAttributesUpdated=e.bool();break;case 7:r.commentThread=Re.CommentsThreadDescriptor.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!je.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.commentId&&e.hasOwnProperty("commentId")&&!je.isString(e.commentId))return"commentId: string expected";if(null!=e.content&&e.hasOwnProperty("content")&&!je.isString(e.content))return"content: string expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId))return"documentId: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!je.isString(e.attributes))return"attributes: string expected";if(null!=e.isAttributesUpdated&&e.hasOwnProperty("isAttributesUpdated")&&"boolean"!=typeof e.isAttributesUpdated)return"isAttributesUpdated: boolean expected";if(null!=e.commentThread&&e.hasOwnProperty("commentThread")){let t=Re.CommentsThreadDescriptor.verify(e.commentThread);if(t)return"commentThread."+t}return null},e.fromObject=function(e){if(e instanceof Re.CommentsV2UpdateCommentMessage)return e;let t=new Re.CommentsV2UpdateCommentMessage;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.isAttributesUpdated&&(t.isAttributesUpdated=Boolean(e.isAttributesUpdated)),null!=e.commentThread){if("object"!=typeof e.commentThread)throw TypeError(".CommentsV2UpdateCommentMessage.commentThread: object expected");t.commentThread=Re.CommentsThreadDescriptor.fromObject(e.commentThread)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.content="",n.documentId="",n.attributes="",n.isAttributesUpdated=!1,n.commentThread=null),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.isAttributesUpdated&&e.hasOwnProperty("isAttributesUpdated")&&(n.isAttributesUpdated=e.isAttributesUpdated),null!=e.commentThread&&e.hasOwnProperty("commentThread")&&(n.commentThread=Re.CommentsThreadDescriptor.toObject(e.commentThread,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2UpdateCommentMessage"},e})(),Re.CommentsV2AddCommentResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.commentId="",e.prototype.createdAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(26).string(e.createdAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CommentsV2AddCommentResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.commentId=e.string();break;case 3:r.createdAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!je.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!je.isString(e.commentId)?"commentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!je.isString(e.createdAt)?"createdAt: string expected":null},e.fromObject=function(e){if(e instanceof Re.CommentsV2AddCommentResponse)return e;let t=new Re.CommentsV2AddCommentResponse;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.createdAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentResponse"},e})(),Re.CommentsV2AddCommentThreadResponse=(()=>{function e(e){if(this.comments=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.createdAt="",e.prototype.comments=je.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(18).string(e.createdAt),null!=e.comments&&e.comments.length)for(let n=0;n<e.comments.length;++n)Re.CommentThreadAddedCommentDescriptor.encode(e.comments[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CommentsV2AddCommentThreadResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.createdAt=e.string();break;case 3:r.comments&&r.comments.length||(r.comments=[]),r.comments.push(Re.CommentThreadAddedCommentDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!je.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!je.isString(e.createdAt))return"createdAt: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(let t=0;t<e.comments.length;++t){let n=Re.CommentThreadAddedCommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null},e.fromObject=function(e){if(e instanceof Re.CommentsV2AddCommentThreadResponse)return e;let t=new Re.CommentsV2AddCommentThreadResponse;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2AddCommentThreadResponse.comments: array expected");t.comments=[];for(let n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsV2AddCommentThreadResponse.comments: object expected");t.comments[n]=Re.CommentThreadAddedCommentDescriptor.fromObject(e.comments[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.commentThreadId="",n.createdAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),e.comments&&e.comments.length){n.comments=[];for(let r=0;r<e.comments.length;++r)n.comments[r]=Re.CommentThreadAddedCommentDescriptor.toObject(e.comments[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentThreadResponse"},e})(),Re.CommentsV2ResolveCommentThreadResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.prototype.resolvedAt="",e.prototype.resolvedBy="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(26).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(34).string(e.resolvedBy),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CommentsV2ResolveCommentThreadResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;case 3:r.resolvedAt=e.string();break;case 4:r.resolvedBy=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!je.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId)?"documentId: string expected":null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!je.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!je.isString(e.resolvedBy)?"resolvedBy: string expected":null},e.fromObject=function(e){if(e instanceof Re.CommentsV2ResolveCommentThreadResponse)return e;let t=new Re.CommentsV2ResolveCommentThreadResponse;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.resolvedAt="",n.resolvedBy=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ResolveCommentThreadResponse"},e})(),Re.CommentsV2ConnectResponse=(()=>{function e(e){if(this.threads=[],this.threadsV2=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.channel="",e.prototype.threads=je.emptyArray,e.prototype.threadsV2=je.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.threads&&e.threads.length)for(let n=0;n<e.threads.length;++n)t.uint32(18).string(e.threads[n]);if(null!=e.threadsV2&&e.threadsV2.length)for(let n=0;n<e.threadsV2.length;++n)Re.CommentsThreadDescriptor.encode(e.threadsV2[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CommentsV2ConnectResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.channel=e.string();break;case 2:r.threads&&r.threads.length||(r.threads=[]),r.threads.push(e.string());break;case 3:r.threadsV2&&r.threadsV2.length||(r.threadsV2=[]),r.threadsV2.push(Re.CommentsThreadDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!je.isString(e.channel))return"channel: string expected";if(null!=e.threads&&e.hasOwnProperty("threads")){if(!Array.isArray(e.threads))return"threads: array expected";for(let t=0;t<e.threads.length;++t)if(!je.isString(e.threads[t]))return"threads: string[] expected"}if(null!=e.threadsV2&&e.hasOwnProperty("threadsV2")){if(!Array.isArray(e.threadsV2))return"threadsV2: array expected";for(let t=0;t<e.threadsV2.length;++t){let n=Re.CommentsThreadDescriptor.verify(e.threadsV2[t]);if(n)return"threadsV2."+n}}return null},e.fromObject=function(e){if(e instanceof Re.CommentsV2ConnectResponse)return e;let t=new Re.CommentsV2ConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.threads){if(!Array.isArray(e.threads))throw TypeError(".CommentsV2ConnectResponse.threads: array expected");t.threads=[];for(let n=0;n<e.threads.length;++n)t.threads[n]=String(e.threads[n])}if(e.threadsV2){if(!Array.isArray(e.threadsV2))throw TypeError(".CommentsV2ConnectResponse.threadsV2: array expected");t.threadsV2=[];for(let n=0;n<e.threadsV2.length;++n){if("object"!=typeof e.threadsV2[n])throw TypeError(".CommentsV2ConnectResponse.threadsV2: object expected");t.threadsV2[n]=Re.CommentsThreadDescriptor.fromObject(e.threadsV2[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.threads=[],n.threadsV2=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.threads&&e.threads.length){n.threads=[];for(let t=0;t<e.threads.length;++t)n.threads[t]=e.threads[t]}if(e.threadsV2&&e.threadsV2.length){n.threadsV2=[];for(let r=0;r<e.threadsV2.length;++r)n.threadsV2[r]=Re.CommentsThreadDescriptor.toObject(e.threadsV2[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ConnectResponse"},e})(),Re.CommentsV2GetCommentThreadResponse=(()=>{function e(e){if(this.comments=[],this.commentsV2=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.comments=je.emptyArray,e.prototype.commentsV2=je.emptyArray,e.prototype.resolvedAt="",e.prototype.resolvedBy="",e.prototype.context="",e.prototype.createdAt="",e.prototype.deletedAt="",e.prototype.attributes="",e.prototype.unlinkedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.comments&&e.comments.length)for(let n=0;n<e.comments.length;++n)t.uint32(18).string(e.comments[n]);if(null!=e.commentsV2&&e.commentsV2.length)for(let n=0;n<e.commentsV2.length;++n)Re.CommentDescriptor.encode(e.commentsV2[n],t.uint32(26).fork()).ldelim();return null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(34).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(42).string(e.resolvedBy),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(50).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(58).string(e.createdAt),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(66).string(e.deletedAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(74).string(e.attributes),null!=e.unlinkedAt&&Object.hasOwnProperty.call(e,"unlinkedAt")&&t.uint32(82).string(e.unlinkedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CommentsV2GetCommentThreadResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.comments&&r.comments.length||(r.comments=[]),r.comments.push(e.string());break;case 3:r.commentsV2&&r.commentsV2.length||(r.commentsV2=[]),r.commentsV2.push(Re.CommentDescriptor.decode(e,e.uint32()));break;case 4:r.resolvedAt=e.string();break;case 5:r.resolvedBy=e.string();break;case 6:r.context=e.string();break;case 7:r.createdAt=e.string();break;case 8:r.deletedAt=e.string();break;case 9:r.attributes=e.string();break;case 10:r.unlinkedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!je.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(let t=0;t<e.comments.length;++t)if(!je.isString(e.comments[t]))return"comments: string[] expected"}if(null!=e.commentsV2&&e.hasOwnProperty("commentsV2")){if(!Array.isArray(e.commentsV2))return"commentsV2: array expected";for(let t=0;t<e.commentsV2.length;++t){let n=Re.CommentDescriptor.verify(e.commentsV2[t]);if(n)return"commentsV2."+n}}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!je.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!je.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.context&&e.hasOwnProperty("context")&&!je.isString(e.context)?"context: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!je.isString(e.createdAt)?"createdAt: string expected":null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!je.isString(e.deletedAt)?"deletedAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!je.isString(e.attributes)?"attributes: string expected":null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&!je.isString(e.unlinkedAt)?"unlinkedAt: string expected":null},e.fromObject=function(e){if(e instanceof Re.CommentsV2GetCommentThreadResponse)return e;let t=new Re.CommentsV2GetCommentThreadResponse;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2GetCommentThreadResponse.comments: array expected");t.comments=[];for(let n=0;n<e.comments.length;++n)t.comments[n]=String(e.comments[n])}if(e.commentsV2){if(!Array.isArray(e.commentsV2))throw TypeError(".CommentsV2GetCommentThreadResponse.commentsV2: array expected");t.commentsV2=[];for(let n=0;n<e.commentsV2.length;++n){if("object"!=typeof e.commentsV2[n])throw TypeError(".CommentsV2GetCommentThreadResponse.commentsV2: object expected");t.commentsV2[n]=Re.CommentDescriptor.fromObject(e.commentsV2[n])}}return null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.unlinkedAt&&(t.unlinkedAt=String(e.unlinkedAt)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.comments=[],n.commentsV2=[]),t.defaults&&(n.commentThreadId="",n.resolvedAt="",n.resolvedBy="",n.context="",n.createdAt="",n.deletedAt="",n.attributes="",n.unlinkedAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),e.comments&&e.comments.length){n.comments=[];for(let t=0;t<e.comments.length;++t)n.comments[t]=e.comments[t]}if(e.commentsV2&&e.commentsV2.length){n.commentsV2=[];for(let r=0;r<e.commentsV2.length;++r)n.commentsV2[r]=Re.CommentDescriptor.toObject(e.commentsV2[r],t)}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&(n.unlinkedAt=e.unlinkedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetCommentThreadResponse"},e})(),Re.CommentsV2GetDocumentThreadsResponse=(()=>{function e(e){if(this.threads=[],this.threadsV2=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.threads=je.emptyArray,e.prototype.threadsV2=je.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.threads&&e.threads.length)for(let n=0;n<e.threads.length;++n)t.uint32(10).string(e.threads[n]);if(null!=e.threadsV2&&e.threadsV2.length)for(let n=0;n<e.threadsV2.length;++n)Re.CommentsThreadDescriptor.encode(e.threadsV2[n],t.uint32(18).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.CommentsV2GetDocumentThreadsResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.threads&&r.threads.length||(r.threads=[]),r.threads.push(e.string());break;case 2:r.threadsV2&&r.threadsV2.length||(r.threadsV2=[]),r.threadsV2.push(Re.CommentsThreadDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.threads&&e.hasOwnProperty("threads")){if(!Array.isArray(e.threads))return"threads: array expected";for(let t=0;t<e.threads.length;++t)if(!je.isString(e.threads[t]))return"threads: string[] expected"}if(null!=e.threadsV2&&e.hasOwnProperty("threadsV2")){if(!Array.isArray(e.threadsV2))return"threadsV2: array expected";for(let t=0;t<e.threadsV2.length;++t){let n=Re.CommentsThreadDescriptor.verify(e.threadsV2[t]);if(n)return"threadsV2."+n}}return null},e.fromObject=function(e){if(e instanceof Re.CommentsV2GetDocumentThreadsResponse)return e;let t=new Re.CommentsV2GetDocumentThreadsResponse;if(e.threads){if(!Array.isArray(e.threads))throw TypeError(".CommentsV2GetDocumentThreadsResponse.threads: array expected");t.threads=[];for(let n=0;n<e.threads.length;++n)t.threads[n]=String(e.threads[n])}if(e.threadsV2){if(!Array.isArray(e.threadsV2))throw TypeError(".CommentsV2GetDocumentThreadsResponse.threadsV2: array expected");t.threadsV2=[];for(let n=0;n<e.threadsV2.length;++n){if("object"!=typeof e.threadsV2[n])throw TypeError(".CommentsV2GetDocumentThreadsResponse.threadsV2: object expected");t.threadsV2[n]=Re.CommentsThreadDescriptor.fromObject(e.threadsV2[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.threads=[],n.threadsV2=[]),e.threads&&e.threads.length){n.threads=[];for(let t=0;t<e.threads.length;++t)n.threads[t]=e.threads[t]}if(e.threadsV2&&e.threadsV2.length){n.threadsV2=[];for(let r=0;r<e.threadsV2.length;++r)n.threadsV2[r]=Re.CommentsThreadDescriptor.toObject(e.threadsV2[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetDocumentThreadsResponse"},e})(),Re.KeyValueDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.key="",e.prototype.value="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(10).string(e.key),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(18).string(e.value),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.KeyValueDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.key=e.string();break;case 2:r.value=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!je.isString(e.key)?"key: string expected":null!=e.value&&e.hasOwnProperty("value")&&!je.isString(e.value)?"value: string expected":null},e.fromObject=function(e){if(e instanceof Re.KeyValueDescriptor)return e;let t=new Re.KeyValueDescriptor;return null!=e.key&&(t.key=String(e.key)),null!=e.value&&(t.value=String(e.value)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.key="",n.value=""),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.value&&e.hasOwnProperty("value")&&(n.value=e.value),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/KeyValueDescriptor"},e})(),Re.IsEditorBundleUploadedMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.bundleVersion="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(10).string(e.bundleVersion),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.IsEditorBundleUploadedMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.bundleVersion=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!je.isString(e.bundleVersion)?"bundleVersion: string expected":null},e.fromObject=function(e){if(e instanceof Re.IsEditorBundleUploadedMessage)return e;let t=new Re.IsEditorBundleUploadedMessage;return null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.bundleVersion=""),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/IsEditorBundleUploadedMessage"},e})(),Re.IsEditorBundleUploadedResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.isUploaded=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.isUploaded&&Object.hasOwnProperty.call(e,"isUploaded")&&t.uint32(8).bool(e.isUploaded),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.IsEditorBundleUploadedResponse;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.isUploaded=e.bool():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.isUploaded&&e.hasOwnProperty("isUploaded")&&"boolean"!=typeof e.isUploaded?"isUploaded: boolean expected":null},e.fromObject=function(e){if(e instanceof Re.IsEditorBundleUploadedResponse)return e;let t=new Re.IsEditorBundleUploadedResponse;return null!=e.isUploaded&&(t.isUploaded=Boolean(e.isUploaded)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.isUploaded=!1),null!=e.isUploaded&&e.hasOwnProperty("isUploaded")&&(n.isUploaded=e.isUploaded),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/IsEditorBundleUploadedResponse"},e})(),Re.RevisionDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.revisionId="",e.prototype.name="",e.prototype.creatorId="",e.prototype.authorsIds="",e.prototype.diffData="",e.prototype.createdAt="",e.prototype.attributes="",e.prototype.toVersion=0,e.prototype.fromVersion=0,e.prototype.isEmptyCurrent=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(10).string(e.revisionId),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(18).string(e.name),null!=e.creatorId&&Object.hasOwnProperty.call(e,"creatorId")&&t.uint32(26).string(e.creatorId),null!=e.authorsIds&&Object.hasOwnProperty.call(e,"authorsIds")&&t.uint32(34).string(e.authorsIds),null!=e.diffData&&Object.hasOwnProperty.call(e,"diffData")&&t.uint32(42).string(e.diffData),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.toVersion&&Object.hasOwnProperty.call(e,"toVersion")&&t.uint32(64).uint32(e.toVersion),null!=e.fromVersion&&Object.hasOwnProperty.call(e,"fromVersion")&&t.uint32(72).uint32(e.fromVersion),null!=e.isEmptyCurrent&&Object.hasOwnProperty.call(e,"isEmptyCurrent")&&t.uint32(80).bool(e.isEmptyCurrent),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.RevisionDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.revisionId=e.string();break;case 2:r.name=e.string();break;case 3:r.creatorId=e.string();break;case 4:r.authorsIds=e.string();break;case 5:r.diffData=e.string();break;case 6:r.createdAt=e.string();break;case 7:r.attributes=e.string();break;case 8:r.toVersion=e.uint32();break;case 9:r.fromVersion=e.uint32();break;case 10:r.isEmptyCurrent=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!je.isString(e.revisionId)?"revisionId: string expected":null!=e.name&&e.hasOwnProperty("name")&&!je.isString(e.name)?"name: string expected":null!=e.creatorId&&e.hasOwnProperty("creatorId")&&!je.isString(e.creatorId)?"creatorId: string expected":null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&!je.isString(e.authorsIds)?"authorsIds: string expected":null!=e.diffData&&e.hasOwnProperty("diffData")&&!je.isString(e.diffData)?"diffData: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!je.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!je.isString(e.attributes)?"attributes: string expected":null!=e.toVersion&&e.hasOwnProperty("toVersion")&&!je.isInteger(e.toVersion)?"toVersion: integer expected":null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&!je.isInteger(e.fromVersion)?"fromVersion: integer expected":null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof e.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},e.fromObject=function(e){if(e instanceof Re.RevisionDescriptor)return e;let t=new Re.RevisionDescriptor;return null!=e.revisionId&&(t.revisionId=String(e.revisionId)),null!=e.name&&(t.name=String(e.name)),null!=e.creatorId&&(t.creatorId=String(e.creatorId)),null!=e.authorsIds&&(t.authorsIds=String(e.authorsIds)),null!=e.diffData&&(t.diffData=String(e.diffData)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.toVersion&&(t.toVersion=e.toVersion>>>0),null!=e.fromVersion&&(t.fromVersion=e.fromVersion>>>0),null!=e.isEmptyCurrent&&(t.isEmptyCurrent=Boolean(e.isEmptyCurrent)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.revisionId="",n.name="",n.creatorId="",n.authorsIds="",n.diffData="",n.createdAt="",n.attributes="",n.toVersion=0,n.fromVersion=0,n.isEmptyCurrent=!1),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.creatorId&&e.hasOwnProperty("creatorId")&&(n.creatorId=e.creatorId),null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&(n.authorsIds=e.authorsIds),null!=e.diffData&&e.hasOwnProperty("diffData")&&(n.diffData=e.diffData),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.toVersion&&e.hasOwnProperty("toVersion")&&(n.toVersion=e.toVersion),null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&(n.fromVersion=e.fromVersion),null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&(n.isEmptyCurrent=e.isEmptyCurrent),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionDescriptor"},e})(),Re.RevisionHistoryConnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.RevisionHistoryConnectMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.documentId=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof Re.RevisionHistoryConnectMessage)return e;let t=new Re.RevisionHistoryConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryConnectMessage"},e})(),Re.RevisionHistoryGetRevisionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.prototype.revisionId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(18).string(e.revisionId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.RevisionHistoryGetRevisionMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.documentId=e.string();break;case 2:r.revisionId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId)?"documentId: string expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!je.isString(e.revisionId)?"revisionId: string expected":null},e.fromObject=function(e){if(e instanceof Re.RevisionHistoryGetRevisionMessage)return e;let t=new Re.RevisionHistoryGetRevisionMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.revisionId&&(t.revisionId=String(e.revisionId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId="",n.revisionId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryGetRevisionMessage"},e})(),Re.RevisionHistoryReconnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.prototype.requestId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.RevisionHistoryReconnectMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.documentId=e.string();break;case 2:r.requestId=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId)?"documentId: string expected":null!=e.requestId&&e.hasOwnProperty("requestId")&&!je.isInteger(e.requestId)?"requestId: integer expected":null},e.fromObject=function(e){if(e instanceof Re.RevisionHistoryReconnectMessage)return e;let t=new Re.RevisionHistoryReconnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.requestId&&(t.requestId=e.requestId>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId="",n.requestId=0),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryReconnectMessage"},e})(),Re.RevisionHistoryUpdateRevisionsMessage=(()=>{function e(e){if(this.revisions=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.prototype.requestId=0,e.prototype.revisions=je.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),null!=e.revisions&&e.revisions.length)for(let n=0;n<e.revisions.length;++n)Re.RevisionDescriptor.encode(e.revisions[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.RevisionHistoryUpdateRevisionsMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.documentId=e.string();break;case 2:r.requestId=e.uint32();break;case 3:r.revisions&&r.revisions.length||(r.revisions=[]),r.revisions.push(Re.RevisionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId))return"documentId: string expected";if(null!=e.requestId&&e.hasOwnProperty("requestId")&&!je.isInteger(e.requestId))return"requestId: integer expected";if(null!=e.revisions&&e.hasOwnProperty("revisions")){if(!Array.isArray(e.revisions))return"revisions: array expected";for(let t=0;t<e.revisions.length;++t){let n=Re.RevisionDescriptor.verify(e.revisions[t]);if(n)return"revisions."+n}}return null},e.fromObject=function(e){if(e instanceof Re.RevisionHistoryUpdateRevisionsMessage)return e;let t=new Re.RevisionHistoryUpdateRevisionsMessage;if(null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.requestId&&(t.requestId=e.requestId>>>0),e.revisions){if(!Array.isArray(e.revisions))throw TypeError(".RevisionHistoryUpdateRevisionsMessage.revisions: array expected");t.revisions=[];for(let n=0;n<e.revisions.length;++n){if("object"!=typeof e.revisions[n])throw TypeError(".RevisionHistoryUpdateRevisionsMessage.revisions: object expected");t.revisions[n]=Re.RevisionDescriptor.fromObject(e.revisions[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.revisions=[]),t.defaults&&(n.documentId="",n.requestId=0),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),e.revisions&&e.revisions.length){n.revisions=[];for(let r=0;r<e.revisions.length;++r)n.revisions[r]=Re.RevisionDescriptor.toObject(e.revisions[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryUpdateRevisionsMessage"},e})(),Re.RevisionHistoryConnectResponse=(()=>{function e(e){if(this.revisions=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.channel="",e.prototype.requestId=0,e.prototype.revisions=je.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),null!=e.revisions&&e.revisions.length)for(let n=0;n<e.revisions.length;++n)Re.RevisionDescriptor.encode(e.revisions[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.RevisionHistoryConnectResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.channel=e.string();break;case 2:r.requestId=e.uint32();break;case 3:r.revisions&&r.revisions.length||(r.revisions=[]),r.revisions.push(Re.RevisionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!je.isString(e.channel))return"channel: string expected";if(null!=e.requestId&&e.hasOwnProperty("requestId")&&!je.isInteger(e.requestId))return"requestId: integer expected";if(null!=e.revisions&&e.hasOwnProperty("revisions")){if(!Array.isArray(e.revisions))return"revisions: array expected";for(let t=0;t<e.revisions.length;++t){let n=Re.RevisionDescriptor.verify(e.revisions[t]);if(n)return"revisions."+n}}return null},e.fromObject=function(e){if(e instanceof Re.RevisionHistoryConnectResponse)return e;let t=new Re.RevisionHistoryConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),null!=e.requestId&&(t.requestId=e.requestId>>>0),e.revisions){if(!Array.isArray(e.revisions))throw TypeError(".RevisionHistoryConnectResponse.revisions: array expected");t.revisions=[];for(let n=0;n<e.revisions.length;++n){if("object"!=typeof e.revisions[n])throw TypeError(".RevisionHistoryConnectResponse.revisions: object expected");t.revisions[n]=Re.RevisionDescriptor.fromObject(e.revisions[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.revisions=[]),t.defaults&&(n.channel="",n.requestId=0),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),e.revisions&&e.revisions.length){n.revisions=[];for(let r=0;r<e.revisions.length;++r)n.revisions[r]=Re.RevisionDescriptor.toObject(e.revisions[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryConnectResponse"},e})(),Re.RevisionHistoryGetRevisionResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.revisionId="",e.prototype.name="",e.prototype.creatorId="",e.prototype.authorsIds="",e.prototype.diffData="",e.prototype.createdAt="",e.prototype.attributes="",e.prototype.toVersion=0,e.prototype.fromVersion=0,e.prototype.isEmptyCurrent=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(10).string(e.revisionId),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(18).string(e.name),null!=e.creatorId&&Object.hasOwnProperty.call(e,"creatorId")&&t.uint32(26).string(e.creatorId),null!=e.authorsIds&&Object.hasOwnProperty.call(e,"authorsIds")&&t.uint32(34).string(e.authorsIds),null!=e.diffData&&Object.hasOwnProperty.call(e,"diffData")&&t.uint32(42).string(e.diffData),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.toVersion&&Object.hasOwnProperty.call(e,"toVersion")&&t.uint32(64).uint32(e.toVersion),null!=e.fromVersion&&Object.hasOwnProperty.call(e,"fromVersion")&&t.uint32(72).uint32(e.fromVersion),null!=e.isEmptyCurrent&&Object.hasOwnProperty.call(e,"isEmptyCurrent")&&t.uint32(80).bool(e.isEmptyCurrent),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.RevisionHistoryGetRevisionResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.revisionId=e.string();break;case 2:r.name=e.string();break;case 3:r.creatorId=e.string();break;case 4:r.authorsIds=e.string();break;case 5:r.diffData=e.string();break;case 6:r.createdAt=e.string();break;case 7:r.attributes=e.string();break;case 8:r.toVersion=e.uint32();break;case 9:r.fromVersion=e.uint32();break;case 10:r.isEmptyCurrent=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!je.isString(e.revisionId)?"revisionId: string expected":null!=e.name&&e.hasOwnProperty("name")&&!je.isString(e.name)?"name: string expected":null!=e.creatorId&&e.hasOwnProperty("creatorId")&&!je.isString(e.creatorId)?"creatorId: string expected":null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&!je.isString(e.authorsIds)?"authorsIds: string expected":null!=e.diffData&&e.hasOwnProperty("diffData")&&!je.isString(e.diffData)?"diffData: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!je.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!je.isString(e.attributes)?"attributes: string expected":null!=e.toVersion&&e.hasOwnProperty("toVersion")&&!je.isInteger(e.toVersion)?"toVersion: integer expected":null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&!je.isInteger(e.fromVersion)?"fromVersion: integer expected":null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof e.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},e.fromObject=function(e){if(e instanceof Re.RevisionHistoryGetRevisionResponse)return e;let t=new Re.RevisionHistoryGetRevisionResponse;return null!=e.revisionId&&(t.revisionId=String(e.revisionId)),null!=e.name&&(t.name=String(e.name)),null!=e.creatorId&&(t.creatorId=String(e.creatorId)),null!=e.authorsIds&&(t.authorsIds=String(e.authorsIds)),null!=e.diffData&&(t.diffData=String(e.diffData)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.toVersion&&(t.toVersion=e.toVersion>>>0),null!=e.fromVersion&&(t.fromVersion=e.fromVersion>>>0),null!=e.isEmptyCurrent&&(t.isEmptyCurrent=Boolean(e.isEmptyCurrent)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.revisionId="",n.name="",n.creatorId="",n.authorsIds="",n.diffData="",n.createdAt="",n.attributes="",n.toVersion=0,n.fromVersion=0,n.isEmptyCurrent=!1),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.creatorId&&e.hasOwnProperty("creatorId")&&(n.creatorId=e.creatorId),null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&(n.authorsIds=e.authorsIds),null!=e.diffData&&e.hasOwnProperty("diffData")&&(n.diffData=e.diffData),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.toVersion&&e.hasOwnProperty("toVersion")&&(n.toVersion=e.toVersion),null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&(n.fromVersion=e.fromVersion),null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&(n.isEmptyCurrent=e.isEmptyCurrent),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryGetRevisionResponse"},e})(),Re.RevisionHistoryUpdateRevisionsResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.requestId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(8).uint32(e.requestId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.RevisionHistoryUpdateRevisionsResponse;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.requestId=e.uint32():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.requestId&&e.hasOwnProperty("requestId")&&!je.isInteger(e.requestId)?"requestId: integer expected":null},e.fromObject=function(e){if(e instanceof Re.RevisionHistoryUpdateRevisionsResponse)return e;let t=new Re.RevisionHistoryUpdateRevisionsResponse;return null!=e.requestId&&(t.requestId=e.requestId>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.requestId=0),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryUpdateRevisionsResponse"},e})(),Re.SessionsSocketDescriptor=(()=>{function e(e){if(this.permissions=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.session="",e.prototype.user="",e.prototype.role="",e.prototype.permissions=je.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.session&&Object.hasOwnProperty.call(e,"session")&&t.uint32(10).string(e.session),null!=e.user&&Object.hasOwnProperty.call(e,"user")&&t.uint32(18).string(e.user),null!=e.role&&Object.hasOwnProperty.call(e,"role")&&t.uint32(26).string(e.role),null!=e.permissions&&e.permissions.length)for(let n=0;n<e.permissions.length;++n)t.uint32(34).string(e.permissions[n]);return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.SessionsSocketDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.session=e.string();break;case 2:r.user=e.string();break;case 3:r.role=e.string();break;case 4:r.permissions&&r.permissions.length||(r.permissions=[]),r.permissions.push(e.string());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.session&&e.hasOwnProperty("session")&&!je.isString(e.session))return"session: string expected";if(null!=e.user&&e.hasOwnProperty("user")&&!je.isString(e.user))return"user: string expected";if(null!=e.role&&e.hasOwnProperty("role")&&!je.isString(e.role))return"role: string expected";if(null!=e.permissions&&e.hasOwnProperty("permissions")){if(!Array.isArray(e.permissions))return"permissions: array expected";for(let t=0;t<e.permissions.length;++t)if(!je.isString(e.permissions[t]))return"permissions: string[] expected"}return null},e.fromObject=function(e){if(e instanceof Re.SessionsSocketDescriptor)return e;let t=new Re.SessionsSocketDescriptor;if(null!=e.session&&(t.session=String(e.session)),null!=e.user&&(t.user=String(e.user)),null!=e.role&&(t.role=String(e.role)),e.permissions){if(!Array.isArray(e.permissions))throw TypeError(".SessionsSocketDescriptor.permissions: array expected");t.permissions=[];for(let n=0;n<e.permissions.length;++n)t.permissions[n]=String(e.permissions[n])}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.permissions=[]),t.defaults&&(n.session="",n.user="",n.role=""),null!=e.session&&e.hasOwnProperty("session")&&(n.session=e.session),null!=e.user&&e.hasOwnProperty("user")&&(n.user=e.user),null!=e.role&&e.hasOwnProperty("role")&&(n.role=e.role),e.permissions&&e.permissions.length){n.permissions=[];for(let t=0;t<e.permissions.length;++t)n.permissions[t]=e.permissions[t]}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsSocketDescriptor"},e})(),Re.SessionsConnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.sessionType=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.sessionType&&Object.hasOwnProperty.call(e,"sessionType")&&t.uint32(16).uint32(e.sessionType),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.SessionsConnectMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.sessionType=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!je.isString(e.id)?"id: string expected":null!=e.sessionType&&e.hasOwnProperty("sessionType")&&!je.isInteger(e.sessionType)?"sessionType: integer expected":null},e.fromObject=function(e){if(e instanceof Re.SessionsConnectMessage)return e;let t=new Re.SessionsConnectMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.sessionType&&(t.sessionType=e.sessionType>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.sessionType=0),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.sessionType&&e.hasOwnProperty("sessionType")&&(n.sessionType=e.sessionType),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsConnectMessage"},e})(),Re.SocketConnectMessage=(()=>{function e(e){if(this.permissions=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.userId="",e.prototype.role="",e.prototype.permissions=je.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),null!=e.role&&Object.hasOwnProperty.call(e,"role")&&t.uint32(26).string(e.role),null!=e.permissions&&e.permissions.length)for(let n=0;n<e.permissions.length;++n)t.uint32(34).string(e.permissions[n]);return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.SocketConnectMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.userId=e.string();break;case 3:r.role=e.string();break;case 4:r.permissions&&r.permissions.length||(r.permissions=[]),r.permissions.push(e.string());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!je.isString(e.id))return"id: string expected";if(null!=e.userId&&e.hasOwnProperty("userId")&&!je.isString(e.userId))return"userId: string expected";if(null!=e.role&&e.hasOwnProperty("role")&&!je.isString(e.role))return"role: string expected";if(null!=e.permissions&&e.hasOwnProperty("permissions")){if(!Array.isArray(e.permissions))return"permissions: array expected";for(let t=0;t<e.permissions.length;++t)if(!je.isString(e.permissions[t]))return"permissions: string[] expected"}return null},e.fromObject=function(e){if(e instanceof Re.SocketConnectMessage)return e;let t=new Re.SocketConnectMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.role&&(t.role=String(e.role)),e.permissions){if(!Array.isArray(e.permissions))throw TypeError(".SocketConnectMessage.permissions: array expected");t.permissions=[];for(let n=0;n<e.permissions.length;++n)t.permissions[n]=String(e.permissions[n])}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.permissions=[]),t.defaults&&(n.id="",n.userId="",n.role=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.role&&e.hasOwnProperty("role")&&(n.role=e.role),e.permissions&&e.permissions.length){n.permissions=[];for(let t=0;t<e.permissions.length;++t)n.permissions[t]=e.permissions[t]}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SocketConnectMessage"},e})(),Re.SocketDisconnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.SocketDisconnectMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.id=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!je.isString(e.id)?"id: string expected":null},e.fromObject=function(e){if(e instanceof Re.SocketDisconnectMessage)return e;let t=new Re.SocketDisconnectMessage;return null!=e.id&&(t.id=String(e.id)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SocketDisconnectMessage"},e})(),Re.SessionsConnectResponse=(()=>{function e(e){if(this.sockets=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.channel="",e.prototype.sockets=je.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.sockets&&e.sockets.length)for(let n=0;n<e.sockets.length;++n)Re.SessionsSocketDescriptor.encode(e.sockets[n],t.uint32(18).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.SessionsConnectResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.channel=e.string();break;case 2:r.sockets&&r.sockets.length||(r.sockets=[]),r.sockets.push(Re.SessionsSocketDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!je.isString(e.channel))return"channel: string expected";if(null!=e.sockets&&e.hasOwnProperty("sockets")){if(!Array.isArray(e.sockets))return"sockets: array expected";for(let t=0;t<e.sockets.length;++t){let n=Re.SessionsSocketDescriptor.verify(e.sockets[t]);if(n)return"sockets."+n}}return null},e.fromObject=function(e){if(e instanceof Re.SessionsConnectResponse)return e;let t=new Re.SessionsConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.sockets){if(!Array.isArray(e.sockets))throw TypeError(".SessionsConnectResponse.sockets: array expected");t.sockets=[];for(let n=0;n<e.sockets.length;++n){if("object"!=typeof e.sockets[n])throw TypeError(".SessionsConnectResponse.sockets: object expected");t.sockets[n]=Re.SessionsSocketDescriptor.fromObject(e.sockets[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.sockets=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.sockets&&e.sockets.length){n.sockets=[];for(let r=0;r<e.sockets.length;++r)n.sockets[r]=Re.SessionsSocketDescriptor.toObject(e.sockets[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsConnectResponse"},e})(),Re.SuggestionDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.authorId="",e.prototype.type="",e.prototype.createdAt="",e.prototype.data="",e.prototype.hasComments=!1,e.prototype.state="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.SuggestionDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.authorId=e.string();break;case 3:r.type=e.string();break;case 4:r.createdAt=e.string();break;case 5:r.data=e.string();break;case 6:r.hasComments=e.bool();break;case 7:r.state=e.string();break;case 8:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!je.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!je.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!je.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!je.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!je.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!je.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!je.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof Re.SuggestionDescriptor)return e;let t=new Re.SuggestionDescriptor;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SuggestionDescriptor"},e})(),Re.TrackChangesAddSuggestionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.documentId="",e.prototype.type="",e.prototype.data="",e.prototype.originalSuggestionId="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(34).string(e.data),null!=e.originalSuggestionId&&Object.hasOwnProperty.call(e,"originalSuggestionId")&&t.uint32(42).string(e.originalSuggestionId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(50).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.TrackChangesAddSuggestionMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.documentId=e.string();break;case 3:r.type=e.string();break;case 4:r.data=e.string();break;case 5:r.originalSuggestionId=e.string();break;case 6:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!je.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId)?"documentId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!je.isString(e.type)?"type: string expected":null!=e.data&&e.hasOwnProperty("data")&&!je.isString(e.data)?"data: string expected":null!=e.originalSuggestionId&&e.hasOwnProperty("originalSuggestionId")&&!je.isString(e.originalSuggestionId)?"originalSuggestionId: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!je.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof Re.TrackChangesAddSuggestionMessage)return e;let t=new Re.TrackChangesAddSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.type&&(t.type=String(e.type)),null!=e.data&&(t.data=String(e.data)),null!=e.originalSuggestionId&&(t.originalSuggestionId=String(e.originalSuggestionId)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.documentId="",n.type="",n.data="",n.originalSuggestionId="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.originalSuggestionId&&e.hasOwnProperty("originalSuggestionId")&&(n.originalSuggestionId=e.originalSuggestionId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesAddSuggestionMessage"},e})(),Re.TrackChangesBatchUpdateSuggestionsStateMessage=(()=>{function e(e){if(this.ids=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.ids=je.emptyArray,e.prototype.documentId="",e.prototype.state="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.ids&&e.ids.length)for(let n=0;n<e.ids.length;++n)t.uint32(10).string(e.ids[n]);return null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(26).string(e.state),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.TrackChangesBatchUpdateSuggestionsStateMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.ids&&r.ids.length||(r.ids=[]),r.ids.push(e.string());break;case 2:r.documentId=e.string();break;case 3:r.state=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.ids&&e.hasOwnProperty("ids")){if(!Array.isArray(e.ids))return"ids: array expected";for(let t=0;t<e.ids.length;++t)if(!je.isString(e.ids[t]))return"ids: string[] expected"}return null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId)?"documentId: string expected":null!=e.state&&e.hasOwnProperty("state")&&!je.isString(e.state)?"state: string expected":null},e.fromObject=function(e){if(e instanceof Re.TrackChangesBatchUpdateSuggestionsStateMessage)return e;let t=new Re.TrackChangesBatchUpdateSuggestionsStateMessage;if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".TrackChangesBatchUpdateSuggestionsStateMessage.ids: array expected");t.ids=[];for(let n=0;n<e.ids.length;++n)t.ids[n]=String(e.ids[n])}return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.state&&(t.state=String(e.state)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.ids=[]),t.defaults&&(n.documentId="",n.state=""),e.ids&&e.ids.length){n.ids=[];for(let t=0;t<e.ids.length;++t)n.ids[t]=e.ids[t]}return null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesBatchUpdateSuggestionsStateMessage"},e})(),Re.TrackChangesConnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.TrackChangesConnectMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.documentId=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof Re.TrackChangesConnectMessage)return e;let t=new Re.TrackChangesConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesConnectMessage"},e})(),Re.TrackChangesGetAllSuggestionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.TrackChangesGetAllSuggestionMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.documentId=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof Re.TrackChangesGetAllSuggestionMessage)return e;let t=new Re.TrackChangesGetAllSuggestionMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetAllSuggestionMessage"},e})(),Re.TrackChangesGetSuggestionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.TrackChangesGetSuggestionMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.documentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!je.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof Re.TrackChangesGetSuggestionMessage)return e;let t=new Re.TrackChangesGetSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.documentId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetSuggestionMessage"},e})(),Re.TrackChangesUpdateSuggestionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.documentId="",e.prototype.hasComments=!1,e.prototype.isHasCommentsModified=!1,e.prototype.state="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(24).bool(e.hasComments),null!=e.isHasCommentsModified&&Object.hasOwnProperty.call(e,"isHasCommentsModified")&&t.uint32(32).bool(e.isHasCommentsModified),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(42).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(50).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.TrackChangesUpdateSuggestionMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.documentId=e.string();break;case 3:r.hasComments=e.bool();break;case 4:r.isHasCommentsModified=e.bool();break;case 5:r.state=e.string();break;case 6:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!je.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!je.isString(e.documentId)?"documentId: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.isHasCommentsModified&&e.hasOwnProperty("isHasCommentsModified")&&"boolean"!=typeof e.isHasCommentsModified?"isHasCommentsModified: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!je.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!je.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof Re.TrackChangesUpdateSuggestionMessage)return e;let t=new Re.TrackChangesUpdateSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.isHasCommentsModified&&(t.isHasCommentsModified=Boolean(e.isHasCommentsModified)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.documentId="",n.hasComments=!1,n.isHasCommentsModified=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.isHasCommentsModified&&e.hasOwnProperty("isHasCommentsModified")&&(n.isHasCommentsModified=e.isHasCommentsModified),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesUpdateSuggestionMessage"},e})(),Re.TrackChangesAddSuggestionResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.authorId="",e.prototype.type="",e.prototype.createdAt="",e.prototype.data="",e.prototype.hasComments=!1,e.prototype.state="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.TrackChangesAddSuggestionResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.authorId=e.string();break;case 3:r.type=e.string();break;case 4:r.createdAt=e.string();break;case 5:r.data=e.string();break;case 6:r.hasComments=e.bool();break;case 7:r.state=e.string();break;case 8:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!je.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!je.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!je.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!je.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!je.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!je.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!je.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof Re.TrackChangesAddSuggestionResponse)return e;let t=new Re.TrackChangesAddSuggestionResponse;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesAddSuggestionResponse"},e})(),Re.TrackChangesConnectResponse=(()=>{function e(e){if(this.suggestions=[],this.suggestionsV2=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.channel="",e.prototype.suggestions=je.emptyArray,e.prototype.suggestionsV2=je.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.suggestions&&e.suggestions.length)for(let n=0;n<e.suggestions.length;++n)t.uint32(18).string(e.suggestions[n]);if(null!=e.suggestionsV2&&e.suggestionsV2.length)for(let n=0;n<e.suggestionsV2.length;++n)Re.SuggestionDescriptor.encode(e.suggestionsV2[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.TrackChangesConnectResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.channel=e.string();break;case 2:r.suggestions&&r.suggestions.length||(r.suggestions=[]),r.suggestions.push(e.string());break;case 3:r.suggestionsV2&&r.suggestionsV2.length||(r.suggestionsV2=[]),r.suggestionsV2.push(Re.SuggestionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!je.isString(e.channel))return"channel: string expected";if(null!=e.suggestions&&e.hasOwnProperty("suggestions")){if(!Array.isArray(e.suggestions))return"suggestions: array expected";for(let t=0;t<e.suggestions.length;++t)if(!je.isString(e.suggestions[t]))return"suggestions: string[] expected"}if(null!=e.suggestionsV2&&e.hasOwnProperty("suggestionsV2")){if(!Array.isArray(e.suggestionsV2))return"suggestionsV2: array expected";for(let t=0;t<e.suggestionsV2.length;++t){let n=Re.SuggestionDescriptor.verify(e.suggestionsV2[t]);if(n)return"suggestionsV2."+n}}return null},e.fromObject=function(e){if(e instanceof Re.TrackChangesConnectResponse)return e;let t=new Re.TrackChangesConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.suggestions){if(!Array.isArray(e.suggestions))throw TypeError(".TrackChangesConnectResponse.suggestions: array expected");t.suggestions=[];for(let n=0;n<e.suggestions.length;++n)t.suggestions[n]=String(e.suggestions[n])}if(e.suggestionsV2){if(!Array.isArray(e.suggestionsV2))throw TypeError(".TrackChangesConnectResponse.suggestionsV2: array expected");t.suggestionsV2=[];for(let n=0;n<e.suggestionsV2.length;++n){if("object"!=typeof e.suggestionsV2[n])throw TypeError(".TrackChangesConnectResponse.suggestionsV2: object expected");t.suggestionsV2[n]=Re.SuggestionDescriptor.fromObject(e.suggestionsV2[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.suggestions=[],n.suggestionsV2=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.suggestions&&e.suggestions.length){n.suggestions=[];for(let t=0;t<e.suggestions.length;++t)n.suggestions[t]=e.suggestions[t]}if(e.suggestionsV2&&e.suggestionsV2.length){n.suggestionsV2=[];for(let r=0;r<e.suggestionsV2.length;++r)n.suggestionsV2[r]=Re.SuggestionDescriptor.toObject(e.suggestionsV2[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesConnectResponse"},e})(),Re.TrackChangesGetAllSuggestionsResponse=(()=>{function e(e){if(this.suggestions=[],this.suggestionsV2=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.suggestions=je.emptyArray,e.prototype.suggestionsV2=je.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.suggestions&&e.suggestions.length)for(let n=0;n<e.suggestions.length;++n)t.uint32(10).string(e.suggestions[n]);if(null!=e.suggestionsV2&&e.suggestionsV2.length)for(let n=0;n<e.suggestionsV2.length;++n)Re.SuggestionDescriptor.encode(e.suggestionsV2[n],t.uint32(18).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.TrackChangesGetAllSuggestionsResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.suggestions&&r.suggestions.length||(r.suggestions=[]),r.suggestions.push(e.string());break;case 2:r.suggestionsV2&&r.suggestionsV2.length||(r.suggestionsV2=[]),r.suggestionsV2.push(Re.SuggestionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.suggestions&&e.hasOwnProperty("suggestions")){if(!Array.isArray(e.suggestions))return"suggestions: array expected";for(let t=0;t<e.suggestions.length;++t)if(!je.isString(e.suggestions[t]))return"suggestions: string[] expected"}if(null!=e.suggestionsV2&&e.hasOwnProperty("suggestionsV2")){if(!Array.isArray(e.suggestionsV2))return"suggestionsV2: array expected";for(let t=0;t<e.suggestionsV2.length;++t){let n=Re.SuggestionDescriptor.verify(e.suggestionsV2[t]);if(n)return"suggestionsV2."+n}}return null},e.fromObject=function(e){if(e instanceof Re.TrackChangesGetAllSuggestionsResponse)return e;let t=new Re.TrackChangesGetAllSuggestionsResponse;if(e.suggestions){if(!Array.isArray(e.suggestions))throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestions: array expected");t.suggestions=[];for(let n=0;n<e.suggestions.length;++n)t.suggestions[n]=String(e.suggestions[n])}if(e.suggestionsV2){if(!Array.isArray(e.suggestionsV2))throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestionsV2: array expected");t.suggestionsV2=[];for(let n=0;n<e.suggestionsV2.length;++n){if("object"!=typeof e.suggestionsV2[n])throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestionsV2: object expected");t.suggestionsV2[n]=Re.SuggestionDescriptor.fromObject(e.suggestionsV2[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.suggestions=[],n.suggestionsV2=[]),e.suggestions&&e.suggestions.length){n.suggestions=[];for(let t=0;t<e.suggestions.length;++t)n.suggestions[t]=e.suggestions[t]}if(e.suggestionsV2&&e.suggestionsV2.length){n.suggestionsV2=[];for(let r=0;r<e.suggestionsV2.length;++r)n.suggestionsV2[r]=Re.SuggestionDescriptor.toObject(e.suggestionsV2[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetAllSuggestionsResponse"},e})(),Re.TrackChangesGetSuggestionResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.authorId="",e.prototype.type="",e.prototype.createdAt="",e.prototype.data="",e.prototype.hasComments=!1,e.prototype.state="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.TrackChangesGetSuggestionResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.authorId=e.string();break;case 3:r.type=e.string();break;case 4:r.createdAt=e.string();break;case 5:r.data=e.string();break;case 6:r.hasComments=e.bool();break;case 7:r.state=e.string();break;case 8:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!je.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!je.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!je.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!je.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!je.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!je.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!je.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof Re.TrackChangesGetSuggestionResponse)return e;let t=new Re.TrackChangesGetSuggestionResponse;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetSuggestionResponse"},e})(),Re.UserDescriptor=(()=>{function e(e){if(this.attributes=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.attributes=je.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.attributes&&e.attributes.length)for(let n=0;n<e.attributes.length;++n)Re.KeyValueDescriptor.encode(e.attributes[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.UserDescriptor;for(;e.pos<n;){let t=e.uint32();t>>>3==1?(r.attributes&&r.attributes.length||(r.attributes=[]),r.attributes.push(Re.KeyValueDescriptor.decode(e,e.uint32()))):e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")){if(!Array.isArray(e.attributes))return"attributes: array expected";for(let t=0;t<e.attributes.length;++t){let n=Re.KeyValueDescriptor.verify(e.attributes[t]);if(n)return"attributes."+n}}return null},e.fromObject=function(e){if(e instanceof Re.UserDescriptor)return e;let t=new Re.UserDescriptor;if(e.attributes){if(!Array.isArray(e.attributes))throw TypeError(".UserDescriptor.attributes: array expected");t.attributes=[];for(let n=0;n<e.attributes.length;++n){if("object"!=typeof e.attributes[n])throw TypeError(".UserDescriptor.attributes: object expected");t.attributes[n]=Re.KeyValueDescriptor.fromObject(e.attributes[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.attributes=[]),e.attributes&&e.attributes.length){n.attributes=[];for(let r=0;r<e.attributes.length;++r)n.attributes[r]=Re.KeyValueDescriptor.toObject(e.attributes[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/UserDescriptor"},e})(),Re.GetManyUsersMessage=(()=>{function e(e){if(this.ids=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.ids=je.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.ids&&e.ids.length)for(let n=0;n<e.ids.length;++n)t.uint32(10).string(e.ids[n]);return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.GetManyUsersMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?(r.ids&&r.ids.length||(r.ids=[]),r.ids.push(e.string())):e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.ids&&e.hasOwnProperty("ids")){if(!Array.isArray(e.ids))return"ids: array expected";for(let t=0;t<e.ids.length;++t)if(!je.isString(e.ids[t]))return"ids: string[] expected"}return null},e.fromObject=function(e){if(e instanceof Re.GetManyUsersMessage)return e;let t=new Re.GetManyUsersMessage;if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".GetManyUsersMessage.ids: array expected");t.ids=[];for(let n=0;n<e.ids.length;++n)t.ids[n]=String(e.ids[n])}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.ids=[]),e.ids&&e.ids.length){n.ids=[];for(let t=0;t<e.ids.length;++t)n.ids[t]=e.ids[t]}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetManyUsersMessage"},e})(),Re.GetUserMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.GetUserMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.id=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!je.isString(e.id)?"id: string expected":null},e.fromObject=function(e){if(e instanceof Re.GetUserMessage)return e;let t=new Re.GetUserMessage;return null!=e.id&&(t.id=String(e.id)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetUserMessage"},e})(),Re.GetManyUsersResponse=(()=>{function e(e){if(this.users=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.users=je.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.users&&e.users.length)for(let n=0;n<e.users.length;++n)Re.UserDescriptor.encode(e.users[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.GetManyUsersResponse;for(;e.pos<n;){let t=e.uint32();t>>>3==1?(r.users&&r.users.length||(r.users=[]),r.users.push(Re.UserDescriptor.decode(e,e.uint32()))):e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.users&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let t=0;t<e.users.length;++t){let n=Re.UserDescriptor.verify(e.users[t]);if(n)return"users."+n}}return null},e.fromObject=function(e){if(e instanceof Re.GetManyUsersResponse)return e;let t=new Re.GetManyUsersResponse;if(e.users){if(!Array.isArray(e.users))throw TypeError(".GetManyUsersResponse.users: array expected");t.users=[];for(let n=0;n<e.users.length;++n){if("object"!=typeof e.users[n])throw TypeError(".GetManyUsersResponse.users: object expected");t.users[n]=Re.UserDescriptor.fromObject(e.users[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.users=[]),e.users&&e.users.length){n.users=[];for(let r=0;r<e.users.length;++r)n.users[r]=Re.UserDescriptor.toObject(e.users[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetManyUsersResponse"},e})(),Re.GetUserResponse=(()=>{function e(e){if(this.attributes=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.attributes=je.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.attributes&&e.attributes.length)for(let n=0;n<e.attributes.length;++n)Re.KeyValueDescriptor.encode(e.attributes[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.GetUserResponse;for(;e.pos<n;){let t=e.uint32();t>>>3==1?(r.attributes&&r.attributes.length||(r.attributes=[]),r.attributes.push(Re.KeyValueDescriptor.decode(e,e.uint32()))):e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")){if(!Array.isArray(e.attributes))return"attributes: array expected";for(let t=0;t<e.attributes.length;++t){let n=Re.KeyValueDescriptor.verify(e.attributes[t]);if(n)return"attributes."+n}}return null},e.fromObject=function(e){if(e instanceof Re.GetUserResponse)return e;let t=new Re.GetUserResponse;if(e.attributes){if(!Array.isArray(e.attributes))throw TypeError(".GetUserResponse.attributes: array expected");t.attributes=[];for(let n=0;n<e.attributes.length;++n){if("object"!=typeof e.attributes[n])throw TypeError(".GetUserResponse.attributes: object expected");t.attributes[n]=Re.KeyValueDescriptor.fromObject(e.attributes[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.attributes=[]),e.attributes&&e.attributes.length){n.attributes=[];for(let r=0;r<e.attributes.length;++r)n.attributes[r]=Re.KeyValueDescriptor.toObject(e.attributes[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetUserResponse"},e})(),Re.ChannelMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.type=0,e.prototype.socketId="",e.prototype.data=je.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).uint32(e.type),null!=e.socketId&&Object.hasOwnProperty.call(e,"socketId")&&t.uint32(18).string(e.socketId),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(26).bytes(e.data),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.ChannelMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.type=e.uint32();break;case 2:r.socketId=e.string();break;case 3:r.data=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!je.isInteger(e.type)?"type: integer expected":null!=e.socketId&&e.hasOwnProperty("socketId")&&!je.isString(e.socketId)?"socketId: string expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||je.isString(e.data))?"data: buffer expected":null},e.fromObject=function(e){if(e instanceof Re.ChannelMessage)return e;let t=new Re.ChannelMessage;return null!=e.type&&(t.type=e.type>>>0),null!=e.socketId&&(t.socketId=String(e.socketId)),null!=e.data&&("string"==typeof e.data?je.base64.decode(e.data,t.data=je.newBuffer(je.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.type=0,n.socketId="",t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=je.newBuffer(n.data)))),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.socketId&&e.hasOwnProperty("socketId")&&(n.socketId=e.socketId),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?je.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ChannelMessage"},e})(),Re.BytesBytesPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=je.newBuffer([]),e.prototype.data1=je.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).bytes(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.BytesBytesPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.bytes();break;case 2:r.data1=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||je.isString(e.data))?"data: buffer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||je.isString(e.data1))?"data1: buffer expected":null},e.fromObject=function(e){if(e instanceof Re.BytesBytesPacketDataMessage)return e;let t=new Re.BytesBytesPacketDataMessage;return null!=e.data&&("string"==typeof e.data?je.base64.decode(e.data,t.data=je.newBuffer(je.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),null!=e.data1&&("string"==typeof e.data1?je.base64.decode(e.data1,t.data1=je.newBuffer(je.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=je.newBuffer(n.data))),t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=je.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?je.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?je.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/BytesBytesPacketDataMessage"},e})(),Re.NumberBytesPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=0,e.prototype.data1=je.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.NumberBytesPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.uint32();break;case 2:r.data1=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!je.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||je.isString(e.data1))?"data1: buffer expected":null},e.fromObject=function(e){if(e instanceof Re.NumberBytesPacketDataMessage)return e;let t=new Re.NumberBytesPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&("string"==typeof e.data1?je.base64.decode(e.data1,t.data1=je.newBuffer(je.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data=0,t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=je.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?je.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberBytesPacketDataMessage"},e})(),Re.NumberNumberPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=0,e.prototype.data1=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(16).uint32(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.NumberNumberPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.uint32();break;case 2:r.data1=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!je.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!je.isInteger(e.data1)?"data1: integer expected":null},e.fromObject=function(e){if(e instanceof Re.NumberNumberPacketDataMessage)return e;let t=new Re.NumberNumberPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=e.data1>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data=0,n.data1=0),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberNumberPacketDataMessage"},e})(),Re.NumberObjectPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=0,e.prototype.data1="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.NumberObjectPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.uint32();break;case 2:r.data1=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!je.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!je.isString(e.data1)?"data1: string expected":null},e.fromObject=function(e){if(e instanceof Re.NumberObjectPacketDataMessage)return e;let t=new Re.NumberObjectPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=String(e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data=0,n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberObjectPacketDataMessage"},e})(),Re.NumberStringPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=0,e.prototype.data1="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.NumberStringPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.uint32();break;case 2:r.data1=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!je.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!je.isString(e.data1)?"data1: string expected":null},e.fromObject=function(e){if(e instanceof Re.NumberStringPacketDataMessage)return e;let t=new Re.NumberStringPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=String(e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data=0,n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberStringPacketDataMessage"},e})(),Re.ObjectBufferPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1=je.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.ObjectBufferPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!je.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||je.isString(e.data1))?"data1: buffer expected":null},e.fromObject=function(e){if(e instanceof Re.ObjectBufferPacketDataMessage)return e;let t=new Re.ObjectBufferPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&("string"==typeof e.data1?je.base64.decode(e.data1,t.data1=je.newBuffer(je.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=je.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?je.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ObjectBufferPacketDataMessage"},e})(),Re.ObjectObjectPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.ObjectObjectPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!je.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!je.isString(e.data1)?"data1: string expected":null},e.fromObject=function(e){if(e instanceof Re.ObjectObjectPacketDataMessage)return e;let t=new Re.ObjectObjectPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ObjectObjectPacketDataMessage"},e})(),Re.PacketMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.type=0,e.prototype.id=0,e.prototype.nsp="",e.prototype.data=je.newBuffer([]),e.prototype.options=je.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).uint32(e.type),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(16).uint32(e.id),null!=e.nsp&&Object.hasOwnProperty.call(e,"nsp")&&t.uint32(26).string(e.nsp),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(34).bytes(e.data),null!=e.options&&Object.hasOwnProperty.call(e,"options")&&t.uint32(42).bytes(e.options),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.PacketMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.type=e.uint32();break;case 2:r.id=e.uint32();break;case 3:r.nsp=e.string();break;case 4:r.data=e.bytes();break;case 5:r.options=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!je.isInteger(e.type)?"type: integer expected":null!=e.id&&e.hasOwnProperty("id")&&!je.isInteger(e.id)?"id: integer expected":null!=e.nsp&&e.hasOwnProperty("nsp")&&!je.isString(e.nsp)?"nsp: string expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||je.isString(e.data))?"data: buffer expected":null!=e.options&&e.hasOwnProperty("options")&&!(e.options&&"number"==typeof e.options.length||je.isString(e.options))?"options: buffer expected":null},e.fromObject=function(e){if(e instanceof Re.PacketMessage)return e;let t=new Re.PacketMessage;return null!=e.type&&(t.type=e.type>>>0),null!=e.id&&(t.id=e.id>>>0),null!=e.nsp&&(t.nsp=String(e.nsp)),null!=e.data&&("string"==typeof e.data?je.base64.decode(e.data,t.data=je.newBuffer(je.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),null!=e.options&&("string"==typeof e.options?je.base64.decode(e.options,t.options=je.newBuffer(je.base64.length(e.options)),0):e.options.length>=0&&(t.options=e.options)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.type=0,n.id=0,n.nsp="",t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=je.newBuffer(n.data))),t.bytes===String?n.options="":(n.options=[],t.bytes!==Array&&(n.options=je.newBuffer(n.options)))),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.nsp&&e.hasOwnProperty("nsp")&&(n.nsp=e.nsp),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?je.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),null!=e.options&&e.hasOwnProperty("options")&&(n.options=t.bytes===String?je.base64.encode(e.options,0,e.options.length):t.bytes===Array?Array.prototype.slice.call(e.options):e.options),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/PacketMessage"},e})(),Re.PacketOptionsMessage=(()=>{function e(e){if(this.rooms=[],this.except=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.flags="",e.prototype.rooms=je.emptyArray,e.prototype.except=je.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ee.create()),null!=e.flags&&Object.hasOwnProperty.call(e,"flags")&&t.uint32(10).string(e.flags),null!=e.rooms&&e.rooms.length)for(let n=0;n<e.rooms.length;++n)t.uint32(18).string(e.rooms[n]);if(null!=e.except&&e.except.length)for(let n=0;n<e.except.length;++n)t.uint32(26).string(e.except[n]);return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.PacketOptionsMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.flags=e.string();break;case 2:r.rooms&&r.rooms.length||(r.rooms=[]),r.rooms.push(e.string());break;case 3:r.except&&r.except.length||(r.except=[]),r.except.push(e.string());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.flags&&e.hasOwnProperty("flags")&&!je.isString(e.flags))return"flags: string expected";if(null!=e.rooms&&e.hasOwnProperty("rooms")){if(!Array.isArray(e.rooms))return"rooms: array expected";for(let t=0;t<e.rooms.length;++t)if(!je.isString(e.rooms[t]))return"rooms: string[] expected"}if(null!=e.except&&e.hasOwnProperty("except")){if(!Array.isArray(e.except))return"except: array expected";for(let t=0;t<e.except.length;++t)if(!je.isString(e.except[t]))return"except: string[] expected"}return null},e.fromObject=function(e){if(e instanceof Re.PacketOptionsMessage)return e;let t=new Re.PacketOptionsMessage;if(null!=e.flags&&(t.flags=String(e.flags)),e.rooms){if(!Array.isArray(e.rooms))throw TypeError(".PacketOptionsMessage.rooms: array expected");t.rooms=[];for(let n=0;n<e.rooms.length;++n)t.rooms[n]=String(e.rooms[n])}if(e.except){if(!Array.isArray(e.except))throw TypeError(".PacketOptionsMessage.except: array expected");t.except=[];for(let n=0;n<e.except.length;++n)t.except[n]=String(e.except[n])}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.rooms=[],n.except=[]),t.defaults&&(n.flags=""),null!=e.flags&&e.hasOwnProperty("flags")&&(n.flags=e.flags),e.rooms&&e.rooms.length){n.rooms=[];for(let t=0;t<e.rooms.length;++t)n.rooms[t]=e.rooms[t]}if(e.except&&e.except.length){n.except=[];for(let t=0;t<e.except.length;++t)n.except[t]=e.except[t]}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/PacketOptionsMessage"},e})(),Re.StringBytesPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1=je.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.StringBytesPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!je.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||je.isString(e.data1))?"data1: buffer expected":null},e.fromObject=function(e){if(e instanceof Re.StringBytesPacketDataMessage)return e;let t=new Re.StringBytesPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&("string"==typeof e.data1?je.base64.decode(e.data1,t.data1=je.newBuffer(je.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=je.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?je.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringBytesPacketDataMessage"},e})(),Re.StringNumberPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(16).uint32(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.StringNumberPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!je.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!je.isInteger(e.data1)?"data1: integer expected":null},e.fromObject=function(e){if(e instanceof Re.StringNumberPacketDataMessage)return e;let t=new Re.StringNumberPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=e.data1>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",n.data1=0),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringNumberPacketDataMessage"},e})(),Re.StringObjectPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.StringObjectPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!je.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!je.isString(e.data1)?"data1: string expected":null},e.fromObject=function(e){if(e instanceof Re.StringObjectPacketDataMessage)return e;let t=new Re.StringObjectPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringObjectPacketDataMessage"},e})(),Re.StringStringPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ee.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Ce||(e=Ce.create(e));let n=void 0===t?e.len:e.pos+t,r=new Re.StringStringPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Ce||(e=new Ce(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!je.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!je.isString(e.data1)?"data1: string expected":null},e.fromObject=function(e){if(e instanceof Re.StringStringPacketDataMessage)return e;let t=new Re.StringStringPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringStringPacketDataMessage"},e})(),Re);class Ne{static decode(e,t){const n=xe(t).decode("undefined"==typeof window?e:new Uint8Array(e));return t.fromJSON({...n})}static encode(e){const t=xe(e.constructor),n=e.toJSON(),r=t.verify(n);if(r)throw Error(r);return t.encode(t.create(n)).finish()}}function xe(e){return De[e.DESCRIPTOR_NAME]}class Ve extends((0,s.EmitterMixin)()){constructor(e,t,n){super(),this._channelName=e,this._wsGateway=t,this._socket=n,this._subscribeToChannel()}remove(){this._socket.off(this._channelName)}getEventName(e,t=!1){let n="";return t&&(n+="all:"),n+="event",e&&(n+=":"+e),n}_subscribeToChannel(){this._socket.on(this._channelName,(e=>{const t=Ne.decode(e,_e);this.fire(this.getEventName(t.type,!0),t.data,t.socketId),t.socketId!==this._wsGateway.socketId&&this.fire(this.getEventName(t.type),t.data,t.socketId)}))}}const Me=Ve;class Be extends Te{constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new Be(e.id)}}Be.TYPE="21",Be.READABLE_TYPE_NAME="getUser",Be.DESCRIPTOR_NAME="GetUserMessage",Be.DESCRIPTOR={fields:{id:{type:"string",id:1}}};class Ue extends Te{constructor(e){super(),this.attributes=e}toJSON(){return{attributes:Object.keys(this.attributes).map((e=>({key:e,value:JSON.stringify(this.attributes[e])})))}}static fromJSON(e){const t=e.attributes.reduce(((e,t)=>(e[t.key]=t.value?JSON.parse(t.value):null,e)),{});return new Ue(t)}}Ue.DESCRIPTOR_NAME="GetUserResponse",Ue.DESCRIPTOR={fields:{attributes:{rule:"repeated",type:"KeyValueDescriptor",id:1}}};class Je extends Te{constructor(e){super(),this.ids=e}toJSON(){return{ids:this.ids}}static fromJSON(e){return new Je(e.ids)}}Je.TYPE="22",Je.READABLE_TYPE_NAME="getManyUsers",Je.DESCRIPTOR_NAME="GetManyUsersMessage",Je.DESCRIPTOR={fields:{ids:{id:1,type:"string",rule:"repeated"}}};class qe extends Te{constructor(e){super(),this.users=e}toJSON(){return{users:this.users.map(Le)}}static fromJSON(e){return new qe(e.users.map(Ge))}}function Le(e){return{attributes:Object.keys(e).map((t=>({key:t,value:JSON.stringify(e[t])})))}}function Ge(e){return e.attributes.reduce(((e,t)=>(e[t.key]=t.value?JSON.parse(t.value):null,e)),{})}qe.DESCRIPTOR_NAME="GetManyUsersResponse",qe.DESCRIPTOR={fields:{users:{rule:"repeated",type:"UserDescriptor",id:1}}};class Ye{constructor(e={}){this._attributes=new Map;for(const t of Object.keys(e))"id"!==t?(this._attributes.set(t,e[t]),Object.defineProperty(this,t,{enumerable:!0,configurable:!1,get:()=>this._attributes.get(t)})):this.id=e.id}static fromData(e){return new Ye(e)}static async get(e,t){const n=new Be(t);try{const t=await e._sendRequest(Ye._SERVICE,Be.TYPE,Ne.encode(n)),r=Ne.decode(t,Ue);return new Ye(r.attributes)}catch(e){return new Ye({id:t})}}static async getMany(e,t){const n=new Je(t);try{const t=await e._sendRequest(Ye._SERVICE,Je.TYPE,Ne.encode(n));return Ne.decode(t,qe).users.map((e=>new Ye(e)))}catch(e){return t.map((e=>new Ye({id:e})))}}}Ye._SERVICE=2;const ze=Ye;class Fe extends Error{constructor(e,t,n=null,r={}){super("cloud-services-internal-error: "+e),this.context=t,this.code=n,this.data=r,this.name="CKEditorError"}static fromPublicError(e){return new Fe(function(e){let t="cloud-services-error: "+e.message;return e.data&&(t+="\nError data: "+JSON.stringify(e.data)),e.explanation&&(t+="\nExplanation: "+e.explanation),e.action&&(t+="\nAction: "+e.action),e.traceId&&(t+="\nTraceId: "+e.traceId),e.code&&(t+="\nCode: "+e.code),t}(e),e)}}class He extends Error{constructor(e,t){super(),this.name="CKEditorCloudServicesServerError",this.stack=void 0,this.message=e,this.code=t.code,this.traceId=t.traceId,this.data=t.data}static fromPublicError(e){return new He(function(e){let t="cloud-services-server-error: "+e.message;return e.explanation&&(t+="\nExplanation: "+e.explanation),e.action&&(t+="\nAction: "+e.action),e.traceId&&(t+="\nTraceId: "+e.traceId),e.code&&(t+="\nCode: "+e.code),t}(e),e)}}const Ke="function"==typeof ArrayBuffer,We=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Qe=Object.prototype.toString,Ze="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Qe.call(Blob),$e="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===Qe.call(File);function Xe(e){return Ke&&(e instanceof ArrayBuffer||We(e))||Ze&&e instanceof Blob||$e&&e instanceof File}function et(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(et(e[t]))return!0;return!1}if(Xe(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return et(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&et(e[t]))return!0;return!1}function tt(e){const t=[],n=e.data,r=e;return r.data=nt(n,t),r.attachments=t.length,{packet:r,buffers:t}}function nt(e,t){if(!e)return e;if(Xe(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=nt(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=nt(e[r],t));return n}return e}function rt(e,t){return e.data=st(e.data,t),delete e.attachments,e}function st(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=st(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=st(e[n],t));return e}var ot;!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(ot||(ot={}));class it{constructor(e){this.replacer=e}encode(e){return e.type!==ot.EVENT&&e.type!==ot.ACK||!et(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===ot.EVENT?ot.BINARY_EVENT:ot.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==ot.BINARY_EVENT&&e.type!==ot.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=tt(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}}class at extends I{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===ot.BINARY_EVENT;n||t.type===ot.BINARY_ACK?(t.type=n?ot.EVENT:ot.ACK,this.reconstructor=new ct(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!Xe(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===ot[n.type])throw new Error("unknown packet type "+n.type);if(n.type===ot.BINARY_EVENT||n.type===ot.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const s=e.substring(r,t);if(s!=Number(s)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(s)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!at.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case ot.CONNECT:return"object"==typeof t;case ot.DISCONNECT:return void 0===t;case ot.CONNECT_ERROR:return"string"==typeof t||"object"==typeof t;case ot.EVENT:case ot.BINARY_EVENT:return Array.isArray(t)&&("string"==typeof t[0]||"number"==typeof t[0]);case ot.ACK:case ot.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class ct{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=rt(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}class dt extends Te{constructor(e,t=[],n=[]){super(),this.flags=e,this.rooms=t,this.except=n}toJSON(){var e,t;return{flags:this.flags?JSON.stringify(this.flags):void 0,rooms:(null===(e=this.rooms)||void 0===e?void 0:e.length)?this.rooms:void 0,except:(null===(t=this.except)||void 0===t?void 0:t.length)?this.except:void 0}}static fromJSON(e){return new dt(e.flags&&JSON.parse(e.flags),e.rooms,e.except)}}dt.TYPE=11,dt.DESCRIPTOR_NAME="PacketOptionsMessage",dt.DESCRIPTOR={fields:{flags:{type:"string",id:1},rooms:{type:"string",id:2,rule:"repeated"},except:{type:"string",id:3,rule:"repeated"}}};const ut=!("undefined"==typeof process||!process.versions||!process.versions.node);var lt,pt;(pt=lt||(lt={}))[pt.BUFFER=1]="BUFFER",pt[pt.STRING=2]="STRING",pt[pt.NUMBER=3]="NUMBER",pt[pt.OBJECT=4]="OBJECT";class ht{static getPacketType(...e){let t=0;for(let n=0;n<e.length;n++)t+=e[n]*Math.pow(10,e.length-n-1);return t}static getType(e){if(ht.isBuffer(e))return lt.BUFFER;const t=typeof e;return"string"===t?lt.STRING:"number"===t?lt.NUMBER:lt.OBJECT}static isBuffer(e){return ut&&Buffer.isBuffer(e)||e instanceof ArrayBuffer||e instanceof Uint8Array||this._isBufferView(e)}static _isBufferView(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer}}class ft extends Te{static create(e,t){throw new TypeError("Must be implemented in a child class!")}}class mt extends ft{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new mt(e.data,e.data1)}static create(e,t){return new mt(e,t)}}mt.TYPE=ht.getPacketType(lt.NUMBER,lt.BUFFER),mt.DESCRIPTOR_NAME="NumberBytesPacketDataMessage",mt.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"bytes",id:2}}};class yt extends ft{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new yt(e.data,e.data1)}static create(e,t){return new yt(e,t)}}yt.TYPE=ht.getPacketType(lt.STRING,lt.BUFFER),yt.DESCRIPTOR_NAME="StringBytesPacketDataMessage",yt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};class gt extends ft{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new gt(e.data,e.data1)}static create(e,t){return new gt(e,t)}}gt.TYPE=ht.getPacketType(lt.BUFFER,lt.BUFFER),gt.DESCRIPTOR_NAME="BytesBytesPacketDataMessage",gt.DESCRIPTOR={fields:{data:{type:"bytes",id:1},data1:{type:"bytes",id:2}}};class bt extends ft{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new bt(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new bt(e,t)}}bt.TYPE=ht.getPacketType(lt.STRING,lt.OBJECT),bt.DESCRIPTOR_NAME="StringObjectPacketDataMessage",bt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};class Ot extends ft{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new Ot(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new Ot(e,t)}}Ot.TYPE=ht.getPacketType(lt.NUMBER,lt.OBJECT),Ot.DESCRIPTOR_NAME="NumberObjectPacketDataMessage",Ot.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};class wt extends ft{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new wt(e.data&&JSON.parse(e.data),e.data1&&JSON.parse(e.data1))}static create(e,t){return new wt(e,t)}}wt.TYPE=ht.getPacketType(lt.OBJECT,lt.OBJECT),wt.DESCRIPTOR_NAME="ObjectObjectPacketDataMessage",wt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};class It extends ft{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1}}static fromJSON(e){return new It(e.data&&JSON.parse(e.data),e.data1)}static create(e,t){return new It(e,t)}}It.TYPE=ht.getPacketType(lt.OBJECT,lt.BUFFER),It.DESCRIPTOR_NAME="ObjectBufferPacketDataMessage",It.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};class vt extends ft{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new vt(e.data,e.data1)}static create(e,t){return new vt(e,t)}}vt.TYPE=ht.getPacketType(lt.STRING,lt.STRING),vt.DESCRIPTOR_NAME="StringStringPacketDataMessage",vt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};class St extends ft{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new St(e.data,e.data1)}static create(e,t){return new St(e,t)}}St.TYPE=ht.getPacketType(lt.STRING,lt.NUMBER),St.DESCRIPTOR_NAME="StringNumberPacketDataMessage",St.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"uint32",id:2}}};class At extends ft{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new At(e.data,e.data1)}static create(e,t){return new At(e,t)}}At.TYPE=ht.getPacketType(lt.NUMBER,lt.NUMBER),At.DESCRIPTOR_NAME="NumberNumberPacketDataMessage",At.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"uint32",id:2}}};class Pt extends ft{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new Pt(e.data,e.data1)}static create(e,t){return new Pt(e,t)}}Pt.TYPE=ht.getPacketType(lt.NUMBER,lt.STRING),Pt.DESCRIPTOR_NAME="NumberStringPacketDataMessage",Pt.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};const Tt=[mt,yt,gt,bt,Ot,wt,It,vt,St,At,Pt].reduce(((e,t)=>(e[t.TYPE]=t,e)),{});class _t extends Te{constructor(e,t,n,r="/",s=new dt){super(),this.type=e,this.data=t,this.id=n,this.nsp=r,this.options=s}get packetData(){return void 0===this.data.data&&void 0===this.data.data1?[]:this.data.data&&void 0===this.data.data1?[this.data.data]:[this.data.data,this.data.data1]}toJSON(){const e=Ne.encode(this.options),t=Ne.encode(this.data);return{type:this.type+10*this.data.constructor.TYPE,id:this.id,nsp:"/"===this.nsp?void 0:this.nsp,data:t,options:e}}static fromJSON(e){const t=Math.floor(e.type/10);return new _t(e.type-10*t,Ne.decode(e.data,Tt[t]),e.id,e.nsp,e.options?Ne.decode(e.options,dt):new dt)}static create(e,t={}){var n;const r=ht.getPacketType(ht.getType(e.data[0]),ht.getType(null!==(n=e.data[1])&&void 0!==n?n:e.data[0]));return new _t(e.type,Tt[r].create(e.data[0],e.data[1]),e.id,e.nsp,new dt(t.flags,t.rooms,t.except))}}_t.TYPE=10,_t.DESCRIPTOR_NAME="PacketMessage",_t.DESCRIPTOR={fields:{type:{type:"uint32",id:1},id:{type:"uint32",id:2},nsp:{type:"string",id:3},data:{type:"bytes",id:4},options:{type:"bytes",id:5}}};class kt{encode(e,t,n,r="/",s={}){if(t.length>2)throw new Error("PacketParser supports only 2 elements in data");const o={type:e,data:t,id:n,nsp:r};return Ne.encode(_t.create(o,s))}decode(e){const t=Ne.decode(e,_t);return{packet:{id:t.id,type:t.type,data:t.packetData,nsp:t.nsp},options:{flags:t.options.flags,rooms:t.options.rooms,except:t.options.except}}}}const Ct=[ot.EVENT,ot.ACK,ot.BINARY_ACK,ot.BINARY_EVENT];class Et extends it{constructor(e=new kt){super(),this._packetParser=e}encode(e){if(Ct.includes(e.type))try{return[this._packetParser.encode(e.type,e.data,e.id,e.nsp)]}catch(e){console.error("Can not properly serialize or deserialize messages. Check the original error.",{originalError:{message:e.message}})}return super.encode(e)}}class jt extends at{constructor(e=new kt){super(),this._packetParser=e}add(e){if(!ht.isBuffer(e))return super.add(e);let t;try{t=this._packetParser.decode(e).packet}catch(t){return super.add(e)}super.emitReserved("decoded",t)}}class Rt{constructor(e,t){this._context=e,this._deferredPromise=function(){let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return{resolve:e,reject:t,promise:n}}(),this.timeout=setTimeout((()=>this.error(new Fe("Request timeout.",this._context))),t)}get promise(){return this._deferredPromise.promise}response(e){this._deferredPromise.resolve(e)}error(e){this._deferredPromise.reject(e)}}class Dt{constructor(e){this._context=e,this._requests=new Set}async send(e,t=45e3){const n=this._createRequest(t);try{return e(n),await n.promise}finally{this._finishRequest(n)}}errorAll(e){for(const t of this._requests)t.error(e)}waitForAllRequests(e=45e3){return this._waitForRequests(e)}_createRequest(e){const t=new Rt(this._context,e);return this._requests.add(t),t}_finishRequest(e){this._requests.delete(e),clearTimeout(e.timeout)}async _waitForRequests(e=5e3,t=0){return!this._requests.size||t>=e/500?Promise.resolve():(await new Promise((e=>{setTimeout(e,500)})),this._waitForRequests(e,t++))}}var Nt,xt;(xt=Nt||(Nt={})).DISCONNECTED="disconnected",xt.CONNECTING="connecting",xt.CONNECTED="connected";class Vt extends((0,s.ObservableMixin)()){constructor(e,t,n={},r=Se,s=ze.get){if(super(),this._token=t,this._options=n,this._connectionProvider=r,this._userFactory=s,this._requestsManager=new Dt(this),this._channels=new Map,this._connectionAttempt=0,!e)throw new TypeError("Api address must be provided.");if(!this._token)throw new TypeError("Token must be provided.");this._options.requestTimeout||(this._options.requestTimeout=2e4),this._url=Ae(e.replace(/^(?!(?:\w+:)?\/\/)/,"https://")),this.set("state",Nt.DISCONNECTED),this.set("socketId",void 0),this.set("me",void 0),this.on("change:state",(async(e,t,n)=>{var r;if(this._debugEvent("ws-gw:change:state",n),n!==Vt.STATE_CONNECTED){if(n===Vt.STATE_DISCONNECTED)return this._requestsManager.errorAll(new Fe("Not connected.",this))}else try{this.me=await this._userFactory.call(ze,this,null===(r=this._socketAuth)||void 0===r?void 0:r.userId)}catch(e){}}),{priority:Vt._CHANGE_STATE_EVENT_PRIORITY}),this.on("error",((e,t)=>{this._options.onError?this._options.onError(t):console.error(t)}))}get sessionId(){return this.socketId}waitForAllRequests(e){return this._requestsManager.waitForAllRequests(e)}disconnect(){var e;this.state!==Nt.DISCONNECTED&&(null===(e=this._socket)||void 0===e||e.disconnect(),this._socket=void 0,this.state=Nt.DISCONNECTED)}async reconnect(){this._socket||this.state!==Nt.DISCONNECTED||(await this._token.refreshToken(),await this._connect())}static async connect(e,t="local.cs.dev:443/ws-v2",n={},r=Se,s=ze.get){const o=new Vt(t,e,n,r,s);return await o._connect(),o}_sendRequest(e,t,n){if(!e)throw new Fe("`serviceName` must be provided.",this);if(this.state!==Vt.STATE_CONNECTED)throw new Fe("Not connected.",this);if(!this._socketAuth||!this._socketAuth.isAuthenticated)throw new Fe("Not authenticated.",this);const r=new ArrayBuffer(n.length+2),s=new Uint8Array(r);return s[0]=e,s[1]=parseInt(t),s.set(n,2),this._emit(1,s)}_getChannel(e,t){const n=""+e+t;return!this._channels.has(n)&&this._socket&&this._channels.set(n,new Me(n,this,this._socket)),this._channels.get(n)}_connect(){return new Promise(((e,t)=>{const n=this._setupSocket();!this.socketId&&n.io.on("reconnect_error",(()=>{this._debugEvent("reconnect_error"),this._reconnectionAttemptError(t)})),n.once("connect",(async()=>{this._debugEvent("once-connect");try{await this._onConnect(),e()}catch(e){t(e)}})),n.connect()}))}_getPortByProtocol(e){return["http:","ws:"].includes(e)?80:443}_setupSocket(){var e;if(this._socket)return this._socket;const t=this._url.port||this._getPortByProtocol(this._url.protocol),n=(this._url.protocol||"https:")+"//"+this._url.hostname+":"+t,r=this._url.pathname.match(/^\/.*\/ws/)?this._url.pathname.split("/ws")[0]:"",s=this._connectionProvider(n,{parser:{Encoder:Et,Decoder:jt},path:r+"/ws-v2/ws",transports:["websocket"],timeout:void 0!==this._options.timeout?this._options.timeout:5e3,reconnection:void 0===this._options.autoReconnect||this._options.autoReconnect,reconnectionDelay:1e3,reconnectionDelayMax:5e3,rejectUnauthorized:void 0===this._options.rejectUnauthorized||this._options.rejectUnauthorized,query:{version:"52.1.6"},agent:null!==(e=this._options.agent)&&void 0!==e&&e,closeOnBeforeunload:!1});return this.state=Nt.CONNECTING,s.on("connect",(()=>{this._debugEvent("connect"),this.socketId=s.id})),s.on("connect_error",(e=>{this._debugEvent("connect_error",e)})),s.on("disconnect",(()=>{this._debugEvent("disconnect"),this._onDisconnect()})),s.io.on("reconnect",(async()=>{this._debugEvent("reconnect"),await this._onReconnect()})),s.io.on("reconnect_attempt",(e=>{this._debugEvent("reconnect_attempt",e),this.state=Nt.CONNECTING,this._connectionAttempt=e})),s.on("unauthorized",(e=>{this._debugEvent("unauthorized"),this._onUnauthorized(e)})),s.on("authenticationRequest",(async e=>{this._debugEvent("authenticationRequest",e.attempt),await this._onReconnect()})),this._socket=s,s}_emit(e,t){const n=this._socket;return this._requestsManager.send((r=>{n.emit(e,t,((e,t)=>{if(e)return r.error(He.fromPublicError(e));r.response(t)}))}),this._options.requestTimeout)}_addAuthData(e,t){this._socketAuth={environmentId:e,userId:t,isAuthenticated:!0}}_removeAuthData(){this._socketAuth=void 0}async _onConnect(){await this._authenticate(this._token.value),this.state=Nt.CONNECTED;const e=async(e,t,n)=>{this._debugEvent("token:value:change");try{await this._authenticate(n)}catch(e){}};this._token.on("change:value",e),this._socket.io.off("reconnect_error"),this.on("disconnect",(()=>{this._token.off("change:value",e)}))}async _onReconnect(){await this._token.refreshToken(),await this._onConnect()}_onDisconnect(){this.state=Nt.DISCONNECTED,this._connectionAttempt=0,this.fire("disconnect");for(const e of this._channels.values())e.remove();this._channels.clear(),void 0===this._options.autoReconnect||this._options.autoReconnect||(this._socket=void 0)}_debugEvent(e,t){if(!this._isDebugModeEnabled())return;const n=void 0!==t?", data: "+t:"";console.info((new Date).toLocaleString()+" "+e+n)}_reconnectionAttemptError(e){this._connectionAttempt>=2&&(this.disconnect(),e(Fe.fromPublicError({message:"The number of initial connection attempts exceeded.",explanation:"Three initial connection attempts failed. It can be caused by a slow, unstable, missing or blocked Internet connection.",action:"Please verify the stability of your Internet connection and ensure that no antivirus or firewall software blocks the Web Socket protocol connections."})))}_onUnauthorized({error:e}){this._removeAuthData(),this.fire("error",He.fromPublicError(e))}async _authenticate(e){try{this._debugEvent("authenticate:start");const t=await this._emit(2,{token:e});this._debugEvent("authenticate:success","envId: "+t.environmentId+", userId: "+t.userId),this._addAuthData(t.environmentId,t.userId)}catch(e){throw this._debugEvent("authenticate:error",e.message),this._removeAuthData(),e}}_isDebugModeEnabled(){var e;return!!s.global.window.localStorage&&"true"===(null!==(e=s.global.window.localStorage.getItem("csClientDebugMode"))&&void 0!==e?e:"false").toLowerCase()}}Vt.STATE_DISCONNECTED=Nt.DISCONNECTED,Vt.STATE_CONNECTING=Nt.CONNECTING,Vt.STATE_CONNECTED=Nt.CONNECTED,Vt._CHANGE_STATE_EVENT_PRIORITY=s.priorities.get("highest")+999999;const Mt=Vt;class Bt extends Te{constructor(e){super(),this.bundleVersion=e}toJSON(){return{bundleVersion:this.bundleVersion}}static fromJSON(e){return new Bt(e.bundleVersion)}}Bt.TYPE="131",Bt.READABLE_TYPE_NAME="isEditorBundleUploaded",Bt.DESCRIPTOR_NAME="IsEditorBundleUploadedMessage",Bt.DESCRIPTOR={fields:{bundleVersion:{type:"string",id:1}}};class Ut extends Te{constructor(e){super(),this.isUploaded=e}toJSON(){return{isUploaded:this.isUploaded}}static fromJSON(e){return new Ut(e.isUploaded)}}Ut.DESCRIPTOR_NAME="IsEditorBundleUploadedResponse",Ut.DESCRIPTOR={fields:{isUploaded:{type:"bool",id:1}}};class Jt extends((0,s.EmitterMixin)()){static async isBundleUploaded(e,t){const n=new Bt(t);if(e.state!==Nt.CONNECTED)throw new Fe("WebSocket Gateway is not connected.",e);const r=await e._sendRequest(Jt._SERVICE,Bt.TYPE,Ne.encode(n));return Ne.decode(r,Ut).isUploaded}}Jt._SERVICE=13;const qt=Jt;class Lt extends Te{constructor(e,t){super(),this.documentId=e,this.revisionId=t}toJSON(){return{documentId:this.documentId,revisionId:this.revisionId}}static fromJSON(e){return new Lt(e.documentId,e.revisionId)}}Lt.TYPE="123",Lt.READABLE_TYPE_NAME="getRevision",Lt.DESCRIPTOR_NAME="RevisionHistoryGetRevisionMessage",Lt.DESCRIPTOR={fields:{documentId:{type:"string",id:1},revisionId:{type:"string",id:2}}};class Gt extends Pe{static create(e){return{revisionId:e.id,name:e.name,creatorId:e.creatorId,createdAt:e.createdAt,fromVersion:e.fromVersion,toVersion:e.toVersion,isEmptyCurrent:e.isEmptyCurrent,diffData:e.diffData?JSON.stringify(e.diffData):void 0,attributes:e.attributes,authorsIds:e.authorsIds}}static toJSON(e){var t;return{revisionId:e.revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.stringify(e.authorsIds):void 0,diffData:e.diffData,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):void 0,toVersion:e.toVersion,fromVersion:e.fromVersion,isEmptyCurrent:e.isEmptyCurrent}}static fromJSON(e){return{revisionId:(e={...e}).revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.parse(e.authorsIds):void 0,diffData:e.diffData,createdAt:e.createdAt?new Date(e.createdAt):void 0,attributes:e.attributes?JSON.parse(e.attributes):void 0,toVersion:e.toVersion,fromVersion:e.fromVersion,isEmptyCurrent:e.isEmptyCurrent}}static toObject(e){return function(e){for(const[t,n]of Object.entries(e))void 0===n&&delete e[t];return e}({id:e.revisionId,name:e.name,creatorId:e.creatorId,createdAt:e.createdAt,fromVersion:e.fromVersion,toVersion:e.toVersion,isEmptyCurrent:e.isEmptyCurrent,diffData:e.diffData?JSON.parse(e.diffData):void 0,attributes:e.attributes,authorsIds:e.authorsIds})}}Gt.DESCRIPTOR_NAME="RevisionDescriptor",Gt.DESCRIPTOR={fields:{revisionId:{type:"string",id:1},name:{type:"string",id:2},creatorId:{type:"string",id:3},authorsIds:{type:"string",id:4},diffData:{type:"string",id:5},createdAt:{type:"string",id:6},attributes:{type:"string",id:7},toVersion:{type:"uint32",id:8},fromVersion:{type:"uint32",id:9},isEmptyCurrent:{type:"bool",id:10}}};class Yt extends Te{constructor(e,t,n,r,s,o,i,a,c,d){super(),this.revisionId=e,this.name=t,this.creatorId=n,this.authorsIds=r,this.createdAt=s,this.diffData=o,this.attributes=i,this.fromVersion=a,this.toVersion=c,this.isEmptyCurrent=d}toJSON(){return Gt.toJSON(this)}toObject(){return Gt.toObject(this)}static create(e){return new Yt(e.revisionId,e.name,e.creatorId,e.authorsIds,e.createdAt,e.diffData,e.attributes,e.fromVersion,e.toVersion,e.isEmptyCurrent)}static fromJSON(e){return new Yt(e.revisionId,e.name,e.creatorId,e.authorsIds?JSON.parse(e.authorsIds):void 0,e.createdAt?new Date(e.createdAt):void 0,e.diffData,e.attributes?JSON.parse(e.attributes):void 0,e.fromVersion,e.toVersion,e.isEmptyCurrent)}}Yt.DESCRIPTOR_NAME="RevisionHistoryGetRevisionResponse",Yt.DESCRIPTOR=Gt.DESCRIPTOR;class zt extends Te{constructor(e,t,n){super(),this.documentId=e,this.requestId=t,this.revisions=n}toJSON(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(Gt.toJSON)}}toObject(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(Gt.toObject)}}static create(e){return new zt(e.documentId,e.requestId,e.revisions.map(Gt.create))}static fromJSON(e){return new zt(e.documentId,e.requestId,e.revisions.map(Gt.fromJSON))}}zt.TYPE="124",zt.READABLE_TYPE_NAME="updateRevisions",zt.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsMessage",zt.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};class Ft extends Te{constructor(e){super(),this.requestId=e}toJSON(){return{requestId:this.requestId}}static fromJSON(e){return new Ft(e.requestId)}}Ft.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsResponse",Ft.DESCRIPTOR={fields:{requestId:{type:"uint32",id:1}}};class Ht extends Te{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Ht(e.documentId)}}Ht.TYPE="121",Ht.READABLE_TYPE_NAME="connectToRevisionHistory",Ht.DESCRIPTOR_NAME="RevisionHistoryConnectMessage",Ht.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};class Kt extends Te{constructor(e,t,n){super(),this.channel=e,this.requestId=t,this.revisions=n}toJSON(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(Gt.toJSON)}}toObject(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(Gt.toObject)}}static fromJSON(e){return new Kt(e.channel,e.requestId,e.revisions.map(Gt.fromJSON))}}Kt.DESCRIPTOR_NAME="RevisionHistoryConnectResponse",Kt.DESCRIPTOR={fields:{channel:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};class Wt extends Te{constructor(e,t){super(),this.documentId=e,this.requestId=t}toJSON(){return{documentId:this.documentId,requestId:this.requestId}}static fromJSON(e){return new Wt(e.documentId,e.requestId)}}Wt.TYPE="122",Wt.READABLE_TYPE_NAME="reconnectToRevisionHistory",Wt.DESCRIPTOR_NAME="RevisionHistoryReconnectMessage",Wt.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2}}};class Qt extends Fe{constructor(e,t){super(e+" Service is not connected.",t)}}class Zt extends((0,s.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}connect(e){return this._isConnected?Promise.resolve():this._connect(e,new Ht(this._documentId))}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this.fire("disconnected"),this.stopListening())}reconnect(e,t){if(this.isConnected)throw new Fe("Cannot reconnect to already connected service.",e);return this._connect(e,new Wt(this._documentId,t))}async updateRevisions(e,t){const n=zt.create({documentId:this._documentId,requestId:t,revisions:e}),r=await this._sendRequest(zt.TYPE,n),{requestId:s}=Ne.decode(r,Ft);return s}async getRevision(e){const t=new Lt(this._documentId,e),n=await this._sendRequest(Lt.TYPE,t);return Ne.decode(n,Yt).toObject()}async _connect(e,t){if(e.state!==Nt.CONNECTED)throw new Fe("WebSocket Gateway is not connected.",e);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(12,t.constructor.TYPE,Ne.encode(t)),{channel:r,requestId:s,revisions:o}=Ne.decode(n,Kt).toObject();return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Mt._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,r),this._isConnected=!0,this.fire("connected"),{revisions:o,requestId:s}}_connectToChannel(e,t){this._channel=e._getChannel(Zt._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(zt.TYPE),((e,t)=>{const{documentId:n,requestId:r,revisions:s}=Ne.decode(t,zt).toObject();this.fire("revisionsUpdated",{documentId:n,requestId:r,revisionsData:s})}))}_onWsGatewayStateChange(e){e===Nt.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new Qt("Revision History",this);return this._wsGateway._sendRequest(12,e,Ne.encode(t))}}Zt._SERVICE=12;const $t=Zt;class Xt extends Te{constructor(e,t,n,r={},s=null,o=null){super(),this.id=e,this.documentId=t,this.type=n,this.data=r,this.originalSuggestionId=s,this.attributes=o}toJSON(){return{id:this.id,documentId:this.documentId,type:this.type,data:JSON.stringify(this.data),originalSuggestionId:this.originalSuggestionId,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){var t;return new Xt(e.id,e.documentId,e.type,JSON.parse(e.data),null!==(t=e.originalSuggestionId)&&void 0!==t?t:null,e.attributes?JSON.parse(e.attributes):null)}}Xt.TYPE="101",Xt.READABLE_TYPE_NAME="addSuggestion",Xt.DESCRIPTOR_NAME="TrackChangesAddSuggestionMessage",Xt.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2},type:{type:"string",id:3},data:{type:"string",id:4},originalSuggestionId:{type:"string",id:5},attributes:{type:"string",id:6}}};class en extends Te{constructor(e,t,n,r,s,o,i={},a=null){super(),this.id=e,this.authorId=t,this.type=n,this.hasComments=s,this.state=o,this.data=i,this.attributes=a,this.createdAt=r?new Date(r):void 0}toJSON(){var e;return{id:this.id,authorId:this.authorId,type:this.type,createdAt:null===(e=this.createdAt)||void 0===e?void 0:e.toISOString(),data:JSON.stringify(this.data),hasComments:this.hasComments,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new en(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}en.DESCRIPTOR_NAME="TrackChangesAddSuggestionResponse",en.DESCRIPTOR={fields:{id:{type:"string",id:1},authorId:{type:"string",id:2},type:{type:"string",id:3},createdAt:{type:"string",id:4},data:{type:"string",id:5},hasComments:{type:"bool",id:6},state:{type:"string",id:7},attributes:{type:"string",id:8}}};class tn extends Te{constructor(e,t){super(),this.id=e,this.documentId=t}toJSON(){return{id:this.id,documentId:this.documentId}}static fromJSON(e){return new tn(e.id,e.documentId)}}tn.TYPE="103",tn.READABLE_TYPE_NAME="getSuggestion",tn.DESCRIPTOR_NAME="TrackChangesGetSuggestionMessage",tn.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2}}};class nn extends Te{constructor(e,t,n,r,s,o,i={},a=null){super(),this.id=e,this.authorId=t,this.type=n,this.hasComments=s,this.state=o,this.data=i,this.attributes=a,this.createdAt=new Date(r)}toJSON(){return{id:this.id,authorId:this.authorId,type:this.type,createdAt:this.createdAt.toISOString(),data:JSON.stringify(this.data),hasComments:this.hasComments,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new nn(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}nn.DESCRIPTOR_NAME="TrackChangesGetSuggestionResponse",nn.DESCRIPTOR={fields:{id:{type:"string",id:1},authorId:{type:"string",id:2},type:{type:"string",id:3},createdAt:{type:"string",id:4},data:{type:"string",id:5},hasComments:{type:"bool",id:6},state:{type:"string",id:7},attributes:{type:"string",id:8}}};class rn extends Te{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new rn(e.documentId)}}rn.TYPE="102",rn.READABLE_TYPE_NAME="getAllSuggestions",rn.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionMessage",rn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};class sn extends Pe{static toJSON(e){var t;return{...e,data:e.data?JSON.stringify(e.data):e.data,attributes:e.attributes?JSON.stringify(e.attributes):e.attributes,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(e){return{...e,data:e.data?JSON.parse(e.data):e.data,attributes:e.attributes?JSON.parse(e.attributes):e.attributes,createdAt:e.createdAt?new Date(e.createdAt):void 0}}}sn.DESCRIPTOR_NAME="SuggestionDescriptor",sn.DESCRIPTOR={fields:{id:{id:1,type:"string"},authorId:{id:2,type:"string"},type:{id:3,type:"string"},createdAt:{id:4,type:"string"},data:{id:5,type:"string"},hasComments:{id:6,type:"bool"},state:{id:7,type:"string"},attributes:{id:8,type:"string"}}};class on extends Te{constructor(e,t){super(),this._suggestions=e,this._suggestionsV2=t,this.suggestions=(null==t?void 0:t.length)?t:e}toJSON(){var e,t;return{suggestions:null===(e=this._suggestions)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),suggestionsV2:null===(t=this._suggestionsV2)||void 0===t?void 0:t.map(sn.toJSON)}}static fromJSON(e){var t,n;return new on(null===(t=e.suggestions)||void 0===t?void 0:t.map(an),null===(n=e.suggestionsV2)||void 0===n?void 0:n.map(sn.fromJSON))}}function an(e){const t=JSON.parse(e);return t.createdAt=t.createdAt?new Date(t.createdAt):void 0,t}on.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionsResponse",on.DESCRIPTOR={fields:{suggestions:{type:"string",rule:"repeated",id:1},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:2}}};class cn extends Te{constructor(e,t,n,r,s,o=null){super(),this.id=e,this.documentId=t,this.hasComments=n,this.isHasCommentsModified=r,this.state=s,this.attributes=o}toJSON(){return{id:this.id,documentId:this.documentId,hasComments:this.hasComments,isHasCommentsModified:this.isHasCommentsModified,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new cn(e.id,e.documentId,e.hasComments,e.isHasCommentsModified,e.state,e.attributes?JSON.parse(e.attributes):null)}}cn.TYPE="104",cn.READABLE_TYPE_NAME="updateSuggestion",cn.DESCRIPTOR_NAME="TrackChangesUpdateSuggestionMessage",cn.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2},hasComments:{type:"bool",id:3},isHasCommentsModified:{type:"bool",id:4},state:{type:"string",id:5},attributes:{type:"string",id:6}}};class dn extends Te{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new dn(e.documentId)}}dn.TYPE="105",dn.READABLE_TYPE_NAME="connectToSuggestions",dn.DESCRIPTOR_NAME="TrackChangesConnectMessage",dn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};class un extends Te{constructor(e,t,n){super(),this.channel=e,this._suggestions=t,this._suggestionsV2=n,this.suggestions=(null==n?void 0:n.length)?n:t}toJSON(){var e,t;return{channel:this.channel,suggestions:null===(e=this._suggestions)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),suggestionsV2:null===(t=this._suggestionsV2)||void 0===t?void 0:t.map(sn.toJSON)}}static fromJSON(e){var t,n;return new un(e.channel,null===(t=e.suggestions)||void 0===t?void 0:t.map((e=>JSON.parse(e))),null===(n=e.suggestionsV2)||void 0===n?void 0:n.map(sn.fromJSON))}}un.DESCRIPTOR_NAME="TrackChangesConnectResponse",un.DESCRIPTOR={fields:{channel:{type:"string",id:1},suggestions:{type:"string",rule:"repeated",id:2},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:3}}};class ln extends Te{constructor(e,t,n){super(),this.ids=e,this.documentId=t,this.state=n}toJSON(){return{ids:this.ids,documentId:this.documentId,state:this.state}}static fromJSON(e){return new ln(e.ids,e.documentId,e.state)}}ln.TYPE="106",ln.READABLE_TYPE_NAME="batchUpdateSuggestionsState",ln.DESCRIPTOR_NAME="TrackChangesBatchUpdateSuggestionsStateMessage",ln.DESCRIPTOR={fields:{ids:{type:"string",rule:"repeated",id:1},documentId:{type:"string",id:2},state:{type:"string",id:3}}};class pn extends((0,s.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==Nt.CONNECTED)throw new Fe("WebSocket Gateway is not connected.",e);const t=new dn(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(10,dn.TYPE,Ne.encode(t)),r=Ne.decode(n,un);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Mt._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,r.channel),this._isConnected=!0,this.fire("connected"),r.suggestions}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this.fire("disconnected"),this.stopListening())}async add(e,t,n,r=null,s){const o=new Xt(e,this._documentId,t,n,r,s),i=await this._sendRequest(Xt.TYPE,o);return Ne.decode(i,en)}async get(e,t=1){const n=new tn(e,this._documentId);try{const e=await this._sendRequest(tn.TYPE,n);return Ne.decode(e,nn)}catch(n){if("CKEditorCloudServicesServerError"===n.name&&"404"===n.code&&t<5)return await(r=100*t,new Promise((e=>{setTimeout(e,r)}))),this.get(e,t+1);if("CKEditorCloudServicesServerError"===n.name)throw n;throw He.fromPublicError(n)}var r}async getAll(){const e=new rn(this._documentId),t=await this._sendRequest(rn.TYPE,e),{suggestions:n}=Ne.decode(t,on);return n}async update(e,t={}){const{hasComments:n,state:r,attributes:s}=t,o=void 0!==n,i=new cn(e,this._documentId,n,o,r,s);await this._sendRequest(cn.TYPE,i)}async batchUpdateState(e){const t=new ln(e.ids,this._documentId,e.state);await this._sendRequest(ln.TYPE,t)}_connectToChannel(e,t){this._channel=e._getChannel(pn._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(cn.TYPE),((e,t)=>{const n=Ne.decode(t,cn);this.fire("suggestionUpdated",n)}))}_onWsGatewayStateChange(e){e===Nt.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new Qt("Track Changes",this);return this._wsGateway._sendRequest(10,e,Ne.encode(t))}}pn._SERVICE=10;const hn=pn;class fn extends Te{constructor(e,t=[]){super(),this.channel=e,this.sockets=t}toJSON(){return{channel:this.channel,sockets:this.sockets.map((e=>({user:e.userId,session:e.id,role:e.role,permissions:e.permissions})))}}static fromJSON(e){return new fn(e.channel,e.sockets.map((e=>({id:e.session,userId:e.user,role:e.role,permissions:e.permissions}))))}}fn.DESCRIPTOR_NAME="SessionsConnectResponse",fn.DESCRIPTOR={fields:{channel:{type:"string",id:1},sockets:{rule:"repeated",type:"SessionsSocketDescriptor",id:2}}};class mn extends Te{constructor(e,t){super(),this.id=e,this.sessionType=t}toJSON(){return{id:this.id,sessionType:this.sessionType}}static fromJSON(e){return new mn(e.id,e.sessionType)}}mn.TYPE="31",mn.READABLE_TYPE_NAME="getConnectedSockets",mn.DESCRIPTOR_NAME="SessionsConnectMessage",mn.DESCRIPTOR={fields:{id:{type:"string",id:1},sessionType:{type:"uint32",id:2}}};class yn extends Te{constructor(e,t,n,r){super(),this.id=e,this.userId=t,this.role=n,this.permissions=r}toJSON(){var e,t,n;return{id:this.id,userId:null!==(e=this.userId)&&void 0!==e?e:void 0,role:null!==(t=this.role)&&void 0!==t?t:void 0,permissions:null!==(n=this.permissions)&&void 0!==n?n:void 0}}static fromJSON(e){return new yn(e.id,e.userId,e.role,e.permissions)}}yn.TYPE="32",yn.READABLE_TYPE_NAME="connectSocket",yn.DESCRIPTOR_NAME="SocketConnectMessage",yn.DESCRIPTOR={fields:{id:{type:"string",id:1},userId:{type:"string",id:2},role:{type:"string",id:3},permissions:{rule:"repeated",type:"string",id:4}}};class gn extends Te{constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new gn(e.id)}}gn.TYPE="33",gn.READABLE_TYPE_NAME="disconnectSocket",gn.DESCRIPTOR_NAME="SocketDisconnectMessage",gn.DESCRIPTOR={fields:{id:{type:"string",id:1}}};const bn=class extends s.Collection{constructor(e,t){super({idProperty:"id"}),this._id=e,this._sessionType=t,this._handlers=new Map,this._eventsQueue=[],this._isRunning=!1}async connect(e){this._wsGateway=e,this.stopListening(e,"change:state");const t=new mn(this._id,this._sessionType);let n;try{const e=await this._wsGateway._sendRequest(3,mn.TYPE,Ne.encode(t));n=Ne.decode(e,fn)}catch(e){n=new fn(this._id,[])}this._connectToChannel(this._wsGateway,n.channel,this._sessionType);const r=await async function(e,t){const n=t.map((e=>e.userId)),r=n.length?await ze.getMany(e,n):[];return t.map((e=>{const t={id:e.id,role:e.role,permissions:e.permissions};return t.user=e.userId&&r.find((t=>t.id===e.userId))||new ze,t}))}(this._wsGateway,n.sockets);for(const e of r)super.add(e);this._connected=!0,this.fire("connected"),this.listenTo(this._wsGateway,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Mt._CHANGE_STATE_EVENT_PRIORITY}),await this._runQueue()}disconnect(e=!0){if(this._connected){for(this._connected=!1,this._eventsQueue=[];this.length;)super.remove(0);this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._wsGateway&&e&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this.fire("disconnected"),e&&this.stopListening()}}add(e,t){throw new TypeError("The collection is read-only.")}remove(e){throw new TypeError("The collection is read-only.")}_connectToChannel(e,t,n){this._channel=e._getChannel(n,t),this._channel&&(this._addHandler(this._channel,yn.TYPE,(async t=>{const n=Ne.decode(t,yn);if(-1===this.getIndex(n.id)){const t={id:n.id,role:n.role,permissions:n.permissions};n.userId&&(t.user=await ze.get(e,n.userId)),super.add(t)}})),this._addHandler(this._channel,gn.TYPE,(e=>{const t=Ne.decode(e,gn);-1!==this.getIndex(t.id)&&super.remove(t.id)})))}async _onWsGatewayStateChange(e){e===Mt.STATE_DISCONNECTED&&this.disconnect(!1),e===Mt.STATE_CONNECTED&&await this.connect(this._wsGateway)}async _runQueue(){if(this._isRunning||!this._connected)return;let e;for(this._isRunning=!0;e=this._eventsQueue.shift();){const t=this._handlers.get(e.eventName);t&&await t(e.data)}this._isRunning=!1}_addHandler(e,t,n){const r=e.getEventName(t,!0);this.listenTo(e,r,(async(e,t)=>{const n=e.name;this._eventsQueue.push({eventName:n,data:t}),await this._runQueue()})),this._handlers.set(r,n)}};var On,wn=new Uint8Array(16);function In(){if(!On&&!(On="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return On(wn)}const vn=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const Sn=function(e){return"string"==typeof e&&vn.test(e)};for(var An=[],Pn=0;Pn<256;++Pn)An.push((Pn+256).toString(16).substr(1));const Tn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(An[e[t+0]]+An[e[t+1]]+An[e[t+2]]+An[e[t+3]]+"-"+An[e[t+4]]+An[e[t+5]]+"-"+An[e[t+6]]+An[e[t+7]]+"-"+An[e[t+8]]+An[e[t+9]]+"-"+An[e[t+10]]+An[e[t+11]]+An[e[t+12]]+An[e[t+13]]+An[e[t+14]]+An[e[t+15]]).toLowerCase();if(!Sn(n))throw TypeError("Stringified UUID is invalid");return n};const _n=function(e,t,n){var r=(e=e||{}).random||(e.rng||In)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var s=0;s<16;++s)t[n+s]=r[s];return t}return Tn(r)};class kn{static async getConnectedSessions(e,t,n){const r=new bn(t,n);return await r.connect(e),r}}class Cn extends Te{constructor(e,t,n,r,s=""){super(),this.id=e,this.buffers=t,this.types=n,this.bundleVersion=r,this.lastOperationId=s}toJSON(){return{id:this.id,buffers:this.buffers,types:this.types,bundleVersion:this.bundleVersion,lastOperationId:this.lastOperationId}}static fromJSON(e){return new Cn(e.id,e.buffers,e.types,e.bundleVersion,e.lastOperationId)}}Cn.TYPE="11",Cn.READABLE_TYPE_NAME="connectToDocument",Cn.DESCRIPTOR_NAME="CollaborativeEditingConnectMessage",Cn.DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},buffers:{rule:"repeated",type:"bytes",id:3},types:{rule:"repeated",type:"uint32",id:4},lastOperationId:{type:"string",id:5}}};class En{static prepareMetadataForOperations(e,t){if(!(e&&e.length&&t&&t.length))return[];const n=[];let r=0;for(const s of e)if(0!==s){if(!t[r])throw new Error("Missing metadata for a operation");n.push(t[r]),r++}else n.push(n[n.length-1]);return n}static removeUnnecessaryMetadata(e,t){if(!(e&&e.length&&t&&t.length))return[];const n=[];for(let r=0;r<e.length;r++)if(0!==e[r]){if(!t[r])throw new Error("Missing metadata for a operation");n.push(t[r])}return n}}class jn extends Pe{static toJSON({createdAt:e,...t}){const n={...t};return(null==e?void 0:e.toISOString)&&(n.createdAt=e.toISOString()),n}static fromJSON({createdAt:e,...t}){const n={...t};return e&&(n.createdAt=new Date(e)),n}}jn.DESCRIPTOR_NAME="OperationMetadataDescriptor",jn.DESCRIPTOR={fields:{userId:{type:"string",id:1},type:{type:"string",id:2},createdAt:{type:"string",id:3}}};class Rn extends Te{constructor(e,t,n,r,s=[],o=""){super(),this.id=e,this.buffers=t,this.types=n,this.baseVersion=r,this.metadata=s,this.lastOperationId=o}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.baseVersion,lastOperationId:this.lastOperationId}}toJSON(){return{id:this.id,buffers:this.buffers,types:this.types,baseVersion:this.baseVersion,metadata:En.removeUnnecessaryMetadata(this.types,this.metadata).map(jn.toJSON),lastOperationId:this.lastOperationId}}static fromJSON(e){return new Rn(e.id,e.buffers,e.types,e.baseVersion,En.prepareMetadataForOperations(e.types,e.metadata).map(jn.fromJSON),e.lastOperationId)}}Rn.TYPE="13",Rn.READABLE_TYPE_NAME="updateDocument",Rn.DESCRIPTOR_NAME="CollaborativeEditingUpdateMessage",Rn.DESCRIPTOR={fields:{id:{type:"string",id:1},baseVersion:{type:"uint32",id:2},buffers:{rule:"repeated",type:"bytes",id:3},types:{rule:"repeated",type:"uint32",id:4},metadata:{rule:"repeated",type:"OperationMetadataDescriptor",id:6},lastOperationId:{type:"string",id:7}}};class Dn extends Te{constructor(e,t,n){super(),this.id=e,this.lastKnowVersion=t,this.bundleVersion=n}toJSON(){return{id:this.id,bundleVersion:this.bundleVersion,lastKnowVersion:this.lastKnowVersion}}static fromJSON(e){return new Dn(e.id,e.lastKnowVersion,e.bundleVersion)}}Dn.TYPE="12",Dn.READABLE_TYPE_NAME="reconnectToDocument",Dn.DESCRIPTOR_NAME="CollaborativeEditingReconnectMessage",Dn.DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},lastKnowVersion:{type:"uint32",id:3}}};class Nn extends Te{constructor(e,t=[],n=[],r=[],s="",o=null){super(),this.version=e,this.buffers=t,this.types=n,this.metadata=r,this.lastOperationId=s,this.lastOperationAcceptedAt=o}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.version-this.types.length,lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt}}get wereChangesApplied(){var e;return!(null===(e=this.types)||void 0===e?void 0:e.length)}toJSON(){return{version:this.version,buffers:this.buffers,types:this.types,metadata:En.removeUnnecessaryMetadata(this.types,this.metadata).map(jn.toJSON),lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt instanceof Date?this.lastOperationAcceptedAt.toISOString():this.lastOperationAcceptedAt}}static fromJSON(e){return new Nn(e.version,e.buffers,e.types,En.prepareMetadataForOperations(e.types,e.metadata).map(jn.fromJSON),e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}static create(e){return new Nn(e.version,e.buffers,e.types,e.metadata,e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}}Nn.DESCRIPTOR_NAME="CollaborativeEditingResponse",Nn.DESCRIPTOR={fields:{version:{type:"uint32",id:1},buffers:{rule:"repeated",type:"bytes",id:2},types:{rule:"repeated",type:"uint32",id:3},metadata:{rule:"repeated",type:"OperationMetadataDescriptor",id:5},lastOperationId:{type:"string",id:6},lastOperationAcceptedAt:{type:"string",id:7}}};class xn extends Te{constructor(e,t,n=[],r=[],s=0,o=[],i=null,a="",c="",d=null){super(),this.channel=e,this.version=t,this.buffers=n,this.types=r,this.offset=s,this.metadata=o,this.initData=i,this.sessionId=a,this.lastOperationId=c,this.sessionCreatedAt=d}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.version-this.types.length,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt}}get wereChangesApplied(){var e;return!(null===(e=this.types)||void 0===e?void 0:e.length)&&null===this.initData}toJSON(){var e;return{channel:this.channel,version:this.version,sessionId:this.sessionId,buffers:this.buffers,types:this.types,offset:this.offset,metadata:En.removeUnnecessaryMetadata(this.types,this.metadata).map(jn.toJSON),initData:null!==(e=this.initData)&&void 0!==e?e:"",isInitialized:"string"==typeof this.initData,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt?this.sessionCreatedAt.toISOString():null}}static create(e){return new xn(e.channel,e.version,e.buffers,e.types,e.offset,e.metadata,e.initData,e.sessionId,e.lastOperationId,e.sessionCreatedAt)}static fromJSON(e){var t;let n=null;return!0===e.isInitialized?n=null!==(t=e.initData)&&void 0!==t?t:"":"boolean"!=typeof e.isInitialized&&e.initData&&(n=e.initData),xn.create({channel:e.channel,version:e.version,buffers:e.buffers,types:e.types,offset:e.offset,metadata:En.prepareMetadataForOperations(e.types,e.metadata).map(jn.fromJSON),initData:n,sessionId:e.sessionId,lastOperationId:e.lastOperationId,sessionCreatedAt:e.sessionCreatedAt?new Date(e.sessionCreatedAt):null})}}xn.DESCRIPTOR_NAME="CollaborativeEditingConnectResponse",xn.DESCRIPTOR={fields:{channel:{type:"string",id:1},offset:{type:"uint32",id:2},version:{type:"uint32",id:3},buffers:{rule:"repeated",type:"bytes",id:4},types:{rule:"repeated",type:"uint32",id:5},metadata:{rule:"repeated",type:jn.DESCRIPTOR_NAME,id:7},initData:{type:"string",id:8},isInitialized:{type:"bool",id:9},sessionId:{type:"string",id:10},lastOperationId:{type:"string",id:11},sessionCreatedAt:{type:"string",id:12}}};class Vn extends Te{constructor(e,t){super(),this.lastDocumentSession=e,this.currentDocumentSession=t}get data(){var e,t,n,r,s;return{lastDocumentSessionId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.id,lastDocumentSessionOperationId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(s=this.currentDocumentSession)||void 0===s?void 0:s.lastOperationId}}toJSON(){var e,t,n,r,s;return{lastDocumentSessionId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.id,lastDocumentSessionOperationId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(s=this.currentDocumentSession)||void 0===s?void 0:s.lastOperationId}}static fromJSON(e){const t=e.lastDocumentSessionId?{id:e.lastDocumentSessionId,lastOperationId:e.lastDocumentSessionOperationId}:void 0,n=e.currentDocumentSessionId?{lastOperationId:e.currentDocumentSessionOperationId,version:e.currentDocumentSessionVersion,id:e.currentDocumentSessionId}:void 0;return new Vn(t,n)}}Vn.DESCRIPTOR_NAME="GetDocumentDetailsResponse",Vn.DESCRIPTOR={fields:{lastDocumentSessionId:{type:"string",id:1},lastDocumentSessionOperationId:{type:"string",id:2},currentDocumentSessionId:{type:"string",id:3},currentDocumentSessionVersion:{type:"uint32",id:4},currentDocumentSessionOperationId:{type:"string",id:5}}};class Mn extends Te{constructor(e){super(),this.documentId=e}get data(){return{documentId:this.documentId}}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Mn(e.documentId)}}Mn.TYPE="14",Mn.READABLE_TYPE_NAME="getDocumentDetails",Mn.DESCRIPTOR_NAME="GetDocumentDetailsMessage",Mn.DESCRIPTOR={fields:{documentId:{type:"string",id:1},environmentId:{type:"string",id:2}}};class Bn extends((0,s.EmitterMixin)()){constructor(e,t){if(super(),!e)throw new TypeError('Param "bundleVersion" must be provided.');this._id=null!=t?t:_n(),this._isConnected=!1,this._bundleVersion=e}getId(){return this._id}isConnected(){return this._isConnected}connect(e,t={buffers:[],types:[]},n){const r=new Cn(this.getId(),t.buffers,t.types,this._bundleVersion,n);return this._connect(e,r)}reconnect(e,t){if(this.isConnected())throw new Fe("Cannot reconnect to already connected service.",e);return this._connect(e,new Dn(this.getId(),t,this._bundleVersion))}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._connectedSessions&&(this._connectedSessions.disconnect(),this._connectedSessions=void 0),this.fire("disconnected"),this.stopListening())}async getDocumentDetails(){const e=new Mn(this.getId());if(!this._wsGateway)throw new Qt("Collaborative Editing",this);const t=await this._wsGateway._sendRequest(1,Mn.TYPE,Ne.encode(e));return Ne.decode(t,Vn)}async sendOperations(e,t,n){if(!e||!e.types||!e.types.length)throw new Fe("Cannot send empty update.",this._wsGateway);const r="number"==typeof t?t:parseInt(t);if(!Number.isInteger(r)||r<0)throw new Fe("Base version not provided.",this._wsGateway);const s=new Rn(this.getId(),e.buffers,e.types,r,[],n);if(!this._wsGateway||!this._isConnected)throw new Qt("Collaborative Editing",this);const o=await this._wsGateway._sendRequest(1,Rn.TYPE,Ne.encode(s));return Ne.decode(o,Nn)}async getConnectedSessions(){if(!this._isConnected)throw new Qt("Collaborative Editing",this);return this._connectedSessions||(this._connectedSessions=await kn.getConnectedSessions(this._wsGateway,this._id,1)),this._connectedSessions}static getConnectedSessions(e,t){return kn.getConnectedSessions(e,t,1)}async _connect(e,t){if(this.isConnected())return;if(e.state!==Mt.STATE_CONNECTED)throw new Fe("WebSocket Gateway is not connected.",e);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(1,t.constructor.TYPE,Ne.encode(t)),r=Ne.decode(n,xn);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Mt._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,r.channel),this._isConnected=!0,this.fire("connected"),r}_connectToChannel(e,t){this._channel=e._getChannel(1,t),this.listenTo(this._channel,this._channel.getEventName(Rn.TYPE),((e,t)=>{const n=Ne.decode(t,Rn);this.fire("operationsReceived",n.baseVersion,n.data,n.metadata)}))}_onWsGatewayStateChange(e){e===Mt.STATE_DISCONNECTED&&this.disconnect()}}Bn._SERVICE=1;const Un=Bn;class Jn extends Pe{static toJSON(e){var t;return{...e,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null}}static fromJSON(e){return{...e,createdAt:new Date(e.createdAt),attributes:e.attributes?JSON.parse(e.attributes):null}}}Jn.DESCRIPTOR_NAME="CommentDescriptor",Jn.DESCRIPTOR={fields:{commentId:{id:1,type:"string"},commentThreadId:{id:2,type:"string"},userId:{id:3,type:"string"},content:{id:4,type:"string"},documentId:{id:5,type:"string"},createdAt:{id:6,type:"string"},attributes:{id:7,type:"string"}}};class qn extends Pe{static toJSON(e){var t,n,r,s,o;return{...e,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),deletedAt:null===(n=e.deletedAt)||void 0===n?void 0:n.toISOString(),resolvedAt:null===(r=e.resolvedAt)||void 0===r?void 0:r.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null,context:e.context?JSON.stringify(e.context):e.context,comments:null===(s=e.comments)||void 0===s?void 0:s.map(Jn.toJSON),unlinkedAt:null===(o=e.unlinkedAt)||void 0===o?void 0:o.toISOString()}}static fromJSON(e){var t;return{...e,createdAt:e.createdAt?new Date(e.createdAt):void 0,deletedAt:e.deletedAt?new Date(e.deletedAt):void 0,resolvedAt:e.resolvedAt?new Date(e.resolvedAt):void 0,attributes:e.attributes?JSON.parse(e.attributes):null,context:e.context?JSON.parse(e.context):void 0,comments:null===(t=e.comments)||void 0===t?void 0:t.map(Jn.fromJSON),unlinkedAt:e.unlinkedAt?new Date(e.unlinkedAt):void 0}}}qn.DESCRIPTOR_NAME="CommentsThreadDescriptor",qn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},comments:{type:"CommentDescriptor",rule:"repeated",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4},context:{type:"string",id:5},createdAt:{type:"string",id:6},deletedAt:{type:"string",id:7},attributes:{type:"string",id:8},unlinkedAt:{type:"string",id:9}}};class Ln extends Te{constructor(e,t,n,r="",s,o="",i=null,a){super(),this.documentId=e,this.commentThreadId=t,this.content=n,this.commentId=r,this.userId=o,this.attributes=i,this.commentThread=a,this.createdAt=s?new Date(s):""}toJSON(){return{commentThreadId:this.commentThreadId,content:this.content,documentId:this.documentId,commentId:this.commentId,createdAt:this.createdAt instanceof Date?this.createdAt.toISOString():this.createdAt,userId:this.userId,attributes:JSON.stringify(this.attributes),commentThread:this.commentThread?qn.toJSON(this.commentThread):void 0}}static fromJSON(e){return new Ln(e.documentId,e.commentThreadId,e.content,e.commentId?e.commentId:void 0,e.createdAt?new Date(e.createdAt):void 0,e.userId?e.userId:void 0,e.attributes?JSON.parse(e.attributes):{},e.commentThread?qn.fromJSON(e.commentThread):void 0)}}Ln.TYPE="91",Ln.READABLE_TYPE_NAME="addComment",Ln.DESCRIPTOR_NAME="CommentsV2AddCommentMessage",Ln.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},content:{type:"string",id:2},documentId:{type:"string",id:3},commentId:{type:"string",id:4},createdAt:{type:"string",id:5},userId:{type:"string",id:6},attributes:{type:"string",id:7},commentThread:{type:"CommentsThreadDescriptor",id:8}}};class Gn extends Te{constructor(e,t,n){super(),this.commentThreadId=e,this.commentId=t,this.createdAt=new Date(n)}toJSON(){return{commentThreadId:this.commentThreadId,commentId:this.commentId,createdAt:this.createdAt.toISOString()}}static fromJSON(e){return new Gn(e.commentThreadId,e.commentId,e.createdAt)}}Gn.DESCRIPTOR_NAME="CommentsV2AddCommentResponse",Gn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},createdAt:{type:"string",id:3}}};class Yn extends Te{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Yn(e.documentId)}}Yn.TYPE="92",Yn.READABLE_TYPE_NAME="connectToComment",Yn.DESCRIPTOR_NAME="CommentsV2ConnectMessage",Yn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};class zn extends Te{constructor(e,t,n){super(),this.channel=e,this._threads=t,this._threadsV2=n,this.threads=(null==n?void 0:n.length)?n:t}toJSON(){var e,t;return{channel:this.channel,threads:null===(e=this._threads)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),threadsV2:null===(t=this._threadsV2)||void 0===t?void 0:t.map(qn.toJSON)}}static fromJSON(e){var t,n;return new zn(e.channel,null===(t=e.threads)||void 0===t?void 0:t.map((e=>JSON.parse(e))),null===(n=e.threadsV2)||void 0===n?void 0:n.map(qn.fromJSON))}}zn.DESCRIPTOR_NAME="CommentsV2ConnectResponse",zn.DESCRIPTOR={fields:{channel:{type:"string",id:1},threads:{type:"string",rule:"repeated",id:2},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:3}}};class Fn extends Te{constructor(e,t,n){super(),this.documentId=e,this.commentThreadId=t,this.commentId=n}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,commentId:this.commentId}}static fromJSON(e){return new Fn(e.documentId,e.commentThreadId,e.commentId)}}Fn.TYPE="95",Fn.READABLE_TYPE_NAME="removeComment",Fn.DESCRIPTOR_NAME="CommentsV2RemoveCommentMessage",Fn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},documentId:{type:"string",id:3}}};class Hn extends Te{constructor(e,t){super(),this.documentId=e,this.commentThreadId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new Hn(e.documentId,e.commentThreadId)}}Hn.TYPE="97",Hn.READABLE_TYPE_NAME="removeCommentThread",Hn.DESCRIPTOR_NAME="CommentsV2RemoveCommentThreadMessage",Hn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};class Kn extends Te{constructor(e,t,n,r,s=null,o=!1,i){super(),this.documentId=e,this.commentThreadId=t,this.commentId=n,this.content=r,this.attributes=s,this.isAttributesUpdated=o,this.commentThread=i}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,commentId:this.commentId,content:this.content,attributes:this.attributes?JSON.stringify(this.attributes):null,isAttributesUpdated:this.isAttributesUpdated,commentThread:this.commentThread?qn.toJSON(this.commentThread):void 0}}static fromJSON(e){return new Kn(e.documentId,e.commentThreadId,e.commentId,e.content,e.attributes?JSON.parse(e.attributes):null,e.isAttributesUpdated,e.commentThread?qn.fromJSON(e.commentThread):void 0)}}Kn.TYPE="96",Kn.READABLE_TYPE_NAME="updateComment",Kn.DESCRIPTOR_NAME="CommentsV2UpdateCommentMessage",Kn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},content:{type:"string",id:3},documentId:{type:"string",id:4},attributes:{type:"string",id:5},isAttributesUpdated:{type:"bool",id:6},commentThread:{type:"CommentsThreadDescriptor",id:7}}};class Wn extends Te{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId}}static fromJSON(e){return new Wn(e.commentThreadId,e.documentId)}}Wn.TYPE="93",Wn.READABLE_TYPE_NAME="getComment",Wn.DESCRIPTOR_NAME="CommentsV2GetCommentThreadMessage",Wn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};class Qn extends Te{constructor(e,t,n,r,s,o,i,a,c,d){super(),this.commentThreadId=e,this._comments=t,this._commentsV2=n,this.resolvedBy=s,this.comments=(null==n?void 0:n.length)?n:t,this.createdAt=i?new Date(i):void 0,this.deletedAt="string"==typeof a?new Date(a):a,this.resolvedAt="string"==typeof c?new Date(c):c,this.unlinkedAt="string"==typeof d?new Date(d):d,this.attributes="string"==typeof r?JSON.parse(r):r,this.context="string"==typeof o?JSON.parse(o):o}toJSON(){var e,t,n,r,s,o;return{commentThreadId:this.commentThreadId,comments:null===(e=this._comments)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),commentsV2:null===(t=this._commentsV2)||void 0===t?void 0:t.map(Jn.toJSON),attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,context:this.context?JSON.stringify(this.context):this.context,resolvedBy:this.resolvedBy,createdAt:null===(n=this.createdAt)||void 0===n?void 0:n.toISOString(),deletedAt:null===(r=this.deletedAt)||void 0===r?void 0:r.toISOString(),resolvedAt:null===(s=this.resolvedAt)||void 0===s?void 0:s.toISOString(),unlinkedAt:null===(o=this.unlinkedAt)||void 0===o?void 0:o.toISOString()}}static fromJSON(e){var t,n;return new Qn(e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((e=>function(e){const t=JSON.parse(e);return{...t,createdAt:new Date(t.createdAt)}}(e))),null===(n=e.commentsV2)||void 0===n?void 0:n.map(Jn.fromJSON),e.attributes?JSON.parse(e.attributes):e.attributes,e.resolvedBy,e.context?JSON.parse(e.context):e.context,e.createdAt,e.deletedAt,e.resolvedAt,e.unlinkedAt)}}Qn.DESCRIPTOR_NAME="CommentsV2GetCommentThreadResponse",Qn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},comments:{type:"string",rule:"repeated",id:2},commentsV2:{type:"CommentDescriptor",rule:"repeated",id:3},resolvedAt:{type:"string",id:4},resolvedBy:{type:"string",id:5},context:{type:"string",id:6},createdAt:{type:"string",id:7},deletedAt:{type:"string",id:8},attributes:{type:"string",id:9},unlinkedAt:{type:"string",id:10}}};class Zn extends Te{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Zn(e.documentId)}}Zn.TYPE="94",Zn.READABLE_TYPE_NAME="getDocumentThreads",Zn.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsMessage",Zn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};class $n extends Te{constructor(e,t){super(),this._threads=e,this._threadsV2=t,this.threads=(null==t?void 0:t.length)?t:e}toJSON(){var e,t;return{threads:null===(e=this._threads)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),threadsV2:null===(t=this._threadsV2)||void 0===t?void 0:t.map(qn.toJSON)}}static fromJSON(e){var t,n;return new $n(null===(t=e.threads)||void 0===t?void 0:t.map((e=>function(e){var t;const n=JSON.parse(e),r={...n};return n.comments&&(r.comments=null===(t=n.comments)||void 0===t?void 0:t.map((e=>({...e,createdAt:new Date(e.createdAt)})))),r}(e))),null===(n=e.threadsV2)||void 0===n?void 0:n.map(qn.fromJSON))}}$n.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsResponse",$n.DESCRIPTOR={fields:{threads:{type:"string",rule:"repeated",id:1},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:2}}};class Xn extends Pe{static toJSON(e){var t;return{commentId:e.commentId,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(e){return{commentId:e.commentId,createdAt:new Date(e.createdAt)}}}Xn.DESCRIPTOR_NAME="CommentThreadAddedCommentDescriptor",Xn.DESCRIPTOR={fields:{commentId:{id:1,type:"string"},createdAt:{id:2,type:"string"}}};class er extends Te{constructor(e,t,n=[]){super(),this.commentThreadId=e,this.comments=n,this.createdAt=new Date(t)}toJSON(){return{commentThreadId:this.commentThreadId,createdAt:this.createdAt.toISOString(),comments:this.comments.map((e=>Xn.toJSON(e)))}}static fromJSON(e){return new er(e.commentThreadId,e.createdAt,e.comments.map((e=>Xn.fromJSON(e))))}}er.DESCRIPTOR_NAME="CommentsV2AddCommentThreadResponse",er.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},createdAt:{type:"string",id:2},comments:{type:"CommentThreadAddedCommentDescriptor",rule:"repeated",id:3}}};class tr extends Te{constructor(e,t,n=[],r,s=null,o=null,i=null,a=null,c=null){super(),this.documentId=e,this.commentThreadId=t,this.comments=n,this.context=r,this.resolvedBy=s,this.attributes=c,this.createdAt=o?new Date(o):"",this.resolvedAt=i?new Date(i):"",this.deletedAt=a?new Date(a):""}toJSON(){var e;return{commentThreadId:this.commentThreadId,context:this.context?JSON.stringify(this.context):this.context,documentId:this.documentId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt instanceof Date?this.resolvedAt.toISOString():this.resolvedAt,deletedAt:this.deletedAt instanceof Date?this.deletedAt.toISOString():this.deletedAt,createdAt:this.createdAt instanceof Date?this.createdAt.toISOString():this.createdAt,attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,comments:null===(e=this.comments)||void 0===e?void 0:e.map((e=>Jn.toJSON(e)))}}static fromJSON(e){var t;return new tr(e.documentId,e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((t=>Jn.fromJSON({...t,documentId:e.documentId,commentThreadId:e.commentThreadId}))),e.context?JSON.parse(e.context):e.context,e.resolvedBy,e.createdAt?new Date(e.createdAt):void 0,e.resolvedAt?new Date(e.resolvedAt):void 0,e.deletedAt?new Date(e.deletedAt):void 0,e.attributes?JSON.parse(e.attributes):e.attributes)}}tr.TYPE="140",tr.READABLE_TYPE_NAME="addCommentThread",tr.DESCRIPTOR_NAME="CommentsV2AddCommentThreadMessage",tr.DESCRIPTOR={fields:{documentId:{type:"string",id:1},commentThreadId:{type:"string",id:2},context:{type:"string",id:3},createdAt:{type:"string",id:4},resolvedAt:{type:"string",id:5},resolvedBy:{type:"string",id:6},attributes:{type:"string",id:7},deletedAt:{type:"string",id:8},comments:{type:"CommentDescriptor",rule:"repeated",id:9}}};class nr extends Te{constructor(e,t,n,r){super(),this.commentThreadId=e,this.documentId=t,this.resolvedBy=n,this.resolvedAt=r?new Date(r):void 0}toJSON(){var e;return{documentId:this.documentId,commentThreadId:this.commentThreadId,resolvedBy:this.resolvedBy,resolvedAt:null===(e=this.resolvedAt)||void 0===e?void 0:e.toISOString()}}static fromJSON(e){return new nr(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}nr.TYPE="142",nr.READABLE_TYPE_NAME="resolveCommentThread",nr.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadMessage",nr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedBy:{type:"string",id:3},resolvedAt:{type:"string",id:4}}};class rr extends Te{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new rr(e.commentThreadId,e.documentId)}}rr.TYPE="141",rr.READABLE_TYPE_NAME="reopenCommentThread",rr.DESCRIPTOR_NAME="CommentsV2ReopenCommentThreadMessage",rr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};class sr extends Te{constructor(e,t,n,r=null,s=null){super(),this.commentThreadId=e,this.documentId=t,this.context=n,this.attributes=r,this.unlinkedAt=s?new Date(s):""}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,context:this.context?JSON.stringify(this.context):this.context,attributes:this.attributes?JSON.stringify(this.attributes):null,unlinkedAt:this.unlinkedAt instanceof Date?this.unlinkedAt.toISOString():this.unlinkedAt}}static fromJSON(e){return new sr(e.commentThreadId,e.documentId,e.context?JSON.parse(e.context):e.context,e.attributes?JSON.parse(e.attributes):null,e.unlinkedAt?new Date(e.unlinkedAt):null)}}sr.TYPE="143",sr.READABLE_TYPE_NAME="updateCommentThread",sr.DESCRIPTOR_NAME="CommentsV2UpdateCommentThreadMessage",sr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},context:{type:"string",id:3},attributes:{type:"string",id:4},unlinkedAt:{type:"string",id:5}}};class or extends Te{constructor(e,t,n,r){super(),this.commentThreadId=e,this.documentId=t,this.resolvedBy=n,this.resolvedAt=new Date(r)}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt.toISOString()}}static fromJSON(e){return new or(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}or.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadResponse",or.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4}}};class ir extends((0,s.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==Nt.CONNECTED)throw new Fe("WebSocket Gateway is not connected.",e);const t=new Yn(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(9,Yn.TYPE,Ne.encode(t)),{channel:r,threads:s}=Ne.decode(n,zn);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Mt._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,r),this._isConnected=!0,this.fire("connected"),s}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._connectedSessions&&(this._connectedSessions.disconnect(),this._connectedSessions=void 0),this.fire("disconnected"),this.stopListening())}async addComment(e,t,n,r){const s=new Ln(this._documentId,e,n,t,void 0,void 0,r),o=await this._sendRequest(Ln.TYPE,s);return Ne.decode(o,Gn)}async updateComment(e,t,n,r){const s=void 0!==r,o=new Kn(this._documentId,e,t,n,r,s);await this._sendRequest(Kn.TYPE,o)}async removeComment(e,t){const n=new Fn(this._documentId,e,t);await this._sendRequest(Fn.TYPE,n)}async removeCommentThread(e){const t=new Hn(this._documentId,e);await this._sendRequest(Hn.TYPE,t)}async addCommentThread(e){var t;const n=new tr(this._documentId,e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((t=>({...t,documentId:this._documentId,commentThreadId:e.commentThreadId}))),e.context,e.resolvedBy,e.createdAt,e.resolvedAt,e.deletedAt,e.attributes),r=await this._sendRequest(tr.TYPE,n);return Ne.decode(r,er)}async resolveCommentThread(e){const t=new nr(e,this._documentId),n=await this._sendRequest(nr.TYPE,t);return Ne.decode(n,or)}async reopenCommentThread(e){const t=new rr(e,this._documentId);await this._sendRequest(rr.TYPE,t)}async updateCommentThread(e){const t=new sr(e.commentThreadId,this._documentId,e.context,e.attributes,e.unlinkedAt);await this._sendRequest(sr.TYPE,t)}async getCommentThread(e,t=1){const n=new Wn(e,this._documentId);try{const e=await this._sendRequest(Wn.TYPE,n),t=Ne.decode(e,Qn);return{commentThreadId:t.commentThreadId,comments:t.comments,attributes:t.attributes,context:t.context,resolvedAt:t.resolvedAt,resolvedBy:t.resolvedBy,deletedAt:t.deletedAt,unlinkedAt:t.unlinkedAt}}catch(n){if("CKEditorCloudServicesServerError"===n.name&&"404"===n.code&&t<5)return await(r=100*t,new Promise((e=>{setTimeout(e,r)}))),this.getCommentThread(e,t+1);if("CKEditorCloudServicesServerError"===n.name)throw n;throw He.fromPublicError(n)}var r}async getDocumentThreads(){const e=new Zn(this._documentId),t=await this._sendRequest(Zn.TYPE,e),{threads:n}=Ne.decode(t,$n);return{threads:n}}async getConnectedSessions(){if(!this._isConnected)throw new Qt("Comments",this);return this._connectedSessions||(this._connectedSessions=await kn.getConnectedSessions(this._wsGateway,this._documentId,9)),this._connectedSessions}_connectToChannel(e,t){this._channel=e._getChannel(ir._SERVICE,t),this._channel&&(this.listenTo(this._channel,this._channel.getEventName(Ln.TYPE),((e,t)=>{const n=Ne.decode(t,Ln);this.fire("commentAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(Fn.TYPE),((e,t)=>{const n=Ne.decode(t,Fn);this.fire("commentRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(Kn.TYPE),((e,t)=>{const n=Ne.decode(t,Kn);this.fire("commentUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(Hn.TYPE),((e,t)=>{const n=Ne.decode(t,Hn);this.fire("commentThreadRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(tr.TYPE),((e,t)=>{const n=Ne.decode(t,tr);this.fire("commentThreadAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(sr.TYPE),((e,t)=>{const n=Ne.decode(t,sr);this.fire("commentThreadUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(nr.TYPE),((e,t)=>{const n=Ne.decode(t,nr);this.fire("commentThreadResolved",n)})),this.listenTo(this._channel,this._channel.getEventName(rr.TYPE),((e,t)=>{const n=Ne.decode(t,rr);this.fire("commentThreadReopened",n)})))}_onWsGatewayStateChange(e){e===Nt.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new Qt("Comments",this);return this._wsGateway._sendRequest(9,e,Ne.encode(t))}}ir._SERVICE=9;const ar=ir;function cr(e,t){const n=ur();return(cr=function(e,t){return n[e-=344]})(e,t)}const dr=cr;function ur(){const e=["change:me","648SgostT","_reconnect","CONNECTING","config","CONNECTED","websocketgateway-missing-token","showWarning","_shouldPluginsReconnect","cloudservices-init","websocketgateway-missing-websocket-url","disconnect","cloudservices-reconnection-error","3755cWtwro","7495850FSaFct","state","WebSocketGateway","requires","webSocketUrl","connection","initialReconnectionInterval","error","isInReconnectionStack","connect","5100195UZdfbZ","_isBrowserOffline","addToReconnectionStack","offline","define","_domEmitter","bind","catch","add","websocketgateway-plugin-already-registered","destroy","CloudServices","all","init","has","create","then","4789728TXeZvb","constructor","_reconnectionStack","3396Jchfsy","DISCONNECTED","Connected users limit exceeded","removeFromReconnectionStack","4847598yubQqG","plugins","cloudServices.requestTimeout","reconnect","131139venUti","code","stopListening","2BncyNG","websocketgateway-invalid-plugin-interface","token","The limit of maximum concurrent connections that the collaboration server can handle has been reached. Try opening the document again in a few minutes. Please contact your system administrator if the problem persists.","260327hZLZUP","listenTo","cloudServices.connectionTimeout","function","delete","online","pluginName","set","real-time-collaboration","connected","context","get","from","limitExceeded"];return(ur=function(){return e})()}!function(e,t){const n=cr,r=e();for(;;)try{if(974782===-parseInt(n(360))/1*(parseInt(n(356))/2)+parseInt(n(398))/3+parseInt(n(415))/4+parseInt(n(387))/5*(-parseInt(n(345))/6)+parseInt(n(349))/7+parseInt(n(375))/8*(-parseInt(n(353))/9)+-parseInt(n(388))/10)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(ur);class lr extends r.ContextPlugin{static get[dr(391)](){return[dr(409),o.Notification]}static get[dr(366)](){return dr(390)}constructor(e){const t=dr;super(e),this[t(367)](t(389),Nt[t(379)]),this[t(367)](t(399),!1),this[t(344)]=new Set,this[t(382)]=!1,this[t(403)]=Object[t(413)](s.DomEmitterMixin)}[dr(411)](){const e=dr,t=this[e(370)],n=t[e(350)][e(371)](e(409)),r=t[e(350)][e(371)](o.Notification);if(!n[e(358)])throw new s.CKEditorError(e(380),this);if(!n[e(392)])throw new s.CKEditorError(e(384),this);return this[e(403)][e(361)](window,e(401),(()=>this[e(399)]=!0)),this[e(403)][e(361)](window,e(365),(()=>this[e(399)]=!1)),this[e(370)][e(378)][e(402)](e(362),10),this[e(370)][e(378)][e(402)](e(351),20),lr[e(390)][e(397)](n[e(358)],n[e(392)],{timeout:1e3*this[e(370)][e(378)][e(371)](e(362)),requestTimeout:1e3*this[e(370)][e(378)][e(371)](e(351))})[e(414)]((t=>{const n=e;if(this[n(393)]=t,this[n(404)](n(389)).to(t,n(389),this,n(399),((e,t)=>(n(369)!==e&&(this[n(382)]=!0),t||e!==Nt[n(379)]?Nt[n(346)]:this[n(389)]==Nt[n(346)]&&this[n(382)]?(this[n(382)]=!1,this[n(376)](),Nt[n(377)]):Nt[n(379)]))),this[n(393)].on(n(395),((e,t)=>{const o=n;if(o(373)!==t[o(354)])throw console[o(395)](t),new s.CKEditorError(o(383),null,{originalError:t});r[o(381)](o(359),{title:o(347),namespace:o(368)})})),!t.me)return new Promise((e=>t.on(n(374),e)))}))[e(405)]((t=>{const n=e;throw console[n(395)](t),new s.CKEditorError(n(383),null,{originalError:t})}))}[dr(400)](e){const t=dr;if(t(363)!=typeof e[t(352)])throw new s.CKEditorError(t(357),this);if(this[t(396)](e))throw new s.CKEditorError(t(407),this,{name:e[t(416)][t(366)]});this[t(344)][t(406)](e)}[dr(348)](e){const t=dr;this[t(344)][t(364)](e)}[dr(396)](e){const t=dr;return this[t(344)][t(412)](e)}[dr(376)](){const e=dr;return this[e(393)][e(352)]()[e(414)]((()=>Promise[e(410)](Array[e(372)](this[e(344)],(t=>t[e(352)]())))))[e(414)]((()=>this[e(389)]=Nt[e(379)]))[e(405)]((t=>{const n=e;throw console[n(395)](t),new s.CKEditorError(n(386),this[n(370)])}))}[dr(408)](){const e=dr;this[e(393)]&&this[e(393)][e(385)](),this[e(389)]=Nt[e(346)],this[e(403)][e(355)](),super[e(408)]()}}lr[dr(390)]=Mt,lr[dr(394)]=1e3;const pr=lr;var hr=__webpack_require__(211);function fr(e,t){const n=yr();return(fr=function(e,t){return n[e-=306]})(e,t)}const mr=fr;function yr(){const e=["276150rkQvzf","listenTo","63TyiIeS","_uniqueUsersCount","addUser","_registeredSessions","1119200IfTgue","164604GLneBb","change:state","has","_handleSessionAdd","_createUser","size","set","get","sessionId","_users","context","290392nXivsN","getUserRole","12728uQGsdK","sessions-unregister-not-exist","mySessionId","658RGkmDB","remove","plugins","Sessions","role","clear","add","connected","fire","forEach","delete","1878dhzQTS","getUserBySessionId","defineMe","values","getUser","channelSessions","13pIdGLB","assign","sessions-register-already-registered","init","697870YIRFof","_handleSessionRemove","register","allConnectedUsers","connection","sessionAdd:","getUserSessions","channelConnectedUsers","isMe","user","requires","orderNumber","unregister","stopListening","pluginName","state"];return(yr=function(){return e})()}!function(e,t){const n=fr,r=e();for(;;)try{if(157209===-parseInt(n(357))/1*(-parseInt(n(337))/2)+-parseInt(n(324))/3+parseInt(n(335))/4+parseInt(n(361))/5+parseInt(n(351))/6*(-parseInt(n(340))/7)+parseInt(n(323))/8+parseInt(n(319))/9*(-parseInt(n(317))/10))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(yr);class gr extends r.ContextPlugin{static get[mr(315)](){return mr(343)}static get[mr(311)](){return[pr,hr.Users]}constructor(e){const t=mr;super(e),this[t(356)]=new Map,this[t(308)]=new Map,this[t(364)]=new s.Collection,this[t(322)]=new Map,this[t(320)]=0,this[t(333)]=this[t(334)][t(342)][t(331)](hr.Users)}[mr(360)](){const e=mr,t=this[e(334)][e(342)][e(331)](pr);this[e(318)](t,e(325),((t,n,r)=>{const s=e;if(s(347)!==r)this[s(356)][s(349)]((e=>e[s(345)]())),this[s(308)][s(349)]((e=>e[s(345)]())),this[s(364)][s(345)]();else for(const[e,t]of this[s(322)])for(const n of t)this[s(327)](e,n)})),this[e(328)](t[e(365)].me,!0)}[mr(363)](e,t){const n=mr;if(this[n(322)][n(326)](e))throw new s.CKEditorError(n(359),null,{channelId:e});this[n(322)][n(330)](e,t),this[n(356)][n(330)](e,new s.Collection),this[n(308)][n(330)](e,new s.Collection),this[n(318)](t,n(346),((t,r)=>this[n(327)](e,r))),this[n(318)](t,n(341),((t,r)=>this[n(362)](e,r)));for(const r of t)this[n(327)](e,r)}[mr(313)](e){const t=mr;if(!this[t(322)][t(326)](e))throw new s.CKEditorError(t(338),null,{channelId:e});const n=this[t(322)][t(331)](e);this[t(314)](n);for(const r of n)t(347)===this[t(334)][t(342)][t(331)](pr)[t(316)]&&this[t(362)](e,r);this[t(322)][t(350)](e),this[t(356)][t(350)](e),this[t(308)][t(350)](e)}get[mr(339)](){const e=mr;return this[e(334)][e(342)][e(331)](pr)[e(365)][e(332)]}[mr(352)](e){const t=mr;for(const n of this[t(356)][t(354)]())for(const r of n)if(r.id===e)return r[t(310)]}[mr(307)](e,t){const n=mr,r=t?[this[n(356)][n(331)](t)]:this[n(356)][n(354)](),s=new Set;for(const t of r)for(const r of t)r[n(310)].id===e.id&&s[n(346)](r.id);return s}[mr(336)](e){const t=mr;for(const n of this[t(356)][t(354)]())for(const r of n)if(r[t(310)]===e)return r[t(344)]}[mr(327)](e,t){const n=mr;if(n(347)!==this[n(334)][n(342)][n(331)](pr)[n(316)])return;const r=t[n(310)],s=this[n(333)][n(355)](r.id)||this[n(328)](r),o=Object[n(358)]({},t,{user:s});this[n(356)][n(331)](e)[n(346)](o);const i=this[n(308)][n(331)](e);i[n(326)](s.id)||i[n(346)](s),this[n(364)][n(326)](s.id)||this[n(364)][n(346)](s,s[n(309)]?0:void 0),this[n(348)](n(306)+e,{channelId:e,session:o})}[mr(362)](e,t){const n=mr;if(n(347)!==this[n(334)][n(342)][n(331)](pr)[n(316)])return;const r=this[n(308)][n(331)](e),s=t[n(310)];s.id&&(this[n(356)][n(331)](e)[n(341)](t.id),r[n(326)](s.id)&&!this[n(307)](s,e)[n(329)]&&r[n(341)](s.id),this[n(364)][n(331)](s.id)&&!this[n(307)](s)[n(329)]&&this[n(364)][n(341)](s.id))}[mr(328)](e,t){const n=mr,r=this[n(333)][n(321)](e);return t&&this[n(333)][n(353)](e.id),r[n(312)]=this[n(320)]++,r}}var br=__webpack_require__(673),Or=__webpack_require__.n(br),wr=__webpack_require__(535),Ir={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Or()(wr.A,Ir);wr.A.locals;const vr=Pr;!function(e,t){const n=Pr,r=e();for(;;)try{if(281111===parseInt(n(426))/1*(-parseInt(n(423))/2)+-parseInt(n(391))/3+-parseInt(n(406))/4*(-parseInt(n(411))/5)+-parseInt(n(365))/6*(-parseInt(n(372))/7)+parseInt(n(374))/8+parseInt(n(435))/9+parseInt(n(347))/10*(-parseInt(n(397))/11))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Tr);class Sr extends r.Plugin{constructor(){const e=Pr;super(...arguments),this[e(367)]=new((0,s.DomEmitterMixin)())}static get[vr(364)](){return[gr]}static get[vr(370)](){return vr(413)}[vr(385)](){const e=vr,t=this[e(338)],n=t[e(326)][e(352)](gr);t[e(432)][e(386)](e(362))[e(346)]({model:e(348),view:(r,{writer:s})=>function(t,n,r,s){const o=e,i=t[o(414)][o(404)](":")[2],a=r[o(417)](i);if(!a||i===r[o(329)])return;if(!s[o(442)][o(334)][o(393)](t[o(412)][o(437)],o(343)))return;const c={class:o(399)+a[o(325)][o(355)](),"data-name":a[o(342)],"data-session-id":i},d=s[o(442)][o(333)][o(352)](t[o(414)])[o(322)](),u=d[o(357)],l=s[o(442)][o(334)];if(u&&l[o(353)](u)&&l[o(438)](u)&&!s[o(442)][o(333)][o(352)](o(371)+i)[o(383)]()[o(339)])return;const p=d[o(439)];return s[o(442)][o(334)][o(402)](p)&&!s[o(442)][o(434)](p)&&(c[o(350)]=!1),function(e,t,n){const r=o,s=e[r(360)](r(420),t);return e[r(424)](r(403),!0,s),s[r(369)]=function(e){const t=r,s=this[t(331)](e);return s[t(389)]=t(324)+n[t(342)]+t(431),s[t(446)](t(433),(()=>{const e=t;s[e(445)][e(407)](e(405))})),s[t(446)](t(378),(()=>{const e=t;s[e(445)][e(384)](e(405))})),s},s[r(382)]=function(e){const t=r;return!(!this[t(398)](t(403))||!e[t(398)](t(403))||this[t(410)](t(429))!=e[t(410)](t(429)))},s}(n,c,a)}(r,s,n,t)}),t[e(432)][e(386)](e(362))[e(421)]({model:e(341),view:t=>function(t,n){const r=e,s=t[r(414)][r(404)](":")[2];if(s===n[r(329)])return null;const o=n[r(417)](s);return o?{id:s,classes:[r(430),o[r(325)][r(447)]()],attributes:{"data-session-id":s},priority:2e3+o[r(401)]}:{id:s,classes:[]}}(t,n)}),function(t){const n=e,r=t[n(442)],s=new Map,o=t[n(326)][n(352)](gr);r[n(333)].on(n(344),((e,a,c,d)=>{const u=n;if(!d&&s[u(352)](a[u(342)]))return s[u(352)](a[u(342)])[u(359)](),void s[u(400)](a[u(342)]);const l=a[u(342)][u(404)](":")[2];if(l===o[u(329)])return;const p=u(363)+l;r[u(333)][u(436)](p)&&t[u(354)][u(376)](p),a.on(u(323),((e,t,n)=>{const o=u;if(o(427)!=t[o(349)][o(373)]&&o(427)==a[o(383)]()[o(349)][o(373)]&&!s[o(436)](a[o(342)])){const e=r[o(334)][o(448)](n[o(422)]);if(e){const t=i.LiveRange[o(443)](e);s[o(351)](a[o(342)],t),t.on(o(323),((e,n,i)=>{const c=o;if(c(427)==t[c(349)][c(373)]){const e=r[c(334)][c(448)](i[c(422)]);e?(t[c(437)]=e[c(437)],t[c(409)]=e[c(409)]):(s[c(400)](a[c(342)]),t[c(359)]())}}))}}}))})),r[n(368)].on(n(441),(()=>{const e=n;s[e(318)]>0&&r[e(392)]({isUndoable:!1},(t=>{const n=e;for(const[e,o]of s)n(427)==r[n(333)][n(352)](e)[n(383)]()[n(349)][n(373)]&&(Ar(e[n(404)](":")[2],o[n(380)](),r,t),o[n(359)]());s[n(319)]()}))}))}(t),this[e(367)][e(375)](s.global[e(368)],e(377),((n,{key:r})=>{const s=e;s(390)===r&&function(e){const t=s;e[t(354)][t(321)][t(441)]((n=>{const r=t;for(const t of e[r(442)][r(333)]){if(!t[r(342)][r(428)](r(348)))continue;const s=e[r(354)][r(327)][r(345)](t[r(342)]);if(s)for(const e of s)n[r(415)](r(405),e)}}))}(t)}),{useCapture:!0})}[vr(396)](){const e=vr,t=this[e(338)],n=t[e(395)][e(352)](e(366));n&&t[e(442)].on(e(320),((r,s)=>{const o=e,i=s[0];if(o(340)!=i[o(358)]||!i[o(342)][o(428)](o(337)))return;const a=i[o(328)];n[o(408)][o(436)](a)&&(i[o(361)]=i[o(419)]?t[o(442)][o(336)](i[o(419)][o(437)],i[o(419)][o(409)]):null)}),{priority:e(444)})}[vr(425)](){const e=vr;return this[e(367)][e(418)](),super[e(425)]()}[vr(387)](){const e=vr,t=this[e(338)],n=t[e(442)][e(368)],r=t[e(326)][e(352)](gr);t[e(442)][e(392)]({isUndoable:!1},(s=>{const o=e,i=o(371)+r[o(329)],a=o(363)+r[o(329)],c=t[o(442)][o(333)][o(436)](i);t[o(354)][o(321)][o(330)]?Ar(r[o(329)],n[o(335)][o(394)](),t[o(442)],s):c&&(s[o(381)](i),s[o(381)](a))}))}}function Ar(e,t,n,r){const s=vr,o=s(371)+e,i=s(363)+e,a=t[s(332)]();let c=t[s(437)];a&&a.is(s(356),s(388))&&(c=function(e,t){const n=s;for(const r of e[n(379)]())if(t[n(334)][n(393)](r,n(343)))return r}(t,n),t=r[s(336)](c));const d=r[s(336)](c);n[s(333)][s(436)](o)?(r[s(416)](o,{range:t}),r[s(416)](i,{range:d})):(r[s(440)](o,{range:t,usingOperation:!0}),r[s(440)](i,{range:d,usingOperation:!0}))}function Pr(e,t){const n=Tr();return(Pr=function(e,t){return n[e-=318]})(e,t)}function Tr(){const e=["markerToHighlight","deletionPosition","20912eYXEaF","setCustomProperty","destroy","28xVEINq","$graveyard","startsWith","data-session-id","ck-user__selection","</span>⁠","conversion","mouseenter","hasContent","1476108sMBfSU","has","start","isInline","parent","addMarker","change","model","fromRange","highest","classList","addEventListener","getSelectionClass","getNearestSelectionRange","size","clear","applyOperation","view","getStart","change:range",'⁠<span class="ck-user__marker-line" contenteditable="false"><span class="ck-user__marker-dot"></span></span><span class="ck-user__marker-tooltip" contenteditable="false" spellcheck="false">',"color","plugins","mapper","batch","mySessionId","hasDomSelection","toDomElement","getContainedElement","markers","schema","selection","createRange","user:","editor","isCollapsed","marker","user:range","name","$text","update:user:range","markerNameToElements","markerToElement","40DkaidE","user:position","root","contenteditable","set","get","isObject","editing","getMarkerClass","element","nodeAfter","type","detach","createUIElement","newRange","editingDowncast","user:position:","requires","709944iEhGBR","undo","_domEmitter","document","render","pluginName","user:range:","7EhTOOY","rootName","3901704ucQpOV","listenTo","reconvertMarker","keydown","mouseleave","getPositions","toRange","removeMarker","isSimilar","getRange","remove","init","for","createUserMarkerOperations","tableCell","innerHTML","Escape","457902MeLZZd","enqueueChange","checkChild","getFirstRange","commands","afterInit","200926FfxzCC","getCustomProperty","ck-user__marker ","delete","orderNumber","isLimit","userPositionMarker","split","ck-user__marker_hovered","16aXMOql","add","_createdBatches","end","getAttribute","36910NgoImK","markerRange","UserMarkers","markerName","removeClass","updateMarker","getUserBySessionId","stopListening","oldRange","span"];return(Tr=function(){return e})()}function _r(e,t,n){const r=e.t;switch(t){case"PENDING_ACTION_SENDING_DATA":return r({string:"Sending data to the server.",id:"PENDING_ACTION_SENDING_DATA"});case"The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.":return r("The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.");case"The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.":return r("The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.");case"The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.":return r("The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.");case"The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.":return r("The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.");case"Synchronization issue":return r("Synchronization issue");case"PENDING_ACTION_REVISION_HISTORY":return r({string:"Unsaved change in revision history.",id:"PENDING_ACTION_REVISION_HISTORY"});case"CONNECTED_USERS":return r({string:"1 connected user (me)",plural:"%0 connected users",id:"CONNECTED_USERS"},n);default:return""}}const kr=ke.Reader,Cr=ke.Writer,Er=ke.util,jr=ke.roots.default||(ke.roots.default={}),Rr=jr.AttributeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.range=null,e.prototype.key="",e.prototype.oldValueBoolean=!1,e.prototype.oldValueJson="",e.prototype.newValueBoolean=!1,e.prototype.newValueJson="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Cr.create()),null!=e.range&&Object.hasOwnProperty.call(e,"range")&&jr.Range.encode(e.range,t.uint32(10).fork()).ldelim(),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(18).string(e.key),null!=e.oldValueBoolean&&Object.hasOwnProperty.call(e,"oldValueBoolean")&&t.uint32(24).bool(e.oldValueBoolean),null!=e.oldValueJson&&Object.hasOwnProperty.call(e,"oldValueJson")&&t.uint32(34).string(e.oldValueJson),null!=e.newValueBoolean&&Object.hasOwnProperty.call(e,"newValueBoolean")&&t.uint32(40).bool(e.newValueBoolean),null!=e.newValueJson&&Object.hasOwnProperty.call(e,"newValueJson")&&t.uint32(50).string(e.newValueJson),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(56).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof kr||(e=kr.create(e));let n=void 0===t?e.len:e.pos+t,r=new jr.AttributeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.range=jr.Range.decode(e,e.uint32());break;case 2:r.key=e.string();break;case 3:r.oldValueBoolean=e.bool();break;case 4:r.oldValueJson=e.string();break;case 5:r.newValueBoolean=e.bool();break;case 6:r.newValueJson=e.string();break;case 7:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof kr||(e=new kr(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.range&&e.hasOwnProperty("range")){let t=jr.Range.verify(e.range);if(t)return"range."+t}return null!=e.key&&e.hasOwnProperty("key")&&!Er.isString(e.key)?"key: string expected":null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&"boolean"!=typeof e.oldValueBoolean?"oldValueBoolean: boolean expected":null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&!Er.isString(e.oldValueJson)?"oldValueJson: string expected":null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&"boolean"!=typeof e.newValueBoolean?"newValueBoolean: boolean expected":null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&!Er.isString(e.newValueJson)?"newValueJson: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof jr.AttributeOperation)return e;let t=new jr.AttributeOperation;if(null!=e.range){if("object"!=typeof e.range)throw TypeError(".AttributeOperation.range: object expected");t.range=jr.Range.fromObject(e.range)}return null!=e.key&&(t.key=String(e.key)),null!=e.oldValueBoolean&&(t.oldValueBoolean=Boolean(e.oldValueBoolean)),null!=e.oldValueJson&&(t.oldValueJson=String(e.oldValueJson)),null!=e.newValueBoolean&&(t.newValueBoolean=Boolean(e.newValueBoolean)),null!=e.newValueJson&&(t.newValueJson=String(e.newValueJson)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.range=null,n.key="",n.oldValueBoolean=!1,n.oldValueJson="",n.newValueBoolean=!1,n.newValueJson="",n.wasUndone=!1),null!=e.range&&e.hasOwnProperty("range")&&(n.range=jr.Range.toObject(e.range,t)),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&(n.oldValueBoolean=e.oldValueBoolean),null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&(n.oldValueJson=e.oldValueJson),null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&(n.newValueBoolean=e.newValueBoolean),null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&(n.newValueJson=e.newValueJson),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/AttributeOperation"},e})(),Dr=jr.InsertOperation=(()=>{function e(e){if(this.nodes=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.position=null,e.prototype.nodes=Er.emptyArray,e.prototype.shouldReceiveAttributes=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Cr.create()),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&jr.Position.encode(e.position,t.uint32(10).fork()).ldelim(),null!=e.nodes&&e.nodes.length)for(let n=0;n<e.nodes.length;++n)jr.Element.encode(e.nodes[n],t.uint32(18).fork()).ldelim();return null!=e.shouldReceiveAttributes&&Object.hasOwnProperty.call(e,"shouldReceiveAttributes")&&t.uint32(24).bool(e.shouldReceiveAttributes),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof kr||(e=kr.create(e));let n=void 0===t?e.len:e.pos+t,r=new jr.InsertOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.position=jr.Position.decode(e,e.uint32());break;case 2:r.nodes&&r.nodes.length||(r.nodes=[]),r.nodes.push(jr.Element.decode(e,e.uint32()));break;case 3:r.shouldReceiveAttributes=e.bool();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof kr||(e=new kr(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.position&&e.hasOwnProperty("position")){let t=jr.Position.verify(e.position);if(t)return"position."+t}if(null!=e.nodes&&e.hasOwnProperty("nodes")){if(!Array.isArray(e.nodes))return"nodes: array expected";for(let t=0;t<e.nodes.length;++t){let n=jr.Element.verify(e.nodes[t]);if(n)return"nodes."+n}}return null!=e.shouldReceiveAttributes&&e.hasOwnProperty("shouldReceiveAttributes")&&"boolean"!=typeof e.shouldReceiveAttributes?"shouldReceiveAttributes: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof jr.InsertOperation)return e;let t=new jr.InsertOperation;if(null!=e.position){if("object"!=typeof e.position)throw TypeError(".InsertOperation.position: object expected");t.position=jr.Position.fromObject(e.position)}if(e.nodes){if(!Array.isArray(e.nodes))throw TypeError(".InsertOperation.nodes: array expected");t.nodes=[];for(let n=0;n<e.nodes.length;++n){if("object"!=typeof e.nodes[n])throw TypeError(".InsertOperation.nodes: object expected");t.nodes[n]=jr.Element.fromObject(e.nodes[n])}}return null!=e.shouldReceiveAttributes&&(t.shouldReceiveAttributes=Boolean(e.shouldReceiveAttributes)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.nodes=[]),t.defaults&&(n.position=null,n.shouldReceiveAttributes=!1,n.wasUndone=!1),null!=e.position&&e.hasOwnProperty("position")&&(n.position=jr.Position.toObject(e.position,t)),e.nodes&&e.nodes.length){n.nodes=[];for(let r=0;r<e.nodes.length;++r)n.nodes[r]=jr.Element.toObject(e.nodes[r],t)}return null!=e.shouldReceiveAttributes&&e.hasOwnProperty("shouldReceiveAttributes")&&(n.shouldReceiveAttributes=e.shouldReceiveAttributes),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/InsertOperation"},e})(),Nr=jr.MarkerOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.oldRange=null,e.prototype.newRange=null,e.prototype.affectsData=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Cr.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.oldRange&&Object.hasOwnProperty.call(e,"oldRange")&&jr.Range.encode(e.oldRange,t.uint32(18).fork()).ldelim(),null!=e.newRange&&Object.hasOwnProperty.call(e,"newRange")&&jr.Range.encode(e.newRange,t.uint32(26).fork()).ldelim(),null!=e.affectsData&&Object.hasOwnProperty.call(e,"affectsData")&&t.uint32(32).bool(e.affectsData),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof kr||(e=kr.create(e));let n=void 0===t?e.len:e.pos+t,r=new jr.MarkerOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.name=e.string();break;case 2:r.oldRange=jr.Range.decode(e,e.uint32());break;case 3:r.newRange=jr.Range.decode(e,e.uint32());break;case 4:r.affectsData=e.bool();break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof kr||(e=new kr(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!Er.isString(e.name))return"name: string expected";if(null!=e.oldRange&&e.hasOwnProperty("oldRange")){let t=jr.Range.verify(e.oldRange);if(t)return"oldRange."+t}if(null!=e.newRange&&e.hasOwnProperty("newRange")){let t=jr.Range.verify(e.newRange);if(t)return"newRange."+t}return null!=e.affectsData&&e.hasOwnProperty("affectsData")&&"boolean"!=typeof e.affectsData?"affectsData: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof jr.MarkerOperation)return e;let t=new jr.MarkerOperation;if(null!=e.name&&(t.name=String(e.name)),null!=e.oldRange){if("object"!=typeof e.oldRange)throw TypeError(".MarkerOperation.oldRange: object expected");t.oldRange=jr.Range.fromObject(e.oldRange)}if(null!=e.newRange){if("object"!=typeof e.newRange)throw TypeError(".MarkerOperation.newRange: object expected");t.newRange=jr.Range.fromObject(e.newRange)}return null!=e.affectsData&&(t.affectsData=Boolean(e.affectsData)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.name="",n.oldRange=null,n.newRange=null,n.affectsData=!1,n.wasUndone=!1),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.oldRange&&e.hasOwnProperty("oldRange")&&(n.oldRange=jr.Range.toObject(e.oldRange,t)),null!=e.newRange&&e.hasOwnProperty("newRange")&&(n.newRange=jr.Range.toObject(e.newRange,t)),null!=e.affectsData&&e.hasOwnProperty("affectsData")&&(n.affectsData=e.affectsData),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MarkerOperation"},e})(),xr=jr.MergeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sourcePosition=null,e.prototype.targetPosition=null,e.prototype.graveyardPosition=null,e.prototype.howMany=0,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Cr.create()),null!=e.sourcePosition&&Object.hasOwnProperty.call(e,"sourcePosition")&&jr.Position.encode(e.sourcePosition,t.uint32(10).fork()).ldelim(),null!=e.targetPosition&&Object.hasOwnProperty.call(e,"targetPosition")&&jr.Position.encode(e.targetPosition,t.uint32(18).fork()).ldelim(),null!=e.graveyardPosition&&Object.hasOwnProperty.call(e,"graveyardPosition")&&jr.Position.encode(e.graveyardPosition,t.uint32(26).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(32).uint32(e.howMany),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof kr||(e=kr.create(e));let n=void 0===t?e.len:e.pos+t,r=new jr.MergeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.sourcePosition=jr.Position.decode(e,e.uint32());break;case 2:r.targetPosition=jr.Position.decode(e,e.uint32());break;case 3:r.graveyardPosition=jr.Position.decode(e,e.uint32());break;case 4:r.howMany=e.uint32();break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof kr||(e=new kr(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")){let t=jr.Position.verify(e.sourcePosition);if(t)return"sourcePosition."+t}if(null!=e.targetPosition&&e.hasOwnProperty("targetPosition")){let t=jr.Position.verify(e.targetPosition);if(t)return"targetPosition."+t}if(null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")){let t=jr.Position.verify(e.graveyardPosition);if(t)return"graveyardPosition."+t}return null!=e.howMany&&e.hasOwnProperty("howMany")&&!Er.isInteger(e.howMany)?"howMany: integer expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof jr.MergeOperation)return e;let t=new jr.MergeOperation;if(null!=e.sourcePosition){if("object"!=typeof e.sourcePosition)throw TypeError(".MergeOperation.sourcePosition: object expected");t.sourcePosition=jr.Position.fromObject(e.sourcePosition)}if(null!=e.targetPosition){if("object"!=typeof e.targetPosition)throw TypeError(".MergeOperation.targetPosition: object expected");t.targetPosition=jr.Position.fromObject(e.targetPosition)}if(null!=e.graveyardPosition){if("object"!=typeof e.graveyardPosition)throw TypeError(".MergeOperation.graveyardPosition: object expected");t.graveyardPosition=jr.Position.fromObject(e.graveyardPosition)}return null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.sourcePosition=null,n.targetPosition=null,n.graveyardPosition=null,n.howMany=0,n.wasUndone=!1),null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")&&(n.sourcePosition=jr.Position.toObject(e.sourcePosition,t)),null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(n.targetPosition=jr.Position.toObject(e.targetPosition,t)),null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=jr.Position.toObject(e.graveyardPosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MergeOperation"},e})(),Vr=jr.MoveOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sourcePosition=null,e.prototype.howMany=0,e.prototype.targetPosition=null,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Cr.create()),null!=e.sourcePosition&&Object.hasOwnProperty.call(e,"sourcePosition")&&jr.Position.encode(e.sourcePosition,t.uint32(10).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(16).uint32(e.howMany),null!=e.targetPosition&&Object.hasOwnProperty.call(e,"targetPosition")&&jr.Position.encode(e.targetPosition,t.uint32(26).fork()).ldelim(),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof kr||(e=kr.create(e));let n=void 0===t?e.len:e.pos+t,r=new jr.MoveOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.sourcePosition=jr.Position.decode(e,e.uint32());break;case 2:r.howMany=e.uint32();break;case 3:r.targetPosition=jr.Position.decode(e,e.uint32());break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof kr||(e=new kr(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")){let t=jr.Position.verify(e.sourcePosition);if(t)return"sourcePosition."+t}if(null!=e.howMany&&e.hasOwnProperty("howMany")&&!Er.isInteger(e.howMany))return"howMany: integer expected";if(null!=e.targetPosition&&e.hasOwnProperty("targetPosition")){let t=jr.Position.verify(e.targetPosition);if(t)return"targetPosition."+t}return null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof jr.MoveOperation)return e;let t=new jr.MoveOperation;if(null!=e.sourcePosition){if("object"!=typeof e.sourcePosition)throw TypeError(".MoveOperation.sourcePosition: object expected");t.sourcePosition=jr.Position.fromObject(e.sourcePosition)}if(null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.targetPosition){if("object"!=typeof e.targetPosition)throw TypeError(".MoveOperation.targetPosition: object expected");t.targetPosition=jr.Position.fromObject(e.targetPosition)}return null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.sourcePosition=null,n.howMany=0,n.targetPosition=null,n.wasUndone=!1),null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")&&(n.sourcePosition=jr.Position.toObject(e.sourcePosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(n.targetPosition=jr.Position.toObject(e.targetPosition,t)),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MoveOperation"},e})(),Mr=jr.RenameOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.position=null,e.prototype.oldName="",e.prototype.newName="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Cr.create()),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&jr.Position.encode(e.position,t.uint32(10).fork()).ldelim(),null!=e.oldName&&Object.hasOwnProperty.call(e,"oldName")&&t.uint32(18).string(e.oldName),null!=e.newName&&Object.hasOwnProperty.call(e,"newName")&&t.uint32(26).string(e.newName),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof kr||(e=kr.create(e));let n=void 0===t?e.len:e.pos+t,r=new jr.RenameOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.position=jr.Position.decode(e,e.uint32());break;case 2:r.oldName=e.string();break;case 3:r.newName=e.string();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof kr||(e=new kr(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.position&&e.hasOwnProperty("position")){let t=jr.Position.verify(e.position);if(t)return"position."+t}return null!=e.oldName&&e.hasOwnProperty("oldName")&&!Er.isString(e.oldName)?"oldName: string expected":null!=e.newName&&e.hasOwnProperty("newName")&&!Er.isString(e.newName)?"newName: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof jr.RenameOperation)return e;let t=new jr.RenameOperation;if(null!=e.position){if("object"!=typeof e.position)throw TypeError(".RenameOperation.position: object expected");t.position=jr.Position.fromObject(e.position)}return null!=e.oldName&&(t.oldName=String(e.oldName)),null!=e.newName&&(t.newName=String(e.newName)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.position=null,n.oldName="",n.newName="",n.wasUndone=!1),null!=e.position&&e.hasOwnProperty("position")&&(n.position=jr.Position.toObject(e.position,t)),null!=e.oldName&&e.hasOwnProperty("oldName")&&(n.oldName=e.oldName),null!=e.newName&&e.hasOwnProperty("newName")&&(n.newName=e.newName),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RenameOperation"},e})(),Br=jr.RootAttributeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.root="",e.prototype.key="",e.prototype.oldValueBoolean=!1,e.prototype.oldValueJson="",e.prototype.newValueBoolean=!1,e.prototype.newValueJson="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Cr.create()),null!=e.root&&Object.hasOwnProperty.call(e,"root")&&t.uint32(10).string(e.root),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(18).string(e.key),null!=e.oldValueBoolean&&Object.hasOwnProperty.call(e,"oldValueBoolean")&&t.uint32(24).bool(e.oldValueBoolean),null!=e.oldValueJson&&Object.hasOwnProperty.call(e,"oldValueJson")&&t.uint32(34).string(e.oldValueJson),null!=e.newValueBoolean&&Object.hasOwnProperty.call(e,"newValueBoolean")&&t.uint32(40).bool(e.newValueBoolean),null!=e.newValueJson&&Object.hasOwnProperty.call(e,"newValueJson")&&t.uint32(50).string(e.newValueJson),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(56).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof kr||(e=kr.create(e));let n=void 0===t?e.len:e.pos+t,r=new jr.RootAttributeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.root=e.string();break;case 2:r.key=e.string();break;case 3:r.oldValueBoolean=e.bool();break;case 4:r.oldValueJson=e.string();break;case 5:r.newValueBoolean=e.bool();break;case 6:r.newValueJson=e.string();break;case 7:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof kr||(e=new kr(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.root&&e.hasOwnProperty("root")&&!Er.isString(e.root)?"root: string expected":null!=e.key&&e.hasOwnProperty("key")&&!Er.isString(e.key)?"key: string expected":null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&"boolean"!=typeof e.oldValueBoolean?"oldValueBoolean: boolean expected":null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&!Er.isString(e.oldValueJson)?"oldValueJson: string expected":null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&"boolean"!=typeof e.newValueBoolean?"newValueBoolean: boolean expected":null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&!Er.isString(e.newValueJson)?"newValueJson: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof jr.RootAttributeOperation)return e;let t=new jr.RootAttributeOperation;return null!=e.root&&(t.root=String(e.root)),null!=e.key&&(t.key=String(e.key)),null!=e.oldValueBoolean&&(t.oldValueBoolean=Boolean(e.oldValueBoolean)),null!=e.oldValueJson&&(t.oldValueJson=String(e.oldValueJson)),null!=e.newValueBoolean&&(t.newValueBoolean=Boolean(e.newValueBoolean)),null!=e.newValueJson&&(t.newValueJson=String(e.newValueJson)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.root="",n.key="",n.oldValueBoolean=!1,n.oldValueJson="",n.newValueBoolean=!1,n.newValueJson="",n.wasUndone=!1),null!=e.root&&e.hasOwnProperty("root")&&(n.root=e.root),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&(n.oldValueBoolean=e.oldValueBoolean),null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&(n.oldValueJson=e.oldValueJson),null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&(n.newValueBoolean=e.newValueBoolean),null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&(n.newValueJson=e.newValueJson),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RootAttributeOperation"},e})(),Ur=jr.RootOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.rootName="",e.prototype.elementName="",e.prototype.isAdd=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Cr.create()),null!=e.rootName&&Object.hasOwnProperty.call(e,"rootName")&&t.uint32(10).string(e.rootName),null!=e.elementName&&Object.hasOwnProperty.call(e,"elementName")&&t.uint32(18).string(e.elementName),null!=e.isAdd&&Object.hasOwnProperty.call(e,"isAdd")&&t.uint32(24).bool(e.isAdd),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof kr||(e=kr.create(e));let n=void 0===t?e.len:e.pos+t,r=new jr.RootOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.rootName=e.string();break;case 2:r.elementName=e.string();break;case 3:r.isAdd=e.bool();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof kr||(e=new kr(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.rootName&&e.hasOwnProperty("rootName")&&!Er.isString(e.rootName)?"rootName: string expected":null!=e.elementName&&e.hasOwnProperty("elementName")&&!Er.isString(e.elementName)?"elementName: string expected":null!=e.isAdd&&e.hasOwnProperty("isAdd")&&"boolean"!=typeof e.isAdd?"isAdd: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof jr.RootOperation)return e;let t=new jr.RootOperation;return null!=e.rootName&&(t.rootName=String(e.rootName)),null!=e.elementName&&(t.elementName=String(e.elementName)),null!=e.isAdd&&(t.isAdd=Boolean(e.isAdd)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.rootName="",n.elementName="",n.isAdd=!1,n.wasUndone=!1),null!=e.rootName&&e.hasOwnProperty("rootName")&&(n.rootName=e.rootName),null!=e.elementName&&e.hasOwnProperty("elementName")&&(n.elementName=e.elementName),null!=e.isAdd&&e.hasOwnProperty("isAdd")&&(n.isAdd=e.isAdd),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RootOperation"},e})(),Jr=jr.SplitOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.splitPosition=null,e.prototype.graveyardPosition=null,e.prototype.howMany=0,e.prototype.insertionPosition=null,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Cr.create()),null!=e.splitPosition&&Object.hasOwnProperty.call(e,"splitPosition")&&jr.Position.encode(e.splitPosition,t.uint32(10).fork()).ldelim(),null!=e.graveyardPosition&&Object.hasOwnProperty.call(e,"graveyardPosition")&&jr.Position.encode(e.graveyardPosition,t.uint32(18).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(24).uint32(e.howMany),null!=e.insertionPosition&&Object.hasOwnProperty.call(e,"insertionPosition")&&jr.Position.encode(e.insertionPosition,t.uint32(34).fork()).ldelim(),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof kr||(e=kr.create(e));let n=void 0===t?e.len:e.pos+t,r=new jr.SplitOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.splitPosition=jr.Position.decode(e,e.uint32());break;case 2:r.graveyardPosition=jr.Position.decode(e,e.uint32());break;case 3:r.howMany=e.uint32();break;case 4:r.insertionPosition=jr.Position.decode(e,e.uint32());break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof kr||(e=new kr(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.splitPosition&&e.hasOwnProperty("splitPosition")){let t=jr.Position.verify(e.splitPosition);if(t)return"splitPosition."+t}if(null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")){let t=jr.Position.verify(e.graveyardPosition);if(t)return"graveyardPosition."+t}if(null!=e.howMany&&e.hasOwnProperty("howMany")&&!Er.isInteger(e.howMany))return"howMany: integer expected";if(null!=e.insertionPosition&&e.hasOwnProperty("insertionPosition")){let t=jr.Position.verify(e.insertionPosition);if(t)return"insertionPosition."+t}return null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof jr.SplitOperation)return e;let t=new jr.SplitOperation;if(null!=e.splitPosition){if("object"!=typeof e.splitPosition)throw TypeError(".SplitOperation.splitPosition: object expected");t.splitPosition=jr.Position.fromObject(e.splitPosition)}if(null!=e.graveyardPosition){if("object"!=typeof e.graveyardPosition)throw TypeError(".SplitOperation.graveyardPosition: object expected");t.graveyardPosition=jr.Position.fromObject(e.graveyardPosition)}if(null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.insertionPosition){if("object"!=typeof e.insertionPosition)throw TypeError(".SplitOperation.insertionPosition: object expected");t.insertionPosition=jr.Position.fromObject(e.insertionPosition)}return null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.splitPosition=null,n.graveyardPosition=null,n.howMany=0,n.insertionPosition=null,n.wasUndone=!1),null!=e.splitPosition&&e.hasOwnProperty("splitPosition")&&(n.splitPosition=jr.Position.toObject(e.splitPosition,t)),null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=jr.Position.toObject(e.graveyardPosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.insertionPosition&&e.hasOwnProperty("insertionPosition")&&(n.insertionPosition=jr.Position.toObject(e.insertionPosition,t)),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SplitOperation"},e})(),qr=jr.Position=(()=>{function e(e){if(this.path=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.root="",e.prototype.rootMain=!1,e.prototype.rootGraveyard=!1,e.prototype.path=Er.emptyArray,e.prototype.stickiness="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Cr.create()),null!=e.root&&Object.hasOwnProperty.call(e,"root")&&t.uint32(10).string(e.root),null!=e.rootMain&&Object.hasOwnProperty.call(e,"rootMain")&&t.uint32(16).bool(e.rootMain),null!=e.rootGraveyard&&Object.hasOwnProperty.call(e,"rootGraveyard")&&t.uint32(24).bool(e.rootGraveyard),null!=e.path&&e.path.length){t.uint32(34).fork();for(let n=0;n<e.path.length;++n)t.uint32(e.path[n]);t.ldelim()}return null!=e.stickiness&&Object.hasOwnProperty.call(e,"stickiness")&&t.uint32(42).string(e.stickiness),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof kr||(e=kr.create(e));let n=void 0===t?e.len:e.pos+t,r=new jr.Position;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.root=e.string();break;case 2:r.rootMain=e.bool();break;case 3:r.rootGraveyard=e.bool();break;case 4:if(r.path&&r.path.length||(r.path=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.path.push(e.uint32())}else r.path.push(e.uint32());break;case 5:r.stickiness=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof kr||(e=new kr(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.root&&e.hasOwnProperty("root")&&!Er.isString(e.root))return"root: string expected";if(null!=e.rootMain&&e.hasOwnProperty("rootMain")&&"boolean"!=typeof e.rootMain)return"rootMain: boolean expected";if(null!=e.rootGraveyard&&e.hasOwnProperty("rootGraveyard")&&"boolean"!=typeof e.rootGraveyard)return"rootGraveyard: boolean expected";if(null!=e.path&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(let t=0;t<e.path.length;++t)if(!Er.isInteger(e.path[t]))return"path: integer[] expected"}return null!=e.stickiness&&e.hasOwnProperty("stickiness")&&!Er.isString(e.stickiness)?"stickiness: string expected":null},e.fromObject=function(e){if(e instanceof jr.Position)return e;let t=new jr.Position;if(null!=e.root&&(t.root=String(e.root)),null!=e.rootMain&&(t.rootMain=Boolean(e.rootMain)),null!=e.rootGraveyard&&(t.rootGraveyard=Boolean(e.rootGraveyard)),e.path){if(!Array.isArray(e.path))throw TypeError(".Position.path: array expected");t.path=[];for(let n=0;n<e.path.length;++n)t.path[n]=e.path[n]>>>0}return null!=e.stickiness&&(t.stickiness=String(e.stickiness)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.path=[]),t.defaults&&(n.root="",n.rootMain=!1,n.rootGraveyard=!1,n.stickiness=""),null!=e.root&&e.hasOwnProperty("root")&&(n.root=e.root),null!=e.rootMain&&e.hasOwnProperty("rootMain")&&(n.rootMain=e.rootMain),null!=e.rootGraveyard&&e.hasOwnProperty("rootGraveyard")&&(n.rootGraveyard=e.rootGraveyard),e.path&&e.path.length){n.path=[];for(let t=0;t<e.path.length;++t)n.path[t]=e.path[t]}return null!=e.stickiness&&e.hasOwnProperty("stickiness")&&(n.stickiness=e.stickiness),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Position"},e})(),Lr=jr.Range=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.start=null,e.prototype.end=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Cr.create()),null!=e.start&&Object.hasOwnProperty.call(e,"start")&&jr.Position.encode(e.start,t.uint32(10).fork()).ldelim(),null!=e.end&&Object.hasOwnProperty.call(e,"end")&&jr.Position.encode(e.end,t.uint32(18).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof kr||(e=kr.create(e));let n=void 0===t?e.len:e.pos+t,r=new jr.Range;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.start=jr.Position.decode(e,e.uint32());break;case 2:r.end=jr.Position.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof kr||(e=new kr(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.start&&e.hasOwnProperty("start")){let t=jr.Position.verify(e.start);if(t)return"start."+t}if(null!=e.end&&e.hasOwnProperty("end")){let t=jr.Position.verify(e.end);if(t)return"end."+t}return null},e.fromObject=function(e){if(e instanceof jr.Range)return e;let t=new jr.Range;if(null!=e.start){if("object"!=typeof e.start)throw TypeError(".Range.start: object expected");t.start=jr.Position.fromObject(e.start)}if(null!=e.end){if("object"!=typeof e.end)throw TypeError(".Range.end: object expected");t.end=jr.Position.fromObject(e.end)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.start=null,n.end=null),null!=e.start&&e.hasOwnProperty("start")&&(n.start=jr.Position.toObject(e.start,t)),null!=e.end&&e.hasOwnProperty("end")&&(n.end=jr.Position.toObject(e.end,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Range"},e})(),Gr=jr.Element=(()=>{function e(e){if(this.children=[],this.attributesBoolean={},e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.children=Er.emptyArray,e.prototype.data="",e.prototype.attributesBoolean=Er.emptyObject,e.prototype.attributesJson="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Cr.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.children&&e.children.length)for(let n=0;n<e.children.length;++n)jr.Element.encode(e.children[n],t.uint32(18).fork()).ldelim();if(null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(26).string(e.data),null!=e.attributesBoolean&&Object.hasOwnProperty.call(e,"attributesBoolean"))for(let n=Object.keys(e.attributesBoolean),r=0;r<n.length;++r)t.uint32(34).fork().uint32(10).string(n[r]).uint32(16).bool(e.attributesBoolean[n[r]]).ldelim();return null!=e.attributesJson&&Object.hasOwnProperty.call(e,"attributesJson")&&t.uint32(42).string(e.attributesJson),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof kr||(e=kr.create(e));let n,r,s=void 0===t?e.len:e.pos+t,o=new jr.Element;for(;e.pos<s;){let t=e.uint32();switch(t>>>3){case 1:o.name=e.string();break;case 2:o.children&&o.children.length||(o.children=[]),o.children.push(jr.Element.decode(e,e.uint32()));break;case 3:o.data=e.string();break;case 4:{o.attributesBoolean===Er.emptyObject&&(o.attributesBoolean={});let t=e.uint32()+e.pos;for(n="",r=!1;e.pos<t;){let t=e.uint32();switch(t>>>3){case 1:n=e.string();break;case 2:r=e.bool();break;default:e.skipType(7&t)}}o.attributesBoolean[n]=r;break}case 5:o.attributesJson=e.string();break;default:e.skipType(7&t)}}return o},e.decodeDelimited=function(e){return e instanceof kr||(e=new kr(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!Er.isString(e.name))return"name: string expected";if(null!=e.children&&e.hasOwnProperty("children")){if(!Array.isArray(e.children))return"children: array expected";for(let t=0;t<e.children.length;++t){let n=jr.Element.verify(e.children[t]);if(n)return"children."+n}}if(null!=e.data&&e.hasOwnProperty("data")&&!Er.isString(e.data))return"data: string expected";if(null!=e.attributesBoolean&&e.hasOwnProperty("attributesBoolean")){if(!Er.isObject(e.attributesBoolean))return"attributesBoolean: object expected";let t=Object.keys(e.attributesBoolean);for(let n=0;n<t.length;++n)if("boolean"!=typeof e.attributesBoolean[t[n]])return"attributesBoolean: boolean{k:string} expected"}return null!=e.attributesJson&&e.hasOwnProperty("attributesJson")&&!Er.isString(e.attributesJson)?"attributesJson: string expected":null},e.fromObject=function(e){if(e instanceof jr.Element)return e;let t=new jr.Element;if(null!=e.name&&(t.name=String(e.name)),e.children){if(!Array.isArray(e.children))throw TypeError(".Element.children: array expected");t.children=[];for(let n=0;n<e.children.length;++n){if("object"!=typeof e.children[n])throw TypeError(".Element.children: object expected");t.children[n]=jr.Element.fromObject(e.children[n])}}if(null!=e.data&&(t.data=String(e.data)),e.attributesBoolean){if("object"!=typeof e.attributesBoolean)throw TypeError(".Element.attributesBoolean: object expected");t.attributesBoolean={};for(let n=Object.keys(e.attributesBoolean),r=0;r<n.length;++r)t.attributesBoolean[n[r]]=Boolean(e.attributesBoolean[n[r]])}return null!=e.attributesJson&&(t.attributesJson=String(e.attributesJson)),t},e.toObject=function(e,t){t||(t={});let n,r={};if((t.arrays||t.defaults)&&(r.children=[]),(t.objects||t.defaults)&&(r.attributesBoolean={}),t.defaults&&(r.name="",r.data="",r.attributesJson=""),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),e.children&&e.children.length){r.children=[];for(let n=0;n<e.children.length;++n)r.children[n]=jr.Element.toObject(e.children[n],t)}if(null!=e.data&&e.hasOwnProperty("data")&&(r.data=e.data),e.attributesBoolean&&(n=Object.keys(e.attributesBoolean)).length){r.attributesBoolean={};for(let t=0;t<n.length;++t)r.attributesBoolean[n[t]]=e.attributesBoolean[n[t]]}return null!=e.attributesJson&&e.hasOwnProperty("attributesJson")&&(r.attributesJson=e.attributesJson),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,ke.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Element"},e})();class Yr{constructor(){this._protobufRoot=n}getDescriptor(e){return new zr(this._protobufRoot[e])}}class zr{constructor(e){this._protobuf=e}compress(e){const t=this._protobuf.verify(e);if(t)throw Error(t);return this._protobuf.encode(this._protobuf.create(e)).finish()}decompress(e){return this._protobuf.toObject(this._protobuf.decode(e),{oneofs:!0})}}const Fr=function(){this.__data__=[],this.size=0};const Hr=function(e,t){return e===t||e!=e&&t!=t};const Kr=function(e,t){for(var n=e.length;n--;)if(Hr(e[n][0],t))return n;return-1};var Wr=Array.prototype.splice;const Qr=function(e){var t=this.__data__,n=Kr(t,e);return!(n<0)&&(n==t.length-1?t.pop():Wr.call(t,n,1),--this.size,!0)};const Zr=function(e){var t=this.__data__,n=Kr(t,e);return n<0?void 0:t[n][1]};const $r=function(e){return Kr(this.__data__,e)>-1};const Xr=function(e,t){var n=this.__data__,r=Kr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function es(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}es.prototype.clear=Fr,es.prototype.delete=Qr,es.prototype.get=Zr,es.prototype.has=$r,es.prototype.set=Xr;const ts=es;const ns=function(){this.__data__=new ts,this.size=0};const rs=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};const ss=function(e){return this.__data__.get(e)};const os=function(e){return this.__data__.has(e)};const is="object"==typeof global&&global&&global.Object===Object&&global;var as="object"==typeof self&&self&&self.Object===Object&&self;const cs=is||as||Function("return this")();const ds=cs.Symbol;var us=Object.prototype,ls=us.hasOwnProperty,ps=us.toString,hs=ds?ds.toStringTag:void 0;const fs=function(e){var t=ls.call(e,hs),n=e[hs];try{e[hs]=void 0;var r=!0}catch(e){}var s=ps.call(e);return r&&(t?e[hs]=n:delete e[hs]),s};var ms=Object.prototype.toString;const ys=function(e){return ms.call(e)};var gs=ds?ds.toStringTag:void 0;const bs=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":gs&&gs in Object(e)?fs(e):ys(e)};const Os=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const ws=function(e){if(!Os(e))return!1;var t=bs(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const Is=cs["__core-js_shared__"];var vs,Ss=(vs=/[^.]+$/.exec(Is&&Is.keys&&Is.keys.IE_PROTO||""))?"Symbol(src)_1."+vs:"";const As=function(e){return!!Ss&&Ss in e};var Ps=Function.prototype.toString;const Ts=function(e){if(null!=e){try{return Ps.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var _s=/^\[object .+?Constructor\]$/,ks=Function.prototype,Cs=Object.prototype,Es=ks.toString,js=Cs.hasOwnProperty,Rs=RegExp("^"+Es.call(js).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Ds=function(e){return!(!Os(e)||As(e))&&(ws(e)?Rs:_s).test(Ts(e))};const Ns=function(e,t){return null==e?void 0:e[t]};const xs=function(e,t){var n=Ns(e,t);return Ds(n)?n:void 0};const Vs=xs(cs,"Map");const Ms=xs(Object,"create");const Bs=function(){this.__data__=Ms?Ms(null):{},this.size=0};const Us=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var Js=Object.prototype.hasOwnProperty;const qs=function(e){var t=this.__data__;if(Ms){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Js.call(t,e)?t[e]:void 0};var Ls=Object.prototype.hasOwnProperty;const Gs=function(e){var t=this.__data__;return Ms?void 0!==t[e]:Ls.call(t,e)};const Ys=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ms&&void 0===t?"__lodash_hash_undefined__":t,this};function zs(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}zs.prototype.clear=Bs,zs.prototype.delete=Us,zs.prototype.get=qs,zs.prototype.has=Gs,zs.prototype.set=Ys;const Fs=zs;const Hs=function(){this.size=0,this.__data__={hash:new Fs,map:new(Vs||ts),string:new Fs}};const Ks=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const Ws=function(e,t){var n=e.__data__;return Ks(t)?n["string"==typeof t?"string":"hash"]:n.map};const Qs=function(e){var t=Ws(this,e).delete(e);return this.size-=t?1:0,t};const Zs=function(e){return Ws(this,e).get(e)};const $s=function(e){return Ws(this,e).has(e)};const Xs=function(e,t){var n=Ws(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function eo(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}eo.prototype.clear=Hs,eo.prototype.delete=Qs,eo.prototype.get=Zs,eo.prototype.has=$s,eo.prototype.set=Xs;const to=eo;const no=function(e,t){var n=this.__data__;if(n instanceof ts){var r=n.__data__;if(!Vs||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new to(r)}return n.set(e,t),this.size=n.size,this};function ro(e){var t=this.__data__=new ts(e);this.size=t.size}ro.prototype.clear=ns,ro.prototype.delete=rs,ro.prototype.get=ss,ro.prototype.has=os,ro.prototype.set=no;const so=ro;const oo=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e};const io=function(){try{var e=xs(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const ao=function(e,t,n){"__proto__"==t&&io?io(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var co=Object.prototype.hasOwnProperty;const uo=function(e,t,n){var r=e[t];co.call(e,t)&&Hr(r,n)&&(void 0!==n||t in e)||ao(e,t,n)};const lo=function(e,t,n,r){var s=!n;n||(n={});for(var o=-1,i=t.length;++o<i;){var a=t[o],c=r?r(n[a],e[a],a,n,e):void 0;void 0===c&&(c=e[a]),s?ao(n,a,c):uo(n,a,c)}return n};const po=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};const ho=function(e){return null!=e&&"object"==typeof e};const fo=function(e){return ho(e)&&"[object Arguments]"==bs(e)};var mo=Object.prototype,yo=mo.hasOwnProperty,go=mo.propertyIsEnumerable,bo=fo(function(){return arguments}())?fo:function(e){return ho(e)&&yo.call(e,"callee")&&!go.call(e,"callee")};const Oo=bo;const wo=Array.isArray;const Io=function(){return!1};var vo="object"==typeof exports&&exports&&!exports.nodeType&&exports,So=vo&&"object"==typeof module&&module&&!module.nodeType&&module,Ao=So&&So.exports===vo?cs.Buffer:void 0;const Po=(Ao?Ao.isBuffer:void 0)||Io;var To=/^(?:0|[1-9]\d*)$/;const _o=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&To.test(e))&&e>-1&&e%1==0&&e<t};const ko=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var Co={};Co["[object Float32Array]"]=Co["[object Float64Array]"]=Co["[object Int8Array]"]=Co["[object Int16Array]"]=Co["[object Int32Array]"]=Co["[object Uint8Array]"]=Co["[object Uint8ClampedArray]"]=Co["[object Uint16Array]"]=Co["[object Uint32Array]"]=!0,Co["[object Arguments]"]=Co["[object Array]"]=Co["[object ArrayBuffer]"]=Co["[object Boolean]"]=Co["[object DataView]"]=Co["[object Date]"]=Co["[object Error]"]=Co["[object Function]"]=Co["[object Map]"]=Co["[object Number]"]=Co["[object Object]"]=Co["[object RegExp]"]=Co["[object Set]"]=Co["[object String]"]=Co["[object WeakMap]"]=!1;const Eo=function(e){return ho(e)&&ko(e.length)&&!!Co[bs(e)]};const jo=function(e){return function(t){return e(t)}};var Ro="object"==typeof exports&&exports&&!exports.nodeType&&exports,Do=Ro&&"object"==typeof module&&module&&!module.nodeType&&module,No=Do&&Do.exports===Ro&&is.process;const xo=function(){try{var e=Do&&Do.require&&Do.require("util").types;return e||No&&No.binding&&No.binding("util")}catch(e){}}();var Vo=xo&&xo.isTypedArray;const Mo=Vo?jo(Vo):Eo;var Bo=Object.prototype.hasOwnProperty;const Uo=function(e,t){var n=wo(e),r=!n&&Oo(e),s=!n&&!r&&Po(e),o=!n&&!r&&!s&&Mo(e),i=n||r||s||o,a=i?po(e.length,String):[],c=a.length;for(var d in e)!t&&!Bo.call(e,d)||i&&("length"==d||s&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||_o(d,c))||a.push(d);return a};var Jo=Object.prototype;const qo=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Jo)};const Lo=function(e,t){return function(n){return e(t(n))}};const Go=Lo(Object.keys,Object);var Yo=Object.prototype.hasOwnProperty;const zo=function(e){if(!qo(e))return Go(e);var t=[];for(var n in Object(e))Yo.call(e,n)&&"constructor"!=n&&t.push(n);return t};const Fo=function(e){return null!=e&&ko(e.length)&&!ws(e)};const Ho=function(e){return Fo(e)?Uo(e):zo(e)};const Ko=function(e,t){return e&&lo(t,Ho(t),e)};const Wo=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var Qo=Object.prototype.hasOwnProperty;const Zo=function(e){if(!Os(e))return Wo(e);var t=qo(e),n=[];for(var r in e)("constructor"!=r||!t&&Qo.call(e,r))&&n.push(r);return n};const $o=function(e){return Fo(e)?Uo(e,!0):Zo(e)};const Xo=function(e,t){return e&&lo(t,$o(t),e)};var ei="object"==typeof exports&&exports&&!exports.nodeType&&exports,ti=ei&&"object"==typeof module&&module&&!module.nodeType&&module,ni=ti&&ti.exports===ei?cs.Buffer:void 0,ri=ni?ni.allocUnsafe:void 0;const si=function(e,t){if(t)return e.slice();var n=e.length,r=ri?ri(n):new e.constructor(n);return e.copy(r),r};const oi=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};const ii=function(e,t){for(var n=-1,r=null==e?0:e.length,s=0,o=[];++n<r;){var i=e[n];t(i,n,e)&&(o[s++]=i)}return o};const ai=function(){return[]};var ci=Object.prototype.propertyIsEnumerable,di=Object.getOwnPropertySymbols;const ui=di?function(e){return null==e?[]:(e=Object(e),ii(di(e),(function(t){return ci.call(e,t)})))}:ai;const li=function(e,t){return lo(e,ui(e),t)};const pi=function(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e};const hi=Lo(Object.getPrototypeOf,Object);const fi=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)pi(t,ui(e)),e=hi(e);return t}:ai;const mi=function(e,t){return lo(e,fi(e),t)};const yi=function(e,t,n){var r=t(e);return wo(e)?r:pi(r,n(e))};const gi=function(e){return yi(e,Ho,ui)};const bi=function(e){return yi(e,$o,fi)};const Oi=xs(cs,"DataView");const wi=xs(cs,"Promise");const Ii=xs(cs,"Set");const vi=xs(cs,"WeakMap");var Si="[object Map]",Ai="[object Promise]",Pi="[object Set]",Ti="[object WeakMap]",_i="[object DataView]",ki=Ts(Oi),Ci=Ts(Vs),Ei=Ts(wi),ji=Ts(Ii),Ri=Ts(vi),Di=bs;(Oi&&Di(new Oi(new ArrayBuffer(1)))!=_i||Vs&&Di(new Vs)!=Si||wi&&Di(wi.resolve())!=Ai||Ii&&Di(new Ii)!=Pi||vi&&Di(new vi)!=Ti)&&(Di=function(e){var t=bs(e),n="[object Object]"==t?e.constructor:void 0,r=n?Ts(n):"";if(r)switch(r){case ki:return _i;case Ci:return Si;case Ei:return Ai;case ji:return Pi;case Ri:return Ti}return t});const Ni=Di;var xi=Object.prototype.hasOwnProperty;const Vi=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&xi.call(e,"index")&&(n.index=e.index,n.input=e.input),n};const Mi=cs.Uint8Array;const Bi=function(e){var t=new e.constructor(e.byteLength);return new Mi(t).set(new Mi(e)),t};const Ui=function(e,t){var n=t?Bi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)};var Ji=/\w*$/;const qi=function(e){var t=new e.constructor(e.source,Ji.exec(e));return t.lastIndex=e.lastIndex,t};var Li=ds?ds.prototype:void 0,Gi=Li?Li.valueOf:void 0;const Yi=function(e){return Gi?Object(Gi.call(e)):{}};const zi=function(e,t){var n=t?Bi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};const Fi=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return Bi(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return Ui(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return zi(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return qi(e);case"[object Symbol]":return Yi(e)}};var Hi=Object.create;const Ki=function(){function e(){}return function(t){if(!Os(t))return{};if(Hi)return Hi(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const Wi=function(e){return"function"!=typeof e.constructor||qo(e)?{}:Ki(hi(e))};const Qi=function(e){return ho(e)&&"[object Map]"==Ni(e)};var Zi=xo&&xo.isMap;const $i=Zi?jo(Zi):Qi;const Xi=function(e){return ho(e)&&"[object Set]"==Ni(e)};var ea=xo&&xo.isSet;const ta=ea?jo(ea):Xi;var na="[object Arguments]",ra="[object Function]",sa="[object Object]",oa={};oa[na]=oa["[object Array]"]=oa["[object ArrayBuffer]"]=oa["[object DataView]"]=oa["[object Boolean]"]=oa["[object Date]"]=oa["[object Float32Array]"]=oa["[object Float64Array]"]=oa["[object Int8Array]"]=oa["[object Int16Array]"]=oa["[object Int32Array]"]=oa["[object Map]"]=oa["[object Number]"]=oa[sa]=oa["[object RegExp]"]=oa["[object Set]"]=oa["[object String]"]=oa["[object Symbol]"]=oa["[object Uint8Array]"]=oa["[object Uint8ClampedArray]"]=oa["[object Uint16Array]"]=oa["[object Uint32Array]"]=!0,oa["[object Error]"]=oa[ra]=oa["[object WeakMap]"]=!1;const ia=function e(t,n,r,s,o,i){var a,c=1&n,d=2&n,u=4&n;if(r&&(a=o?r(t,s,o,i):r(t)),void 0!==a)return a;if(!Os(t))return t;var l=wo(t);if(l){if(a=Vi(t),!c)return oi(t,a)}else{var p=Ni(t),h=p==ra||"[object GeneratorFunction]"==p;if(Po(t))return si(t,c);if(p==sa||p==na||h&&!o){if(a=d||h?{}:Wi(t),!c)return d?mi(t,Xo(a,t)):li(t,Ko(a,t))}else{if(!oa[p])return o?t:{};a=Fi(t,p,c)}}i||(i=new so);var f=i.get(t);if(f)return f;i.set(t,a),ta(t)?t.forEach((function(s){a.add(e(s,n,r,s,t,i))})):$i(t)&&t.forEach((function(s,o){a.set(o,e(s,n,r,o,t,i))}));var m=l?void 0:(u?d?bi:gi:d?$o:Ho)(t);return oo(m||t,(function(s,o){m&&(s=t[o=s]),uo(a,o,e(s,n,r,o,t,i))})),a};const aa=function(e){return ia(e,5)};const ca=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const da=function(e){return this.__data__.has(e)};function ua(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new to;++t<n;)this.add(e[t])}ua.prototype.add=ua.prototype.push=ca,ua.prototype.has=da;const la=ua;const pa=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};const ha=function(e,t){return e.has(t)};const fa=function(e,t,n,r,s,o){var i=1&n,a=e.length,c=t.length;if(a!=c&&!(i&&c>a))return!1;var d=o.get(e),u=o.get(t);if(d&&u)return d==t&&u==e;var l=-1,p=!0,h=2&n?new la:void 0;for(o.set(e,t),o.set(t,e);++l<a;){var f=e[l],m=t[l];if(r)var y=i?r(m,f,l,t,e,o):r(f,m,l,e,t,o);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!pa(t,(function(e,t){if(!ha(h,t)&&(f===e||s(f,e,n,r,o)))return h.push(t)}))){p=!1;break}}else if(f!==m&&!s(f,m,n,r,o)){p=!1;break}}return o.delete(e),o.delete(t),p};const ma=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n};const ya=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var ga=ds?ds.prototype:void 0,ba=ga?ga.valueOf:void 0;const Oa=function(e,t,n,r,s,o,i){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new Mi(e),new Mi(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Hr(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=ma;case"[object Set]":var c=1&r;if(a||(a=ya),e.size!=t.size&&!c)return!1;var d=i.get(e);if(d)return d==t;r|=2,i.set(e,t);var u=fa(a(e),a(t),r,s,o,i);return i.delete(e),u;case"[object Symbol]":if(ba)return ba.call(e)==ba.call(t)}return!1};var wa=Object.prototype.hasOwnProperty;const Ia=function(e,t,n,r,s,o){var i=1&n,a=gi(e),c=a.length;if(c!=gi(t).length&&!i)return!1;for(var d=c;d--;){var u=a[d];if(!(i?u in t:wa.call(t,u)))return!1}var l=o.get(e),p=o.get(t);if(l&&p)return l==t&&p==e;var h=!0;o.set(e,t),o.set(t,e);for(var f=i;++d<c;){var m=e[u=a[d]],y=t[u];if(r)var g=i?r(y,m,u,t,e,o):r(m,y,u,e,t,o);if(!(void 0===g?m===y||s(m,y,n,r,o):g)){h=!1;break}f||(f="constructor"==u)}if(h&&!f){var b=e.constructor,O=t.constructor;b==O||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof O&&O instanceof O||(h=!1)}return o.delete(e),o.delete(t),h};var va="[object Arguments]",Sa="[object Array]",Aa="[object Object]",Pa=Object.prototype.hasOwnProperty;const Ta=function(e,t,n,r,s,o){var i=wo(e),a=wo(t),c=i?Sa:Ni(e),d=a?Sa:Ni(t),u=(c=c==va?Aa:c)==Aa,l=(d=d==va?Aa:d)==Aa,p=c==d;if(p&&Po(e)){if(!Po(t))return!1;i=!0,u=!1}if(p&&!u)return o||(o=new so),i||Mo(e)?fa(e,t,n,r,s,o):Oa(e,t,c,n,r,s,o);if(!(1&n)){var h=u&&Pa.call(e,"__wrapped__"),f=l&&Pa.call(t,"__wrapped__");if(h||f){var m=h?e.value():e,y=f?t.value():t;return o||(o=new so),s(m,y,n,r,o)}}return!!p&&(o||(o=new so),Ia(e,t,n,r,s,o))};const _a=function e(t,n,r,s,o){return t===n||(null==t||null==n||!ho(t)&&!ho(n)?t!=t&&n!=n:Ta(t,n,r,s,e,o))};const ka=function(e,t){return _a(e,t)};function Ca(e,t){const n=aa(e);return n.path[n.path.length-1]+=t,n}function Ea(e,t){return e.root===t.root&&ka(e.path,t.path)}function ja(e){Da(e,(e=>("main"==e.root?(e.rootMain=!0,delete e.root):"$graveyard"==e.root&&(e.rootGraveyard=!0,delete e.root),e)))}function Ra(e){Da(e,(e=>(e.rootMain?(e.root="main",delete e.rootMain):e.rootGraveyard&&(e.root="$graveyard",delete e.rootGraveyard),e)))}function Da(e,t){for(const n in e){const r=e[n];"nodes"!==n&&Os(r)&&(r.path&&(r.root||r.rootMain||r.rootGraveyard)?e[n]=t(r):Da(r,t))}return e}class Na{constructor(e,t,n){this._id=e,this._operationName=t,this._protobufDescriptor=n}compress(e,t){const n=t.shift();return ja(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){t.types.shift();const n=this._protobufDescriptor.decompress(t.buffers.shift());Ra(n),n.__className=this._operationName,e.push(n)}}class xa extends Na{compress(e,t){const n=t.shift();return this._serializeOneOf("oldValue",n),this._serializeOneOf("newValue",n),ja(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){const{types:n,buffers:r}=t,s=this._protobufDescriptor.decompress(r.shift());n.shift(),this._deserializeOneOf("oldValue",s),this._deserializeOneOf("newValue",s),Ra(s),s.__className=this._operationName,e.push(s)}_serializeOneOf(e,t){const n=t[e];"boolean"==typeof n?t[`${e}Boolean`]=n:t[`${e}Json`]=JSON.stringify(n)}_deserializeOneOf(e,t){const n=`${e}Json`;t[n]?(t[e]=JSON.parse(t[n]),delete t[n]):(t[e]=t[`${e}Boolean`],delete t[`${e}Boolean`])}}class Va extends Na{compress(e,t){const n=t.shift();return this._serializeNodesAttributes(n.nodes),ja(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){const{types:n,buffers:r}=t,s=this._protobufDescriptor.decompress(r.shift());n.shift(),s.nodes||(s.nodes=[]),this._deserializeNodesAttributes(s.nodes),Ra(s),s.__className=this._operationName,e.push(s)}_serializeNodesAttributes(e){for(const t of e){if(t.attributes){const e=t.attributes;this._areValuesBoolean(e)?t.attributesBoolean=e:t.attributesJson=JSON.stringify(e)}t.children&&this._serializeNodesAttributes(t.children)}}_deserializeNodesAttributes(e){for(const t of e)(t.attributesBoolean||t.attributesJson)&&(t.attributesBoolean?(t.attributes=t.attributesBoolean,delete t.attributesBoolean):(t.attributes=JSON.parse(t.attributesJson),delete t.attributesJson)),t.children&&this._deserializeNodesAttributes(t.children)}_areValuesBoolean(e){return Object.keys(e).every((t=>"boolean"==typeof e[t]))}}class Ma extends Na{decompress(e,t){super.decompress(e,t);const n=e[e.length-1];n.oldRange||(n.oldRange=null),n.newRange||(n.newRange=null)}}class Ba extends Na{compress(e,t){return t.shift(),e.types.push(this._id),!0}decompress(e,t){t.types.shift(),e.push({__className:this._operationName})}}class Ua extends Ma{constructor(e,t,n,r){super(e,t,n),this._omittedNamespace=r+":"}compress(e,t){return!("MarkerOperation"!=t[0].__className||!t[0].name.startsWith(this._omittedNamespace))&&(t[0].name=t[0].name.replace(new RegExp("^"+this._omittedNamespace),""),super.compress(e,t),!0)}decompress(e,t){super.decompress(e,t);const n=e[e.length-1];n.name=this._omittedNamespace+n.name}}class Ja{constructor(e,t){this._id=e,this._context=t}compress(e,t){let n;for(;t.length>1&&this._compareOperations(t[0],t[1]);)n?(n=this._combineNext(t.shift(),n),e.types.push(0)):(n=aa(t.shift()),e.types.push(this._id));return!!n&&(n=this._combineNext(t.shift(),n),e.types.push(0),e.buffers.push(this._compressSingleOperation(n)),!0)}decompress(e,t){const n=this._decompressSingleOperation(t);for(;0==t.types[0];)t.types.shift(),e.push(this._splitCurrent(n));e.push(n)}}class qa extends Ja{_combineNext(e,t){return t.nodes[0].data+=e.nodes[0].data,t}_splitCurrent(e){const t=aa(e),n=t.nodes[0],r=e.nodes[0],s=r.data[Symbol.iterator]().next().value,o=s.length;return n.data=s,r.data=r.data.substr(o),e.position=Ca(e.position,o),t}_compareOperations(e,t){if(this._checkOperation(e)&&this._checkOperation(t)){const n=e.nodes[0].data.length,r=Ea(Ca(e.position,n),t.position),s=e.nodes[0],o=t.nodes[0];return r&&this._compareAttributes(s,o)}return!1}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("InsertOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("InsertOperation").decompress(t,e),t[0]}_checkOperation(e){return"InsertOperation"==e.__className&&1==e.nodes.length&&e.nodes[0].data&&!e.wasUndone&&1==Array.from(e.nodes[0].data).length}_compareAttributes(e,t){const n=Object.keys(e.attributes||{}),r=Object.keys(t.attributes||{});return n.length===r.length&&n.every((n=>t.attributes[n]&&t.attributes[n]===e.attributes[n]))}}class La extends Ja{_combineNext(e,t){return t.howMany++,t.sourcePosition=aa(e.sourcePosition),t}_splitCurrent(e){const t=aa(e);return e.howMany--,t.howMany=1,t.sourcePosition=Ca(t.sourcePosition,e.howMany),t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(Ea(Ca(e.sourcePosition,-1),t.sourcePosition)&&Ea(e.targetPosition,t.targetPosition))}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MoveOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MoveOperation").decompress(t,e),t[0]}_checkOperation(e){return"MoveOperation"==e.__className&&"$graveyard"==e.targetPosition.root&&1==e.howMany&&!e.wasUndone}}class Ga extends Ja{_combineNext(e,t){return t.howMany++,t}_splitCurrent(e){const t=aa(e);return t.howMany=1,e.howMany--,t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(Ea(e.sourcePosition,t.sourcePosition)&&Ea(e.targetPosition,t.targetPosition))}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MoveOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MoveOperation").decompress(t,e),t[0]}_checkOperation(e){return"MoveOperation"==e.__className&&"$graveyard"==e.targetPosition.root&&1==e.howMany&&!e.wasUndone}}class Ya extends Ja{compress(e,t){if(!this._compareOperations(t[0],t[1]))return!1;const n=t.shift();return n.oldRange=null,n.newRange&&Ea(n.newRange.start,n.newRange.end)&&(n.newRange.end=null),t.shift(),e.types.push(this._id),e.types.push(0),e.buffers.push(this._compressSingleOperation(n)),!0}decompress(e,t){const n=this._decompressSingleOperation(t);n.newRange&&!n.newRange.end&&(n.newRange.end=aa(n.newRange.start));const r=aa(n);r.newRange&&(r.newRange.start.stickiness="toNone",r.newRange.end=aa(r.newRange.start)),r.name="user:position:"+r.name.split(":")[2],t.types.shift(),e.push(n),e.push(r)}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MarkerOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MarkerOperation").decompress(t,e),t[0]}_compareOperations(e,t){return!(!e||!t)&&("MarkerOperation"==e.__className&&"MarkerOperation"==t.__className&&!(!e.name.startsWith("user:")||!t.name.startsWith("user:")||e.name==t.name))}}class za{constructor(){this._compressorById=new Map,this._compressorByName=new Map,this._protobufFactory=new Yr;const e=this._protobufFactory.getDescriptor("MarkerOperation");this._registerCompressor(1,"NoOperation",new Ba(1,"NoOperation",void 0)),this._registerOperationCompressor(10,"AttributeOperation",xa),this._registerOperationCompressor(11,"InsertOperation",Va),this._registerOperationCompressor(12,"MarkerOperation",Ma),this._registerOperationCompressor(13,"MergeOperation",Na),this._registerOperationCompressor(14,"MoveOperation",Na),this._registerOperationCompressor(15,"RenameOperation",Na),this._registerOperationCompressor(16,"RootAttributeOperation",xa),this._registerOperationCompressor(17,"SplitOperation",Na),this._registerCompressor(18,"CommentMarkerOperation",new Ua(18,"MarkerOperation",e,"comment")),this._registerCompressor(19,"SuggestionMarkerOperation",new Ua(19,"MarkerOperation",e,"suggestion")),this._registerOperationCompressor(20,"RootOperation",Na),this._registerActionCompressor(100,"TypingAction",qa),this._registerActionCompressor(101,"DeletingAction",La),this._registerActionCompressor(102,"ForwardDeletingAction",Ga),this._registerActionCompressor(103,"UserSelectionAction",Ya)}compress(e){if(!e||!e[0])throw new s.CKEditorError("no-operations-provided",this);const t={types:[],buffers:[],baseVersion:e[0].baseVersion};for(;e.length;)this._getCompressorByName("UserSelectionAction").compress(t,e)||this._getCompressorByName("TypingAction").compress(t,e)||this._getCompressorByName("DeletingAction").compress(t,e)||this._getCompressorByName("ForwardDeletingAction").compress(t,e)||this._getCompressorByName("CommentMarkerOperation").compress(t,e)||this._getCompressorByName("SuggestionMarkerOperation").compress(t,e)||this._getCompressorByName(e[0].__className).compress(t,e);return t}decompress(e){const t=[];for(;e.types.length;){this._compressorById.get(e.types[0]).decompress(t,e)}return t.forEach(((t,n)=>t.baseVersion=e.baseVersion+n)),t}_getCompressorByName(e){return this._compressorByName.get(e)}_registerOperationCompressor(e,t,n){const r=new n(e,t,this._protobufFactory.getDescriptor(t));this._registerCompressor(e,t,r)}_registerActionCompressor(e,t,n){const r=new n(e,this);this._registerCompressor(e,t,r)}_registerCompressor(e,t,n){this._compressorById.set(e,n),this._compressorByName.set(t,n)}}new Map([[Cn.TYPE,Cn.READABLE_TYPE_NAME],[Dn.TYPE,Dn.READABLE_TYPE_NAME],[Rn.TYPE,Rn.READABLE_TYPE_NAME],[Mn.TYPE,Mn.READABLE_TYPE_NAME],[Ln.TYPE,Ln.READABLE_TYPE_NAME],[Yn.TYPE,Yn.READABLE_TYPE_NAME],[Wn.TYPE,Wn.READABLE_TYPE_NAME],[Zn.TYPE,Zn.READABLE_TYPE_NAME],[Fn.TYPE,Fn.READABLE_TYPE_NAME],[Hn.TYPE,Hn.READABLE_TYPE_NAME],[Kn.TYPE,Kn.READABLE_TYPE_NAME],[mn.TYPE,mn.READABLE_TYPE_NAME],[yn.TYPE,yn.READABLE_TYPE_NAME],[gn.TYPE,gn.READABLE_TYPE_NAME],[Xt.TYPE,Xt.READABLE_TYPE_NAME],[tn.TYPE,tn.READABLE_TYPE_NAME],[cn.TYPE,cn.READABLE_TYPE_NAME],[rn.TYPE,rn.READABLE_TYPE_NAME],[dn.TYPE,dn.READABLE_TYPE_NAME],[ln.TYPE,ln.READABLE_TYPE_NAME],[Be.TYPE,Be.READABLE_TYPE_NAME],[Je.TYPE,Je.READABLE_TYPE_NAME],[Ht.TYPE,Ht.READABLE_TYPE_NAME],[Wt.TYPE,Wt.READABLE_TYPE_NAME],[Lt.TYPE,Lt.READABLE_TYPE_NAME],[zt.TYPE,zt.READABLE_TYPE_NAME],[Bt.TYPE,Bt.READABLE_TYPE_NAME],[nr.TYPE,nr.READABLE_TYPE_NAME],[rr.TYPE,rr.READABLE_TYPE_NAME],[sr.TYPE,sr.READABLE_TYPE_NAME],[tr.TYPE,tr.READABLE_TYPE_NAME]]);const{Encoder:Fa,Decoder:Ha}=t,Ka=Wa;function Wa(e,t){const n=tc();return(Wa=function(e,t){return n[e-=469]})(e,t)}!function(e,t){const n=Wa,r=e();for(;;)try{if(569982===-parseInt(n(504))/1+-parseInt(n(706))/2*(parseInt(n(619))/3)+-parseInt(n(533))/4*(parseInt(n(530))/5)+parseInt(n(541))/6+parseInt(n(647))/7+-parseInt(n(711))/8+parseInt(n(676))/9)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(tc);let Qa=1;class Za extends r.Plugin{static get[Ka(648)](){return[pr,gr,Sr,r.PendingActions,hr.Users,o.Notification]}static get[Ka(663)](){return Ka(577)}get[Ka(724)](){const e=Ka;return this[e(703)]+this[e(562)]}get[Ka(703)](){const e=Ka;return this[e(589)][e(639)]-this[e(562)]}get[Ka(607)](){const e=Ka,t=this[e(589)][e(524)]();for(let n=t[e(517)]-1;n>=0;n--){const r=t[n];if(!this[e(558)][e(598)](r))return r[e(547)]+1-this[e(562)]}return 0}constructor(e){const t=Ka;if(super(e),this[t(562)]=0,this[t(480)]=null,this[t(589)]=new i.History,this[t(719)][t(609)][t(572)](t(560),{}),this[t(669)]=this[t(719)][t(609)][t(634)](t(610)),!this[t(669)])throw new s.CKEditorError(t(585),this);const n=e[t(609)][t(634)](t(600))||s.version;this[t(535)]=new(Za[t(578)])(n,this[t(669)]),this[t(475)]=this[t(719)][t(470)][t(584)],this[t(548)]=new za,this[t(660)]=[],this[t(582)]=new WeakSet,this[t(591)]=new Set,this[t(516)](t(606),!1),this[t(516)](t(575),!1),this[t(721)]=null,this[t(593)]=!1,this[t(553)]=null,this[t(552)]=300,this[t(690)]=this[t(552)],this[t(694)]=null,this[t(558)]=new WeakSet,this[t(493)]=new nc(this[t(558)])}[Ka(671)](){const e=Ka,t=this[e(719)],n=t[e(659)][e(634)](hr.Users),r=t[e(659)][e(634)](pr);this[e(587)](n,e(667),((t,r)=>{const s=e,o=r[0];o[s(710)]&&(t[s(522)]=n[s(573)](o[s(710)]),t[s(544)]()),null===o[s(710)]&&(t[s(522)]=null,t[s(544)]())}),{priority:e(602)}),this[e(587)](t[e(470)][e(584)][e(677)],e(622),((t,n)=>{const r=e;n[r(695)]&&this[r(478)]()})),this[e(587)](t[e(630)][e(518)],e(503),(()=>{this[e(478)]()})),this[e(640)](),t[e(470)].on(e(469),((t,n)=>{const r=e,s=n[0];s[r(508)]&&(this[r(580)](s),this[r(617)]()&&this[r(618)]())})),this[e(489)](),this[e(556)](e(592)).to(r,e(657),this,e(575),((t,n)=>e(571)===t&&!n)),this.on(e(624),(()=>{const n=e;this[n(592)]?t[n(509)](n(637)):t[n(666)](n(637))})),this[e(592)]?t[e(509)](e(637)):t[e(666)](e(637)),this[e(516)](e(668),!1)}async[Ka(623)](){const e=Ka,t=this[e(719)][e(659)][e(634)](gr),n=this[e(719)][e(659)][e(634)](pr);try{this[e(606)]=!0,t[e(566)](this[e(669)]);const r=await this[e(535)][e(623)](n[e(709)],this[e(607)]);await this[e(642)](r)&&(this[e(606)]=!1,this[e(477)]());const s=await this[e(535)][e(545)]();t[e(628)](this[e(669)],s),this[e(621)](),this[e(668)]=!0}catch(t){if(function(t){const n=e;return n(495)===t[n(636)]}(t)&&this[e(480)])await this[e(658)]();else if(function(t){const n=e;return n(586)===t[n(636)]}(t)){const t=_r(this[e(719)][e(507)],e(603));this[e(590)](t)}else{if(!(t instanceof Xa))throw t;this[e(590)]()}}}[Ka(482)](){const e=Ka,t=this[e(719)][e(659)][e(634)](pr),n=this[e(719)][e(659)][e(634)](gr);this[e(719)][e(666)](e(594)),n[e(542)][e(598)](this[e(669)])&&n[e(566)](this[e(669)]),t[e(539)](this),this[e(531)](),super[e(482)]()}async[Ka(642)](e){const t=Ka;if(this[t(480)]!==e[t(480)]&&this[t(694)]!==e[t(629)])throw new Xa;return this[t(480)]=e[t(480)],this[t(712)]([],{...e,wereChangesApplied:!1,data:e[t(472)]},t(623))}async[Ka(471)](e,t=!1){const n=Ka,{connection:r}=this[n(719)][n(659)][n(634)](pr);Za[n(578)][n(545)](r,this[n(669)])[n(546)]((e=>this[n(536)](e)))[n(485)]((e=>{const t=n;this[t(697)](t(596),e)})),this[n(587)](this[n(535)],n(638),this[n(608)][n(556)](this)),this[n(587)](this[n(535)],n(561),((e,t)=>{const r=n;this[r(697)](r(505),t)})),this[n(587)](this[n(535)],n(701),(()=>{this[n(668)]=!1}));const s=this[n(493)][n(514)](e);this[n(606)]=!0;const o=await this[n(535)][n(511)](r,this[n(698)](e),s);if(this[n(480)]=o[n(480)],t){if(!o[n(625)])return void this[n(590)]();this[n(606)]=!1,this[n(477)](),this[n(589)][n(651)](),this[n(562)]=o[n(702)],this[n(589)][n(639)]=this[n(562)],await this[n(712)](e,o,n(599))}else await this[n(680)](o,e);this[n(621)](),this[n(668)]=!0}[Ka(621)](){const e=Ka,t=this[e(719)][e(659)][e(634)](gr),n=this[e(719)][e(659)][e(634)](Sr),r=t[e(542)][e(634)](this[e(669)]);r&&r[e(517)]>1?n[e(484)]():this[e(587)](t,e(570)+this[e(669)],(()=>{const r=e;2===t[r(542)][r(634)](this[r(669)])[r(517)]&&n[r(484)]()}))}async[Ka(608)](e,t,n,r){const s=Ka;if(!this[s(606)]&&this[s(475)][s(639)]==t){const e=this[s(494)](n,r);await this[s(520)](e),this[s(641)](e,t,n[s(629)])||this[s(697)](s(643))}}async[Ka(658)](){const e=Ka;this[e(531)]();const{locale:t}=this[e(719)];let n;try{n=await this[e(535)][e(512)]()}catch(n){const r=_r(t,e(656));return void this[e(590)](r)}const r=n[e(722)]||n[e(708)];if(this[e(694)]===r[e(629)])await this[e(471)](this[e(719)][e(470)][e(584)][e(538)][e(524)](),!0);else{const n=_r(t,e(716));this[e(590)](n)}}[Ka(531)](){const e=Ka;this[e(535)][e(519)](),this[e(660)]=[],clearTimeout(this[e(553)]),this[e(479)](this[e(535)])}[Ka(536)](e){const t=Ka,n=this[t(719)][t(659)][t(634)](gr);this[t(587)](n,t(570)+this[t(669)],((e,{session:r})=>{const s=t;if(r.id===n[s(486)]){e[s(673)]();const t=this[s(719)][s(659)][s(598)](s(473))&&this[s(719)][s(659)][s(634)](s(473));let n=r[s(654)];t&&t[s(498)]&&(n=n[s(526)]((e=>s(718)!==e))),this[s(719)][s(659)][s(634)](s(674))[s(683)](n,this[s(669)])}})),n[t(628)](this[t(669)],e)}[Ka(640)](){const e=Ka,t=this[e(719)][e(472)][e(516)];this[e(719)][e(472)][e(516)]=(...n)=>{const r=e;if(!n[n[r(517)]-1][r(492)])throw new s.CKEditorError(r(564),this);t[r(675)](this[r(719)][r(472)],n)}}[Ka(489)](){const e=Ka;this[e(719)][e(472)].on(e(671),((t,[n])=>{const r=e;if(this[r(475)][r(639)])throw new s.CKEditorError(r(653),this);t[r(544)](),this[r(691)]();const o=this[r(719)][r(609)][r(634)](r(579)),a=this[r(581)](n,o);0==a[r(517)]&&a[r(521)](new i.NoOperation(0)),t[r(522)]=this[r(471)](a)[r(546)]((()=>{const e=r;this[e(719)][e(659)][e(634)](pr)[e(613)](this),this[e(719)][e(472)][e(515)](e(693))}))[r(485)]((e=>this[r(697)](r(527),e)))[r(506)]((()=>this[r(477)]()))}),{priority:e(602)}),this[e(719)].on(e(557),(async(t,[n,r])=>{const s=e;t[s(544)]();const o=this[s(719)][s(470)][s(584)][s(604)](n);if(!this[s(591)][s(598)](n)){const e=r&&r[s(472)]?r[s(472)]:"",t=r&&r[s(686)]?r[s(686)]:{};await this[s(483)](n,e,t)}this[s(719)][s(470)][s(502)]({isUndoable:!1},(()=>{const e=s;o[e(529)]=!0,this[e(719)][e(470)][e(584)][e(652)][e(688)](o)}))}),{priority:e(602)})}async[Ka(520)](e){const t=Ka,n=this[t(719)][t(659)][t(634)](hr.Users),{connection:r}=this[t(719)][t(659)][t(634)](pr),s=new Set;for(const r of e){const e=r[t(710)];e&&!n[t(573)](e)&&s[t(714)](e)}if(0===s[t(611)])return;const o=await ze[t(565)](r,Array[t(563)](s));for(const e of o)n[t(573)](e.id)||n[t(605)](e)}[Ka(581)](e,t={}){const n=Ka,r=this[n(719)][n(470)],o=[];let a=0;const c=n(550)==typeof e?{main:e}:e;for(const e of Object[n(481)](c)){if(!this[n(475)][n(499)][n(598)](e))throw new s.CKEditorError(n(595),this);const t=this[n(719)][n(472)][n(583)](c[e]),d=this[n(475)][n(604)](e),u=new i.InsertOperation(r[n(626)](d,0),t,a++);o[n(521)](u);for(const[e,s]of t[n(720)]){const t=r[n(664)](r[n(567)](d,s[n(525)][n(549)][n(532)]()),r[n(567)](d,s[n(645)][n(549)][n(532)]())),c=new i.MarkerOperation(e,null,t,r[n(720)],!0,a++);o[n(521)](c)}}if(t)for(const[e,c]of Object[n(612)](t)){const t=r[n(584)][n(604)](e);if(!t)throw new s.CKEditorError(n(510),null);for(const[e,r]of Object[n(612)](c))if(null!==r){const s=new i.RootAttributeOperation(t,e,null,r,a++);o[n(521)](s)}}return o}async[Ka(483)](e,t,n){const r=Ka;this[r(581)]({[e]:t},{[e]:n})[r(723)](((e,t)=>{const n=r;e[n(547)]=this[n(475)][n(639)]+t,e[n(540)]=!0,this[n(580)](e)})),this[r(618)](),await this[r(679)]()}async[Ka(680)](e,t){const n=Ka;let r;this[n(562)]=e[n(702)];const s=e[n(625)]&&!e[n(616)],o=s?0:e[n(472)][n(547)];if(t[n(723)]((t=>{const r=n;t[r(540)]=!0,t[r(588)]=e[r(725)],t[r(710)]=null})),s)r=t,this[n(661)](r,s);else{if(e[n(616)]){const t=this[n(581)](e[n(616)]);this[n(475)][n(538)][n(639)]=-t[n(517)],t[n(723)]((r=>{const s=n;r[s(547)]-=t[s(517)],r[s(588)]=e[s(725)],r[s(540)]=!0,r[s(710)]=null})),this[n(661)](t,!0),this[n(589)][n(639)]=-t[n(517)]+this[n(562)],this[n(490)](t)}this[n(475)][n(538)][n(639)]=o,r=this[n(494)](e[n(472)],e[n(513)]),await this[n(520)](r),this[n(661)](r,s)}e[n(629)]&&(this[n(493)][n(632)](r,e[n(629)]),this[n(694)]=e[n(629)]),this[n(589)][n(639)]=o+this[n(562)],this[n(490)](r),t[n(526)]((e=>{const t=n,r=this[t(705)](e);return r&&!this[t(591)][t(598)](r)}))[n(723)](((e,t)=>{const r=n;e[r(547)]=this[r(475)][r(639)]+t,this[r(580)](e)})),this[n(617)]()?(this[n(690)]=0,this[n(618)](!0),await this[n(679)]()):(this[n(606)]=!1,this[n(477)]())}[Ka(697)](e,t){const n=Ka;throw this[n(606)]=!0,t&&console[n(561)](t),new s.CKEditorError(e,this[n(719)])}[Ka(580)](e){const t=Ka;this[t(582)][t(598)](e)||(this[t(582)][t(714)](e),this[t(660)][t(521)](e),this[t(721)]||t(555)==e[t(696)]&&!e[t(488)]||this[t(691)]())}[Ka(618)](e=!1){const t=Ka;!e&&this[t(606)]||(this[t(606)]=!0,clearTimeout(this[t(553)]),this[t(553)]=setTimeout((()=>{const e=t;this[e(543)]()[e(546)]((t=>{const n=e;t&&(this[n(477)](),this[n(606)]=!1)}))[e(485)]((t=>{const n=e;if(this[n(477)](),this[n(606)]=!1,!function(e){const t=n;return e[t(715)][t(537)](t(700))||e[t(715)][t(537)](t(633))||e[t(715)][t(537)](t(644))}(t))throw t}))}),this[t(690)]))}[Ka(679)](){return new Promise((e=>{const t=Wa;this.on(t(615),(()=>{e()}))}))}async[Ka(543)](){const e=Ka,t=this[e(719)][e(659)][e(634)](Sr);if(this[e(487)]()&&(t[e(484)](),this[e(593)]=!1),!this[e(617)]())return!0;const n=[...this[e(660)]];for(const t of n)t[e(646)]=this[e(475)][e(538)][e(635)](t);const r=this[e(493)][e(514)](n),s=Qa++,o=this[e(698)](n),i=await this[e(535)][e(474)](o,o[e(547)],r);try{return await this[e(712)](n,i,s)}catch(t){return this[e(697)](e(672),t)}}async[Ka(712)](e,t,n){const r=Ka;if(r(561)in t)throw t[r(561)];let s=!1;if(t[r(625)]){t[r(629)]&&(this[r(694)]=t[r(629)]),this[r(660)]=this[r(660)][r(526)]((t=>!e[r(678)](t)));for(const n of e)n[r(588)]=r(682)in t&&t[r(682)]||void 0;ec(e,t[r(639)]-e[r(517)]),this[r(490)](e);const n=e[r(526)]((e=>{const t=r;if(!e[t(540)])return!1;const n=this[t(705)](e);return n&&!this[t(591)][t(598)](n)}));ec(n,this[r(475)][r(639)]),this[r(661)](n),s=!0,this[r(690)]=this[r(552)]}else{const e=this[r(494)](t[r(472)],t[r(513)])[r(526)]((e=>e[r(547)]>=this[r(703)]));e[r(723)]((e=>this[r(576)](e))),this[r(660)]=this[r(660)][r(526)]((e=>!e[r(540)]||!this[r(591)][r(598)](this[r(705)](e)))),this[r(660)][r(517)]&&ec(this[r(660)],this[r(660)][0][r(547)]),await this[r(520)](e),s=this[r(641)](e,t[r(639)],t[r(629)]),this[r(690)]=Math[r(597)](this[r(690)]/2)}return s?!this[r(617)]()||(this[r(618)](!0),!1):this[r(697)](r(704))}[Ka(641)](e,t,n){const r=Ka;try{const s={document:this[r(475)],useRelations:!1,padWithNoOps:!0},{operationsA:o,operationsB:a,originalOperations:c}=(0,i.transformSets)(e,this[r(660)],s);ec(o,this[r(475)][r(639)]),ec(a,t);for(const e of o){const t=c[r(634)](e);e[r(710)]=t?t[r(710)]:null}n&&(this[r(493)][r(632)](e,n),this[r(694)]=n),this[r(660)]=[...a],this[r(661)](o),this[r(490)](e)}catch(e){return console[r(561)](e),!1}return!0}[Ka(661)](e,t=!1){const n=Ka;this[n(719)][n(470)][n(502)]({isUndoable:!1,isLocal:!1},(t=>{const r=n;for(const n of e)this[r(582)][r(714)](n),this[r(576)](n),t[r(665)][r(574)](n),this[r(719)][r(470)][r(469)](n)}))}[Ka(576)](e){const t=Ka,n=this[t(705)](e);n&&this[t(591)][t(714)](n)}[Ka(705)](e){const t=Ka;let n,r;switch(e[t(696)]){case t(601):n=e[t(491)][t(685)];break;case t(555):if(r=e[t(692)],!r)return null;n=r[t(685)];break;case t(689):n=e[t(685)];break;case t(631):n=e[t(523)];break;case t(662):n=e[t(614)][t(685)];break;default:return null}return n[t(569)]}[Ka(490)](e){const t=Ka;e[t(723)]((e=>{const n=t,r=e[n(713)]();r[n(710)]=e[n(710)],r[n(540)]=!!e[n(540)],r[n(588)]=e[n(588)],r[n(547)]+=this[n(562)],e[n(649)]&&this[n(558)][n(714)](r),this[n(589)][n(574)](r)}))}[Ka(590)](e){const t=Ka,n=this[t(719)][t(659)][t(634)](t(650)),r=this[t(719)][t(507)];e||(e=_r(r,t(528))),n[t(670)](e,{title:_r(r,t(707)),namespace:t(620)}),this[t(575)]=!0,clearTimeout(this[t(553)]),this[t(660)]=[],this[t(719)][t(659)][t(634)](pr)[t(482)]()}[Ka(691)](){const e=Ka;this[e(721)]||(this[e(721)]=this[e(719)][e(659)][e(634)](r.PendingActions)[e(714)](_r(this[e(719)][e(507)],e(627))))}[Ka(477)](){const e=Ka;this[e(721)]&&(this[e(719)][e(659)][e(634)](r.PendingActions)[e(554)](this[e(721)]),this[e(721)]=null)}[Ka(698)](e){const t=Ka,n=e[t(655)]((e=>e[t(497)]()));return this[t(548)][t(534)](n)}[Ka(494)](e,t){const n=Ka;return this[n(548)][n(500)](e)[n(655)](((e,r)=>{const s=n,o=s(671)==t[r][s(696)];if(s(684)==e[s(681)]){const t=e[s(491)][s(685)];!this[s(475)][s(604)](t)&&(this[s(475)][s(699)](s(568),t)[s(476)]=!1)}const a=i.OperationFactory[s(501)](e,this[s(475)]);return a[s(646)]=e[s(646)],a[s(540)]=o,a[s(710)]=o?null:t[r][s(559)],a[s(649)]=s(551)===t[r][s(696)],a[s(588)]=t[r][s(588)],a}))}[Ka(478)](){const e=Ka;this[e(593)]=!0,this[e(487)]()?this[e(618)]():this[e(593)]=!1}[Ka(487)](){const e=Ka,t=this[e(719)][e(659)][e(634)](gr)[e(542)][e(634)](this[e(669)]);return!this[e(719)][e(687)]&&!!t&&t[e(517)]>1&&this[e(593)]}[Ka(617)](){const e=Ka;return this[e(660)][e(517)]>0||this[e(487)]()}}Za[Ka(578)]=Un;const $a=Za;class Xa extends Error{}function ec(e,t){const n=Ka;for(const r of e)r[n(547)]=t++}function tc(){const e=["_sendBufferedOperationsDelayId","remove","marker","bind","loadRoot","_disconnectionOperations","userId","collaboration","error","_offset","from","realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration","getMany","unregister","createPositionFromPath","$root","rootName","sessionAdd:","connected","define","getUser","addOperation","_hasSynchronizationProblem","_addKnownRoot","RealTimeCollaborationClient","CollaborativeEditingService","rootsAttributes","_saveOperationInBuffer","_getOperationsFromInitData","_knownOperations","parse","document","collaboration-missing-channelid","409","listenTo","createdAt","serverHistory","_handleReconnectionError","_knownRootNames","_isEditingAllowed","_hasSelectionChanged","rtc-destroyed","realtimecollaborationclient-init-non-existent-root","realtimecollaborationclient-init-session-connection-error","round","has","reconnection: flushed session","cloudServices.bundleVersion","insert","high","The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.","getRoot","addUser","_isPendingUpdate","lastSyncVersion","_handleReceivedOperations","config","collaboration.channelId","size","entries","addToReconnectionStack","targetPosition","change:_isPendingUpdate","initData","_shouldSendUpdate","_sendBufferedOperationsDelayed","1905zPKFmQ","real-time-collaboration","_handleSendingSelectionMarkers","change:range","reconnect","change:_isEditingAllowed","wereChangesApplied","createPositionAt","PENDING_ACTION_SENDING_DATA","register","lastOperationId","editing","addRoot","setIdForTheLastOperation","cloud-services-internal-error: Collaborative Editing Service is not connected.","get","isUndoneOperation","code","rtc-offline","operationsReceived","version","_initThrowingOnDataSet","_handleExternalOperations","_handleReconnectionResponse","realtimecollaborationclient-initservice-incorrect-server-operation","cloud-services-internal-error: Request timeout.","end","wasUndone","4196024aAQLMq","requires","_isDisconnection","Notification","reset","differ","realtimecollaborationclient-init-document-already-initialized","permissions","map","The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.","state","_connectAfterSessionHasBeenFlushed","plugins","_bufferedOperations","_applyOperationsSet","move","pluginName","createRange","batch","enableReadOnlyMode","getOperationAuthor","_isConnected","_channelId","showWarning","init","realtimecollaborationclient-sendbufferedoperations","off","Permissions","apply","24187554XtjYrw","selection","includes","_waitUntilSynced","_handleInitialConnectionData","__className","lastOperationAcceptedAt","setPermissions","InsertOperation","root","attributes","isReadOnly","_bufferRootLoad","addRootAttribute","_currentBufferDelay","_setPendingAction","newRange","ready","_lastSyncedOperationId","directChange","type","_crash","_compressOperations","createRoot","cloud-services-internal-error: Not connected.","disconnected","offset","_lastServerVersion","realtimecollaborationclient-handleserverresponse","_getAffectedRoot","764SEAeES","Synchronization issue","lastDocumentSession","connection","_authorId","8276816aoQUUO","_handleServerResponse","clone","add","message","The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.","_operationToId","document:write","editor","markers","_pendingAction","currentDocumentSession","forEach","cloudDocumentVersion","sessionCreatedAt","applyOperation","model","_connectService","data","CommentsOnly","sendOperations","_document","_isAttached","_clearPendingAction","_refreshUserSelectionMarkers","stopListening","sessionId","keys","destroy","_loadRoot","createUserMarkerOperations","catch","mySessionId","_shouldSendSelectionUpdate","affectsData","_setUpDataInit","_updateServerHistory","position","suppressErrorInCollaboration","_operationIdentifier","_decompressOperations","404","_ignoredOperations","toJSON","isEnabled","roots","decompress","fromJSON","enqueueChange","change:hasDomSelection","1015309UNGArR","realtimecollaborationclient-initservice-internal-error","finally","locale","isDocumentOperation","disableReadOnlyMode","multi-root-editor-root-attributes-no-root","connect","getDocumentDetails","metadata","getIdOfTheLastOperation","fire","set","length","view","disconnect","_fetchMissingUsers","push","return","affectedSelectable","getOperations","start","filter","realtimecollaborationclient-init-connection-failed","The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.","_isLoaded","25NQxrjF","_disconnectService","slice","383232LMclKj","compress","_service","_initSessionsHandling","startsWith","history","removeFromReconnectionStack","_isInit","327390vQczFa","channelSessions","_sendBufferedOperations","stop","getConnectedSessions","then","baseVersion","_compressor","path","string","cs:removeUser","_baseBufferDelay"];return(tc=function(){return e})()}class nc{constructor(e){const t=Ka;this[t(496)]=e,this[t(717)]=new WeakMap}[Ka(514)](e){const t=Ka;let n=e[t(517)];for(;n--;){const r=e[n];if(!this[t(496)][t(598)](r)){if(!this[t(717)][t(598)](r)){const e=(0,s.uid)()[t(532)](1,18);this[t(717)][t(516)](r,e)}return this[t(717)][t(634)](r)}}}[Ka(632)](e,t){const n=Ka;if(!t)return;let r=e[n(517)];for(;r--;){const s=e[r];this[n(496)][n(598)](s)||this[n(717)][n(516)](s,t)}}}var rc=oc;function sc(){var e=["3vLxMGv","22348fdFuUh","1764QxBjZx","525820suEzoy","404792THpIIZ","requires","pluginName","126ohXBhZ","46970oSykeG","RealTimeCollaborativeEditing","2379000IMzzdT","30EDBjUx","185JkMkdB","121312KwDOsC","56067BOhWir"];return(sc=function(){return e})()}function oc(e,t){var n=sc();return(oc=function(e,t){return n[e-=444]})(e,t)}!function(e,t){for(var n=oc,r=e();;)try{if(291484===-parseInt(n(458))/1+-parseInt(n(457))/2*(parseInt(n(454))/3)+-parseInt(n(455))/4*(parseInt(n(451))/5)+parseInt(n(450))/6*(-parseInt(n(447))/7)+-parseInt(n(452))/8*(-parseInt(n(446))/9)+parseInt(n(449))/10+parseInt(n(453))/11*(parseInt(n(456))/12))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(sc);class ic extends r.Plugin{static get[rc(444)](){return[$a]}static get[rc(445)](){return rc(448)}}const ac=lc;function cc(){const e=["8sCLKQr","_fetchMissingUsersForThreads","from","cloud-services-internal-error: Comments Service is not connected.","commentThreadUpdated","_terminateService","commentThreadResolved","reconnect","20515330egDZDg","unregister","userId","message","115uVRqlU","updateComment","delete","commentRemoved","resolve","authorId","getConnectedSessions","2330960KSoIpW","resolvedBy","commentId","permissions","commentThreadAdded","_getService","mySessionId","6955669yWokMB","requires","listenTo","has","314hkcPqr","destroy","commentUpdated","CommentsRepository","getComment","createdAt","add","register","getUser","Permissions","commentThreadId","commentAdded","removeComment","code","_connectService","size","_setUpService","reopen","context","resolveCommentThread","catch","cloudservicescommentsadapter-connect-already-connected","577305kolcSC","attributes","updateCommentThread","removeCommentThread","CommentsService","_services","setPermissions","assign","set","cloudservicescommentsadapter-service-not-exist","map","cloud-services-internal-error: Request timeout.","comments","5497lZFzlM","3616986eoCadZ","init","deletedAt","addCommentThread","404","remove","sessionAdd:","pluginName","getCommentThreads","plugins","addToReconnectionStack","disconnect","getMany","cloud-services-internal-error: Not connected.","startsWith","update","adapter","addComment","getCommentThread","resolvedAt","reopenCommentThread","commentThreadRemoved","get","commentThreadReopened","keys","config","addUser","cloudservicescommentsadapter-disconnect-not-exist","collaboration.channelId","CloudServicesCommentsAdapter","connect","content","off","26178dNQxmF"];return(cc=function(){return e})()}!function(e,t){const n=lc,r=e();for(;;)try{if(653265===parseInt(n(456))/1*(-parseInt(n(421))/2)+parseInt(n(457))/3+-parseInt(n(410))/4+parseInt(n(403))/5*(-parseInt(n(390))/6)+parseInt(n(417))/7*(-parseInt(n(391))/8)+-parseInt(n(443))/9+parseInt(n(399))/10)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(cc);class dc extends r.ContextPlugin{static get[ac(418)](){return[pr,ac(424),gr,hr.Users]}static get[ac(464)](){return ac(386)}constructor(e){const t=ac;super(e),this[t(448)]=new Map}async[ac(458)](){const e=ac,t=this[e(439)],n=t[e(366)][e(379)](e(424));if(t[e(366)][e(379)](pr)[e(367)](this),n[e(373)]={addCommentThread:async({channelId:t,threadId:n,comments:r,resolvedAt:s,resolvedBy:o,context:i,attributes:a})=>{const c=e,d=await this[c(415)](t)[c(460)]({commentThreadId:n,comments:r[c(453)]((e=>function(e,t,n){const r=c;return{commentThreadId:n,commentId:e[r(412)],userId:e[r(408)],content:e[r(388)],documentId:t,createdAt:e[r(426)],attributes:e[r(444)]||{}}}(e,t,n))),resolvedAt:s,resolvedBy:o,context:i,attributes:a})[c(441)](hc);return{threadId:d[c(431)],comments:d[c(455)]}},getCommentThread:async({channelId:t,threadId:n})=>{const r=e,s=await this[r(415)](t)[r(375)](n)[r(441)](hc);return await this[r(392)]([s]),{threadId:s[r(431)],comments:s[r(455)][r(453)](fc),context:s[r(439)],resolvedAt:s[r(376)],resolvedBy:s[r(411)],attributes:s[r(444)]||{}}},updateCommentThread:async({channelId:t,threadId:n,context:r,unlinkedAt:s,attributes:o})=>this[e(415)](t)[e(445)]({commentThreadId:n,context:r,attributes:o,unlinkedAt:s})[e(441)](pc)[e(441)](hc),resolveCommentThread:async({channelId:t,threadId:n})=>{const r=e,s=await this[r(415)](t)[r(440)](n)[r(441)](pc)[r(441)](hc);return{threadId:s[r(431)],resolvedAt:s[r(376)],resolvedBy:s[r(411)]}},reopenCommentThread:async({channelId:t,threadId:n})=>this[e(415)](t)[e(377)](n)[e(441)](pc)[e(441)](hc),removeCommentThread:({channelId:t,threadId:n})=>this[e(415)](t)[e(446)](n)[e(441)](pc)[e(441)](hc),addComment:({channelId:t,threadId:n,commentId:r,content:s,attributes:o})=>this[e(415)](t)[e(374)](n,r,s,o)[e(441)](hc),updateComment:({channelId:t,threadId:n,commentId:r,content:s,attributes:o})=>this[e(415)](t)[e(404)](n,r,s,o)[e(441)](pc)[e(441)](hc),removeComment:({channelId:t,threadId:n,commentId:r})=>this[e(415)](t)[e(433)](n,r)[e(441)](pc)[e(441)](hc)},t instanceof r.Context){const n=t[e(382)][e(379)](e(385)),r=t[e(366)][e(379)](gr);await this[e(437)](n);const s=await this[e(448)][e(379)](n)[e(409)]();this[e(419)](r,e(463)+n,((t,{session:s})=>{const o=e;s.id===r[o(416)]&&(t[o(389)](),this[o(439)][o(366)][o(379)](o(430))[o(449)](s[o(413)],n))})),r[e(428)](n,s)}}async[ac(437)](e){const t=ac;if(this[t(448)][t(420)](e))throw new s.CKEditorError(t(442),null,{channelId:e});const n=this[t(439)][t(366)][t(379)](t(424)),r=new(dc[t(447)])(e);this[t(448)][t(451)](e,r),this[t(419)](r,t(414),((e,r)=>{const s=t,{commentThreadId:o,documentId:i,context:a,attributes:c,resolvedAt:d,resolvedBy:u,comments:l}=r;n[s(375)](o)||n[s(460)]({threadId:o,channelId:i,comments:l?l[s(453)](fc):[],context:a,attributes:c,resolvedAt:d,resolvedBy:u,isFromAdapter:!0})})),this[t(419)](r,t(395),((e,{commentThreadId:r,documentId:s,context:o,unlinkedAt:i,attributes:a})=>{const c=t;n[c(375)](r)&&n[c(445)]({threadId:r,channelId:s,context:o,unlinkedAt:i,attributes:a,isFromAdapter:!0})})),this[t(419)](r,t(397),((e,{commentThreadId:r,resolvedBy:s,resolvedAt:o})=>{const i=t,a=n[i(375)](r);a&&a[i(407)]({resolvedBy:s,resolvedAt:o,isFromAdapter:!0})})),this[t(419)](r,t(380),((e,{commentThreadId:r})=>{const s=t,o=n[s(375)](r);o&&o[s(438)]({isFromAdapter:!0})})),this[t(419)](r,t(378),((e,{commentThreadId:r})=>{const s=t,o=n[s(375)](r);o&&o[s(462)]({isFromAdapter:!0})})),this[t(419)](r,t(432),((e,r)=>{const s=t,o=r[s(431)],i=n[s(375)](o);i&&i[s(374)]({...fc(r),isFromAdapter:!0})})),this[t(419)](r,t(423),((e,{commentThreadId:r,commentId:s,content:o,attributes:i})=>{const a=t,c=n[a(375)](r);if(c){const e=c[a(425)](s);e&&e[a(372)]({content:o,attributes:i,isFromAdapter:!0})}})),this[t(419)](r,t(406),((e,{commentThreadId:r,commentId:s})=>{const o=t,i=n[o(375)](r);if(i){const e=i[o(425)](s);e&&e[o(462)]({isFromAdapter:!0})}})),await this[t(435)](e)}[ac(422)](){const e=ac;if(this[e(439)]instanceof r.Context){const t=this[e(439)][e(382)][e(379)](e(385));this[e(396)](t)}}[ac(396)](e){const t=ac;if(!this[t(448)][t(420)](e))throw new s.CKEditorError(t(384),null,{channelId:e});this[t(415)](e)[t(368)](),this[t(448)][t(405)](e)}async[ac(398)](){const e=ac;for(const t of this[e(448)][e(381)]())await this[e(435)](t);if(this[e(439)]instanceof r.Context){const t=this[e(439)][e(382)][e(379)](e(385)),n=this[e(439)][e(366)][e(379)](gr);n[e(400)](t);const r=await this[e(448)][e(379)](t)[e(409)]();n[e(428)](t,r)}}async[ac(435)](e){const t=ac,{connection:n}=this[t(439)][t(366)][t(379)](pr),r=this[t(439)][t(366)][t(379)](t(424)),s=this[t(448)][t(379)](e),o=await s[t(387)](n);await this[t(392)](o);const i=new Set(Array[t(393)](r[t(365)]({channelId:e}),(e=>e.id)));for(const e of o)e[t(459)]||i[t(405)](e[t(431)]);for(const e of i)r[t(375)](e)[t(462)]({isFromAdapter:!0});for(const n of o){let s=r[t(375)](n[t(431)]);const{commentThreadId:o,context:i,attributes:a,resolvedBy:c,resolvedAt:d,unlinkedAt:u,deletedAt:l}=n;if(l)continue;s||(s=r[t(460)]({channelId:e,threadId:o,context:i,attributes:a||{},resolvedBy:c,resolvedAt:d,unlinkedAt:u,isFromAdapter:!0}));const p=new Set(Array[t(393)](s[t(455)],(e=>e.id)));for(const e of n[t(455)])p[t(405)](e[t(412)]);for(const e of p)s[t(425)](e)[t(462)]({isFromAdapter:!0});for(const e of n[t(455)]){const n=s[t(425)](e[t(412)]);n?n[t(388)]!==e[t(388)]&&n[t(372)]({content:e[t(388)],isFromAdapter:!0}):s[t(374)](Object[t(450)](fc(e),{isFromAdapter:!0}))}}}[ac(415)](e){const t=ac;if(!this[t(448)][t(420)](e))throw new s.CKEditorError(t(452),null,{channelId:e});return this[t(448)][t(379)](e)}async[ac(392)](e){const t=ac,n=this[t(439)][t(366)][t(379)](hr.Users),{connection:r}=this[t(439)][t(366)][t(379)](pr),s=new Set;for(const{resolvedBy:r,comments:o}of e){r&&!n[t(429)](r)&&s[t(427)](r);for(const{userId:e}of o)n[t(429)](e)||s[t(427)](e)}if(0===s[t(436)])return;const o=await ze[t(369)](r,Array[t(393)](s));for(const e of o)n[t(429)](e.id)||n[t(383)](e)}}dc[ac(447)]=ar;const uc=dc;function lc(e,t){const n=cc();return(lc=function(e,t){return n[e-=365]})(e,t)}async function pc(e){const t=ac;if(t(461)!==e[t(434)])throw e}function hc(e){const t=ac;if((n=e)[t(402)][t(371)](t(394))||n[t(402)][t(371)](t(370))||n[t(402)][t(371)](t(454)))return new Promise((()=>{}));var n;throw e}function fc(e){const t=ac;return{threadId:e[t(431)],commentId:e[t(412)],content:e[t(388)],createdAt:e[t(426)],authorId:e[t(401)],attributes:e[t(444)]||{}}}const mc=yc;function yc(e,t){const n=gc();return(yc=function(e,t){return n[e-=475]})(e,t)}function gc(){const e=["230BBISaq","4045152MyJizB","getUser","config","requires","5jywuOx","editor","catch","message","hasSuggestion","listenTo","init","679drOYGl","type","state","data","6140228vcjpcz","then","TrackChangesService","connected","_trackChangesService","from","suggestionUpdated","585549wWTGBl","_waitForServiceReady","collaboration.channelId","attributes","12ELNbwp","adapter","502398huFdKW","5633265Btllkd","cloud-services-internal-error: Not connected.","startsWith","addToReconnectionStack","plugins","_bufferedRequests","94304uzxCyL","size","_fetchMissingUsersForThreads","reconnect","cloud-services-internal-error: Request timeout.","add","3suaBcv","update","TrackChangesEditing","set","isConnected","connection","get","find","getMany","off","values","_saved","originalSuggestionId","delete","connect","getSuggestion","843834BWZOGA","addUser","open","addSuggestionData"];return(gc=function(){return e})()}!function(e,t){const n=yc,r=e();for(;;)try{if(928532===parseInt(n(482))/1+-parseInt(n(511))/2*(-parseInt(n(495))/3)+parseInt(n(531))/4*(-parseInt(n(520))/5)+parseInt(n(516))/6+-parseInt(n(527))/7*(parseInt(n(489))/8)+parseInt(n(476))/9*(parseInt(n(515))/10)+parseInt(n(483))/11*(parseInt(n(480))/12))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(gc);class bc extends r.Plugin{static get[mc(519)](){return[uc,mc(497),pr]}constructor(e){const t=mc;super(e);const n=this[t(521)][t(518)][t(501)](t(478));this[t(488)]=new Map,this[t(535)]=new(bc[t(533)])(n)}[mc(526)](){const e=mc,t=this[e(521)][e(487)][e(501)](pr),n=this[e(521)][e(487)][e(501)](e(497));return n[e(481)]={getSuggestion:async t=>{const n=e;await this[n(477)]();const r=await this[n(535)][n(501)](t)[n(522)](Oc);return await this[n(491)]([r]),r},addSuggestion:async({id:t,type:n,data:r,originalSuggestionId:s,attributes:o})=>{const i=e;await this[i(477)]();const a={id:t,type:n,data:r,originalSuggestionId:s,attributes:o},c=await this[i(535)][i(494)](t,n,r,s,o)[i(522)]((e=>{if(wc(e))return new Promise((e=>{const n=yc;this[n(488)][n(498)](t,{resolve:e,suggestionData:a})}));throw e}));return this[i(488)][i(508)](t),c},updateSuggestion:async(t,n)=>{const r=e;if(await this[r(477)](),r(513)!==n[r(529)])return this[r(535)][r(496)](t,n)[r(522)](Oc)}},this[e(525)](this[e(535)],e(475),((t,r)=>{const s=e;n[s(524)](r.id)&&(n[s(510)](r.id)[s(479)]=r[s(479)])})),this[e(535)][e(509)](t[e(500)])[e(532)]((r=>(t[e(486)](this),this[e(491)](r)[e(532)]((()=>{const t=e;for(const e of r)n[t(514)](e)[t(506)]=!0})))))}async[mc(492)](){const e=mc,t=this[e(521)][e(487)][e(501)](e(497)),{connection:n}=this[e(521)][e(487)][e(501)](pr),r=await this[e(535)][e(509)](n);await this[e(491)](r);for(const{suggestionData:t,resolve:n}of this[e(488)][e(505)]()){let s=r[e(502)]((e=>e.id===t.id));s||(s=await this[e(535)][e(494)](t.id,t[e(528)],t[e(530)],t[e(507)])),n(s)}for(const n of r)t[e(524)](n.id)||t[e(514)](n)}async[mc(477)](){const e=mc;this[e(535)][e(499)]||await new Promise((t=>{const n=e;this[n(525)](this[n(535)],n(534),(e=>{e[n(504)](),t()}))}))}async[mc(491)](e){const t=mc,n=this[t(521)][t(487)][t(501)](hr.Users),{connection:r}=this[t(521)][t(487)][t(501)](pr),s=new Set;for(const{authorId:r}of e)n[t(517)](r)||s[t(494)](r);if(0===s[t(490)])return;const o=await ze[t(503)](r,Array[t(536)](s));for(const e of o)n[t(517)](e.id)||n[t(512)](e)}}function Oc(e){if(wc(e))return new Promise((()=>{}));throw e}function wc(e){const t=mc;return e[t(523)][t(485)](t(484))||e[t(523)][t(485)](t(493))}function Ic(e,t){const n=Sc();return(Ic=function(e,t){return n[e-=165]})(e,t)}bc[mc(533)]=hn;const vc=Ic;function Sc(){const e=["ready","destroy","init","1698201fHthpe","CommentsRepository","listenTo","config","isThreadsLoadingPaused","_terminateService","2037144tKQsQj","815264DVzJch","once","requires","503174dWaUHY","133093URjqEu","connected","CommentsEditing","switchReadOnly","_setUpService","pluginName","plugins","4354929nbocia","get","RealTimeCollaborativeComments","216VhsnRv","16205ADwJTx","editor","data","collaboration.channelId","Comments","change:state","7nMtqly"];return(Sc=function(){return e})()}!function(e,t){const n=Ic,r=e();for(;;)try{if(302726===-parseInt(n(193))/1+parseInt(n(192))/2+-parseInt(n(182))/3+parseInt(n(171))/4*(-parseInt(n(172))/5)+-parseInt(n(188))/6*(-parseInt(n(178))/7)+parseInt(n(189))/8+parseInt(n(168))/9)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Sc);class Ac extends r.Plugin{static get[vc(191)](){return[vc(176),uc,ic,pr]}static get[vc(166)](){return vc(170)}[vc(181)](){const e=vc,t=this[e(173)][e(167)][e(169)](pr),n=this[e(173)][e(167)][e(169)](e(195)),r=this[e(173)][e(167)][e(169)](uc);return this[e(173)][e(174)][e(190)](e(179),(()=>{const r=e;this[r(184)](t,r(177),((e,t,s)=>{const o=r;n[o(186)]=o(194)!==s}))})),this[e(184)](t,e(177),((t,n,r)=>{const s=e;this[s(173)][s(167)][s(169)](s(183))[s(196)](s(194)!==r)})),r[e(165)](this[e(173)][e(185)][e(169)](e(175)))}[vc(180)](){const e=vc;this[e(173)][e(167)][e(169)](uc)[e(187)](this[e(173)][e(185)][e(169)](e(175))),super[e(180)]()}}var Pc=Tc;function Tc(e,t){var n=_c();return(Tc=function(e,t){return n[e-=350]})(e,t)}function _c(){var e=["2947173cwWyUj","5513165dpbsqK","293450lwuxEN","TrackChanges","6645JcFsjH","40611aSfAIU","1117530dKwWCt","559284tsMQts","2QIOHzM","RealTimeCollaborativeTrackChanges","508rwghsS","207phWXTD","requires","8DNjGme","pluginName"];return(_c=function(){return e})()}!function(e,t){for(var n=Tc,r=e();;)try{if(524926===-parseInt(n(351))/1+parseInt(n(354))/2*(parseInt(n(361))/3)+parseInt(n(356))/4*(-parseInt(n(350))/5)+-parseInt(n(352))/6+-parseInt(n(362))/7*(parseInt(n(359))/8)+-parseInt(n(357))/9*(-parseInt(n(363))/10)+parseInt(n(353))/11)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(_c);class kc extends r.Plugin{static get[Pc(358)](){return[Ac,bc,Pc(364)]}static get[Pc(360)](){return Pc(355)}}const Cc=jc;function Ec(){const e=["data","repository","size","_revisions","cloud-services-internal-error: Request timeout.","length","listenTo","_bufferedUpdates","keys","cloudServices.bundleVersion","sendBufferedUpdates","getRevision","_revisionDataBuilder","once","updateRevisions","_startingVersion","connect","addRevisionData","1311192VZrizV","getMany","_handleReconnectionError","16wwXAQN","affectsData","currentRevision","editor","_oldOffset","getOperations","RevisionHistoryService","requires","_handleRevisionsUpdate","adapter","_fetchMissingUsers","isBundleUploaded","catch","connection","from","setSource","_isConnected","getUser","destroy","isEmptyCurrent","addToReconnectionStack","setRevisionData","cloud-services-internal-error: Revision History Service is not connected.","10245FDWifr","revisionsUpdated","sessionId","message","buildRevisionData","_lastRequestId","config","collaboration.channelId","diffData","349069CxBTiZ","_offset","plugins","getRevisions","reconnect","bind","_fixRevision","creatorId","_getLatestVersion","cloud-services-internal-error: Not connected.","93MrxEWE","off","state","reInit","1243352JcmapH","change:_isPendingUpdate","add","map","_revisionTracker","get","290044veQgLN","_preventResendingRevisionData","_getLatestVersionFromServerOperations","_waitForServiceReady","toVersion","_bufferUpdate","_createCurrentRevision","400","addUser","_isPendingUpdate","serverHistory","init","marker","remove","CONNECTED","authors","change:_isConnected","reverse","wrongRequestId","_update","fromVersion","startsWith","654kHZIKx","isEnabled","RevisionTracker","code","then","isConnected","7003980ZOYTAG","baseVersion","connected","5078aJKPEy","max","has","authorsIds","_revisionHistoryService","type","createdAt"];return(Ec=function(){return e})()}function jc(e,t){const n=Ec();return(jc=function(e,t){return n[e-=413]})(e,t)}!function(e,t){const n=jc,r=e();for(;;)try{if(173720===-parseInt(n(438))/1+-parseInt(n(469))/2*(parseInt(n(428))/3)+parseInt(n(432))/4+parseInt(n(520))/5*(-parseInt(n(460))/6)+-parseInt(n(418))/7*(parseInt(n(497))/8)+-parseInt(n(494))/9+parseInt(n(466))/10)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Ec);class Rc extends r.Plugin{static get[Cc(504)](){return[pr,$a,Cc(462),gr,hr.Users]}constructor(e){const t=Cc;super(e);const n=this[t(500)][t(415)][t(437)](t(416));this[t(414)]=null,this[t(436)]=this[t(500)][t(420)][t(437)](t(462)),this[t(473)]=new(Rc[t(503)])(n)}async[Cc(449)](){const e=Cc,t=this[e(500)][e(420)][e(437)]($a),n=t[e(448)],r=this[e(500)][e(420)][e(437)](pr);this[e(436)][e(512)]({history:n,getLatestVersion:()=>this[e(426)](),getCurrentRevisionId:()=>t[e(522)]});const o=this[e(500)][e(415)][e(437)](e(485))||s.version,i=await qt[e(508)](r[e(510)],o);this[e(436)][e(506)]={getRevision:async({revisionId:t})=>(await this[e(441)](),await this[e(473)][e(487)](t)),updateRevisions:async t=>{const n=e;await this[n(441)]();const r=this[n(436)][n(499)];if(i&&1===t[n(481)]&&t[0].id===r.id)return t;for(const e of t)e.id===r.id&&(e[n(516)]=e[n(458)]===e[n(442)]);return this[n(473)][n(490)](t,this[n(414)])[n(464)]((e=>(this[n(414)]=e,t)))[n(509)]((e=>{const r=n;if(Nc(e)||r(445)===e[r(463)]&&void 0!==e[r(476)][r(456)]){for(const e of t)!this[r(436)][r(477)][r(487)](e.id)||this[r(436)][r(443)](e.id,e,!1);if(Nc(e))throw e;return t}throw e}))}},this[e(482)](this[e(473)],e(521),((t,{revisionsData:n,requestId:r})=>{const s=e;Math[s(470)](...n[s(435)]((e=>e[s(442)])))>this[s(440)]()-1?this[s(426)]()[s(464)]((()=>{this[s(505)](n,r)})):this[s(505)](n,r)}));const{revisions:a,requestId:c}=await this[e(473)][e(492)](r[e(510)]);r[e(517)](this),this[e(414)]=c,await this[e(507)](a);for(const t of a)this[e(436)][e(493)](t);this[e(482)](t,e(454),((n,r,s)=>{const o=e;s&&(this[o(501)]=t[o(419)],n[o(429)]())})),this[e(436)][e(423)](e(461)).to(r,e(430),(t=>t===Nt[e(452)]))}async[Cc(422)](){const e=Cc,t=this[e(500)][e(420)][e(437)](pr),n=this[e(500)][e(420)][e(437)]($a),r=async()=>{const r=e,s=this[r(436)][r(499)],o=s.id,i=o!==n[r(522)];if(i){const e=n[r(419)]-this[r(501)],t=this[r(440)]();if(this[r(436)][r(488)][r(431)](),s[r(442)]+e!==t){const n=s[r(458)]+e,o=this[r(500)][r(420)][r(437)](hr.Users),i=this[r(436)][r(413)]({revision:s,from:n,to:t});i.id=s.id;const a=i[r(472)][r(435)]((e=>o[r(514)](e)));s[r(457)]({...i,authors:a},!0),this[r(436)][r(443)](s.id,i,!0)}this[r(436)][r(491)]=t,s[r(442)]===s[r(458)]&&!this[r(436)][r(483)][r(471)](o)&&this[r(436)][r(477)][r(479)][r(451)](o),this[r(436)][r(444)](t)}const{revisions:a,requestId:c}=await this[r(473)][r(422)](t[r(510)],this[r(414)]);i&&a[r(481)]>0?n[r(496)]():(await this[r(507)](a),this[r(505)](a,c),this[r(436)][r(486)]())};return n[e(513)]?r():new Promise(((t,s)=>{const o=e;n[o(489)](o(454),(()=>{const e=o;r()[e(464)](t)[e(509)](s)}))}))}[Cc(515)](){super[Cc(515)]()}async[Cc(441)](){const e=Cc;this[e(473)][e(465)]||await new Promise((t=>{const n=e;this[n(482)](this[n(473)],n(468),(e=>{e[n(429)](),t()}))}))}[Cc(440)](){const e=Cc,t=this[e(500)][e(420)][e(437)]($a)[e(448)][e(502)]()[e(455)]();for(const n of t)if(e(450)!==n[e(474)]||n[e(498)])return n[e(467)]+1}[Cc(426)](){const e=Cc,t=this[e(500)][e(420)][e(437)]($a);return new Promise((n=>{const r=e;t[r(447)]?t[r(489)](r(433),(()=>{n(this[r(440)]())})):n(this[r(440)]())}))}[Cc(505)](e,t){const n=Cc,r=this[n(436)][n(477)];this[n(414)]=t;for(const t of e){const e=r[n(487)](t.id);if(e){if((t[n(458)]||t[n(442)])&&(t[n(417)]=null),e===this[n(436)][n(499)]){const r=Math[n(470)](e[n(442)],t[n(442)]),s=Math[n(470)](e[n(458)],t[n(458)]);let o;e[n(442)]===t[n(442)]&&e[n(458)]===t[n(458)]?(o=!0,this[n(439)](t)):t[n(442)]===r&&t[n(458)]===s?o=!1:(e[n(442)]===r&&e[n(458)]===s||this[n(424)]({revision:e,from:s,to:r}),o=!0),o&&(delete t[n(458)],delete t[n(442)],delete t[n(417)],delete t[n(475)],delete t[n(472)])}this[n(436)][n(518)](t),this[n(439)](t)}else this[n(436)][n(493)](t)}const s=r[n(421)]();s[n(455)]();for(let e=0;e<s[n(481)]-1;e++){const t=s[e],r=s[e+1];if(t[n(458)]<r[n(442)]){const e=r[n(442)],s=Math[n(470)](e,t[n(442)]);this[n(424)]({revision:t,from:e,to:s})}}}[Cc(424)]({revision:e,from:t,to:n}={}){const r=Cc,s=this[r(500)][r(420)][r(437)](hr.Users),o=this[r(436)][r(413)]({revision:e,from:t,to:n});o[r(453)]=o[r(472)][r(435)]((e=>s[r(514)](e))),e[r(457)](o)}[Cc(439)](e){const t=Cc,n={};n.id=e.id;for(const r of Object[t(484)](e))"id"!==r&&(n[r]=void 0);this[t(436)][t(443)](n.id,n,!0)}async[Cc(507)](e){const t=Cc,n=this[t(500)][t(420)][t(437)](hr.Users),{connection:r}=this[t(500)][t(420)][t(437)](pr),s=new Set;for(const n of e){for(const e of n[t(472)])i(e);n[t(425)]&&i(n[t(425)])}if(0===s[t(478)])return;const o=await ze[t(495)](r,Array[t(511)](s));for(const e of o)n[t(514)](e.id)||n[t(446)](e);function i(e){const r=t;n[r(514)](e)||s[r(434)](e)}}}Rc[Cc(503)]=$t;const Dc=Rc;function Nc(e){const t=Cc;return e[t(523)][t(459)](t(519))||e[t(523)][t(459)](t(427))||e[t(523)][t(459)](t(480))}function xc(){var e=["requires","8298240wNpgXe","1390440DgCHuw","1566535VbDiTT","292kyYhJh","pluginName","7336966CDlDTE","RealTimeCollaborativeRevisionHistory","4639950VMuRoW","RevisionHistory","910903uKalBO","34449DLMndu"];return(xc=function(){return e})()}var Vc=Mc;function Mc(e,t){var n=xc();return(Mc=function(e,t){return n[e-=131]})(e,t)}!function(e,t){for(var n=Mc,r=e();;)try{if(583066===parseInt(n(141))/1+-parseInt(n(133))/2+-parseInt(n(142))/3*(-parseInt(n(135))/4)+parseInt(n(134))/5+-parseInt(n(139))/6+-parseInt(n(137))/7+parseInt(n(132))/8)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(xc);class Bc extends r.Plugin{static get[Vc(131)](){return[Vc(140),Dc,ic]}static get[Vc(136)](){return Vc(138)}}var Uc=Function.prototype,Jc=Object.prototype,qc=Uc.toString,Lc=Jc.hasOwnProperty,Gc=qc.call(Object);const Yc=function(e){if(!ho(e)||"[object Object]"!=bs(e))return!1;var t=hi(e);if(null===t)return!0;var n=Lc.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&qc.call(n)==Gc};const zc=function(e){return ho(e)&&1===e.nodeType&&!Yc(e)};function Fc(e,t){const n=Hc();return(Fc=function(e,t){return n[e-=276]})(e,t)}function Hc(){const e=["168PBYgCp","6LwGhna","10rHZzoE","setTemplate","291302WikryF","179433qtCXfB","7cBeSyB","div","1969544JKyrwh","260579gEIrPm","usersCount","348340SBXGiW","set","CONNECTED_USERS","16779yLLqbd","49780rStTjD","ck-presence-list__counter","bindTemplate","ck-presence-list__counter--hidden","isHidden","116TvNSrj"];return(Hc=function(){return e})()}!function(e,t){const n=Fc,r=e();for(;;)try{if(175737===-parseInt(n(283))/1+-parseInt(n(278))/2*(-parseInt(n(293))/3)+parseInt(n(290))/4+-parseInt(n(294))/5*(parseInt(n(280))/6)+parseInt(n(285))/7*(-parseInt(n(287))/8)+parseInt(n(284))/9*(-parseInt(n(281))/10)+parseInt(n(288))/11*(parseInt(n(279))/12))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Hc);class Kc extends o.View{constructor(e){const t=Fc;super(e);const n=this[t(296)];this[t(291)](t(289),0),this[t(291)](t(277),!0),this[t(282)]({tag:t(286),attributes:{class:["ck",t(295),n.if(t(277),t(276))]},children:[{text:n.to(t(289),(n=>_r(e,t(292),n)))}]})}}function Wc(e,t){const n=Qc();return(Wc=function(e,t){return n[e-=349]})(e,t)}function Qc(){const e=["315153lmjEmG","4101933atXEyh","div","bindTemplate","35bTjJup","6965QKdfgO","items","576200qrvulL","16518jLbwxd","20QSNiyw","fire","createCollection","2647664ZWFNvs","execute","2796FwYrSs","1369692fqGuwn","ck-presence-list__list","setTemplate","86jdKMBd"];return(Qc=function(){return e})()}!function(e,t){const n=Wc,r=e();for(;;)try{if(357215===parseInt(n(366))/1+parseInt(n(365))/2*(-parseInt(n(355))/3)+-parseInt(n(359))/4+parseInt(n(352))/5*(parseInt(n(361))/6)+parseInt(n(351))/7*(parseInt(n(354))/8)+-parseInt(n(362))/9*(-parseInt(n(356))/10)+-parseInt(n(367))/11)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Qc);class Zc extends o.View{constructor(e){const t=Wc;super(e),this[t(353)]=this[t(358)]();const n=this[t(350)];this[t(364)]({tag:t(349),attributes:{class:["ck",t(363)]},children:this[t(353)],on:{click:n.to((()=>this[t(357)](t(360))))}})}}var $c=__webpack_require__(106),Xc={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};Or()($c.A,Xc);$c.A.locals;function ed(e,t){const n=td();return(ed=function(e,t){return n[e-=113]})(e,t)}function td(){const e=["bindTemplate","counterView","change","first","listenTo","55tRifgV","inlineListView","items","ck-rounded-corners","setTemplate","isCollapsed","ck-reset","10ZfOVVP","tooltipPosition","4xCBwox","4349471RGMhaM","1585IxYlyq","set","290156OUEwsS","ck-presence-list","1100796HQxdee","7217334PgjMWj","7820DzlLsp","div","3748360KPwQUL","locale","6qjzMje","987357xwihGr","ck-presence-list--collapsed"];return(td=function(){return e})()}!function(e,t){const n=ed,r=e();for(;;)try{if(494984===-parseInt(n(120))/1+-parseInt(n(116))/2*(-parseInt(n(129))/3)+parseInt(n(124))/4*(-parseInt(n(118))/5)+parseInt(n(128))/6*(parseInt(n(117))/7)+parseInt(n(126))/8+-parseInt(n(123))/9*(parseInt(n(114))/10)+-parseInt(n(136))/11*(-parseInt(n(122))/12))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(td);class nd extends o.View{constructor(e){const t=ed;super(e);const n=this[t(131)];this[t(119)](t(141),!0),this[t(132)]=new Kc(this[t(127)]),this[t(137)]=new Zc(e),this[t(135)](this[t(137)][t(138)],t(133),(()=>{const e=t;for(const t of this[e(137)][e(138)])t[e(115)]="s";this[e(137)][e(138)][e(134)]&&(this[e(137)][e(138)][e(134)][e(115)]="se")})),this[t(140)]({tag:t(125),attributes:{class:["ck",t(121),t(113),t(139),n.if(t(141),t(130))]},children:[this[t(132)],this[t(137)]]})}}function rd(e,t){var n=sd();return(rd=function(e,t){return n[e-=461]})(e,t)}function sd(){var e=["div","5789476lNdpdW","12wAsdCn","5430UHUPbP","184281BSeWYh","5765fdGRDu","setTemplate","24114090gVGvam","8czBiUl","items","460006rJROmG","createCollection","1497411LPiZzH","ck-presence-list__dropdown-list","2TgqKLJ","9544360oWMWdD","ck-presence-list__dropdown-list-wrapper"];return(sd=function(){return e})()}!function(e,t){for(var n=rd,r=e();;)try{if(543449===parseInt(n(464))/1*(-parseInt(n(468))/2)+parseInt(n(475))/3*(-parseInt(n(473))/4)+-parseInt(n(476))/5*(parseInt(n(474))/6)+parseInt(n(472))/7+parseInt(n(462))/8*(parseInt(n(466))/9)+-parseInt(n(469))/10+parseInt(n(461))/11)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(sd);class od extends o.View{constructor(e){var t=rd;super(e),this[t(463)]=this[t(465)](),this[t(477)]({tag:t(471),attributes:{class:["ck",t(467)]},children:[{tag:t(471),attributes:{class:["ck",t(470)]},children:this[t(463)]}]})}}!function(e,t){const n=ad,r=e();for(;;)try{if(362911===-parseInt(n(384))/1*(parseInt(n(380))/2)+-parseInt(n(386))/3+parseInt(n(389))/4*(-parseInt(n(394))/5)+parseInt(n(398))/6*(-parseInt(n(393))/7)+parseInt(n(381))/8+-parseInt(n(401))/9*(parseInt(n(392))/10)+parseInt(n(404))/11)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(cd);class id extends o.View{constructor(e,t,n){const r=ad;super(e);const s=this[r(379)];this[r(405)]=new hr.UserView(e,t);const o={tag:r(399),attributes:{class:["ck",r(391)]},children:[this[r(405)],{tag:r(395),attributes:{class:["ck",r(390)]},children:[{text:t[r(396)]}]},{tag:r(395),attributes:{class:["ck",r(385),t[r(388)][r(387)]()],"aria-hidden":r(402)}}]};n&&(o[r(382)]=r(397),o.on={click:s.to((()=>this[r(383)](r(400))))}),this[r(403)](o)}}function ad(e,t){const n=cd();return(ad=function(e,t){return n[e-=379]})(e,t)}function cd(){const e=["20RpGFGX","span","name","button","12OOBVDq","div","execute","27clXXHh","true","setTemplate","19120244nLkOAH","userView","bindTemplate","36958PhJFAx","1205872DyMXns","tag","fire","17qpTeKY","ck-presence-list__marker","1091097HTJQTr","getBackgroundColorClass","color","302920CGvnUV","ck-user__full-name","ck-presence-list__dropdown-list-item","1780330nkOFko","39081iZbZXg"];return(cd=function(){return e})()}function dd(e,t){const n=ud();return(dd=function(e,t){return n[e-=350]})(e,t)}function ud(){const e=["6SPJmkc","21945znyDCs","markerView","ck-presence-list__list-item","147464xQKpak","ck-presence-list__list-item__tooltip","1iqRABo","bindTemplate","313964CcVMbP","tooltipPosition","fire","hasTooltip","getBackgroundColorClass","740528rLIjUe","11ecRWGh","button","div","userView","33808824SkrClj","4594445OmYToW","234atDnca","6475890TwECqc","tag","set","execute","ck-presence-list__marker","color","setTemplate","span","516TyEksx","name","true"];return(ud=function(){return e})()}!function(e,t){const n=dd,r=e();for(;;)try{if(514030===-parseInt(n(354))/1*(parseInt(n(356))/2)+parseInt(n(380))/3*(-parseInt(n(361))/4)+-parseInt(n(367))/5+parseInt(n(377))/6*(parseInt(n(381))/7)+parseInt(n(352))/8*(-parseInt(n(368))/9)+-parseInt(n(369))/10*(parseInt(n(362))/11)+parseInt(n(366))/12)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(ud);class ld extends o.View{constructor(e,t,n){const r=dd;super(e);const s=this[r(355)];this[r(371)](r(359),!0),this[r(371)](r(357),""),this[r(365)]=new hr.UserView(e,t),this[r(350)]=new pd(e,t);const o={tag:r(364),attributes:{class:["ck",r(351)],"data-cke-tooltip-text":this[r(365)][r(378)],"data-cke-tooltip-position":s.to(r(357)),"data-cke-tooltip-disabled":s.to(r(359),(e=>!e)),"data-cke-tooltip-class":r(353)},children:[this[r(365)],this[r(350)]]};n&&(o[r(370)]=r(363),o.on={click:s.to((()=>this[r(358)](r(372))))}),this[r(375)](o)}}class pd extends o.View{constructor(e,t){const n=dd;super(e),this[n(375)]({tag:n(376),attributes:{class:["ck",n(373),t[n(374)][n(360)]()],"aria-hidden":n(379)}})}}const hd=md;function fd(){const e=["8bFbiZq","hideDropdown","reverse","4DOarLf","presenceList.collapseAt","content","_createView","execute","115335NyBYIn","remove","balloonPanelView","allConnectedUsers","isRendered","config","bindTo","inlineListView","locale","unpin","_allConnectedUsers","_handleUserAdd","338288JUAzko","3347130KpGPNm","_handleUserRemove","154152crVQXz","presencelist-collapseat-invalid-format","length","element","isHidden","pin","presenceList.container","_bodyCollection","plugins","init","context","isMe","appendChild","presenceDropdownView","onClick","counterView","attachToDom","isVisible","number","showDropdown","ck ck-presence-list__balloon","render","detachFromDom","using","hasTooltip","items","get","destroy","currentDisplayedUsers","803409ZDLYZm","define","18858CXMlnV","from","_calculateNewUserPosition","listenTo","requires","set","usersCount","add","view","last","presenceList","isCollapsed","class","presencelist-missing-container","displayMe","presenceList.displayMe","301605RHOwUw","bind","161RiGbrL"];return(fd=function(){return e})()}function md(e,t){const n=fd();return(md=function(e,t){return n[e-=411]})(e,t)}!function(e,t){const n=md,r=e();for(;;)try{if(195879===-parseInt(n(442))/1+parseInt(n(445))/2+-parseInt(n(474))/3*(-parseInt(n(425))/4)+-parseInt(n(419))/5+parseInt(n(476))/6*(-parseInt(n(421))/7)+-parseInt(n(422))/8*(parseInt(n(430))/9)+parseInt(n(443))/10)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(fd);const yd={collapseAt:6,displayMe:!0};class gd extends r.ContextPlugin{constructor(e){const t=md;super(e),this[t(455)][t(435)][t(475)](t(413),yd);const n=e[t(435)][t(471)](t(426));if(t(463)!=typeof n)throw new s.CKEditorError(t(446),this);if(n<1)throw new s.CKEditorError(t(446),this);this[t(440)]=this[t(455)][t(453)][t(471)](gr)[t(433)],this[t(481)](t(482),0),this[t(473)]=new s.Collection,this[t(432)]=new o.BalloonPanelView,this[t(432)][t(415)]=t(465),this[t(411)]=this[t(428)](),this[t(458)]=void 0}static get[hd(480)](){return[gr]}[hd(454)](){const e=hd;for(const t of this[e(440)])this[e(441)](t);this[e(479)](this[e(440)],e(483),((t,n)=>{this[e(441)](n)})),this[e(479)](this[e(440)],e(431),((t,n)=>{this[e(444)](n)}))}[hd(428)](){const e=hd,t=this[e(455)],n=new nd(this[e(455)][e(438)]),r=this[e(432)];if(!zc(t[e(435)][e(471)](e(451))))throw new s.CKEditorError(e(416),this);return n[e(460)][e(420)](e(482)).to(this),n[e(420)](e(414)).to(this,e(482),(r=>{const s=e,{collapseAt:o,displayMe:i}=t[s(435)][s(471)](s(413)),a=r>=o;return n[s(460)][s(449)]=!(1==r&&i||a),a||this[s(423)](),a})),n[e(437)][e(470)][e(436)](this[e(473)])[e(468)]((r=>{const s=e,o=t[s(435)][s(471)](s(413)),i=new ld(t[s(438)],r,!!o[s(459)]);return i[s(420)](s(469)).to(n,s(414),(e=>!e)),o[s(459)]&&this[s(479)](i,s(429),(()=>{const e=s;this[e(411)][e(414)]||o[e(459)](r,i[e(448)])})),i})),this[e(479)](n[e(437)],e(429),(()=>{const t=e;this[t(458)]?this[t(423)]():this[t(411)][t(414)]&&this[t(464)]()})),n[e(466)](),r[e(466)](),(0,o.clickOutsideHandler)({emitter:n,activator:()=>r[e(462)],contextElements:[r[e(448)],n[e(437)][e(448)]],callback:()=>this[e(423)]()}),t[e(435)][e(471)](e(451))[e(457)](n[e(448)]),this[e(452)]=new o.BodyCollection(this[e(455)][e(438)]),this[e(452)][e(461)](),this[e(452)][e(483)](r),n}[hd(441)](e){const t=hd;if(!this[t(455)][t(435)][t(471)](t(418))&&e[t(456)])return;const n=this[t(455)][t(435)][t(471)](t(426))-1;this[t(482)]++,this[t(473)][t(447)]==n&&this[t(473)][t(431)](0);const r=this[t(478)](e);this[t(473)][t(483)](e,r)}[hd(444)](e){const t=hd;if(this[t(482)]--,this[t(473)][t(471)](e.id)&&(this[t(473)][t(431)](e.id),this[t(473)][t(447)]<this[t(482)]))for(const e of Array[t(477)](this[t(440)])[t(424)]())if(!this[t(473)][t(471)](e.id))return void this[t(473)][t(483)](e,0)}[hd(478)](e){const t=hd;return Boolean(this[t(473)][t(412)]&&this[t(473)][t(412)][t(456)])&&!e[t(456)]?this[t(473)][t(447)]-1:this[t(473)][t(447)]}[hd(464)](){const e=hd;if(this[e(458)])return;this[e(458)]=new od(this[e(455)][e(438)]);const t=this[e(455)][e(435)][e(471)](e(413));this[e(458)][e(470)][e(436)](this[e(440)])[e(468)]((n=>{const r=e;if(!t[r(417)]&&n[r(456)])return null;const s=new id(this[r(455)][r(438)],n,!!t[r(459)]);return t[r(459)]&&this[r(479)](s,r(429),(()=>{const e=r;t[e(459)](n,s[e(448)])})),s})),this[e(432)][e(427)][e(483)](this[e(458)]),this[e(432)][e(450)]({target:this[e(411)][e(437)][e(448)]})}[hd(423)](){const e=hd;this[e(458)]&&(this[e(432)][e(439)](),this[e(432)][e(427)][e(431)](this[e(458)]),this[e(458)][e(472)](),this[e(458)]=void 0)}[hd(472)](){const e=hd;super[e(472)](),this[e(411)]&&this[e(411)][e(434)]&&this[e(411)][e(472)](),this[e(452)]&&this[e(452)][e(467)]()}}var bd=wd;function Od(){var e=["1536995AgfdOc","377613DlPomG","pluginName","6753069DswUeP","742784QEZcki","12ZVQZVL","6nOWDmV","1821XmptDi","1800768RICFkC","PresenceList","869056JSbOGd","requires"];return(Od=function(){return e})()}function wd(e,t){var n=Od();return(wd=function(e,t){return n[e-=353]})(e,t)}!function(e,t){for(var n=wd,r=e();;)try{if(192201===-parseInt(n(361))/1*(parseInt(n(359))/2)+-parseInt(n(355))/3+parseInt(n(364))/4+parseInt(n(354))/5*(-parseInt(n(360))/6)+-parseInt(n(358))/7+-parseInt(n(362))/8+parseInt(n(357))/9)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Od);class Id extends r.ContextPlugin{static get[bd(353)](){return[gr,gd]}static get[bd(356)](){return bd(363)}}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;(0,s.ObservableMixin)();(0,s.EmitterMixin)();r.ContextPlugin;r.ContextPlugin;function vd(){var e=["2306019oDIbvz","5EMsXkm","243416NirUkt","820554dgAcsI","38667MRAqOe","2490572fXLnjq","377676fiaaHk","3077428VoWUdb"];return(vd=function(){return e})()}function Sd(e,t){var n=vd();return(Sd=function(e,t){return n[e-=222]})(e,t)}function Ad(e,t){var n=Pd();return(Ad=function(e,t){return n[e-=415]})(e,t)}function Pd(){var e=["1596DiitGN","4098582ILCzns","332679rDYhKl","420437klMBPJ","69724cklAzU","9VcxeVx","12764270zefmmG","965531jtLANL","41547RCicQN","290rGCuqI","6KJPeGs","24fCAgNa"];return(Pd=function(){return e})()}!function(e,t){for(var n=Sd,r=e();;)try{if(415431===parseInt(n(226))/1+parseInt(n(228))/2+parseInt(n(222))/3+-parseInt(n(229))/4*(parseInt(n(223))/5)+-parseInt(n(225))/6+parseInt(n(227))/7+-parseInt(n(224))/8)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(vd),function(e,t){for(var n=Ad,r=e();;)try{if(939754===-parseInt(n(418))/1+-parseInt(n(425))/2*(parseInt(n(417))/3)+-parseInt(n(419))/4*(-parseInt(n(424))/5)+-parseInt(n(416))/6+-parseInt(n(422))/7*(parseInt(n(426))/8)+-parseInt(n(420))/9*(-parseInt(n(421))/10)+-parseInt(n(423))/11*(-parseInt(n(415))/12))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Pd)})(),(window.CKEditor5=window.CKEditor5||{}).realTimeCollaboration=__webpack_exports__})();
5
+ */(()=>{var __webpack_modules__={310:e=>{"use strict";e.exports=function(e,t){var n=new Array(arguments.length-1),r=0,s=2,o=!0;for(;s<arguments.length;)n[r++]=arguments[s++];return new Promise((function(s,i){n[r]=function(e){if(o)if(o=!1,e)i(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];s.apply(null,t)}};try{e.apply(t||null,n)}catch(e){o&&(o=!1,i(e))}}))}},662:(e,t)=>{"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),s=new Array(123),o=0;o<64;)s[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;n.encode=function(e,t,n){for(var s,o=null,i=[],a=0,c=0;t<n;){var d=e[t++];switch(c){case 0:i[a++]=r[d>>2],s=(3&d)<<4,c=1;break;case 1:i[a++]=r[s|d>>4],s=(15&d)<<2,c=2;break;case 2:i[a++]=r[s|d>>6],i[a++]=r[63&d],c=0}a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0)}return c&&(i[a++]=r[s],i[a++]=61,1===c&&(i[a++]=61)),o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))};var i="invalid encoding";n.decode=function(e,t,n){for(var r,o=n,a=0,c=0;c<e.length;){var d=e.charCodeAt(c++);if(61===d&&a>1)break;if(void 0===(d=s[d]))throw Error(i);switch(a){case 0:r=d,a=1;break;case 1:t[n++]=r<<2|(48&d)>>4,r=d,a=2;break;case 2:t[n++]=(15&r)<<4|(60&d)>>2,r=d,a=3;break;case 3:t[n++]=(3&r)<<6|d,a=0}}if(1===a)throw Error(i);return n-o},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},707:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}},365:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function s(e,r,s){t[0]=e,r[s]=n[0],r[s+1]=n[1],r[s+2]=n[2],r[s+3]=n[3]}function o(e,r,s){t[0]=e,r[s]=n[3],r[s+1]=n[2],r[s+2]=n[1],r[s+3]=n[0]}function i(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function a(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?s:o,e.writeFloatBE=r?o:s,e.readFloatLE=r?i:a,e.readFloatBE=r?a:i}():function(){function t(e,t,n,r){var s=t<0?1:0;if(s&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((s<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((s<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var o=Math.floor(Math.log(t)/Math.LN2);e((s<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,n,r)}}function i(e,t,n){var r=e(t,n),s=2*(r>>31)+1,o=r>>>23&255,i=8388607&r;return 255===o?i?NaN:s*(1/0):0===o?1401298464324817e-60*s*i:s*Math.pow(2,o-150)*(i+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,r),e.readFloatLE=i.bind(null,s),e.readFloatBE=i.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function s(e,r,s){t[0]=e,r[s]=n[0],r[s+1]=n[1],r[s+2]=n[2],r[s+3]=n[3],r[s+4]=n[4],r[s+5]=n[5],r[s+6]=n[6],r[s+7]=n[7]}function o(e,r,s){t[0]=e,r[s]=n[7],r[s+1]=n[6],r[s+2]=n[5],r[s+3]=n[4],r[s+4]=n[3],r[s+5]=n[2],r[s+6]=n[1],r[s+7]=n[0]}function i(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function a(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?s:o,e.writeDoubleBE=r?o:s,e.readDoubleLE=r?i:a,e.readDoubleBE=r?a:i}():function(){function t(e,t,n,r,s,o){var i=r<0?1:0;if(i&&(r=-r),0===r)e(0,s,o+t),e(1/r>0?0:2147483648,s,o+n);else if(isNaN(r))e(0,s,o+t),e(2146959360,s,o+n);else if(r>17976931348623157e292)e(0,s,o+t),e((i<<31|2146435072)>>>0,s,o+n);else{var a;if(r<22250738585072014e-324)e((a=r/5e-324)>>>0,s,o+t),e((i<<31|a/4294967296)>>>0,s,o+n);else{var c=Math.floor(Math.log(r)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=r*Math.pow(2,-c))>>>0,s,o+t),e((i<<31|c+1023<<20|1048576*a&1048575)>>>0,s,o+n)}}}function i(e,t,n,r,s){var o=e(r,s+t),i=e(r,s+n),a=2*(i>>31)+1,c=i>>>20&2047,d=4294967296*(1048575&i)+o;return 2047===c?d?NaN:a*(1/0):0===c?5e-324*a*d:a*Math.pow(2,c-1075)*(d+4503599627370496)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=i.bind(null,s,0,4),e.readDoubleBE=i.bind(null,o,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function r(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function s(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},230:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},319:e=>{"use strict";e.exports=function(e,t,n){var r=n||8192,s=r>>>1,o=null,i=r;return function(n){if(n<1||n>s)return e(n);i+n>r&&(o=e(r),i=0);var a=t.call(o,i,i+=n);return 7&i&&(i=1+(7|i)),a}}},742:(e,t)=>{"use strict";var n=t;n.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return"";for(var r,s=null,o=[],i=0;t<n;)(r=e[t++])<128?o[i++]=r:r>191&&r<224?o[i++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[i++]=55296+(r>>10),o[i++]=56320+(1023&r)):o[i++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],i>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),i=0);return s?(i&&s.push(String.fromCharCode.apply(String,o.slice(0,i))),s.join("")):String.fromCharCode.apply(String,o.slice(0,i))},n.write=function(e,t,n){for(var r,s,o=n,i=0;i<e.length;++i)(r=e.charCodeAt(i))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(s=e.charCodeAt(i+1)))?(r=65536+((1023&r)<<10)+(1023&s),++i,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-o}},106:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(433),s=n.n(r)()((function(e){return e[1]}));s.push([e.id,".ck.ck-balloon-panel.ck-tooltip{z-index:calc(var(--ck-z-dialog) + 100)}:root{--ck-color-presence-list-dropdown-background:#fff;--ck-color-presence-list-dropdown-arrow-border:#ebebeb;--ck-presence-list-dropdown-list-max-width:250px;--ck-presence-list-dropdown-list-min-width:180px;--ck-presence-list-users-tooltip-max-width:120px;--ck-presence-list-users-tooltip-min-width:25px}.ck.ck-presence-list{align-items:center;display:flex;font-size:var(--ck-font-size-base);margin-right:var(--ck-spacing-standard);transition:margin-right .2s ease-in-out}.ck.ck-presence-list *{box-sizing:border-box}.ck.ck-presence-list__list{display:flex;justify-content:flex-end}.ck.ck-presence-list__counter{color:var(--ck-color-base-text);margin-right:var(--ck-spacing-large)}.ck.ck-presence-list__counter--hidden{display:none}.ck.ck-presence-list__list-item{background:none;border:0;color:inherit;font:inherit;margin-left:var(--ck-spacing-standard);outline:none;padding:0;position:relative}.ck.ck-presence-list__list-item:last-child{margin-left:0;order:-1}.ck.ck-tooltip.ck-presence-list__list-item__tooltip>.ck-tooltip__text{display:inline-block;max-width:var(--ck-presence-list-users-tooltip-max-width);overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.ck.ck-presence-list__marker{display:block;height:3px;margin-top:3px;position:relative;width:100%}.ck-presence-list__balloon button.ck-presence-list__dropdown-list-item *,.ck-presence-list__list button.ck-presence-list__list-item *{cursor:pointer}.ck.ck-presence-list--collapsed .ck-presence-list__list{min-width:calc(var(--ck-user-avatar-size)*2)}.ck.ck-presence-list--collapsed .ck-presence-list__list *{cursor:pointer;transition:all .4s ease-in-out}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item{margin-left:calc(var(--ck-user-avatar-size)*-1 + 7px)}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:last-child{order:unset}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(2){opacity:.75}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(3){opacity:.55}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(4){opacity:.35}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(5){opacity:.15}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(n+6){display:none}.ck.ck-presence-list__balloon{--ck-color-panel-border:var(--ck-color-presence-list-dropdown-arrow-border);--ck-color-panel-background:var(--ck-color-presence-list-dropdown-background);animation:fadeIn .3s ease-in-out;background-color:var(--ck-color-presence-list-dropdown-background);border:0;opacity:1}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-wrapper{border-radius:var(--ck-border-radius);max-height:80vh;max-width:var(--ck-presence-list-dropdown-list-max-width);min-width:var(--ck-presence-list-dropdown-list-min-width);overflow-x:hidden;overflow-y:auto}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item{align-items:center;background:none;border:0;color:inherit;display:flex;font:inherit;outline:none;padding:var(--ck-spacing-standard);position:relative}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item:first-of-type .ck-presence-list__marker{border-top-left-radius:var(--ck-border-radius)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item:last-of-type .ck-presence-list__marker{border-bottom-left-radius:var(--ck-border-radius)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list .ck-user__full-name{color:var(--ck-color-base-text);margin-left:var(--ck-spacing-standard);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list .ck.ck-presence-list__marker{height:100%;left:0;margin:0;position:absolute;width:3px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}",""]);const o=s},535:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(433),s=n.n(r)()((function(e){return e[1]}));s.push([e.id,".ck .ck-user__marker-dot{border-radius:50%;cursor:default;display:block;height:var(--ck-user-dot-size);left:50%;position:absolute;top:calc((var(--ck-user-dot-size)/2)*-1);transform:translate(-50%,-50%);width:var(--ck-user-dot-size)}.ck .ck-user__marker-tooltip{color:#fff;display:none;font-family:Georgia,sans-serif;font-size:var(--ck-font-size-base);font-style:normal;font-weight:400;left:0;line-height:1;opacity:0;padding:var(--ck-spacing-small);position:absolute;top:-20px;transition:opacity .2s linear,transform .3s ease-in-out;white-space:nowrap;z-index:99999}.ck .ck-user__marker-line{bottom:0;height:100%;position:absolute;width:0}.ck .ck-user__marker{cursor:default;display:inline;position:relative}.ck .ck-user__marker.ck-user__marker_hovered .ck-user__marker-dot{width:0}.ck .ck-user__marker.ck-user__marker_hovered .ck-user__marker-tooltip{animation:fadeInLeft .3s ease-in-out;display:block;opacity:1}.ck .ck-placeholder .ck-user__marker{display:none}@keyframes fadeInLeft{0%{opacity:0;transform:translateX(-10px)}to{opacity:1;transform:translateX(0)}}",""]);const o=s},433:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var s={};if(r)for(var o=0;o<this.length;o++){var i=this[o][0];null!=i&&(s[i]=!0)}for(var a=0;a<e.length;a++){var c=[].concat(e[a]);r&&s[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},199:(e,t,n)=>{"use strict";e.exports=n(995)},995:(e,t,n)=>{"use strict";var r=t;function s(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(6),r.BufferWriter=n(623),r.Reader=n(366),r.BufferReader=n(895),r.util=n(737),r.rpc=n(178),r.roots=n(156),r.configure=s,s()},366:(e,t,n)=>{"use strict";e.exports=c;var r,s=n(737),o=s.LongBits,i=s.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var d,u="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},l=function(){return s.Buffer?function(e){return(c.create=function(e){return s.Buffer.isBuffer(e)?new r(e):u(e)})(e)}:u};function p(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new o(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}c.create=l(),c.prototype._slice=s.Array.prototype.subarray||s.Array.prototype.slice,c.prototype.uint32=(d=4294967295,function(){if(d=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return d;if(d=(d|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return d;if(d=(d|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return d;if(d=(d|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return d;if(d=(d|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return d;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return d}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return h(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|h(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=s.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=s.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw a(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,n);if(t===n){var r=s.Buffer;return r?r.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,n)},c.prototype.string=function(){var e=this.bytes();return i.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){r=e,c.create=l(),r._configure();var t=s.Long?"toLong":"toNumber";s.merge(c.prototype,{int64:function(){return p.call(this)[t](!1)},uint64:function(){return p.call(this)[t](!0)},sint64:function(){return p.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},895:(e,t,n)=>{"use strict";e.exports=o;var r=n(366);(o.prototype=Object.create(r.prototype)).constructor=o;var s=n(737);function o(e){r.call(this,e)}o._configure=function(){s.Buffer&&(o.prototype._slice=s.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},156:e=>{"use strict";e.exports={}},178:(e,t,n)=>{"use strict";t.Service=n(418)},418:(e,t,n)=>{"use strict";e.exports=s;var r=n(737);function s(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(s.prototype=Object.create(r.EventEmitter.prototype)).constructor=s,s.prototype.rpcCall=function e(t,n,s,o,i){if(!o)throw TypeError("request must be specified");var a=this;if(!i)return r.asPromise(e,a,t,n,s,o);if(a.rpcImpl)try{return a.rpcImpl(t,n[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,n){if(e)return a.emit("error",e,t),i(e);if(null!==n){if(!(n instanceof s))try{n=s[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return a.emit("error",e,t),i(e)}return a.emit("data",n,t),i(null,n)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){i(e)}),0)}else setTimeout((function(){i(Error("already ended"))}),0)},s.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},130:(e,t,n)=>{"use strict";e.exports=s;var r=n(737);function s(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=s.zero=new s(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var i=s.zeroHash="\0\0\0\0\0\0\0\0";s.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new s(n,r)},s.from=function(e){if("number"==typeof e)return s.fromNumber(e);if(r.isString(e)){if(!r.Long)return s.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new s(e.low>>>0,e.high>>>0):o},s.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},s.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;s.fromHash=function(e){return e===i?o:new s((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},s.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},s.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},s.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},s.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},737:function(e,t,n){"use strict";var r=t;function s(e,t,n){for(var r=Object.keys(t),s=0;s<r.length;++s)void 0!==e[r[s]]&&n||(e[r[s]]=t[r[s]]);return e}function o(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&s(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}r.asPromise=n(310),r.base64=n(662),r.EventEmitter=n(707),r.float=n(365),r.inquire=n(230),r.utf8=n(742),r.pool=n(319),r.LongBits=n(130),r.isNode=Boolean(void 0!==n.g&&n.g&&n.g.process&&n.g.process.versions&&n.g.process.versions.node),r.global=r.isNode&&n.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=s,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=o,r.ProtocolError=o("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},6:(e,t,n)=>{"use strict";e.exports=l;var r,s=n(737),o=s.LongBits,i=s.base64,a=s.utf8;function c(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function d(){}function u(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new c(d,0,0),this.tail=this.head,this.states=null}var p=function(){return s.Buffer?function(){return(l.create=function(){return new r})()}:function(){return new l}};function h(e,t,n){t[n]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function y(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}l.create=p(),l.alloc=function(e){return new s.Array(e)},s.Array!==Array&&(l.alloc=s.pool(l.alloc,s.Array.prototype.subarray)),l.prototype._push=function(e,t,n){return this.tail=this.tail.next=new c(e,t,n),this.len+=t,this},f.prototype=Object.create(c.prototype),f.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(m,10,o.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=o.from(e);return this._push(m,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(m,t.length(),t)},l.prototype.bool=function(e){return this._push(h,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=o.from(e);return this._push(y,4,t.lo)._push(y,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(s.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(s.float.writeDoubleLE,8,e)};var g=s.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};l.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(s.isString(e)){var n=l.alloc(t=i.length(e));i.decode(e,n,0),e=n}return this.uint32(t)._push(g,t,e)},l.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(h,1,0)},l.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new c(d,0,0),this.len=0,this},l.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 c(d,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},l._configure=function(e){r=e,l.create=p(),r._configure()}},623:(e,t,n)=>{"use strict";e.exports=o;var r=n(6);(o.prototype=Object.create(r.prototype)).constructor=o;var s=n(737);function o(){r.call(this)}function i(e,t,n){e.length<40?s.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}o._configure=function(){o.alloc=s._Buffer_allocUnsafe,o.writeBytesBuffer=s.Buffer&&s.Buffer.prototype instanceof Uint8Array&&"set"===s.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},o.prototype.bytes=function(e){s.isString(e)&&(e=s._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=s.Buffer.byteLength(e);return this.uint32(t),t&&this._push(i,t,e),this},o._configure()},553:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function r(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function s(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var r,o,i=[];for(o in"string"!=typeof t&&(t="?"),e)if(n.call(e,o)){if((r=e[o])||null!=r&&!isNaN(r)||(r=""),o=s(o),r=s(r),null===o||null===r)continue;i.push(o+"="+r)}return i.length?t+i.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,s={};t=n.exec(e);){var o=r(t[1]),i=r(t[2]);null===o||null===i||o in s||(s[o]=i)}return s}},696:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},673:(e,t,n)=>{"use strict";var r,s=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function a(e){for(var t=-1,n=0;n<i.length;n++)if(i[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},r=[],s=0;s<e.length;s++){var o=e[s],c=t.base?o[0]+t.base:o[0],d=n[c]||0,u="".concat(c," ").concat(d);n[c]=d+1;var l=a(u),p={css:o[1],media:o[2],sourceMap:o[3]};-1!==l?(i[l].references++,i[l].updater(p)):i.push({identifier:u,updater:y(p,t),references:1}),r.push(u)}return r}function d(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var s=n.nc;s&&(r.nonce=s)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var i=o(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var u,l=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function p(e,t,n,r){var s=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=l(t,s);else{var o=document.createTextNode(s),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(o,i[t]):e.appendChild(o)}}function h(e,t,n){var r=n.css,s=n.media,o=n.sourceMap;if(s?e.setAttribute("media",s):e.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var f=null,m=0;function y(e,t){var n,r,s;if(t.singleton){var o=m++;n=f||(f=d(t)),r=p.bind(null,n,o,!1),s=p.bind(null,n,o,!0)}else n=d(t),r=h.bind(null,n,t),s=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else s()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=s());var n=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var s=a(n[r]);i[s].references--}for(var o=c(e,t),d=0;d<n.length;d++){var u=a(n[d]);0===i[u].references&&(i[u].updater(),i.splice(u,1))}n=o}}}},835:(e,t,n)=>{"use strict";var r=n(696),s=n(553),o=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,d=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,u=/^[a-zA-Z]:/;function l(e){return(e||"").toString().replace(o,"")}var p=[["#","hash"],["?","query"],function(e,t){return m(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function f(e){var t,r=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},s={},o=typeof(e=e||r);if("blob:"===e.protocol)s=new g(unescape(e.pathname),{});else if("string"===o)for(t in s=new g(e,{}),h)delete s[t];else if("object"===o){for(t in e)t in h||(s[t]=e[t]);void 0===s.slashes&&(s.slashes=a.test(e.href))}return s}function m(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function y(e,t){e=(e=l(e)).replace(i,""),t=t||{};var n,r=d.exec(e),s=r[1]?r[1].toLowerCase():"",o=!!r[2],a=!!r[3],c=0;return o?a?(n=r[2]+r[3]+r[4],c=r[2].length+r[3].length):(n=r[2]+r[4],c=r[2].length):a?(n=r[3]+r[4],c=r[3].length):n=r[4],"file:"===s?c>=2&&(n=n.slice(2)):m(s)?n=r[4]:s?o&&(n=n.slice(2)):c>=2&&m(t.protocol)&&(n=r[4]),{protocol:s,slashes:o||m(s),slashesCount:c,rest:n}}function g(e,t,n){if(e=(e=l(e)).replace(i,""),!(this instanceof g))return new g(e,t,n);var o,a,c,d,h,b,O=p.slice(),w=typeof t,I=this,v=0;for("object"!==w&&"string"!==w&&(n=t,t=null),n&&"function"!=typeof n&&(n=s.parse),o=!(a=y(e||"",t=f(t))).protocol&&!a.slashes,I.slashes=a.slashes||o&&t.slashes,I.protocol=a.protocol||t.protocol||"",e=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||u.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!m(I.protocol)))&&(O[3]=[/(.*)/,"pathname"]);v<O.length;v++)"function"!=typeof(d=O[v])?(c=d[0],b=d[1],c!=c?I[b]=e:"string"==typeof c?~(h="@"===c?e.lastIndexOf(c):e.indexOf(c))&&("number"==typeof d[2]?(I[b]=e.slice(0,h),e=e.slice(h+d[2])):(I[b]=e.slice(h),e=e.slice(0,h))):(h=c.exec(e))&&(I[b]=h[1],e=e.slice(0,h.index)),I[b]=I[b]||o&&d[3]&&t[b]||"",d[4]&&(I[b]=I[b].toLowerCase())):e=d(e,I);n&&(I.query=n(I.query)),o&&t.slashes&&"/"!==I.pathname.charAt(0)&&(""!==I.pathname||""!==t.pathname)&&(I.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,s=n[r-1],o=!1,i=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),i++):i&&(0===r&&(o=!0),n.splice(r,1),i--);return o&&n.unshift(""),"."!==s&&".."!==s||n.push(""),n.join("/")}(I.pathname,t.pathname)),"/"!==I.pathname.charAt(0)&&m(I.protocol)&&(I.pathname="/"+I.pathname),r(I.port,I.protocol)||(I.host=I.hostname,I.port=""),I.username=I.password="",I.auth&&(~(h=I.auth.indexOf(":"))?(I.username=I.auth.slice(0,h),I.username=encodeURIComponent(decodeURIComponent(I.username)),I.password=I.auth.slice(h+1),I.password=encodeURIComponent(decodeURIComponent(I.password))):I.username=encodeURIComponent(decodeURIComponent(I.auth)),I.auth=I.password?I.username+":"+I.password:I.username),I.origin="file:"!==I.protocol&&m(I.protocol)&&I.host?I.protocol+"//"+I.host:"null",I.href=I.toString()}g.prototype={set:function(e,t,n){var o=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||s.parse)(t)),o[e]=t;break;case"port":o[e]=t,r(t,o.protocol)?t&&(o.host=o.hostname+":"+t):(o.host=o.hostname,o[e]="");break;case"hostname":o[e]=t,o.port&&(t+=":"+o.port),o.host=t;break;case"host":o[e]=t,c.test(t)?(t=t.split(":"),o.port=t.pop(),o.hostname=t.join(":")):(o.hostname=t,o.port="");break;case"protocol":o.protocol=t.toLowerCase(),o.slashes=!n;break;case"pathname":case"hash":if(t){var i="pathname"===e?"/":"#";o[e]=t.charAt(0)!==i?i+t:t}else o[e]=t;break;case"username":case"password":o[e]=encodeURIComponent(t);break;case"auth":var a=t.indexOf(":");~a?(o.username=t.slice(0,a),o.username=encodeURIComponent(decodeURIComponent(o.username)),o.password=t.slice(a+1),o.password=encodeURIComponent(decodeURIComponent(o.password))):o.username=encodeURIComponent(decodeURIComponent(t))}for(var d=0;d<p.length;d++){var u=p[d];u[4]&&(o[u[1]]=o[u[1]].toLowerCase())}return o.auth=o.password?o.username+":"+o.password:o.username,o.origin="file:"!==o.protocol&&m(o.protocol)&&o.host?o.protocol+"//"+o.host:"null",o.href=o.toString(),o},toString:function(e){e&&"function"==typeof e||(e=s.stringify);var t,n=this,r=n.host,o=n.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var i=o+(n.protocol&&n.slashes||m(n.protocol)?"//":"");return n.username?(i+=n.username,n.password&&(i+=":"+n.password),i+="@"):n.password?(i+=":"+n.password,i+="@"):"file:"!==n.protocol&&m(n.protocol)&&!r&&"/"!==n.pathname&&(i+="@"),(":"===r[r.length-1]||c.test(n.hostname)&&!n.port)&&(r+=":"),i+=r+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(i+=n.hash),i}},g.extractProtocol=y,g.location=f,g.trimLeft=l,g.qs=s,e.exports=g},211:(e,t,n)=>{e.exports=n(312)("./src/collaboration-core.js")},782:(e,t,n)=>{e.exports=n(237)("./src/core.js")},783:(e,t,n)=>{e.exports=n(237)("./src/engine.js")},311:(e,t,n)=>{e.exports=n(237)("./src/ui.js")},584:(e,t,n)=>{e.exports=n(237)("./src/utils.js")},312:e=>{"use strict";e.exports=CKEditor5.collaborationDll},237:e=>{"use strict";e.exports=CKEditor5.dll}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nc=void 0;var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CloudServicesCommentsAdapter:()=>cc,CloudServicesRevisionHistoryAdapter:()=>Ec,CloudServicesTrackChangesAdapter:()=>mc,PresenceList:()=>yd,RealTimeCollaborationClient:()=>Qa,RealTimeCollaborativeComments:()=>Ic,RealTimeCollaborativeEditing:()=>rc,RealTimeCollaborativeRevisionHistory:()=>xc,RealTimeCollaborativeTrackChanges:()=>Pc});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{Decoder:()=>he,Encoder:()=>le,PacketType:()=>ue,protocol:()=>de});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{XM:()=>kt,Nz:()=>_t});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{AttributeOperation:()=>Cr,Element:()=>Jr,InsertOperation:()=>Er,MarkerOperation:()=>jr,MergeOperation:()=>Rr,MoveOperation:()=>Dr,Position:()=>Br,Range:()=>Ur,RenameOperation:()=>Nr,RootAttributeOperation:()=>xr,RootOperation:()=>Vr,SplitOperation:()=>Mr,default:()=>kr});var r=__webpack_require__(782),s=__webpack_require__(584),o=__webpack_require__(311),i=__webpack_require__(783);const a=Object.create(null);a.open="0",a.close="1",a.ping="2",a.pong="3",a.message="4",a.upgrade="5",a.noop="6";const c=Object.create(null);Object.keys(a).forEach((e=>{c[a[e]]=e}));const d={type:"error",data:"parser error"},u="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),l="function"==typeof ArrayBuffer,p=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)},h=({type:e,data:t},n,r)=>{return u&&t instanceof Blob?n?r(t):p(t,r):l&&(t instanceof ArrayBuffer||(s=t,"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer))?n?r(t):p(new Blob([t]),r):r(a[e]+(t||""));var s},f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)m[f.charCodeAt(e)]=e;const y="function"==typeof ArrayBuffer,g=(e,t)=>{if(y){const n=(e=>{let t,n,r,s,o,i=.75*e.length,a=e.length,c=0;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);const d=new ArrayBuffer(i),u=new Uint8Array(d);for(t=0;t<a;t+=4)n=m[e.charCodeAt(t)],r=m[e.charCodeAt(t+1)],s=m[e.charCodeAt(t+2)],o=m[e.charCodeAt(t+3)],u[c++]=n<<2|r>>4,u[c++]=(15&r)<<4|s>>2,u[c++]=(3&s)<<6|63&o;return d})(e);return b(n,t)}return{base64:!0,data:e}},b=(e,t)=>"blob"===t&&e instanceof ArrayBuffer?new Blob([e]):e,O=(e,t)=>{if("string"!=typeof e)return{type:"message",data:b(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:g(e.substring(1),t)};return c[n]?e.length>1?{type:c[n],data:e.substring(1)}:{type:c[n]}:d},w=String.fromCharCode(30);function I(e){if(e)return function(e){for(var t in I.prototype)e[t]=I.prototype[t];return e}(e)}I.prototype.on=I.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},I.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},I.prototype.off=I.prototype.removeListener=I.prototype.removeAllListeners=I.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<r.length;s++)if((n=r[s])===t||n.fn===t){r.splice(s,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},I.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var s=(n=n.slice(0)).length;r<s;++r)n[r].apply(this,t)}return this},I.prototype.emitReserved=I.prototype.emit,I.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},I.prototype.hasListeners=function(e){return!!this.listeners(e).length};const v="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function S(e,...t){return t.reduce(((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const A=v.setTimeout,P=v.clearTimeout;function T(e,t){t.useNativeTimers?(e.setTimeoutFn=A.bind(v),e.clearTimeoutFn=P.bind(v)):(e.setTimeoutFn=v.setTimeout.bind(v),e.clearTimeoutFn=v.clearTimeout.bind(v))}class _ extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class k extends I{constructor(e){super(),this.writable=!1,T(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new _(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=O(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}}const C="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),E={};let j,R=0,D=0;function N(e){let t="";do{t=C[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function x(){const e=N(+new Date);return e!==j?(R=0,j=e):e+"."+N(R++)}for(;D<64;D++)E[C[D]]=D;function V(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}let M=!1;try{M="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}const B=M;function U(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||B))return new XMLHttpRequest}catch(e){}if(!t)try{return new(v[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}function J(){}const q=null!=new U({xdomain:!1}).responseType;class G extends I{constructor(e,t){super(),T(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.create()}create(){const e=S(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const t=this.xhr=new U(e);try{t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&t.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(e){}if("POST"===this.method)try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{t.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{4===t.readyState&&(200===t.status||1223===t.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof t.status?t.status:0)}),0))},t.send(this.data)}catch(e){return void this.setTimeoutFn((()=>{this.onError(e)}),0)}"undefined"!=typeof document&&(this.index=G.requestsCount++,G.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=J,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete G.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(G.requestsCount=0,G.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",L);else if("function"==typeof addEventListener){addEventListener("onpagehide"in v?"pagehide":"unload",L,!1)}function L(){for(let e in G.requests)G.requests.hasOwnProperty(e)&&G.requests[e].abort()}const Y="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),z=v.WebSocket||v.MozWebSocket,H="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const F={websocket:class extends k{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,n=H?{}:S(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=H?new z(e,t,n):t?new z(e,t):new z(e)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType||"arraybuffer",this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;h(n,this.supportsBinary,(e=>{try{this.ws.send(e)}catch(e){}r&&Y((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const t=this.opts.secure?"wss":"ws";let n="";this.opts.port&&("wss"===t&&443!==Number(this.opts.port)||"ws"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=x()),this.supportsBinary||(e.b64=1);const r=V(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}check(){return!!z}},polling:class extends k{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==t}const t=e&&e.forceBase64;this.supportsBinary=q&&!t}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(e++,this.once("pollComplete",(function(){--e||t()}))),this.writable||(e++,this.once("drain",(function(){--e||t()})))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const n=e.split(w),r=[];for(let e=0;e<n.length;e++){const s=O(n[e],t);if(r.push(s),"error"===s.type)break}return r})(e,this.socket.binaryType).forEach((e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach(((e,o)=>{h(e,!1,(e=>{r[o]=e,++s===n&&t(r.join(w))}))}))})(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){let e=this.query||{};const t=this.opts.secure?"https":"http";let n="";!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=x()),this.supportsBinary||e.sid||(e.b64=1),this.opts.port&&("https"===t&&443!==Number(this.opts.port)||"http"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port);const r=V(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new G(this.uri(),e)}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}},K=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,W=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Q(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=K.exec(e||""),o={},i=14;for(;i--;)o[W[i]]=s[i]||"";return-1!=n&&-1!=r&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=function(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,o.path),o.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}(0,o.query),o}class X extends I{constructor(e,t={}){super(),this.writeBuffer=[],e&&"object"==typeof e&&(t=e,e=null),e?(e=Q(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=Q(t.host).host),T(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},n=e.split("&");for(let e=0,r=n.length;e<r;e++){let r=n[e].split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new F[e](n)}open(){let e;if(this.opts.rememberUpgrade&&X.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(e){let t=this.createTransport(e),n=!1;X.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",(e=>{if(!n)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;X.priorWebsocketSuccess="websocket"===t.name,this.transport.pause((()=>{n||"closed"!==this.readyState&&(d(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}})))};function s(){n||(n=!0,d(),t.close(),t=null)}const o=e=>{const n=new Error("probe error: "+e);n.transport=t.name,s(),this.emitReserved("upgradeError",n)};function i(){o("transport closed")}function a(){o("socket closed")}function c(e){t&&e.name!==t.name&&s()}const d=()=>{t.removeListener("open",r),t.removeListener("error",o),t.removeListener("close",i),this.off("close",a),this.off("upgrading",c)};t.once("open",r),t.once("error",o),t.once("close",i),this.once("close",a),this.once("upgrading",c),t.open()}onOpen(){if(this.readyState="open",X.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let n=0;n<this.writeBuffer.length;n++){const r=this.writeBuffer[n].data;if(r&&(e+="string"==typeof(t=r)?function(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}(t):Math.ceil(1.33*(t.byteLength||t.size))),n>0&&e>this.maxPayload)return this.writeBuffer.slice(0,n);e+=2}var t;return this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const s={type:e,data:t,options:n};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(e){X.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let n=0;const r=e.length;for(;n<r;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}X.protocol=4;X.protocol;const $="function"==typeof ArrayBuffer,Z=Object.prototype.toString,ee="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Z.call(Blob),te="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===Z.call(File);function ne(e){return $&&(e instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||ee&&e instanceof Blob||te&&e instanceof File}function re(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(re(e[t]))return!0;return!1}if(ne(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return re(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&re(e[t]))return!0;return!1}function se(e){const t=[],n=e.data,r=e;return r.data=oe(n,t),r.attachments=t.length,{packet:r,buffers:t}}function oe(e,t){if(!e)return e;if(ne(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=oe(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=oe(e[r],t));return n}return e}function ie(e,t){return e.data=ae(e.data,t),delete e.attachments,e}function ae(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=ae(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=ae(e[n],t));return e}const ce=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],de=5;var ue;!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(ue||(ue={}));class le{constructor(e){this.replacer=e}encode(e){return e.type!==ue.EVENT&&e.type!==ue.ACK||!re(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===ue.EVENT?ue.BINARY_EVENT:ue.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==ue.BINARY_EVENT&&e.type!==ue.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=se(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}}function pe(e){return"[object Object]"===Object.prototype.toString.call(e)}class he extends I{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===ue.BINARY_EVENT;n||t.type===ue.BINARY_ACK?(t.type=n?ue.EVENT:ue.ACK,this.reconstructor=new fe(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!ne(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===ue[n.type])throw new Error("unknown packet type "+n.type);if(n.type===ue.BINARY_EVENT||n.type===ue.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const s=e.substring(r,t);if(s!=Number(s)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(s)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!he.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case ue.CONNECT:return pe(t);case ue.DISCONNECT:return void 0===t;case ue.CONNECT_ERROR:return"string"==typeof t||pe(t);case ue.EVENT:case ue.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===ce.indexOf(t[0]));case ue.ACK:case ue.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class fe{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=ie(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function me(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const ye=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ge extends I{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[me(e,"open",this.onopen.bind(this)),me(e,"packet",this.onpacket.bind(this)),me(e,"error",this.onerror.bind(this)),me(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(ye.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const n={type:ue.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[e]=t);const s=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,new Error("operation has timed out"))}),r);this.acks[e]=(...e)=>{this.io.clearTimeoutFn(s),t.apply(this,[null,...e])}}emitWithAck(e,...t){const n=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise(((r,s)=>{t.push(((e,t)=>n?e?s(e):r(t):r(e))),this.emit(e,...t)}))}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push(((e,...r)=>{if(n!==this._queue[0])return;return null!==e?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...r)),n.pending=!1,this._drainQueue()})),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth((e=>{this._sendConnectPacket(e)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:ue.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case ue.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ue.EVENT:case ue.BINARY_EVENT:this.onevent(e);break;case ue.ACK:case ue.BINARY_ACK:this.onack(e);break;case ue.DISCONNECT:this.ondisconnect();break;case ue.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:ue.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ue.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function be(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}be.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=1&Math.floor(10*t)?e+n:e-n}return 0|Math.min(e,this.max)},be.prototype.reset=function(){this.attempts=0},be.prototype.setMin=function(e){this.ms=e},be.prototype.setMax=function(e){this.max=e},be.prototype.setJitter=function(e){this.jitter=e};class Oe extends I{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&"object"==typeof t&&(n=t,t=void 0),(n=n||{}).path=n.path||"/socket.io",this.opts=n,T(this,n),this.reconnection(!1!==n.reconnection),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(r=n.randomizationFactor)&&void 0!==r?r:.5),this.backoff=new be({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==n.timeout?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||e;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=!1!==n.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new X(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=me(t,"open",(function(){n.onopen(),e&&e()})),s=me(t,"error",(t=>{n.cleanup(),n._readyState="closed",this.emitReserved("error",t),e?e(t):n.maybeReconnectOnOpen()}));if(!1!==this._timeout){const e=this._timeout;0===e&&r();const n=this.setTimeoutFn((()=>{r(),t.close(),t.emit("error",new Error("timeout"))}),e);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}return this.subs.push(r),this.subs.push(s),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(me(e,"ping",this.onping.bind(this)),me(e,"data",this.ondata.bind(this)),me(e,"error",this.onerror.bind(this)),me(e,"close",this.onclose.bind(this)),me(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){Y((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new ge(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const e of t){if(this.nsps[e].active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach((e=>e())),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn((()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()})))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const we={};function Ie(e,t){"object"==typeof e&&(t=e,e=void 0);const n=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),r=Q(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),r=n.source,s=n.id,o=n.path,i=we[s]&&o in we[s].nsps;let a;return t.forceNew||t["force new connection"]||!1===t.multiplex||i?a=new Oe(r,t):(we[s]||(we[s]=new Oe(r,t)),a=we[s]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}Object.assign(Ie,{Manager:Oe,Socket:ge,io:Ie,connect:Ie});var ve=__webpack_require__(835);class Se{constructor(...e){}}class Ae extends Se{constructor(...e){super()}static fromJSON(e){throw new TypeError("Must be implemented in a child class!")}}Ae.TYPE="1000";class Pe extends Ae{constructor(e,t,n){super(),this.type=e,this.socketId=t,this.data=n}toJSON(){return{type:this.type,socketId:this.socketId,data:this.data}}static fromJSON(e){return new Pe(e.type,e.socketId,e.data)}}Pe.DESCRIPTOR_NAME="ChannelMessage",Pe.DESCRIPTOR={fields:{type:{type:"uint32",id:1},socketId:{type:"string",id:2},data:{type:"bytes",id:3}}};var Te=__webpack_require__(199);const _e=Te.Reader,ke=Te.Writer,Ce=Te.util,Ee=Te.roots.default||(Te.roots.default={}),je=(Ee.OperationMetadataDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.userId="",e.prototype.type="",e.prototype.createdAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(18).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(26).string(e.createdAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.OperationMetadataDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.userId=e.string();break;case 2:r.type=e.string();break;case 3:r.createdAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.userId&&e.hasOwnProperty("userId")&&!Ce.isString(e.userId)?"userId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!Ce.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ce.isString(e.createdAt)?"createdAt: string expected":null},e.fromObject=function(e){if(e instanceof Ee.OperationMetadataDescriptor)return e;let t=new Ee.OperationMetadataDescriptor;return null!=e.userId&&(t.userId=String(e.userId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.userId="",n.type="",n.createdAt=""),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/OperationMetadataDescriptor"},e})(),Ee.CollaborativeEditingConnectMessage=(()=>{function e(e){if(this.buffers=[],this.types=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.bundleVersion="",e.prototype.buffers=Ce.emptyArray,e.prototype.types=Ce.emptyArray,e.prototype.lastOperationId="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(18).string(e.bundleVersion),null!=e.buffers&&e.buffers.length)for(let n=0;n<e.buffers.length;++n)t.uint32(26).bytes(e.buffers[n]);if(null!=e.types&&e.types.length){t.uint32(34).fork();for(let n=0;n<e.types.length;++n)t.uint32(e.types[n]);t.ldelim()}return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(42).string(e.lastOperationId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CollaborativeEditingConnectMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.bundleVersion=e.string();break;case 3:r.buffers&&r.buffers.length||(r.buffers=[]),r.buffers.push(e.bytes());break;case 4:if(r.types&&r.types.length||(r.types=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.types.push(e.uint32())}else r.types.push(e.uint32());break;case 5:r.lastOperationId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!Ce.isString(e.id))return"id: string expected";if(null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!Ce.isString(e.bundleVersion))return"bundleVersion: string expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(let t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||Ce.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)if(!Ce.isInteger(e.types[t]))return"types: integer[] expected"}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!Ce.isString(e.lastOperationId)?"lastOperationId: string expected":null},e.fromObject=function(e){if(e instanceof Ee.CollaborativeEditingConnectMessage)return e;let t=new Ee.CollaborativeEditingConnectMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingConnectMessage.buffers: array expected");t.buffers=[];for(let n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?Ce.base64.decode(e.buffers[n],t.buffers[n]=Ce.newBuffer(Ce.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingConnectMessage.types: array expected");t.types=[];for(let n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[]),t.defaults&&(n.id="",n.bundleVersion="",n.lastOperationId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),e.buffers&&e.buffers.length){n.buffers=[];for(let r=0;r<e.buffers.length;++r)n.buffers[r]=t.bytes===String?Ce.base64.encode(e.buffers[r],0,e.buffers[r].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[r]):e.buffers[r]}if(e.types&&e.types.length){n.types=[];for(let t=0;t<e.types.length;++t)n.types[t]=e.types[t]}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingConnectMessage"},e})(),Ee.CollaborativeEditingReconnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.bundleVersion="",e.prototype.lastKnowVersion=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(18).string(e.bundleVersion),null!=e.lastKnowVersion&&Object.hasOwnProperty.call(e,"lastKnowVersion")&&t.uint32(24).uint32(e.lastKnowVersion),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CollaborativeEditingReconnectMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.bundleVersion=e.string();break;case 3:r.lastKnowVersion=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ce.isString(e.id)?"id: string expected":null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!Ce.isString(e.bundleVersion)?"bundleVersion: string expected":null!=e.lastKnowVersion&&e.hasOwnProperty("lastKnowVersion")&&!Ce.isInteger(e.lastKnowVersion)?"lastKnowVersion: integer expected":null},e.fromObject=function(e){if(e instanceof Ee.CollaborativeEditingReconnectMessage)return e;let t=new Ee.CollaborativeEditingReconnectMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),null!=e.lastKnowVersion&&(t.lastKnowVersion=e.lastKnowVersion>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.bundleVersion="",n.lastKnowVersion=0),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),null!=e.lastKnowVersion&&e.hasOwnProperty("lastKnowVersion")&&(n.lastKnowVersion=e.lastKnowVersion),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingReconnectMessage"},e})(),Ee.CollaborativeEditingUpdateMessage=(()=>{function e(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.baseVersion=0,e.prototype.buffers=Ce.emptyArray,e.prototype.types=Ce.emptyArray,e.prototype.metadata=Ce.emptyArray,e.prototype.lastOperationId="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.baseVersion&&Object.hasOwnProperty.call(e,"baseVersion")&&t.uint32(16).uint32(e.baseVersion),null!=e.buffers&&e.buffers.length)for(let n=0;n<e.buffers.length;++n)t.uint32(26).bytes(e.buffers[n]);if(null!=e.types&&e.types.length){t.uint32(34).fork();for(let n=0;n<e.types.length;++n)t.uint32(e.types[n]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(let n=0;n<e.metadata.length;++n)Ee.OperationMetadataDescriptor.encode(e.metadata[n],t.uint32(50).fork()).ldelim();return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(58).string(e.lastOperationId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CollaborativeEditingUpdateMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.baseVersion=e.uint32();break;case 3:r.buffers&&r.buffers.length||(r.buffers=[]),r.buffers.push(e.bytes());break;case 4:if(r.types&&r.types.length||(r.types=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.types.push(e.uint32())}else r.types.push(e.uint32());break;case 6:r.metadata&&r.metadata.length||(r.metadata=[]),r.metadata.push(Ee.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 7:r.lastOperationId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!Ce.isString(e.id))return"id: string expected";if(null!=e.baseVersion&&e.hasOwnProperty("baseVersion")&&!Ce.isInteger(e.baseVersion))return"baseVersion: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(let t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||Ce.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)if(!Ce.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(let t=0;t<e.metadata.length;++t){let n=Ee.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!Ce.isString(e.lastOperationId)?"lastOperationId: string expected":null},e.fromObject=function(e){if(e instanceof Ee.CollaborativeEditingUpdateMessage)return e;let t=new Ee.CollaborativeEditingUpdateMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.baseVersion&&(t.baseVersion=e.baseVersion>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingUpdateMessage.buffers: array expected");t.buffers=[];for(let n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?Ce.base64.decode(e.buffers[n],t.buffers[n]=Ce.newBuffer(Ce.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingUpdateMessage.types: array expected");t.types=[];for(let n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingUpdateMessage.metadata: array expected");t.metadata=[];for(let n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingUpdateMessage.metadata: object expected");t.metadata[n]=Ee.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.id="",n.baseVersion=0,n.lastOperationId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.baseVersion&&e.hasOwnProperty("baseVersion")&&(n.baseVersion=e.baseVersion),e.buffers&&e.buffers.length){n.buffers=[];for(let r=0;r<e.buffers.length;++r)n.buffers[r]=t.bytes===String?Ce.base64.encode(e.buffers[r],0,e.buffers[r].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[r]):e.buffers[r]}if(e.types&&e.types.length){n.types=[];for(let t=0;t<e.types.length;++t)n.types[t]=e.types[t]}if(e.metadata&&e.metadata.length){n.metadata=[];for(let r=0;r<e.metadata.length;++r)n.metadata[r]=Ee.OperationMetadataDescriptor.toObject(e.metadata[r],t)}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingUpdateMessage"},e})(),Ee.GetDocumentDetailsMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.prototype.environmentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.environmentId&&Object.hasOwnProperty.call(e,"environmentId")&&t.uint32(18).string(e.environmentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.GetDocumentDetailsMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.documentId=e.string();break;case 2:r.environmentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId)?"documentId: string expected":null!=e.environmentId&&e.hasOwnProperty("environmentId")&&!Ce.isString(e.environmentId)?"environmentId: string expected":null},e.fromObject=function(e){if(e instanceof Ee.GetDocumentDetailsMessage)return e;let t=new Ee.GetDocumentDetailsMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.environmentId&&(t.environmentId=String(e.environmentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId="",n.environmentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.environmentId&&e.hasOwnProperty("environmentId")&&(n.environmentId=e.environmentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetDocumentDetailsMessage"},e})(),Ee.CollaborativeEditingConnectResponse=(()=>{function e(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.channel="",e.prototype.offset=0,e.prototype.version=0,e.prototype.buffers=Ce.emptyArray,e.prototype.types=Ce.emptyArray,e.prototype.metadata=Ce.emptyArray,e.prototype.initData="",e.prototype.isInitialized=!1,e.prototype.sessionId="",e.prototype.lastOperationId="",e.prototype.sessionCreatedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.offset&&Object.hasOwnProperty.call(e,"offset")&&t.uint32(16).uint32(e.offset),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&t.uint32(24).uint32(e.version),null!=e.buffers&&e.buffers.length)for(let n=0;n<e.buffers.length;++n)t.uint32(34).bytes(e.buffers[n]);if(null!=e.types&&e.types.length){t.uint32(42).fork();for(let n=0;n<e.types.length;++n)t.uint32(e.types[n]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(let n=0;n<e.metadata.length;++n)Ee.OperationMetadataDescriptor.encode(e.metadata[n],t.uint32(58).fork()).ldelim();return null!=e.initData&&Object.hasOwnProperty.call(e,"initData")&&t.uint32(66).string(e.initData),null!=e.isInitialized&&Object.hasOwnProperty.call(e,"isInitialized")&&t.uint32(72).bool(e.isInitialized),null!=e.sessionId&&Object.hasOwnProperty.call(e,"sessionId")&&t.uint32(82).string(e.sessionId),null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(90).string(e.lastOperationId),null!=e.sessionCreatedAt&&Object.hasOwnProperty.call(e,"sessionCreatedAt")&&t.uint32(98).string(e.sessionCreatedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CollaborativeEditingConnectResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.channel=e.string();break;case 2:r.offset=e.uint32();break;case 3:r.version=e.uint32();break;case 4:r.buffers&&r.buffers.length||(r.buffers=[]),r.buffers.push(e.bytes());break;case 5:if(r.types&&r.types.length||(r.types=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.types.push(e.uint32())}else r.types.push(e.uint32());break;case 7:r.metadata&&r.metadata.length||(r.metadata=[]),r.metadata.push(Ee.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 8:r.initData=e.string();break;case 9:r.isInitialized=e.bool();break;case 10:r.sessionId=e.string();break;case 11:r.lastOperationId=e.string();break;case 12:r.sessionCreatedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!Ce.isString(e.channel))return"channel: string expected";if(null!=e.offset&&e.hasOwnProperty("offset")&&!Ce.isInteger(e.offset))return"offset: integer expected";if(null!=e.version&&e.hasOwnProperty("version")&&!Ce.isInteger(e.version))return"version: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(let t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||Ce.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)if(!Ce.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(let t=0;t<e.metadata.length;++t){let n=Ee.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.initData&&e.hasOwnProperty("initData")&&!Ce.isString(e.initData)?"initData: string expected":null!=e.isInitialized&&e.hasOwnProperty("isInitialized")&&"boolean"!=typeof e.isInitialized?"isInitialized: boolean expected":null!=e.sessionId&&e.hasOwnProperty("sessionId")&&!Ce.isString(e.sessionId)?"sessionId: string expected":null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!Ce.isString(e.lastOperationId)?"lastOperationId: string expected":null!=e.sessionCreatedAt&&e.hasOwnProperty("sessionCreatedAt")&&!Ce.isString(e.sessionCreatedAt)?"sessionCreatedAt: string expected":null},e.fromObject=function(e){if(e instanceof Ee.CollaborativeEditingConnectResponse)return e;let t=new Ee.CollaborativeEditingConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),null!=e.offset&&(t.offset=e.offset>>>0),null!=e.version&&(t.version=e.version>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingConnectResponse.buffers: array expected");t.buffers=[];for(let n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?Ce.base64.decode(e.buffers[n],t.buffers[n]=Ce.newBuffer(Ce.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingConnectResponse.types: array expected");t.types=[];for(let n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingConnectResponse.metadata: array expected");t.metadata=[];for(let n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingConnectResponse.metadata: object expected");t.metadata[n]=Ee.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.initData&&(t.initData=String(e.initData)),null!=e.isInitialized&&(t.isInitialized=Boolean(e.isInitialized)),null!=e.sessionId&&(t.sessionId=String(e.sessionId)),null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),null!=e.sessionCreatedAt&&(t.sessionCreatedAt=String(e.sessionCreatedAt)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.channel="",n.offset=0,n.version=0,n.initData="",n.isInitialized=!1,n.sessionId="",n.lastOperationId="",n.sessionCreatedAt=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),null!=e.offset&&e.hasOwnProperty("offset")&&(n.offset=e.offset),null!=e.version&&e.hasOwnProperty("version")&&(n.version=e.version),e.buffers&&e.buffers.length){n.buffers=[];for(let r=0;r<e.buffers.length;++r)n.buffers[r]=t.bytes===String?Ce.base64.encode(e.buffers[r],0,e.buffers[r].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[r]):e.buffers[r]}if(e.types&&e.types.length){n.types=[];for(let t=0;t<e.types.length;++t)n.types[t]=e.types[t]}if(e.metadata&&e.metadata.length){n.metadata=[];for(let r=0;r<e.metadata.length;++r)n.metadata[r]=Ee.OperationMetadataDescriptor.toObject(e.metadata[r],t)}return null!=e.initData&&e.hasOwnProperty("initData")&&(n.initData=e.initData),null!=e.isInitialized&&e.hasOwnProperty("isInitialized")&&(n.isInitialized=e.isInitialized),null!=e.sessionId&&e.hasOwnProperty("sessionId")&&(n.sessionId=e.sessionId),null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),null!=e.sessionCreatedAt&&e.hasOwnProperty("sessionCreatedAt")&&(n.sessionCreatedAt=e.sessionCreatedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingConnectResponse"},e})(),Ee.CollaborativeEditingResponse=(()=>{function e(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.version=0,e.prototype.buffers=Ce.emptyArray,e.prototype.types=Ce.emptyArray,e.prototype.metadata=Ce.emptyArray,e.prototype.lastOperationId="",e.prototype.lastOperationAcceptedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&t.uint32(8).uint32(e.version),null!=e.buffers&&e.buffers.length)for(let n=0;n<e.buffers.length;++n)t.uint32(18).bytes(e.buffers[n]);if(null!=e.types&&e.types.length){t.uint32(26).fork();for(let n=0;n<e.types.length;++n)t.uint32(e.types[n]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(let n=0;n<e.metadata.length;++n)Ee.OperationMetadataDescriptor.encode(e.metadata[n],t.uint32(42).fork()).ldelim();return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(50).string(e.lastOperationId),null!=e.lastOperationAcceptedAt&&Object.hasOwnProperty.call(e,"lastOperationAcceptedAt")&&t.uint32(58).string(e.lastOperationAcceptedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CollaborativeEditingResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.version=e.uint32();break;case 2:r.buffers&&r.buffers.length||(r.buffers=[]),r.buffers.push(e.bytes());break;case 3:if(r.types&&r.types.length||(r.types=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.types.push(e.uint32())}else r.types.push(e.uint32());break;case 5:r.metadata&&r.metadata.length||(r.metadata=[]),r.metadata.push(Ee.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 6:r.lastOperationId=e.string();break;case 7:r.lastOperationAcceptedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.version&&e.hasOwnProperty("version")&&!Ce.isInteger(e.version))return"version: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(let t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||Ce.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)if(!Ce.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(let t=0;t<e.metadata.length;++t){let n=Ee.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!Ce.isString(e.lastOperationId)?"lastOperationId: string expected":null!=e.lastOperationAcceptedAt&&e.hasOwnProperty("lastOperationAcceptedAt")&&!Ce.isString(e.lastOperationAcceptedAt)?"lastOperationAcceptedAt: string expected":null},e.fromObject=function(e){if(e instanceof Ee.CollaborativeEditingResponse)return e;let t=new Ee.CollaborativeEditingResponse;if(null!=e.version&&(t.version=e.version>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingResponse.buffers: array expected");t.buffers=[];for(let n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?Ce.base64.decode(e.buffers[n],t.buffers[n]=Ce.newBuffer(Ce.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingResponse.types: array expected");t.types=[];for(let n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingResponse.metadata: array expected");t.metadata=[];for(let n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingResponse.metadata: object expected");t.metadata[n]=Ee.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),null!=e.lastOperationAcceptedAt&&(t.lastOperationAcceptedAt=String(e.lastOperationAcceptedAt)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.version=0,n.lastOperationId="",n.lastOperationAcceptedAt=""),null!=e.version&&e.hasOwnProperty("version")&&(n.version=e.version),e.buffers&&e.buffers.length){n.buffers=[];for(let r=0;r<e.buffers.length;++r)n.buffers[r]=t.bytes===String?Ce.base64.encode(e.buffers[r],0,e.buffers[r].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[r]):e.buffers[r]}if(e.types&&e.types.length){n.types=[];for(let t=0;t<e.types.length;++t)n.types[t]=e.types[t]}if(e.metadata&&e.metadata.length){n.metadata=[];for(let r=0;r<e.metadata.length;++r)n.metadata[r]=Ee.OperationMetadataDescriptor.toObject(e.metadata[r],t)}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),null!=e.lastOperationAcceptedAt&&e.hasOwnProperty("lastOperationAcceptedAt")&&(n.lastOperationAcceptedAt=e.lastOperationAcceptedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingResponse"},e})(),Ee.GetDocumentDetailsResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.lastDocumentSessionId="",e.prototype.lastDocumentSessionOperationId="",e.prototype.currentDocumentSessionId="",e.prototype.currentDocumentSessionVersion=0,e.prototype.currentDocumentSessionOperationId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.lastDocumentSessionId&&Object.hasOwnProperty.call(e,"lastDocumentSessionId")&&t.uint32(10).string(e.lastDocumentSessionId),null!=e.lastDocumentSessionOperationId&&Object.hasOwnProperty.call(e,"lastDocumentSessionOperationId")&&t.uint32(18).string(e.lastDocumentSessionOperationId),null!=e.currentDocumentSessionId&&Object.hasOwnProperty.call(e,"currentDocumentSessionId")&&t.uint32(26).string(e.currentDocumentSessionId),null!=e.currentDocumentSessionVersion&&Object.hasOwnProperty.call(e,"currentDocumentSessionVersion")&&t.uint32(32).uint32(e.currentDocumentSessionVersion),null!=e.currentDocumentSessionOperationId&&Object.hasOwnProperty.call(e,"currentDocumentSessionOperationId")&&t.uint32(42).string(e.currentDocumentSessionOperationId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.GetDocumentDetailsResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.lastDocumentSessionId=e.string();break;case 2:r.lastDocumentSessionOperationId=e.string();break;case 3:r.currentDocumentSessionId=e.string();break;case 4:r.currentDocumentSessionVersion=e.uint32();break;case 5:r.currentDocumentSessionOperationId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.lastDocumentSessionId&&e.hasOwnProperty("lastDocumentSessionId")&&!Ce.isString(e.lastDocumentSessionId)?"lastDocumentSessionId: string expected":null!=e.lastDocumentSessionOperationId&&e.hasOwnProperty("lastDocumentSessionOperationId")&&!Ce.isString(e.lastDocumentSessionOperationId)?"lastDocumentSessionOperationId: string expected":null!=e.currentDocumentSessionId&&e.hasOwnProperty("currentDocumentSessionId")&&!Ce.isString(e.currentDocumentSessionId)?"currentDocumentSessionId: string expected":null!=e.currentDocumentSessionVersion&&e.hasOwnProperty("currentDocumentSessionVersion")&&!Ce.isInteger(e.currentDocumentSessionVersion)?"currentDocumentSessionVersion: integer expected":null!=e.currentDocumentSessionOperationId&&e.hasOwnProperty("currentDocumentSessionOperationId")&&!Ce.isString(e.currentDocumentSessionOperationId)?"currentDocumentSessionOperationId: string expected":null},e.fromObject=function(e){if(e instanceof Ee.GetDocumentDetailsResponse)return e;let t=new Ee.GetDocumentDetailsResponse;return null!=e.lastDocumentSessionId&&(t.lastDocumentSessionId=String(e.lastDocumentSessionId)),null!=e.lastDocumentSessionOperationId&&(t.lastDocumentSessionOperationId=String(e.lastDocumentSessionOperationId)),null!=e.currentDocumentSessionId&&(t.currentDocumentSessionId=String(e.currentDocumentSessionId)),null!=e.currentDocumentSessionVersion&&(t.currentDocumentSessionVersion=e.currentDocumentSessionVersion>>>0),null!=e.currentDocumentSessionOperationId&&(t.currentDocumentSessionOperationId=String(e.currentDocumentSessionOperationId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.lastDocumentSessionId="",n.lastDocumentSessionOperationId="",n.currentDocumentSessionId="",n.currentDocumentSessionVersion=0,n.currentDocumentSessionOperationId=""),null!=e.lastDocumentSessionId&&e.hasOwnProperty("lastDocumentSessionId")&&(n.lastDocumentSessionId=e.lastDocumentSessionId),null!=e.lastDocumentSessionOperationId&&e.hasOwnProperty("lastDocumentSessionOperationId")&&(n.lastDocumentSessionOperationId=e.lastDocumentSessionOperationId),null!=e.currentDocumentSessionId&&e.hasOwnProperty("currentDocumentSessionId")&&(n.currentDocumentSessionId=e.currentDocumentSessionId),null!=e.currentDocumentSessionVersion&&e.hasOwnProperty("currentDocumentSessionVersion")&&(n.currentDocumentSessionVersion=e.currentDocumentSessionVersion),null!=e.currentDocumentSessionOperationId&&e.hasOwnProperty("currentDocumentSessionOperationId")&&(n.currentDocumentSessionOperationId=e.currentDocumentSessionOperationId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetDocumentDetailsResponse"},e})(),Ee.CommentDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentId="",e.prototype.commentThreadId="",e.prototype.userId="",e.prototype.content="",e.prototype.documentId="",e.prototype.createdAt="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(10).string(e.commentId),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(18).string(e.commentThreadId),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(26).string(e.userId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(34).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(42).string(e.documentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CommentDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentId=e.string();break;case 2:r.commentThreadId=e.string();break;case 3:r.userId=e.string();break;case 4:r.content=e.string();break;case 5:r.documentId=e.string();break;case 6:r.createdAt=e.string();break;case 7:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!Ce.isString(e.commentId)?"commentId: string expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ce.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.userId&&e.hasOwnProperty("userId")&&!Ce.isString(e.userId)?"userId: string expected":null!=e.content&&e.hasOwnProperty("content")&&!Ce.isString(e.content)?"content: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId)?"documentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ce.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ce.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof Ee.CommentDescriptor)return e;let t=new Ee.CommentDescriptor;return null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentId="",n.commentThreadId="",n.userId="",n.content="",n.documentId="",n.createdAt="",n.attributes=""),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentDescriptor"},e})(),Ee.CommentsThreadDescriptor=(()=>{function e(e){if(this.comments=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.comments=Ce.emptyArray,e.prototype.resolvedAt="",e.prototype.resolvedBy="",e.prototype.context="",e.prototype.createdAt="",e.prototype.deletedAt="",e.prototype.attributes="",e.prototype.unlinkedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.comments&&e.comments.length)for(let n=0;n<e.comments.length;++n)Ee.CommentDescriptor.encode(e.comments[n],t.uint32(18).fork()).ldelim();return null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(26).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(34).string(e.resolvedBy),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(42).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(58).string(e.deletedAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),null!=e.unlinkedAt&&Object.hasOwnProperty.call(e,"unlinkedAt")&&t.uint32(74).string(e.unlinkedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CommentsThreadDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.comments&&r.comments.length||(r.comments=[]),r.comments.push(Ee.CommentDescriptor.decode(e,e.uint32()));break;case 3:r.resolvedAt=e.string();break;case 4:r.resolvedBy=e.string();break;case 5:r.context=e.string();break;case 6:r.createdAt=e.string();break;case 7:r.deletedAt=e.string();break;case 8:r.attributes=e.string();break;case 9:r.unlinkedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ce.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(let t=0;t<e.comments.length;++t){let n=Ee.CommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!Ce.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!Ce.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.context&&e.hasOwnProperty("context")&&!Ce.isString(e.context)?"context: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ce.isString(e.createdAt)?"createdAt: string expected":null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!Ce.isString(e.deletedAt)?"deletedAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ce.isString(e.attributes)?"attributes: string expected":null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&!Ce.isString(e.unlinkedAt)?"unlinkedAt: string expected":null},e.fromObject=function(e){if(e instanceof Ee.CommentsThreadDescriptor)return e;let t=new Ee.CommentsThreadDescriptor;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsThreadDescriptor.comments: array expected");t.comments=[];for(let n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsThreadDescriptor.comments: object expected");t.comments[n]=Ee.CommentDescriptor.fromObject(e.comments[n])}}return null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.unlinkedAt&&(t.unlinkedAt=String(e.unlinkedAt)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.commentThreadId="",n.resolvedAt="",n.resolvedBy="",n.context="",n.createdAt="",n.deletedAt="",n.attributes="",n.unlinkedAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),e.comments&&e.comments.length){n.comments=[];for(let r=0;r<e.comments.length;++r)n.comments[r]=Ee.CommentDescriptor.toObject(e.comments[r],t)}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&(n.unlinkedAt=e.unlinkedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsThreadDescriptor"},e})(),Ee.CommentThreadAddedCommentDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentId="",e.prototype.createdAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(10).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(18).string(e.createdAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CommentThreadAddedCommentDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentId=e.string();break;case 2:r.createdAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!Ce.isString(e.commentId)?"commentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ce.isString(e.createdAt)?"createdAt: string expected":null},e.fromObject=function(e){if(e instanceof Ee.CommentThreadAddedCommentDescriptor)return e;let t=new Ee.CommentThreadAddedCommentDescriptor;return null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentId="",n.createdAt=""),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentThreadAddedCommentDescriptor"},e})(),Ee.CommentsV2AddCommentMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.content="",e.prototype.documentId="",e.prototype.commentId="",e.prototype.createdAt="",e.prototype.userId="",e.prototype.attributes="",e.prototype.commentThread=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(18).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(26).string(e.documentId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(34).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(42).string(e.createdAt),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(50).string(e.userId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.commentThread&&Object.hasOwnProperty.call(e,"commentThread")&&Ee.CommentsThreadDescriptor.encode(e.commentThread,t.uint32(66).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CommentsV2AddCommentMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.content=e.string();break;case 3:r.documentId=e.string();break;case 4:r.commentId=e.string();break;case 5:r.createdAt=e.string();break;case 6:r.userId=e.string();break;case 7:r.attributes=e.string();break;case 8:r.commentThread=Ee.CommentsThreadDescriptor.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ce.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.content&&e.hasOwnProperty("content")&&!Ce.isString(e.content))return"content: string expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId))return"documentId: string expected";if(null!=e.commentId&&e.hasOwnProperty("commentId")&&!Ce.isString(e.commentId))return"commentId: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ce.isString(e.createdAt))return"createdAt: string expected";if(null!=e.userId&&e.hasOwnProperty("userId")&&!Ce.isString(e.userId))return"userId: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ce.isString(e.attributes))return"attributes: string expected";if(null!=e.commentThread&&e.hasOwnProperty("commentThread")){let t=Ee.CommentsThreadDescriptor.verify(e.commentThread);if(t)return"commentThread."+t}return null},e.fromObject=function(e){if(e instanceof Ee.CommentsV2AddCommentMessage)return e;let t=new Ee.CommentsV2AddCommentMessage;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.commentThread){if("object"!=typeof e.commentThread)throw TypeError(".CommentsV2AddCommentMessage.commentThread: object expected");t.commentThread=Ee.CommentsThreadDescriptor.fromObject(e.commentThread)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.content="",n.documentId="",n.commentId="",n.createdAt="",n.userId="",n.attributes="",n.commentThread=null),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.commentThread&&e.hasOwnProperty("commentThread")&&(n.commentThread=Ee.CommentsThreadDescriptor.toObject(e.commentThread,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentMessage"},e})(),Ee.CommentsV2AddCommentThreadMessage=(()=>{function e(e){if(this.comments=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.prototype.commentThreadId="",e.prototype.context="",e.prototype.createdAt="",e.prototype.resolvedAt="",e.prototype.resolvedBy="",e.prototype.attributes="",e.prototype.deletedAt="",e.prototype.comments=Ce.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(18).string(e.commentThreadId),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(26).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(42).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(50).string(e.resolvedBy),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(66).string(e.deletedAt),null!=e.comments&&e.comments.length)for(let n=0;n<e.comments.length;++n)Ee.CommentDescriptor.encode(e.comments[n],t.uint32(74).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CommentsV2AddCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.documentId=e.string();break;case 2:r.commentThreadId=e.string();break;case 3:r.context=e.string();break;case 4:r.createdAt=e.string();break;case 5:r.resolvedAt=e.string();break;case 6:r.resolvedBy=e.string();break;case 7:r.attributes=e.string();break;case 8:r.deletedAt=e.string();break;case 9:r.comments&&r.comments.length||(r.comments=[]),r.comments.push(Ee.CommentDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId))return"documentId: string expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ce.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.context&&e.hasOwnProperty("context")&&!Ce.isString(e.context))return"context: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ce.isString(e.createdAt))return"createdAt: string expected";if(null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!Ce.isString(e.resolvedAt))return"resolvedAt: string expected";if(null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!Ce.isString(e.resolvedBy))return"resolvedBy: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ce.isString(e.attributes))return"attributes: string expected";if(null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!Ce.isString(e.deletedAt))return"deletedAt: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(let t=0;t<e.comments.length;++t){let n=Ee.CommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null},e.fromObject=function(e){if(e instanceof Ee.CommentsV2AddCommentThreadMessage)return e;let t=new Ee.CommentsV2AddCommentThreadMessage;if(null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2AddCommentThreadMessage.comments: array expected");t.comments=[];for(let n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsV2AddCommentThreadMessage.comments: object expected");t.comments[n]=Ee.CommentDescriptor.fromObject(e.comments[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.documentId="",n.commentThreadId="",n.context="",n.createdAt="",n.resolvedAt="",n.resolvedBy="",n.attributes="",n.deletedAt=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),e.comments&&e.comments.length){n.comments=[];for(let r=0;r<e.comments.length;++r)n.comments[r]=Ee.CommentDescriptor.toObject(e.comments[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentThreadMessage"},e})(),Ee.CommentsV2ReopenCommentThreadMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CommentsV2ReopenCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ce.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof Ee.CommentsV2ReopenCommentThreadMessage)return e;let t=new Ee.CommentsV2ReopenCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ReopenCommentThreadMessage"},e})(),Ee.CommentsV2ResolveCommentThreadMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.prototype.resolvedBy="",e.prototype.resolvedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(26).string(e.resolvedBy),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(34).string(e.resolvedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CommentsV2ResolveCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;case 3:r.resolvedBy=e.string();break;case 4:r.resolvedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ce.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId)?"documentId: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!Ce.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!Ce.isString(e.resolvedAt)?"resolvedAt: string expected":null},e.fromObject=function(e){if(e instanceof Ee.CommentsV2ResolveCommentThreadMessage)return e;let t=new Ee.CommentsV2ResolveCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.resolvedBy="",n.resolvedAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ResolveCommentThreadMessage"},e})(),Ee.CommentsV2UpdateCommentThreadMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.prototype.context="",e.prototype.attributes="",e.prototype.unlinkedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(26).string(e.context),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(34).string(e.attributes),null!=e.unlinkedAt&&Object.hasOwnProperty.call(e,"unlinkedAt")&&t.uint32(42).string(e.unlinkedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CommentsV2UpdateCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;case 3:r.context=e.string();break;case 4:r.attributes=e.string();break;case 5:r.unlinkedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ce.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId)?"documentId: string expected":null!=e.context&&e.hasOwnProperty("context")&&!Ce.isString(e.context)?"context: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ce.isString(e.attributes)?"attributes: string expected":null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&!Ce.isString(e.unlinkedAt)?"unlinkedAt: string expected":null},e.fromObject=function(e){if(e instanceof Ee.CommentsV2UpdateCommentThreadMessage)return e;let t=new Ee.CommentsV2UpdateCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.context&&(t.context=String(e.context)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.unlinkedAt&&(t.unlinkedAt=String(e.unlinkedAt)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.context="",n.attributes="",n.unlinkedAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&(n.unlinkedAt=e.unlinkedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2UpdateCommentThreadMessage"},e})(),Ee.CommentsV2ConnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CommentsV2ConnectMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.documentId=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof Ee.CommentsV2ConnectMessage)return e;let t=new Ee.CommentsV2ConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ConnectMessage"},e})(),Ee.CommentsV2GetCommentThreadMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CommentsV2GetCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ce.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof Ee.CommentsV2GetCommentThreadMessage)return e;let t=new Ee.CommentsV2GetCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetCommentThreadMessage"},e})(),Ee.CommentsV2GetDocumentThreadsMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CommentsV2GetDocumentThreadsMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.documentId=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof Ee.CommentsV2GetDocumentThreadsMessage)return e;let t=new Ee.CommentsV2GetDocumentThreadsMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetDocumentThreadsMessage"},e})(),Ee.CommentsV2RemoveCommentMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.commentId="",e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(26).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CommentsV2RemoveCommentMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.commentId=e.string();break;case 3:r.documentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ce.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!Ce.isString(e.commentId)?"commentId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof Ee.CommentsV2RemoveCommentMessage)return e;let t=new Ee.CommentsV2RemoveCommentMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2RemoveCommentMessage"},e})(),Ee.CommentsV2RemoveCommentThreadMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CommentsV2RemoveCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ce.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof Ee.CommentsV2RemoveCommentThreadMessage)return e;let t=new Ee.CommentsV2RemoveCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2RemoveCommentThreadMessage"},e})(),Ee.CommentsV2UpdateCommentMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.commentId="",e.prototype.content="",e.prototype.documentId="",e.prototype.attributes="",e.prototype.isAttributesUpdated=!1,e.prototype.commentThread=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(26).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(34).string(e.documentId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(42).string(e.attributes),null!=e.isAttributesUpdated&&Object.hasOwnProperty.call(e,"isAttributesUpdated")&&t.uint32(48).bool(e.isAttributesUpdated),null!=e.commentThread&&Object.hasOwnProperty.call(e,"commentThread")&&Ee.CommentsThreadDescriptor.encode(e.commentThread,t.uint32(58).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CommentsV2UpdateCommentMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.commentId=e.string();break;case 3:r.content=e.string();break;case 4:r.documentId=e.string();break;case 5:r.attributes=e.string();break;case 6:r.isAttributesUpdated=e.bool();break;case 7:r.commentThread=Ee.CommentsThreadDescriptor.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ce.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.commentId&&e.hasOwnProperty("commentId")&&!Ce.isString(e.commentId))return"commentId: string expected";if(null!=e.content&&e.hasOwnProperty("content")&&!Ce.isString(e.content))return"content: string expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId))return"documentId: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ce.isString(e.attributes))return"attributes: string expected";if(null!=e.isAttributesUpdated&&e.hasOwnProperty("isAttributesUpdated")&&"boolean"!=typeof e.isAttributesUpdated)return"isAttributesUpdated: boolean expected";if(null!=e.commentThread&&e.hasOwnProperty("commentThread")){let t=Ee.CommentsThreadDescriptor.verify(e.commentThread);if(t)return"commentThread."+t}return null},e.fromObject=function(e){if(e instanceof Ee.CommentsV2UpdateCommentMessage)return e;let t=new Ee.CommentsV2UpdateCommentMessage;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.isAttributesUpdated&&(t.isAttributesUpdated=Boolean(e.isAttributesUpdated)),null!=e.commentThread){if("object"!=typeof e.commentThread)throw TypeError(".CommentsV2UpdateCommentMessage.commentThread: object expected");t.commentThread=Ee.CommentsThreadDescriptor.fromObject(e.commentThread)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.content="",n.documentId="",n.attributes="",n.isAttributesUpdated=!1,n.commentThread=null),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.isAttributesUpdated&&e.hasOwnProperty("isAttributesUpdated")&&(n.isAttributesUpdated=e.isAttributesUpdated),null!=e.commentThread&&e.hasOwnProperty("commentThread")&&(n.commentThread=Ee.CommentsThreadDescriptor.toObject(e.commentThread,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2UpdateCommentMessage"},e})(),Ee.CommentsV2AddCommentResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.commentId="",e.prototype.createdAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(26).string(e.createdAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CommentsV2AddCommentResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.commentId=e.string();break;case 3:r.createdAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ce.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!Ce.isString(e.commentId)?"commentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ce.isString(e.createdAt)?"createdAt: string expected":null},e.fromObject=function(e){if(e instanceof Ee.CommentsV2AddCommentResponse)return e;let t=new Ee.CommentsV2AddCommentResponse;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.createdAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentResponse"},e})(),Ee.CommentsV2AddCommentThreadResponse=(()=>{function e(e){if(this.comments=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.createdAt="",e.prototype.comments=Ce.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(18).string(e.createdAt),null!=e.comments&&e.comments.length)for(let n=0;n<e.comments.length;++n)Ee.CommentThreadAddedCommentDescriptor.encode(e.comments[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CommentsV2AddCommentThreadResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.createdAt=e.string();break;case 3:r.comments&&r.comments.length||(r.comments=[]),r.comments.push(Ee.CommentThreadAddedCommentDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ce.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ce.isString(e.createdAt))return"createdAt: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(let t=0;t<e.comments.length;++t){let n=Ee.CommentThreadAddedCommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null},e.fromObject=function(e){if(e instanceof Ee.CommentsV2AddCommentThreadResponse)return e;let t=new Ee.CommentsV2AddCommentThreadResponse;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2AddCommentThreadResponse.comments: array expected");t.comments=[];for(let n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsV2AddCommentThreadResponse.comments: object expected");t.comments[n]=Ee.CommentThreadAddedCommentDescriptor.fromObject(e.comments[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.commentThreadId="",n.createdAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),e.comments&&e.comments.length){n.comments=[];for(let r=0;r<e.comments.length;++r)n.comments[r]=Ee.CommentThreadAddedCommentDescriptor.toObject(e.comments[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentThreadResponse"},e})(),Ee.CommentsV2ResolveCommentThreadResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.prototype.resolvedAt="",e.prototype.resolvedBy="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(26).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(34).string(e.resolvedBy),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CommentsV2ResolveCommentThreadResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;case 3:r.resolvedAt=e.string();break;case 4:r.resolvedBy=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ce.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId)?"documentId: string expected":null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!Ce.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!Ce.isString(e.resolvedBy)?"resolvedBy: string expected":null},e.fromObject=function(e){if(e instanceof Ee.CommentsV2ResolveCommentThreadResponse)return e;let t=new Ee.CommentsV2ResolveCommentThreadResponse;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.resolvedAt="",n.resolvedBy=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ResolveCommentThreadResponse"},e})(),Ee.CommentsV2ConnectResponse=(()=>{function e(e){if(this.threads=[],this.threadsV2=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.channel="",e.prototype.threads=Ce.emptyArray,e.prototype.threadsV2=Ce.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.threads&&e.threads.length)for(let n=0;n<e.threads.length;++n)t.uint32(18).string(e.threads[n]);if(null!=e.threadsV2&&e.threadsV2.length)for(let n=0;n<e.threadsV2.length;++n)Ee.CommentsThreadDescriptor.encode(e.threadsV2[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CommentsV2ConnectResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.channel=e.string();break;case 2:r.threads&&r.threads.length||(r.threads=[]),r.threads.push(e.string());break;case 3:r.threadsV2&&r.threadsV2.length||(r.threadsV2=[]),r.threadsV2.push(Ee.CommentsThreadDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!Ce.isString(e.channel))return"channel: string expected";if(null!=e.threads&&e.hasOwnProperty("threads")){if(!Array.isArray(e.threads))return"threads: array expected";for(let t=0;t<e.threads.length;++t)if(!Ce.isString(e.threads[t]))return"threads: string[] expected"}if(null!=e.threadsV2&&e.hasOwnProperty("threadsV2")){if(!Array.isArray(e.threadsV2))return"threadsV2: array expected";for(let t=0;t<e.threadsV2.length;++t){let n=Ee.CommentsThreadDescriptor.verify(e.threadsV2[t]);if(n)return"threadsV2."+n}}return null},e.fromObject=function(e){if(e instanceof Ee.CommentsV2ConnectResponse)return e;let t=new Ee.CommentsV2ConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.threads){if(!Array.isArray(e.threads))throw TypeError(".CommentsV2ConnectResponse.threads: array expected");t.threads=[];for(let n=0;n<e.threads.length;++n)t.threads[n]=String(e.threads[n])}if(e.threadsV2){if(!Array.isArray(e.threadsV2))throw TypeError(".CommentsV2ConnectResponse.threadsV2: array expected");t.threadsV2=[];for(let n=0;n<e.threadsV2.length;++n){if("object"!=typeof e.threadsV2[n])throw TypeError(".CommentsV2ConnectResponse.threadsV2: object expected");t.threadsV2[n]=Ee.CommentsThreadDescriptor.fromObject(e.threadsV2[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.threads=[],n.threadsV2=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.threads&&e.threads.length){n.threads=[];for(let t=0;t<e.threads.length;++t)n.threads[t]=e.threads[t]}if(e.threadsV2&&e.threadsV2.length){n.threadsV2=[];for(let r=0;r<e.threadsV2.length;++r)n.threadsV2[r]=Ee.CommentsThreadDescriptor.toObject(e.threadsV2[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ConnectResponse"},e})(),Ee.CommentsV2GetCommentThreadResponse=(()=>{function e(e){if(this.comments=[],this.commentsV2=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.comments=Ce.emptyArray,e.prototype.commentsV2=Ce.emptyArray,e.prototype.resolvedAt="",e.prototype.resolvedBy="",e.prototype.context="",e.prototype.createdAt="",e.prototype.deletedAt="",e.prototype.attributes="",e.prototype.unlinkedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.comments&&e.comments.length)for(let n=0;n<e.comments.length;++n)t.uint32(18).string(e.comments[n]);if(null!=e.commentsV2&&e.commentsV2.length)for(let n=0;n<e.commentsV2.length;++n)Ee.CommentDescriptor.encode(e.commentsV2[n],t.uint32(26).fork()).ldelim();return null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(34).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(42).string(e.resolvedBy),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(50).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(58).string(e.createdAt),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(66).string(e.deletedAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(74).string(e.attributes),null!=e.unlinkedAt&&Object.hasOwnProperty.call(e,"unlinkedAt")&&t.uint32(82).string(e.unlinkedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CommentsV2GetCommentThreadResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.comments&&r.comments.length||(r.comments=[]),r.comments.push(e.string());break;case 3:r.commentsV2&&r.commentsV2.length||(r.commentsV2=[]),r.commentsV2.push(Ee.CommentDescriptor.decode(e,e.uint32()));break;case 4:r.resolvedAt=e.string();break;case 5:r.resolvedBy=e.string();break;case 6:r.context=e.string();break;case 7:r.createdAt=e.string();break;case 8:r.deletedAt=e.string();break;case 9:r.attributes=e.string();break;case 10:r.unlinkedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ce.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(let t=0;t<e.comments.length;++t)if(!Ce.isString(e.comments[t]))return"comments: string[] expected"}if(null!=e.commentsV2&&e.hasOwnProperty("commentsV2")){if(!Array.isArray(e.commentsV2))return"commentsV2: array expected";for(let t=0;t<e.commentsV2.length;++t){let n=Ee.CommentDescriptor.verify(e.commentsV2[t]);if(n)return"commentsV2."+n}}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!Ce.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!Ce.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.context&&e.hasOwnProperty("context")&&!Ce.isString(e.context)?"context: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ce.isString(e.createdAt)?"createdAt: string expected":null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!Ce.isString(e.deletedAt)?"deletedAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ce.isString(e.attributes)?"attributes: string expected":null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&!Ce.isString(e.unlinkedAt)?"unlinkedAt: string expected":null},e.fromObject=function(e){if(e instanceof Ee.CommentsV2GetCommentThreadResponse)return e;let t=new Ee.CommentsV2GetCommentThreadResponse;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2GetCommentThreadResponse.comments: array expected");t.comments=[];for(let n=0;n<e.comments.length;++n)t.comments[n]=String(e.comments[n])}if(e.commentsV2){if(!Array.isArray(e.commentsV2))throw TypeError(".CommentsV2GetCommentThreadResponse.commentsV2: array expected");t.commentsV2=[];for(let n=0;n<e.commentsV2.length;++n){if("object"!=typeof e.commentsV2[n])throw TypeError(".CommentsV2GetCommentThreadResponse.commentsV2: object expected");t.commentsV2[n]=Ee.CommentDescriptor.fromObject(e.commentsV2[n])}}return null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.unlinkedAt&&(t.unlinkedAt=String(e.unlinkedAt)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.comments=[],n.commentsV2=[]),t.defaults&&(n.commentThreadId="",n.resolvedAt="",n.resolvedBy="",n.context="",n.createdAt="",n.deletedAt="",n.attributes="",n.unlinkedAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),e.comments&&e.comments.length){n.comments=[];for(let t=0;t<e.comments.length;++t)n.comments[t]=e.comments[t]}if(e.commentsV2&&e.commentsV2.length){n.commentsV2=[];for(let r=0;r<e.commentsV2.length;++r)n.commentsV2[r]=Ee.CommentDescriptor.toObject(e.commentsV2[r],t)}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&(n.unlinkedAt=e.unlinkedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetCommentThreadResponse"},e})(),Ee.CommentsV2GetDocumentThreadsResponse=(()=>{function e(e){if(this.threads=[],this.threadsV2=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.threads=Ce.emptyArray,e.prototype.threadsV2=Ce.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.threads&&e.threads.length)for(let n=0;n<e.threads.length;++n)t.uint32(10).string(e.threads[n]);if(null!=e.threadsV2&&e.threadsV2.length)for(let n=0;n<e.threadsV2.length;++n)Ee.CommentsThreadDescriptor.encode(e.threadsV2[n],t.uint32(18).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.CommentsV2GetDocumentThreadsResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.threads&&r.threads.length||(r.threads=[]),r.threads.push(e.string());break;case 2:r.threadsV2&&r.threadsV2.length||(r.threadsV2=[]),r.threadsV2.push(Ee.CommentsThreadDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.threads&&e.hasOwnProperty("threads")){if(!Array.isArray(e.threads))return"threads: array expected";for(let t=0;t<e.threads.length;++t)if(!Ce.isString(e.threads[t]))return"threads: string[] expected"}if(null!=e.threadsV2&&e.hasOwnProperty("threadsV2")){if(!Array.isArray(e.threadsV2))return"threadsV2: array expected";for(let t=0;t<e.threadsV2.length;++t){let n=Ee.CommentsThreadDescriptor.verify(e.threadsV2[t]);if(n)return"threadsV2."+n}}return null},e.fromObject=function(e){if(e instanceof Ee.CommentsV2GetDocumentThreadsResponse)return e;let t=new Ee.CommentsV2GetDocumentThreadsResponse;if(e.threads){if(!Array.isArray(e.threads))throw TypeError(".CommentsV2GetDocumentThreadsResponse.threads: array expected");t.threads=[];for(let n=0;n<e.threads.length;++n)t.threads[n]=String(e.threads[n])}if(e.threadsV2){if(!Array.isArray(e.threadsV2))throw TypeError(".CommentsV2GetDocumentThreadsResponse.threadsV2: array expected");t.threadsV2=[];for(let n=0;n<e.threadsV2.length;++n){if("object"!=typeof e.threadsV2[n])throw TypeError(".CommentsV2GetDocumentThreadsResponse.threadsV2: object expected");t.threadsV2[n]=Ee.CommentsThreadDescriptor.fromObject(e.threadsV2[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.threads=[],n.threadsV2=[]),e.threads&&e.threads.length){n.threads=[];for(let t=0;t<e.threads.length;++t)n.threads[t]=e.threads[t]}if(e.threadsV2&&e.threadsV2.length){n.threadsV2=[];for(let r=0;r<e.threadsV2.length;++r)n.threadsV2[r]=Ee.CommentsThreadDescriptor.toObject(e.threadsV2[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetDocumentThreadsResponse"},e})(),Ee.KeyValueDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.key="",e.prototype.value="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(10).string(e.key),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(18).string(e.value),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.KeyValueDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.key=e.string();break;case 2:r.value=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!Ce.isString(e.key)?"key: string expected":null!=e.value&&e.hasOwnProperty("value")&&!Ce.isString(e.value)?"value: string expected":null},e.fromObject=function(e){if(e instanceof Ee.KeyValueDescriptor)return e;let t=new Ee.KeyValueDescriptor;return null!=e.key&&(t.key=String(e.key)),null!=e.value&&(t.value=String(e.value)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.key="",n.value=""),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.value&&e.hasOwnProperty("value")&&(n.value=e.value),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/KeyValueDescriptor"},e})(),Ee.IsEditorBundleUploadedMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.bundleVersion="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(10).string(e.bundleVersion),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.IsEditorBundleUploadedMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.bundleVersion=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!Ce.isString(e.bundleVersion)?"bundleVersion: string expected":null},e.fromObject=function(e){if(e instanceof Ee.IsEditorBundleUploadedMessage)return e;let t=new Ee.IsEditorBundleUploadedMessage;return null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.bundleVersion=""),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/IsEditorBundleUploadedMessage"},e})(),Ee.IsEditorBundleUploadedResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.isUploaded=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.isUploaded&&Object.hasOwnProperty.call(e,"isUploaded")&&t.uint32(8).bool(e.isUploaded),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.IsEditorBundleUploadedResponse;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.isUploaded=e.bool():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.isUploaded&&e.hasOwnProperty("isUploaded")&&"boolean"!=typeof e.isUploaded?"isUploaded: boolean expected":null},e.fromObject=function(e){if(e instanceof Ee.IsEditorBundleUploadedResponse)return e;let t=new Ee.IsEditorBundleUploadedResponse;return null!=e.isUploaded&&(t.isUploaded=Boolean(e.isUploaded)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.isUploaded=!1),null!=e.isUploaded&&e.hasOwnProperty("isUploaded")&&(n.isUploaded=e.isUploaded),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/IsEditorBundleUploadedResponse"},e})(),Ee.RevisionDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.revisionId="",e.prototype.name="",e.prototype.creatorId="",e.prototype.authorsIds="",e.prototype.diffData="",e.prototype.createdAt="",e.prototype.attributes="",e.prototype.toVersion=0,e.prototype.fromVersion=0,e.prototype.isEmptyCurrent=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(10).string(e.revisionId),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(18).string(e.name),null!=e.creatorId&&Object.hasOwnProperty.call(e,"creatorId")&&t.uint32(26).string(e.creatorId),null!=e.authorsIds&&Object.hasOwnProperty.call(e,"authorsIds")&&t.uint32(34).string(e.authorsIds),null!=e.diffData&&Object.hasOwnProperty.call(e,"diffData")&&t.uint32(42).string(e.diffData),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.toVersion&&Object.hasOwnProperty.call(e,"toVersion")&&t.uint32(64).uint32(e.toVersion),null!=e.fromVersion&&Object.hasOwnProperty.call(e,"fromVersion")&&t.uint32(72).uint32(e.fromVersion),null!=e.isEmptyCurrent&&Object.hasOwnProperty.call(e,"isEmptyCurrent")&&t.uint32(80).bool(e.isEmptyCurrent),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.RevisionDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.revisionId=e.string();break;case 2:r.name=e.string();break;case 3:r.creatorId=e.string();break;case 4:r.authorsIds=e.string();break;case 5:r.diffData=e.string();break;case 6:r.createdAt=e.string();break;case 7:r.attributes=e.string();break;case 8:r.toVersion=e.uint32();break;case 9:r.fromVersion=e.uint32();break;case 10:r.isEmptyCurrent=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!Ce.isString(e.revisionId)?"revisionId: string expected":null!=e.name&&e.hasOwnProperty("name")&&!Ce.isString(e.name)?"name: string expected":null!=e.creatorId&&e.hasOwnProperty("creatorId")&&!Ce.isString(e.creatorId)?"creatorId: string expected":null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&!Ce.isString(e.authorsIds)?"authorsIds: string expected":null!=e.diffData&&e.hasOwnProperty("diffData")&&!Ce.isString(e.diffData)?"diffData: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ce.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ce.isString(e.attributes)?"attributes: string expected":null!=e.toVersion&&e.hasOwnProperty("toVersion")&&!Ce.isInteger(e.toVersion)?"toVersion: integer expected":null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&!Ce.isInteger(e.fromVersion)?"fromVersion: integer expected":null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof e.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},e.fromObject=function(e){if(e instanceof Ee.RevisionDescriptor)return e;let t=new Ee.RevisionDescriptor;return null!=e.revisionId&&(t.revisionId=String(e.revisionId)),null!=e.name&&(t.name=String(e.name)),null!=e.creatorId&&(t.creatorId=String(e.creatorId)),null!=e.authorsIds&&(t.authorsIds=String(e.authorsIds)),null!=e.diffData&&(t.diffData=String(e.diffData)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.toVersion&&(t.toVersion=e.toVersion>>>0),null!=e.fromVersion&&(t.fromVersion=e.fromVersion>>>0),null!=e.isEmptyCurrent&&(t.isEmptyCurrent=Boolean(e.isEmptyCurrent)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.revisionId="",n.name="",n.creatorId="",n.authorsIds="",n.diffData="",n.createdAt="",n.attributes="",n.toVersion=0,n.fromVersion=0,n.isEmptyCurrent=!1),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.creatorId&&e.hasOwnProperty("creatorId")&&(n.creatorId=e.creatorId),null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&(n.authorsIds=e.authorsIds),null!=e.diffData&&e.hasOwnProperty("diffData")&&(n.diffData=e.diffData),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.toVersion&&e.hasOwnProperty("toVersion")&&(n.toVersion=e.toVersion),null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&(n.fromVersion=e.fromVersion),null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&(n.isEmptyCurrent=e.isEmptyCurrent),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionDescriptor"},e})(),Ee.RevisionHistoryConnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.RevisionHistoryConnectMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.documentId=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof Ee.RevisionHistoryConnectMessage)return e;let t=new Ee.RevisionHistoryConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryConnectMessage"},e})(),Ee.RevisionHistoryGetRevisionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.prototype.revisionId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(18).string(e.revisionId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.RevisionHistoryGetRevisionMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.documentId=e.string();break;case 2:r.revisionId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId)?"documentId: string expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!Ce.isString(e.revisionId)?"revisionId: string expected":null},e.fromObject=function(e){if(e instanceof Ee.RevisionHistoryGetRevisionMessage)return e;let t=new Ee.RevisionHistoryGetRevisionMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.revisionId&&(t.revisionId=String(e.revisionId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId="",n.revisionId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryGetRevisionMessage"},e})(),Ee.RevisionHistoryReconnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.prototype.requestId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.RevisionHistoryReconnectMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.documentId=e.string();break;case 2:r.requestId=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId)?"documentId: string expected":null!=e.requestId&&e.hasOwnProperty("requestId")&&!Ce.isInteger(e.requestId)?"requestId: integer expected":null},e.fromObject=function(e){if(e instanceof Ee.RevisionHistoryReconnectMessage)return e;let t=new Ee.RevisionHistoryReconnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.requestId&&(t.requestId=e.requestId>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId="",n.requestId=0),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryReconnectMessage"},e})(),Ee.RevisionHistoryUpdateRevisionsMessage=(()=>{function e(e){if(this.revisions=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.prototype.requestId=0,e.prototype.revisions=Ce.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),null!=e.revisions&&e.revisions.length)for(let n=0;n<e.revisions.length;++n)Ee.RevisionDescriptor.encode(e.revisions[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.RevisionHistoryUpdateRevisionsMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.documentId=e.string();break;case 2:r.requestId=e.uint32();break;case 3:r.revisions&&r.revisions.length||(r.revisions=[]),r.revisions.push(Ee.RevisionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId))return"documentId: string expected";if(null!=e.requestId&&e.hasOwnProperty("requestId")&&!Ce.isInteger(e.requestId))return"requestId: integer expected";if(null!=e.revisions&&e.hasOwnProperty("revisions")){if(!Array.isArray(e.revisions))return"revisions: array expected";for(let t=0;t<e.revisions.length;++t){let n=Ee.RevisionDescriptor.verify(e.revisions[t]);if(n)return"revisions."+n}}return null},e.fromObject=function(e){if(e instanceof Ee.RevisionHistoryUpdateRevisionsMessage)return e;let t=new Ee.RevisionHistoryUpdateRevisionsMessage;if(null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.requestId&&(t.requestId=e.requestId>>>0),e.revisions){if(!Array.isArray(e.revisions))throw TypeError(".RevisionHistoryUpdateRevisionsMessage.revisions: array expected");t.revisions=[];for(let n=0;n<e.revisions.length;++n){if("object"!=typeof e.revisions[n])throw TypeError(".RevisionHistoryUpdateRevisionsMessage.revisions: object expected");t.revisions[n]=Ee.RevisionDescriptor.fromObject(e.revisions[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.revisions=[]),t.defaults&&(n.documentId="",n.requestId=0),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),e.revisions&&e.revisions.length){n.revisions=[];for(let r=0;r<e.revisions.length;++r)n.revisions[r]=Ee.RevisionDescriptor.toObject(e.revisions[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryUpdateRevisionsMessage"},e})(),Ee.RevisionHistoryConnectResponse=(()=>{function e(e){if(this.revisions=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.channel="",e.prototype.requestId=0,e.prototype.revisions=Ce.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),null!=e.revisions&&e.revisions.length)for(let n=0;n<e.revisions.length;++n)Ee.RevisionDescriptor.encode(e.revisions[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.RevisionHistoryConnectResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.channel=e.string();break;case 2:r.requestId=e.uint32();break;case 3:r.revisions&&r.revisions.length||(r.revisions=[]),r.revisions.push(Ee.RevisionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!Ce.isString(e.channel))return"channel: string expected";if(null!=e.requestId&&e.hasOwnProperty("requestId")&&!Ce.isInteger(e.requestId))return"requestId: integer expected";if(null!=e.revisions&&e.hasOwnProperty("revisions")){if(!Array.isArray(e.revisions))return"revisions: array expected";for(let t=0;t<e.revisions.length;++t){let n=Ee.RevisionDescriptor.verify(e.revisions[t]);if(n)return"revisions."+n}}return null},e.fromObject=function(e){if(e instanceof Ee.RevisionHistoryConnectResponse)return e;let t=new Ee.RevisionHistoryConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),null!=e.requestId&&(t.requestId=e.requestId>>>0),e.revisions){if(!Array.isArray(e.revisions))throw TypeError(".RevisionHistoryConnectResponse.revisions: array expected");t.revisions=[];for(let n=0;n<e.revisions.length;++n){if("object"!=typeof e.revisions[n])throw TypeError(".RevisionHistoryConnectResponse.revisions: object expected");t.revisions[n]=Ee.RevisionDescriptor.fromObject(e.revisions[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.revisions=[]),t.defaults&&(n.channel="",n.requestId=0),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),e.revisions&&e.revisions.length){n.revisions=[];for(let r=0;r<e.revisions.length;++r)n.revisions[r]=Ee.RevisionDescriptor.toObject(e.revisions[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryConnectResponse"},e})(),Ee.RevisionHistoryGetRevisionResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.revisionId="",e.prototype.name="",e.prototype.creatorId="",e.prototype.authorsIds="",e.prototype.diffData="",e.prototype.createdAt="",e.prototype.attributes="",e.prototype.toVersion=0,e.prototype.fromVersion=0,e.prototype.isEmptyCurrent=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(10).string(e.revisionId),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(18).string(e.name),null!=e.creatorId&&Object.hasOwnProperty.call(e,"creatorId")&&t.uint32(26).string(e.creatorId),null!=e.authorsIds&&Object.hasOwnProperty.call(e,"authorsIds")&&t.uint32(34).string(e.authorsIds),null!=e.diffData&&Object.hasOwnProperty.call(e,"diffData")&&t.uint32(42).string(e.diffData),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.toVersion&&Object.hasOwnProperty.call(e,"toVersion")&&t.uint32(64).uint32(e.toVersion),null!=e.fromVersion&&Object.hasOwnProperty.call(e,"fromVersion")&&t.uint32(72).uint32(e.fromVersion),null!=e.isEmptyCurrent&&Object.hasOwnProperty.call(e,"isEmptyCurrent")&&t.uint32(80).bool(e.isEmptyCurrent),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.RevisionHistoryGetRevisionResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.revisionId=e.string();break;case 2:r.name=e.string();break;case 3:r.creatorId=e.string();break;case 4:r.authorsIds=e.string();break;case 5:r.diffData=e.string();break;case 6:r.createdAt=e.string();break;case 7:r.attributes=e.string();break;case 8:r.toVersion=e.uint32();break;case 9:r.fromVersion=e.uint32();break;case 10:r.isEmptyCurrent=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!Ce.isString(e.revisionId)?"revisionId: string expected":null!=e.name&&e.hasOwnProperty("name")&&!Ce.isString(e.name)?"name: string expected":null!=e.creatorId&&e.hasOwnProperty("creatorId")&&!Ce.isString(e.creatorId)?"creatorId: string expected":null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&!Ce.isString(e.authorsIds)?"authorsIds: string expected":null!=e.diffData&&e.hasOwnProperty("diffData")&&!Ce.isString(e.diffData)?"diffData: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ce.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ce.isString(e.attributes)?"attributes: string expected":null!=e.toVersion&&e.hasOwnProperty("toVersion")&&!Ce.isInteger(e.toVersion)?"toVersion: integer expected":null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&!Ce.isInteger(e.fromVersion)?"fromVersion: integer expected":null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof e.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},e.fromObject=function(e){if(e instanceof Ee.RevisionHistoryGetRevisionResponse)return e;let t=new Ee.RevisionHistoryGetRevisionResponse;return null!=e.revisionId&&(t.revisionId=String(e.revisionId)),null!=e.name&&(t.name=String(e.name)),null!=e.creatorId&&(t.creatorId=String(e.creatorId)),null!=e.authorsIds&&(t.authorsIds=String(e.authorsIds)),null!=e.diffData&&(t.diffData=String(e.diffData)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.toVersion&&(t.toVersion=e.toVersion>>>0),null!=e.fromVersion&&(t.fromVersion=e.fromVersion>>>0),null!=e.isEmptyCurrent&&(t.isEmptyCurrent=Boolean(e.isEmptyCurrent)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.revisionId="",n.name="",n.creatorId="",n.authorsIds="",n.diffData="",n.createdAt="",n.attributes="",n.toVersion=0,n.fromVersion=0,n.isEmptyCurrent=!1),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.creatorId&&e.hasOwnProperty("creatorId")&&(n.creatorId=e.creatorId),null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&(n.authorsIds=e.authorsIds),null!=e.diffData&&e.hasOwnProperty("diffData")&&(n.diffData=e.diffData),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.toVersion&&e.hasOwnProperty("toVersion")&&(n.toVersion=e.toVersion),null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&(n.fromVersion=e.fromVersion),null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&(n.isEmptyCurrent=e.isEmptyCurrent),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryGetRevisionResponse"},e})(),Ee.RevisionHistoryUpdateRevisionsResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.requestId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(8).uint32(e.requestId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.RevisionHistoryUpdateRevisionsResponse;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.requestId=e.uint32():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.requestId&&e.hasOwnProperty("requestId")&&!Ce.isInteger(e.requestId)?"requestId: integer expected":null},e.fromObject=function(e){if(e instanceof Ee.RevisionHistoryUpdateRevisionsResponse)return e;let t=new Ee.RevisionHistoryUpdateRevisionsResponse;return null!=e.requestId&&(t.requestId=e.requestId>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.requestId=0),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryUpdateRevisionsResponse"},e})(),Ee.SessionsSocketDescriptor=(()=>{function e(e){if(this.permissions=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.session="",e.prototype.user="",e.prototype.role="",e.prototype.permissions=Ce.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.session&&Object.hasOwnProperty.call(e,"session")&&t.uint32(10).string(e.session),null!=e.user&&Object.hasOwnProperty.call(e,"user")&&t.uint32(18).string(e.user),null!=e.role&&Object.hasOwnProperty.call(e,"role")&&t.uint32(26).string(e.role),null!=e.permissions&&e.permissions.length)for(let n=0;n<e.permissions.length;++n)t.uint32(34).string(e.permissions[n]);return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.SessionsSocketDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.session=e.string();break;case 2:r.user=e.string();break;case 3:r.role=e.string();break;case 4:r.permissions&&r.permissions.length||(r.permissions=[]),r.permissions.push(e.string());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.session&&e.hasOwnProperty("session")&&!Ce.isString(e.session))return"session: string expected";if(null!=e.user&&e.hasOwnProperty("user")&&!Ce.isString(e.user))return"user: string expected";if(null!=e.role&&e.hasOwnProperty("role")&&!Ce.isString(e.role))return"role: string expected";if(null!=e.permissions&&e.hasOwnProperty("permissions")){if(!Array.isArray(e.permissions))return"permissions: array expected";for(let t=0;t<e.permissions.length;++t)if(!Ce.isString(e.permissions[t]))return"permissions: string[] expected"}return null},e.fromObject=function(e){if(e instanceof Ee.SessionsSocketDescriptor)return e;let t=new Ee.SessionsSocketDescriptor;if(null!=e.session&&(t.session=String(e.session)),null!=e.user&&(t.user=String(e.user)),null!=e.role&&(t.role=String(e.role)),e.permissions){if(!Array.isArray(e.permissions))throw TypeError(".SessionsSocketDescriptor.permissions: array expected");t.permissions=[];for(let n=0;n<e.permissions.length;++n)t.permissions[n]=String(e.permissions[n])}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.permissions=[]),t.defaults&&(n.session="",n.user="",n.role=""),null!=e.session&&e.hasOwnProperty("session")&&(n.session=e.session),null!=e.user&&e.hasOwnProperty("user")&&(n.user=e.user),null!=e.role&&e.hasOwnProperty("role")&&(n.role=e.role),e.permissions&&e.permissions.length){n.permissions=[];for(let t=0;t<e.permissions.length;++t)n.permissions[t]=e.permissions[t]}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsSocketDescriptor"},e})(),Ee.SessionsConnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.sessionType=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.sessionType&&Object.hasOwnProperty.call(e,"sessionType")&&t.uint32(16).uint32(e.sessionType),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.SessionsConnectMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.sessionType=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ce.isString(e.id)?"id: string expected":null!=e.sessionType&&e.hasOwnProperty("sessionType")&&!Ce.isInteger(e.sessionType)?"sessionType: integer expected":null},e.fromObject=function(e){if(e instanceof Ee.SessionsConnectMessage)return e;let t=new Ee.SessionsConnectMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.sessionType&&(t.sessionType=e.sessionType>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.sessionType=0),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.sessionType&&e.hasOwnProperty("sessionType")&&(n.sessionType=e.sessionType),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsConnectMessage"},e})(),Ee.SocketConnectMessage=(()=>{function e(e){if(this.permissions=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.userId="",e.prototype.role="",e.prototype.permissions=Ce.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),null!=e.role&&Object.hasOwnProperty.call(e,"role")&&t.uint32(26).string(e.role),null!=e.permissions&&e.permissions.length)for(let n=0;n<e.permissions.length;++n)t.uint32(34).string(e.permissions[n]);return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.SocketConnectMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.userId=e.string();break;case 3:r.role=e.string();break;case 4:r.permissions&&r.permissions.length||(r.permissions=[]),r.permissions.push(e.string());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!Ce.isString(e.id))return"id: string expected";if(null!=e.userId&&e.hasOwnProperty("userId")&&!Ce.isString(e.userId))return"userId: string expected";if(null!=e.role&&e.hasOwnProperty("role")&&!Ce.isString(e.role))return"role: string expected";if(null!=e.permissions&&e.hasOwnProperty("permissions")){if(!Array.isArray(e.permissions))return"permissions: array expected";for(let t=0;t<e.permissions.length;++t)if(!Ce.isString(e.permissions[t]))return"permissions: string[] expected"}return null},e.fromObject=function(e){if(e instanceof Ee.SocketConnectMessage)return e;let t=new Ee.SocketConnectMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.role&&(t.role=String(e.role)),e.permissions){if(!Array.isArray(e.permissions))throw TypeError(".SocketConnectMessage.permissions: array expected");t.permissions=[];for(let n=0;n<e.permissions.length;++n)t.permissions[n]=String(e.permissions[n])}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.permissions=[]),t.defaults&&(n.id="",n.userId="",n.role=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.role&&e.hasOwnProperty("role")&&(n.role=e.role),e.permissions&&e.permissions.length){n.permissions=[];for(let t=0;t<e.permissions.length;++t)n.permissions[t]=e.permissions[t]}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SocketConnectMessage"},e})(),Ee.SocketDisconnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.SocketDisconnectMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.id=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ce.isString(e.id)?"id: string expected":null},e.fromObject=function(e){if(e instanceof Ee.SocketDisconnectMessage)return e;let t=new Ee.SocketDisconnectMessage;return null!=e.id&&(t.id=String(e.id)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SocketDisconnectMessage"},e})(),Ee.SessionsConnectResponse=(()=>{function e(e){if(this.sockets=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.channel="",e.prototype.sockets=Ce.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.sockets&&e.sockets.length)for(let n=0;n<e.sockets.length;++n)Ee.SessionsSocketDescriptor.encode(e.sockets[n],t.uint32(18).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.SessionsConnectResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.channel=e.string();break;case 2:r.sockets&&r.sockets.length||(r.sockets=[]),r.sockets.push(Ee.SessionsSocketDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!Ce.isString(e.channel))return"channel: string expected";if(null!=e.sockets&&e.hasOwnProperty("sockets")){if(!Array.isArray(e.sockets))return"sockets: array expected";for(let t=0;t<e.sockets.length;++t){let n=Ee.SessionsSocketDescriptor.verify(e.sockets[t]);if(n)return"sockets."+n}}return null},e.fromObject=function(e){if(e instanceof Ee.SessionsConnectResponse)return e;let t=new Ee.SessionsConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.sockets){if(!Array.isArray(e.sockets))throw TypeError(".SessionsConnectResponse.sockets: array expected");t.sockets=[];for(let n=0;n<e.sockets.length;++n){if("object"!=typeof e.sockets[n])throw TypeError(".SessionsConnectResponse.sockets: object expected");t.sockets[n]=Ee.SessionsSocketDescriptor.fromObject(e.sockets[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.sockets=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.sockets&&e.sockets.length){n.sockets=[];for(let r=0;r<e.sockets.length;++r)n.sockets[r]=Ee.SessionsSocketDescriptor.toObject(e.sockets[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsConnectResponse"},e})(),Ee.SuggestionDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.authorId="",e.prototype.type="",e.prototype.createdAt="",e.prototype.data="",e.prototype.hasComments=!1,e.prototype.state="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.SuggestionDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.authorId=e.string();break;case 3:r.type=e.string();break;case 4:r.createdAt=e.string();break;case 5:r.data=e.string();break;case 6:r.hasComments=e.bool();break;case 7:r.state=e.string();break;case 8:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ce.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!Ce.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!Ce.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ce.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!Ce.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!Ce.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ce.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof Ee.SuggestionDescriptor)return e;let t=new Ee.SuggestionDescriptor;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SuggestionDescriptor"},e})(),Ee.TrackChangesAddSuggestionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.documentId="",e.prototype.type="",e.prototype.data="",e.prototype.originalSuggestionId="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(34).string(e.data),null!=e.originalSuggestionId&&Object.hasOwnProperty.call(e,"originalSuggestionId")&&t.uint32(42).string(e.originalSuggestionId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(50).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.TrackChangesAddSuggestionMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.documentId=e.string();break;case 3:r.type=e.string();break;case 4:r.data=e.string();break;case 5:r.originalSuggestionId=e.string();break;case 6:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ce.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId)?"documentId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!Ce.isString(e.type)?"type: string expected":null!=e.data&&e.hasOwnProperty("data")&&!Ce.isString(e.data)?"data: string expected":null!=e.originalSuggestionId&&e.hasOwnProperty("originalSuggestionId")&&!Ce.isString(e.originalSuggestionId)?"originalSuggestionId: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ce.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof Ee.TrackChangesAddSuggestionMessage)return e;let t=new Ee.TrackChangesAddSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.type&&(t.type=String(e.type)),null!=e.data&&(t.data=String(e.data)),null!=e.originalSuggestionId&&(t.originalSuggestionId=String(e.originalSuggestionId)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.documentId="",n.type="",n.data="",n.originalSuggestionId="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.originalSuggestionId&&e.hasOwnProperty("originalSuggestionId")&&(n.originalSuggestionId=e.originalSuggestionId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesAddSuggestionMessage"},e})(),Ee.TrackChangesBatchUpdateSuggestionsStateMessage=(()=>{function e(e){if(this.ids=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.ids=Ce.emptyArray,e.prototype.documentId="",e.prototype.state="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.ids&&e.ids.length)for(let n=0;n<e.ids.length;++n)t.uint32(10).string(e.ids[n]);return null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(26).string(e.state),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.TrackChangesBatchUpdateSuggestionsStateMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.ids&&r.ids.length||(r.ids=[]),r.ids.push(e.string());break;case 2:r.documentId=e.string();break;case 3:r.state=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.ids&&e.hasOwnProperty("ids")){if(!Array.isArray(e.ids))return"ids: array expected";for(let t=0;t<e.ids.length;++t)if(!Ce.isString(e.ids[t]))return"ids: string[] expected"}return null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId)?"documentId: string expected":null!=e.state&&e.hasOwnProperty("state")&&!Ce.isString(e.state)?"state: string expected":null},e.fromObject=function(e){if(e instanceof Ee.TrackChangesBatchUpdateSuggestionsStateMessage)return e;let t=new Ee.TrackChangesBatchUpdateSuggestionsStateMessage;if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".TrackChangesBatchUpdateSuggestionsStateMessage.ids: array expected");t.ids=[];for(let n=0;n<e.ids.length;++n)t.ids[n]=String(e.ids[n])}return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.state&&(t.state=String(e.state)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.ids=[]),t.defaults&&(n.documentId="",n.state=""),e.ids&&e.ids.length){n.ids=[];for(let t=0;t<e.ids.length;++t)n.ids[t]=e.ids[t]}return null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesBatchUpdateSuggestionsStateMessage"},e})(),Ee.TrackChangesConnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.TrackChangesConnectMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.documentId=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof Ee.TrackChangesConnectMessage)return e;let t=new Ee.TrackChangesConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesConnectMessage"},e})(),Ee.TrackChangesGetAllSuggestionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.TrackChangesGetAllSuggestionMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.documentId=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof Ee.TrackChangesGetAllSuggestionMessage)return e;let t=new Ee.TrackChangesGetAllSuggestionMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetAllSuggestionMessage"},e})(),Ee.TrackChangesGetSuggestionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.TrackChangesGetSuggestionMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.documentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ce.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof Ee.TrackChangesGetSuggestionMessage)return e;let t=new Ee.TrackChangesGetSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.documentId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetSuggestionMessage"},e})(),Ee.TrackChangesUpdateSuggestionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.documentId="",e.prototype.hasComments=!1,e.prototype.isHasCommentsModified=!1,e.prototype.state="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(24).bool(e.hasComments),null!=e.isHasCommentsModified&&Object.hasOwnProperty.call(e,"isHasCommentsModified")&&t.uint32(32).bool(e.isHasCommentsModified),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(42).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(50).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.TrackChangesUpdateSuggestionMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.documentId=e.string();break;case 3:r.hasComments=e.bool();break;case 4:r.isHasCommentsModified=e.bool();break;case 5:r.state=e.string();break;case 6:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ce.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ce.isString(e.documentId)?"documentId: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.isHasCommentsModified&&e.hasOwnProperty("isHasCommentsModified")&&"boolean"!=typeof e.isHasCommentsModified?"isHasCommentsModified: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!Ce.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ce.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof Ee.TrackChangesUpdateSuggestionMessage)return e;let t=new Ee.TrackChangesUpdateSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.isHasCommentsModified&&(t.isHasCommentsModified=Boolean(e.isHasCommentsModified)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.documentId="",n.hasComments=!1,n.isHasCommentsModified=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.isHasCommentsModified&&e.hasOwnProperty("isHasCommentsModified")&&(n.isHasCommentsModified=e.isHasCommentsModified),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesUpdateSuggestionMessage"},e})(),Ee.TrackChangesAddSuggestionResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.authorId="",e.prototype.type="",e.prototype.createdAt="",e.prototype.data="",e.prototype.hasComments=!1,e.prototype.state="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.TrackChangesAddSuggestionResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.authorId=e.string();break;case 3:r.type=e.string();break;case 4:r.createdAt=e.string();break;case 5:r.data=e.string();break;case 6:r.hasComments=e.bool();break;case 7:r.state=e.string();break;case 8:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ce.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!Ce.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!Ce.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ce.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!Ce.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!Ce.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ce.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof Ee.TrackChangesAddSuggestionResponse)return e;let t=new Ee.TrackChangesAddSuggestionResponse;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesAddSuggestionResponse"},e})(),Ee.TrackChangesConnectResponse=(()=>{function e(e){if(this.suggestions=[],this.suggestionsV2=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.channel="",e.prototype.suggestions=Ce.emptyArray,e.prototype.suggestionsV2=Ce.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.suggestions&&e.suggestions.length)for(let n=0;n<e.suggestions.length;++n)t.uint32(18).string(e.suggestions[n]);if(null!=e.suggestionsV2&&e.suggestionsV2.length)for(let n=0;n<e.suggestionsV2.length;++n)Ee.SuggestionDescriptor.encode(e.suggestionsV2[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.TrackChangesConnectResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.channel=e.string();break;case 2:r.suggestions&&r.suggestions.length||(r.suggestions=[]),r.suggestions.push(e.string());break;case 3:r.suggestionsV2&&r.suggestionsV2.length||(r.suggestionsV2=[]),r.suggestionsV2.push(Ee.SuggestionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!Ce.isString(e.channel))return"channel: string expected";if(null!=e.suggestions&&e.hasOwnProperty("suggestions")){if(!Array.isArray(e.suggestions))return"suggestions: array expected";for(let t=0;t<e.suggestions.length;++t)if(!Ce.isString(e.suggestions[t]))return"suggestions: string[] expected"}if(null!=e.suggestionsV2&&e.hasOwnProperty("suggestionsV2")){if(!Array.isArray(e.suggestionsV2))return"suggestionsV2: array expected";for(let t=0;t<e.suggestionsV2.length;++t){let n=Ee.SuggestionDescriptor.verify(e.suggestionsV2[t]);if(n)return"suggestionsV2."+n}}return null},e.fromObject=function(e){if(e instanceof Ee.TrackChangesConnectResponse)return e;let t=new Ee.TrackChangesConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.suggestions){if(!Array.isArray(e.suggestions))throw TypeError(".TrackChangesConnectResponse.suggestions: array expected");t.suggestions=[];for(let n=0;n<e.suggestions.length;++n)t.suggestions[n]=String(e.suggestions[n])}if(e.suggestionsV2){if(!Array.isArray(e.suggestionsV2))throw TypeError(".TrackChangesConnectResponse.suggestionsV2: array expected");t.suggestionsV2=[];for(let n=0;n<e.suggestionsV2.length;++n){if("object"!=typeof e.suggestionsV2[n])throw TypeError(".TrackChangesConnectResponse.suggestionsV2: object expected");t.suggestionsV2[n]=Ee.SuggestionDescriptor.fromObject(e.suggestionsV2[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.suggestions=[],n.suggestionsV2=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.suggestions&&e.suggestions.length){n.suggestions=[];for(let t=0;t<e.suggestions.length;++t)n.suggestions[t]=e.suggestions[t]}if(e.suggestionsV2&&e.suggestionsV2.length){n.suggestionsV2=[];for(let r=0;r<e.suggestionsV2.length;++r)n.suggestionsV2[r]=Ee.SuggestionDescriptor.toObject(e.suggestionsV2[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesConnectResponse"},e})(),Ee.TrackChangesGetAllSuggestionsResponse=(()=>{function e(e){if(this.suggestions=[],this.suggestionsV2=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.suggestions=Ce.emptyArray,e.prototype.suggestionsV2=Ce.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.suggestions&&e.suggestions.length)for(let n=0;n<e.suggestions.length;++n)t.uint32(10).string(e.suggestions[n]);if(null!=e.suggestionsV2&&e.suggestionsV2.length)for(let n=0;n<e.suggestionsV2.length;++n)Ee.SuggestionDescriptor.encode(e.suggestionsV2[n],t.uint32(18).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.TrackChangesGetAllSuggestionsResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.suggestions&&r.suggestions.length||(r.suggestions=[]),r.suggestions.push(e.string());break;case 2:r.suggestionsV2&&r.suggestionsV2.length||(r.suggestionsV2=[]),r.suggestionsV2.push(Ee.SuggestionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.suggestions&&e.hasOwnProperty("suggestions")){if(!Array.isArray(e.suggestions))return"suggestions: array expected";for(let t=0;t<e.suggestions.length;++t)if(!Ce.isString(e.suggestions[t]))return"suggestions: string[] expected"}if(null!=e.suggestionsV2&&e.hasOwnProperty("suggestionsV2")){if(!Array.isArray(e.suggestionsV2))return"suggestionsV2: array expected";for(let t=0;t<e.suggestionsV2.length;++t){let n=Ee.SuggestionDescriptor.verify(e.suggestionsV2[t]);if(n)return"suggestionsV2."+n}}return null},e.fromObject=function(e){if(e instanceof Ee.TrackChangesGetAllSuggestionsResponse)return e;let t=new Ee.TrackChangesGetAllSuggestionsResponse;if(e.suggestions){if(!Array.isArray(e.suggestions))throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestions: array expected");t.suggestions=[];for(let n=0;n<e.suggestions.length;++n)t.suggestions[n]=String(e.suggestions[n])}if(e.suggestionsV2){if(!Array.isArray(e.suggestionsV2))throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestionsV2: array expected");t.suggestionsV2=[];for(let n=0;n<e.suggestionsV2.length;++n){if("object"!=typeof e.suggestionsV2[n])throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestionsV2: object expected");t.suggestionsV2[n]=Ee.SuggestionDescriptor.fromObject(e.suggestionsV2[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.suggestions=[],n.suggestionsV2=[]),e.suggestions&&e.suggestions.length){n.suggestions=[];for(let t=0;t<e.suggestions.length;++t)n.suggestions[t]=e.suggestions[t]}if(e.suggestionsV2&&e.suggestionsV2.length){n.suggestionsV2=[];for(let r=0;r<e.suggestionsV2.length;++r)n.suggestionsV2[r]=Ee.SuggestionDescriptor.toObject(e.suggestionsV2[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetAllSuggestionsResponse"},e})(),Ee.TrackChangesGetSuggestionResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.authorId="",e.prototype.type="",e.prototype.createdAt="",e.prototype.data="",e.prototype.hasComments=!1,e.prototype.state="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.TrackChangesGetSuggestionResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.authorId=e.string();break;case 3:r.type=e.string();break;case 4:r.createdAt=e.string();break;case 5:r.data=e.string();break;case 6:r.hasComments=e.bool();break;case 7:r.state=e.string();break;case 8:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ce.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!Ce.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!Ce.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ce.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!Ce.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!Ce.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ce.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof Ee.TrackChangesGetSuggestionResponse)return e;let t=new Ee.TrackChangesGetSuggestionResponse;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetSuggestionResponse"},e})(),Ee.UserDescriptor=(()=>{function e(e){if(this.attributes=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.attributes=Ce.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.attributes&&e.attributes.length)for(let n=0;n<e.attributes.length;++n)Ee.KeyValueDescriptor.encode(e.attributes[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.UserDescriptor;for(;e.pos<n;){let t=e.uint32();t>>>3==1?(r.attributes&&r.attributes.length||(r.attributes=[]),r.attributes.push(Ee.KeyValueDescriptor.decode(e,e.uint32()))):e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")){if(!Array.isArray(e.attributes))return"attributes: array expected";for(let t=0;t<e.attributes.length;++t){let n=Ee.KeyValueDescriptor.verify(e.attributes[t]);if(n)return"attributes."+n}}return null},e.fromObject=function(e){if(e instanceof Ee.UserDescriptor)return e;let t=new Ee.UserDescriptor;if(e.attributes){if(!Array.isArray(e.attributes))throw TypeError(".UserDescriptor.attributes: array expected");t.attributes=[];for(let n=0;n<e.attributes.length;++n){if("object"!=typeof e.attributes[n])throw TypeError(".UserDescriptor.attributes: object expected");t.attributes[n]=Ee.KeyValueDescriptor.fromObject(e.attributes[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.attributes=[]),e.attributes&&e.attributes.length){n.attributes=[];for(let r=0;r<e.attributes.length;++r)n.attributes[r]=Ee.KeyValueDescriptor.toObject(e.attributes[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/UserDescriptor"},e})(),Ee.GetManyUsersMessage=(()=>{function e(e){if(this.ids=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.ids=Ce.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.ids&&e.ids.length)for(let n=0;n<e.ids.length;++n)t.uint32(10).string(e.ids[n]);return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.GetManyUsersMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?(r.ids&&r.ids.length||(r.ids=[]),r.ids.push(e.string())):e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.ids&&e.hasOwnProperty("ids")){if(!Array.isArray(e.ids))return"ids: array expected";for(let t=0;t<e.ids.length;++t)if(!Ce.isString(e.ids[t]))return"ids: string[] expected"}return null},e.fromObject=function(e){if(e instanceof Ee.GetManyUsersMessage)return e;let t=new Ee.GetManyUsersMessage;if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".GetManyUsersMessage.ids: array expected");t.ids=[];for(let n=0;n<e.ids.length;++n)t.ids[n]=String(e.ids[n])}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.ids=[]),e.ids&&e.ids.length){n.ids=[];for(let t=0;t<e.ids.length;++t)n.ids[t]=e.ids[t]}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetManyUsersMessage"},e})(),Ee.GetUserMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.GetUserMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.id=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ce.isString(e.id)?"id: string expected":null},e.fromObject=function(e){if(e instanceof Ee.GetUserMessage)return e;let t=new Ee.GetUserMessage;return null!=e.id&&(t.id=String(e.id)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetUserMessage"},e})(),Ee.GetManyUsersResponse=(()=>{function e(e){if(this.users=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.users=Ce.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.users&&e.users.length)for(let n=0;n<e.users.length;++n)Ee.UserDescriptor.encode(e.users[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.GetManyUsersResponse;for(;e.pos<n;){let t=e.uint32();t>>>3==1?(r.users&&r.users.length||(r.users=[]),r.users.push(Ee.UserDescriptor.decode(e,e.uint32()))):e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.users&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let t=0;t<e.users.length;++t){let n=Ee.UserDescriptor.verify(e.users[t]);if(n)return"users."+n}}return null},e.fromObject=function(e){if(e instanceof Ee.GetManyUsersResponse)return e;let t=new Ee.GetManyUsersResponse;if(e.users){if(!Array.isArray(e.users))throw TypeError(".GetManyUsersResponse.users: array expected");t.users=[];for(let n=0;n<e.users.length;++n){if("object"!=typeof e.users[n])throw TypeError(".GetManyUsersResponse.users: object expected");t.users[n]=Ee.UserDescriptor.fromObject(e.users[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.users=[]),e.users&&e.users.length){n.users=[];for(let r=0;r<e.users.length;++r)n.users[r]=Ee.UserDescriptor.toObject(e.users[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetManyUsersResponse"},e})(),Ee.GetUserResponse=(()=>{function e(e){if(this.attributes=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.attributes=Ce.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.attributes&&e.attributes.length)for(let n=0;n<e.attributes.length;++n)Ee.KeyValueDescriptor.encode(e.attributes[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.GetUserResponse;for(;e.pos<n;){let t=e.uint32();t>>>3==1?(r.attributes&&r.attributes.length||(r.attributes=[]),r.attributes.push(Ee.KeyValueDescriptor.decode(e,e.uint32()))):e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")){if(!Array.isArray(e.attributes))return"attributes: array expected";for(let t=0;t<e.attributes.length;++t){let n=Ee.KeyValueDescriptor.verify(e.attributes[t]);if(n)return"attributes."+n}}return null},e.fromObject=function(e){if(e instanceof Ee.GetUserResponse)return e;let t=new Ee.GetUserResponse;if(e.attributes){if(!Array.isArray(e.attributes))throw TypeError(".GetUserResponse.attributes: array expected");t.attributes=[];for(let n=0;n<e.attributes.length;++n){if("object"!=typeof e.attributes[n])throw TypeError(".GetUserResponse.attributes: object expected");t.attributes[n]=Ee.KeyValueDescriptor.fromObject(e.attributes[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.attributes=[]),e.attributes&&e.attributes.length){n.attributes=[];for(let r=0;r<e.attributes.length;++r)n.attributes[r]=Ee.KeyValueDescriptor.toObject(e.attributes[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetUserResponse"},e})(),Ee.ChannelMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.type=0,e.prototype.socketId="",e.prototype.data=Ce.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).uint32(e.type),null!=e.socketId&&Object.hasOwnProperty.call(e,"socketId")&&t.uint32(18).string(e.socketId),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(26).bytes(e.data),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.ChannelMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.type=e.uint32();break;case 2:r.socketId=e.string();break;case 3:r.data=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!Ce.isInteger(e.type)?"type: integer expected":null!=e.socketId&&e.hasOwnProperty("socketId")&&!Ce.isString(e.socketId)?"socketId: string expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||Ce.isString(e.data))?"data: buffer expected":null},e.fromObject=function(e){if(e instanceof Ee.ChannelMessage)return e;let t=new Ee.ChannelMessage;return null!=e.type&&(t.type=e.type>>>0),null!=e.socketId&&(t.socketId=String(e.socketId)),null!=e.data&&("string"==typeof e.data?Ce.base64.decode(e.data,t.data=Ce.newBuffer(Ce.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.type=0,n.socketId="",t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=Ce.newBuffer(n.data)))),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.socketId&&e.hasOwnProperty("socketId")&&(n.socketId=e.socketId),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?Ce.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ChannelMessage"},e})(),Ee.BytesBytesPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=Ce.newBuffer([]),e.prototype.data1=Ce.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).bytes(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.BytesBytesPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.bytes();break;case 2:r.data1=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||Ce.isString(e.data))?"data: buffer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||Ce.isString(e.data1))?"data1: buffer expected":null},e.fromObject=function(e){if(e instanceof Ee.BytesBytesPacketDataMessage)return e;let t=new Ee.BytesBytesPacketDataMessage;return null!=e.data&&("string"==typeof e.data?Ce.base64.decode(e.data,t.data=Ce.newBuffer(Ce.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),null!=e.data1&&("string"==typeof e.data1?Ce.base64.decode(e.data1,t.data1=Ce.newBuffer(Ce.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=Ce.newBuffer(n.data))),t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=Ce.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?Ce.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?Ce.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/BytesBytesPacketDataMessage"},e})(),Ee.NumberBytesPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=0,e.prototype.data1=Ce.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.NumberBytesPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.uint32();break;case 2:r.data1=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ce.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||Ce.isString(e.data1))?"data1: buffer expected":null},e.fromObject=function(e){if(e instanceof Ee.NumberBytesPacketDataMessage)return e;let t=new Ee.NumberBytesPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&("string"==typeof e.data1?Ce.base64.decode(e.data1,t.data1=Ce.newBuffer(Ce.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data=0,t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=Ce.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?Ce.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberBytesPacketDataMessage"},e})(),Ee.NumberNumberPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=0,e.prototype.data1=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(16).uint32(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.NumberNumberPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.uint32();break;case 2:r.data1=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ce.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ce.isInteger(e.data1)?"data1: integer expected":null},e.fromObject=function(e){if(e instanceof Ee.NumberNumberPacketDataMessage)return e;let t=new Ee.NumberNumberPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=e.data1>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data=0,n.data1=0),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberNumberPacketDataMessage"},e})(),Ee.NumberObjectPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=0,e.prototype.data1="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.NumberObjectPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.uint32();break;case 2:r.data1=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ce.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ce.isString(e.data1)?"data1: string expected":null},e.fromObject=function(e){if(e instanceof Ee.NumberObjectPacketDataMessage)return e;let t=new Ee.NumberObjectPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=String(e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data=0,n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberObjectPacketDataMessage"},e})(),Ee.NumberStringPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=0,e.prototype.data1="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.NumberStringPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.uint32();break;case 2:r.data1=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ce.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ce.isString(e.data1)?"data1: string expected":null},e.fromObject=function(e){if(e instanceof Ee.NumberStringPacketDataMessage)return e;let t=new Ee.NumberStringPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=String(e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data=0,n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberStringPacketDataMessage"},e})(),Ee.ObjectBufferPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1=Ce.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.ObjectBufferPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ce.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||Ce.isString(e.data1))?"data1: buffer expected":null},e.fromObject=function(e){if(e instanceof Ee.ObjectBufferPacketDataMessage)return e;let t=new Ee.ObjectBufferPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&("string"==typeof e.data1?Ce.base64.decode(e.data1,t.data1=Ce.newBuffer(Ce.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=Ce.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?Ce.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ObjectBufferPacketDataMessage"},e})(),Ee.ObjectObjectPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.ObjectObjectPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ce.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ce.isString(e.data1)?"data1: string expected":null},e.fromObject=function(e){if(e instanceof Ee.ObjectObjectPacketDataMessage)return e;let t=new Ee.ObjectObjectPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ObjectObjectPacketDataMessage"},e})(),Ee.PacketMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.type=0,e.prototype.id=0,e.prototype.nsp="",e.prototype.data=Ce.newBuffer([]),e.prototype.options=Ce.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).uint32(e.type),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(16).uint32(e.id),null!=e.nsp&&Object.hasOwnProperty.call(e,"nsp")&&t.uint32(26).string(e.nsp),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(34).bytes(e.data),null!=e.options&&Object.hasOwnProperty.call(e,"options")&&t.uint32(42).bytes(e.options),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.PacketMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.type=e.uint32();break;case 2:r.id=e.uint32();break;case 3:r.nsp=e.string();break;case 4:r.data=e.bytes();break;case 5:r.options=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!Ce.isInteger(e.type)?"type: integer expected":null!=e.id&&e.hasOwnProperty("id")&&!Ce.isInteger(e.id)?"id: integer expected":null!=e.nsp&&e.hasOwnProperty("nsp")&&!Ce.isString(e.nsp)?"nsp: string expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||Ce.isString(e.data))?"data: buffer expected":null!=e.options&&e.hasOwnProperty("options")&&!(e.options&&"number"==typeof e.options.length||Ce.isString(e.options))?"options: buffer expected":null},e.fromObject=function(e){if(e instanceof Ee.PacketMessage)return e;let t=new Ee.PacketMessage;return null!=e.type&&(t.type=e.type>>>0),null!=e.id&&(t.id=e.id>>>0),null!=e.nsp&&(t.nsp=String(e.nsp)),null!=e.data&&("string"==typeof e.data?Ce.base64.decode(e.data,t.data=Ce.newBuffer(Ce.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),null!=e.options&&("string"==typeof e.options?Ce.base64.decode(e.options,t.options=Ce.newBuffer(Ce.base64.length(e.options)),0):e.options.length>=0&&(t.options=e.options)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.type=0,n.id=0,n.nsp="",t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=Ce.newBuffer(n.data))),t.bytes===String?n.options="":(n.options=[],t.bytes!==Array&&(n.options=Ce.newBuffer(n.options)))),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.nsp&&e.hasOwnProperty("nsp")&&(n.nsp=e.nsp),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?Ce.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),null!=e.options&&e.hasOwnProperty("options")&&(n.options=t.bytes===String?Ce.base64.encode(e.options,0,e.options.length):t.bytes===Array?Array.prototype.slice.call(e.options):e.options),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/PacketMessage"},e})(),Ee.PacketOptionsMessage=(()=>{function e(e){if(this.rooms=[],this.except=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.flags="",e.prototype.rooms=Ce.emptyArray,e.prototype.except=Ce.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ke.create()),null!=e.flags&&Object.hasOwnProperty.call(e,"flags")&&t.uint32(10).string(e.flags),null!=e.rooms&&e.rooms.length)for(let n=0;n<e.rooms.length;++n)t.uint32(18).string(e.rooms[n]);if(null!=e.except&&e.except.length)for(let n=0;n<e.except.length;++n)t.uint32(26).string(e.except[n]);return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.PacketOptionsMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.flags=e.string();break;case 2:r.rooms&&r.rooms.length||(r.rooms=[]),r.rooms.push(e.string());break;case 3:r.except&&r.except.length||(r.except=[]),r.except.push(e.string());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.flags&&e.hasOwnProperty("flags")&&!Ce.isString(e.flags))return"flags: string expected";if(null!=e.rooms&&e.hasOwnProperty("rooms")){if(!Array.isArray(e.rooms))return"rooms: array expected";for(let t=0;t<e.rooms.length;++t)if(!Ce.isString(e.rooms[t]))return"rooms: string[] expected"}if(null!=e.except&&e.hasOwnProperty("except")){if(!Array.isArray(e.except))return"except: array expected";for(let t=0;t<e.except.length;++t)if(!Ce.isString(e.except[t]))return"except: string[] expected"}return null},e.fromObject=function(e){if(e instanceof Ee.PacketOptionsMessage)return e;let t=new Ee.PacketOptionsMessage;if(null!=e.flags&&(t.flags=String(e.flags)),e.rooms){if(!Array.isArray(e.rooms))throw TypeError(".PacketOptionsMessage.rooms: array expected");t.rooms=[];for(let n=0;n<e.rooms.length;++n)t.rooms[n]=String(e.rooms[n])}if(e.except){if(!Array.isArray(e.except))throw TypeError(".PacketOptionsMessage.except: array expected");t.except=[];for(let n=0;n<e.except.length;++n)t.except[n]=String(e.except[n])}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.rooms=[],n.except=[]),t.defaults&&(n.flags=""),null!=e.flags&&e.hasOwnProperty("flags")&&(n.flags=e.flags),e.rooms&&e.rooms.length){n.rooms=[];for(let t=0;t<e.rooms.length;++t)n.rooms[t]=e.rooms[t]}if(e.except&&e.except.length){n.except=[];for(let t=0;t<e.except.length;++t)n.except[t]=e.except[t]}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/PacketOptionsMessage"},e})(),Ee.StringBytesPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1=Ce.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.StringBytesPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ce.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||Ce.isString(e.data1))?"data1: buffer expected":null},e.fromObject=function(e){if(e instanceof Ee.StringBytesPacketDataMessage)return e;let t=new Ee.StringBytesPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&("string"==typeof e.data1?Ce.base64.decode(e.data1,t.data1=Ce.newBuffer(Ce.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=Ce.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?Ce.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringBytesPacketDataMessage"},e})(),Ee.StringNumberPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(16).uint32(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.StringNumberPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ce.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ce.isInteger(e.data1)?"data1: integer expected":null},e.fromObject=function(e){if(e instanceof Ee.StringNumberPacketDataMessage)return e;let t=new Ee.StringNumberPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=e.data1>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",n.data1=0),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringNumberPacketDataMessage"},e})(),Ee.StringObjectPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.StringObjectPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ce.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ce.isString(e.data1)?"data1: string expected":null},e.fromObject=function(e){if(e instanceof Ee.StringObjectPacketDataMessage)return e;let t=new Ee.StringObjectPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringObjectPacketDataMessage"},e})(),Ee.StringStringPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ke.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _e||(e=_e.create(e));let n=void 0===t?e.len:e.pos+t,r=new Ee.StringStringPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _e||(e=new _e(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ce.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ce.isString(e.data1)?"data1: string expected":null},e.fromObject=function(e){if(e instanceof Ee.StringStringPacketDataMessage)return e;let t=new Ee.StringStringPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringStringPacketDataMessage"},e})(),Ee);class Re{static decode(e,t){const n=De(t).decode("undefined"==typeof window?e:new Uint8Array(e));return t.fromJSON({...n})}static encode(e){const t=De(e.constructor),n=e.toJSON(),r=t.verify(n);if(r)throw Error(r);return t.encode(t.create(n)).finish()}}function De(e){return je[e.DESCRIPTOR_NAME]}class Ne extends((0,s.EmitterMixin)()){constructor(e,t,n){super(),this._channelName=e,this._wsGateway=t,this._socket=n,this._subscribeToChannel()}remove(){this._socket.off(this._channelName)}getEventName(e,t=!1){let n="";return t&&(n+="all:"),n+="event",e&&(n+=":"+e),n}_subscribeToChannel(){this._socket.on(this._channelName,(e=>{const t=Re.decode(e,Pe);this.fire(this.getEventName(t.type,!0),t.data,t.socketId),t.socketId!==this._wsGateway.socketId&&this.fire(this.getEventName(t.type),t.data,t.socketId)}))}}const xe=Ne;class Ve extends Ae{constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new Ve(e.id)}}Ve.TYPE="21",Ve.READABLE_TYPE_NAME="getUser",Ve.DESCRIPTOR_NAME="GetUserMessage",Ve.DESCRIPTOR={fields:{id:{type:"string",id:1}}};class Me extends Ae{constructor(e){super(),this.attributes=e}toJSON(){return{attributes:Object.keys(this.attributes).map((e=>({key:e,value:JSON.stringify(this.attributes[e])})))}}static fromJSON(e){const t=e.attributes.reduce(((e,t)=>(e[t.key]=t.value?JSON.parse(t.value):null,e)),{});return new Me(t)}}Me.DESCRIPTOR_NAME="GetUserResponse",Me.DESCRIPTOR={fields:{attributes:{rule:"repeated",type:"KeyValueDescriptor",id:1}}};class Be extends Ae{constructor(e){super(),this.ids=e}toJSON(){return{ids:this.ids}}static fromJSON(e){return new Be(e.ids)}}Be.TYPE="22",Be.READABLE_TYPE_NAME="getManyUsers",Be.DESCRIPTOR_NAME="GetManyUsersMessage",Be.DESCRIPTOR={fields:{ids:{id:1,type:"string",rule:"repeated"}}};class Ue extends Ae{constructor(e){super(),this.users=e}toJSON(){return{users:this.users.map(Je)}}static fromJSON(e){return new Ue(e.users.map(qe))}}function Je(e){return{attributes:Object.keys(e).map((t=>({key:t,value:JSON.stringify(e[t])})))}}function qe(e){return e.attributes.reduce(((e,t)=>(e[t.key]=t.value?JSON.parse(t.value):null,e)),{})}Ue.DESCRIPTOR_NAME="GetManyUsersResponse",Ue.DESCRIPTOR={fields:{users:{rule:"repeated",type:"UserDescriptor",id:1}}};class Ge{constructor(e={}){this._attributes=new Map;for(const t of Object.keys(e))"id"!==t?(this._attributes.set(t,e[t]),Object.defineProperty(this,t,{enumerable:!0,configurable:!1,get:()=>this._attributes.get(t)})):this.id=e.id}static fromData(e){return new Ge(e)}static async get(e,t){const n=new Ve(t);try{const t=await e._sendRequest(Ge._SERVICE,Ve.TYPE,Re.encode(n)),r=Re.decode(t,Me);return new Ge(r.attributes)}catch(e){return new Ge({id:t})}}static async getMany(e,t){const n=new Be(t);try{const t=await e._sendRequest(Ge._SERVICE,Be.TYPE,Re.encode(n));return Re.decode(t,Ue).users.map((e=>new Ge(e)))}catch(e){return t.map((e=>new Ge({id:e})))}}}Ge._SERVICE=2;const Le=Ge;class Ye extends Error{constructor(e,t,n=null,r={}){super("cloud-services-internal-error: "+e),this.context=t,this.code=n,this.data=r,this.name="CKEditorError"}static fromPublicError(e){return new Ye(function(e){let t="cloud-services-error: "+e.message;return e.data&&(t+="\nError data: "+JSON.stringify(e.data)),e.explanation&&(t+="\nExplanation: "+e.explanation),e.action&&(t+="\nAction: "+e.action),e.traceId&&(t+="\nTraceId: "+e.traceId),e.code&&(t+="\nCode: "+e.code),t}(e),e)}}class ze extends Error{constructor(e,t){super(),this.name="CKEditorCloudServicesServerError",this.stack=void 0,this.message=e,this.code=t.code,this.traceId=t.traceId,this.data=t.data}static fromPublicError(e){return new ze(function(e){let t="cloud-services-server-error: "+e.message;return e.explanation&&(t+="\nExplanation: "+e.explanation),e.action&&(t+="\nAction: "+e.action),e.traceId&&(t+="\nTraceId: "+e.traceId),e.code&&(t+="\nCode: "+e.code),t}(e),e)}}const He="function"==typeof ArrayBuffer,Fe=Object.prototype.toString,Ke="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Fe.call(Blob),We="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===Fe.call(File);function Qe(e){return He&&(e instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||Ke&&e instanceof Blob||We&&e instanceof File}function Xe(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(Xe(e[t]))return!0;return!1}if(Qe(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return Xe(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&Xe(e[t]))return!0;return!1}function $e(e){const t=[],n=e.data,r=e;return r.data=Ze(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Ze(e,t){if(!e)return e;if(Qe(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Ze(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Ze(e[r],t));return n}return e}function et(e,t){return e.data=tt(e.data,t),delete e.attachments,e}function tt(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=tt(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=tt(e[n],t));return e}var nt;!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(nt||(nt={}));class rt{constructor(e){this.replacer=e}encode(e){return e.type!==nt.EVENT&&e.type!==nt.ACK||!Xe(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===nt.EVENT?nt.BINARY_EVENT:nt.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==nt.BINARY_EVENT&&e.type!==nt.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=$e(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}}class st extends I{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===nt.BINARY_EVENT;n||t.type===nt.BINARY_ACK?(t.type=n?nt.EVENT:nt.ACK,this.reconstructor=new ot(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!Qe(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===nt[n.type])throw new Error("unknown packet type "+n.type);if(n.type===nt.BINARY_EVENT||n.type===nt.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const s=e.substring(r,t);if(s!=Number(s)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(s)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!st.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case nt.CONNECT:return"object"==typeof t;case nt.DISCONNECT:return void 0===t;case nt.CONNECT_ERROR:return"string"==typeof t||"object"==typeof t;case nt.EVENT:case nt.BINARY_EVENT:return Array.isArray(t)&&("string"==typeof t[0]||"number"==typeof t[0]);case nt.ACK:case nt.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class ot{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=et(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}class it extends Ae{constructor(e,t=[],n=[]){super(),this.flags=e,this.rooms=t,this.except=n}toJSON(){var e,t;return{flags:this.flags?JSON.stringify(this.flags):void 0,rooms:(null===(e=this.rooms)||void 0===e?void 0:e.length)?this.rooms:void 0,except:(null===(t=this.except)||void 0===t?void 0:t.length)?this.except:void 0}}static fromJSON(e){return new it(e.flags&&JSON.parse(e.flags),e.rooms,e.except)}}it.TYPE=11,it.DESCRIPTOR_NAME="PacketOptionsMessage",it.DESCRIPTOR={fields:{flags:{type:"string",id:1},rooms:{type:"string",id:2,rule:"repeated"},except:{type:"string",id:3,rule:"repeated"}}};const at=!("undefined"==typeof process||!process.versions||!process.versions.node);var ct,dt;(dt=ct||(ct={}))[dt.BUFFER=1]="BUFFER",dt[dt.STRING=2]="STRING",dt[dt.NUMBER=3]="NUMBER",dt[dt.OBJECT=4]="OBJECT";class ut{static getPacketType(...e){let t=0;for(let n=0;n<e.length;n++)t+=e[n]*Math.pow(10,e.length-n-1);return t}static getType(e){if(ut.isBuffer(e))return ct.BUFFER;const t=typeof e;return"string"===t?ct.STRING:"number"===t?ct.NUMBER:ct.OBJECT}static isBuffer(e){return at&&Buffer.isBuffer(e)||e instanceof ArrayBuffer||e instanceof Uint8Array||this._isBufferView(e)}static _isBufferView(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer}}class lt extends Ae{static create(e,t){throw new TypeError("Must be implemented in a child class!")}}class pt extends lt{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new pt(e.data,e.data1)}static create(e,t){return new pt(e,t)}}pt.TYPE=ut.getPacketType(ct.NUMBER,ct.BUFFER),pt.DESCRIPTOR_NAME="NumberBytesPacketDataMessage",pt.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"bytes",id:2}}};class ht extends lt{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new ht(e.data,e.data1)}static create(e,t){return new ht(e,t)}}ht.TYPE=ut.getPacketType(ct.STRING,ct.BUFFER),ht.DESCRIPTOR_NAME="StringBytesPacketDataMessage",ht.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};class ft extends lt{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new ft(e.data,e.data1)}static create(e,t){return new ft(e,t)}}ft.TYPE=ut.getPacketType(ct.BUFFER,ct.BUFFER),ft.DESCRIPTOR_NAME="BytesBytesPacketDataMessage",ft.DESCRIPTOR={fields:{data:{type:"bytes",id:1},data1:{type:"bytes",id:2}}};class mt extends lt{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new mt(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new mt(e,t)}}mt.TYPE=ut.getPacketType(ct.STRING,ct.OBJECT),mt.DESCRIPTOR_NAME="StringObjectPacketDataMessage",mt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};class yt extends lt{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new yt(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new yt(e,t)}}yt.TYPE=ut.getPacketType(ct.NUMBER,ct.OBJECT),yt.DESCRIPTOR_NAME="NumberObjectPacketDataMessage",yt.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};class gt extends lt{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new gt(e.data&&JSON.parse(e.data),e.data1&&JSON.parse(e.data1))}static create(e,t){return new gt(e,t)}}gt.TYPE=ut.getPacketType(ct.OBJECT,ct.OBJECT),gt.DESCRIPTOR_NAME="ObjectObjectPacketDataMessage",gt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};class bt extends lt{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1}}static fromJSON(e){return new bt(e.data&&JSON.parse(e.data),e.data1)}static create(e,t){return new bt(e,t)}}bt.TYPE=ut.getPacketType(ct.OBJECT,ct.BUFFER),bt.DESCRIPTOR_NAME="ObjectBufferPacketDataMessage",bt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};class Ot extends lt{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new Ot(e.data,e.data1)}static create(e,t){return new Ot(e,t)}}Ot.TYPE=ut.getPacketType(ct.STRING,ct.STRING),Ot.DESCRIPTOR_NAME="StringStringPacketDataMessage",Ot.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};class wt extends lt{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new wt(e.data,e.data1)}static create(e,t){return new wt(e,t)}}wt.TYPE=ut.getPacketType(ct.STRING,ct.NUMBER),wt.DESCRIPTOR_NAME="StringNumberPacketDataMessage",wt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"uint32",id:2}}};class It extends lt{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new It(e.data,e.data1)}static create(e,t){return new It(e,t)}}It.TYPE=ut.getPacketType(ct.NUMBER,ct.NUMBER),It.DESCRIPTOR_NAME="NumberNumberPacketDataMessage",It.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"uint32",id:2}}};class vt extends lt{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new vt(e.data,e.data1)}static create(e,t){return new vt(e,t)}}vt.TYPE=ut.getPacketType(ct.NUMBER,ct.STRING),vt.DESCRIPTOR_NAME="NumberStringPacketDataMessage",vt.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};const St=[pt,ht,ft,mt,yt,gt,bt,Ot,wt,It,vt].reduce(((e,t)=>(e[t.TYPE]=t,e)),{});class At extends Ae{constructor(e,t,n,r="/",s=new it){super(),this.type=e,this.data=t,this.id=n,this.nsp=r,this.options=s}get packetData(){return void 0===this.data.data&&void 0===this.data.data1?[]:this.data.data&&void 0===this.data.data1?[this.data.data]:[this.data.data,this.data.data1]}toJSON(){const e=Re.encode(this.options),t=Re.encode(this.data);return{type:this.type+10*this.data.constructor.TYPE,id:this.id,nsp:"/"===this.nsp?void 0:this.nsp,data:t,options:e}}static fromJSON(e){const t=Math.floor(e.type/10);return new At(e.type-10*t,Re.decode(e.data,St[t]),e.id,e.nsp,e.options?Re.decode(e.options,it):new it)}static create(e,t={}){var n;const r=ut.getPacketType(ut.getType(e.data[0]),ut.getType(null!==(n=e.data[1])&&void 0!==n?n:e.data[0]));return new At(e.type,St[r].create(e.data[0],e.data[1]),e.id,e.nsp,new it(t.flags,t.rooms,t.except))}}At.TYPE=10,At.DESCRIPTOR_NAME="PacketMessage",At.DESCRIPTOR={fields:{type:{type:"uint32",id:1},id:{type:"uint32",id:2},nsp:{type:"string",id:3},data:{type:"bytes",id:4},options:{type:"bytes",id:5}}};class Pt{encode(e,t,n,r="/",s={}){if(t.length>2)throw new Error("PacketParser supports only 2 elements in data");const o={type:e,data:t,id:n,nsp:r};return Re.encode(At.create(o,s))}decode(e){const t=Re.decode(e,At);return{packet:{id:t.id,type:t.type,data:t.packetData,nsp:t.nsp},options:{flags:t.options.flags,rooms:t.options.rooms,except:t.options.except}}}}const Tt=[nt.EVENT,nt.ACK,nt.BINARY_ACK,nt.BINARY_EVENT];class _t extends rt{constructor(e=new Pt){super(),this._packetParser=e}encode(e){if(Tt.includes(e.type))try{return[this._packetParser.encode(e.type,e.data,e.id,e.nsp)]}catch(e){console.error("Can not properly serialize or deserialize messages. Check the original error.",{originalError:{message:e.message}})}return super.encode(e)}}class kt extends st{constructor(e=new Pt){super(),this._packetParser=e}add(e){if(!ut.isBuffer(e))return super.add(e);let t;try{t=this._packetParser.decode(e).packet}catch(t){return super.add(e)}super.emitReserved("decoded",t)}}class Ct{constructor(e,t){this._context=e,this._deferredPromise=function(){let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return{resolve:e,reject:t,promise:n}}(),this.timeout=setTimeout((()=>this.error(new Ye("Request timeout.",this._context))),t)}get promise(){return this._deferredPromise.promise}response(e){this._deferredPromise.resolve(e)}error(e){this._deferredPromise.reject(e)}}class Et{constructor(e){this._context=e,this._requests=new Set}async send(e,t=45e3){const n=this._createRequest(t);try{return e(n),await n.promise}finally{this._finishRequest(n)}}errorAll(e){for(const t of this._requests)t.error(e)}waitForAllRequests(e=45e3){return this._waitForRequests(e)}_createRequest(e){const t=new Ct(this._context,e);return this._requests.add(t),t}_finishRequest(e){this._requests.delete(e),clearTimeout(e.timeout)}async _waitForRequests(e=5e3,t=0){return!this._requests.size||t>=e/500?Promise.resolve():(await new Promise((e=>{setTimeout(e,500)})),this._waitForRequests(e,t++))}}var jt,Rt;(Rt=jt||(jt={})).DISCONNECTED="disconnected",Rt.CONNECTING="connecting",Rt.CONNECTED="connected";class Dt extends((0,s.ObservableMixin)()){constructor(e,t,n={},r=Ie,s=Le.get){if(super(),this._token=t,this._options=n,this._connectionProvider=r,this._userFactory=s,this._requestsManager=new Et(this),this._channels=new Map,this._connectionAttempt=0,!e)throw new TypeError("Api address must be provided.");if(!this._token)throw new TypeError("Token must be provided.");this._options.requestTimeout||(this._options.requestTimeout=2e4),this._url=ve(e.replace(/^(?!(?:\w+:)?\/\/)/,"https://")),this.set("state",jt.DISCONNECTED),this.set("socketId",void 0),this.set("me",void 0),this.on("change:state",(async(e,t,n)=>{var r;if(this._debugEvent("ws-gw:change:state",n),n!==Dt.STATE_CONNECTED){if(n===Dt.STATE_DISCONNECTED)return this._requestsManager.errorAll(new Ye("Not connected.",this))}else try{this.me=await this._userFactory.call(Le,this,null===(r=this._socketAuth)||void 0===r?void 0:r.userId)}catch(e){}}),{priority:Dt._CHANGE_STATE_EVENT_PRIORITY}),this.on("error",((e,t)=>{this._options.onError?this._options.onError(t):console.error(t)}))}get sessionId(){return this.socketId}waitForAllRequests(e){return this._requestsManager.waitForAllRequests(e)}disconnect(){var e;this.state!==jt.DISCONNECTED&&(null===(e=this._socket)||void 0===e||e.disconnect(),this._socket=void 0,this.state=jt.DISCONNECTED)}async reconnect(){this._socket||this.state!==jt.DISCONNECTED||(await this._token.refreshToken(),await this._connect())}static async connect(e,t="local.cs.dev:443/ws-v2",n={},r=Ie,s=Le.get){const o=new Dt(t,e,n,r,s);return await o._connect(),o}_sendRequest(e,t,n){if(!e)throw new Ye("`serviceName` must be provided.",this);if(this.state!==Dt.STATE_CONNECTED)throw new Ye("Not connected.",this);if(!this._socketAuth||!this._socketAuth.isAuthenticated)throw new Ye("Not authenticated.",this);const r=new ArrayBuffer(n.length+2),s=new Uint8Array(r);return s[0]=e,s[1]=parseInt(t),s.set(n,2),this._emit(1,s)}_getChannel(e,t){const n=""+e+t;return!this._channels.has(n)&&this._socket&&this._channels.set(n,new xe(n,this,this._socket)),this._channels.get(n)}_connect(){return new Promise(((e,t)=>{const n=this._setupSocket();!this.socketId&&n.io.on("reconnect_error",(()=>{this._debugEvent("reconnect_error"),this._reconnectionAttemptError(t)})),n.once("connect",(async()=>{this._debugEvent("once-connect");try{await this._onConnect(),e()}catch(e){t(e)}})),n.connect()}))}_getPortByProtocol(e){return["http:","ws:"].includes(e)?80:443}_setupSocket(){var e;if(this._socket)return this._socket;const t=this._url.port||this._getPortByProtocol(this._url.protocol),n=(this._url.protocol||"https:")+"//"+this._url.hostname+":"+t,r=this._url.pathname.match(/^\/.*\/ws/)?this._url.pathname.split("/ws")[0]:"",s=this._connectionProvider(n,{parser:{Encoder:_t,Decoder:kt},path:r+"/ws-v2/ws",transports:["websocket"],timeout:void 0!==this._options.timeout?this._options.timeout:5e3,reconnection:void 0===this._options.autoReconnect||this._options.autoReconnect,reconnectionDelay:1e3,reconnectionDelayMax:5e3,rejectUnauthorized:void 0===this._options.rejectUnauthorized||this._options.rejectUnauthorized,query:{version:"52.1.6"},agent:null!==(e=this._options.agent)&&void 0!==e&&e,closeOnBeforeunload:!1});return this.state=jt.CONNECTING,s.on("connect",(()=>{this._debugEvent("connect"),this.socketId=s.id})),s.on("connect_error",(e=>{this._debugEvent("connect_error",e)})),s.on("disconnect",(()=>{this._debugEvent("disconnect"),this._onDisconnect()})),s.io.on("reconnect",(async()=>{this._debugEvent("reconnect"),await this._onReconnect()})),s.io.on("reconnect_attempt",(e=>{this._debugEvent("reconnect_attempt",e),this.state=jt.CONNECTING,this._connectionAttempt=e})),s.on("unauthorized",(e=>{this._debugEvent("unauthorized"),this._onUnauthorized(e)})),s.on("authenticationRequest",(async e=>{this._debugEvent("authenticationRequest",e.attempt),await this._onReconnect()})),this._socket=s,s}_emit(e,t){const n=this._socket;return this._requestsManager.send((r=>{n.emit(e,t,((e,t)=>{if(e)return r.error(ze.fromPublicError(e));r.response(t)}))}),this._options.requestTimeout)}_addAuthData(e,t){this._socketAuth={environmentId:e,userId:t,isAuthenticated:!0}}_removeAuthData(){this._socketAuth=void 0}async _onConnect(){await this._authenticate(this._token.value),this.state=jt.CONNECTED;const e=async(e,t,n)=>{this._debugEvent("token:value:change");try{await this._authenticate(n)}catch(e){}};this._token.on("change:value",e),this._socket.io.off("reconnect_error"),this.on("disconnect",(()=>{this._token.off("change:value",e)}))}async _onReconnect(){await this._token.refreshToken(),await this._onConnect()}_onDisconnect(){this.state=jt.DISCONNECTED,this._connectionAttempt=0,this.fire("disconnect");for(const e of this._channels.values())e.remove();this._channels.clear(),void 0===this._options.autoReconnect||this._options.autoReconnect||(this._socket=void 0)}_debugEvent(e,t){if(!this._isDebugModeEnabled())return;const n=void 0!==t?", data: "+t:"";console.info((new Date).toLocaleString()+" "+e+n)}_reconnectionAttemptError(e){this._connectionAttempt>=2&&(this.disconnect(),e(Ye.fromPublicError({message:"The number of initial connection attempts exceeded.",explanation:"Three initial connection attempts failed. It can be caused by a slow, unstable, missing or blocked Internet connection.",action:"Please verify the stability of your Internet connection and ensure that no antivirus or firewall software blocks the Web Socket protocol connections."})))}_onUnauthorized({error:e}){this._removeAuthData(),this.fire("error",ze.fromPublicError(e))}async _authenticate(e){try{this._debugEvent("authenticate:start");const t=await this._emit(2,{token:e});this._debugEvent("authenticate:success","envId: "+t.environmentId+", userId: "+t.userId),this._addAuthData(t.environmentId,t.userId)}catch(e){throw this._debugEvent("authenticate:error",e.message),this._removeAuthData(),e}}_isDebugModeEnabled(){var e;return!!s.global.window.localStorage&&"true"===(null!==(e=s.global.window.localStorage.getItem("csClientDebugMode"))&&void 0!==e?e:"false").toLowerCase()}}Dt.STATE_DISCONNECTED=jt.DISCONNECTED,Dt.STATE_CONNECTING=jt.CONNECTING,Dt.STATE_CONNECTED=jt.CONNECTED,Dt._CHANGE_STATE_EVENT_PRIORITY=s.priorities.get("highest")+999999;const Nt=Dt;class xt extends Ae{constructor(e){super(),this.bundleVersion=e}toJSON(){return{bundleVersion:this.bundleVersion}}static fromJSON(e){return new xt(e.bundleVersion)}}xt.TYPE="131",xt.READABLE_TYPE_NAME="isEditorBundleUploaded",xt.DESCRIPTOR_NAME="IsEditorBundleUploadedMessage",xt.DESCRIPTOR={fields:{bundleVersion:{type:"string",id:1}}};class Vt extends Ae{constructor(e){super(),this.isUploaded=e}toJSON(){return{isUploaded:this.isUploaded}}static fromJSON(e){return new Vt(e.isUploaded)}}Vt.DESCRIPTOR_NAME="IsEditorBundleUploadedResponse",Vt.DESCRIPTOR={fields:{isUploaded:{type:"bool",id:1}}};class Mt extends((0,s.EmitterMixin)()){static async isBundleUploaded(e,t){const n=new xt(t);if(e.state!==jt.CONNECTED)throw new Ye("WebSocket Gateway is not connected.",e);const r=await e._sendRequest(Mt._SERVICE,xt.TYPE,Re.encode(n));return Re.decode(r,Vt).isUploaded}}Mt._SERVICE=13;const Bt=Mt;class Ut extends Ae{constructor(e,t){super(),this.documentId=e,this.revisionId=t}toJSON(){return{documentId:this.documentId,revisionId:this.revisionId}}static fromJSON(e){return new Ut(e.documentId,e.revisionId)}}Ut.TYPE="123",Ut.READABLE_TYPE_NAME="getRevision",Ut.DESCRIPTOR_NAME="RevisionHistoryGetRevisionMessage",Ut.DESCRIPTOR={fields:{documentId:{type:"string",id:1},revisionId:{type:"string",id:2}}};class Jt extends Se{static create(e){return{revisionId:e.id,name:e.name,creatorId:e.creatorId,createdAt:e.createdAt,fromVersion:e.fromVersion,toVersion:e.toVersion,isEmptyCurrent:e.isEmptyCurrent,diffData:e.diffData?JSON.stringify(e.diffData):void 0,attributes:e.attributes,authorsIds:e.authorsIds}}static toJSON(e){var t;return{revisionId:e.revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.stringify(e.authorsIds):void 0,diffData:e.diffData,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):void 0,toVersion:e.toVersion,fromVersion:e.fromVersion,isEmptyCurrent:e.isEmptyCurrent}}static fromJSON(e){return{revisionId:(e={...e}).revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.parse(e.authorsIds):void 0,diffData:e.diffData,createdAt:e.createdAt?new Date(e.createdAt):void 0,attributes:e.attributes?JSON.parse(e.attributes):void 0,toVersion:e.toVersion,fromVersion:e.fromVersion,isEmptyCurrent:e.isEmptyCurrent}}static toObject(e){return function(e){for(const[t,n]of Object.entries(e))void 0===n&&delete e[t];return e}({id:e.revisionId,name:e.name,creatorId:e.creatorId,createdAt:e.createdAt,fromVersion:e.fromVersion,toVersion:e.toVersion,isEmptyCurrent:e.isEmptyCurrent,diffData:e.diffData?JSON.parse(e.diffData):void 0,attributes:e.attributes,authorsIds:e.authorsIds})}}Jt.DESCRIPTOR_NAME="RevisionDescriptor",Jt.DESCRIPTOR={fields:{revisionId:{type:"string",id:1},name:{type:"string",id:2},creatorId:{type:"string",id:3},authorsIds:{type:"string",id:4},diffData:{type:"string",id:5},createdAt:{type:"string",id:6},attributes:{type:"string",id:7},toVersion:{type:"uint32",id:8},fromVersion:{type:"uint32",id:9},isEmptyCurrent:{type:"bool",id:10}}};class qt extends Ae{constructor(e,t,n,r,s,o,i,a,c,d){super(),this.revisionId=e,this.name=t,this.creatorId=n,this.authorsIds=r,this.createdAt=s,this.diffData=o,this.attributes=i,this.fromVersion=a,this.toVersion=c,this.isEmptyCurrent=d}toJSON(){return Jt.toJSON(this)}toObject(){return Jt.toObject(this)}static create(e){return new qt(e.revisionId,e.name,e.creatorId,e.authorsIds,e.createdAt,e.diffData,e.attributes,e.fromVersion,e.toVersion,e.isEmptyCurrent)}static fromJSON(e){return new qt(e.revisionId,e.name,e.creatorId,e.authorsIds?JSON.parse(e.authorsIds):void 0,e.createdAt?new Date(e.createdAt):void 0,e.diffData,e.attributes?JSON.parse(e.attributes):void 0,e.fromVersion,e.toVersion,e.isEmptyCurrent)}}qt.DESCRIPTOR_NAME="RevisionHistoryGetRevisionResponse",qt.DESCRIPTOR=Jt.DESCRIPTOR;class Gt extends Ae{constructor(e,t,n){super(),this.documentId=e,this.requestId=t,this.revisions=n}toJSON(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(Jt.toJSON)}}toObject(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(Jt.toObject)}}static create(e){return new Gt(e.documentId,e.requestId,e.revisions.map(Jt.create))}static fromJSON(e){return new Gt(e.documentId,e.requestId,e.revisions.map(Jt.fromJSON))}}Gt.TYPE="124",Gt.READABLE_TYPE_NAME="updateRevisions",Gt.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsMessage",Gt.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};class Lt extends Ae{constructor(e){super(),this.requestId=e}toJSON(){return{requestId:this.requestId}}static fromJSON(e){return new Lt(e.requestId)}}Lt.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsResponse",Lt.DESCRIPTOR={fields:{requestId:{type:"uint32",id:1}}};class Yt extends Ae{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Yt(e.documentId)}}Yt.TYPE="121",Yt.READABLE_TYPE_NAME="connectToRevisionHistory",Yt.DESCRIPTOR_NAME="RevisionHistoryConnectMessage",Yt.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};class zt extends Ae{constructor(e,t,n){super(),this.channel=e,this.requestId=t,this.revisions=n}toJSON(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(Jt.toJSON)}}toObject(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(Jt.toObject)}}static fromJSON(e){return new zt(e.channel,e.requestId,e.revisions.map(Jt.fromJSON))}}zt.DESCRIPTOR_NAME="RevisionHistoryConnectResponse",zt.DESCRIPTOR={fields:{channel:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};class Ht extends Ae{constructor(e,t){super(),this.documentId=e,this.requestId=t}toJSON(){return{documentId:this.documentId,requestId:this.requestId}}static fromJSON(e){return new Ht(e.documentId,e.requestId)}}Ht.TYPE="122",Ht.READABLE_TYPE_NAME="reconnectToRevisionHistory",Ht.DESCRIPTOR_NAME="RevisionHistoryReconnectMessage",Ht.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2}}};class Ft extends Ye{constructor(e,t){super(e+" Service is not connected.",t)}}class Kt extends((0,s.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}connect(e){return this._isConnected?Promise.resolve():this._connect(e,new Yt(this._documentId))}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this.fire("disconnected"),this.stopListening())}reconnect(e,t){if(this.isConnected)throw new Ye("Cannot reconnect to already connected service.",e);return this._connect(e,new Ht(this._documentId,t))}async updateRevisions(e,t){const n=Gt.create({documentId:this._documentId,requestId:t,revisions:e}),r=await this._sendRequest(Gt.TYPE,n),{requestId:s}=Re.decode(r,Lt);return s}async getRevision(e){const t=new Ut(this._documentId,e),n=await this._sendRequest(Ut.TYPE,t);return Re.decode(n,qt).toObject()}async _connect(e,t){if(e.state!==jt.CONNECTED)throw new Ye("WebSocket Gateway is not connected.",e);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(12,t.constructor.TYPE,Re.encode(t)),{channel:r,requestId:s,revisions:o}=Re.decode(n,zt).toObject();return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Nt._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,r),this._isConnected=!0,this.fire("connected"),{revisions:o,requestId:s}}_connectToChannel(e,t){this._channel=e._getChannel(Kt._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(Gt.TYPE),((e,t)=>{const{documentId:n,requestId:r,revisions:s}=Re.decode(t,Gt).toObject();this.fire("revisionsUpdated",{documentId:n,requestId:r,revisionsData:s})}))}_onWsGatewayStateChange(e){e===jt.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new Ft("Revision History",this);return this._wsGateway._sendRequest(12,e,Re.encode(t))}}Kt._SERVICE=12;const Wt=Kt;class Qt extends Ae{constructor(e,t,n,r={},s=null,o=null){super(),this.id=e,this.documentId=t,this.type=n,this.data=r,this.originalSuggestionId=s,this.attributes=o}toJSON(){return{id:this.id,documentId:this.documentId,type:this.type,data:JSON.stringify(this.data),originalSuggestionId:this.originalSuggestionId,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){var t;return new Qt(e.id,e.documentId,e.type,JSON.parse(e.data),null!==(t=e.originalSuggestionId)&&void 0!==t?t:null,e.attributes?JSON.parse(e.attributes):null)}}Qt.TYPE="101",Qt.READABLE_TYPE_NAME="addSuggestion",Qt.DESCRIPTOR_NAME="TrackChangesAddSuggestionMessage",Qt.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2},type:{type:"string",id:3},data:{type:"string",id:4},originalSuggestionId:{type:"string",id:5},attributes:{type:"string",id:6}}};class Xt extends Ae{constructor(e,t,n,r,s,o,i={},a=null){super(),this.id=e,this.authorId=t,this.type=n,this.hasComments=s,this.state=o,this.data=i,this.attributes=a,this.createdAt=r?new Date(r):void 0}toJSON(){var e;return{id:this.id,authorId:this.authorId,type:this.type,createdAt:null===(e=this.createdAt)||void 0===e?void 0:e.toISOString(),data:JSON.stringify(this.data),hasComments:this.hasComments,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new Xt(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}Xt.DESCRIPTOR_NAME="TrackChangesAddSuggestionResponse",Xt.DESCRIPTOR={fields:{id:{type:"string",id:1},authorId:{type:"string",id:2},type:{type:"string",id:3},createdAt:{type:"string",id:4},data:{type:"string",id:5},hasComments:{type:"bool",id:6},state:{type:"string",id:7},attributes:{type:"string",id:8}}};class $t extends Ae{constructor(e,t){super(),this.id=e,this.documentId=t}toJSON(){return{id:this.id,documentId:this.documentId}}static fromJSON(e){return new $t(e.id,e.documentId)}}$t.TYPE="103",$t.READABLE_TYPE_NAME="getSuggestion",$t.DESCRIPTOR_NAME="TrackChangesGetSuggestionMessage",$t.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2}}};class Zt extends Ae{constructor(e,t,n,r,s,o,i={},a=null){super(),this.id=e,this.authorId=t,this.type=n,this.hasComments=s,this.state=o,this.data=i,this.attributes=a,this.createdAt=new Date(r)}toJSON(){return{id:this.id,authorId:this.authorId,type:this.type,createdAt:this.createdAt.toISOString(),data:JSON.stringify(this.data),hasComments:this.hasComments,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new Zt(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}Zt.DESCRIPTOR_NAME="TrackChangesGetSuggestionResponse",Zt.DESCRIPTOR={fields:{id:{type:"string",id:1},authorId:{type:"string",id:2},type:{type:"string",id:3},createdAt:{type:"string",id:4},data:{type:"string",id:5},hasComments:{type:"bool",id:6},state:{type:"string",id:7},attributes:{type:"string",id:8}}};class en extends Ae{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new en(e.documentId)}}en.TYPE="102",en.READABLE_TYPE_NAME="getAllSuggestions",en.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionMessage",en.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};class tn extends Se{static toJSON(e){var t;return{...e,data:e.data?JSON.stringify(e.data):e.data,attributes:e.attributes?JSON.stringify(e.attributes):e.attributes,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(e){return{...e,data:e.data?JSON.parse(e.data):e.data,attributes:e.attributes?JSON.parse(e.attributes):e.attributes,createdAt:e.createdAt?new Date(e.createdAt):void 0}}}tn.DESCRIPTOR_NAME="SuggestionDescriptor",tn.DESCRIPTOR={fields:{id:{id:1,type:"string"},authorId:{id:2,type:"string"},type:{id:3,type:"string"},createdAt:{id:4,type:"string"},data:{id:5,type:"string"},hasComments:{id:6,type:"bool"},state:{id:7,type:"string"},attributes:{id:8,type:"string"}}};class nn extends Ae{constructor(e,t){super(),this._suggestions=e,this._suggestionsV2=t,this.suggestions=(null==t?void 0:t.length)?t:e}toJSON(){var e,t;return{suggestions:null===(e=this._suggestions)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),suggestionsV2:null===(t=this._suggestionsV2)||void 0===t?void 0:t.map(tn.toJSON)}}static fromJSON(e){var t,n;return new nn(null===(t=e.suggestions)||void 0===t?void 0:t.map(rn),null===(n=e.suggestionsV2)||void 0===n?void 0:n.map(tn.fromJSON))}}function rn(e){const t=JSON.parse(e);return t.createdAt=t.createdAt?new Date(t.createdAt):void 0,t}nn.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionsResponse",nn.DESCRIPTOR={fields:{suggestions:{type:"string",rule:"repeated",id:1},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:2}}};class sn extends Ae{constructor(e,t,n,r,s,o=null){super(),this.id=e,this.documentId=t,this.hasComments=n,this.isHasCommentsModified=r,this.state=s,this.attributes=o}toJSON(){return{id:this.id,documentId:this.documentId,hasComments:this.hasComments,isHasCommentsModified:this.isHasCommentsModified,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new sn(e.id,e.documentId,e.hasComments,e.isHasCommentsModified,e.state,e.attributes?JSON.parse(e.attributes):null)}}sn.TYPE="104",sn.READABLE_TYPE_NAME="updateSuggestion",sn.DESCRIPTOR_NAME="TrackChangesUpdateSuggestionMessage",sn.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2},hasComments:{type:"bool",id:3},isHasCommentsModified:{type:"bool",id:4},state:{type:"string",id:5},attributes:{type:"string",id:6}}};class on extends Ae{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new on(e.documentId)}}on.TYPE="105",on.READABLE_TYPE_NAME="connectToSuggestions",on.DESCRIPTOR_NAME="TrackChangesConnectMessage",on.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};class an extends Ae{constructor(e,t,n){super(),this.channel=e,this._suggestions=t,this._suggestionsV2=n,this.suggestions=(null==n?void 0:n.length)?n:t}toJSON(){var e,t;return{channel:this.channel,suggestions:null===(e=this._suggestions)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),suggestionsV2:null===(t=this._suggestionsV2)||void 0===t?void 0:t.map(tn.toJSON)}}static fromJSON(e){var t,n;return new an(e.channel,null===(t=e.suggestions)||void 0===t?void 0:t.map((e=>JSON.parse(e))),null===(n=e.suggestionsV2)||void 0===n?void 0:n.map(tn.fromJSON))}}an.DESCRIPTOR_NAME="TrackChangesConnectResponse",an.DESCRIPTOR={fields:{channel:{type:"string",id:1},suggestions:{type:"string",rule:"repeated",id:2},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:3}}};class cn extends Ae{constructor(e,t,n){super(),this.ids=e,this.documentId=t,this.state=n}toJSON(){return{ids:this.ids,documentId:this.documentId,state:this.state}}static fromJSON(e){return new cn(e.ids,e.documentId,e.state)}}cn.TYPE="106",cn.READABLE_TYPE_NAME="batchUpdateSuggestionsState",cn.DESCRIPTOR_NAME="TrackChangesBatchUpdateSuggestionsStateMessage",cn.DESCRIPTOR={fields:{ids:{type:"string",rule:"repeated",id:1},documentId:{type:"string",id:2},state:{type:"string",id:3}}};class dn extends((0,s.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==jt.CONNECTED)throw new Ye("WebSocket Gateway is not connected.",e);const t=new on(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(10,on.TYPE,Re.encode(t)),r=Re.decode(n,an);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Nt._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,r.channel),this._isConnected=!0,this.fire("connected"),r.suggestions}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this.fire("disconnected"),this.stopListening())}async add(e,t,n,r=null,s){const o=new Qt(e,this._documentId,t,n,r,s),i=await this._sendRequest(Qt.TYPE,o);return Re.decode(i,Xt)}async get(e,t=1){const n=new $t(e,this._documentId);try{const e=await this._sendRequest($t.TYPE,n);return Re.decode(e,Zt)}catch(n){if("CKEditorCloudServicesServerError"===n.name&&"404"===n.code&&t<5)return await(r=100*t,new Promise((e=>{setTimeout(e,r)}))),this.get(e,t+1);if("CKEditorCloudServicesServerError"===n.name)throw n;throw ze.fromPublicError(n)}var r}async getAll(){const e=new en(this._documentId),t=await this._sendRequest(en.TYPE,e),{suggestions:n}=Re.decode(t,nn);return n}async update(e,t={}){const{hasComments:n,state:r,attributes:s}=t,o=void 0!==n,i=new sn(e,this._documentId,n,o,r,s);await this._sendRequest(sn.TYPE,i)}async batchUpdateState(e){const t=new cn(e.ids,this._documentId,e.state);await this._sendRequest(cn.TYPE,t)}_connectToChannel(e,t){this._channel=e._getChannel(dn._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(sn.TYPE),((e,t)=>{const n=Re.decode(t,sn);this.fire("suggestionUpdated",n)}))}_onWsGatewayStateChange(e){e===jt.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new Ft("Track Changes",this);return this._wsGateway._sendRequest(10,e,Re.encode(t))}}dn._SERVICE=10;const un=dn;class ln extends Ae{constructor(e,t=[]){super(),this.channel=e,this.sockets=t}toJSON(){return{channel:this.channel,sockets:this.sockets.map((e=>({user:e.userId,session:e.id,role:e.role,permissions:e.permissions})))}}static fromJSON(e){return new ln(e.channel,e.sockets.map((e=>({id:e.session,userId:e.user,role:e.role,permissions:e.permissions}))))}}ln.DESCRIPTOR_NAME="SessionsConnectResponse",ln.DESCRIPTOR={fields:{channel:{type:"string",id:1},sockets:{rule:"repeated",type:"SessionsSocketDescriptor",id:2}}};class pn extends Ae{constructor(e,t){super(),this.id=e,this.sessionType=t}toJSON(){return{id:this.id,sessionType:this.sessionType}}static fromJSON(e){return new pn(e.id,e.sessionType)}}pn.TYPE="31",pn.READABLE_TYPE_NAME="getConnectedSockets",pn.DESCRIPTOR_NAME="SessionsConnectMessage",pn.DESCRIPTOR={fields:{id:{type:"string",id:1},sessionType:{type:"uint32",id:2}}};class hn extends Ae{constructor(e,t,n,r){super(),this.id=e,this.userId=t,this.role=n,this.permissions=r}toJSON(){var e,t,n;return{id:this.id,userId:null!==(e=this.userId)&&void 0!==e?e:void 0,role:null!==(t=this.role)&&void 0!==t?t:void 0,permissions:null!==(n=this.permissions)&&void 0!==n?n:void 0}}static fromJSON(e){return new hn(e.id,e.userId,e.role,e.permissions)}}hn.TYPE="32",hn.READABLE_TYPE_NAME="connectSocket",hn.DESCRIPTOR_NAME="SocketConnectMessage",hn.DESCRIPTOR={fields:{id:{type:"string",id:1},userId:{type:"string",id:2},role:{type:"string",id:3},permissions:{rule:"repeated",type:"string",id:4}}};class fn extends Ae{constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new fn(e.id)}}fn.TYPE="33",fn.READABLE_TYPE_NAME="disconnectSocket",fn.DESCRIPTOR_NAME="SocketDisconnectMessage",fn.DESCRIPTOR={fields:{id:{type:"string",id:1}}};const mn=class extends s.Collection{constructor(e,t){super({idProperty:"id"}),this._id=e,this._sessionType=t,this._handlers=new Map,this._eventsQueue=[],this._isRunning=!1}async connect(e){this._wsGateway=e,this.stopListening(e,"change:state");const t=new pn(this._id,this._sessionType);let n;try{const e=await this._wsGateway._sendRequest(3,pn.TYPE,Re.encode(t));n=Re.decode(e,ln)}catch(e){n=new ln(this._id,[])}this._connectToChannel(this._wsGateway,n.channel,this._sessionType);const r=await async function(e,t){const n=t.map((e=>e.userId)),r=n.length?await Le.getMany(e,n):[];return t.map((e=>{const t={id:e.id,role:e.role,permissions:e.permissions};return t.user=e.userId&&r.find((t=>t.id===e.userId))||new Le,t}))}(this._wsGateway,n.sockets);for(const e of r)super.add(e);this._connected=!0,this.fire("connected"),this.listenTo(this._wsGateway,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Nt._CHANGE_STATE_EVENT_PRIORITY}),await this._runQueue()}disconnect(e=!0){if(this._connected){for(this._connected=!1,this._eventsQueue=[];this.length;)super.remove(0);this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._wsGateway&&e&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this.fire("disconnected"),e&&this.stopListening()}}add(e,t){throw new TypeError("The collection is read-only.")}remove(e){throw new TypeError("The collection is read-only.")}_connectToChannel(e,t,n){this._channel=e._getChannel(n,t),this._channel&&(this._addHandler(this._channel,hn.TYPE,(async t=>{const n=Re.decode(t,hn);if(-1===this.getIndex(n.id)){const t={id:n.id,role:n.role,permissions:n.permissions};n.userId&&(t.user=await Le.get(e,n.userId)),super.add(t)}})),this._addHandler(this._channel,fn.TYPE,(e=>{const t=Re.decode(e,fn);-1!==this.getIndex(t.id)&&super.remove(t.id)})))}async _onWsGatewayStateChange(e){e===Nt.STATE_DISCONNECTED&&this.disconnect(!1),e===Nt.STATE_CONNECTED&&await this.connect(this._wsGateway)}async _runQueue(){if(this._isRunning||!this._connected)return;let e;for(this._isRunning=!0;e=this._eventsQueue.shift();){const t=this._handlers.get(e.eventName);t&&await t(e.data)}this._isRunning=!1}_addHandler(e,t,n){const r=e.getEventName(t,!0);this.listenTo(e,r,(async(e,t)=>{const n=e.name;this._eventsQueue.push({eventName:n,data:t}),await this._runQueue()})),this._handlers.set(r,n)}};var yn,gn=new Uint8Array(16);function bn(){if(!yn&&!(yn="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yn(gn)}const On=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const wn=function(e){return"string"==typeof e&&On.test(e)};for(var In=[],vn=0;vn<256;++vn)In.push((vn+256).toString(16).substr(1));const Sn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(In[e[t+0]]+In[e[t+1]]+In[e[t+2]]+In[e[t+3]]+"-"+In[e[t+4]]+In[e[t+5]]+"-"+In[e[t+6]]+In[e[t+7]]+"-"+In[e[t+8]]+In[e[t+9]]+"-"+In[e[t+10]]+In[e[t+11]]+In[e[t+12]]+In[e[t+13]]+In[e[t+14]]+In[e[t+15]]).toLowerCase();if(!wn(n))throw TypeError("Stringified UUID is invalid");return n};const An=function(e,t,n){var r=(e=e||{}).random||(e.rng||bn)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var s=0;s<16;++s)t[n+s]=r[s];return t}return Sn(r)};class Pn{static async getConnectedSessions(e,t,n){const r=new mn(t,n);return await r.connect(e),r}}class Tn extends Ae{constructor(e,t,n,r,s=""){super(),this.id=e,this.buffers=t,this.types=n,this.bundleVersion=r,this.lastOperationId=s}toJSON(){return{id:this.id,buffers:this.buffers,types:this.types,bundleVersion:this.bundleVersion,lastOperationId:this.lastOperationId}}static fromJSON(e){return new Tn(e.id,e.buffers,e.types,e.bundleVersion,e.lastOperationId)}}Tn.TYPE="11",Tn.READABLE_TYPE_NAME="connectToDocument",Tn.DESCRIPTOR_NAME="CollaborativeEditingConnectMessage",Tn.DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},buffers:{rule:"repeated",type:"bytes",id:3},types:{rule:"repeated",type:"uint32",id:4},lastOperationId:{type:"string",id:5}}};class _n{static prepareMetadataForOperations(e,t){if(!(e&&e.length&&t&&t.length))return[];const n=[];let r=0;for(const s of e)if(0!==s){if(!t[r])throw new Error("Missing metadata for a operation");n.push(t[r]),r++}else n.push(n[n.length-1]);return n}static removeUnnecessaryMetadata(e,t){if(!(e&&e.length&&t&&t.length))return[];const n=[];for(let r=0;r<e.length;r++)if(0!==e[r]){if(!t[r])throw new Error("Missing metadata for a operation");n.push(t[r])}return n}}class kn extends Se{static toJSON({createdAt:e,...t}){const n={...t};return(null==e?void 0:e.toISOString)&&(n.createdAt=e.toISOString()),n}static fromJSON({createdAt:e,...t}){const n={...t};return e&&(n.createdAt=new Date(e)),n}}kn.DESCRIPTOR_NAME="OperationMetadataDescriptor",kn.DESCRIPTOR={fields:{userId:{type:"string",id:1},type:{type:"string",id:2},createdAt:{type:"string",id:3}}};class Cn extends Ae{constructor(e,t,n,r,s=[],o=""){super(),this.id=e,this.buffers=t,this.types=n,this.baseVersion=r,this.metadata=s,this.lastOperationId=o}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.baseVersion,lastOperationId:this.lastOperationId}}toJSON(){return{id:this.id,buffers:this.buffers,types:this.types,baseVersion:this.baseVersion,metadata:_n.removeUnnecessaryMetadata(this.types,this.metadata).map(kn.toJSON),lastOperationId:this.lastOperationId}}static fromJSON(e){return new Cn(e.id,e.buffers,e.types,e.baseVersion,_n.prepareMetadataForOperations(e.types,e.metadata).map(kn.fromJSON),e.lastOperationId)}}Cn.TYPE="13",Cn.READABLE_TYPE_NAME="updateDocument",Cn.DESCRIPTOR_NAME="CollaborativeEditingUpdateMessage",Cn.DESCRIPTOR={fields:{id:{type:"string",id:1},baseVersion:{type:"uint32",id:2},buffers:{rule:"repeated",type:"bytes",id:3},types:{rule:"repeated",type:"uint32",id:4},metadata:{rule:"repeated",type:"OperationMetadataDescriptor",id:6},lastOperationId:{type:"string",id:7}}};class En extends Ae{constructor(e,t,n){super(),this.id=e,this.lastKnowVersion=t,this.bundleVersion=n}toJSON(){return{id:this.id,bundleVersion:this.bundleVersion,lastKnowVersion:this.lastKnowVersion}}static fromJSON(e){return new En(e.id,e.lastKnowVersion,e.bundleVersion)}}En.TYPE="12",En.READABLE_TYPE_NAME="reconnectToDocument",En.DESCRIPTOR_NAME="CollaborativeEditingReconnectMessage",En.DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},lastKnowVersion:{type:"uint32",id:3}}};class jn extends Ae{constructor(e,t=[],n=[],r=[],s="",o=null){super(),this.version=e,this.buffers=t,this.types=n,this.metadata=r,this.lastOperationId=s,this.lastOperationAcceptedAt=o}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.version-this.types.length,lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt}}get wereChangesApplied(){var e;return!(null===(e=this.types)||void 0===e?void 0:e.length)}toJSON(){return{version:this.version,buffers:this.buffers,types:this.types,metadata:_n.removeUnnecessaryMetadata(this.types,this.metadata).map(kn.toJSON),lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt instanceof Date?this.lastOperationAcceptedAt.toISOString():this.lastOperationAcceptedAt}}static fromJSON(e){return new jn(e.version,e.buffers,e.types,_n.prepareMetadataForOperations(e.types,e.metadata).map(kn.fromJSON),e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}static create(e){return new jn(e.version,e.buffers,e.types,e.metadata,e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}}jn.DESCRIPTOR_NAME="CollaborativeEditingResponse",jn.DESCRIPTOR={fields:{version:{type:"uint32",id:1},buffers:{rule:"repeated",type:"bytes",id:2},types:{rule:"repeated",type:"uint32",id:3},metadata:{rule:"repeated",type:"OperationMetadataDescriptor",id:5},lastOperationId:{type:"string",id:6},lastOperationAcceptedAt:{type:"string",id:7}}};class Rn extends Ae{constructor(e,t,n=[],r=[],s=0,o=[],i=null,a="",c="",d=null){super(),this.channel=e,this.version=t,this.buffers=n,this.types=r,this.offset=s,this.metadata=o,this.initData=i,this.sessionId=a,this.lastOperationId=c,this.sessionCreatedAt=d}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.version-this.types.length,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt}}get wereChangesApplied(){var e;return!(null===(e=this.types)||void 0===e?void 0:e.length)&&null===this.initData}toJSON(){var e;return{channel:this.channel,version:this.version,sessionId:this.sessionId,buffers:this.buffers,types:this.types,offset:this.offset,metadata:_n.removeUnnecessaryMetadata(this.types,this.metadata).map(kn.toJSON),initData:null!==(e=this.initData)&&void 0!==e?e:"",isInitialized:"string"==typeof this.initData,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt?this.sessionCreatedAt.toISOString():null}}static create(e){return new Rn(e.channel,e.version,e.buffers,e.types,e.offset,e.metadata,e.initData,e.sessionId,e.lastOperationId,e.sessionCreatedAt)}static fromJSON(e){var t;let n=null;return!0===e.isInitialized?n=null!==(t=e.initData)&&void 0!==t?t:"":"boolean"!=typeof e.isInitialized&&e.initData&&(n=e.initData),Rn.create({channel:e.channel,version:e.version,buffers:e.buffers,types:e.types,offset:e.offset,metadata:_n.prepareMetadataForOperations(e.types,e.metadata).map(kn.fromJSON),initData:n,sessionId:e.sessionId,lastOperationId:e.lastOperationId,sessionCreatedAt:e.sessionCreatedAt?new Date(e.sessionCreatedAt):null})}}Rn.DESCRIPTOR_NAME="CollaborativeEditingConnectResponse",Rn.DESCRIPTOR={fields:{channel:{type:"string",id:1},offset:{type:"uint32",id:2},version:{type:"uint32",id:3},buffers:{rule:"repeated",type:"bytes",id:4},types:{rule:"repeated",type:"uint32",id:5},metadata:{rule:"repeated",type:kn.DESCRIPTOR_NAME,id:7},initData:{type:"string",id:8},isInitialized:{type:"bool",id:9},sessionId:{type:"string",id:10},lastOperationId:{type:"string",id:11},sessionCreatedAt:{type:"string",id:12}}};class Dn extends Ae{constructor(e,t){super(),this.lastDocumentSession=e,this.currentDocumentSession=t}get data(){var e,t,n,r,s;return{lastDocumentSessionId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.id,lastDocumentSessionOperationId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(s=this.currentDocumentSession)||void 0===s?void 0:s.lastOperationId}}toJSON(){var e,t,n,r,s;return{lastDocumentSessionId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.id,lastDocumentSessionOperationId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(s=this.currentDocumentSession)||void 0===s?void 0:s.lastOperationId}}static fromJSON(e){const t=e.lastDocumentSessionId?{id:e.lastDocumentSessionId,lastOperationId:e.lastDocumentSessionOperationId}:void 0,n=e.currentDocumentSessionId?{lastOperationId:e.currentDocumentSessionOperationId,version:e.currentDocumentSessionVersion,id:e.currentDocumentSessionId}:void 0;return new Dn(t,n)}}Dn.DESCRIPTOR_NAME="GetDocumentDetailsResponse",Dn.DESCRIPTOR={fields:{lastDocumentSessionId:{type:"string",id:1},lastDocumentSessionOperationId:{type:"string",id:2},currentDocumentSessionId:{type:"string",id:3},currentDocumentSessionVersion:{type:"uint32",id:4},currentDocumentSessionOperationId:{type:"string",id:5}}};class Nn extends Ae{constructor(e){super(),this.documentId=e}get data(){return{documentId:this.documentId}}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Nn(e.documentId)}}Nn.TYPE="14",Nn.READABLE_TYPE_NAME="getDocumentDetails",Nn.DESCRIPTOR_NAME="GetDocumentDetailsMessage",Nn.DESCRIPTOR={fields:{documentId:{type:"string",id:1},environmentId:{type:"string",id:2}}};class xn extends((0,s.EmitterMixin)()){constructor(e,t){if(super(),!e)throw new TypeError('Param "bundleVersion" must be provided.');this._id=null!=t?t:An(),this._isConnected=!1,this._bundleVersion=e}getId(){return this._id}isConnected(){return this._isConnected}connect(e,t={buffers:[],types:[]},n){const r=new Tn(this.getId(),t.buffers,t.types,this._bundleVersion,n);return this._connect(e,r)}reconnect(e,t){if(this.isConnected())throw new Ye("Cannot reconnect to already connected service.",e);return this._connect(e,new En(this.getId(),t,this._bundleVersion))}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._connectedSessions&&(this._connectedSessions.disconnect(),this._connectedSessions=void 0),this.fire("disconnected"),this.stopListening())}async getDocumentDetails(){const e=new Nn(this.getId());if(!this._wsGateway)throw new Ft("Collaborative Editing",this);const t=await this._wsGateway._sendRequest(1,Nn.TYPE,Re.encode(e));return Re.decode(t,Dn)}async sendOperations(e,t,n){if(!e||!e.types||!e.types.length)throw new Ye("Cannot send empty update.",this._wsGateway);const r="number"==typeof t?t:parseInt(t);if(!Number.isInteger(r)||r<0)throw new Ye("Base version not provided.",this._wsGateway);const s=new Cn(this.getId(),e.buffers,e.types,r,[],n);if(!this._wsGateway||!this._isConnected)throw new Ft("Collaborative Editing",this);const o=await this._wsGateway._sendRequest(1,Cn.TYPE,Re.encode(s));return Re.decode(o,jn)}async getConnectedSessions(){if(!this._isConnected)throw new Ft("Collaborative Editing",this);return this._connectedSessions||(this._connectedSessions=await Pn.getConnectedSessions(this._wsGateway,this._id,1)),this._connectedSessions}static getConnectedSessions(e,t){return Pn.getConnectedSessions(e,t,1)}async _connect(e,t){if(this.isConnected())return;if(e.state!==Nt.STATE_CONNECTED)throw new Ye("WebSocket Gateway is not connected.",e);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(1,t.constructor.TYPE,Re.encode(t)),r=Re.decode(n,Rn);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Nt._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,r.channel),this._isConnected=!0,this.fire("connected"),r}_connectToChannel(e,t){this._channel=e._getChannel(1,t),this.listenTo(this._channel,this._channel.getEventName(Cn.TYPE),((e,t)=>{const n=Re.decode(t,Cn);this.fire("operationsReceived",n.baseVersion,n.data,n.metadata)}))}_onWsGatewayStateChange(e){e===Nt.STATE_DISCONNECTED&&this.disconnect()}}xn._SERVICE=1;const Vn=xn;class Mn extends Se{static toJSON(e){var t;return{...e,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null}}static fromJSON(e){return{...e,createdAt:new Date(e.createdAt),attributes:e.attributes?JSON.parse(e.attributes):null}}}Mn.DESCRIPTOR_NAME="CommentDescriptor",Mn.DESCRIPTOR={fields:{commentId:{id:1,type:"string"},commentThreadId:{id:2,type:"string"},userId:{id:3,type:"string"},content:{id:4,type:"string"},documentId:{id:5,type:"string"},createdAt:{id:6,type:"string"},attributes:{id:7,type:"string"}}};class Bn extends Se{static toJSON(e){var t,n,r,s,o;return{...e,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),deletedAt:null===(n=e.deletedAt)||void 0===n?void 0:n.toISOString(),resolvedAt:null===(r=e.resolvedAt)||void 0===r?void 0:r.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null,context:e.context?JSON.stringify(e.context):e.context,comments:null===(s=e.comments)||void 0===s?void 0:s.map(Mn.toJSON),unlinkedAt:null===(o=e.unlinkedAt)||void 0===o?void 0:o.toISOString()}}static fromJSON(e){var t;return{...e,createdAt:e.createdAt?new Date(e.createdAt):void 0,deletedAt:e.deletedAt?new Date(e.deletedAt):void 0,resolvedAt:e.resolvedAt?new Date(e.resolvedAt):void 0,attributes:e.attributes?JSON.parse(e.attributes):null,context:e.context?JSON.parse(e.context):void 0,comments:null===(t=e.comments)||void 0===t?void 0:t.map(Mn.fromJSON),unlinkedAt:e.unlinkedAt?new Date(e.unlinkedAt):void 0}}}Bn.DESCRIPTOR_NAME="CommentsThreadDescriptor",Bn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},comments:{type:"CommentDescriptor",rule:"repeated",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4},context:{type:"string",id:5},createdAt:{type:"string",id:6},deletedAt:{type:"string",id:7},attributes:{type:"string",id:8},unlinkedAt:{type:"string",id:9}}};class Un extends Ae{constructor(e,t,n,r="",s,o="",i=null,a){super(),this.documentId=e,this.commentThreadId=t,this.content=n,this.commentId=r,this.userId=o,this.attributes=i,this.commentThread=a,this.createdAt=s?new Date(s):""}toJSON(){return{commentThreadId:this.commentThreadId,content:this.content,documentId:this.documentId,commentId:this.commentId,createdAt:this.createdAt instanceof Date?this.createdAt.toISOString():this.createdAt,userId:this.userId,attributes:JSON.stringify(this.attributes),commentThread:this.commentThread?Bn.toJSON(this.commentThread):void 0}}static fromJSON(e){return new Un(e.documentId,e.commentThreadId,e.content,e.commentId?e.commentId:void 0,e.createdAt?new Date(e.createdAt):void 0,e.userId?e.userId:void 0,e.attributes?JSON.parse(e.attributes):{},e.commentThread?Bn.fromJSON(e.commentThread):void 0)}}Un.TYPE="91",Un.READABLE_TYPE_NAME="addComment",Un.DESCRIPTOR_NAME="CommentsV2AddCommentMessage",Un.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},content:{type:"string",id:2},documentId:{type:"string",id:3},commentId:{type:"string",id:4},createdAt:{type:"string",id:5},userId:{type:"string",id:6},attributes:{type:"string",id:7},commentThread:{type:"CommentsThreadDescriptor",id:8}}};class Jn extends Ae{constructor(e,t,n){super(),this.commentThreadId=e,this.commentId=t,this.createdAt=new Date(n)}toJSON(){return{commentThreadId:this.commentThreadId,commentId:this.commentId,createdAt:this.createdAt.toISOString()}}static fromJSON(e){return new Jn(e.commentThreadId,e.commentId,e.createdAt)}}Jn.DESCRIPTOR_NAME="CommentsV2AddCommentResponse",Jn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},createdAt:{type:"string",id:3}}};class qn extends Ae{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new qn(e.documentId)}}qn.TYPE="92",qn.READABLE_TYPE_NAME="connectToComment",qn.DESCRIPTOR_NAME="CommentsV2ConnectMessage",qn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};class Gn extends Ae{constructor(e,t,n){super(),this.channel=e,this._threads=t,this._threadsV2=n,this.threads=(null==n?void 0:n.length)?n:t}toJSON(){var e,t;return{channel:this.channel,threads:null===(e=this._threads)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),threadsV2:null===(t=this._threadsV2)||void 0===t?void 0:t.map(Bn.toJSON)}}static fromJSON(e){var t,n;return new Gn(e.channel,null===(t=e.threads)||void 0===t?void 0:t.map((e=>JSON.parse(e))),null===(n=e.threadsV2)||void 0===n?void 0:n.map(Bn.fromJSON))}}Gn.DESCRIPTOR_NAME="CommentsV2ConnectResponse",Gn.DESCRIPTOR={fields:{channel:{type:"string",id:1},threads:{type:"string",rule:"repeated",id:2},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:3}}};class Ln extends Ae{constructor(e,t,n){super(),this.documentId=e,this.commentThreadId=t,this.commentId=n}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,commentId:this.commentId}}static fromJSON(e){return new Ln(e.documentId,e.commentThreadId,e.commentId)}}Ln.TYPE="95",Ln.READABLE_TYPE_NAME="removeComment",Ln.DESCRIPTOR_NAME="CommentsV2RemoveCommentMessage",Ln.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},documentId:{type:"string",id:3}}};class Yn extends Ae{constructor(e,t){super(),this.documentId=e,this.commentThreadId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new Yn(e.documentId,e.commentThreadId)}}Yn.TYPE="97",Yn.READABLE_TYPE_NAME="removeCommentThread",Yn.DESCRIPTOR_NAME="CommentsV2RemoveCommentThreadMessage",Yn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};class zn extends Ae{constructor(e,t,n,r,s=null,o=!1,i){super(),this.documentId=e,this.commentThreadId=t,this.commentId=n,this.content=r,this.attributes=s,this.isAttributesUpdated=o,this.commentThread=i}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,commentId:this.commentId,content:this.content,attributes:this.attributes?JSON.stringify(this.attributes):null,isAttributesUpdated:this.isAttributesUpdated,commentThread:this.commentThread?Bn.toJSON(this.commentThread):void 0}}static fromJSON(e){return new zn(e.documentId,e.commentThreadId,e.commentId,e.content,e.attributes?JSON.parse(e.attributes):null,e.isAttributesUpdated,e.commentThread?Bn.fromJSON(e.commentThread):void 0)}}zn.TYPE="96",zn.READABLE_TYPE_NAME="updateComment",zn.DESCRIPTOR_NAME="CommentsV2UpdateCommentMessage",zn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},content:{type:"string",id:3},documentId:{type:"string",id:4},attributes:{type:"string",id:5},isAttributesUpdated:{type:"bool",id:6},commentThread:{type:"CommentsThreadDescriptor",id:7}}};class Hn extends Ae{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId}}static fromJSON(e){return new Hn(e.commentThreadId,e.documentId)}}Hn.TYPE="93",Hn.READABLE_TYPE_NAME="getComment",Hn.DESCRIPTOR_NAME="CommentsV2GetCommentThreadMessage",Hn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};class Fn extends Ae{constructor(e,t,n,r,s,o,i,a,c,d){super(),this.commentThreadId=e,this._comments=t,this._commentsV2=n,this.resolvedBy=s,this.comments=(null==n?void 0:n.length)?n:t,this.createdAt=i?new Date(i):void 0,this.deletedAt="string"==typeof a?new Date(a):a,this.resolvedAt="string"==typeof c?new Date(c):c,this.unlinkedAt="string"==typeof d?new Date(d):d,this.attributes="string"==typeof r?JSON.parse(r):r,this.context="string"==typeof o?JSON.parse(o):o}toJSON(){var e,t,n,r,s,o;return{commentThreadId:this.commentThreadId,comments:null===(e=this._comments)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),commentsV2:null===(t=this._commentsV2)||void 0===t?void 0:t.map(Mn.toJSON),attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,context:this.context?JSON.stringify(this.context):this.context,resolvedBy:this.resolvedBy,createdAt:null===(n=this.createdAt)||void 0===n?void 0:n.toISOString(),deletedAt:null===(r=this.deletedAt)||void 0===r?void 0:r.toISOString(),resolvedAt:null===(s=this.resolvedAt)||void 0===s?void 0:s.toISOString(),unlinkedAt:null===(o=this.unlinkedAt)||void 0===o?void 0:o.toISOString()}}static fromJSON(e){var t,n;return new Fn(e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((e=>function(e){const t=JSON.parse(e);return{...t,createdAt:new Date(t.createdAt)}}(e))),null===(n=e.commentsV2)||void 0===n?void 0:n.map(Mn.fromJSON),e.attributes?JSON.parse(e.attributes):e.attributes,e.resolvedBy,e.context?JSON.parse(e.context):e.context,e.createdAt,e.deletedAt,e.resolvedAt,e.unlinkedAt)}}Fn.DESCRIPTOR_NAME="CommentsV2GetCommentThreadResponse",Fn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},comments:{type:"string",rule:"repeated",id:2},commentsV2:{type:"CommentDescriptor",rule:"repeated",id:3},resolvedAt:{type:"string",id:4},resolvedBy:{type:"string",id:5},context:{type:"string",id:6},createdAt:{type:"string",id:7},deletedAt:{type:"string",id:8},attributes:{type:"string",id:9},unlinkedAt:{type:"string",id:10}}};class Kn extends Ae{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Kn(e.documentId)}}Kn.TYPE="94",Kn.READABLE_TYPE_NAME="getDocumentThreads",Kn.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsMessage",Kn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};class Wn extends Ae{constructor(e,t){super(),this._threads=e,this._threadsV2=t,this.threads=(null==t?void 0:t.length)?t:e}toJSON(){var e,t;return{threads:null===(e=this._threads)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),threadsV2:null===(t=this._threadsV2)||void 0===t?void 0:t.map(Bn.toJSON)}}static fromJSON(e){var t,n;return new Wn(null===(t=e.threads)||void 0===t?void 0:t.map((e=>function(e){var t;const n=JSON.parse(e),r={...n};return n.comments&&(r.comments=null===(t=n.comments)||void 0===t?void 0:t.map((e=>({...e,createdAt:new Date(e.createdAt)})))),r}(e))),null===(n=e.threadsV2)||void 0===n?void 0:n.map(Bn.fromJSON))}}Wn.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsResponse",Wn.DESCRIPTOR={fields:{threads:{type:"string",rule:"repeated",id:1},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:2}}};class Qn extends Se{static toJSON(e){var t;return{commentId:e.commentId,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(e){return{commentId:e.commentId,createdAt:new Date(e.createdAt)}}}Qn.DESCRIPTOR_NAME="CommentThreadAddedCommentDescriptor",Qn.DESCRIPTOR={fields:{commentId:{id:1,type:"string"},createdAt:{id:2,type:"string"}}};class Xn extends Ae{constructor(e,t,n=[]){super(),this.commentThreadId=e,this.comments=n,this.createdAt=new Date(t)}toJSON(){return{commentThreadId:this.commentThreadId,createdAt:this.createdAt.toISOString(),comments:this.comments.map((e=>Qn.toJSON(e)))}}static fromJSON(e){return new Xn(e.commentThreadId,e.createdAt,e.comments.map((e=>Qn.fromJSON(e))))}}Xn.DESCRIPTOR_NAME="CommentsV2AddCommentThreadResponse",Xn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},createdAt:{type:"string",id:2},comments:{type:"CommentThreadAddedCommentDescriptor",rule:"repeated",id:3}}};class $n extends Ae{constructor(e,t,n=[],r,s=null,o=null,i=null,a=null,c=null){super(),this.documentId=e,this.commentThreadId=t,this.comments=n,this.context=r,this.resolvedBy=s,this.attributes=c,this.createdAt=o?new Date(o):"",this.resolvedAt=i?new Date(i):"",this.deletedAt=a?new Date(a):""}toJSON(){var e;return{commentThreadId:this.commentThreadId,context:this.context?JSON.stringify(this.context):this.context,documentId:this.documentId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt instanceof Date?this.resolvedAt.toISOString():this.resolvedAt,deletedAt:this.deletedAt instanceof Date?this.deletedAt.toISOString():this.deletedAt,createdAt:this.createdAt instanceof Date?this.createdAt.toISOString():this.createdAt,attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,comments:null===(e=this.comments)||void 0===e?void 0:e.map((e=>Mn.toJSON(e)))}}static fromJSON(e){var t;return new $n(e.documentId,e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((t=>Mn.fromJSON({...t,documentId:e.documentId,commentThreadId:e.commentThreadId}))),e.context?JSON.parse(e.context):e.context,e.resolvedBy,e.createdAt?new Date(e.createdAt):void 0,e.resolvedAt?new Date(e.resolvedAt):void 0,e.deletedAt?new Date(e.deletedAt):void 0,e.attributes?JSON.parse(e.attributes):e.attributes)}}$n.TYPE="140",$n.READABLE_TYPE_NAME="addCommentThread",$n.DESCRIPTOR_NAME="CommentsV2AddCommentThreadMessage",$n.DESCRIPTOR={fields:{documentId:{type:"string",id:1},commentThreadId:{type:"string",id:2},context:{type:"string",id:3},createdAt:{type:"string",id:4},resolvedAt:{type:"string",id:5},resolvedBy:{type:"string",id:6},attributes:{type:"string",id:7},deletedAt:{type:"string",id:8},comments:{type:"CommentDescriptor",rule:"repeated",id:9}}};class Zn extends Ae{constructor(e,t,n,r){super(),this.commentThreadId=e,this.documentId=t,this.resolvedBy=n,this.resolvedAt=r?new Date(r):void 0}toJSON(){var e;return{documentId:this.documentId,commentThreadId:this.commentThreadId,resolvedBy:this.resolvedBy,resolvedAt:null===(e=this.resolvedAt)||void 0===e?void 0:e.toISOString()}}static fromJSON(e){return new Zn(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}Zn.TYPE="142",Zn.READABLE_TYPE_NAME="resolveCommentThread",Zn.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadMessage",Zn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedBy:{type:"string",id:3},resolvedAt:{type:"string",id:4}}};class er extends Ae{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new er(e.commentThreadId,e.documentId)}}er.TYPE="141",er.READABLE_TYPE_NAME="reopenCommentThread",er.DESCRIPTOR_NAME="CommentsV2ReopenCommentThreadMessage",er.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};class tr extends Ae{constructor(e,t,n,r=null,s=null){super(),this.commentThreadId=e,this.documentId=t,this.context=n,this.attributes=r,this.unlinkedAt=s?new Date(s):""}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,context:this.context?JSON.stringify(this.context):this.context,attributes:this.attributes?JSON.stringify(this.attributes):null,unlinkedAt:this.unlinkedAt instanceof Date?this.unlinkedAt.toISOString():this.unlinkedAt}}static fromJSON(e){return new tr(e.commentThreadId,e.documentId,e.context?JSON.parse(e.context):e.context,e.attributes?JSON.parse(e.attributes):null,e.unlinkedAt?new Date(e.unlinkedAt):null)}}tr.TYPE="143",tr.READABLE_TYPE_NAME="updateCommentThread",tr.DESCRIPTOR_NAME="CommentsV2UpdateCommentThreadMessage",tr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},context:{type:"string",id:3},attributes:{type:"string",id:4},unlinkedAt:{type:"string",id:5}}};class nr extends Ae{constructor(e,t,n,r){super(),this.commentThreadId=e,this.documentId=t,this.resolvedBy=n,this.resolvedAt=new Date(r)}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt.toISOString()}}static fromJSON(e){return new nr(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}nr.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadResponse",nr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4}}};class rr extends((0,s.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==jt.CONNECTED)throw new Ye("WebSocket Gateway is not connected.",e);const t=new qn(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(9,qn.TYPE,Re.encode(t)),{channel:r,threads:s}=Re.decode(n,Gn);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Nt._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,r),this._isConnected=!0,this.fire("connected"),s}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._connectedSessions&&(this._connectedSessions.disconnect(),this._connectedSessions=void 0),this.fire("disconnected"),this.stopListening())}async addComment(e,t,n,r){const s=new Un(this._documentId,e,n,t,void 0,void 0,r),o=await this._sendRequest(Un.TYPE,s);return Re.decode(o,Jn)}async updateComment(e,t,n,r){const s=void 0!==r,o=new zn(this._documentId,e,t,n,r,s);await this._sendRequest(zn.TYPE,o)}async removeComment(e,t){const n=new Ln(this._documentId,e,t);await this._sendRequest(Ln.TYPE,n)}async removeCommentThread(e){const t=new Yn(this._documentId,e);await this._sendRequest(Yn.TYPE,t)}async addCommentThread(e){var t;const n=new $n(this._documentId,e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((t=>({...t,documentId:this._documentId,commentThreadId:e.commentThreadId}))),e.context,e.resolvedBy,e.createdAt,e.resolvedAt,e.deletedAt,e.attributes),r=await this._sendRequest($n.TYPE,n);return Re.decode(r,Xn)}async resolveCommentThread(e){const t=new Zn(e,this._documentId),n=await this._sendRequest(Zn.TYPE,t);return Re.decode(n,nr)}async reopenCommentThread(e){const t=new er(e,this._documentId);await this._sendRequest(er.TYPE,t)}async updateCommentThread(e){const t=new tr(e.commentThreadId,this._documentId,e.context,e.attributes,e.unlinkedAt);await this._sendRequest(tr.TYPE,t)}async getCommentThread(e,t=1){const n=new Hn(e,this._documentId);try{const e=await this._sendRequest(Hn.TYPE,n),t=Re.decode(e,Fn);return{commentThreadId:t.commentThreadId,comments:t.comments,attributes:t.attributes,context:t.context,resolvedAt:t.resolvedAt,resolvedBy:t.resolvedBy,deletedAt:t.deletedAt,unlinkedAt:t.unlinkedAt}}catch(n){if("CKEditorCloudServicesServerError"===n.name&&"404"===n.code&&t<5)return await(r=100*t,new Promise((e=>{setTimeout(e,r)}))),this.getCommentThread(e,t+1);if("CKEditorCloudServicesServerError"===n.name)throw n;throw ze.fromPublicError(n)}var r}async getDocumentThreads(){const e=new Kn(this._documentId),t=await this._sendRequest(Kn.TYPE,e),{threads:n}=Re.decode(t,Wn);return{threads:n}}async getConnectedSessions(){if(!this._isConnected)throw new Ft("Comments",this);return this._connectedSessions||(this._connectedSessions=await Pn.getConnectedSessions(this._wsGateway,this._documentId,9)),this._connectedSessions}_connectToChannel(e,t){this._channel=e._getChannel(rr._SERVICE,t),this._channel&&(this.listenTo(this._channel,this._channel.getEventName(Un.TYPE),((e,t)=>{const n=Re.decode(t,Un);this.fire("commentAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(Ln.TYPE),((e,t)=>{const n=Re.decode(t,Ln);this.fire("commentRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(zn.TYPE),((e,t)=>{const n=Re.decode(t,zn);this.fire("commentUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(Yn.TYPE),((e,t)=>{const n=Re.decode(t,Yn);this.fire("commentThreadRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName($n.TYPE),((e,t)=>{const n=Re.decode(t,$n);this.fire("commentThreadAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(tr.TYPE),((e,t)=>{const n=Re.decode(t,tr);this.fire("commentThreadUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(Zn.TYPE),((e,t)=>{const n=Re.decode(t,Zn);this.fire("commentThreadResolved",n)})),this.listenTo(this._channel,this._channel.getEventName(er.TYPE),((e,t)=>{const n=Re.decode(t,er);this.fire("commentThreadReopened",n)})))}_onWsGatewayStateChange(e){e===jt.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new Ft("Comments",this);return this._wsGateway._sendRequest(9,e,Re.encode(t))}}rr._SERVICE=9;const sr=rr,or=cr;!function(e){const t=cr,n=e();for(;;)try{if(284302===parseInt(t(145))/1+parseInt(t(141))/2*(parseInt(t(173))/3)+parseInt(t(176))/4+-parseInt(t(157))/5+-parseInt(t(149))/6*(-parseInt(t(153))/7)+parseInt(t(129))/8*(parseInt(t(114))/9)+parseInt(t(144))/10*(-parseInt(t(175))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(ar);class ir extends r.ContextPlugin{static get[or(138)](){return[or(117),o.Notification]}static get[or(125)](){return or(124)}constructor(e){const t=or;super(e),this[t(179)](t(116),jt[t(146)]),this[t(179)](t(123),!1),this[t(158)]=new Set,this[t(160)]=!1,this[t(115)]=Object[t(169)](s.DomEmitterMixin)}[or(150)](){const e=or,t=this[e(183)],n=t[e(128)][e(168)](e(117)),r=t[e(128)][e(168)](o.Notification);if(!n[e(136)])throw new s.CKEditorError(e(167),this);if(!n[e(135)])throw new s.CKEditorError(e(118),this);return this[e(115)][e(162)](window,e(180),(()=>this[e(123)]=!0)),this[e(115)][e(162)](window,e(131),(()=>this[e(123)]=!1)),this[e(183)][e(177)][e(154)](e(182),10),this[e(183)][e(177)][e(154)](e(151),20),ir[e(124)][e(186)](n[e(136)],n[e(135)],{timeout:1e3*this[e(183)][e(177)][e(168)](e(182)),requestTimeout:1e3*this[e(183)][e(177)][e(168)](e(151))})[e(161)]((t=>{const n=e;if(this[n(156)]=t,this[n(127)](n(116)).to(t,n(116),this,n(123),((e,t)=>(n(121)!==e&&(this[n(160)]=!0),t||e!==jt[n(146)]?jt[n(152)]:this[n(116)]==jt[n(152)]&&this[n(160)]?(this[n(160)]=!1,this[n(148)](),jt[n(126)]):jt[n(146)]))),this[n(156)].on(n(122),((e,t)=>{const o=n;if(o(166)!==t[o(137)])throw console[o(122)](t),new s.CKEditorError(o(155),null,{originalError:t});r[o(165)](o(140),{title:o(187),namespace:o(171)})})),!t.me)return new Promise((e=>t.on(n(120),e)))}))[e(170)]((t=>{const n=e;throw console[n(122)](t),new s.CKEditorError(n(155),null,{originalError:t})}))}[or(130)](e){const t=or;if(t(143)!=typeof e[t(172)])throw new s.CKEditorError(t(163),this);if(this[t(147)](e))throw new s.CKEditorError(t(174),this,{name:e[t(139)][t(125)]});this[t(158)][t(133)](e)}[or(181)](e){const t=or;this[t(158)][t(185)](e)}[or(147)](e){const t=or;return this[t(158)][t(164)](e)}[or(148)](){const e=or;return this[e(156)][e(172)]()[e(161)]((()=>Promise[e(159)](Array[e(134)](this[e(158)],(t=>t[e(172)]())))))[e(161)]((()=>this[e(116)]=jt[e(146)]))[e(170)]((t=>{const n=e;throw console[n(122)](t),new s.CKEditorError(n(132),this[n(183)])}))}[or(142)](){const e=or;this[e(156)]&&this[e(156)][e(184)](),this[e(116)]=jt[e(152)],this[e(115)][e(119)](),super[e(142)]()}}function ar(){const e=["cloudServices.requestTimeout","DISCONNECTED","193879eGUSqM","define","cloudservices-init","connection","1504635zpUIel","_reconnectionStack","all","_shouldPluginsReconnect","then","listenTo","websocketgateway-invalid-plugin-interface","has","showWarning","limitExceeded","websocketgateway-missing-token","get","create","catch","real-time-collaboration","reconnect","114PZAadg","websocketgateway-plugin-already-registered","8353796eHkyOk","782124gOtZOU","config","initialReconnectionInterval","set","offline","removeFromReconnectionStack","cloudServices.connectionTimeout","context","disconnect","delete","connect","Connected users limit exceeded","298314cqiCEL","_domEmitter","state","CloudServices","websocketgateway-missing-websocket-url","stopListening","change:me","connected","error","_isBrowserOffline","WebSocketGateway","pluginName","CONNECTING","bind","plugins","72uBAJiq","addToReconnectionStack","online","cloudservices-reconnection-error","add","from","webSocketUrl","token","code","requires","constructor","The limit of maximum concurrent connections that the collaboration server can handle has been reached. Try opening the document again in a few minutes. Please contact your system administrator if the problem persists.","25966QHenkj","destroy","function","10yAXHEp","191284bogoFs","CONNECTED","isInReconnectionStack","_reconnect","36jBBglT","init"];return(ar=function(){return e})()}function cr(e,t){const n=ar();return(cr=function(e,t){return n[e-=114]})(e,t)}ir[or(124)]=Nt,ir[or(178)]=1e3;const dr=ir;var ur=__webpack_require__(211);const lr=pr;function pr(e,t){const n=hr();return(pr=function(e,t){return n[e-=431]})(e,t)}function hr(){const e=["stopListening","_handleSessionAdd","allConnectedUsers","sessionId","_users","_uniqueUsersCount","945280BGGwIN","defineMe","344050kddjyz","759225swYGpK","isMe","unregister","addUser","requires","state","477100GDmzBa","_createUser","18XQdPWE","channelSessions","sessions-register-already-registered","156680vgNMwN","has","change:state","connected","orderNumber","register","delete","get","add","287070aodKHY","2781LaSvMa","values","fire","plugins","role","remove","forEach","pluginName","_handleSessionRemove","sessions-unregister-not-exist","_registeredSessions","clear","user","Sessions","size","8QwpdyG","channelConnectedUsers","connection","getUserSessions","assign","getUser","context","mySessionId","getUserBySessionId","listenTo","sessionAdd:","set","init","getUserRole"];return(hr=function(){return e})()}!function(e){const t=pr,n=e();for(;;)try{if(212841===parseInt(t(452))/1+-parseInt(t(440))/2+-parseInt(t(441))/3+parseInt(t(438))/4+parseInt(t(447))/5*(parseInt(t(449))/6)+-parseInt(t(461))/7+parseInt(t(477))/8*(-parseInt(t(462))/9))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(hr);class fr extends r.ContextPlugin{static get[lr(469)](){return lr(475)}static get[lr(445)](){return[dr,ur.Users]}constructor(e){const t=lr;super(e),this[t(450)]=new Map,this[t(478)]=new Map,this[t(434)]=new s.Collection,this[t(472)]=new Map,this[t(437)]=0,this[t(436)]=this[t(483)][t(465)][t(459)](ur.Users)}[lr(489)](){const e=lr,t=this[e(483)][e(465)][e(459)](dr);this[e(486)](t,e(454),((t,n,r)=>{const s=e;if(s(455)!==r)this[s(450)][s(468)]((e=>e[s(473)]())),this[s(478)][s(468)]((e=>e[s(473)]())),this[s(434)][s(473)]();else for(const[e,t]of this[s(472)])for(const n of t)this[s(433)](e,n)})),this[e(448)](t[e(479)].me,!0)}[lr(457)](e,t){const n=lr;if(this[n(472)][n(453)](e))throw new s.CKEditorError(n(451),null,{channelId:e});this[n(472)][n(488)](e,t),this[n(450)][n(488)](e,new s.Collection),this[n(478)][n(488)](e,new s.Collection),this[n(486)](t,n(460),((t,r)=>this[n(433)](e,r))),this[n(486)](t,n(467),((t,r)=>this[n(470)](e,r)));for(const r of t)this[n(433)](e,r)}[lr(443)](e){const t=lr;if(!this[t(472)][t(453)](e))throw new s.CKEditorError(t(471),null,{channelId:e});const n=this[t(472)][t(459)](e);this[t(432)](n);for(const r of n)t(455)===this[t(483)][t(465)][t(459)](dr)[t(446)]&&this[t(470)](e,r);this[t(472)][t(458)](e),this[t(450)][t(458)](e),this[t(478)][t(458)](e)}get[lr(484)](){const e=lr;return this[e(483)][e(465)][e(459)](dr)[e(479)][e(435)]}[lr(485)](e){const t=lr;for(const n of this[t(450)][t(463)]())for(const r of n)if(r.id===e)return r[t(474)]}[lr(480)](e,t){const n=lr,r=t?[this[n(450)][n(459)](t)]:this[n(450)][n(463)](),s=new Set;for(const t of r)for(const r of t)r[n(474)].id===e.id&&s[n(460)](r.id);return s}[lr(431)](e){const t=lr;for(const n of this[t(450)][t(463)]())for(const r of n)if(r[t(474)]===e)return r[t(466)]}[lr(433)](e,t){const n=lr;if(n(455)!==this[n(483)][n(465)][n(459)](dr)[n(446)])return;const r=t[n(474)],s=this[n(436)][n(482)](r.id)||this[n(448)](r),o=Object[n(481)]({},t,{user:s});this[n(450)][n(459)](e)[n(460)](o);const i=this[n(478)][n(459)](e);i[n(453)](s.id)||i[n(460)](s),this[n(434)][n(453)](s.id)||this[n(434)][n(460)](s,s[n(442)]?0:void 0),this[n(464)](n(487)+e,{channelId:e,session:o})}[lr(470)](e,t){const n=lr;if(n(455)!==this[n(483)][n(465)][n(459)](dr)[n(446)])return;const r=this[n(478)][n(459)](e),s=t[n(474)];s.id&&(this[n(450)][n(459)](e)[n(467)](t.id),r[n(453)](s.id)&&!this[n(480)](s,e)[n(476)]&&r[n(467)](s.id),this[n(434)][n(459)](s.id)&&!this[n(480)](s)[n(476)]&&this[n(434)][n(467)](s.id))}[lr(448)](e,t){const n=lr,r=this[n(436)][n(444)](e);return t&&this[n(436)][n(439)](e.id),r[n(456)]=this[n(437)]++,r}}var mr=__webpack_require__(673),yr=__webpack_require__.n(mr),gr=__webpack_require__(535),br={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};yr()(gr.A,br);gr.A.locals;const Or=Ir;function wr(){const e=["name","mouseenter","checkChild","newRange","ck-user__marker_hovered","hasDomSelection","start","afterInit","marker","Escape","editingDowncast","user:position:","rootName","stopListening","mySessionId","schema","createUIElement","_createdBatches","parent","markerName","$graveyard","classList","contenteditable","toDomElement","nodeAfter","createUserMarkerOperations","isCollapsed","createRange","171EBGHzF","highest","color","markerToHighlight","model","remove","listenTo","data-session-id","get","fromRange","UserMarkers","setCustomProperty","isInline","user:position","ck-user__selection","ck-user__marker ","1914183OInYsI","markerToElement","batch","editing","$text","tableCell","63240sInyGT","removeMarker","startsWith","mouseleave","isLimit","update:user:range","addEventListener","view","innerHTML",'⁠<span class="ck-user__marker-line" contenteditable="false"><span class="ck-user__marker-dot"></span></span><span class="ck-user__marker-tooltip" contenteditable="false" spellcheck="false">',"getAttribute","conversion","deletionPosition","getNearestSelectionRange","_domEmitter","getContainedElement","mapper","oldRange","getRange","split","user:range","markers","has","keydown","commands","markerRange","destroy","root","6afeSjr","delete","isSimilar","change","2297316kCHpAJ","markerNameToElements","undo","2713550CGJDUJ","type","getStart","enqueueChange","215255LPdmWu","90120GEvfCj","user:range:","getFirstRange","editor","end","for","change:range","reconvertMarker","</span>⁠","applyOperation","pluginName","getMarkerClass","document","span","3056136cCIZLA","detach","updateMarker","requires","getSelectionClass","clear","element","addMarker","orderNumber","add","selection","hasContent","user:","userPositionMarker","init","removeClass","set","size","getUserBySessionId","76ZaCATT","isObject","plugins","render","toRange","getCustomProperty","getPositions"];return(wr=function(){return e})()}function Ir(e,t){const n=wr();return(Ir=function(e,t){return n[e-=470]})(e,t)}!function(e){const t=Ir,n=e();for(;;)try{if(432695===parseInt(t(539))/1*(parseInt(t(528))/2)+parseInt(t(494))/3+parseInt(t(573))/4*(-parseInt(t(540))/5)+-parseInt(t(532))/6+-parseInt(t(535))/7+parseInt(t(554))/8+-parseInt(t(478))/9*(parseInt(t(500))/10))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(wr);class vr extends r.Plugin{constructor(){const e=Ir;super(...arguments),this[e(514)]=new((0,s.DomEmitterMixin)())}static get[Or(557)](){return[fr]}static get[Or(550)](){return Or(488)}[Or(568)](){const e=Or,t=this[e(543)],n=t[e(575)][e(486)](fr);t[e(511)][e(545)](e(590))[e(495)]({model:e(491),view:(r,{writer:s})=>function(t,n,r,s){const o=e,i=t[o(599)][o(519)](":")[2],a=r[o(572)](i);if(!a||i===r[o(594)])return;if(!s[o(482)][o(595)][o(582)](t[o(525)][o(586)],o(498)))return;const c={class:o(493)+a[o(480)][o(551)](),"data-name":a[o(580)],"data-session-id":i},d=s[o(482)][o(521)][o(486)](t[o(599)])[o(537)](),u=d[o(474)],l=s[o(482)][o(595)];if(u&&l[o(574)](u)&&l[o(490)](u)&&!s[o(482)][o(521)][o(486)](o(541)+i)[o(518)]()[o(476)])return;const p=d[o(598)];return s[o(482)][o(595)][o(504)](p)&&!s[o(482)][o(565)](p)&&(c[o(472)]=!1),function(e,t,n){const r=o,s=e[r(596)](r(553),t);return e[r(489)](r(567),!0,s),s[r(576)]=function(e){const t=r,s=this[t(473)](e);return s[t(508)]=t(509)+n[t(580)]+t(548),s[t(506)](t(581),(()=>{const e=t;s[e(471)][e(563)](e(584))})),s[t(506)](t(503),(()=>{const e=t;s[e(471)][e(483)](e(584))})),s},s[r(530)]=function(e){const t=r;return!(!this[t(578)](t(567))||!e[t(578)](t(567))||this[t(510)](t(485))!=e[t(510)](t(485)))},s}(n,c,a)}(r,s,n,t)}),t[e(511)][e(545)](e(590))[e(481)]({model:e(520),view:t=>function(t,n){const r=e,s=t[r(599)][r(519)](":")[2];if(s===n[r(594)])return null;const o=n[r(572)](s);return o?{id:s,classes:[r(492),o[r(480)][r(558)]()],attributes:{"data-session-id":s},priority:2e3+o[r(562)]}:{id:s,classes:[]}}(t,n)}),function(t){const n=e,r=t[n(482)],s=new Map,o=t[n(575)][n(486)](fr);r[n(521)].on(n(505),((e,a,c,d)=>{const u=n;if(!d&&s[u(486)](a[u(580)]))return s[u(486)](a[u(580)])[u(555)](),void s[u(529)](a[u(580)]);const l=a[u(580)][u(519)](":")[2];if(l===o[u(594)])return;const p=u(591)+l;r[u(521)][u(522)](p)&&t[u(497)][u(547)](p),a.on(u(546),((e,t,n)=>{const o=u;if(o(470)!=t[o(527)][o(592)]&&o(470)==a[o(518)]()[o(527)][o(592)]&&!s[o(522)](a[o(580)])){const e=r[o(595)][o(513)](n[o(512)]);if(e){const t=i.LiveRange[o(487)](e);s[o(570)](a[o(580)],t),t.on(o(546),((e,n,i)=>{const c=o;if(c(470)==t[c(527)][c(592)]){const e=r[c(595)][c(513)](i[c(512)]);e?(t[c(586)]=e[c(586)],t[c(544)]=e[c(544)]):(s[c(529)](a[c(580)]),t[c(555)]())}}))}}}))})),r[n(552)].on(n(531),(()=>{const e=n;s[e(571)]>0&&r[e(538)]({isUndoable:!1},(t=>{const n=e;for(const[e,o]of s)n(470)==r[n(521)][n(486)](e)[n(518)]()[n(527)][n(592)]&&(Sr(e[n(519)](":")[2],o[n(577)](),r,t),o[n(555)]());s[n(559)]()}))}))}(t),this[e(514)][e(484)](s.global[e(552)],e(523),((n,{key:r})=>{const s=e;s(589)===r&&function(e){const t=s;e[t(497)][t(507)][t(531)]((n=>{const r=t;for(const t of e[r(482)][r(521)]){if(!t[r(580)][r(502)](r(491)))continue;const s=e[r(497)][r(516)][r(533)](t[r(580)]);if(s)for(const e of s)n[r(569)](r(584),e)}}))}(t)}),{useCapture:!0})}[Or(587)](){const e=Or,t=this[e(543)],n=t[e(524)][e(486)](e(534));n&&t[e(482)].on(e(549),((r,s)=>{const o=e,i=s[0];if(o(588)!=i[o(536)]||!i[o(580)][o(502)](o(566)))return;const a=i[o(496)];n[o(597)][o(522)](a)&&(i[o(583)]=i[o(517)]?t[o(482)][o(477)](i[o(517)][o(586)],i[o(517)][o(544)]):null)}),{priority:e(479)})}[Or(526)](){const e=Or;return this[e(514)][e(593)](),super[e(526)]()}[Or(475)](){const e=Or,t=this[e(543)],n=t[e(482)][e(552)],r=t[e(575)][e(486)](fr);t[e(482)][e(538)]({isUndoable:!1},(s=>{const o=e,i=o(541)+r[o(594)],a=o(591)+r[o(594)],c=t[o(482)][o(521)][o(522)](i);t[o(497)][o(507)][o(585)]?Sr(r[o(594)],n[o(564)][o(542)](),t[o(482)],s):c&&(s[o(501)](i),s[o(501)](a))}))}}function Sr(e,t,n,r){const s=Or,o=s(541)+e,i=s(591)+e,a=t[s(515)]();let c=t[s(586)];a&&a.is(s(560),s(499))&&(c=function(e,t){const n=s;for(const r of e[n(579)]())if(t[n(595)][n(582)](r,n(498)))return r}(t,n),t=r[s(477)](c));const d=r[s(477)](c);n[s(521)][s(522)](o)?(r[s(556)](o,{range:t}),r[s(556)](i,{range:d})):(r[s(561)](o,{range:t,usingOperation:!0}),r[s(561)](i,{range:d,usingOperation:!0}))}function Ar(e,t,n){const r=e.t;switch(t){case"PENDING_ACTION_SENDING_DATA":return r({string:"Sending data to the server.",id:"PENDING_ACTION_SENDING_DATA"});case"The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.":return r("The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.");case"The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.":return r("The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.");case"The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.":return r("The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.");case"The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.":return r("The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.");case"Synchronization issue":return r("Synchronization issue");case"PENDING_ACTION_REVISION_HISTORY":return r({string:"Unsaved change in revision history.",id:"PENDING_ACTION_REVISION_HISTORY"});case"CONNECTED_USERS":return r({string:"1 connected user (me)",plural:"%0 connected users",id:"CONNECTED_USERS"},n);default:return""}}const Pr=Te.Reader,Tr=Te.Writer,_r=Te.util,kr=Te.roots.default||(Te.roots.default={}),Cr=kr.AttributeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.range=null,e.prototype.key="",e.prototype.oldValueBoolean=!1,e.prototype.oldValueJson="",e.prototype.newValueBoolean=!1,e.prototype.newValueJson="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Tr.create()),null!=e.range&&Object.hasOwnProperty.call(e,"range")&&kr.Range.encode(e.range,t.uint32(10).fork()).ldelim(),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(18).string(e.key),null!=e.oldValueBoolean&&Object.hasOwnProperty.call(e,"oldValueBoolean")&&t.uint32(24).bool(e.oldValueBoolean),null!=e.oldValueJson&&Object.hasOwnProperty.call(e,"oldValueJson")&&t.uint32(34).string(e.oldValueJson),null!=e.newValueBoolean&&Object.hasOwnProperty.call(e,"newValueBoolean")&&t.uint32(40).bool(e.newValueBoolean),null!=e.newValueJson&&Object.hasOwnProperty.call(e,"newValueJson")&&t.uint32(50).string(e.newValueJson),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(56).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Pr||(e=Pr.create(e));let n=void 0===t?e.len:e.pos+t,r=new kr.AttributeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.range=kr.Range.decode(e,e.uint32());break;case 2:r.key=e.string();break;case 3:r.oldValueBoolean=e.bool();break;case 4:r.oldValueJson=e.string();break;case 5:r.newValueBoolean=e.bool();break;case 6:r.newValueJson=e.string();break;case 7:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Pr||(e=new Pr(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.range&&e.hasOwnProperty("range")){let t=kr.Range.verify(e.range);if(t)return"range."+t}return null!=e.key&&e.hasOwnProperty("key")&&!_r.isString(e.key)?"key: string expected":null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&"boolean"!=typeof e.oldValueBoolean?"oldValueBoolean: boolean expected":null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&!_r.isString(e.oldValueJson)?"oldValueJson: string expected":null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&"boolean"!=typeof e.newValueBoolean?"newValueBoolean: boolean expected":null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&!_r.isString(e.newValueJson)?"newValueJson: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof kr.AttributeOperation)return e;let t=new kr.AttributeOperation;if(null!=e.range){if("object"!=typeof e.range)throw TypeError(".AttributeOperation.range: object expected");t.range=kr.Range.fromObject(e.range)}return null!=e.key&&(t.key=String(e.key)),null!=e.oldValueBoolean&&(t.oldValueBoolean=Boolean(e.oldValueBoolean)),null!=e.oldValueJson&&(t.oldValueJson=String(e.oldValueJson)),null!=e.newValueBoolean&&(t.newValueBoolean=Boolean(e.newValueBoolean)),null!=e.newValueJson&&(t.newValueJson=String(e.newValueJson)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.range=null,n.key="",n.oldValueBoolean=!1,n.oldValueJson="",n.newValueBoolean=!1,n.newValueJson="",n.wasUndone=!1),null!=e.range&&e.hasOwnProperty("range")&&(n.range=kr.Range.toObject(e.range,t)),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&(n.oldValueBoolean=e.oldValueBoolean),null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&(n.oldValueJson=e.oldValueJson),null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&(n.newValueBoolean=e.newValueBoolean),null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&(n.newValueJson=e.newValueJson),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/AttributeOperation"},e})(),Er=kr.InsertOperation=(()=>{function e(e){if(this.nodes=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.position=null,e.prototype.nodes=_r.emptyArray,e.prototype.shouldReceiveAttributes=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Tr.create()),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&kr.Position.encode(e.position,t.uint32(10).fork()).ldelim(),null!=e.nodes&&e.nodes.length)for(let n=0;n<e.nodes.length;++n)kr.Element.encode(e.nodes[n],t.uint32(18).fork()).ldelim();return null!=e.shouldReceiveAttributes&&Object.hasOwnProperty.call(e,"shouldReceiveAttributes")&&t.uint32(24).bool(e.shouldReceiveAttributes),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Pr||(e=Pr.create(e));let n=void 0===t?e.len:e.pos+t,r=new kr.InsertOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.position=kr.Position.decode(e,e.uint32());break;case 2:r.nodes&&r.nodes.length||(r.nodes=[]),r.nodes.push(kr.Element.decode(e,e.uint32()));break;case 3:r.shouldReceiveAttributes=e.bool();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Pr||(e=new Pr(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.position&&e.hasOwnProperty("position")){let t=kr.Position.verify(e.position);if(t)return"position."+t}if(null!=e.nodes&&e.hasOwnProperty("nodes")){if(!Array.isArray(e.nodes))return"nodes: array expected";for(let t=0;t<e.nodes.length;++t){let n=kr.Element.verify(e.nodes[t]);if(n)return"nodes."+n}}return null!=e.shouldReceiveAttributes&&e.hasOwnProperty("shouldReceiveAttributes")&&"boolean"!=typeof e.shouldReceiveAttributes?"shouldReceiveAttributes: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof kr.InsertOperation)return e;let t=new kr.InsertOperation;if(null!=e.position){if("object"!=typeof e.position)throw TypeError(".InsertOperation.position: object expected");t.position=kr.Position.fromObject(e.position)}if(e.nodes){if(!Array.isArray(e.nodes))throw TypeError(".InsertOperation.nodes: array expected");t.nodes=[];for(let n=0;n<e.nodes.length;++n){if("object"!=typeof e.nodes[n])throw TypeError(".InsertOperation.nodes: object expected");t.nodes[n]=kr.Element.fromObject(e.nodes[n])}}return null!=e.shouldReceiveAttributes&&(t.shouldReceiveAttributes=Boolean(e.shouldReceiveAttributes)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.nodes=[]),t.defaults&&(n.position=null,n.shouldReceiveAttributes=!1,n.wasUndone=!1),null!=e.position&&e.hasOwnProperty("position")&&(n.position=kr.Position.toObject(e.position,t)),e.nodes&&e.nodes.length){n.nodes=[];for(let r=0;r<e.nodes.length;++r)n.nodes[r]=kr.Element.toObject(e.nodes[r],t)}return null!=e.shouldReceiveAttributes&&e.hasOwnProperty("shouldReceiveAttributes")&&(n.shouldReceiveAttributes=e.shouldReceiveAttributes),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/InsertOperation"},e})(),jr=kr.MarkerOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.oldRange=null,e.prototype.newRange=null,e.prototype.affectsData=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Tr.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.oldRange&&Object.hasOwnProperty.call(e,"oldRange")&&kr.Range.encode(e.oldRange,t.uint32(18).fork()).ldelim(),null!=e.newRange&&Object.hasOwnProperty.call(e,"newRange")&&kr.Range.encode(e.newRange,t.uint32(26).fork()).ldelim(),null!=e.affectsData&&Object.hasOwnProperty.call(e,"affectsData")&&t.uint32(32).bool(e.affectsData),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Pr||(e=Pr.create(e));let n=void 0===t?e.len:e.pos+t,r=new kr.MarkerOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.name=e.string();break;case 2:r.oldRange=kr.Range.decode(e,e.uint32());break;case 3:r.newRange=kr.Range.decode(e,e.uint32());break;case 4:r.affectsData=e.bool();break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Pr||(e=new Pr(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!_r.isString(e.name))return"name: string expected";if(null!=e.oldRange&&e.hasOwnProperty("oldRange")){let t=kr.Range.verify(e.oldRange);if(t)return"oldRange."+t}if(null!=e.newRange&&e.hasOwnProperty("newRange")){let t=kr.Range.verify(e.newRange);if(t)return"newRange."+t}return null!=e.affectsData&&e.hasOwnProperty("affectsData")&&"boolean"!=typeof e.affectsData?"affectsData: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof kr.MarkerOperation)return e;let t=new kr.MarkerOperation;if(null!=e.name&&(t.name=String(e.name)),null!=e.oldRange){if("object"!=typeof e.oldRange)throw TypeError(".MarkerOperation.oldRange: object expected");t.oldRange=kr.Range.fromObject(e.oldRange)}if(null!=e.newRange){if("object"!=typeof e.newRange)throw TypeError(".MarkerOperation.newRange: object expected");t.newRange=kr.Range.fromObject(e.newRange)}return null!=e.affectsData&&(t.affectsData=Boolean(e.affectsData)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.name="",n.oldRange=null,n.newRange=null,n.affectsData=!1,n.wasUndone=!1),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.oldRange&&e.hasOwnProperty("oldRange")&&(n.oldRange=kr.Range.toObject(e.oldRange,t)),null!=e.newRange&&e.hasOwnProperty("newRange")&&(n.newRange=kr.Range.toObject(e.newRange,t)),null!=e.affectsData&&e.hasOwnProperty("affectsData")&&(n.affectsData=e.affectsData),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MarkerOperation"},e})(),Rr=kr.MergeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sourcePosition=null,e.prototype.targetPosition=null,e.prototype.graveyardPosition=null,e.prototype.howMany=0,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Tr.create()),null!=e.sourcePosition&&Object.hasOwnProperty.call(e,"sourcePosition")&&kr.Position.encode(e.sourcePosition,t.uint32(10).fork()).ldelim(),null!=e.targetPosition&&Object.hasOwnProperty.call(e,"targetPosition")&&kr.Position.encode(e.targetPosition,t.uint32(18).fork()).ldelim(),null!=e.graveyardPosition&&Object.hasOwnProperty.call(e,"graveyardPosition")&&kr.Position.encode(e.graveyardPosition,t.uint32(26).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(32).uint32(e.howMany),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Pr||(e=Pr.create(e));let n=void 0===t?e.len:e.pos+t,r=new kr.MergeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.sourcePosition=kr.Position.decode(e,e.uint32());break;case 2:r.targetPosition=kr.Position.decode(e,e.uint32());break;case 3:r.graveyardPosition=kr.Position.decode(e,e.uint32());break;case 4:r.howMany=e.uint32();break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Pr||(e=new Pr(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")){let t=kr.Position.verify(e.sourcePosition);if(t)return"sourcePosition."+t}if(null!=e.targetPosition&&e.hasOwnProperty("targetPosition")){let t=kr.Position.verify(e.targetPosition);if(t)return"targetPosition."+t}if(null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")){let t=kr.Position.verify(e.graveyardPosition);if(t)return"graveyardPosition."+t}return null!=e.howMany&&e.hasOwnProperty("howMany")&&!_r.isInteger(e.howMany)?"howMany: integer expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof kr.MergeOperation)return e;let t=new kr.MergeOperation;if(null!=e.sourcePosition){if("object"!=typeof e.sourcePosition)throw TypeError(".MergeOperation.sourcePosition: object expected");t.sourcePosition=kr.Position.fromObject(e.sourcePosition)}if(null!=e.targetPosition){if("object"!=typeof e.targetPosition)throw TypeError(".MergeOperation.targetPosition: object expected");t.targetPosition=kr.Position.fromObject(e.targetPosition)}if(null!=e.graveyardPosition){if("object"!=typeof e.graveyardPosition)throw TypeError(".MergeOperation.graveyardPosition: object expected");t.graveyardPosition=kr.Position.fromObject(e.graveyardPosition)}return null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.sourcePosition=null,n.targetPosition=null,n.graveyardPosition=null,n.howMany=0,n.wasUndone=!1),null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")&&(n.sourcePosition=kr.Position.toObject(e.sourcePosition,t)),null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(n.targetPosition=kr.Position.toObject(e.targetPosition,t)),null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=kr.Position.toObject(e.graveyardPosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MergeOperation"},e})(),Dr=kr.MoveOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sourcePosition=null,e.prototype.howMany=0,e.prototype.targetPosition=null,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Tr.create()),null!=e.sourcePosition&&Object.hasOwnProperty.call(e,"sourcePosition")&&kr.Position.encode(e.sourcePosition,t.uint32(10).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(16).uint32(e.howMany),null!=e.targetPosition&&Object.hasOwnProperty.call(e,"targetPosition")&&kr.Position.encode(e.targetPosition,t.uint32(26).fork()).ldelim(),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Pr||(e=Pr.create(e));let n=void 0===t?e.len:e.pos+t,r=new kr.MoveOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.sourcePosition=kr.Position.decode(e,e.uint32());break;case 2:r.howMany=e.uint32();break;case 3:r.targetPosition=kr.Position.decode(e,e.uint32());break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Pr||(e=new Pr(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")){let t=kr.Position.verify(e.sourcePosition);if(t)return"sourcePosition."+t}if(null!=e.howMany&&e.hasOwnProperty("howMany")&&!_r.isInteger(e.howMany))return"howMany: integer expected";if(null!=e.targetPosition&&e.hasOwnProperty("targetPosition")){let t=kr.Position.verify(e.targetPosition);if(t)return"targetPosition."+t}return null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof kr.MoveOperation)return e;let t=new kr.MoveOperation;if(null!=e.sourcePosition){if("object"!=typeof e.sourcePosition)throw TypeError(".MoveOperation.sourcePosition: object expected");t.sourcePosition=kr.Position.fromObject(e.sourcePosition)}if(null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.targetPosition){if("object"!=typeof e.targetPosition)throw TypeError(".MoveOperation.targetPosition: object expected");t.targetPosition=kr.Position.fromObject(e.targetPosition)}return null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.sourcePosition=null,n.howMany=0,n.targetPosition=null,n.wasUndone=!1),null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")&&(n.sourcePosition=kr.Position.toObject(e.sourcePosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(n.targetPosition=kr.Position.toObject(e.targetPosition,t)),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MoveOperation"},e})(),Nr=kr.RenameOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.position=null,e.prototype.oldName="",e.prototype.newName="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Tr.create()),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&kr.Position.encode(e.position,t.uint32(10).fork()).ldelim(),null!=e.oldName&&Object.hasOwnProperty.call(e,"oldName")&&t.uint32(18).string(e.oldName),null!=e.newName&&Object.hasOwnProperty.call(e,"newName")&&t.uint32(26).string(e.newName),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Pr||(e=Pr.create(e));let n=void 0===t?e.len:e.pos+t,r=new kr.RenameOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.position=kr.Position.decode(e,e.uint32());break;case 2:r.oldName=e.string();break;case 3:r.newName=e.string();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Pr||(e=new Pr(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.position&&e.hasOwnProperty("position")){let t=kr.Position.verify(e.position);if(t)return"position."+t}return null!=e.oldName&&e.hasOwnProperty("oldName")&&!_r.isString(e.oldName)?"oldName: string expected":null!=e.newName&&e.hasOwnProperty("newName")&&!_r.isString(e.newName)?"newName: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof kr.RenameOperation)return e;let t=new kr.RenameOperation;if(null!=e.position){if("object"!=typeof e.position)throw TypeError(".RenameOperation.position: object expected");t.position=kr.Position.fromObject(e.position)}return null!=e.oldName&&(t.oldName=String(e.oldName)),null!=e.newName&&(t.newName=String(e.newName)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.position=null,n.oldName="",n.newName="",n.wasUndone=!1),null!=e.position&&e.hasOwnProperty("position")&&(n.position=kr.Position.toObject(e.position,t)),null!=e.oldName&&e.hasOwnProperty("oldName")&&(n.oldName=e.oldName),null!=e.newName&&e.hasOwnProperty("newName")&&(n.newName=e.newName),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RenameOperation"},e})(),xr=kr.RootAttributeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.root="",e.prototype.key="",e.prototype.oldValueBoolean=!1,e.prototype.oldValueJson="",e.prototype.newValueBoolean=!1,e.prototype.newValueJson="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Tr.create()),null!=e.root&&Object.hasOwnProperty.call(e,"root")&&t.uint32(10).string(e.root),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(18).string(e.key),null!=e.oldValueBoolean&&Object.hasOwnProperty.call(e,"oldValueBoolean")&&t.uint32(24).bool(e.oldValueBoolean),null!=e.oldValueJson&&Object.hasOwnProperty.call(e,"oldValueJson")&&t.uint32(34).string(e.oldValueJson),null!=e.newValueBoolean&&Object.hasOwnProperty.call(e,"newValueBoolean")&&t.uint32(40).bool(e.newValueBoolean),null!=e.newValueJson&&Object.hasOwnProperty.call(e,"newValueJson")&&t.uint32(50).string(e.newValueJson),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(56).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Pr||(e=Pr.create(e));let n=void 0===t?e.len:e.pos+t,r=new kr.RootAttributeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.root=e.string();break;case 2:r.key=e.string();break;case 3:r.oldValueBoolean=e.bool();break;case 4:r.oldValueJson=e.string();break;case 5:r.newValueBoolean=e.bool();break;case 6:r.newValueJson=e.string();break;case 7:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Pr||(e=new Pr(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.root&&e.hasOwnProperty("root")&&!_r.isString(e.root)?"root: string expected":null!=e.key&&e.hasOwnProperty("key")&&!_r.isString(e.key)?"key: string expected":null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&"boolean"!=typeof e.oldValueBoolean?"oldValueBoolean: boolean expected":null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&!_r.isString(e.oldValueJson)?"oldValueJson: string expected":null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&"boolean"!=typeof e.newValueBoolean?"newValueBoolean: boolean expected":null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&!_r.isString(e.newValueJson)?"newValueJson: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof kr.RootAttributeOperation)return e;let t=new kr.RootAttributeOperation;return null!=e.root&&(t.root=String(e.root)),null!=e.key&&(t.key=String(e.key)),null!=e.oldValueBoolean&&(t.oldValueBoolean=Boolean(e.oldValueBoolean)),null!=e.oldValueJson&&(t.oldValueJson=String(e.oldValueJson)),null!=e.newValueBoolean&&(t.newValueBoolean=Boolean(e.newValueBoolean)),null!=e.newValueJson&&(t.newValueJson=String(e.newValueJson)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.root="",n.key="",n.oldValueBoolean=!1,n.oldValueJson="",n.newValueBoolean=!1,n.newValueJson="",n.wasUndone=!1),null!=e.root&&e.hasOwnProperty("root")&&(n.root=e.root),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&(n.oldValueBoolean=e.oldValueBoolean),null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&(n.oldValueJson=e.oldValueJson),null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&(n.newValueBoolean=e.newValueBoolean),null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&(n.newValueJson=e.newValueJson),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RootAttributeOperation"},e})(),Vr=kr.RootOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.rootName="",e.prototype.elementName="",e.prototype.isAdd=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Tr.create()),null!=e.rootName&&Object.hasOwnProperty.call(e,"rootName")&&t.uint32(10).string(e.rootName),null!=e.elementName&&Object.hasOwnProperty.call(e,"elementName")&&t.uint32(18).string(e.elementName),null!=e.isAdd&&Object.hasOwnProperty.call(e,"isAdd")&&t.uint32(24).bool(e.isAdd),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Pr||(e=Pr.create(e));let n=void 0===t?e.len:e.pos+t,r=new kr.RootOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.rootName=e.string();break;case 2:r.elementName=e.string();break;case 3:r.isAdd=e.bool();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Pr||(e=new Pr(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.rootName&&e.hasOwnProperty("rootName")&&!_r.isString(e.rootName)?"rootName: string expected":null!=e.elementName&&e.hasOwnProperty("elementName")&&!_r.isString(e.elementName)?"elementName: string expected":null!=e.isAdd&&e.hasOwnProperty("isAdd")&&"boolean"!=typeof e.isAdd?"isAdd: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof kr.RootOperation)return e;let t=new kr.RootOperation;return null!=e.rootName&&(t.rootName=String(e.rootName)),null!=e.elementName&&(t.elementName=String(e.elementName)),null!=e.isAdd&&(t.isAdd=Boolean(e.isAdd)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.rootName="",n.elementName="",n.isAdd=!1,n.wasUndone=!1),null!=e.rootName&&e.hasOwnProperty("rootName")&&(n.rootName=e.rootName),null!=e.elementName&&e.hasOwnProperty("elementName")&&(n.elementName=e.elementName),null!=e.isAdd&&e.hasOwnProperty("isAdd")&&(n.isAdd=e.isAdd),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RootOperation"},e})(),Mr=kr.SplitOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.splitPosition=null,e.prototype.graveyardPosition=null,e.prototype.howMany=0,e.prototype.insertionPosition=null,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Tr.create()),null!=e.splitPosition&&Object.hasOwnProperty.call(e,"splitPosition")&&kr.Position.encode(e.splitPosition,t.uint32(10).fork()).ldelim(),null!=e.graveyardPosition&&Object.hasOwnProperty.call(e,"graveyardPosition")&&kr.Position.encode(e.graveyardPosition,t.uint32(18).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(24).uint32(e.howMany),null!=e.insertionPosition&&Object.hasOwnProperty.call(e,"insertionPosition")&&kr.Position.encode(e.insertionPosition,t.uint32(34).fork()).ldelim(),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Pr||(e=Pr.create(e));let n=void 0===t?e.len:e.pos+t,r=new kr.SplitOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.splitPosition=kr.Position.decode(e,e.uint32());break;case 2:r.graveyardPosition=kr.Position.decode(e,e.uint32());break;case 3:r.howMany=e.uint32();break;case 4:r.insertionPosition=kr.Position.decode(e,e.uint32());break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Pr||(e=new Pr(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.splitPosition&&e.hasOwnProperty("splitPosition")){let t=kr.Position.verify(e.splitPosition);if(t)return"splitPosition."+t}if(null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")){let t=kr.Position.verify(e.graveyardPosition);if(t)return"graveyardPosition."+t}if(null!=e.howMany&&e.hasOwnProperty("howMany")&&!_r.isInteger(e.howMany))return"howMany: integer expected";if(null!=e.insertionPosition&&e.hasOwnProperty("insertionPosition")){let t=kr.Position.verify(e.insertionPosition);if(t)return"insertionPosition."+t}return null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof kr.SplitOperation)return e;let t=new kr.SplitOperation;if(null!=e.splitPosition){if("object"!=typeof e.splitPosition)throw TypeError(".SplitOperation.splitPosition: object expected");t.splitPosition=kr.Position.fromObject(e.splitPosition)}if(null!=e.graveyardPosition){if("object"!=typeof e.graveyardPosition)throw TypeError(".SplitOperation.graveyardPosition: object expected");t.graveyardPosition=kr.Position.fromObject(e.graveyardPosition)}if(null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.insertionPosition){if("object"!=typeof e.insertionPosition)throw TypeError(".SplitOperation.insertionPosition: object expected");t.insertionPosition=kr.Position.fromObject(e.insertionPosition)}return null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.splitPosition=null,n.graveyardPosition=null,n.howMany=0,n.insertionPosition=null,n.wasUndone=!1),null!=e.splitPosition&&e.hasOwnProperty("splitPosition")&&(n.splitPosition=kr.Position.toObject(e.splitPosition,t)),null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=kr.Position.toObject(e.graveyardPosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.insertionPosition&&e.hasOwnProperty("insertionPosition")&&(n.insertionPosition=kr.Position.toObject(e.insertionPosition,t)),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SplitOperation"},e})(),Br=kr.Position=(()=>{function e(e){if(this.path=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.root="",e.prototype.rootMain=!1,e.prototype.rootGraveyard=!1,e.prototype.path=_r.emptyArray,e.prototype.stickiness="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Tr.create()),null!=e.root&&Object.hasOwnProperty.call(e,"root")&&t.uint32(10).string(e.root),null!=e.rootMain&&Object.hasOwnProperty.call(e,"rootMain")&&t.uint32(16).bool(e.rootMain),null!=e.rootGraveyard&&Object.hasOwnProperty.call(e,"rootGraveyard")&&t.uint32(24).bool(e.rootGraveyard),null!=e.path&&e.path.length){t.uint32(34).fork();for(let n=0;n<e.path.length;++n)t.uint32(e.path[n]);t.ldelim()}return null!=e.stickiness&&Object.hasOwnProperty.call(e,"stickiness")&&t.uint32(42).string(e.stickiness),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Pr||(e=Pr.create(e));let n=void 0===t?e.len:e.pos+t,r=new kr.Position;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.root=e.string();break;case 2:r.rootMain=e.bool();break;case 3:r.rootGraveyard=e.bool();break;case 4:if(r.path&&r.path.length||(r.path=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.path.push(e.uint32())}else r.path.push(e.uint32());break;case 5:r.stickiness=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Pr||(e=new Pr(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.root&&e.hasOwnProperty("root")&&!_r.isString(e.root))return"root: string expected";if(null!=e.rootMain&&e.hasOwnProperty("rootMain")&&"boolean"!=typeof e.rootMain)return"rootMain: boolean expected";if(null!=e.rootGraveyard&&e.hasOwnProperty("rootGraveyard")&&"boolean"!=typeof e.rootGraveyard)return"rootGraveyard: boolean expected";if(null!=e.path&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(let t=0;t<e.path.length;++t)if(!_r.isInteger(e.path[t]))return"path: integer[] expected"}return null!=e.stickiness&&e.hasOwnProperty("stickiness")&&!_r.isString(e.stickiness)?"stickiness: string expected":null},e.fromObject=function(e){if(e instanceof kr.Position)return e;let t=new kr.Position;if(null!=e.root&&(t.root=String(e.root)),null!=e.rootMain&&(t.rootMain=Boolean(e.rootMain)),null!=e.rootGraveyard&&(t.rootGraveyard=Boolean(e.rootGraveyard)),e.path){if(!Array.isArray(e.path))throw TypeError(".Position.path: array expected");t.path=[];for(let n=0;n<e.path.length;++n)t.path[n]=e.path[n]>>>0}return null!=e.stickiness&&(t.stickiness=String(e.stickiness)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.path=[]),t.defaults&&(n.root="",n.rootMain=!1,n.rootGraveyard=!1,n.stickiness=""),null!=e.root&&e.hasOwnProperty("root")&&(n.root=e.root),null!=e.rootMain&&e.hasOwnProperty("rootMain")&&(n.rootMain=e.rootMain),null!=e.rootGraveyard&&e.hasOwnProperty("rootGraveyard")&&(n.rootGraveyard=e.rootGraveyard),e.path&&e.path.length){n.path=[];for(let t=0;t<e.path.length;++t)n.path[t]=e.path[t]}return null!=e.stickiness&&e.hasOwnProperty("stickiness")&&(n.stickiness=e.stickiness),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Position"},e})(),Ur=kr.Range=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.start=null,e.prototype.end=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Tr.create()),null!=e.start&&Object.hasOwnProperty.call(e,"start")&&kr.Position.encode(e.start,t.uint32(10).fork()).ldelim(),null!=e.end&&Object.hasOwnProperty.call(e,"end")&&kr.Position.encode(e.end,t.uint32(18).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Pr||(e=Pr.create(e));let n=void 0===t?e.len:e.pos+t,r=new kr.Range;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.start=kr.Position.decode(e,e.uint32());break;case 2:r.end=kr.Position.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof Pr||(e=new Pr(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.start&&e.hasOwnProperty("start")){let t=kr.Position.verify(e.start);if(t)return"start."+t}if(null!=e.end&&e.hasOwnProperty("end")){let t=kr.Position.verify(e.end);if(t)return"end."+t}return null},e.fromObject=function(e){if(e instanceof kr.Range)return e;let t=new kr.Range;if(null!=e.start){if("object"!=typeof e.start)throw TypeError(".Range.start: object expected");t.start=kr.Position.fromObject(e.start)}if(null!=e.end){if("object"!=typeof e.end)throw TypeError(".Range.end: object expected");t.end=kr.Position.fromObject(e.end)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.start=null,n.end=null),null!=e.start&&e.hasOwnProperty("start")&&(n.start=kr.Position.toObject(e.start,t)),null!=e.end&&e.hasOwnProperty("end")&&(n.end=kr.Position.toObject(e.end,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Range"},e})(),Jr=kr.Element=(()=>{function e(e){if(this.children=[],this.attributesBoolean={},e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.children=_r.emptyArray,e.prototype.data="",e.prototype.attributesBoolean=_r.emptyObject,e.prototype.attributesJson="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Tr.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.children&&e.children.length)for(let n=0;n<e.children.length;++n)kr.Element.encode(e.children[n],t.uint32(18).fork()).ldelim();if(null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(26).string(e.data),null!=e.attributesBoolean&&Object.hasOwnProperty.call(e,"attributesBoolean"))for(let n=Object.keys(e.attributesBoolean),r=0;r<n.length;++r)t.uint32(34).fork().uint32(10).string(n[r]).uint32(16).bool(e.attributesBoolean[n[r]]).ldelim();return null!=e.attributesJson&&Object.hasOwnProperty.call(e,"attributesJson")&&t.uint32(42).string(e.attributesJson),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof Pr||(e=Pr.create(e));let n,r,s=void 0===t?e.len:e.pos+t,o=new kr.Element;for(;e.pos<s;){let t=e.uint32();switch(t>>>3){case 1:o.name=e.string();break;case 2:o.children&&o.children.length||(o.children=[]),o.children.push(kr.Element.decode(e,e.uint32()));break;case 3:o.data=e.string();break;case 4:{o.attributesBoolean===_r.emptyObject&&(o.attributesBoolean={});let t=e.uint32()+e.pos;for(n="",r=!1;e.pos<t;){let t=e.uint32();switch(t>>>3){case 1:n=e.string();break;case 2:r=e.bool();break;default:e.skipType(7&t)}}o.attributesBoolean[n]=r;break}case 5:o.attributesJson=e.string();break;default:e.skipType(7&t)}}return o},e.decodeDelimited=function(e){return e instanceof Pr||(e=new Pr(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!_r.isString(e.name))return"name: string expected";if(null!=e.children&&e.hasOwnProperty("children")){if(!Array.isArray(e.children))return"children: array expected";for(let t=0;t<e.children.length;++t){let n=kr.Element.verify(e.children[t]);if(n)return"children."+n}}if(null!=e.data&&e.hasOwnProperty("data")&&!_r.isString(e.data))return"data: string expected";if(null!=e.attributesBoolean&&e.hasOwnProperty("attributesBoolean")){if(!_r.isObject(e.attributesBoolean))return"attributesBoolean: object expected";let t=Object.keys(e.attributesBoolean);for(let n=0;n<t.length;++n)if("boolean"!=typeof e.attributesBoolean[t[n]])return"attributesBoolean: boolean{k:string} expected"}return null!=e.attributesJson&&e.hasOwnProperty("attributesJson")&&!_r.isString(e.attributesJson)?"attributesJson: string expected":null},e.fromObject=function(e){if(e instanceof kr.Element)return e;let t=new kr.Element;if(null!=e.name&&(t.name=String(e.name)),e.children){if(!Array.isArray(e.children))throw TypeError(".Element.children: array expected");t.children=[];for(let n=0;n<e.children.length;++n){if("object"!=typeof e.children[n])throw TypeError(".Element.children: object expected");t.children[n]=kr.Element.fromObject(e.children[n])}}if(null!=e.data&&(t.data=String(e.data)),e.attributesBoolean){if("object"!=typeof e.attributesBoolean)throw TypeError(".Element.attributesBoolean: object expected");t.attributesBoolean={};for(let n=Object.keys(e.attributesBoolean),r=0;r<n.length;++r)t.attributesBoolean[n[r]]=Boolean(e.attributesBoolean[n[r]])}return null!=e.attributesJson&&(t.attributesJson=String(e.attributesJson)),t},e.toObject=function(e,t){t||(t={});let n,r={};if((t.arrays||t.defaults)&&(r.children=[]),(t.objects||t.defaults)&&(r.attributesBoolean={}),t.defaults&&(r.name="",r.data="",r.attributesJson=""),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),e.children&&e.children.length){r.children=[];for(let n=0;n<e.children.length;++n)r.children[n]=kr.Element.toObject(e.children[n],t)}if(null!=e.data&&e.hasOwnProperty("data")&&(r.data=e.data),e.attributesBoolean&&(n=Object.keys(e.attributesBoolean)).length){r.attributesBoolean={};for(let t=0;t<n.length;++t)r.attributesBoolean[n[t]]=e.attributesBoolean[n[t]]}return null!=e.attributesJson&&e.hasOwnProperty("attributesJson")&&(r.attributesJson=e.attributesJson),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,Te.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Element"},e})();class qr{constructor(){this._protobufRoot=n}getDescriptor(e){return new Gr(this._protobufRoot[e])}}class Gr{constructor(e){this._protobuf=e}compress(e){const t=this._protobuf.verify(e);if(t)throw Error(t);return this._protobuf.encode(this._protobuf.create(e)).finish()}decompress(e){return this._protobuf.toObject(this._protobuf.decode(e),{oneofs:!0})}}const Lr=function(){this.__data__=[],this.size=0};const Yr=function(e,t){return e===t||e!=e&&t!=t};const zr=function(e,t){for(var n=e.length;n--;)if(Yr(e[n][0],t))return n;return-1};var Hr=Array.prototype.splice;const Fr=function(e){var t=this.__data__,n=zr(t,e);return!(n<0)&&(n==t.length-1?t.pop():Hr.call(t,n,1),--this.size,!0)};const Kr=function(e){var t=this.__data__,n=zr(t,e);return n<0?void 0:t[n][1]};const Wr=function(e){return zr(this.__data__,e)>-1};const Qr=function(e,t){var n=this.__data__,r=zr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Xr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Xr.prototype.clear=Lr,Xr.prototype.delete=Fr,Xr.prototype.get=Kr,Xr.prototype.has=Wr,Xr.prototype.set=Qr;const $r=Xr;const Zr=function(){this.__data__=new $r,this.size=0};const es=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};const ts=function(e){return this.__data__.get(e)};const ns=function(e){return this.__data__.has(e)};const rs="object"==typeof global&&global&&global.Object===Object&&global;var ss="object"==typeof self&&self&&self.Object===Object&&self;const os=rs||ss||Function("return this")();const is=os.Symbol;var as=Object.prototype,cs=as.hasOwnProperty,ds=as.toString,us=is?is.toStringTag:void 0;const ls=function(e){var t=cs.call(e,us),n=e[us];try{e[us]=void 0;var r=!0}catch(e){}var s=ds.call(e);return r&&(t?e[us]=n:delete e[us]),s};var ps=Object.prototype.toString;const hs=function(e){return ps.call(e)};var fs=is?is.toStringTag:void 0;const ms=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":fs&&fs in Object(e)?ls(e):hs(e)};const ys=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const gs=function(e){if(!ys(e))return!1;var t=ms(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const bs=os["__core-js_shared__"];var Os,ws=(Os=/[^.]+$/.exec(bs&&bs.keys&&bs.keys.IE_PROTO||""))?"Symbol(src)_1."+Os:"";const Is=function(e){return!!ws&&ws in e};var vs=Function.prototype.toString;const Ss=function(e){if(null!=e){try{return vs.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var As=/^\[object .+?Constructor\]$/,Ps=Function.prototype,Ts=Object.prototype,_s=Ps.toString,ks=Ts.hasOwnProperty,Cs=RegExp("^"+_s.call(ks).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Es=function(e){return!(!ys(e)||Is(e))&&(gs(e)?Cs:As).test(Ss(e))};const js=function(e,t){return null==e?void 0:e[t]};const Rs=function(e,t){var n=js(e,t);return Es(n)?n:void 0};const Ds=Rs(os,"Map");const Ns=Rs(Object,"create");const xs=function(){this.__data__=Ns?Ns(null):{},this.size=0};const Vs=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var Ms=Object.prototype.hasOwnProperty;const Bs=function(e){var t=this.__data__;if(Ns){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Ms.call(t,e)?t[e]:void 0};var Us=Object.prototype.hasOwnProperty;const Js=function(e){var t=this.__data__;return Ns?void 0!==t[e]:Us.call(t,e)};const qs=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ns&&void 0===t?"__lodash_hash_undefined__":t,this};function Gs(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Gs.prototype.clear=xs,Gs.prototype.delete=Vs,Gs.prototype.get=Bs,Gs.prototype.has=Js,Gs.prototype.set=qs;const Ls=Gs;const Ys=function(){this.size=0,this.__data__={hash:new Ls,map:new(Ds||$r),string:new Ls}};const zs=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const Hs=function(e,t){var n=e.__data__;return zs(t)?n["string"==typeof t?"string":"hash"]:n.map};const Fs=function(e){var t=Hs(this,e).delete(e);return this.size-=t?1:0,t};const Ks=function(e){return Hs(this,e).get(e)};const Ws=function(e){return Hs(this,e).has(e)};const Qs=function(e,t){var n=Hs(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Xs(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Xs.prototype.clear=Ys,Xs.prototype.delete=Fs,Xs.prototype.get=Ks,Xs.prototype.has=Ws,Xs.prototype.set=Qs;const $s=Xs;const Zs=function(e,t){var n=this.__data__;if(n instanceof $r){var r=n.__data__;if(!Ds||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new $s(r)}return n.set(e,t),this.size=n.size,this};function eo(e){var t=this.__data__=new $r(e);this.size=t.size}eo.prototype.clear=Zr,eo.prototype.delete=es,eo.prototype.get=ts,eo.prototype.has=ns,eo.prototype.set=Zs;const to=eo;const no=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e};const ro=function(){try{var e=Rs(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const so=function(e,t,n){"__proto__"==t&&ro?ro(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var oo=Object.prototype.hasOwnProperty;const io=function(e,t,n){var r=e[t];oo.call(e,t)&&Yr(r,n)&&(void 0!==n||t in e)||so(e,t,n)};const ao=function(e,t,n,r){var s=!n;n||(n={});for(var o=-1,i=t.length;++o<i;){var a=t[o],c=r?r(n[a],e[a],a,n,e):void 0;void 0===c&&(c=e[a]),s?so(n,a,c):io(n,a,c)}return n};const co=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};const uo=function(e){return null!=e&&"object"==typeof e};const lo=function(e){return uo(e)&&"[object Arguments]"==ms(e)};var po=Object.prototype,ho=po.hasOwnProperty,fo=po.propertyIsEnumerable,mo=lo(function(){return arguments}())?lo:function(e){return uo(e)&&ho.call(e,"callee")&&!fo.call(e,"callee")};const yo=mo;const go=Array.isArray;const bo=function(){return!1};var Oo="object"==typeof exports&&exports&&!exports.nodeType&&exports,wo=Oo&&"object"==typeof module&&module&&!module.nodeType&&module,Io=wo&&wo.exports===Oo?os.Buffer:void 0;const vo=(Io?Io.isBuffer:void 0)||bo;var So=/^(?:0|[1-9]\d*)$/;const Ao=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&So.test(e))&&e>-1&&e%1==0&&e<t};const Po=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var To={};To["[object Float32Array]"]=To["[object Float64Array]"]=To["[object Int8Array]"]=To["[object Int16Array]"]=To["[object Int32Array]"]=To["[object Uint8Array]"]=To["[object Uint8ClampedArray]"]=To["[object Uint16Array]"]=To["[object Uint32Array]"]=!0,To["[object Arguments]"]=To["[object Array]"]=To["[object ArrayBuffer]"]=To["[object Boolean]"]=To["[object DataView]"]=To["[object Date]"]=To["[object Error]"]=To["[object Function]"]=To["[object Map]"]=To["[object Number]"]=To["[object Object]"]=To["[object RegExp]"]=To["[object Set]"]=To["[object String]"]=To["[object WeakMap]"]=!1;const _o=function(e){return uo(e)&&Po(e.length)&&!!To[ms(e)]};const ko=function(e){return function(t){return e(t)}};var Co="object"==typeof exports&&exports&&!exports.nodeType&&exports,Eo=Co&&"object"==typeof module&&module&&!module.nodeType&&module,jo=Eo&&Eo.exports===Co&&rs.process;const Ro=function(){try{var e=Eo&&Eo.require&&Eo.require("util").types;return e||jo&&jo.binding&&jo.binding("util")}catch(e){}}();var Do=Ro&&Ro.isTypedArray;const No=Do?ko(Do):_o;var xo=Object.prototype.hasOwnProperty;const Vo=function(e,t){var n=go(e),r=!n&&yo(e),s=!n&&!r&&vo(e),o=!n&&!r&&!s&&No(e),i=n||r||s||o,a=i?co(e.length,String):[],c=a.length;for(var d in e)!t&&!xo.call(e,d)||i&&("length"==d||s&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||Ao(d,c))||a.push(d);return a};var Mo=Object.prototype;const Bo=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Mo)};const Uo=function(e,t){return function(n){return e(t(n))}};const Jo=Uo(Object.keys,Object);var qo=Object.prototype.hasOwnProperty;const Go=function(e){if(!Bo(e))return Jo(e);var t=[];for(var n in Object(e))qo.call(e,n)&&"constructor"!=n&&t.push(n);return t};const Lo=function(e){return null!=e&&Po(e.length)&&!gs(e)};const Yo=function(e){return Lo(e)?Vo(e):Go(e)};const zo=function(e,t){return e&&ao(t,Yo(t),e)};const Ho=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var Fo=Object.prototype.hasOwnProperty;const Ko=function(e){if(!ys(e))return Ho(e);var t=Bo(e),n=[];for(var r in e)("constructor"!=r||!t&&Fo.call(e,r))&&n.push(r);return n};const Wo=function(e){return Lo(e)?Vo(e,!0):Ko(e)};const Qo=function(e,t){return e&&ao(t,Wo(t),e)};var Xo="object"==typeof exports&&exports&&!exports.nodeType&&exports,$o=Xo&&"object"==typeof module&&module&&!module.nodeType&&module,Zo=$o&&$o.exports===Xo?os.Buffer:void 0,ei=Zo?Zo.allocUnsafe:void 0;const ti=function(e,t){if(t)return e.slice();var n=e.length,r=ei?ei(n):new e.constructor(n);return e.copy(r),r};const ni=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};const ri=function(e,t){for(var n=-1,r=null==e?0:e.length,s=0,o=[];++n<r;){var i=e[n];t(i,n,e)&&(o[s++]=i)}return o};const si=function(){return[]};var oi=Object.prototype.propertyIsEnumerable,ii=Object.getOwnPropertySymbols;const ai=ii?function(e){return null==e?[]:(e=Object(e),ri(ii(e),(function(t){return oi.call(e,t)})))}:si;const ci=function(e,t){return ao(e,ai(e),t)};const di=function(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e};const ui=Uo(Object.getPrototypeOf,Object);const li=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)di(t,ai(e)),e=ui(e);return t}:si;const pi=function(e,t){return ao(e,li(e),t)};const hi=function(e,t,n){var r=t(e);return go(e)?r:di(r,n(e))};const fi=function(e){return hi(e,Yo,ai)};const mi=function(e){return hi(e,Wo,li)};const yi=Rs(os,"DataView");const gi=Rs(os,"Promise");const bi=Rs(os,"Set");const Oi=Rs(os,"WeakMap");var wi="[object Map]",Ii="[object Promise]",vi="[object Set]",Si="[object WeakMap]",Ai="[object DataView]",Pi=Ss(yi),Ti=Ss(Ds),_i=Ss(gi),ki=Ss(bi),Ci=Ss(Oi),Ei=ms;(yi&&Ei(new yi(new ArrayBuffer(1)))!=Ai||Ds&&Ei(new Ds)!=wi||gi&&Ei(gi.resolve())!=Ii||bi&&Ei(new bi)!=vi||Oi&&Ei(new Oi)!=Si)&&(Ei=function(e){var t=ms(e),n="[object Object]"==t?e.constructor:void 0,r=n?Ss(n):"";if(r)switch(r){case Pi:return Ai;case Ti:return wi;case _i:return Ii;case ki:return vi;case Ci:return Si}return t});const ji=Ei;var Ri=Object.prototype.hasOwnProperty;const Di=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ri.call(e,"index")&&(n.index=e.index,n.input=e.input),n};const Ni=os.Uint8Array;const xi=function(e){var t=new e.constructor(e.byteLength);return new Ni(t).set(new Ni(e)),t};const Vi=function(e,t){var n=t?xi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)};var Mi=/\w*$/;const Bi=function(e){var t=new e.constructor(e.source,Mi.exec(e));return t.lastIndex=e.lastIndex,t};var Ui=is?is.prototype:void 0,Ji=Ui?Ui.valueOf:void 0;const qi=function(e){return Ji?Object(Ji.call(e)):{}};const Gi=function(e,t){var n=t?xi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};const Li=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return xi(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return Vi(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Gi(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return Bi(e);case"[object Symbol]":return qi(e)}};var Yi=Object.create;const zi=function(){function e(){}return function(t){if(!ys(t))return{};if(Yi)return Yi(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const Hi=function(e){return"function"!=typeof e.constructor||Bo(e)?{}:zi(ui(e))};const Fi=function(e){return uo(e)&&"[object Map]"==ji(e)};var Ki=Ro&&Ro.isMap;const Wi=Ki?ko(Ki):Fi;const Qi=function(e){return uo(e)&&"[object Set]"==ji(e)};var Xi=Ro&&Ro.isSet;const $i=Xi?ko(Xi):Qi;var Zi="[object Arguments]",ea="[object Function]",ta="[object Object]",na={};na[Zi]=na["[object Array]"]=na["[object ArrayBuffer]"]=na["[object DataView]"]=na["[object Boolean]"]=na["[object Date]"]=na["[object Float32Array]"]=na["[object Float64Array]"]=na["[object Int8Array]"]=na["[object Int16Array]"]=na["[object Int32Array]"]=na["[object Map]"]=na["[object Number]"]=na[ta]=na["[object RegExp]"]=na["[object Set]"]=na["[object String]"]=na["[object Symbol]"]=na["[object Uint8Array]"]=na["[object Uint8ClampedArray]"]=na["[object Uint16Array]"]=na["[object Uint32Array]"]=!0,na["[object Error]"]=na[ea]=na["[object WeakMap]"]=!1;const ra=function e(t,n,r,s,o,i){var a,c=1&n,d=2&n,u=4&n;if(r&&(a=o?r(t,s,o,i):r(t)),void 0!==a)return a;if(!ys(t))return t;var l=go(t);if(l){if(a=Di(t),!c)return ni(t,a)}else{var p=ji(t),h=p==ea||"[object GeneratorFunction]"==p;if(vo(t))return ti(t,c);if(p==ta||p==Zi||h&&!o){if(a=d||h?{}:Hi(t),!c)return d?pi(t,Qo(a,t)):ci(t,zo(a,t))}else{if(!na[p])return o?t:{};a=Li(t,p,c)}}i||(i=new to);var f=i.get(t);if(f)return f;i.set(t,a),$i(t)?t.forEach((function(s){a.add(e(s,n,r,s,t,i))})):Wi(t)&&t.forEach((function(s,o){a.set(o,e(s,n,r,o,t,i))}));var m=l?void 0:(u?d?mi:fi:d?Wo:Yo)(t);return no(m||t,(function(s,o){m&&(s=t[o=s]),io(a,o,e(s,n,r,o,t,i))})),a};const sa=function(e){return ra(e,5)};const oa=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const ia=function(e){return this.__data__.has(e)};function aa(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new $s;++t<n;)this.add(e[t])}aa.prototype.add=aa.prototype.push=oa,aa.prototype.has=ia;const ca=aa;const da=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};const ua=function(e,t){return e.has(t)};const la=function(e,t,n,r,s,o){var i=1&n,a=e.length,c=t.length;if(a!=c&&!(i&&c>a))return!1;var d=o.get(e),u=o.get(t);if(d&&u)return d==t&&u==e;var l=-1,p=!0,h=2&n?new ca:void 0;for(o.set(e,t),o.set(t,e);++l<a;){var f=e[l],m=t[l];if(r)var y=i?r(m,f,l,t,e,o):r(f,m,l,e,t,o);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!da(t,(function(e,t){if(!ua(h,t)&&(f===e||s(f,e,n,r,o)))return h.push(t)}))){p=!1;break}}else if(f!==m&&!s(f,m,n,r,o)){p=!1;break}}return o.delete(e),o.delete(t),p};const pa=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n};const ha=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var fa=is?is.prototype:void 0,ma=fa?fa.valueOf:void 0;const ya=function(e,t,n,r,s,o,i){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new Ni(e),new Ni(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Yr(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=pa;case"[object Set]":var c=1&r;if(a||(a=ha),e.size!=t.size&&!c)return!1;var d=i.get(e);if(d)return d==t;r|=2,i.set(e,t);var u=la(a(e),a(t),r,s,o,i);return i.delete(e),u;case"[object Symbol]":if(ma)return ma.call(e)==ma.call(t)}return!1};var ga=Object.prototype.hasOwnProperty;const ba=function(e,t,n,r,s,o){var i=1&n,a=fi(e),c=a.length;if(c!=fi(t).length&&!i)return!1;for(var d=c;d--;){var u=a[d];if(!(i?u in t:ga.call(t,u)))return!1}var l=o.get(e),p=o.get(t);if(l&&p)return l==t&&p==e;var h=!0;o.set(e,t),o.set(t,e);for(var f=i;++d<c;){var m=e[u=a[d]],y=t[u];if(r)var g=i?r(y,m,u,t,e,o):r(m,y,u,e,t,o);if(!(void 0===g?m===y||s(m,y,n,r,o):g)){h=!1;break}f||(f="constructor"==u)}if(h&&!f){var b=e.constructor,O=t.constructor;b==O||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof O&&O instanceof O||(h=!1)}return o.delete(e),o.delete(t),h};var Oa="[object Arguments]",wa="[object Array]",Ia="[object Object]",va=Object.prototype.hasOwnProperty;const Sa=function(e,t,n,r,s,o){var i=go(e),a=go(t),c=i?wa:ji(e),d=a?wa:ji(t),u=(c=c==Oa?Ia:c)==Ia,l=(d=d==Oa?Ia:d)==Ia,p=c==d;if(p&&vo(e)){if(!vo(t))return!1;i=!0,u=!1}if(p&&!u)return o||(o=new to),i||No(e)?la(e,t,n,r,s,o):ya(e,t,c,n,r,s,o);if(!(1&n)){var h=u&&va.call(e,"__wrapped__"),f=l&&va.call(t,"__wrapped__");if(h||f){var m=h?e.value():e,y=f?t.value():t;return o||(o=new to),s(m,y,n,r,o)}}return!!p&&(o||(o=new to),ba(e,t,n,r,s,o))};const Aa=function e(t,n,r,s,o){return t===n||(null==t||null==n||!uo(t)&&!uo(n)?t!=t&&n!=n:Sa(t,n,r,s,e,o))};const Pa=function(e,t){return Aa(e,t)};function Ta(e,t){const n=sa(e);return n.path[n.path.length-1]+=t,n}function _a(e,t){return e.root===t.root&&Pa(e.path,t.path)}function ka(e){Ea(e,(e=>("main"==e.root?(e.rootMain=!0,delete e.root):"$graveyard"==e.root&&(e.rootGraveyard=!0,delete e.root),e)))}function Ca(e){Ea(e,(e=>(e.rootMain?(e.root="main",delete e.rootMain):e.rootGraveyard&&(e.root="$graveyard",delete e.rootGraveyard),e)))}function Ea(e,t){for(const n in e){const r=e[n];"nodes"!==n&&ys(r)&&(r.path&&(r.root||r.rootMain||r.rootGraveyard)?e[n]=t(r):Ea(r,t))}return e}class ja{constructor(e,t,n){this._id=e,this._operationName=t,this._protobufDescriptor=n}compress(e,t){const n=t.shift();return ka(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){t.types.shift();const n=this._protobufDescriptor.decompress(t.buffers.shift());Ca(n),n.__className=this._operationName,e.push(n)}}class Ra extends ja{compress(e,t){const n=t.shift();return this._serializeOneOf("oldValue",n),this._serializeOneOf("newValue",n),ka(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){const{types:n,buffers:r}=t,s=this._protobufDescriptor.decompress(r.shift());n.shift(),this._deserializeOneOf("oldValue",s),this._deserializeOneOf("newValue",s),Ca(s),s.__className=this._operationName,e.push(s)}_serializeOneOf(e,t){const n=t[e];"boolean"==typeof n?t[`${e}Boolean`]=n:t[`${e}Json`]=JSON.stringify(n)}_deserializeOneOf(e,t){const n=`${e}Json`;t[n]?(t[e]=JSON.parse(t[n]),delete t[n]):(t[e]=t[`${e}Boolean`],delete t[`${e}Boolean`])}}class Da extends ja{compress(e,t){const n=t.shift();return this._serializeNodesAttributes(n.nodes),ka(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){const{types:n,buffers:r}=t,s=this._protobufDescriptor.decompress(r.shift());n.shift(),s.nodes||(s.nodes=[]),this._deserializeNodesAttributes(s.nodes),Ca(s),s.__className=this._operationName,e.push(s)}_serializeNodesAttributes(e){for(const t of e){if(t.attributes){const e=t.attributes;this._areValuesBoolean(e)?t.attributesBoolean=e:t.attributesJson=JSON.stringify(e)}t.children&&this._serializeNodesAttributes(t.children)}}_deserializeNodesAttributes(e){for(const t of e)(t.attributesBoolean||t.attributesJson)&&(t.attributesBoolean?(t.attributes=t.attributesBoolean,delete t.attributesBoolean):(t.attributes=JSON.parse(t.attributesJson),delete t.attributesJson)),t.children&&this._deserializeNodesAttributes(t.children)}_areValuesBoolean(e){return Object.keys(e).every((t=>"boolean"==typeof e[t]))}}class Na extends ja{decompress(e,t){super.decompress(e,t);const n=e[e.length-1];n.oldRange||(n.oldRange=null),n.newRange||(n.newRange=null)}}class xa extends ja{compress(e,t){return t.shift(),e.types.push(this._id),!0}decompress(e,t){t.types.shift(),e.push({__className:this._operationName})}}class Va extends Na{constructor(e,t,n,r){super(e,t,n),this._omittedNamespace=r+":"}compress(e,t){return!("MarkerOperation"!=t[0].__className||!t[0].name.startsWith(this._omittedNamespace))&&(t[0].name=t[0].name.replace(new RegExp("^"+this._omittedNamespace),""),super.compress(e,t),!0)}decompress(e,t){super.decompress(e,t);const n=e[e.length-1];n.name=this._omittedNamespace+n.name}}class Ma{constructor(e,t){this._id=e,this._context=t}compress(e,t){let n;for(;t.length>1&&this._compareOperations(t[0],t[1]);)n?(n=this._combineNext(t.shift(),n),e.types.push(0)):(n=sa(t.shift()),e.types.push(this._id));return!!n&&(n=this._combineNext(t.shift(),n),e.types.push(0),e.buffers.push(this._compressSingleOperation(n)),!0)}decompress(e,t){const n=this._decompressSingleOperation(t);for(;0==t.types[0];)t.types.shift(),e.push(this._splitCurrent(n));e.push(n)}}class Ba extends Ma{_combineNext(e,t){return t.nodes[0].data+=e.nodes[0].data,t}_splitCurrent(e){const t=sa(e),n=t.nodes[0],r=e.nodes[0],s=r.data[Symbol.iterator]().next().value,o=s.length;return n.data=s,r.data=r.data.substr(o),e.position=Ta(e.position,o),t}_compareOperations(e,t){if(this._checkOperation(e)&&this._checkOperation(t)){const n=e.nodes[0].data.length,r=_a(Ta(e.position,n),t.position),s=e.nodes[0],o=t.nodes[0];return r&&this._compareAttributes(s,o)}return!1}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("InsertOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("InsertOperation").decompress(t,e),t[0]}_checkOperation(e){return"InsertOperation"==e.__className&&1==e.nodes.length&&e.nodes[0].data&&!e.wasUndone&&1==Array.from(e.nodes[0].data).length}_compareAttributes(e,t){const n=Object.keys(e.attributes||{}),r=Object.keys(t.attributes||{});return n.length===r.length&&n.every((n=>t.attributes[n]&&t.attributes[n]===e.attributes[n]))}}class Ua extends Ma{_combineNext(e,t){return t.howMany++,t.sourcePosition=sa(e.sourcePosition),t}_splitCurrent(e){const t=sa(e);return e.howMany--,t.howMany=1,t.sourcePosition=Ta(t.sourcePosition,e.howMany),t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(_a(Ta(e.sourcePosition,-1),t.sourcePosition)&&_a(e.targetPosition,t.targetPosition))}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MoveOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MoveOperation").decompress(t,e),t[0]}_checkOperation(e){return"MoveOperation"==e.__className&&"$graveyard"==e.targetPosition.root&&1==e.howMany&&!e.wasUndone}}class Ja extends Ma{_combineNext(e,t){return t.howMany++,t}_splitCurrent(e){const t=sa(e);return t.howMany=1,e.howMany--,t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(_a(e.sourcePosition,t.sourcePosition)&&_a(e.targetPosition,t.targetPosition))}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MoveOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MoveOperation").decompress(t,e),t[0]}_checkOperation(e){return"MoveOperation"==e.__className&&"$graveyard"==e.targetPosition.root&&1==e.howMany&&!e.wasUndone}}class qa extends Ma{compress(e,t){if(!this._compareOperations(t[0],t[1]))return!1;const n=t.shift();return n.oldRange=null,n.newRange&&_a(n.newRange.start,n.newRange.end)&&(n.newRange.end=null),t.shift(),e.types.push(this._id),e.types.push(0),e.buffers.push(this._compressSingleOperation(n)),!0}decompress(e,t){const n=this._decompressSingleOperation(t);n.newRange&&!n.newRange.end&&(n.newRange.end=sa(n.newRange.start));const r=sa(n);r.newRange&&(r.newRange.start.stickiness="toNone",r.newRange.end=sa(r.newRange.start)),r.name="user:position:"+r.name.split(":")[2],t.types.shift(),e.push(n),e.push(r)}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MarkerOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MarkerOperation").decompress(t,e),t[0]}_compareOperations(e,t){return!(!e||!t)&&("MarkerOperation"==e.__className&&"MarkerOperation"==t.__className&&!(!e.name.startsWith("user:")||!t.name.startsWith("user:")||e.name==t.name))}}class Ga{constructor(){this._compressorById=new Map,this._compressorByName=new Map,this._protobufFactory=new qr;const e=this._protobufFactory.getDescriptor("MarkerOperation");this._registerCompressor(1,"NoOperation",new xa(1,"NoOperation",void 0)),this._registerOperationCompressor(10,"AttributeOperation",Ra),this._registerOperationCompressor(11,"InsertOperation",Da),this._registerOperationCompressor(12,"MarkerOperation",Na),this._registerOperationCompressor(13,"MergeOperation",ja),this._registerOperationCompressor(14,"MoveOperation",ja),this._registerOperationCompressor(15,"RenameOperation",ja),this._registerOperationCompressor(16,"RootAttributeOperation",Ra),this._registerOperationCompressor(17,"SplitOperation",ja),this._registerCompressor(18,"CommentMarkerOperation",new Va(18,"MarkerOperation",e,"comment")),this._registerCompressor(19,"SuggestionMarkerOperation",new Va(19,"MarkerOperation",e,"suggestion")),this._registerOperationCompressor(20,"RootOperation",ja),this._registerActionCompressor(100,"TypingAction",Ba),this._registerActionCompressor(101,"DeletingAction",Ua),this._registerActionCompressor(102,"ForwardDeletingAction",Ja),this._registerActionCompressor(103,"UserSelectionAction",qa)}compress(e){if(!e||!e[0])throw new s.CKEditorError("no-operations-provided",this);const t={types:[],buffers:[],baseVersion:e[0].baseVersion};for(;e.length;)this._getCompressorByName("UserSelectionAction").compress(t,e)||this._getCompressorByName("TypingAction").compress(t,e)||this._getCompressorByName("DeletingAction").compress(t,e)||this._getCompressorByName("ForwardDeletingAction").compress(t,e)||this._getCompressorByName("CommentMarkerOperation").compress(t,e)||this._getCompressorByName("SuggestionMarkerOperation").compress(t,e)||this._getCompressorByName(e[0].__className).compress(t,e);return t}decompress(e){const t=[];for(;e.types.length;){this._compressorById.get(e.types[0]).decompress(t,e)}return t.forEach(((t,n)=>t.baseVersion=e.baseVersion+n)),t}_getCompressorByName(e){return this._compressorByName.get(e)}_registerOperationCompressor(e,t,n){const r=new n(e,t,this._protobufFactory.getDescriptor(t));this._registerCompressor(e,t,r)}_registerActionCompressor(e,t,n){const r=new n(e,this);this._registerCompressor(e,t,r)}_registerCompressor(e,t,n){this._compressorById.set(e,n),this._compressorByName.set(t,n)}}new Map([[Tn.TYPE,Tn.READABLE_TYPE_NAME],[En.TYPE,En.READABLE_TYPE_NAME],[Cn.TYPE,Cn.READABLE_TYPE_NAME],[Nn.TYPE,Nn.READABLE_TYPE_NAME],[Un.TYPE,Un.READABLE_TYPE_NAME],[qn.TYPE,qn.READABLE_TYPE_NAME],[Hn.TYPE,Hn.READABLE_TYPE_NAME],[Kn.TYPE,Kn.READABLE_TYPE_NAME],[Ln.TYPE,Ln.READABLE_TYPE_NAME],[Yn.TYPE,Yn.READABLE_TYPE_NAME],[zn.TYPE,zn.READABLE_TYPE_NAME],[pn.TYPE,pn.READABLE_TYPE_NAME],[hn.TYPE,hn.READABLE_TYPE_NAME],[fn.TYPE,fn.READABLE_TYPE_NAME],[Qt.TYPE,Qt.READABLE_TYPE_NAME],[$t.TYPE,$t.READABLE_TYPE_NAME],[sn.TYPE,sn.READABLE_TYPE_NAME],[en.TYPE,en.READABLE_TYPE_NAME],[on.TYPE,on.READABLE_TYPE_NAME],[cn.TYPE,cn.READABLE_TYPE_NAME],[Ve.TYPE,Ve.READABLE_TYPE_NAME],[Be.TYPE,Be.READABLE_TYPE_NAME],[Yt.TYPE,Yt.READABLE_TYPE_NAME],[Ht.TYPE,Ht.READABLE_TYPE_NAME],[Ut.TYPE,Ut.READABLE_TYPE_NAME],[Gt.TYPE,Gt.READABLE_TYPE_NAME],[xt.TYPE,xt.READABLE_TYPE_NAME],[Zn.TYPE,Zn.READABLE_TYPE_NAME],[er.TYPE,er.READABLE_TYPE_NAME],[tr.TYPE,tr.READABLE_TYPE_NAME],[$n.TYPE,$n.READABLE_TYPE_NAME]]);const{Nz:La,XM:Ya}=t,za=Fa;function Ha(){const e=["decompress","isUndoneOperation","_sendBufferedOperations","model","2536227FWvfDw","cloud-services-internal-error: Not connected.","define","stop","Permissions","createRange","destroy","end","CommentsOnly","_shouldSendUpdate","history","forEach","_handleReconnectionResponse","requires","isReadOnly","batch","_hasSynchronizationProblem","cs:removeUser","_channelId","enableReadOnlyMode","_isConnected","high","disconnected","change:hasDomSelection","cloudDocumentVersion","get","type","differ","_service","document","_addKnownRoot","stopListening","addRootAttribute","multi-root-editor-root-attributes-no-root","setIdForTheLastOperation","_connectAfterSessionHasBeenFlushed","toJSON","listenTo","permissions","_decompressOperations","selection","_document","marker","locale","RealTimeCollaborationClient","_initSessionsHandling","realtimecollaborationclient-init-non-existent-root","add","cloud-services-internal-error: Request timeout.","lastOperationAcceptedAt","_shouldSendSelectionUpdate","keys","getConnectedSessions","_lastServerVersion","2775234zsHQnP","cloud-services-internal-error: Collaborative Editing Service is not connected.","_pendingAction","_operationToId","addToReconnectionStack","map","rootName","The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.","The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.","register","realtimecollaborationclient-handleserverresponse","_knownOperations","realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration","attributes","rtc-offline","apply","code","Notification","createUserMarkerOperations","startsWith","directChange","realtimecollaborationclient-init-connection-failed","message","_handleServerResponse","disconnect","real-time-collaboration","position","_compressOperations","createRoot","config","lastSyncVersion","operationsReceived","_setPendingAction","remove","_saveOperationInBuffer","_handleReceivedOperations","createPositionAt","removeFromReconnectionStack","_lastSyncedOperationId","return","init","initData","offset","_bufferRootLoad","9164312eBAgDq","compress","root","realtimecollaborationclient-init-session-connection-error","lastDocumentSession","_isEditingAllowed","sendOperations","_clearPendingAction","sessionId","bind","addRoot","plugins","showWarning","has","size","change:_isPendingUpdate","wereChangesApplied","_applyOperationsSet","channelSessions","_refreshUserSelectionMarkers","slice","_operationIdentifier","70758tqZKma","currentDocumentSession","getUser","_handleExternalOperations","connection","metadata","getIdOfTheLastOperation","createPositionFromPath","_isLoaded","version","_bufferedOperations","cloudServices.bundleVersion","lastOperationId","serverHistory","finally","collaboration.channelId","_handleReconnectionError","change:_isEditingAllowed","_initThrowingOnDataSet","change:range","realtimecollaborationclient-init-document-already-initialized","reset","_currentBufferDelay","collaboration","reconnection: flushed session","start","$root","collaboration-missing-channelid","_sendBufferedOperationsDelayId","getOperationAuthor","error","off","addUser","_knownRootNames","loadRoot","markers","view","wasUndone","The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.","suppressErrorInCollaboration","getMany","connect","mySessionId","applyOperation","set","_handleInitialConnectionData","enqueueChange","_disconnectionOperations","404","_crash","realtimecollaborationclient-initservice-incorrect-server-operation","_disconnectService","InsertOperation","state","clone","40394WaAkrx","Synchronization issue","realtimecollaborationclient-initservice-internal-error","931220DMEYRv","then","_isInit","getDocumentDetails","string","_isAttached","setPermissions","editing","userId","_offset","addOperation","createdAt","_handleSendingSelectionMarkers","_setUpDataInit","_sendBufferedOperationsDelayed","filter","rtc-destroyed","_getAffectedRoot","fromJSON","_hasSelectionChanged","_baseBufferDelay","data","409","_authorId","fire","The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.","_connectService","entries","affectedSelectable","_ignoredOperations","__className","_isPendingUpdate","document:write","410MrBbWc","path","getRoot","_isDisconnection","65QqczuO","move","pluginName","catch","_waitUntilSynced","getOperations","from","isDocumentOperation","push","roots","rootsAttributes","parse","disableReadOnlyMode","_updateServerHistory","connected","newRange","sessionAdd:","isEnabled","realtimecollaborationclient-sendbufferedoperations","baseVersion","18WCuXEd","CollaborativeEditingService","insert","affectsData","_loadRoot","round","ready","length","_fetchMissingUsers","sessionCreatedAt","reconnect","includes","unregister","28706220rJPQsR","PENDING_ACTION_SENDING_DATA","editor","_getOperationsFromInitData","_compressor","targetPosition"];return(Ha=function(){return e})()}function Fa(e,t){const n=Ha();return(Fa=function(e,t){return n[e-=362]})(e,t)}!function(e){const t=Fa,n=e();for(;;)try{if(727423===parseInt(t(506))/1*(-parseInt(t(466))/2)+parseInt(t(526))/3*(parseInt(t(469))/4)+parseInt(t(502))/5*(-parseInt(t(411))/6)+-parseInt(t(603))/7+-parseInt(t(389))/8+parseInt(t(549))/9+parseInt(t(539))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Ha);let Ka=1;class Wa extends r.Plugin{static get[za(562)](){return[dr,fr,vr,r.PendingActions,ur.Users,o.Notification]}static get[za(508)](){return za(593)}get[za(573)](){const e=za;return this[e(602)]+this[e(478)]}get[za(602)](){const e=za;return this[e(424)][e(420)]-this[e(478)]}get[za(375)](){const e=za,t=this[e(424)][e(511)]();for(let n=t[e(533)]-1;n>=0;n--){const r=t[n];if(!this[e(458)][e(402)](r))return r[e(525)]+1-this[e(478)]}return 0}constructor(e){const t=za;if(super(e),this[t(478)]=0,this[t(397)]=null,this[t(424)]=new i.History,this[t(541)][t(374)][t(551)](t(434),{}),this[t(567)]=this[t(541)][t(374)][t(574)](t(426)),!this[t(567)])throw new s.CKEditorError(t(438),this);const n=e[t(374)][t(574)](t(422))||s.version;this[t(577)]=new(Wa[t(527)])(n,this[t(567)]),this[t(590)]=this[t(541)][t(548)][t(578)],this[t(543)]=new Ga,this[t(421)]=[],this[t(614)]=new WeakSet,this[t(444)]=new Set,this[t(455)](t(500),!1),this[t(455)](t(565),!1),this[t(605)]=null,this[t(488)]=!1,this[t(439)]=null,this[t(489)]=300,this[t(433)]=this[t(489)],this[t(383)]=null,this[t(458)]=new WeakSet,this[t(410)]=new Za(this[t(458)])}[za(385)](){const e=za,t=this[e(541)],n=t[e(400)][e(574)](ur.Users),r=t[e(400)][e(574)](dr);this[e(586)](n,e(440),((t,r)=>{const s=e,o=r[0];o[s(492)]&&(t[s(384)]=n[s(413)](o[s(492)]),t[s(552)]()),null===o[s(492)]&&(t[s(384)]=null,t[s(552)]())}),{priority:e(570)}),this[e(586)](t[e(548)][e(578)][e(589)],e(430),((t,n)=>{const r=e;n[r(365)]&&this[r(408)]()})),this[e(586)](t[e(476)][e(447)],e(572),(()=>{this[e(408)]()})),this[e(429)](),t[e(548)].on(e(454),((t,n)=>{const r=e,s=n[0];s[r(513)]&&(this[r(379)](s),this[r(558)]()&&this[r(483)]())})),this[e(482)](),this[e(398)](e(394)).to(r,e(464),this,e(565),((t,n)=>e(520)===t&&!n)),this.on(e(428),(()=>{const n=e;this[n(394)]?t[n(518)](n(617)):t[n(568)](n(617))})),this[e(394)]?t[e(518)](e(617)):t[e(568)](e(617)),this[e(455)](e(569),!1)}async[za(536)](){const e=za,t=this[e(541)][e(400)][e(574)](fr),n=this[e(541)][e(400)][e(574)](dr);try{this[e(500)]=!0,t[e(538)](this[e(567)]);const r=await this[e(577)][e(536)](n[e(415)],this[e(375)]);await this[e(561)](r)&&(this[e(500)]=!1,this[e(396)]());const s=await this[e(577)][e(601)]();t[e(612)](this[e(567)],s),this[e(481)](),this[e(569)]=!0}catch(t){if(function(t){const n=e;return n(459)===t[n(619)]}(t)&&this[e(397)])await this[e(584)]();else if(function(t){const n=e;return n(491)===t[n(619)]}(t)){const t=Ar(this[e(541)][e(592)],e(610));this[e(427)](t)}else{if(!(t instanceof Xa))throw t;this[e(427)]()}}}[za(555)](){const e=za,t=this[e(541)][e(400)][e(574)](dr),n=this[e(541)][e(400)][e(574)](fr);this[e(541)][e(568)](e(485)),n[e(407)][e(402)](this[e(567)])&&n[e(538)](this[e(567)]),t[e(382)](this),this[e(462)](),super[e(555)]()}async[za(561)](e){const t=za;if(this[t(397)]!==e[t(397)]&&this[t(383)]!==e[t(423)])throw new Xa;return this[t(397)]=e[t(397)],this[t(368)]([],{...e,wereChangesApplied:!1,data:e[t(490)]},t(536))}async[za(495)](e,t=!1){const n=za,{connection:r}=this[n(541)][n(400)][n(574)](dr);Wa[n(527)][n(601)](r,this[n(567)])[n(470)]((e=>this[n(594)](e)))[n(509)]((e=>{const t=n;this[t(460)](t(392),e)})),this[n(586)](this[n(577)],n(376),this[n(380)][n(398)](this)),this[n(586)](this[n(577)],n(441),((e,t)=>{const r=n;this[r(460)](r(468),t)})),this[n(586)](this[n(577)],n(571),(()=>{this[n(569)]=!1}));const s=this[n(410)][n(417)](e);this[n(500)]=!0;const o=await this[n(577)][n(452)](r,this[n(372)](e),s);if(this[n(397)]=o[n(397)],t){if(!o[n(405)])return void this[n(427)]();this[n(500)]=!1,this[n(396)](),this[n(424)][n(432)](),this[n(478)]=o[n(387)],this[n(424)][n(420)]=this[n(478)],await this[n(368)](e,o,n(435))}else await this[n(456)](o,e);this[n(481)](),this[n(569)]=!0}[za(481)](){const e=za,t=this[e(541)][e(400)][e(574)](fr),n=this[e(541)][e(400)][e(574)](vr),r=t[e(407)][e(574)](this[e(567)]);r&&r[e(533)]>1?n[e(363)]():this[e(586)](t,e(522)+this[e(567)],(()=>{const r=e;2===t[r(407)][r(574)](this[r(567)])[r(533)]&&n[r(363)]()}))}async[za(380)](e,t,n,r){const s=za;if(!this[s(500)]&&this[s(590)][s(420)]==t){const e=this[s(588)](n,r);await this[s(534)](e),this[s(414)](e,t,n[s(423)])||this[s(460)](s(461))}}async[za(584)](){const e=za;this[e(462)]();const{locale:t}=this[e(541)];let n;try{n=await this[e(577)][e(472)]()}catch(n){const r=Ar(t,e(494));return void this[e(427)](r)}const r=n[e(412)]||n[e(393)];if(this[e(383)]===r[e(423)])await this[e(495)](this[e(541)][e(548)][e(578)][e(559)][e(511)](),!0);else{const n=Ar(t,e(611));this[e(427)](n)}}[za(462)](){const e=za;this[e(577)][e(369)](),this[e(421)]=[],clearTimeout(this[e(439)]),this[e(580)](this[e(577)])}[za(594)](e){const t=za,n=this[t(541)][t(400)][t(574)](fr);this[t(586)](n,t(522)+this[t(567)],((e,{session:r})=>{const s=t;if(r.id===n[s(453)]){e[s(442)]();const t=this[s(541)][s(400)][s(402)](s(557))&&this[s(541)][s(400)][s(574)](s(557));let n=r[s(587)];t&&t[s(523)]&&(n=n[s(484)]((e=>s(501)!==e))),this[s(541)][s(400)][s(574)](s(553))[s(475)](n,this[s(567)])}})),n[t(612)](this[t(567)],e)}[za(429)](){const e=za,t=this[e(541)][e(490)][e(455)];this[e(541)][e(490)][e(455)]=(...n)=>{const r=e;if(!n[n[r(533)]-1][r(450)])throw new s.CKEditorError(r(615),this);t[r(618)](this[r(541)][r(490)],n)}}[za(482)](){const e=za;this[e(541)][e(490)].on(e(385),((t,[n])=>{const r=e;if(this[r(590)][r(420)])throw new s.CKEditorError(r(431),this);t[r(552)](),this[r(377)]();const o=this[r(541)][r(374)][r(574)](r(516)),a=this[r(542)](n,o);0==a[r(533)]&&a[r(514)](new i.NoOperation(0)),t[r(384)]=this[r(495)](a)[r(470)]((()=>{const e=r;this[e(541)][e(400)][e(574)](dr)[e(607)](this),this[e(541)][e(490)][e(493)](e(532))}))[r(509)]((e=>this[r(460)](r(366),e)))[r(425)]((()=>this[r(396)]()))}),{priority:e(570)}),this[e(541)].on(e(445),(async(t,[n,r])=>{const s=e;t[s(552)]();const o=this[s(541)][s(548)][s(578)][s(504)](n);if(!this[s(444)][s(402)](n)){const e=r&&r[s(490)]?r[s(490)]:"",t=r&&r[s(616)]?r[s(616)]:{};await this[s(530)](n,e,t)}this[s(541)][s(548)][s(457)]({isUndoable:!1},(()=>{const e=s;o[e(419)]=!0,this[e(541)][e(548)][e(578)][e(576)][e(388)](o)}))}),{priority:e(570)})}async[za(534)](e){const t=za,n=this[t(541)][t(400)][t(574)](ur.Users),{connection:r}=this[t(541)][t(400)][t(574)](dr),s=new Set;for(const r of e){const e=r[t(492)];e&&!n[t(413)](e)&&s[t(596)](e)}if(0===s[t(403)])return;const o=await Le[t(451)](r,Array[t(512)](s));for(const e of o)n[t(413)](e.id)||n[t(443)](e)}[za(542)](e,t={}){const n=za,r=this[n(541)][n(548)],o=[];let a=0;const c=n(473)==typeof e?{main:e}:e;for(const e of Object[n(600)](c)){if(!this[n(590)][n(515)][n(402)](e))throw new s.CKEditorError(n(595),this);const t=this[n(541)][n(490)][n(517)](c[e]),d=this[n(590)][n(504)](e),u=new i.InsertOperation(r[n(381)](d,0),t,a++);o[n(514)](u);for(const[e,s]of t[n(446)]){const t=r[n(554)](r[n(418)](d,s[n(436)][n(503)][n(409)]()),r[n(418)](d,s[n(556)][n(503)][n(409)]())),c=new i.MarkerOperation(e,null,t,r[n(446)],!0,a++);o[n(514)](c)}}if(t)for(const[e,c]of Object[n(496)](t)){const t=r[n(578)][n(504)](e);if(!t)throw new s.CKEditorError(n(582),null);for(const[e,r]of Object[n(496)](c))if(null!==r){const s=new i.RootAttributeOperation(t,e,null,r,a++);o[n(514)](s)}}return o}async[za(530)](e,t,n){const r=za;this[r(542)]({[e]:t},{[e]:n})[r(560)](((e,t)=>{const n=r;e[n(525)]=this[n(590)][n(420)]+t,e[n(471)]=!0,this[n(379)](e)})),this[r(483)](),await this[r(510)]()}async[za(456)](e,t){const n=za;let r;this[n(478)]=e[n(387)];const s=e[n(405)]&&!e[n(386)],o=s?0:e[n(490)][n(525)];if(t[n(560)]((t=>{const r=n;t[r(471)]=!0,t[r(480)]=e[r(535)],t[r(492)]=null})),s)r=t,this[n(406)](r,s);else{if(e[n(386)]){const t=this[n(542)](e[n(386)]);this[n(590)][n(559)][n(420)]=-t[n(533)],t[n(560)]((r=>{const s=n;r[s(525)]-=t[s(533)],r[s(480)]=e[s(535)],r[s(471)]=!0,r[s(492)]=null})),this[n(406)](t,!0),this[n(424)][n(420)]=-t[n(533)]+this[n(478)],this[n(519)](t)}this[n(590)][n(559)][n(420)]=o,r=this[n(588)](e[n(490)],e[n(416)]),await this[n(534)](r),this[n(406)](r,s)}e[n(423)]&&(this[n(410)][n(583)](r,e[n(423)]),this[n(383)]=e[n(423)]),this[n(424)][n(420)]=o+this[n(478)],this[n(519)](r),t[n(484)]((e=>{const t=n,r=this[t(486)](e);return r&&!this[t(444)][t(402)](r)}))[n(560)](((e,t)=>{const r=n;e[r(525)]=this[r(590)][r(420)]+t,this[r(379)](e)})),this[n(558)]()?(this[n(433)]=0,this[n(483)](!0),await this[n(510)]()):(this[n(500)]=!1,this[n(396)]())}[za(460)](e,t){const n=za;throw this[n(500)]=!0,t&&console[n(441)](t),new s.CKEditorError(e,this[n(541)])}[za(379)](e){const t=za;this[t(614)][t(402)](e)||(this[t(614)][t(596)](e),this[t(421)][t(514)](e),this[t(605)]||t(591)==e[t(575)]&&!e[t(529)]||this[t(377)]())}[za(483)](e=!1){const t=za;!e&&this[t(500)]||(this[t(500)]=!0,clearTimeout(this[t(439)]),this[t(439)]=setTimeout((()=>{const e=t;this[e(547)]()[e(470)]((t=>{const n=e;t&&(this[n(396)](),this[n(500)]=!1)}))[e(509)]((t=>{const n=e;if(this[n(396)](),this[n(500)]=!1,!function(e){const t=n;return e[t(367)][t(364)](t(550))||e[t(367)][t(364)](t(604))||e[t(367)][t(364)](t(597))}(t))throw t}))}),this[t(433)]))}[za(510)](){return new Promise((e=>{const t=Fa;this.on(t(404),(()=>{e()}))}))}async[za(547)](){const e=za,t=this[e(541)][e(400)][e(574)](vr);if(this[e(599)]()&&(t[e(363)](),this[e(488)]=!1),!this[e(558)]())return!0;const n=[...this[e(421)]];for(const t of n)t[e(448)]=this[e(590)][e(559)][e(546)](t);const r=this[e(410)][e(417)](n),s=Ka++,o=this[e(372)](n),i=await this[e(577)][e(395)](o,o[e(525)],r);try{return await this[e(368)](n,i,s)}catch(t){return this[e(460)](e(524),t)}}async[za(368)](e,t,n){const r=za;if(r(441)in t)throw t[r(441)];let s=!1;if(t[r(405)]){t[r(423)]&&(this[r(383)]=t[r(423)]),this[r(421)]=this[r(421)][r(484)]((t=>!e[r(537)](t)));for(const n of e)n[r(480)]=r(598)in t&&t[r(598)]||void 0;$a(e,t[r(420)]-e[r(533)]),this[r(519)](e);const n=e[r(484)]((e=>{const t=r;if(!e[t(471)])return!1;const n=this[t(486)](e);return n&&!this[t(444)][t(402)](n)}));$a(n,this[r(590)][r(420)]),this[r(406)](n),s=!0,this[r(433)]=this[r(489)]}else{const e=this[r(588)](t[r(490)],t[r(416)])[r(484)]((e=>e[r(525)]>=this[r(602)]));e[r(560)]((e=>this[r(579)](e))),this[r(421)]=this[r(421)][r(484)]((e=>!e[r(471)]||!this[r(444)][r(402)](this[r(486)](e)))),this[r(421)][r(533)]&&$a(this[r(421)],this[r(421)][0][r(525)]),await this[r(534)](e),s=this[r(414)](e,t[r(420)],t[r(423)]),this[r(433)]=Math[r(531)](this[r(433)]/2)}return s?!this[r(558)]()||(this[r(483)](!0),!1):this[r(460)](r(613))}[za(414)](e,t,n){const r=za;try{const s={document:this[r(590)],useRelations:!1,padWithNoOps:!0},{operationsA:o,operationsB:a,originalOperations:c}=(0,i.transformSets)(e,this[r(421)],s);$a(o,this[r(590)][r(420)]),$a(a,t);for(const e of o){const t=c[r(574)](e);e[r(492)]=t?t[r(492)]:null}n&&(this[r(410)][r(583)](e,n),this[r(383)]=n),this[r(421)]=[...a],this[r(406)](o),this[r(519)](e)}catch(e){return console[r(441)](e),!1}return!0}[za(406)](e,t=!1){const n=za;this[n(541)][n(548)][n(457)]({isUndoable:!1,isLocal:!1},(t=>{const r=n;for(const n of e)this[r(614)][r(596)](n),this[r(579)](n),t[r(564)][r(479)](n),this[r(541)][r(548)][r(454)](n)}))}[za(579)](e){const t=za,n=this[t(486)](e);n&&this[t(444)][t(596)](n)}[za(486)](e){const t=za;let n,r;switch(e[t(575)]){case t(528):n=e[t(371)][t(391)];break;case t(591):if(r=e[t(521)],!r)return null;n=r[t(391)];break;case t(581):n=e[t(391)];break;case t(399):n=e[t(497)];break;case t(507):n=e[t(544)][t(391)];break;default:return null}return n[t(609)]}[za(519)](e){const t=za;e[t(560)]((e=>{const n=t,r=e[n(465)]();r[n(492)]=e[n(492)],r[n(471)]=!!e[n(471)],r[n(480)]=e[n(480)],r[n(525)]+=this[n(478)],e[n(505)]&&this[n(458)][n(596)](r),this[n(424)][n(479)](r)}))}[za(427)](e){const t=za,n=this[t(541)][t(400)][t(574)](t(362)),r=this[t(541)][t(592)];e||(e=Ar(r,t(449))),n[t(401)](e,{title:Ar(r,t(467)),namespace:t(370)}),this[t(565)]=!0,clearTimeout(this[t(439)]),this[t(421)]=[],this[t(541)][t(400)][t(574)](dr)[t(555)]()}[za(377)](){const e=za;this[e(605)]||(this[e(605)]=this[e(541)][e(400)][e(574)](r.PendingActions)[e(596)](Ar(this[e(541)][e(592)],e(540))))}[za(396)](){const e=za;this[e(605)]&&(this[e(541)][e(400)][e(574)](r.PendingActions)[e(378)](this[e(605)]),this[e(605)]=null)}[za(372)](e){const t=za,n=e[t(608)]((e=>e[t(585)]()));return this[t(543)][t(390)](n)}[za(588)](e,t){const n=za;return this[n(543)][n(545)](e)[n(608)](((e,r)=>{const s=n,o=s(385)==t[r][s(575)];if(s(463)==e[s(499)]){const t=e[s(371)][s(391)];!this[s(590)][s(504)](t)&&(this[s(590)][s(373)](s(437),t)[s(474)]=!1)}const a=i.OperationFactory[s(487)](e,this[s(590)]);return a[s(448)]=e[s(448)],a[s(471)]=o,a[s(492)]=o?null:t[r][s(477)],a[s(505)]=s(566)===t[r][s(575)],a[s(480)]=t[r][s(480)],a}))}[za(408)](){const e=za;this[e(488)]=!0,this[e(599)]()?this[e(483)]():this[e(488)]=!1}[za(599)](){const e=za,t=this[e(541)][e(400)][e(574)](fr)[e(407)][e(574)](this[e(567)]);return!this[e(541)][e(563)]&&!!t&&t[e(533)]>1&&this[e(488)]}[za(558)](){const e=za;return this[e(421)][e(533)]>0||this[e(599)]()}}Wa[za(527)]=Vn;const Qa=Wa;class Xa extends Error{}function $a(e,t){const n=za;for(const r of e)r[n(525)]=t++}class Za{constructor(e){const t=za;this[t(498)]=e,this[t(606)]=new WeakMap}[za(417)](e){const t=za;let n=e[t(533)];for(;n--;){const r=e[n];if(!this[t(498)][t(402)](r)){if(!this[t(606)][t(402)](r)){const e=(0,s.uid)()[t(409)](1,18);this[t(606)][t(455)](r,e)}return this[t(606)][t(574)](r)}}}[za(583)](e,t){const n=za;if(!t)return;let r=e[n(533)];for(;r--;){const s=e[r];this[n(498)][n(402)](s)||this[n(606)][n(455)](s,t)}}}function ec(){var e=["18XUoKle","4693260EIjPoG","9303545jaBNJg","13113200dYioRu","4415800GHiAXl","292472MNyIBR","RealTimeCollaborativeEditing","pluginName","3853402ImhByy","6654VMtsNA","652tszRFz","requires","6NRkiNx"];return(ec=function(){return e})()}var tc=nc;function nc(e,t){var n=ec();return(nc=function(e,t){return n[e-=321]})(e,t)}!function(e){for(var t=nc,n=e();;)try{if(945078===parseInt(t(326))/1+-parseInt(t(331))/2*(-parseInt(t(330))/3)+-parseInt(t(322))/4+parseInt(t(323))/5*(parseInt(t(333))/6)+-parseInt(t(329))/7+-parseInt(t(325))/8*(-parseInt(t(321))/9)+-parseInt(t(324))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(ec);class rc extends r.Plugin{static get[tc(332)](){return[Qa]}static get[tc(328)](){return tc(327)}}const sc=ic;!function(e){const t=ic,n=e();for(;;)try{if(758366===parseInt(t(522))/1+parseInt(t(457))/2*(-parseInt(t(516))/3)+-parseInt(t(519))/4*(parseInt(t(491))/5)+parseInt(t(509))/6*(parseInt(t(485))/7)+-parseInt(t(494))/8+parseInt(t(526))/9+parseInt(t(461))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(ac);class oc extends r.ContextPlugin{static get[sc(514)](){return[dr,sc(473),fr,ur.Users]}static get[sc(530)](){return sc(541)}constructor(e){const t=sc;super(e),this[t(543)]=new Map}async[sc(515)](){const e=sc,t=this[e(459)],n=t[e(471)][e(503)](e(473));if(t[e(471)][e(503)](dr)[e(453)](this),n[e(468)]={addCommentThread:async({channelId:t,threadId:n,comments:r,resolvedAt:s,resolvedBy:o,context:i,attributes:a})=>{const c=e,d=await this[c(481)](t)[c(488)]({commentThreadId:n,comments:r[c(472)]((e=>function(e,t,n){const r=c;return{commentThreadId:n,commentId:e[r(480)],userId:e[r(464)],content:e[r(475)],documentId:t,createdAt:e[r(478)],attributes:e[r(507)]||{}}}(e,t,n))),resolvedAt:s,resolvedBy:o,context:i,attributes:a})[c(490)](uc);return{threadId:d[c(550)],comments:d[c(504)]}},getCommentThread:async({channelId:t,threadId:n})=>{const r=e,s=await this[r(481)](t)[r(548)](n)[r(490)](uc);return await this[r(492)]([s]),{threadId:s[r(550)],comments:s[r(504)][r(472)](lc),context:s[r(459)],resolvedAt:s[r(456)],resolvedBy:s[r(511)],attributes:s[r(507)]||{}}},updateCommentThread:async({channelId:t,threadId:n,context:r,unlinkedAt:s,attributes:o})=>this[e(481)](t)[e(533)]({commentThreadId:n,context:r,attributes:o,unlinkedAt:s})[e(490)](dc)[e(490)](uc),resolveCommentThread:async({channelId:t,threadId:n})=>{const r=e,s=await this[r(481)](t)[r(537)](n)[r(490)](dc)[r(490)](uc);return{threadId:s[r(550)],resolvedAt:s[r(456)],resolvedBy:s[r(511)]}},reopenCommentThread:async({channelId:t,threadId:n})=>this[e(481)](t)[e(544)](n)[e(490)](dc)[e(490)](uc),removeCommentThread:({channelId:t,threadId:n})=>this[e(481)](t)[e(496)](n)[e(490)](dc)[e(490)](uc),addComment:({channelId:t,threadId:n,commentId:r,content:s,attributes:o})=>this[e(481)](t)[e(529)](n,r,s,o)[e(490)](uc),updateComment:({channelId:t,threadId:n,commentId:r,content:s,attributes:o})=>this[e(481)](t)[e(477)](n,r,s,o)[e(490)](dc)[e(490)](uc),removeComment:({channelId:t,threadId:n,commentId:r})=>this[e(481)](t)[e(506)](n,r)[e(490)](dc)[e(490)](uc)},t instanceof r.Context){const n=t[e(498)][e(503)](e(536)),r=t[e(471)][e(503)](fr);await this[e(469)](n);const s=await this[e(543)][e(503)](n)[e(458)]();this[e(452)](r,e(512)+n,((t,{session:s})=>{const o=e;s.id===r[o(455)]&&(t[o(535)](),this[o(459)][o(471)][o(503)](o(460))[o(502)](s[o(470)],n))})),r[e(532)](n,s)}}async[sc(469)](e){const t=sc;if(this[t(543)][t(528)](e))throw new s.CKEditorError(t(510),null,{channelId:e});const n=this[t(459)][t(471)][t(503)](t(473)),r=new(oc[t(542)])(e);this[t(543)][t(538)](e,r),this[t(452)](r,t(479),((e,r)=>{const s=t,{commentThreadId:o,documentId:i,context:a,attributes:c,resolvedAt:d,resolvedBy:u,comments:l}=r;n[s(548)](o)||n[s(488)]({threadId:o,channelId:i,comments:l?l[s(472)](lc):[],context:a,attributes:c,resolvedAt:d,resolvedBy:u,isFromAdapter:!0})})),this[t(452)](r,t(467),((e,{commentThreadId:r,documentId:s,context:o,unlinkedAt:i,attributes:a})=>{const c=t;n[c(548)](r)&&n[c(533)]({threadId:r,channelId:s,context:o,unlinkedAt:i,attributes:a,isFromAdapter:!0})})),this[t(452)](r,t(483),((e,{commentThreadId:r,resolvedBy:s,resolvedAt:o})=>{const i=t,a=n[i(548)](r);a&&a[i(495)]({resolvedBy:s,resolvedAt:o,isFromAdapter:!0})})),this[t(452)](r,t(524),((e,{commentThreadId:r})=>{const s=t,o=n[s(548)](r);o&&o[s(500)]({isFromAdapter:!0})})),this[t(452)](r,t(451),((e,{commentThreadId:r})=>{const s=t,o=n[s(548)](r);o&&o[s(525)]({isFromAdapter:!0})})),this[t(452)](r,t(531),((e,r)=>{const s=t,o=r[s(550)],i=n[s(548)](o);i&&i[s(529)]({...lc(r),isFromAdapter:!0})})),this[t(452)](r,t(462),((e,{commentThreadId:r,commentId:s,content:o,attributes:i})=>{const a=t,c=n[a(548)](r);if(c){const e=c[a(518)](s);e&&e[a(499)]({content:o,attributes:i,isFromAdapter:!0})}})),this[t(452)](r,t(497),((e,{commentThreadId:r,commentId:s})=>{const o=t,i=n[o(548)](r);if(i){const e=i[o(518)](s);e&&e[o(525)]({isFromAdapter:!0})}})),await this[t(508)](e)}[sc(523)](){const e=sc;if(this[e(459)]instanceof r.Context){const t=this[e(459)][e(498)][e(503)](e(536));this[e(474)](t)}}[sc(474)](e){const t=sc;if(!this[t(543)][t(528)](e))throw new s.CKEditorError(t(520),null,{channelId:e});this[t(481)](e)[t(521)](),this[t(543)][t(476)](e)}async[sc(505)](){const e=sc;for(const t of this[e(543)][e(487)]())await this[e(508)](t);if(this[e(459)]instanceof r.Context){const t=this[e(459)][e(498)][e(503)](e(536)),n=this[e(459)][e(471)][e(503)](fr);n[e(517)](t);const r=await this[e(543)][e(503)](t)[e(458)]();n[e(532)](t,r)}}async[sc(508)](e){const t=sc,{connection:n}=this[t(459)][t(471)][t(503)](dr),r=this[t(459)][t(471)][t(503)](t(473)),s=this[t(543)][t(503)](e),o=await s[t(482)](n);await this[t(492)](o);const i=new Set(Array[t(539)](r[t(513)]({channelId:e}),(e=>e.id)));for(const e of o)e[t(484)]||i[t(476)](e[t(550)]);for(const e of i)r[t(548)](e)[t(525)]({isFromAdapter:!0});for(const n of o){let s=r[t(548)](n[t(550)]);const{commentThreadId:o,context:i,attributes:a,resolvedBy:c,resolvedAt:d,unlinkedAt:u,deletedAt:l}=n;if(l)continue;s||(s=r[t(488)]({channelId:e,threadId:o,context:i,attributes:a||{},resolvedBy:c,resolvedAt:d,unlinkedAt:u,isFromAdapter:!0}));const p=new Set(Array[t(539)](s[t(504)],(e=>e.id)));for(const e of n[t(504)])p[t(476)](e[t(480)]);for(const e of p)s[t(518)](e)[t(525)]({isFromAdapter:!0});for(const e of n[t(504)]){const n=s[t(518)](e[t(480)]);n?n[t(475)]!==e[t(475)]&&n[t(499)]({content:e[t(475)],isFromAdapter:!0}):s[t(529)](Object[t(465)](lc(e),{isFromAdapter:!0}))}}}[sc(481)](e){const t=sc;if(!this[t(543)][t(528)](e))throw new s.CKEditorError(t(527),null,{channelId:e});return this[t(543)][t(503)](e)}async[sc(492)](e){const t=sc,n=this[t(459)][t(471)][t(503)](ur.Users),{connection:r}=this[t(459)][t(471)][t(503)](dr),s=new Set;for(const{resolvedBy:r,comments:o}of e){r&&!n[t(486)](r)&&s[t(545)](r);for(const{userId:e}of o)n[t(486)](e)||s[t(545)](e)}if(0===s[t(540)])return;const o=await Le[t(493)](r,Array[t(539)](s));for(const e of o)n[t(486)](e.id)||n[t(501)](e)}}function ic(e,t){const n=ac();return(ic=function(e,t){return n[e-=451]})(e,t)}function ac(){const e=["addComment","pluginName","commentAdded","register","updateCommentThread","code","off","collaboration.channelId","resolveCommentThread","set","from","size","CloudServicesCommentsAdapter","CommentsService","_services","reopenCommentThread","add","404","cloud-services-internal-error: Not connected.","getCommentThread","startsWith","commentThreadId","commentThreadRemoved","listenTo","addToReconnectionStack","cloud-services-internal-error: Comments Service is not connected.","mySessionId","resolvedAt","4034PPeCoa","getConnectedSessions","context","Permissions","13775260lIffAF","commentUpdated","userId","authorId","assign","message","commentThreadUpdated","adapter","_setUpService","permissions","plugins","map","CommentsRepository","_terminateService","content","delete","updateComment","createdAt","commentThreadAdded","commentId","_getService","connect","commentThreadResolved","deletedAt","7DkXWmG","getUser","keys","addCommentThread","cloud-services-internal-error: Request timeout.","catch","205rfMblV","_fetchMissingUsersForThreads","getMany","12104512vIpLVp","resolve","removeCommentThread","commentRemoved","config","update","reopen","addUser","setPermissions","get","comments","reconnect","removeComment","attributes","_connectService","8303118rCHKyo","cloudservicescommentsadapter-connect-already-connected","resolvedBy","sessionAdd:","getCommentThreads","requires","init","1854xrkKBV","unregister","getComment","92788sVHZZg","cloudservicescommentsadapter-disconnect-not-exist","disconnect","433504OGTdYx","destroy","commentThreadReopened","remove","11467170CKtCcY","cloudservicescommentsadapter-service-not-exist","has"];return(ac=function(){return e})()}oc[sc(542)]=sr;const cc=oc;async function dc(e){const t=sc;if(t(546)!==e[t(534)])throw e}function uc(e){const t=sc;if((n=e)[t(466)][t(549)](t(454))||n[t(466)][t(549)](t(547))||n[t(466)][t(549)](t(489)))return new Promise((()=>{}));var n;throw e}function lc(e){const t=sc;return{threadId:e[t(550)],commentId:e[t(480)],content:e[t(475)],createdAt:e[t(478)],authorId:e[t(463)],attributes:e[t(507)]||{}}}const pc=hc;function hc(e,t){const n=fc();return(hc=function(e,t){return n[e-=280]})(e,t)}function fc(){const e=["TrackChangesService","update","add","size","64664OJkZJs","adapter","_saved","cloud-services-internal-error: Not connected.","11PtswgB","data","hasSuggestion","get","49YGZBTz","_fetchMissingUsersForThreads","addSuggestionData","values","addUser","8nHgUoM","message","getSuggestion","requires","reconnect","1359736JauErc","startsWith","type","from","attributes","set","suggestionUpdated","addToReconnectionStack","874684bUusnA","TrackChangesEditing","_bufferedRequests","listenTo","plugins","init","open","6819740WutAmc","_waitForServiceReady","connect","984185KKKKmz","connection","originalSuggestionId","connected","collaboration.channelId","isConnected","561042eCPUpQ","off","find","catch","state","then","686454yhzuLB","editor","729zVJzuH","cloud-services-internal-error: Request timeout.","getMany","getUser","delete","_trackChangesService","config"];return(fc=function(){return e})()}!function(e){const t=hc,n=e();for(;;)try{if(579291===-parseInt(t(335))/1+-parseInt(t(322))/2*(-parseInt(t(296))/3)+-parseInt(t(327))/4+parseInt(t(284))/5+-parseInt(t(290))/6*(-parseInt(t(317))/7)+parseInt(t(309))/8*(-parseInt(t(298))/9)+parseInt(t(281))/10*(parseInt(t(313))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(fc);class mc extends r.Plugin{static get[pc(325)](){return[cc,pc(336),dr]}constructor(e){const t=pc;super(e);const n=this[t(297)][t(304)][t(316)](t(288));this[t(337)]=new Map,this[t(303)]=new(mc[t(305)])(n)}[pc(340)](){const e=pc,t=this[e(297)][e(339)][e(316)](dr),n=this[e(297)][e(339)][e(316)](e(336));return n[e(310)]={getSuggestion:async t=>{const n=e;await this[n(282)]();const r=await this[n(303)][n(316)](t)[n(293)](yc);return await this[n(318)]([r]),r},addSuggestion:async({id:t,type:n,data:r,originalSuggestionId:s,attributes:o})=>{const i=e;await this[i(282)]();const a={id:t,type:n,data:r,originalSuggestionId:s,attributes:o},c=await this[i(303)][i(307)](t,n,r,s,o)[i(293)]((e=>{if(gc(e))return new Promise((e=>{const n=hc;this[n(337)][n(332)](t,{resolve:e,suggestionData:a})}));throw e}));return this[i(337)][i(302)](t),c},updateSuggestion:async(t,n)=>{const r=e;if(await this[r(282)](),r(280)!==n[r(294)])return this[r(303)][r(306)](t,n)[r(293)](yc)}},this[e(338)](this[e(303)],e(333),((t,r)=>{const s=e;n[s(315)](r.id)&&(n[s(324)](r.id)[s(331)]=r[s(331)])})),this[e(303)][e(283)](t[e(285)])[e(295)]((r=>(t[e(334)](this),this[e(318)](r)[e(295)]((()=>{const t=e;for(const e of r)n[t(319)](e)[t(311)]=!0})))))}async[pc(326)](){const e=pc,t=this[e(297)][e(339)][e(316)](e(336)),{connection:n}=this[e(297)][e(339)][e(316)](dr),r=await this[e(303)][e(283)](n);await this[e(318)](r);for(const{suggestionData:t,resolve:n}of this[e(337)][e(320)]()){let s=r[e(292)]((e=>e.id===t.id));s||(s=await this[e(303)][e(307)](t.id,t[e(329)],t[e(314)],t[e(286)])),n(s)}for(const n of r)t[e(315)](n.id)||t[e(319)](n)}async[pc(282)](){const e=pc;this[e(303)][e(289)]||await new Promise((t=>{const n=e;this[n(338)](this[n(303)],n(287),(e=>{e[n(291)](),t()}))}))}async[pc(318)](e){const t=pc,n=this[t(297)][t(339)][t(316)](ur.Users),{connection:r}=this[t(297)][t(339)][t(316)](dr),s=new Set;for(const{authorId:r}of e)n[t(301)](r)||s[t(307)](r);if(0===s[t(308)])return;const o=await Le[t(300)](r,Array[t(330)](s));for(const e of o)n[t(301)](e.id)||n[t(321)](e)}}function yc(e){if(gc(e))return new Promise((()=>{}));throw e}function gc(e){const t=pc;return e[t(323)][t(328)](t(312))||e[t(323)][t(328)](t(299))}function bc(){const e=["184308gyhGwK","change:state","collaboration.channelId","1466520bDTylG","_setUpService","9HrdsvO","RealTimeCollaborativeComments","1021170eyYxJb","514569DNuCCY","once","CommentsRepository","get","484088wubMLT","ready","CommentsEditing","18SPTEUB","10826648oNidEo","config","Comments","390NQKbJw","connected","destroy","_terminateService","1498032cGQiNT","data","init","pluginName","editor","listenTo","12nOAuWg","requires","plugins","isThreadsLoadingPaused","switchReadOnly"];return(bc=function(){return e})()}mc[pc(305)]=un;const Oc=wc;function wc(e,t){const n=bc();return(wc=function(e,t){return n[e-=266]})(e,t)}!function(e){const t=wc,n=e();for(;;)try{if(976628===parseInt(t(279))/1+-parseInt(t(271))/2*(-parseInt(t(290))/3)+-parseInt(t(285))/4*(parseInt(t(297))/5)+-parseInt(t(293))/6+parseInt(t(272))/7+-parseInt(t(268))/8*(-parseInt(t(295))/9)+-parseInt(t(275))/10*(parseInt(t(298))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(bc);class Ic extends r.Plugin{static get[Oc(286)](){return[Oc(274),cc,rc,dr]}static get[Oc(282)](){return Oc(296)}[Oc(281)](){const e=Oc,t=this[e(283)][e(287)][e(267)](dr),n=this[e(283)][e(287)][e(267)](e(270)),r=this[e(283)][e(287)][e(267)](cc);return this[e(283)][e(280)][e(299)](e(269),(()=>{const r=e;this[r(284)](t,r(291),((e,t,s)=>{const o=r;n[o(288)]=o(276)!==s}))})),this[e(284)](t,e(291),((t,n,r)=>{const s=e;this[s(283)][s(287)][s(267)](s(266))[s(289)](s(276)!==r)})),r[e(294)](this[e(283)][e(273)][e(267)](e(292)))}[Oc(277)](){const e=Oc;this[e(283)][e(287)][e(267)](cc)[e(278)](this[e(283)][e(273)][e(267)](e(292))),super[e(277)]()}}function vc(e,t){var n=Ac();return(vc=function(e,t){return n[e-=398]})(e,t)}var Sc=vc;function Ac(){var e=["41224qtYXqD","936475MyqcsS","1128308HOpJBU","176336Mlkluj","RealTimeCollaborativeTrackChanges","600264KKGqro","requires","4061932LiahMY","117mDaryn","pluginName","69AjYNFh","TrackChanges","439581TGXLLV"];return(Ac=function(){return e})()}!function(e){for(var t=vc,n=e();;)try{if(310181===-parseInt(t(407))/1+-parseInt(t(408))/2*(-parseInt(t(405))/3)+parseInt(t(410))/4+parseInt(t(409))/5+parseInt(t(400))/6+-parseInt(t(402))/7+-parseInt(t(398))/8*(-parseInt(t(403))/9))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Ac);class Pc extends r.Plugin{static get[Sc(401)](){return[Ic,mc,Sc(406)]}static get[Sc(404)](){return Sc(399)}}const Tc=_c;function _c(e,t){const n=kc();return(_c=function(e,t){return n[e-=410]})(e,t)}function kc(){const e=["serverHistory","size","getRevision","requires","9489007EECyCT","_waitForServiceReady","_getLatestVersionFromServerOperations","revisionsUpdated","cloud-services-internal-error: Revision History Service is not connected.","_revisionDataBuilder","reInit","cloudServices.bundleVersion","state","_createCurrentRevision","type","_fixRevision","affectsData","6xsDtyb","40ZUKQBp","_update","_handleReconnectionError","cloud-services-internal-error: Request timeout.","adapter","plugins","add","_revisions","then","10ugezij","authorsIds","57014fZJuub","2781258nasKvW","getOperations","_bufferedUpdates","isEmptyCurrent","_fetchMissingUsers","_revisionTracker","435790wMQsSQ","connect","wrongRequestId","_oldOffset","editor","message","CONNECTED","destroy","init","_lastRequestId","2602894CzFepZ","listenTo","addUser","catch","_offset","data","_isPendingUpdate","length","marker","isBundleUploaded","setRevisionData","code","get","createdAt","connection","once","42831LEureh","has","currentRevision","max","from","off","_isConnected","isEnabled","fromVersion","buildRevisionData","remove","getRevisions","_revisionHistoryService","setSource","reconnect","authors","reverse","toVersion","sessionId","repository","change:_isConnected","isConnected","_startingVersion","_getLatestVersion","creatorId","addRevisionData","change:_isPendingUpdate","connected","bind","_preventResendingRevisionData","config","startsWith","RevisionTracker","_bufferUpdate","diffData","58RsfWlB","RevisionHistoryService","4988348AWCHBp","getMany","cloud-services-internal-error: Not connected.","addToReconnectionStack","collaboration.channelId","baseVersion","400","updateRevisions","keys","_handleRevisionsUpdate","getUser","sendBufferedUpdates","map"];return(kc=function(){return e})()}!function(e){const t=_c,n=e();for(;;)try{if(953563===-parseInt(t(512))/1*(-parseInt(t(444))/2)+parseInt(t(445))/3+-parseInt(t(514))/4+parseInt(t(451))/5*(parseInt(t(432))/6)+parseInt(t(461))/7+-parseInt(t(433))/8*(-parseInt(t(477))/9)+parseInt(t(442))/10*(-parseInt(t(419))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(kc);class Cc extends r.Plugin{static get[Tc(418)](){return[dr,Qa,Tc(509),fr,ur.Users]}constructor(e){const t=Tc;super(e);const n=this[t(455)][t(507)][t(473)](t(518));this[t(460)]=null,this[t(450)]=this[t(455)][t(438)][t(473)](t(509)),this[t(489)]=new(Cc[t(513)])(n)}async[Tc(459)](){const e=Tc,t=this[e(455)][e(438)][e(473)](Qa),n=t[e(415)],r=this[e(455)][e(438)][e(473)](dr);this[e(450)][e(490)]({history:n,getLatestVersion:()=>this[e(500)](),getCurrentRevisionId:()=>t[e(495)]});const o=this[e(455)][e(507)][e(473)](e(426))||s.version,i=await Bt[e(470)](r[e(475)],o);this[e(450)][e(437)]={getRevision:async({revisionId:t})=>(await this[e(420)](),await this[e(489)][e(417)](t)),updateRevisions:async t=>{const n=e;await this[n(420)]();const r=this[n(450)][n(479)];if(i&&1===t[n(468)]&&t[0].id===r.id)return t;for(const e of t)e.id===r.id&&(e[n(448)]=e[n(485)]===e[n(494)]);return this[n(489)][n(521)](t,this[n(460)])[n(441)]((e=>(this[n(460)]=e,t)))[n(464)]((e=>{const r=n;if(jc(e)||r(520)===e[r(472)]&&void 0!==e[r(466)][r(453)]){for(const e of t)!this[r(450)][r(496)][r(417)](e.id)||this[r(450)][r(510)](e.id,e,!1);if(jc(e))throw e;return t}throw e}))}},this[e(462)](this[e(489)],e(422),((t,{revisionsData:n,requestId:r})=>{const s=e;Math[s(480)](...n[s(414)]((e=>e[s(494)])))>this[s(421)]()-1?this[s(500)]()[s(441)]((()=>{this[s(411)](n,r)})):this[s(411)](n,r)}));const{revisions:a,requestId:c}=await this[e(489)][e(452)](r[e(475)]);r[e(517)](this),this[e(460)]=c,await this[e(449)](a);for(const t of a)this[e(450)][e(502)](t);this[e(462)](t,e(497),((n,r,s)=>{const o=e;s&&(this[o(454)]=t[o(465)],n[o(482)]())})),this[e(450)][e(505)](e(484)).to(r,e(427),(t=>t===jt[e(457)]))}async[Tc(491)](){const e=Tc,t=this[e(455)][e(438)][e(473)](dr),n=this[e(455)][e(438)][e(473)](Qa),r=async()=>{const r=e,s=this[r(450)][r(479)],o=s.id,i=o!==n[r(495)];if(i){const e=n[r(465)]-this[r(454)],t=this[r(421)]();if(this[r(450)][r(424)][r(425)](),s[r(494)]+e!==t){const n=s[r(485)]+e,o=this[r(455)][r(438)][r(473)](ur.Users),i=this[r(450)][r(486)]({revision:s,from:n,to:t});i.id=s.id;const a=i[r(443)][r(414)]((e=>o[r(412)](e)));s[r(434)]({...i,authors:a},!0),this[r(450)][r(510)](s.id,i,!0)}this[r(450)][r(499)]=t,s[r(494)]===s[r(485)]&&!this[r(450)][r(447)][r(478)](o)&&this[r(450)][r(496)][r(440)][r(487)](o),this[r(450)][r(428)](t)}const{revisions:a,requestId:c}=await this[r(489)][r(491)](t[r(475)],this[r(460)]);i&&a[r(468)]>0?n[r(435)]():(await this[r(449)](a),this[r(411)](a,c),this[r(450)][r(413)]())};return n[e(483)]?r():new Promise(((t,s)=>{const o=e;n[o(476)](o(497),(()=>{const e=o;r()[e(441)](t)[e(464)](s)}))}))}[Tc(458)](){super[Tc(458)]()}async[Tc(420)](){const e=Tc;this[e(489)][e(498)]||await new Promise((t=>{const n=e;this[n(462)](this[n(489)],n(504),(e=>{e[n(482)](),t()}))}))}[Tc(421)](){const e=Tc,t=this[e(455)][e(438)][e(473)](Qa)[e(415)][e(446)]()[e(493)]();for(const n of t)if(e(469)!==n[e(429)]||n[e(431)])return n[e(519)]+1}[Tc(500)](){const e=Tc,t=this[e(455)][e(438)][e(473)](Qa);return new Promise((n=>{const r=e;t[r(467)]?t[r(476)](r(503),(()=>{n(this[r(421)]())})):n(this[r(421)]())}))}[Tc(411)](e,t){const n=Tc,r=this[n(450)][n(496)];this[n(460)]=t;for(const t of e){const e=r[n(417)](t.id);if(e){if((t[n(485)]||t[n(494)])&&(t[n(511)]=null),e===this[n(450)][n(479)]){const r=Math[n(480)](e[n(494)],t[n(494)]),s=Math[n(480)](e[n(485)],t[n(485)]);let o;e[n(494)]===t[n(494)]&&e[n(485)]===t[n(485)]?(o=!0,this[n(506)](t)):t[n(494)]===r&&t[n(485)]===s?o=!1:(e[n(494)]===r&&e[n(485)]===s||this[n(430)]({revision:e,from:s,to:r}),o=!0),o&&(delete t[n(485)],delete t[n(494)],delete t[n(511)],delete t[n(474)],delete t[n(443)])}this[n(450)][n(471)](t),this[n(506)](t)}else this[n(450)][n(502)](t)}const s=r[n(488)]();s[n(493)]();for(let e=0;e<s[n(468)]-1;e++){const t=s[e],r=s[e+1];if(t[n(485)]<r[n(494)]){const e=r[n(494)],s=Math[n(480)](e,t[n(494)]);this[n(430)]({revision:t,from:e,to:s})}}}[Tc(430)]({revision:e,from:t,to:n}={}){const r=Tc,s=this[r(455)][r(438)][r(473)](ur.Users),o=this[r(450)][r(486)]({revision:e,from:t,to:n});o[r(492)]=o[r(443)][r(414)]((e=>s[r(412)](e))),e[r(434)](o)}[Tc(506)](e){const t=Tc,n={};n.id=e.id;for(const r of Object[t(410)](e))"id"!==r&&(n[r]=void 0);this[t(450)][t(510)](n.id,n,!0)}async[Tc(449)](e){const t=Tc,n=this[t(455)][t(438)][t(473)](ur.Users),{connection:r}=this[t(455)][t(438)][t(473)](dr),s=new Set;for(const n of e){for(const e of n[t(443)])i(e);n[t(501)]&&i(n[t(501)])}if(0===s[t(416)])return;const o=await Le[t(515)](r,Array[t(481)](s));for(const e of o)n[t(412)](e.id)||n[t(463)](e);function i(e){const r=t;n[r(412)](e)||s[r(439)](e)}}}Cc[Tc(513)]=Wt;const Ec=Cc;function jc(e){const t=Tc;return e[t(456)][t(508)](t(423))||e[t(456)][t(508)](t(516))||e[t(456)][t(508)](t(436))}var Rc=Nc;function Dc(){var e=["1023896OXceOA","RevisionHistory","279089OlwsvO","2862020HvXjlN","requires","7BBiGzX","1146468hElpNr","1116268OwxdJX","2113371caHFhz","15243104TXGpab","RealTimeCollaborativeRevisionHistory","9Helkjl","pluginName"];return(Dc=function(){return e})()}function Nc(e,t){var n=Dc();return(Nc=function(e,t){return n[e-=316]})(e,t)}!function(e){for(var t=Nc,n=e();;)try{if(391241===-parseInt(t(322))/1+parseInt(t(320))/2+-parseInt(t(328))/3+-parseInt(t(327))/4+-parseInt(t(323))/5+-parseInt(t(326))/6*(parseInt(t(325))/7)+-parseInt(t(316))/8*(-parseInt(t(318))/9))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Dc);class xc extends r.Plugin{static get[Rc(324)](){return[Rc(321),Ec,rc]}static get[Rc(319)](){return Rc(317)}}var Vc=Function.prototype,Mc=Object.prototype,Bc=Vc.toString,Uc=Mc.hasOwnProperty,Jc=Bc.call(Object);const qc=function(e){if(!uo(e)||"[object Object]"!=ms(e))return!1;var t=ui(e);if(null===t)return!0;var n=Uc.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Bc.call(n)==Jc};const Gc=function(e){return uo(e)&&1===e.nodeType&&!qc(e)};function Lc(e,t){const n=Yc();return(Lc=function(e,t){return n[e-=299]})(e,t)}function Yc(){const e=["ck-presence-list__counter","1182596VBgdqK","785205KpDlUm","CONNECTED_USERS","356037ltQXYW","bindTemplate","set","div","1986632UKAOUP","9asqOgo","69562TxOztq","4dSNbPI","555024HJxkir","826630CDnLKH","ck-presence-list__counter--hidden","usersCount","21EDGEZc","isHidden","setTemplate"];return(Yc=function(){return e})()}!function(e){const t=Lc,n=e();for(;;)try{if(173048===parseInt(t(310))/1+-parseInt(t(311))/2*(parseInt(t(304))/3)+parseInt(t(301))/4+parseInt(t(302))/5+-parseInt(t(312))/6*(parseInt(t(316))/7)+parseInt(t(308))/8*(parseInt(t(309))/9)+-parseInt(t(313))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Yc);class zc extends o.View{constructor(e){const t=Lc;super(e);const n=this[t(305)];this[t(306)](t(315),0),this[t(306)](t(317),!0),this[t(299)]({tag:t(307),attributes:{class:["ck",t(300),n.if(t(317),t(314))]},children:[{text:n.to(t(315),(n=>Ar(e,t(303),n)))}]})}}function Hc(){const e=["192VYdlCl","setTemplate","26gGTPuA","15872480hJIdqA","89223GracHZ","fire","11704xOZBJN","73905BuZuuF","5yrRVef","1869FVWAez","ck-presence-list__list","bindTemplate","2874456hNcixm","createCollection","execute","div","2395740LmtGnr","29993953tsmoCI","items"];return(Hc=function(){return e})()}function Fc(e,t){const n=Hc();return(Fc=function(e,t){return n[e-=141]})(e,t)}!function(e){const t=Fc,n=e();for(;;)try{if(834003===parseInt(t(144))/1*(-parseInt(t(142))/2)+parseInt(t(147))/3*(parseInt(t(159))/4)+parseInt(t(148))/5*(-parseInt(t(156))/6)+-parseInt(t(149))/7*(-parseInt(t(146))/8)+-parseInt(t(152))/9+-parseInt(t(143))/10+parseInt(t(157))/11)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Hc);class Kc extends o.View{constructor(e){const t=Fc;super(e),this[t(158)]=this[t(153)]();const n=this[t(151)];this[t(141)]({tag:t(155),attributes:{class:["ck",t(150)]},children:this[t(158)],on:{click:n.to((()=>this[t(145)](t(154))))}})}}var Wc=__webpack_require__(106),Qc={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};yr()(Wc.A,Qc);Wc.A.locals;function Xc(e,t){const n=$c();return(Xc=function(e,t){return n[e-=208]})(e,t)}function $c(){const e=["inlineListView","4ZbyKBR","counterView","1606390ibZUsY","5850441dOFcrA","2sOhFQO","tooltipPosition","ck-presence-list","bindTemplate","div","1182538sUFAMj","13848373UCprRd","items","first","42dBxgfi","set","8qboMFh","setTemplate","4622262JseFTh","615278jAARJJ","isCollapsed","ck-rounded-corners","change","3092320SJyuHD","listenTo","ck-reset","ck-presence-list--collapsed","locale"];return($c=function(){return e})()}!function(e){const t=Xc,n=e();for(;;)try{if(923452===-parseInt(t(222))/1+parseInt(t(208))/2*(-parseInt(t(221))/3)+parseInt(t(232))/4*(-parseInt(t(234))/5)+-parseInt(t(217))/6*(-parseInt(t(213))/7)+-parseInt(t(219))/8*(-parseInt(t(235))/9)+parseInt(t(226))/10+parseInt(t(214))/11)break;n.push(n.shift())}catch(e){n.push(n.shift())}}($c);class Zc extends o.View{constructor(e){const t=Xc;super(e);const n=this[t(211)];this[t(218)](t(223),!0),this[t(233)]=new zc(this[t(230)]),this[t(231)]=new Kc(e),this[t(227)](this[t(231)][t(215)],t(225),(()=>{const e=t;for(const t of this[e(231)][e(215)])t[e(209)]="s";this[e(231)][e(215)][e(216)]&&(this[e(231)][e(215)][e(216)][e(209)]="se")})),this[t(220)]({tag:t(212),attributes:{class:["ck",t(210),t(228),t(224),n.if(t(223),t(229))]},children:[this[t(233)],this[t(231)]]})}}function ed(e,t){var n=nd();return(ed=function(e,t){return n[e-=237]})(e,t)}!function(e){for(var t=ed,n=e();;)try{if(842858===-parseInt(t(249))/1+-parseInt(t(247))/2+parseInt(t(248))/3+parseInt(t(251))/4*(parseInt(t(241))/5)+-parseInt(t(250))/6*(parseInt(t(243))/7)+parseInt(t(239))/8*(parseInt(t(242))/9)+parseInt(t(246))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(nd);class td extends o.View{constructor(e){var t=ed;super(e),this[t(240)]=this[t(245)](),this[t(237)]({tag:t(252),attributes:{class:["ck",t(238)]},children:[{tag:t(252),attributes:{class:["ck",t(244)]},children:this[t(240)]}]})}}function nd(){var e=["2874813zwPxfh","554776lvFruN","6peduaa","1487588AzvbiV","div","setTemplate","ck-presence-list__dropdown-list","2818168BcSWzz","items","5kjZRSC","18cXZaBY","9801379edSiJy","ck-presence-list__dropdown-list-wrapper","createCollection","20926160aFVljA","2658990ogkGYb"];return(nd=function(){return e})()}function rd(){const e=["ck-presence-list__marker","color","tag","17UilHDx","button","ck-presence-list__dropdown-list-item","154LMaToc","true","bindTemplate","div","2142732qWfwcL","273hSoWDY","2059535bfRUWu","201786yVYdrm","1827416MUiyvx","execute","name","userView","1900MGwdmi","36vqjMdl","getBackgroundColorClass","fire","4440114KpAKhg","9878lYOWcK","setTemplate","30112LpVNKZ","span","ck-user__full-name","16dPRYWG"];return(rd=function(){return e})()}function sd(e,t){const n=rd();return(sd=function(e,t){return n[e-=292]})(e,t)}!function(e){const t=sd,n=e();for(;;)try{if(946143===-parseInt(t(310))/1*(parseInt(t(303))/2)+parseInt(t(300))/3+parseInt(t(306))/4*(parseInt(t(319))/5)+-parseInt(t(320))/6*(-parseInt(t(313))/7)+parseInt(t(292))/8*(parseInt(t(297))/9)+-parseInt(t(296))/10*(-parseInt(t(301))/11)+-parseInt(t(317))/12*(parseInt(t(318))/13))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(rd);class od extends o.View{constructor(e,t,n){const r=sd;super(e);const s=this[r(315)];this[r(295)]=new ur.UserView(e,t);const o={tag:r(316),attributes:{class:["ck",r(312)]},children:[this[r(295)],{tag:r(304),attributes:{class:["ck",r(305)]},children:[{text:t[r(294)]}]},{tag:r(304),attributes:{class:["ck",r(307),t[r(308)][r(298)]()],"aria-hidden":r(314)}}]};n&&(o[r(309)]=r(311),o.on={click:s.to((()=>this[r(299)](r(293))))}),this[r(302)](o)}}function id(){const e=["fire","ck-presence-list__marker","2260578RJLHbn","4087494xATrhJ","13946792cdOgyG","ck-presence-list__list-item__tooltip","hasTooltip","true","9119810qVMCOc","5706UTQuYs","div","bindTemplate","userView","getBackgroundColorClass","set","ck-presence-list__list-item","tooltipPosition","name","button","execute","color","markerView","10FRWVlr","tag","614EIPIND","5575869YxxbQG","setTemplate","span","7233332UCHoVX"];return(id=function(){return e})()}function ad(e,t){const n=id();return(ad=function(e,t){return n[e-=424]})(e,t)}!function(e){const t=ad,n=e();for(;;)try{if(934279===-parseInt(t(442))/1*(-parseInt(t(427))/2)+-parseInt(t(443))/3+parseInt(t(446))/4+parseInt(t(440))/5*(-parseInt(t(449))/6)+-parseInt(t(426))/7+parseInt(t(451))/8+-parseInt(t(450))/9)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(id);class cd extends o.View{constructor(e,t,n){const r=ad;super(e);const s=this[r(429)];this[r(432)](r(424),!0),this[r(432)](r(434),""),this[r(430)]=new ur.UserView(e,t),this[r(439)]=new dd(e,t);const o={tag:r(428),attributes:{class:["ck",r(433)],"data-cke-tooltip-text":this[r(430)][r(435)],"data-cke-tooltip-position":s.to(r(434)),"data-cke-tooltip-disabled":s.to(r(424),(e=>!e)),"data-cke-tooltip-class":r(452)},children:[this[r(430)],this[r(439)]]};n&&(o[r(441)]=r(436),o.on={click:s.to((()=>this[r(447)](r(437))))}),this[r(444)](o)}}class dd extends o.View{constructor(e,t){const n=ad;super(e),this[n(444)]({tag:n(445),attributes:{class:["ck",n(448),t[n(438)][n(431)]()],"aria-hidden":n(425)}})}}const ud=ld;function ld(e,t){const n=pd();return(ld=function(e,t){return n[e-=265]})(e,t)}function pd(){const e=["onClick","allConnectedUsers","currentDisplayedUsers","requires","presenceList.collapseAt","11NJdzQo","4lImXYC","get","displayMe","isMe","inlineListView","_allConnectedUsers","destroy","_createView","isCollapsed","set","render","presencelist-collapseat-invalid-format","isRendered","4905890bzMOAT","showDropdown","counterView","presenceList.container","399385gAfHHM","ck ck-presence-list__balloon","isVisible","add","2445783ZQtjWg","length","locale","16UZlCXG","class","detachFromDom","context","init","bind","1178749SXJexa","6FGkCxg","_calculateNewUserPosition","number","remove","view","element","presenceList.displayMe","last","plugins","7375039nfqoQO","unpin","hasTooltip","12CkEOfx","define","_bodyCollection","hideDropdown","attachToDom","3916881oPzCXF","isHidden","appendChild","items","listenTo","4772935COdqRm","presencelist-missing-container","execute","_handleUserRemove","_handleUserAdd","usersCount","presenceList","presenceDropdownView","using","bindTo","pin","2nwMbwc","balloonPanelView","content","reverse","from","config"];return(pd=function(){return e})()}!function(e){const t=ld,n=e();for(;;)try{if(658162===-parseInt(t(310))/1*(-parseInt(t(281))/2)+-parseInt(t(314))/3*(-parseInt(t(293))/4)+-parseInt(t(270))/5+parseInt(t(324))/6*(-parseInt(t(333))/7)+-parseInt(t(317))/8*(-parseInt(t(265))/9)+parseInt(t(306))/10*(parseInt(t(292))/11)+-parseInt(t(336))/12*(-parseInt(t(323))/13))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(pd);const hd={collapseAt:6,displayMe:!0};class fd extends r.ContextPlugin{constructor(e){const t=ld;super(e),this[t(320)][t(286)][t(337)](t(276),hd);const n=e[t(286)][t(294)](t(291));if(t(326)!=typeof n)throw new s.CKEditorError(t(304),this);if(n<1)throw new s.CKEditorError(t(304),this);this[t(298)]=this[t(320)][t(332)][t(294)](fr)[t(288)],this[t(302)](t(275),0),this[t(289)]=new s.Collection,this[t(282)]=new o.BalloonPanelView,this[t(282)][t(318)]=t(311),this[t(328)]=this[t(300)](),this[t(277)]=void 0}static get[ud(290)](){return[fr]}[ud(321)](){const e=ud;for(const t of this[e(298)])this[e(274)](t);this[e(269)](this[e(298)],e(313),((t,n)=>{this[e(274)](n)})),this[e(269)](this[e(298)],e(327),((t,n)=>{this[e(273)](n)}))}[ud(300)](){const e=ud,t=this[e(320)],n=new Zc(this[e(320)][e(316)]),r=this[e(282)];if(!Gc(t[e(286)][e(294)](e(309))))throw new s.CKEditorError(e(271),this);return n[e(308)][e(322)](e(275)).to(this),n[e(322)](e(301)).to(this,e(275),(r=>{const s=e,{collapseAt:o,displayMe:i}=t[s(286)][s(294)](s(276)),a=r>=o;return n[s(308)][s(266)]=!(1==r&&i||a),a||this[s(339)](),a})),n[e(297)][e(268)][e(279)](this[e(289)])[e(278)]((r=>{const s=e,o=t[s(286)][s(294)](s(276)),i=new cd(t[s(316)],r,!!o[s(287)]);return i[s(322)](s(335)).to(n,s(301),(e=>!e)),o[s(287)]&&this[s(269)](i,s(272),(()=>{const e=s;this[e(328)][e(301)]||o[e(287)](r,i[e(329)])})),i})),this[e(269)](n[e(297)],e(272),(()=>{const t=e;this[t(277)]?this[t(339)]():this[t(328)][t(301)]&&this[t(307)]()})),n[e(303)](),r[e(303)](),(0,o.clickOutsideHandler)({emitter:n,activator:()=>r[e(312)],contextElements:[r[e(329)],n[e(297)][e(329)]],callback:()=>this[e(339)]()}),t[e(286)][e(294)](e(309))[e(267)](n[e(329)]),this[e(338)]=new o.BodyCollection(this[e(320)][e(316)]),this[e(338)][e(340)](),this[e(338)][e(313)](r),n}[ud(274)](e){const t=ud;if(!this[t(320)][t(286)][t(294)](t(330))&&e[t(296)])return;const n=this[t(320)][t(286)][t(294)](t(291))-1;this[t(275)]++,this[t(289)][t(315)]==n&&this[t(289)][t(327)](0);const r=this[t(325)](e);this[t(289)][t(313)](e,r)}[ud(273)](e){const t=ud;if(this[t(275)]--,this[t(289)][t(294)](e.id)&&(this[t(289)][t(327)](e.id),this[t(289)][t(315)]<this[t(275)]))for(const e of Array[t(285)](this[t(298)])[t(284)]())if(!this[t(289)][t(294)](e.id))return void this[t(289)][t(313)](e,0)}[ud(325)](e){const t=ud;return Boolean(this[t(289)][t(331)]&&this[t(289)][t(331)][t(296)])&&!e[t(296)]?this[t(289)][t(315)]-1:this[t(289)][t(315)]}[ud(307)](){const e=ud;if(this[e(277)])return;this[e(277)]=new td(this[e(320)][e(316)]);const t=this[e(320)][e(286)][e(294)](e(276));this[e(277)][e(268)][e(279)](this[e(298)])[e(278)]((n=>{const r=e;if(!t[r(295)]&&n[r(296)])return null;const s=new od(this[r(320)][r(316)],n,!!t[r(287)]);return t[r(287)]&&this[r(269)](s,r(272),(()=>{const e=r;t[e(287)](n,s[e(329)])})),s})),this[e(282)][e(283)][e(313)](this[e(277)]),this[e(282)][e(280)]({target:this[e(328)][e(297)][e(329)]})}[ud(339)](){const e=ud;this[e(277)]&&(this[e(282)][e(334)](),this[e(282)][e(283)][e(327)](this[e(277)]),this[e(277)][e(299)](),this[e(277)]=void 0)}[ud(299)](){const e=ud;super[e(299)](),this[e(328)]&&this[e(328)][e(305)]&&this[e(328)][e(299)](),this[e(338)]&&this[e(338)][e(319)]()}}var md=gd;!function(e){for(var t=gd,n=e();;)try{if(349566===-parseInt(t(302))/1+parseInt(t(293))/2+parseInt(t(298))/3+-parseInt(t(297))/4*(parseInt(t(292))/5)+parseInt(t(296))/6*(parseInt(t(300))/7)+parseInt(t(294))/8+parseInt(t(299))/9*(-parseInt(t(303))/10))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(bd);class yd extends r.ContextPlugin{static get[md(291)](){return[fr,fd]}static get[md(295)](){return md(301)}}function gd(e,t){var n=bd();return(gd=function(e,t){return n[e-=291]})(e,t)}function bd(){var e=["pluginName","88986tNLpeM","458704xwYCAQ","1249992KBfJZR","9486HyhQRB","21GvPeWM","PresenceList","151644ZMpwLL","3560yCiTuO","requires","10SsqPws","308722YlkGnK","3922144ojQmKn"];return(bd=function(){return e})()}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;(0,s.ObservableMixin)();(0,s.EmitterMixin)();r.ContextPlugin;r.ContextPlugin;function Od(e,t){var n=wd();return(Od=function(e,t){return n[e-=167]})(e,t)}function wd(){var e=["1513895RsoiWM","1093900WhTMOf","14590170Dwkblo","1812EVjSXx","428615ggwclh","5571728PPElPA","164856BYcDGI","56siwlXf","1272jSTcqv"];return(wd=function(){return e})()}function Id(){var e=["2442705oUzceI","2968760rYKXRD","1326tSfDnX","4jMHgTW","20UAfStc","3477672YlYOXq","1894ZcPPEY","131389autREW","9089559dlgyzb","2828749NXWdSV"];return(Id=function(){return e})()}function vd(e,t){var n=Id();return(vd=function(e,t){return n[e-=181]})(e,t)}!function(e){for(var t=Od,n=e();;)try{if(381416===parseInt(t(175))/1+parseInt(t(172))/2+-parseInt(t(170))/3*(parseInt(t(174))/4)+parseInt(t(171))/5+-parseInt(t(168))/6*(-parseInt(t(169))/7)+parseInt(t(167))/8+-parseInt(t(173))/9)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(wd),function(e){for(var t=vd,n=e();;)try{if(373416===parseInt(t(188))/1+parseInt(t(187))/2*(parseInt(t(183))/3)+-parseInt(t(184))/4*(-parseInt(t(181))/5)+parseInt(t(186))/6+parseInt(t(190))/7+parseInt(t(182))/8+-parseInt(t(189))/9*(parseInt(t(185))/10))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Id)})(),(window.CKEditor5=window.CKEditor5||{}).realTimeCollaboration=__webpack_exports__})();