@ckeditor/ckeditor5-real-time-collaboration 46.0.2-alpha.1 → 46.0.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-2025, CKSource Holding sp. z o.o. All rights reserved.
4
4
  * For licensing, see LICENSE.md.
5
- */(()=>{var __webpack_modules__={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()}},106:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(168),s=n.n(r),o=n(433),i=n.n(o)()(s());i.push([e.id,'.ck.ck-balloon-panel.ck-tooltip{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;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:inline-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;flex-direction:row;justify-content:flex-end;position:relative}.ck.ck-presence-list__list:after{background:transparent;bottom:-15px;content:"";height:15px;left:0;position:absolute;width:100%}.ck.ck-presence-list__counter--hidden{display:none}.ck.ck-presence-list__list-item{background:none;border:1px solid transparent;color:inherit;font:inherit;margin-left:var(--ck-spacing-medium);outline:none;padding:0;position:relative}.ck.ck-presence-list__list-item:focus{border:var(--ck-focus-ring);border-radius:0;box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck-rounded-corners .ck.ck-presence-list__list-item:focus,.ck.ck-presence-list__list-item.ck-rounded-corners:focus{border-radius:var(--ck-border-radius)}.ck.ck-presence-list__list-item .ck-label{height:0;overflow:hidden;width:0}.ck.ck-presence-list__list-item:first-child{margin-left:0}.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:5px;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{border:1px solid transparent;min-width:calc(var(--ck-user-avatar-size)*2);padding-left:1px}.ck.ck-presence-list--collapsed .ck-presence-list__list *{cursor:pointer;transition:all .4s ease-in-out}.ck.ck-presence-list--collapsed .ck-presence-list__list:focus{border:var(--ck-focus-ring);border-radius:0;box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck-rounded-corners .ck.ck-presence-list--collapsed .ck-presence-list__list:focus,.ck.ck-presence-list--collapsed .ck-presence-list__list.ck-rounded-corners:focus{border-radius:var(--ck-border-radius)}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item{border:0;margin-left:calc(var(--ck-user-avatar-size)*-.35);padding:0}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:first-child{margin-left:0}.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 .ck-user{--ck-presence-list-avatar-border-color:var(--ck-color-base-foreground);border:2px solid var(--ck-presence-list-avatar-border-color);margin-left:0;margin-right:0}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item.ck-presence-list__users-counter{margin-left:0;margin-right:0}.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}@media (prefers-reduced-motion:reduce){.ck.ck-presence-list__balloon{animation:none}}.ck.ck-presence-list__balloon ul{background-color:var(--ck-color-presence-list-dropdown-background)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-wrapper{border-radius:var(--ck-border-radius);max-width:var(--ck-presence-list-dropdown-list-max-width);min-width:var(--ck-presence-list-dropdown-list-min-width)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-wrapper.ck-presence-list__dropdown-list-wrapper_scrollable{max-height:80vh;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:focus{box-shadow:var(--ck-focus-outer-shadow),0 0;outline:var(--ck-focus-ring);outline-offset:-1px;position:relative;z-index:1}.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}.ck.ck-presence-list__users-counter{--ck-presence-list-counter-border-color:var(--ck-user-avatar-background);--ck-presence-list-counter-background-color:var(--ck-user-avatar-color);align-items:center;background-color:var(--ck-presence-list-counter-background-color);border:2px solid var(--ck-presence-list-counter-border-color);border-radius:50%;box-sizing:border-box;display:flex;height:calc(var(--ck-user-avatar-size) - 4px);justify-content:center;line-height:100%;margin:4px 2px 2px;position:relative;width:calc(var(--ck-user-avatar-size) - 4px)}.ck.ck-presence-list__users-counter__text{--ck-presence-list-counter-text-color:var(--ck-user-avatar-background);color:var(--ck-presence-list-counter-text-color);cursor:default;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}',""]);const a=i},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}},156:e=>{"use strict";e.exports={}},168:e=>{"use strict";e.exports=function(e){return e[1]}},178:(e,t,n)=>{"use strict";t.Service=n(418)},199:(e,t,n)=>{"use strict";e.exports=n(995)},211:(e,t,n)=>{e.exports=n(312)("./src/collaboration-core.js")},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},237:e=>{"use strict";e.exports=CKEditor5.dll},262:e=>{"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},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))}})}},311:(e,t,n)=>{e.exports=n(237)("./src/ui.js")},312:e=>{"use strict";e.exports=CKEditor5.collaborationDll},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}}},357:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},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)},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)}})}},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}},433:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,s,o){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(i[c]=!0)}for(var d=0;d<e.length;d++){var u=[].concat(e[d]);r&&i[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),s&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=s):u[4]="".concat(s)),t.push(u))}},t}},535:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(168),s=n.n(r),o=n(433),i=n.n(o)()(s());i.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}@media (prefers-reduced-motion:reduce){.ck .ck-user__marker-tooltip{transition:none}}.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}@media (prefers-reduced-motion:reduce){.ck .ck-user__marker,.ck .ck-user__marker *,.ck .ck-user__marker:after{animation:none!important}}@keyframes fadeInLeft{0%{opacity:0;transform:translateX(-10px)}to{opacity:1;transform:translateX(0)}}",""]);const a=i},545:e=>{"use strict";var t,n=(t=[],function(e,n){return t[e]=n,t.filter(Boolean).join("\n")});function r(e,t,r,s){var o;if(r)o="";else{o="",s.supports&&(o+="@supports (".concat(s.supports,") {")),s.media&&(o+="@media ".concat(s.media," {"));var i=void 0!==s.layer;i&&(o+="@layer".concat(s.layer.length>0?" ".concat(s.layer):""," {")),o+=s.css,i&&(o+="}"),s.media&&(o+="}"),s.supports&&(o+="}")}if(e.styleSheet)e.styleSheet.cssText=n(t,o);else{var a=document.createTextNode(o),c=e.childNodes;c[t]&&e.removeChild(c[t]),c.length?e.insertBefore(a,c[t]):e.appendChild(a)}}var s={singleton:null,singletonCounter:0};e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=s.singletonCounter++,n=s.singleton||(s.singleton=e.insertStyleElement(e));return{update:function(e){r(n,t,!1,e)},remove:function(e){r(n,t,!0,e)}}}},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}},584:(e,t,n)=>{e.exports=n(237)("./src/utils.js")},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()},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)}},667:e=>{"use strict";e.exports=function(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}},673:e=>{"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var o={},i=[],a=0;a<e.length;a++){var c=e[a],d=r.base?c[0]+r.base:c[0],u=o[d]||0,l="".concat(d," ").concat(u);o[d]=u+1;var p=n(l),h={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==p)t[p].references++,t[p].updater(h);else{var f=s(h,r);r.byIndex=a,t.splice(a,0,{identifier:l,updater:f,references:1})}i.push(l)}return i}function s(e,t){var n=t.domAPI(t);n.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,s){var o=r(e=e||[],s=s||{});return function(e){e=e||[];for(var i=0;i<o.length;i++){var a=n(o[i]);t[a].references--}for(var c=r(e,s),d=0;d<o.length;d++){var u=n(o[d]);0===t[u].references&&(t[u].updater(),t.splice(u,1))}o=c}}},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}},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}},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}},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}},782:(e,t,n)=>{e.exports=n(237)("./src/core.js")},783:(e,t,n)=>{e.exports=n(237)("./src/engine.js")},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},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()},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()}},__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})};var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CloudServicesCommentsAdapter:()=>Cs,CloudServicesRevisionHistoryAdapter:()=>$s,CloudServicesTrackChangesAdapter:()=>Bs,PresenceList:()=>Go,PresenceListUI:()=>Bo,RealTimeCollaborationClient:()=>Os,RealTimeCollaborativeComments:()=>Ys,RealTimeCollaborativeEditing:()=>Ts,RealTimeCollaborativeRevisionHistory:()=>ro,RealTimeCollaborativeTrackChanges:()=>Ks,Sessions:()=>Zn,WebSocketGateway:()=>Yn});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{Decoder:()=>De,Encoder:()=>je,PacketType:()=>Ce,protocol:()=>_e});var t=__webpack_require__(782),n=__webpack_require__(584),r=__webpack_require__(311),s=__webpack_require__(783);class o{static DESCRIPTOR_NAME;static DESCRIPTOR;constructor(...e){}}class i extends o{static TYPE="1000";static READABLE_TYPE_NAME;constructor(...e){super()}static fromJSON(e){throw new TypeError("Must be implemented in a child class!")}}class a extends i{id;static TYPE="21";static READABLE_TYPE_NAME="getUser";static DESCRIPTOR_NAME="GetUserMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1}}};constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new a(e.id)}}class c extends i{attributes;static DESCRIPTOR_NAME="GetUserResponse";static DESCRIPTOR={fields:{attributes:{rule:"repeated",type:"KeyValueDescriptor",id:1}}};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 c(t)}}var d=__webpack_require__(199);const u=(()=>{var e=d.Reader,t=d.Writer,n=d.util,r=d.roots.default||(d.roots.default={});return r.OperationMetadataDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.userId="",s.prototype.type="",s.prototype.createdAt="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(10).string(e.userId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&n.uint32(18).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(26).string(e.createdAt),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.OperationMetadataDescriptor;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.userId=t.string();break;case 2:i.type=t.string();break;case 3:i.createdAt=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.userId&&e.hasOwnProperty("userId")&&!n.isString(e.userId)?"userId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!n.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null},s.fromObject=function(e){if(e instanceof r.OperationMetadataDescriptor)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/OperationMetadataDescriptor"},s}(),r.CollaborativeEditingConnectMessage=function(){function s(e){if(this.buffers=[],this.types=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.bundleVersion="",s.prototype.buffers=n.emptyArray,s.prototype.types=n.emptyArray,s.prototype.lastOperationId="",s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&n.uint32(18).string(e.bundleVersion),null!=e.buffers&&e.buffers.length)for(var r=0;r<e.buffers.length;++r)n.uint32(26).bytes(e.buffers[r]);if(null!=e.types&&e.types.length){for(n.uint32(34).fork(),r=0;r<e.types.length;++r)n.uint32(e.types[r]);n.ldelim()}return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&n.uint32(42).string(e.lastOperationId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CollaborativeEditingConnectMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.bundleVersion=t.string();break;case 3:i.buffers&&i.buffers.length||(i.buffers=[]),i.buffers.push(t.bytes());break;case 4:if(i.types&&i.types.length||(i.types=[]),2==(7&a))for(var c=t.uint32()+t.pos;t.pos<c;)i.types.push(t.uint32());else i.types.push(t.uint32());break;case 5:i.lastOperationId=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id))return"id: string expected";if(null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!n.isString(e.bundleVersion))return"bundleVersion: string expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(var t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||n.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(t=0;t<e.types.length;++t)if(!n.isInteger(e.types[t]))return"types: integer[] expected"}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!n.isString(e.lastOperationId)?"lastOperationId: string expected":null},s.fromObject=function(e){if(e instanceof r.CollaborativeEditingConnectMessage)return e;var t=new r.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(var s=0;s<e.buffers.length;++s)"string"==typeof e.buffers[s]?n.base64.decode(e.buffers[s],t.buffers[s]=n.newBuffer(n.base64.length(e.buffers[s])),0):e.buffers[s].length>=0&&(t.buffers[s]=e.buffers[s])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingConnectMessage.types: array expected");for(t.types=[],s=0;s<e.types.length;++s)t.types[s]=e.types[s]>>>0}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),t},s.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.buffers=[],r.types=[]),t.defaults&&(r.id="",r.bundleVersion="",r.lastOperationId=""),null!=e.id&&e.hasOwnProperty("id")&&(r.id=e.id),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(r.bundleVersion=e.bundleVersion),e.buffers&&e.buffers.length){r.buffers=[];for(var s=0;s<e.buffers.length;++s)r.buffers[s]=t.bytes===String?n.base64.encode(e.buffers[s],0,e.buffers[s].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[s]):e.buffers[s]}if(e.types&&e.types.length)for(r.types=[],s=0;s<e.types.length;++s)r.types[s]=e.types[s];return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(r.lastOperationId=e.lastOperationId),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingConnectMessage"},s}(),r.CollaborativeEditingReconnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.bundleVersion="",s.prototype.lastKnowVersion=0,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&n.uint32(18).string(e.bundleVersion),null!=e.lastKnowVersion&&Object.hasOwnProperty.call(e,"lastKnowVersion")&&n.uint32(24).uint32(e.lastKnowVersion),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CollaborativeEditingReconnectMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.bundleVersion=t.string();break;case 3:i.lastKnowVersion=t.uint32();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id)?"id: string expected":null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!n.isString(e.bundleVersion)?"bundleVersion: string expected":null!=e.lastKnowVersion&&e.hasOwnProperty("lastKnowVersion")&&!n.isInteger(e.lastKnowVersion)?"lastKnowVersion: integer expected":null},s.fromObject=function(e){if(e instanceof r.CollaborativeEditingReconnectMessage)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingReconnectMessage"},s}(),r.CollaborativeEditingUpdateMessage=function(){function s(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.baseVersion=0,s.prototype.buffers=n.emptyArray,s.prototype.types=n.emptyArray,s.prototype.metadata=n.emptyArray,s.prototype.lastOperationId="",s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.baseVersion&&Object.hasOwnProperty.call(e,"baseVersion")&&n.uint32(16).uint32(e.baseVersion),null!=e.buffers&&e.buffers.length)for(var s=0;s<e.buffers.length;++s)n.uint32(26).bytes(e.buffers[s]);if(null!=e.types&&e.types.length){for(n.uint32(34).fork(),s=0;s<e.types.length;++s)n.uint32(e.types[s]);n.ldelim()}if(null!=e.metadata&&e.metadata.length)for(s=0;s<e.metadata.length;++s)r.OperationMetadataDescriptor.encode(e.metadata[s],n.uint32(50).fork()).ldelim();return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&n.uint32(58).string(e.lastOperationId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CollaborativeEditingUpdateMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.baseVersion=t.uint32();break;case 3:i.buffers&&i.buffers.length||(i.buffers=[]),i.buffers.push(t.bytes());break;case 4:if(i.types&&i.types.length||(i.types=[]),2==(7&a))for(var c=t.uint32()+t.pos;t.pos<c;)i.types.push(t.uint32());else i.types.push(t.uint32());break;case 6:i.metadata&&i.metadata.length||(i.metadata=[]),i.metadata.push(r.OperationMetadataDescriptor.decode(t,t.uint32()));break;case 7:i.lastOperationId=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id))return"id: string expected";if(null!=e.baseVersion&&e.hasOwnProperty("baseVersion")&&!n.isInteger(e.baseVersion))return"baseVersion: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(var t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||n.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(t=0;t<e.types.length;++t)if(!n.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(t=0;t<e.metadata.length;++t){var s=r.OperationMetadataDescriptor.verify(e.metadata[t]);if(s)return"metadata."+s}}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!n.isString(e.lastOperationId)?"lastOperationId: string expected":null},s.fromObject=function(e){if(e instanceof r.CollaborativeEditingUpdateMessage)return e;var t=new r.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(var s=0;s<e.buffers.length;++s)"string"==typeof e.buffers[s]?n.base64.decode(e.buffers[s],t.buffers[s]=n.newBuffer(n.base64.length(e.buffers[s])),0):e.buffers[s].length>=0&&(t.buffers[s]=e.buffers[s])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingUpdateMessage.types: array expected");for(t.types=[],s=0;s<e.types.length;++s)t.types[s]=e.types[s]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingUpdateMessage.metadata: array expected");for(t.metadata=[],s=0;s<e.metadata.length;++s){if("object"!=typeof e.metadata[s])throw TypeError(".CollaborativeEditingUpdateMessage.metadata: object expected");t.metadata[s]=r.OperationMetadataDescriptor.fromObject(e.metadata[s])}}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),t},s.toObject=function(e,t){t||(t={});var s={};if((t.arrays||t.defaults)&&(s.buffers=[],s.types=[],s.metadata=[]),t.defaults&&(s.id="",s.baseVersion=0,s.lastOperationId=""),null!=e.id&&e.hasOwnProperty("id")&&(s.id=e.id),null!=e.baseVersion&&e.hasOwnProperty("baseVersion")&&(s.baseVersion=e.baseVersion),e.buffers&&e.buffers.length){s.buffers=[];for(var o=0;o<e.buffers.length;++o)s.buffers[o]=t.bytes===String?n.base64.encode(e.buffers[o],0,e.buffers[o].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[o]):e.buffers[o]}if(e.types&&e.types.length)for(s.types=[],o=0;o<e.types.length;++o)s.types[o]=e.types[o];if(e.metadata&&e.metadata.length)for(s.metadata=[],o=0;o<e.metadata.length;++o)s.metadata[o]=r.OperationMetadataDescriptor.toObject(e.metadata[o],t);return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(s.lastOperationId=e.lastOperationId),s},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingUpdateMessage"},s}(),r.GetDocumentDetailsMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.environmentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(10).string(e.documentId),null!=e.environmentId&&Object.hasOwnProperty.call(e,"environmentId")&&n.uint32(18).string(e.environmentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.GetDocumentDetailsMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.documentId=t.string();break;case 2:i.environmentId=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null!=e.environmentId&&e.hasOwnProperty("environmentId")&&!n.isString(e.environmentId)?"environmentId: string expected":null},s.fromObject=function(e){if(e instanceof r.GetDocumentDetailsMessage)return e;var t=new r.GetDocumentDetailsMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.environmentId&&(t.environmentId=String(e.environmentId)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetDocumentDetailsMessage"},s}(),r.CollaborativeEditingConnectResponse=function(){function s(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.offset=0,s.prototype.version=0,s.prototype.buffers=n.emptyArray,s.prototype.types=n.emptyArray,s.prototype.metadata=n.emptyArray,s.prototype.initData="",s.prototype.isInitialized=!1,s.prototype.sessionId="",s.prototype.lastOperationId="",s.prototype.sessionCreatedAt="",s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&n.uint32(10).string(e.channel),null!=e.offset&&Object.hasOwnProperty.call(e,"offset")&&n.uint32(16).uint32(e.offset),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&n.uint32(24).uint32(e.version),null!=e.buffers&&e.buffers.length)for(var s=0;s<e.buffers.length;++s)n.uint32(34).bytes(e.buffers[s]);if(null!=e.types&&e.types.length){for(n.uint32(42).fork(),s=0;s<e.types.length;++s)n.uint32(e.types[s]);n.ldelim()}if(null!=e.metadata&&e.metadata.length)for(s=0;s<e.metadata.length;++s)r.OperationMetadataDescriptor.encode(e.metadata[s],n.uint32(58).fork()).ldelim();return null!=e.initData&&Object.hasOwnProperty.call(e,"initData")&&n.uint32(66).string(e.initData),null!=e.isInitialized&&Object.hasOwnProperty.call(e,"isInitialized")&&n.uint32(72).bool(e.isInitialized),null!=e.sessionId&&Object.hasOwnProperty.call(e,"sessionId")&&n.uint32(82).string(e.sessionId),null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&n.uint32(90).string(e.lastOperationId),null!=e.sessionCreatedAt&&Object.hasOwnProperty.call(e,"sessionCreatedAt")&&n.uint32(98).string(e.sessionCreatedAt),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CollaborativeEditingConnectResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.channel=t.string();break;case 2:i.offset=t.uint32();break;case 3:i.version=t.uint32();break;case 4:i.buffers&&i.buffers.length||(i.buffers=[]),i.buffers.push(t.bytes());break;case 5:if(i.types&&i.types.length||(i.types=[]),2==(7&a))for(var c=t.uint32()+t.pos;t.pos<c;)i.types.push(t.uint32());else i.types.push(t.uint32());break;case 7:i.metadata&&i.metadata.length||(i.metadata=[]),i.metadata.push(r.OperationMetadataDescriptor.decode(t,t.uint32()));break;case 8:i.initData=t.string();break;case 9:i.isInitialized=t.bool();break;case 10:i.sessionId=t.string();break;case 11:i.lastOperationId=t.string();break;case 12:i.sessionCreatedAt=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!n.isString(e.channel))return"channel: string expected";if(null!=e.offset&&e.hasOwnProperty("offset")&&!n.isInteger(e.offset))return"offset: integer expected";if(null!=e.version&&e.hasOwnProperty("version")&&!n.isInteger(e.version))return"version: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(var t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||n.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(t=0;t<e.types.length;++t)if(!n.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(t=0;t<e.metadata.length;++t){var s=r.OperationMetadataDescriptor.verify(e.metadata[t]);if(s)return"metadata."+s}}return null!=e.initData&&e.hasOwnProperty("initData")&&!n.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")&&!n.isString(e.sessionId)?"sessionId: string expected":null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!n.isString(e.lastOperationId)?"lastOperationId: string expected":null!=e.sessionCreatedAt&&e.hasOwnProperty("sessionCreatedAt")&&!n.isString(e.sessionCreatedAt)?"sessionCreatedAt: string expected":null},s.fromObject=function(e){if(e instanceof r.CollaborativeEditingConnectResponse)return e;var t=new r.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(var s=0;s<e.buffers.length;++s)"string"==typeof e.buffers[s]?n.base64.decode(e.buffers[s],t.buffers[s]=n.newBuffer(n.base64.length(e.buffers[s])),0):e.buffers[s].length>=0&&(t.buffers[s]=e.buffers[s])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingConnectResponse.types: array expected");for(t.types=[],s=0;s<e.types.length;++s)t.types[s]=e.types[s]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingConnectResponse.metadata: array expected");for(t.metadata=[],s=0;s<e.metadata.length;++s){if("object"!=typeof e.metadata[s])throw TypeError(".CollaborativeEditingConnectResponse.metadata: object expected");t.metadata[s]=r.OperationMetadataDescriptor.fromObject(e.metadata[s])}}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},s.toObject=function(e,t){t||(t={});var s={};if((t.arrays||t.defaults)&&(s.buffers=[],s.types=[],s.metadata=[]),t.defaults&&(s.channel="",s.offset=0,s.version=0,s.initData="",s.isInitialized=!1,s.sessionId="",s.lastOperationId="",s.sessionCreatedAt=""),null!=e.channel&&e.hasOwnProperty("channel")&&(s.channel=e.channel),null!=e.offset&&e.hasOwnProperty("offset")&&(s.offset=e.offset),null!=e.version&&e.hasOwnProperty("version")&&(s.version=e.version),e.buffers&&e.buffers.length){s.buffers=[];for(var o=0;o<e.buffers.length;++o)s.buffers[o]=t.bytes===String?n.base64.encode(e.buffers[o],0,e.buffers[o].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[o]):e.buffers[o]}if(e.types&&e.types.length)for(s.types=[],o=0;o<e.types.length;++o)s.types[o]=e.types[o];if(e.metadata&&e.metadata.length)for(s.metadata=[],o=0;o<e.metadata.length;++o)s.metadata[o]=r.OperationMetadataDescriptor.toObject(e.metadata[o],t);return null!=e.initData&&e.hasOwnProperty("initData")&&(s.initData=e.initData),null!=e.isInitialized&&e.hasOwnProperty("isInitialized")&&(s.isInitialized=e.isInitialized),null!=e.sessionId&&e.hasOwnProperty("sessionId")&&(s.sessionId=e.sessionId),null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(s.lastOperationId=e.lastOperationId),null!=e.sessionCreatedAt&&e.hasOwnProperty("sessionCreatedAt")&&(s.sessionCreatedAt=e.sessionCreatedAt),s},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingConnectResponse"},s}(),r.CollaborativeEditingResponse=function(){function s(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.version=0,s.prototype.buffers=n.emptyArray,s.prototype.types=n.emptyArray,s.prototype.metadata=n.emptyArray,s.prototype.lastOperationId="",s.prototype.lastOperationAcceptedAt="",s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&n.uint32(8).uint32(e.version),null!=e.buffers&&e.buffers.length)for(var s=0;s<e.buffers.length;++s)n.uint32(18).bytes(e.buffers[s]);if(null!=e.types&&e.types.length){for(n.uint32(26).fork(),s=0;s<e.types.length;++s)n.uint32(e.types[s]);n.ldelim()}if(null!=e.metadata&&e.metadata.length)for(s=0;s<e.metadata.length;++s)r.OperationMetadataDescriptor.encode(e.metadata[s],n.uint32(42).fork()).ldelim();return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&n.uint32(50).string(e.lastOperationId),null!=e.lastOperationAcceptedAt&&Object.hasOwnProperty.call(e,"lastOperationAcceptedAt")&&n.uint32(58).string(e.lastOperationAcceptedAt),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CollaborativeEditingResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.version=t.uint32();break;case 2:i.buffers&&i.buffers.length||(i.buffers=[]),i.buffers.push(t.bytes());break;case 3:if(i.types&&i.types.length||(i.types=[]),2==(7&a))for(var c=t.uint32()+t.pos;t.pos<c;)i.types.push(t.uint32());else i.types.push(t.uint32());break;case 5:i.metadata&&i.metadata.length||(i.metadata=[]),i.metadata.push(r.OperationMetadataDescriptor.decode(t,t.uint32()));break;case 6:i.lastOperationId=t.string();break;case 7:i.lastOperationAcceptedAt=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.version&&e.hasOwnProperty("version")&&!n.isInteger(e.version))return"version: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(var t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||n.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(t=0;t<e.types.length;++t)if(!n.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(t=0;t<e.metadata.length;++t){var s=r.OperationMetadataDescriptor.verify(e.metadata[t]);if(s)return"metadata."+s}}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!n.isString(e.lastOperationId)?"lastOperationId: string expected":null!=e.lastOperationAcceptedAt&&e.hasOwnProperty("lastOperationAcceptedAt")&&!n.isString(e.lastOperationAcceptedAt)?"lastOperationAcceptedAt: string expected":null},s.fromObject=function(e){if(e instanceof r.CollaborativeEditingResponse)return e;var t=new r.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(var s=0;s<e.buffers.length;++s)"string"==typeof e.buffers[s]?n.base64.decode(e.buffers[s],t.buffers[s]=n.newBuffer(n.base64.length(e.buffers[s])),0):e.buffers[s].length>=0&&(t.buffers[s]=e.buffers[s])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingResponse.types: array expected");for(t.types=[],s=0;s<e.types.length;++s)t.types[s]=e.types[s]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingResponse.metadata: array expected");for(t.metadata=[],s=0;s<e.metadata.length;++s){if("object"!=typeof e.metadata[s])throw TypeError(".CollaborativeEditingResponse.metadata: object expected");t.metadata[s]=r.OperationMetadataDescriptor.fromObject(e.metadata[s])}}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),null!=e.lastOperationAcceptedAt&&(t.lastOperationAcceptedAt=String(e.lastOperationAcceptedAt)),t},s.toObject=function(e,t){t||(t={});var s={};if((t.arrays||t.defaults)&&(s.buffers=[],s.types=[],s.metadata=[]),t.defaults&&(s.version=0,s.lastOperationId="",s.lastOperationAcceptedAt=""),null!=e.version&&e.hasOwnProperty("version")&&(s.version=e.version),e.buffers&&e.buffers.length){s.buffers=[];for(var o=0;o<e.buffers.length;++o)s.buffers[o]=t.bytes===String?n.base64.encode(e.buffers[o],0,e.buffers[o].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[o]):e.buffers[o]}if(e.types&&e.types.length)for(s.types=[],o=0;o<e.types.length;++o)s.types[o]=e.types[o];if(e.metadata&&e.metadata.length)for(s.metadata=[],o=0;o<e.metadata.length;++o)s.metadata[o]=r.OperationMetadataDescriptor.toObject(e.metadata[o],t);return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(s.lastOperationId=e.lastOperationId),null!=e.lastOperationAcceptedAt&&e.hasOwnProperty("lastOperationAcceptedAt")&&(s.lastOperationAcceptedAt=e.lastOperationAcceptedAt),s},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingResponse"},s}(),r.GetDocumentDetailsResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.lastDocumentSessionId="",s.prototype.lastDocumentSessionOperationId="",s.prototype.currentDocumentSessionId="",s.prototype.currentDocumentSessionVersion=0,s.prototype.currentDocumentSessionOperationId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.lastDocumentSessionId&&Object.hasOwnProperty.call(e,"lastDocumentSessionId")&&n.uint32(10).string(e.lastDocumentSessionId),null!=e.lastDocumentSessionOperationId&&Object.hasOwnProperty.call(e,"lastDocumentSessionOperationId")&&n.uint32(18).string(e.lastDocumentSessionOperationId),null!=e.currentDocumentSessionId&&Object.hasOwnProperty.call(e,"currentDocumentSessionId")&&n.uint32(26).string(e.currentDocumentSessionId),null!=e.currentDocumentSessionVersion&&Object.hasOwnProperty.call(e,"currentDocumentSessionVersion")&&n.uint32(32).uint32(e.currentDocumentSessionVersion),null!=e.currentDocumentSessionOperationId&&Object.hasOwnProperty.call(e,"currentDocumentSessionOperationId")&&n.uint32(42).string(e.currentDocumentSessionOperationId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.GetDocumentDetailsResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.lastDocumentSessionId=t.string();break;case 2:i.lastDocumentSessionOperationId=t.string();break;case 3:i.currentDocumentSessionId=t.string();break;case 4:i.currentDocumentSessionVersion=t.uint32();break;case 5:i.currentDocumentSessionOperationId=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.lastDocumentSessionId&&e.hasOwnProperty("lastDocumentSessionId")&&!n.isString(e.lastDocumentSessionId)?"lastDocumentSessionId: string expected":null!=e.lastDocumentSessionOperationId&&e.hasOwnProperty("lastDocumentSessionOperationId")&&!n.isString(e.lastDocumentSessionOperationId)?"lastDocumentSessionOperationId: string expected":null!=e.currentDocumentSessionId&&e.hasOwnProperty("currentDocumentSessionId")&&!n.isString(e.currentDocumentSessionId)?"currentDocumentSessionId: string expected":null!=e.currentDocumentSessionVersion&&e.hasOwnProperty("currentDocumentSessionVersion")&&!n.isInteger(e.currentDocumentSessionVersion)?"currentDocumentSessionVersion: integer expected":null!=e.currentDocumentSessionOperationId&&e.hasOwnProperty("currentDocumentSessionOperationId")&&!n.isString(e.currentDocumentSessionOperationId)?"currentDocumentSessionOperationId: string expected":null},s.fromObject=function(e){if(e instanceof r.GetDocumentDetailsResponse)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetDocumentDetailsResponse"},s}(),r.CommentDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentId="",s.prototype.commentThreadId="",s.prototype.userId="",s.prototype.content="",s.prototype.documentId="",s.prototype.createdAt="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&n.uint32(10).string(e.commentId),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(18).string(e.commentThreadId),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(26).string(e.userId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&n.uint32(34).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(42).string(e.documentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(58).string(e.attributes),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentDescriptor;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentId=t.string();break;case 2:i.commentThreadId=t.string();break;case 3:i.userId=t.string();break;case 4:i.content=t.string();break;case 5:i.documentId=t.string();break;case 6:i.createdAt=t.string();break;case 7:i.attributes=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!n.isString(e.commentId)?"commentId: string expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.userId&&e.hasOwnProperty("userId")&&!n.isString(e.userId)?"userId: string expected":null!=e.content&&e.hasOwnProperty("content")&&!n.isString(e.content)?"content: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentDescriptor)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentDescriptor"},s}(),r.CommentsThreadDescriptor=function(){function s(e){if(this.comments=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.comments=n.emptyArray,s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.prototype.context="",s.prototype.createdAt="",s.prototype.deletedAt="",s.prototype.attributes="",s.prototype.unlinkedAt="",s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.comments&&e.comments.length)for(var s=0;s<e.comments.length;++s)r.CommentDescriptor.encode(e.comments[s],n.uint32(18).fork()).ldelim();return null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&n.uint32(26).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&n.uint32(34).string(e.resolvedBy),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&n.uint32(42).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(50).string(e.createdAt),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&n.uint32(58).string(e.deletedAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(66).string(e.attributes),null!=e.unlinkedAt&&Object.hasOwnProperty.call(e,"unlinkedAt")&&n.uint32(74).string(e.unlinkedAt),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsThreadDescriptor;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.comments&&i.comments.length||(i.comments=[]),i.comments.push(r.CommentDescriptor.decode(t,t.uint32()));break;case 3:i.resolvedAt=t.string();break;case 4:i.resolvedBy=t.string();break;case 5:i.context=t.string();break;case 6:i.createdAt=t.string();break;case 7:i.deletedAt=t.string();break;case 8:i.attributes=t.string();break;case 9:i.unlinkedAt=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(var t=0;t<e.comments.length;++t){var s=r.CommentDescriptor.verify(e.comments[t]);if(s)return"comments."+s}}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!n.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!n.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.context&&e.hasOwnProperty("context")&&!n.isString(e.context)?"context: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!n.isString(e.deletedAt)?"deletedAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&!n.isString(e.unlinkedAt)?"unlinkedAt: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsThreadDescriptor)return e;var t=new r.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(var n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsThreadDescriptor.comments: object expected");t.comments[n]=r.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},s.toObject=function(e,t){t||(t={});var 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(var s=0;s<e.comments.length;++s)n.comments[s]=r.CommentDescriptor.toObject(e.comments[s],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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsThreadDescriptor"},s}(),r.CommentThreadAddedCommentDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentId="",s.prototype.createdAt="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&n.uint32(10).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(18).string(e.createdAt),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentThreadAddedCommentDescriptor;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentId=t.string();break;case 2:i.createdAt=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!n.isString(e.commentId)?"commentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentThreadAddedCommentDescriptor)return e;var t=new r.CommentThreadAddedCommentDescriptor;return null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentThreadAddedCommentDescriptor"},s}(),r.CommentsV2AddCommentMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.content="",s.prototype.documentId="",s.prototype.commentId="",s.prototype.createdAt="",s.prototype.userId="",s.prototype.attributes="",s.prototype.commentThread=null,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&n.uint32(18).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(26).string(e.documentId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&n.uint32(34).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(42).string(e.createdAt),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(50).string(e.userId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(58).string(e.attributes),null!=e.commentThread&&Object.hasOwnProperty.call(e,"commentThread")&&r.CommentsThreadDescriptor.encode(e.commentThread,n.uint32(66).fork()).ldelim(),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2AddCommentMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.content=t.string();break;case 3:i.documentId=t.string();break;case 4:i.commentId=t.string();break;case 5:i.createdAt=t.string();break;case 6:i.userId=t.string();break;case 7:i.attributes=t.string();break;case 8:i.commentThread=r.CommentsThreadDescriptor.decode(t,t.uint32());break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.content&&e.hasOwnProperty("content")&&!n.isString(e.content))return"content: string expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId))return"documentId: string expected";if(null!=e.commentId&&e.hasOwnProperty("commentId")&&!n.isString(e.commentId))return"commentId: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt))return"createdAt: string expected";if(null!=e.userId&&e.hasOwnProperty("userId")&&!n.isString(e.userId))return"userId: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes))return"attributes: string expected";if(null!=e.commentThread&&e.hasOwnProperty("commentThread")){var t=r.CommentsThreadDescriptor.verify(e.commentThread);if(t)return"commentThread."+t}return null},s.fromObject=function(e){if(e instanceof r.CommentsV2AddCommentMessage)return e;var t=new r.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=r.CommentsThreadDescriptor.fromObject(e.commentThread)}return t},s.toObject=function(e,t){t||(t={});var 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=r.CommentsThreadDescriptor.toObject(e.commentThread,t)),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentMessage"},s}(),r.CommentsV2AddCommentThreadMessage=function(){function s(e){if(this.comments=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.commentThreadId="",s.prototype.context="",s.prototype.createdAt="",s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.prototype.attributes="",s.prototype.deletedAt="",s.prototype.comments=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(10).string(e.documentId),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(18).string(e.commentThreadId),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&n.uint32(26).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(34).string(e.createdAt),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&n.uint32(42).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&n.uint32(50).string(e.resolvedBy),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(58).string(e.attributes),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&n.uint32(66).string(e.deletedAt),null!=e.comments&&e.comments.length)for(var s=0;s<e.comments.length;++s)r.CommentDescriptor.encode(e.comments[s],n.uint32(74).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2AddCommentThreadMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.documentId=t.string();break;case 2:i.commentThreadId=t.string();break;case 3:i.context=t.string();break;case 4:i.createdAt=t.string();break;case 5:i.resolvedAt=t.string();break;case 6:i.resolvedBy=t.string();break;case 7:i.attributes=t.string();break;case 8:i.deletedAt=t.string();break;case 9:i.comments&&i.comments.length||(i.comments=[]),i.comments.push(r.CommentDescriptor.decode(t,t.uint32()));break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId))return"documentId: string expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.context&&e.hasOwnProperty("context")&&!n.isString(e.context))return"context: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt))return"createdAt: string expected";if(null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!n.isString(e.resolvedAt))return"resolvedAt: string expected";if(null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!n.isString(e.resolvedBy))return"resolvedBy: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes))return"attributes: string expected";if(null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!n.isString(e.deletedAt))return"deletedAt: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(var t=0;t<e.comments.length;++t){var s=r.CommentDescriptor.verify(e.comments[t]);if(s)return"comments."+s}}return null},s.fromObject=function(e){if(e instanceof r.CommentsV2AddCommentThreadMessage)return e;var t=new r.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(var n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsV2AddCommentThreadMessage.comments: object expected");t.comments[n]=r.CommentDescriptor.fromObject(e.comments[n])}}return t},s.toObject=function(e,t){t||(t={});var 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(var s=0;s<e.comments.length;++s)n.comments[s]=r.CommentDescriptor.toObject(e.comments[s],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentThreadMessage"},s}(),r.CommentsV2ReopenCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(18).string(e.documentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2ReopenCommentThreadMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.documentId=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2ReopenCommentThreadMessage)return e;var t=new r.CommentsV2ReopenCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ReopenCommentThreadMessage"},s}(),r.CommentsV2ResolveCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.resolvedBy="",s.prototype.resolvedAt="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(18).string(e.documentId),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&n.uint32(26).string(e.resolvedBy),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&n.uint32(34).string(e.resolvedAt),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2ResolveCommentThreadMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.documentId=t.string();break;case 3:i.resolvedBy=t.string();break;case 4:i.resolvedAt=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!n.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!n.isString(e.resolvedAt)?"resolvedAt: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2ResolveCommentThreadMessage)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ResolveCommentThreadMessage"},s}(),r.CommentsV2UpdateCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.context="",s.prototype.attributes="",s.prototype.unlinkedAt="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(18).string(e.documentId),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&n.uint32(26).string(e.context),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(34).string(e.attributes),null!=e.unlinkedAt&&Object.hasOwnProperty.call(e,"unlinkedAt")&&n.uint32(42).string(e.unlinkedAt),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2UpdateCommentThreadMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.documentId=t.string();break;case 3:i.context=t.string();break;case 4:i.attributes=t.string();break;case 5:i.unlinkedAt=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null!=e.context&&e.hasOwnProperty("context")&&!n.isString(e.context)?"context: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&!n.isString(e.unlinkedAt)?"unlinkedAt: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2UpdateCommentThreadMessage)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2UpdateCommentThreadMessage"},s}(),r.CommentsV2ConnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(10).string(e.documentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2ConnectMessage;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?i.documentId=t.string():t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2ConnectMessage)return e;var t=new r.CommentsV2ConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ConnectMessage"},s}(),r.CommentsV2GetCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(18).string(e.documentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2GetCommentThreadMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.documentId=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2GetCommentThreadMessage)return e;var t=new r.CommentsV2GetCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetCommentThreadMessage"},s}(),r.CommentsV2GetDocumentThreadsMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(10).string(e.documentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2GetDocumentThreadsMessage;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?i.documentId=t.string():t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2GetDocumentThreadsMessage)return e;var t=new r.CommentsV2GetDocumentThreadsMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetDocumentThreadsMessage"},s}(),r.CommentsV2RemoveCommentMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.commentId="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&n.uint32(18).string(e.commentId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(26).string(e.documentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2RemoveCommentMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.commentId=t.string();break;case 3:i.documentId=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!n.isString(e.commentId)?"commentId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2RemoveCommentMessage)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2RemoveCommentMessage"},s}(),r.CommentsV2RemoveCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(18).string(e.documentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2RemoveCommentThreadMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.documentId=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2RemoveCommentThreadMessage)return e;var t=new r.CommentsV2RemoveCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2RemoveCommentThreadMessage"},s}(),r.CommentsV2UpdateCommentMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.commentId="",s.prototype.content="",s.prototype.documentId="",s.prototype.attributes="",s.prototype.isAttributesUpdated=!1,s.prototype.commentThread=null,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&n.uint32(18).string(e.commentId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&n.uint32(26).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(34).string(e.documentId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(42).string(e.attributes),null!=e.isAttributesUpdated&&Object.hasOwnProperty.call(e,"isAttributesUpdated")&&n.uint32(48).bool(e.isAttributesUpdated),null!=e.commentThread&&Object.hasOwnProperty.call(e,"commentThread")&&r.CommentsThreadDescriptor.encode(e.commentThread,n.uint32(58).fork()).ldelim(),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2UpdateCommentMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.commentId=t.string();break;case 3:i.content=t.string();break;case 4:i.documentId=t.string();break;case 5:i.attributes=t.string();break;case 6:i.isAttributesUpdated=t.bool();break;case 7:i.commentThread=r.CommentsThreadDescriptor.decode(t,t.uint32());break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.commentId&&e.hasOwnProperty("commentId")&&!n.isString(e.commentId))return"commentId: string expected";if(null!=e.content&&e.hasOwnProperty("content")&&!n.isString(e.content))return"content: string expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId))return"documentId: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.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")){var t=r.CommentsThreadDescriptor.verify(e.commentThread);if(t)return"commentThread."+t}return null},s.fromObject=function(e){if(e instanceof r.CommentsV2UpdateCommentMessage)return e;var t=new r.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=r.CommentsThreadDescriptor.fromObject(e.commentThread)}return t},s.toObject=function(e,t){t||(t={});var 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=r.CommentsThreadDescriptor.toObject(e.commentThread,t)),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2UpdateCommentMessage"},s}(),r.CommentsV2AddCommentResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.commentId="",s.prototype.createdAt="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&n.uint32(18).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(26).string(e.createdAt),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2AddCommentResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.commentId=t.string();break;case 3:i.createdAt=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!n.isString(e.commentId)?"commentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2AddCommentResponse)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentResponse"},s}(),r.CommentsV2AddCommentThreadResponse=function(){function s(e){if(this.comments=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.createdAt="",s.prototype.comments=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(18).string(e.createdAt),null!=e.comments&&e.comments.length)for(var s=0;s<e.comments.length;++s)r.CommentThreadAddedCommentDescriptor.encode(e.comments[s],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2AddCommentThreadResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.createdAt=t.string();break;case 3:i.comments&&i.comments.length||(i.comments=[]),i.comments.push(r.CommentThreadAddedCommentDescriptor.decode(t,t.uint32()));break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt))return"createdAt: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(var t=0;t<e.comments.length;++t){var s=r.CommentThreadAddedCommentDescriptor.verify(e.comments[t]);if(s)return"comments."+s}}return null},s.fromObject=function(e){if(e instanceof r.CommentsV2AddCommentThreadResponse)return e;var t=new r.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(var n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsV2AddCommentThreadResponse.comments: object expected");t.comments[n]=r.CommentThreadAddedCommentDescriptor.fromObject(e.comments[n])}}return t},s.toObject=function(e,t){t||(t={});var 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(var s=0;s<e.comments.length;++s)n.comments[s]=r.CommentThreadAddedCommentDescriptor.toObject(e.comments[s],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentThreadResponse"},s}(),r.CommentsV2ResolveCommentThreadResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(18).string(e.documentId),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&n.uint32(26).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&n.uint32(34).string(e.resolvedBy),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2ResolveCommentThreadResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.documentId=t.string();break;case 3:i.resolvedAt=t.string();break;case 4:i.resolvedBy=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!n.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!n.isString(e.resolvedBy)?"resolvedBy: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2ResolveCommentThreadResponse)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ResolveCommentThreadResponse"},s}(),r.CommentsV2ConnectResponse=function(){function s(e){if(this.threads=[],this.threadsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.threads=n.emptyArray,s.prototype.threadsV2=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&n.uint32(10).string(e.channel),null!=e.threads&&e.threads.length)for(var s=0;s<e.threads.length;++s)n.uint32(18).string(e.threads[s]);if(null!=e.threadsV2&&e.threadsV2.length)for(s=0;s<e.threadsV2.length;++s)r.CommentsThreadDescriptor.encode(e.threadsV2[s],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2ConnectResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.channel=t.string();break;case 2:i.threads&&i.threads.length||(i.threads=[]),i.threads.push(t.string());break;case 3:i.threadsV2&&i.threadsV2.length||(i.threadsV2=[]),i.threadsV2.push(r.CommentsThreadDescriptor.decode(t,t.uint32()));break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!n.isString(e.channel))return"channel: string expected";if(null!=e.threads&&e.hasOwnProperty("threads")){if(!Array.isArray(e.threads))return"threads: array expected";for(var t=0;t<e.threads.length;++t)if(!n.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(t=0;t<e.threadsV2.length;++t){var s=r.CommentsThreadDescriptor.verify(e.threadsV2[t]);if(s)return"threadsV2."+s}}return null},s.fromObject=function(e){if(e instanceof r.CommentsV2ConnectResponse)return e;var t=new r.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(var 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");for(t.threadsV2=[],n=0;n<e.threadsV2.length;++n){if("object"!=typeof e.threadsV2[n])throw TypeError(".CommentsV2ConnectResponse.threadsV2: object expected");t.threadsV2[n]=r.CommentsThreadDescriptor.fromObject(e.threadsV2[n])}}return t},s.toObject=function(e,t){t||(t={});var 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(var s=0;s<e.threads.length;++s)n.threads[s]=e.threads[s]}if(e.threadsV2&&e.threadsV2.length)for(n.threadsV2=[],s=0;s<e.threadsV2.length;++s)n.threadsV2[s]=r.CommentsThreadDescriptor.toObject(e.threadsV2[s],t);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ConnectResponse"},s}(),r.CommentsV2GetCommentThreadResponse=function(){function s(e){if(this.comments=[],this.commentsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.comments=n.emptyArray,s.prototype.commentsV2=n.emptyArray,s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.prototype.context="",s.prototype.createdAt="",s.prototype.deletedAt="",s.prototype.attributes="",s.prototype.unlinkedAt="",s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.comments&&e.comments.length)for(var s=0;s<e.comments.length;++s)n.uint32(18).string(e.comments[s]);if(null!=e.commentsV2&&e.commentsV2.length)for(s=0;s<e.commentsV2.length;++s)r.CommentDescriptor.encode(e.commentsV2[s],n.uint32(26).fork()).ldelim();return null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&n.uint32(34).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&n.uint32(42).string(e.resolvedBy),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&n.uint32(50).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(58).string(e.createdAt),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&n.uint32(66).string(e.deletedAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(74).string(e.attributes),null!=e.unlinkedAt&&Object.hasOwnProperty.call(e,"unlinkedAt")&&n.uint32(82).string(e.unlinkedAt),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2GetCommentThreadResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.comments&&i.comments.length||(i.comments=[]),i.comments.push(t.string());break;case 3:i.commentsV2&&i.commentsV2.length||(i.commentsV2=[]),i.commentsV2.push(r.CommentDescriptor.decode(t,t.uint32()));break;case 4:i.resolvedAt=t.string();break;case 5:i.resolvedBy=t.string();break;case 6:i.context=t.string();break;case 7:i.createdAt=t.string();break;case 8:i.deletedAt=t.string();break;case 9:i.attributes=t.string();break;case 10:i.unlinkedAt=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(var t=0;t<e.comments.length;++t)if(!n.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(t=0;t<e.commentsV2.length;++t){var s=r.CommentDescriptor.verify(e.commentsV2[t]);if(s)return"commentsV2."+s}}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!n.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!n.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.context&&e.hasOwnProperty("context")&&!n.isString(e.context)?"context: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!n.isString(e.deletedAt)?"deletedAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&!n.isString(e.unlinkedAt)?"unlinkedAt: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2GetCommentThreadResponse)return e;var t=new r.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(var 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");for(t.commentsV2=[],n=0;n<e.commentsV2.length;++n){if("object"!=typeof e.commentsV2[n])throw TypeError(".CommentsV2GetCommentThreadResponse.commentsV2: object expected");t.commentsV2[n]=r.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},s.toObject=function(e,t){t||(t={});var 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(var s=0;s<e.comments.length;++s)n.comments[s]=e.comments[s]}if(e.commentsV2&&e.commentsV2.length)for(n.commentsV2=[],s=0;s<e.commentsV2.length;++s)n.commentsV2[s]=r.CommentDescriptor.toObject(e.commentsV2[s],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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetCommentThreadResponse"},s}(),r.CommentsV2GetDocumentThreadsResponse=function(){function s(e){if(this.threads=[],this.threadsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.threads=n.emptyArray,s.prototype.threadsV2=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.threads&&e.threads.length)for(var s=0;s<e.threads.length;++s)n.uint32(10).string(e.threads[s]);if(null!=e.threadsV2&&e.threadsV2.length)for(s=0;s<e.threadsV2.length;++s)r.CommentsThreadDescriptor.encode(e.threadsV2[s],n.uint32(18).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2GetDocumentThreadsResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.threads&&i.threads.length||(i.threads=[]),i.threads.push(t.string());break;case 2:i.threadsV2&&i.threadsV2.length||(i.threadsV2=[]),i.threadsV2.push(r.CommentsThreadDescriptor.decode(t,t.uint32()));break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.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(var t=0;t<e.threads.length;++t)if(!n.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(t=0;t<e.threadsV2.length;++t){var s=r.CommentsThreadDescriptor.verify(e.threadsV2[t]);if(s)return"threadsV2."+s}}return null},s.fromObject=function(e){if(e instanceof r.CommentsV2GetDocumentThreadsResponse)return e;var t=new r.CommentsV2GetDocumentThreadsResponse;if(e.threads){if(!Array.isArray(e.threads))throw TypeError(".CommentsV2GetDocumentThreadsResponse.threads: array expected");t.threads=[];for(var 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");for(t.threadsV2=[],n=0;n<e.threadsV2.length;++n){if("object"!=typeof e.threadsV2[n])throw TypeError(".CommentsV2GetDocumentThreadsResponse.threadsV2: object expected");t.threadsV2[n]=r.CommentsThreadDescriptor.fromObject(e.threadsV2[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.threads=[],n.threadsV2=[]),e.threads&&e.threads.length){n.threads=[];for(var s=0;s<e.threads.length;++s)n.threads[s]=e.threads[s]}if(e.threadsV2&&e.threadsV2.length)for(n.threadsV2=[],s=0;s<e.threadsV2.length;++s)n.threadsV2[s]=r.CommentsThreadDescriptor.toObject(e.threadsV2[s],t);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetDocumentThreadsResponse"},s}(),r.KeyValueDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.key="",s.prototype.value="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&n.uint32(10).string(e.key),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&n.uint32(18).string(e.value),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.KeyValueDescriptor;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.key=t.string();break;case 2:i.value=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!n.isString(e.key)?"key: string expected":null!=e.value&&e.hasOwnProperty("value")&&!n.isString(e.value)?"value: string expected":null},s.fromObject=function(e){if(e instanceof r.KeyValueDescriptor)return e;var t=new r.KeyValueDescriptor;return null!=e.key&&(t.key=String(e.key)),null!=e.value&&(t.value=String(e.value)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/KeyValueDescriptor"},s}(),r.IsEditorBundleUploadedMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.bundleVersion="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&n.uint32(10).string(e.bundleVersion),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.IsEditorBundleUploadedMessage;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?i.bundleVersion=t.string():t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!n.isString(e.bundleVersion)?"bundleVersion: string expected":null},s.fromObject=function(e){if(e instanceof r.IsEditorBundleUploadedMessage)return e;var t=new r.IsEditorBundleUploadedMessage;return null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.bundleVersion=""),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/IsEditorBundleUploadedMessage"},s}(),r.IsEditorBundleUploadedResponse=function(){function n(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return n.prototype.isUploaded=!1,n.create=function(e){return new n(e)},n.encode=function(e,n){return n||(n=t.create()),null!=e.isUploaded&&Object.hasOwnProperty.call(e,"isUploaded")&&n.uint32(8).bool(e.isUploaded),n},n.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},n.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.IsEditorBundleUploadedResponse;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?i.isUploaded=t.bool():t.skipType(7&a)}return i},n.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},n.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},n.fromObject=function(e){if(e instanceof r.IsEditorBundleUploadedResponse)return e;var t=new r.IsEditorBundleUploadedResponse;return null!=e.isUploaded&&(t.isUploaded=Boolean(e.isUploaded)),t},n.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.isUploaded=!1),null!=e.isUploaded&&e.hasOwnProperty("isUploaded")&&(n.isUploaded=e.isUploaded),n},n.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},n.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/IsEditorBundleUploadedResponse"},n}(),r.RevisionDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.revisionId="",s.prototype.name="",s.prototype.creatorId="",s.prototype.authorsIds="",s.prototype.diffData="",s.prototype.createdAt="",s.prototype.attributes="",s.prototype.toVersion=0,s.prototype.fromVersion=0,s.prototype.isEmptyCurrent=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&n.uint32(10).string(e.revisionId),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&n.uint32(18).string(e.name),null!=e.creatorId&&Object.hasOwnProperty.call(e,"creatorId")&&n.uint32(26).string(e.creatorId),null!=e.authorsIds&&Object.hasOwnProperty.call(e,"authorsIds")&&n.uint32(34).string(e.authorsIds),null!=e.diffData&&Object.hasOwnProperty.call(e,"diffData")&&n.uint32(42).string(e.diffData),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(58).string(e.attributes),null!=e.toVersion&&Object.hasOwnProperty.call(e,"toVersion")&&n.uint32(64).uint32(e.toVersion),null!=e.fromVersion&&Object.hasOwnProperty.call(e,"fromVersion")&&n.uint32(72).uint32(e.fromVersion),null!=e.isEmptyCurrent&&Object.hasOwnProperty.call(e,"isEmptyCurrent")&&n.uint32(80).bool(e.isEmptyCurrent),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.RevisionDescriptor;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.revisionId=t.string();break;case 2:i.name=t.string();break;case 3:i.creatorId=t.string();break;case 4:i.authorsIds=t.string();break;case 5:i.diffData=t.string();break;case 6:i.createdAt=t.string();break;case 7:i.attributes=t.string();break;case 8:i.toVersion=t.uint32();break;case 9:i.fromVersion=t.uint32();break;case 10:i.isEmptyCurrent=t.bool();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!n.isString(e.revisionId)?"revisionId: string expected":null!=e.name&&e.hasOwnProperty("name")&&!n.isString(e.name)?"name: string expected":null!=e.creatorId&&e.hasOwnProperty("creatorId")&&!n.isString(e.creatorId)?"creatorId: string expected":null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&!n.isString(e.authorsIds)?"authorsIds: string expected":null!=e.diffData&&e.hasOwnProperty("diffData")&&!n.isString(e.diffData)?"diffData: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null!=e.toVersion&&e.hasOwnProperty("toVersion")&&!n.isInteger(e.toVersion)?"toVersion: integer expected":null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&!n.isInteger(e.fromVersion)?"fromVersion: integer expected":null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof e.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},s.fromObject=function(e){if(e instanceof r.RevisionDescriptor)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionDescriptor"},s}(),r.RevisionHistoryConnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(10).string(e.documentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.RevisionHistoryConnectMessage;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?i.documentId=t.string():t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof r.RevisionHistoryConnectMessage)return e;var t=new r.RevisionHistoryConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryConnectMessage"},s}(),r.RevisionHistoryGetRevisionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.revisionId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(10).string(e.documentId),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&n.uint32(18).string(e.revisionId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.RevisionHistoryGetRevisionMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.documentId=t.string();break;case 2:i.revisionId=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!n.isString(e.revisionId)?"revisionId: string expected":null},s.fromObject=function(e){if(e instanceof r.RevisionHistoryGetRevisionMessage)return e;var t=new r.RevisionHistoryGetRevisionMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.revisionId&&(t.revisionId=String(e.revisionId)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryGetRevisionMessage"},s}(),r.RevisionHistoryReconnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.requestId=0,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(10).string(e.documentId),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&n.uint32(16).uint32(e.requestId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.RevisionHistoryReconnectMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.documentId=t.string();break;case 2:i.requestId=t.uint32();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null!=e.requestId&&e.hasOwnProperty("requestId")&&!n.isInteger(e.requestId)?"requestId: integer expected":null},s.fromObject=function(e){if(e instanceof r.RevisionHistoryReconnectMessage)return e;var t=new r.RevisionHistoryReconnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.requestId&&(t.requestId=e.requestId>>>0),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryReconnectMessage"},s}(),r.RevisionHistoryUpdateRevisionsMessage=function(){function s(e){if(this.revisions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.requestId=0,s.prototype.revisions=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(10).string(e.documentId),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&n.uint32(16).uint32(e.requestId),null!=e.revisions&&e.revisions.length)for(var s=0;s<e.revisions.length;++s)r.RevisionDescriptor.encode(e.revisions[s],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.RevisionHistoryUpdateRevisionsMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.documentId=t.string();break;case 2:i.requestId=t.uint32();break;case 3:i.revisions&&i.revisions.length||(i.revisions=[]),i.revisions.push(r.RevisionDescriptor.decode(t,t.uint32()));break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId))return"documentId: string expected";if(null!=e.requestId&&e.hasOwnProperty("requestId")&&!n.isInteger(e.requestId))return"requestId: integer expected";if(null!=e.revisions&&e.hasOwnProperty("revisions")){if(!Array.isArray(e.revisions))return"revisions: array expected";for(var t=0;t<e.revisions.length;++t){var s=r.RevisionDescriptor.verify(e.revisions[t]);if(s)return"revisions."+s}}return null},s.fromObject=function(e){if(e instanceof r.RevisionHistoryUpdateRevisionsMessage)return e;var t=new r.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(var n=0;n<e.revisions.length;++n){if("object"!=typeof e.revisions[n])throw TypeError(".RevisionHistoryUpdateRevisionsMessage.revisions: object expected");t.revisions[n]=r.RevisionDescriptor.fromObject(e.revisions[n])}}return t},s.toObject=function(e,t){t||(t={});var 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(var s=0;s<e.revisions.length;++s)n.revisions[s]=r.RevisionDescriptor.toObject(e.revisions[s],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryUpdateRevisionsMessage"},s}(),r.RevisionHistoryConnectResponse=function(){function s(e){if(this.revisions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.requestId=0,s.prototype.revisions=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&n.uint32(10).string(e.channel),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&n.uint32(16).uint32(e.requestId),null!=e.revisions&&e.revisions.length)for(var s=0;s<e.revisions.length;++s)r.RevisionDescriptor.encode(e.revisions[s],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.RevisionHistoryConnectResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.channel=t.string();break;case 2:i.requestId=t.uint32();break;case 3:i.revisions&&i.revisions.length||(i.revisions=[]),i.revisions.push(r.RevisionDescriptor.decode(t,t.uint32()));break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!n.isString(e.channel))return"channel: string expected";if(null!=e.requestId&&e.hasOwnProperty("requestId")&&!n.isInteger(e.requestId))return"requestId: integer expected";if(null!=e.revisions&&e.hasOwnProperty("revisions")){if(!Array.isArray(e.revisions))return"revisions: array expected";for(var t=0;t<e.revisions.length;++t){var s=r.RevisionDescriptor.verify(e.revisions[t]);if(s)return"revisions."+s}}return null},s.fromObject=function(e){if(e instanceof r.RevisionHistoryConnectResponse)return e;var t=new r.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(var n=0;n<e.revisions.length;++n){if("object"!=typeof e.revisions[n])throw TypeError(".RevisionHistoryConnectResponse.revisions: object expected");t.revisions[n]=r.RevisionDescriptor.fromObject(e.revisions[n])}}return t},s.toObject=function(e,t){t||(t={});var 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(var s=0;s<e.revisions.length;++s)n.revisions[s]=r.RevisionDescriptor.toObject(e.revisions[s],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryConnectResponse"},s}(),r.RevisionHistoryGetRevisionResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.revisionId="",s.prototype.name="",s.prototype.creatorId="",s.prototype.authorsIds="",s.prototype.diffData="",s.prototype.createdAt="",s.prototype.attributes="",s.prototype.toVersion=0,s.prototype.fromVersion=0,s.prototype.isEmptyCurrent=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&n.uint32(10).string(e.revisionId),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&n.uint32(18).string(e.name),null!=e.creatorId&&Object.hasOwnProperty.call(e,"creatorId")&&n.uint32(26).string(e.creatorId),null!=e.authorsIds&&Object.hasOwnProperty.call(e,"authorsIds")&&n.uint32(34).string(e.authorsIds),null!=e.diffData&&Object.hasOwnProperty.call(e,"diffData")&&n.uint32(42).string(e.diffData),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(58).string(e.attributes),null!=e.toVersion&&Object.hasOwnProperty.call(e,"toVersion")&&n.uint32(64).uint32(e.toVersion),null!=e.fromVersion&&Object.hasOwnProperty.call(e,"fromVersion")&&n.uint32(72).uint32(e.fromVersion),null!=e.isEmptyCurrent&&Object.hasOwnProperty.call(e,"isEmptyCurrent")&&n.uint32(80).bool(e.isEmptyCurrent),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.RevisionHistoryGetRevisionResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.revisionId=t.string();break;case 2:i.name=t.string();break;case 3:i.creatorId=t.string();break;case 4:i.authorsIds=t.string();break;case 5:i.diffData=t.string();break;case 6:i.createdAt=t.string();break;case 7:i.attributes=t.string();break;case 8:i.toVersion=t.uint32();break;case 9:i.fromVersion=t.uint32();break;case 10:i.isEmptyCurrent=t.bool();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!n.isString(e.revisionId)?"revisionId: string expected":null!=e.name&&e.hasOwnProperty("name")&&!n.isString(e.name)?"name: string expected":null!=e.creatorId&&e.hasOwnProperty("creatorId")&&!n.isString(e.creatorId)?"creatorId: string expected":null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&!n.isString(e.authorsIds)?"authorsIds: string expected":null!=e.diffData&&e.hasOwnProperty("diffData")&&!n.isString(e.diffData)?"diffData: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null!=e.toVersion&&e.hasOwnProperty("toVersion")&&!n.isInteger(e.toVersion)?"toVersion: integer expected":null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&!n.isInteger(e.fromVersion)?"fromVersion: integer expected":null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof e.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},s.fromObject=function(e){if(e instanceof r.RevisionHistoryGetRevisionResponse)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryGetRevisionResponse"},s}(),r.RevisionHistoryUpdateRevisionsResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.requestId=0,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&n.uint32(8).uint32(e.requestId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.RevisionHistoryUpdateRevisionsResponse;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?i.requestId=t.uint32():t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.requestId&&e.hasOwnProperty("requestId")&&!n.isInteger(e.requestId)?"requestId: integer expected":null},s.fromObject=function(e){if(e instanceof r.RevisionHistoryUpdateRevisionsResponse)return e;var t=new r.RevisionHistoryUpdateRevisionsResponse;return null!=e.requestId&&(t.requestId=e.requestId>>>0),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.requestId=0),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryUpdateRevisionsResponse"},s}(),r.SessionsSocketDescriptor=function(){function s(e){if(this.permissions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.session="",s.prototype.user="",s.prototype.role="",s.prototype.permissions=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.session&&Object.hasOwnProperty.call(e,"session")&&n.uint32(10).string(e.session),null!=e.user&&Object.hasOwnProperty.call(e,"user")&&n.uint32(18).string(e.user),null!=e.role&&Object.hasOwnProperty.call(e,"role")&&n.uint32(26).string(e.role),null!=e.permissions&&e.permissions.length)for(var r=0;r<e.permissions.length;++r)n.uint32(34).string(e.permissions[r]);return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.SessionsSocketDescriptor;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.session=t.string();break;case 2:i.user=t.string();break;case 3:i.role=t.string();break;case 4:i.permissions&&i.permissions.length||(i.permissions=[]),i.permissions.push(t.string());break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.session&&e.hasOwnProperty("session")&&!n.isString(e.session))return"session: string expected";if(null!=e.user&&e.hasOwnProperty("user")&&!n.isString(e.user))return"user: string expected";if(null!=e.role&&e.hasOwnProperty("role")&&!n.isString(e.role))return"role: string expected";if(null!=e.permissions&&e.hasOwnProperty("permissions")){if(!Array.isArray(e.permissions))return"permissions: array expected";for(var t=0;t<e.permissions.length;++t)if(!n.isString(e.permissions[t]))return"permissions: string[] expected"}return null},s.fromObject=function(e){if(e instanceof r.SessionsSocketDescriptor)return e;var t=new r.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(var n=0;n<e.permissions.length;++n)t.permissions[n]=String(e.permissions[n])}return t},s.toObject=function(e,t){t||(t={});var 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(var r=0;r<e.permissions.length;++r)n.permissions[r]=e.permissions[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsSocketDescriptor"},s}(),r.SessionsConnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.sessionType=0,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.sessionType&&Object.hasOwnProperty.call(e,"sessionType")&&n.uint32(16).uint32(e.sessionType),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.SessionsConnectMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.sessionType=t.uint32();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id)?"id: string expected":null!=e.sessionType&&e.hasOwnProperty("sessionType")&&!n.isInteger(e.sessionType)?"sessionType: integer expected":null},s.fromObject=function(e){if(e instanceof r.SessionsConnectMessage)return e;var t=new r.SessionsConnectMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.sessionType&&(t.sessionType=e.sessionType>>>0),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsConnectMessage"},s}(),r.SocketConnectMessage=function(){function s(e){if(this.permissions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.userId="",s.prototype.role="",s.prototype.permissions=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(18).string(e.userId),null!=e.role&&Object.hasOwnProperty.call(e,"role")&&n.uint32(26).string(e.role),null!=e.permissions&&e.permissions.length)for(var r=0;r<e.permissions.length;++r)n.uint32(34).string(e.permissions[r]);return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.SocketConnectMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.userId=t.string();break;case 3:i.role=t.string();break;case 4:i.permissions&&i.permissions.length||(i.permissions=[]),i.permissions.push(t.string());break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id))return"id: string expected";if(null!=e.userId&&e.hasOwnProperty("userId")&&!n.isString(e.userId))return"userId: string expected";if(null!=e.role&&e.hasOwnProperty("role")&&!n.isString(e.role))return"role: string expected";if(null!=e.permissions&&e.hasOwnProperty("permissions")){if(!Array.isArray(e.permissions))return"permissions: array expected";for(var t=0;t<e.permissions.length;++t)if(!n.isString(e.permissions[t]))return"permissions: string[] expected"}return null},s.fromObject=function(e){if(e instanceof r.SocketConnectMessage)return e;var t=new r.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(var n=0;n<e.permissions.length;++n)t.permissions[n]=String(e.permissions[n])}return t},s.toObject=function(e,t){t||(t={});var 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(var r=0;r<e.permissions.length;++r)n.permissions[r]=e.permissions[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SocketConnectMessage"},s}(),r.SocketDisconnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.SocketDisconnectMessage;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?i.id=t.string():t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id)?"id: string expected":null},s.fromObject=function(e){if(e instanceof r.SocketDisconnectMessage)return e;var t=new r.SocketDisconnectMessage;return null!=e.id&&(t.id=String(e.id)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SocketDisconnectMessage"},s}(),r.SessionsConnectResponse=function(){function s(e){if(this.sockets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.sockets=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&n.uint32(10).string(e.channel),null!=e.sockets&&e.sockets.length)for(var s=0;s<e.sockets.length;++s)r.SessionsSocketDescriptor.encode(e.sockets[s],n.uint32(18).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.SessionsConnectResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.channel=t.string();break;case 2:i.sockets&&i.sockets.length||(i.sockets=[]),i.sockets.push(r.SessionsSocketDescriptor.decode(t,t.uint32()));break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!n.isString(e.channel))return"channel: string expected";if(null!=e.sockets&&e.hasOwnProperty("sockets")){if(!Array.isArray(e.sockets))return"sockets: array expected";for(var t=0;t<e.sockets.length;++t){var s=r.SessionsSocketDescriptor.verify(e.sockets[t]);if(s)return"sockets."+s}}return null},s.fromObject=function(e){if(e instanceof r.SessionsConnectResponse)return e;var t=new r.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(var n=0;n<e.sockets.length;++n){if("object"!=typeof e.sockets[n])throw TypeError(".SessionsConnectResponse.sockets: object expected");t.sockets[n]=r.SessionsSocketDescriptor.fromObject(e.sockets[n])}}return t},s.toObject=function(e,t){t||(t={});var 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(var s=0;s<e.sockets.length;++s)n.sockets[s]=r.SessionsSocketDescriptor.toObject(e.sockets[s],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsConnectResponse"},s}(),r.SuggestionDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.authorId="",s.prototype.type="",s.prototype.createdAt="",s.prototype.data="",s.prototype.hasComments=!1,s.prototype.state="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&n.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&n.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&n.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&n.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(66).string(e.attributes),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.SuggestionDescriptor;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.authorId=t.string();break;case 3:i.type=t.string();break;case 4:i.createdAt=t.string();break;case 5:i.data=t.string();break;case 6:i.hasComments=t.bool();break;case 7:i.state=t.string();break;case 8:i.attributes=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!n.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!n.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!n.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")&&!n.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof r.SuggestionDescriptor)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SuggestionDescriptor"},s}(),r.TrackChangesAddSuggestionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.documentId="",s.prototype.type="",s.prototype.data="",s.prototype.originalSuggestionId="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(18).string(e.documentId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&n.uint32(26).string(e.type),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(34).string(e.data),null!=e.originalSuggestionId&&Object.hasOwnProperty.call(e,"originalSuggestionId")&&n.uint32(42).string(e.originalSuggestionId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(50).string(e.attributes),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.TrackChangesAddSuggestionMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.documentId=t.string();break;case 3:i.type=t.string();break;case 4:i.data=t.string();break;case 5:i.originalSuggestionId=t.string();break;case 6:i.attributes=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!n.isString(e.type)?"type: string expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isString(e.data)?"data: string expected":null!=e.originalSuggestionId&&e.hasOwnProperty("originalSuggestionId")&&!n.isString(e.originalSuggestionId)?"originalSuggestionId: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof r.TrackChangesAddSuggestionMessage)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesAddSuggestionMessage"},s}(),r.TrackChangesBatchUpdateSuggestionsStateMessage=function(){function s(e){if(this.ids=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.ids=n.emptyArray,s.prototype.documentId="",s.prototype.state="",s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.ids&&e.ids.length)for(var r=0;r<e.ids.length;++r)n.uint32(10).string(e.ids[r]);return null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(18).string(e.documentId),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&n.uint32(26).string(e.state),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.TrackChangesBatchUpdateSuggestionsStateMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.ids&&i.ids.length||(i.ids=[]),i.ids.push(t.string());break;case 2:i.documentId=t.string();break;case 3:i.state=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.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(var t=0;t<e.ids.length;++t)if(!n.isString(e.ids[t]))return"ids: string[] expected"}return null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null!=e.state&&e.hasOwnProperty("state")&&!n.isString(e.state)?"state: string expected":null},s.fromObject=function(e){if(e instanceof r.TrackChangesBatchUpdateSuggestionsStateMessage)return e;var t=new r.TrackChangesBatchUpdateSuggestionsStateMessage;if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".TrackChangesBatchUpdateSuggestionsStateMessage.ids: array expected");t.ids=[];for(var 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},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.ids=[]),t.defaults&&(n.documentId="",n.state=""),e.ids&&e.ids.length){n.ids=[];for(var r=0;r<e.ids.length;++r)n.ids[r]=e.ids[r]}return null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesBatchUpdateSuggestionsStateMessage"},s}(),r.TrackChangesConnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(10).string(e.documentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.TrackChangesConnectMessage;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?i.documentId=t.string():t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof r.TrackChangesConnectMessage)return e;var t=new r.TrackChangesConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesConnectMessage"},s}(),r.TrackChangesGetAllSuggestionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(10).string(e.documentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.TrackChangesGetAllSuggestionMessage;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?i.documentId=t.string():t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof r.TrackChangesGetAllSuggestionMessage)return e;var t=new r.TrackChangesGetAllSuggestionMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetAllSuggestionMessage"},s}(),r.TrackChangesGetSuggestionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(18).string(e.documentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.TrackChangesGetSuggestionMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.documentId=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof r.TrackChangesGetSuggestionMessage)return e;var t=new r.TrackChangesGetSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetSuggestionMessage"},s}(),r.TrackChangesUpdateSuggestionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.documentId="",s.prototype.hasComments=!1,s.prototype.isHasCommentsModified=!1,s.prototype.state="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(18).string(e.documentId),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&n.uint32(24).bool(e.hasComments),null!=e.isHasCommentsModified&&Object.hasOwnProperty.call(e,"isHasCommentsModified")&&n.uint32(32).bool(e.isHasCommentsModified),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&n.uint32(42).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(50).string(e.attributes),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.TrackChangesUpdateSuggestionMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.documentId=t.string();break;case 3:i.hasComments=t.bool();break;case 4:i.isHasCommentsModified=t.bool();break;case 5:i.state=t.string();break;case 6:i.attributes=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.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")&&!n.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof r.TrackChangesUpdateSuggestionMessage)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesUpdateSuggestionMessage"},s}(),r.TrackChangesAddSuggestionResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.authorId="",s.prototype.type="",s.prototype.createdAt="",s.prototype.data="",s.prototype.hasComments=!1,s.prototype.state="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&n.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&n.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&n.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&n.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(66).string(e.attributes),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.TrackChangesAddSuggestionResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.authorId=t.string();break;case 3:i.type=t.string();break;case 4:i.createdAt=t.string();break;case 5:i.data=t.string();break;case 6:i.hasComments=t.bool();break;case 7:i.state=t.string();break;case 8:i.attributes=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!n.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!n.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!n.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")&&!n.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof r.TrackChangesAddSuggestionResponse)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesAddSuggestionResponse"},s}(),r.TrackChangesConnectResponse=function(){function s(e){if(this.suggestions=[],this.suggestionsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.suggestions=n.emptyArray,s.prototype.suggestionsV2=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&n.uint32(10).string(e.channel),null!=e.suggestions&&e.suggestions.length)for(var s=0;s<e.suggestions.length;++s)n.uint32(18).string(e.suggestions[s]);if(null!=e.suggestionsV2&&e.suggestionsV2.length)for(s=0;s<e.suggestionsV2.length;++s)r.SuggestionDescriptor.encode(e.suggestionsV2[s],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.TrackChangesConnectResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.channel=t.string();break;case 2:i.suggestions&&i.suggestions.length||(i.suggestions=[]),i.suggestions.push(t.string());break;case 3:i.suggestionsV2&&i.suggestionsV2.length||(i.suggestionsV2=[]),i.suggestionsV2.push(r.SuggestionDescriptor.decode(t,t.uint32()));break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!n.isString(e.channel))return"channel: string expected";if(null!=e.suggestions&&e.hasOwnProperty("suggestions")){if(!Array.isArray(e.suggestions))return"suggestions: array expected";for(var t=0;t<e.suggestions.length;++t)if(!n.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(t=0;t<e.suggestionsV2.length;++t){var s=r.SuggestionDescriptor.verify(e.suggestionsV2[t]);if(s)return"suggestionsV2."+s}}return null},s.fromObject=function(e){if(e instanceof r.TrackChangesConnectResponse)return e;var t=new r.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(var 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");for(t.suggestionsV2=[],n=0;n<e.suggestionsV2.length;++n){if("object"!=typeof e.suggestionsV2[n])throw TypeError(".TrackChangesConnectResponse.suggestionsV2: object expected");t.suggestionsV2[n]=r.SuggestionDescriptor.fromObject(e.suggestionsV2[n])}}return t},s.toObject=function(e,t){t||(t={});var 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(var s=0;s<e.suggestions.length;++s)n.suggestions[s]=e.suggestions[s]}if(e.suggestionsV2&&e.suggestionsV2.length)for(n.suggestionsV2=[],s=0;s<e.suggestionsV2.length;++s)n.suggestionsV2[s]=r.SuggestionDescriptor.toObject(e.suggestionsV2[s],t);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesConnectResponse"},s}(),r.TrackChangesGetAllSuggestionsResponse=function(){function s(e){if(this.suggestions=[],this.suggestionsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.suggestions=n.emptyArray,s.prototype.suggestionsV2=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.suggestions&&e.suggestions.length)for(var s=0;s<e.suggestions.length;++s)n.uint32(10).string(e.suggestions[s]);if(null!=e.suggestionsV2&&e.suggestionsV2.length)for(s=0;s<e.suggestionsV2.length;++s)r.SuggestionDescriptor.encode(e.suggestionsV2[s],n.uint32(18).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.TrackChangesGetAllSuggestionsResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.suggestions&&i.suggestions.length||(i.suggestions=[]),i.suggestions.push(t.string());break;case 2:i.suggestionsV2&&i.suggestionsV2.length||(i.suggestionsV2=[]),i.suggestionsV2.push(r.SuggestionDescriptor.decode(t,t.uint32()));break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.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(var t=0;t<e.suggestions.length;++t)if(!n.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(t=0;t<e.suggestionsV2.length;++t){var s=r.SuggestionDescriptor.verify(e.suggestionsV2[t]);if(s)return"suggestionsV2."+s}}return null},s.fromObject=function(e){if(e instanceof r.TrackChangesGetAllSuggestionsResponse)return e;var t=new r.TrackChangesGetAllSuggestionsResponse;if(e.suggestions){if(!Array.isArray(e.suggestions))throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestions: array expected");t.suggestions=[];for(var 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");for(t.suggestionsV2=[],n=0;n<e.suggestionsV2.length;++n){if("object"!=typeof e.suggestionsV2[n])throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestionsV2: object expected");t.suggestionsV2[n]=r.SuggestionDescriptor.fromObject(e.suggestionsV2[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.suggestions=[],n.suggestionsV2=[]),e.suggestions&&e.suggestions.length){n.suggestions=[];for(var s=0;s<e.suggestions.length;++s)n.suggestions[s]=e.suggestions[s]}if(e.suggestionsV2&&e.suggestionsV2.length)for(n.suggestionsV2=[],s=0;s<e.suggestionsV2.length;++s)n.suggestionsV2[s]=r.SuggestionDescriptor.toObject(e.suggestionsV2[s],t);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetAllSuggestionsResponse"},s}(),r.TrackChangesGetSuggestionResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.authorId="",s.prototype.type="",s.prototype.createdAt="",s.prototype.data="",s.prototype.hasComments=!1,s.prototype.state="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&n.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&n.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&n.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&n.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(66).string(e.attributes),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.TrackChangesGetSuggestionResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.authorId=t.string();break;case 3:i.type=t.string();break;case 4:i.createdAt=t.string();break;case 5:i.data=t.string();break;case 6:i.hasComments=t.bool();break;case 7:i.state=t.string();break;case 8:i.attributes=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!n.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!n.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!n.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")&&!n.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof r.TrackChangesGetSuggestionResponse)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetSuggestionResponse"},s}(),r.UserDescriptor=function(){function s(e){if(this.attributes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.attributes=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.attributes&&e.attributes.length)for(var s=0;s<e.attributes.length;++s)r.KeyValueDescriptor.encode(e.attributes[s],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.UserDescriptor;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?(i.attributes&&i.attributes.length||(i.attributes=[]),i.attributes.push(r.KeyValueDescriptor.decode(t,t.uint32()))):t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.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(var t=0;t<e.attributes.length;++t){var n=r.KeyValueDescriptor.verify(e.attributes[t]);if(n)return"attributes."+n}}return null},s.fromObject=function(e){if(e instanceof r.UserDescriptor)return e;var t=new r.UserDescriptor;if(e.attributes){if(!Array.isArray(e.attributes))throw TypeError(".UserDescriptor.attributes: array expected");t.attributes=[];for(var n=0;n<e.attributes.length;++n){if("object"!=typeof e.attributes[n])throw TypeError(".UserDescriptor.attributes: object expected");t.attributes[n]=r.KeyValueDescriptor.fromObject(e.attributes[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.attributes=[]),e.attributes&&e.attributes.length){n.attributes=[];for(var s=0;s<e.attributes.length;++s)n.attributes[s]=r.KeyValueDescriptor.toObject(e.attributes[s],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/UserDescriptor"},s}(),r.GetManyUsersMessage=function(){function s(e){if(this.ids=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.ids=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.ids&&e.ids.length)for(var r=0;r<e.ids.length;++r)n.uint32(10).string(e.ids[r]);return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.GetManyUsersMessage;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?(i.ids&&i.ids.length||(i.ids=[]),i.ids.push(t.string())):t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.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(var t=0;t<e.ids.length;++t)if(!n.isString(e.ids[t]))return"ids: string[] expected"}return null},s.fromObject=function(e){if(e instanceof r.GetManyUsersMessage)return e;var t=new r.GetManyUsersMessage;if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".GetManyUsersMessage.ids: array expected");t.ids=[];for(var n=0;n<e.ids.length;++n)t.ids[n]=String(e.ids[n])}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.ids=[]),e.ids&&e.ids.length){n.ids=[];for(var r=0;r<e.ids.length;++r)n.ids[r]=e.ids[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetManyUsersMessage"},s}(),r.GetUserMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.GetUserMessage;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?i.id=t.string():t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id)?"id: string expected":null},s.fromObject=function(e){if(e instanceof r.GetUserMessage)return e;var t=new r.GetUserMessage;return null!=e.id&&(t.id=String(e.id)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetUserMessage"},s}(),r.GetManyUsersResponse=function(){function s(e){if(this.users=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.users=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.users&&e.users.length)for(var s=0;s<e.users.length;++s)r.UserDescriptor.encode(e.users[s],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.GetManyUsersResponse;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?(i.users&&i.users.length||(i.users=[]),i.users.push(r.UserDescriptor.decode(t,t.uint32()))):t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.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(var t=0;t<e.users.length;++t){var n=r.UserDescriptor.verify(e.users[t]);if(n)return"users."+n}}return null},s.fromObject=function(e){if(e instanceof r.GetManyUsersResponse)return e;var t=new r.GetManyUsersResponse;if(e.users){if(!Array.isArray(e.users))throw TypeError(".GetManyUsersResponse.users: array expected");t.users=[];for(var n=0;n<e.users.length;++n){if("object"!=typeof e.users[n])throw TypeError(".GetManyUsersResponse.users: object expected");t.users[n]=r.UserDescriptor.fromObject(e.users[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.users=[]),e.users&&e.users.length){n.users=[];for(var s=0;s<e.users.length;++s)n.users[s]=r.UserDescriptor.toObject(e.users[s],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetManyUsersResponse"},s}(),r.GetUserResponse=function(){function s(e){if(this.attributes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.attributes=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.attributes&&e.attributes.length)for(var s=0;s<e.attributes.length;++s)r.KeyValueDescriptor.encode(e.attributes[s],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.GetUserResponse;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?(i.attributes&&i.attributes.length||(i.attributes=[]),i.attributes.push(r.KeyValueDescriptor.decode(t,t.uint32()))):t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.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(var t=0;t<e.attributes.length;++t){var n=r.KeyValueDescriptor.verify(e.attributes[t]);if(n)return"attributes."+n}}return null},s.fromObject=function(e){if(e instanceof r.GetUserResponse)return e;var t=new r.GetUserResponse;if(e.attributes){if(!Array.isArray(e.attributes))throw TypeError(".GetUserResponse.attributes: array expected");t.attributes=[];for(var n=0;n<e.attributes.length;++n){if("object"!=typeof e.attributes[n])throw TypeError(".GetUserResponse.attributes: object expected");t.attributes[n]=r.KeyValueDescriptor.fromObject(e.attributes[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.attributes=[]),e.attributes&&e.attributes.length){n.attributes=[];for(var s=0;s<e.attributes.length;++s)n.attributes[s]=r.KeyValueDescriptor.toObject(e.attributes[s],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetUserResponse"},s}(),r.ChannelMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.type=0,s.prototype.socketId="",s.prototype.data=n.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&n.uint32(8).uint32(e.type),null!=e.socketId&&Object.hasOwnProperty.call(e,"socketId")&&n.uint32(18).string(e.socketId),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(26).bytes(e.data),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.ChannelMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.type=t.uint32();break;case 2:i.socketId=t.string();break;case 3:i.data=t.bytes();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!n.isInteger(e.type)?"type: integer expected":null!=e.socketId&&e.hasOwnProperty("socketId")&&!n.isString(e.socketId)?"socketId: string expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||n.isString(e.data))?"data: buffer expected":null},s.fromObject=function(e){if(e instanceof r.ChannelMessage)return e;var t=new r.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?n.base64.decode(e.data,t.data=n.newBuffer(n.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),t},s.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.type=0,r.socketId="",t.bytes===String?r.data="":(r.data=[],t.bytes!==Array&&(r.data=n.newBuffer(r.data)))),null!=e.type&&e.hasOwnProperty("type")&&(r.type=e.type),null!=e.socketId&&e.hasOwnProperty("socketId")&&(r.socketId=e.socketId),null!=e.data&&e.hasOwnProperty("data")&&(r.data=t.bytes===String?n.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ChannelMessage"},s}(),r.BytesBytesPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=n.newBuffer([]),s.prototype.data1=n.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(10).bytes(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(18).bytes(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.BytesBytesPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.bytes();break;case 2:i.data1=t.bytes();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||n.isString(e.data))?"data: buffer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||n.isString(e.data1))?"data1: buffer expected":null},s.fromObject=function(e){if(e instanceof r.BytesBytesPacketDataMessage)return e;var t=new r.BytesBytesPacketDataMessage;return null!=e.data&&("string"==typeof e.data?n.base64.decode(e.data,t.data=n.newBuffer(n.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),null!=e.data1&&("string"==typeof e.data1?n.base64.decode(e.data1,t.data1=n.newBuffer(n.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},s.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.data="":(r.data=[],t.bytes!==Array&&(r.data=n.newBuffer(r.data))),t.bytes===String?r.data1="":(r.data1=[],t.bytes!==Array&&(r.data1=n.newBuffer(r.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(r.data=t.bytes===String?n.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")&&(r.data1=t.bytes===String?n.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/BytesBytesPacketDataMessage"},s}(),r.NumberBytesPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=0,s.prototype.data1=n.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(18).bytes(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.NumberBytesPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.uint32();break;case 2:i.data1=t.bytes();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||n.isString(e.data1))?"data1: buffer expected":null},s.fromObject=function(e){if(e instanceof r.NumberBytesPacketDataMessage)return e;var t=new r.NumberBytesPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&("string"==typeof e.data1?n.base64.decode(e.data1,t.data1=n.newBuffer(n.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},s.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.data=0,t.bytes===String?r.data1="":(r.data1=[],t.bytes!==Array&&(r.data1=n.newBuffer(r.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(r.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(r.data1=t.bytes===String?n.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberBytesPacketDataMessage"},s}(),r.NumberNumberPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=0,s.prototype.data1=0,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(16).uint32(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.NumberNumberPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.uint32();break;case 2:i.data1=t.uint32();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!n.isInteger(e.data1)?"data1: integer expected":null},s.fromObject=function(e){if(e instanceof r.NumberNumberPacketDataMessage)return e;var t=new r.NumberNumberPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=e.data1>>>0),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberNumberPacketDataMessage"},s}(),r.NumberObjectPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=0,s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(18).string(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.NumberObjectPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.uint32();break;case 2:i.data1=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!n.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof r.NumberObjectPacketDataMessage)return e;var t=new r.NumberObjectPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberObjectPacketDataMessage"},s}(),r.NumberStringPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=0,s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(18).string(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.NumberStringPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.uint32();break;case 2:i.data1=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!n.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof r.NumberStringPacketDataMessage)return e;var t=new r.NumberStringPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberStringPacketDataMessage"},s}(),r.ObjectBufferPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1=n.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(18).bytes(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.ObjectBufferPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.string();break;case 2:i.data1=t.bytes();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||n.isString(e.data1))?"data1: buffer expected":null},s.fromObject=function(e){if(e instanceof r.ObjectBufferPacketDataMessage)return e;var t=new r.ObjectBufferPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&("string"==typeof e.data1?n.base64.decode(e.data1,t.data1=n.newBuffer(n.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},s.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.data="",t.bytes===String?r.data1="":(r.data1=[],t.bytes!==Array&&(r.data1=n.newBuffer(r.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(r.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(r.data1=t.bytes===String?n.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ObjectBufferPacketDataMessage"},s}(),r.ObjectObjectPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(18).string(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.ObjectObjectPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.string();break;case 2:i.data1=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!n.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof r.ObjectObjectPacketDataMessage)return e;var t=new r.ObjectObjectPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ObjectObjectPacketDataMessage"},s}(),r.PacketMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.type=0,s.prototype.id=0,s.prototype.nsp="",s.prototype.data=n.newBuffer([]),s.prototype.options=n.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&n.uint32(8).uint32(e.type),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(16).uint32(e.id),null!=e.nsp&&Object.hasOwnProperty.call(e,"nsp")&&n.uint32(26).string(e.nsp),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(34).bytes(e.data),null!=e.options&&Object.hasOwnProperty.call(e,"options")&&n.uint32(42).bytes(e.options),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.PacketMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.type=t.uint32();break;case 2:i.id=t.uint32();break;case 3:i.nsp=t.string();break;case 4:i.data=t.bytes();break;case 5:i.options=t.bytes();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!n.isInteger(e.type)?"type: integer expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isInteger(e.id)?"id: integer expected":null!=e.nsp&&e.hasOwnProperty("nsp")&&!n.isString(e.nsp)?"nsp: string expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||n.isString(e.data))?"data: buffer expected":null!=e.options&&e.hasOwnProperty("options")&&!(e.options&&"number"==typeof e.options.length||n.isString(e.options))?"options: buffer expected":null},s.fromObject=function(e){if(e instanceof r.PacketMessage)return e;var t=new r.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?n.base64.decode(e.data,t.data=n.newBuffer(n.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),null!=e.options&&("string"==typeof e.options?n.base64.decode(e.options,t.options=n.newBuffer(n.base64.length(e.options)),0):e.options.length>=0&&(t.options=e.options)),t},s.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.type=0,r.id=0,r.nsp="",t.bytes===String?r.data="":(r.data=[],t.bytes!==Array&&(r.data=n.newBuffer(r.data))),t.bytes===String?r.options="":(r.options=[],t.bytes!==Array&&(r.options=n.newBuffer(r.options)))),null!=e.type&&e.hasOwnProperty("type")&&(r.type=e.type),null!=e.id&&e.hasOwnProperty("id")&&(r.id=e.id),null!=e.nsp&&e.hasOwnProperty("nsp")&&(r.nsp=e.nsp),null!=e.data&&e.hasOwnProperty("data")&&(r.data=t.bytes===String?n.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")&&(r.options=t.bytes===String?n.base64.encode(e.options,0,e.options.length):t.bytes===Array?Array.prototype.slice.call(e.options):e.options),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/PacketMessage"},s}(),r.PacketOptionsMessage=function(){function s(e){if(this.rooms=[],this.except=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.flags="",s.prototype.rooms=n.emptyArray,s.prototype.except=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.flags&&Object.hasOwnProperty.call(e,"flags")&&n.uint32(10).string(e.flags),null!=e.rooms&&e.rooms.length)for(var r=0;r<e.rooms.length;++r)n.uint32(18).string(e.rooms[r]);if(null!=e.except&&e.except.length)for(r=0;r<e.except.length;++r)n.uint32(26).string(e.except[r]);return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.PacketOptionsMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.flags=t.string();break;case 2:i.rooms&&i.rooms.length||(i.rooms=[]),i.rooms.push(t.string());break;case 3:i.except&&i.except.length||(i.except=[]),i.except.push(t.string());break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.flags&&e.hasOwnProperty("flags")&&!n.isString(e.flags))return"flags: string expected";if(null!=e.rooms&&e.hasOwnProperty("rooms")){if(!Array.isArray(e.rooms))return"rooms: array expected";for(var t=0;t<e.rooms.length;++t)if(!n.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(t=0;t<e.except.length;++t)if(!n.isString(e.except[t]))return"except: string[] expected"}return null},s.fromObject=function(e){if(e instanceof r.PacketOptionsMessage)return e;var t=new r.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(var 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");for(t.except=[],n=0;n<e.except.length;++n)t.except[n]=String(e.except[n])}return t},s.toObject=function(e,t){t||(t={});var 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(var r=0;r<e.rooms.length;++r)n.rooms[r]=e.rooms[r]}if(e.except&&e.except.length)for(n.except=[],r=0;r<e.except.length;++r)n.except[r]=e.except[r];return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/PacketOptionsMessage"},s}(),r.StringBytesPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1=n.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(18).bytes(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.StringBytesPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.string();break;case 2:i.data1=t.bytes();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||n.isString(e.data1))?"data1: buffer expected":null},s.fromObject=function(e){if(e instanceof r.StringBytesPacketDataMessage)return e;var t=new r.StringBytesPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&("string"==typeof e.data1?n.base64.decode(e.data1,t.data1=n.newBuffer(n.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},s.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.data="",t.bytes===String?r.data1="":(r.data1=[],t.bytes!==Array&&(r.data1=n.newBuffer(r.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(r.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(r.data1=t.bytes===String?n.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringBytesPacketDataMessage"},s}(),r.StringNumberPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1=0,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(16).uint32(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.StringNumberPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.string();break;case 2:i.data1=t.uint32();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!n.isInteger(e.data1)?"data1: integer expected":null},s.fromObject=function(e){if(e instanceof r.StringNumberPacketDataMessage)return e;var t=new r.StringNumberPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=e.data1>>>0),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringNumberPacketDataMessage"},s}(),r.StringObjectPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(18).string(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.StringObjectPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.string();break;case 2:i.data1=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!n.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof r.StringObjectPacketDataMessage)return e;var t=new r.StringObjectPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringObjectPacketDataMessage"},s}(),r.StringStringPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(18).string(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.StringStringPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.string();break;case 2:i.data1=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!n.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof r.StringStringPacketDataMessage)return e;var t=new r.StringStringPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringStringPacketDataMessage"},s}(),r})();class l{static decode(e,t){const n=p(t).decode("undefined"==typeof window?e:new Uint8Array(e));return t.fromJSON({...n})}static encode(e){const t=p(e.constructor),n=e.toJSON(),r=t.verify(n);if(r)throw Error(r);return t.encode(t.create(n)).finish()}}function p(e){return u[e.DESCRIPTOR_NAME]}class h extends i{ids;static TYPE="22";static READABLE_TYPE_NAME="getManyUsers";static DESCRIPTOR_NAME="GetManyUsersMessage";static DESCRIPTOR={fields:{ids:{id:1,type:"string",rule:"repeated"}}};constructor(e){super(),this.ids=e}toJSON(){return{ids:this.ids}}static fromJSON(e){return new h(e.ids)}}class f extends i{users;static DESCRIPTOR_NAME="GetManyUsersResponse";static DESCRIPTOR={fields:{users:{rule:"repeated",type:"UserDescriptor",id:1}}};constructor(e){super(),this.users=e}toJSON(){return{users:this.users.map(m)}}static fromJSON(e){return new f(e.users.map(y))}}function m(e){return{attributes:Object.keys(e).map(t=>({key:t,value:JSON.stringify(e[t])}))}}function y(e){return e.attributes.reduce((e,t)=>(e[t.key]=t.value?JSON.parse(t.value):null,e),{})}class g{static _SERVICE=2;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 g(e)}static async get(e,t){const n=new a(t);try{const t=await e._sendRequest(g._SERVICE,a.TYPE,l.encode(n)),r=l.decode(t,c);return new g(r.attributes)}catch(e){return new g({id:t})}}static async getMany(e,t){const n=new h(t);try{const t=await e._sendRequest(g._SERVICE,h.TYPE,l.encode(n));return l.decode(t,f).users.map(e=>new g(e))}catch(e){return t.map(e=>new g({id:e}))}}}const b=g,O=Object.create(null);O.open="0",O.close="1",O.ping="2",O.pong="3",O.message="4",O.upgrade="5",O.noop="6";const w=Object.create(null);Object.keys(O).forEach(e=>{w[O[e]]=e});const I={type:"error",data:"parser error"},v="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),S="function"==typeof ArrayBuffer,k=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,P=({type:e,data:t},n,r)=>v&&t instanceof Blob?n?r(t):A(t,r):S&&(t instanceof ArrayBuffer||k(t))?n?r(t):A(new Blob([t]),r):r(O[e]+(t||"")),A=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)};function T(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let _;const C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)j[C.charCodeAt(e)]=e;const E="function"==typeof ArrayBuffer,D=(e,t)=>{if("string"!=typeof e)return{type:"message",data:R(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:x(e.substring(1),t)};return w[n]?e.length>1?{type:w[n],data:e.substring(1)}:{type:w[n]}:I},x=(e,t)=>{if(E){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=j[e.charCodeAt(t)],r=j[e.charCodeAt(t+1)],s=j[e.charCodeAt(t+2)],o=j[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 R(n,t)}return{base64:!0,data:e}},R=(e,t)=>"blob"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,N=String.fromCharCode(30);function V(){return new TransformStream({transform(e,t){!function(e,t){v&&e.data instanceof Blob?e.data.arrayBuffer().then(T).then(t):S&&(e.data instanceof ArrayBuffer||k(e.data))?t(T(e.data)):P(e,!1,e=>{_||(_=new TextEncoder),t(_.encode(e))})}(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const e=new DataView(s.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{s=new Uint8Array(9);const e=new DataView(s.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&"string"!=typeof e.data&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let M;function B(e){return e.reduce((e,t)=>e+t.length,0)}function U(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function J(e){if(e)return function(e){for(var t in J.prototype)e[t]=J.prototype[t];return e}(e)}J.prototype.on=J.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},J.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},J.prototype.off=J.prototype.removeListener=J.prototype.removeAllListeners=J.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},J.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},J.prototype.emitReserved=J.prototype.emit,J.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},J.prototype.hasListeners=function(e){return!!this.listeners(e).length};const q="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function G(e,...t){return t.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{})}const L=q.setTimeout,Y=q.clearTimeout;function H(e,t){t.useNativeTimers?(e.setTimeoutFn=L.bind(q),e.clearTimeoutFn=Y.bind(q)):(e.setTimeoutFn=q.setTimeout.bind(q),e.clearTimeoutFn=q.clearTimeout.bind(q))}function z(e){return"string"==typeof e?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}(e):Math.ceil(1.33*(e.byteLength||e.size))}class F extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class K extends J{constructor(e){super(),this.writable=!1,H(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new F(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=D(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return-1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){const t=function(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}(e);return t.length?"?"+t:""}}const W="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Q={};let Z,$=0,X=0;function ee(e){let t="";do{t=W[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function te(){const e=ee(+new Date);return e!==Z?($=0,Z=e):e+"."+ee($++)}for(;X<64;X++)Q[W[X]]=X;let ne=!1;try{ne="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}const re=ne;function se(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||re))return new XMLHttpRequest}catch(e){}if(!t)try{return new(q[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}function oe(){}const ie=null!=new se({xdomain:!1}).responseType;class ae extends J{constructor(e,t){super(),H(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.data=void 0!==t.data?t.data:null,this.create()}create(){var e;const t=G(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd;const n=this.xhr=new se(t);try{n.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&n.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(e){}if("POST"===this.method)try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{n.setRequestHeader("Accept","*/*")}catch(e){}null===(e=this.opts.cookieJar)||void 0===e||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{var e;3===n.readyState&&(null===(e=this.opts.cookieJar)||void 0===e||e.parseCookies(n)),4===n.readyState&&(200===n.status||1223===n.status?this.onLoad():this.setTimeoutFn(()=>{this.onError("number"==typeof n.status?n.status:0)},0))},n.send(this.data)}catch(e){return void this.setTimeoutFn(()=>{this.onError(e)},0)}"undefined"!=typeof document&&(this.index=ae.requestsCount++,ae.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=oe,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete ae.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(ae.requestsCount=0,ae.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",ce);else if("function"==typeof addEventListener){addEventListener("onpagehide"in q?"pagehide":"unload",ce,!1)}function ce(){for(let e in ae.requests)ae.requests.hasOwnProperty(e)&&ae.requests[e].abort()}const de="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),ue=q.WebSocket||q.MozWebSocket,le="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const pe={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=le?{}:G(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=le?new ue(e,t,n):t?new ue(e,t):new ue(e)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,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;P(n,this.supportsBinary,e=>{try{this.ws.send(e)}catch(e){}r&&de(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=te()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}check(){return!!ue}},webtransport:class extends K{get name(){return"webtransport"}doOpen(){"function"==typeof WebTransport&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(e=>{const t=function(e,t){M||(M=new TextDecoder);const n=[];let r=0,s=-1,o=!1;return new TransformStream({transform(i,a){for(n.push(i);;){if(0===r){if(B(n)<1)break;const e=U(n,1);o=!(128&~e[0]),s=127&e[0],r=s<126?3:126===s?1:2}else if(1===r){if(B(n)<2)break;const e=U(n,2);s=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(2===r){if(B(n)<8)break;const e=U(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),o=t.getUint32(0);if(o>Math.pow(2,21)-1){a.enqueue(I);break}s=o*Math.pow(2,32)+t.getUint32(4),r=3}else{if(B(n)<s)break;const e=U(n,s);a.enqueue(D(o?e:M.decode(e),t)),r=0}if(0===s||s>e){a.enqueue(I);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=V();r.readable.pipeTo(e.writable),this.writer=r.writable.getWriter();const s=()=>{n.read().then(({done:e,value:t})=>{e||(this.onPacket(t),s())}).catch(e=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;this.writer.write(n).then(()=>{r&&de(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;null===(e=this.transport)||void 0===e||e.close()}},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}const t=e&&e.forceBase64;this.supportsBinary=ie&&!t,this.opts.withCredentials&&(this.cookieJar=void 0)}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(N),r=[];for(let e=0;e<n.length;e++){const s=D(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)=>{P(e,!1,e=>{r[o]=e,++s===n&&t(r.join(N))})})})(e,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=te()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new ae(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}}},he=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,fe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function me(e){if(e.length>2e3)throw"URI too long";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=he.exec(e||""),o={},i=14;for(;i--;)o[fe[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 ye extends J{constructor(e,t={}){super(),this.binaryType="arraybuffer",this.writeBuffer=[],e&&"object"==typeof e&&(t=e,e=null),e?(e=me(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=me(t.host).host),H(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","webtransport"],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:!1},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,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new pe[e](n)}open(){let e;if(this.opts.rememberUpgrade&&ye.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;ye.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;ye.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),-1!==this.upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onOpen(){if(this.readyState="open",ye.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"),this.resetPingTimeout(),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":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 t=0;t<this.writeBuffer.length;t++){const n=this.writeBuffer[t].data;if(n&&(e+=z(n)),t>0&&e>this.maxPayload)return this.writeBuffer.slice(0,t);e+=2}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){ye.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}}ye.protocol=4;ye.protocol;const ge="function"==typeof ArrayBuffer,be=Object.prototype.toString,Oe="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===be.call(Blob),we="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===be.call(File);function Ie(e){return ge&&(e instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||Oe&&e instanceof Blob||we&&e instanceof File}function ve(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(ve(e[t]))return!0;return!1}if(Ie(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return ve(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&ve(e[t]))return!0;return!1}function Se(e){const t=[],n=e.data,r=e;return r.data=ke(n,t),r.attachments=t.length,{packet:r,buffers:t}}function ke(e,t){if(!e)return e;if(Ie(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]=ke(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]=ke(e[r],t));return n}return e}function Pe(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 Te=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],_e=5;var Ce;!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"}(Ce||(Ce={}));class je{constructor(e){this.replacer=e}encode(e){return e.type!==Ce.EVENT&&e.type!==Ce.ACK||!ve(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===Ce.EVENT?Ce.BINARY_EVENT:Ce.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==Ce.BINARY_EVENT&&e.type!==Ce.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 Ee(e){return"[object Object]"===Object.prototype.toString.call(e)}class De extends J{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===Ce.BINARY_EVENT;n||t.type===Ce.BINARY_ACK?(t.type=n?Ce.EVENT:Ce.ACK,this.reconstructor=new xe(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!Ie(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===Ce[n.type])throw new Error("unknown packet type "+n.type);if(n.type===Ce.BINARY_EVENT||n.type===Ce.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(!De.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 Ce.CONNECT:return Ee(t);case Ce.DISCONNECT:return void 0===t;case Ce.CONNECT_ERROR:return"string"==typeof t||Ee(t);case Ce.EVENT:case Ce.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===Te.indexOf(t[0]));case Ce.ACK:case Ce.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class xe{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=Pe(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Re(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Ne=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ve extends J{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=[Re(e,"open",this.onopen.bind(this)),Re(e,"packet",this.onpacket.bind(this)),Re(e,"error",this.onerror.bind(this)),Re(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(Ne.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:Ce.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:Ce.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 Ce.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 Ce.EVENT:case Ce.BINARY_EVENT:this.onevent(e);break;case Ce.ACK:case Ce.BINARY_ACK:this.onack(e);break;case Ce.DISCONNECT:this.ondisconnect();break;case Ce.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:Ce.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:Ce.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 Me(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}Me.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)},Me.prototype.reset=function(){this.attempts=0},Me.prototype.setMin=function(e){this.ms=e},Me.prototype.setMax=function(e){this.max=e},Me.prototype.setJitter=function(e){this.jitter=e};class Be extends J{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,H(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 Me({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 ye(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=Re(t,"open",function(){n.onopen(),e&&e()}),s=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},o=Re(t,"error",s);if(!1!==this._timeout){const e=this._timeout,n=this.setTimeoutFn(()=>{r(),s(new Error("timeout")),t.close()},e);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Re(e,"ping",this.onping.bind(this)),Re(e,"data",this.ondata.bind(this)),Re(e,"error",this.onerror.bind(this)),Re(e,"close",this.onclose.bind(this)),Re(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){de(()=>{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 Ve(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(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Ue={};function Je(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=me(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=Ue[s]&&o in Ue[s].nsps;let a;return t.forceNew||t["force new connection"]||!1===t.multiplex||i?a=new Be(r,t):(Ue[s]||(Ue[s]=new Be(r,t)),a=Ue[s]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}Object.assign(Je,{Manager:Be,Socket:Ve,io:Je,connect:Je});var qe=__webpack_require__(835);class Ge extends i{type;socketId;data;static DESCRIPTOR_NAME="ChannelMessage";static DESCRIPTOR={fields:{type:{type:"uint32",id:1},socketId:{type:"string",id:2},data:{type:"bytes",id:3}}};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 Ge(e.type,e.socketId,e.data)}}const Le=class extends((0,n.EmitterMixin)()){_channelName;_wsGateway;_socket;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=l.decode(e,Ge);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)})}};class Ye extends Error{context;code;data;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 He extends Error{code;traceId;data;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)}}class ze extends i{flags;rooms;except;static TYPE=11;static DESCRIPTOR_NAME="PacketOptionsMessage";static DESCRIPTOR={fields:{flags:{type:"string",id:1},rooms:{type:"string",id:2,rule:"repeated"},except:{type:"string",id:3,rule:"repeated"}}};constructor(e,t=[],n=[]){super(),this.flags=e,this.rooms=t,this.except=n}toJSON(){return{flags:this.flags?JSON.stringify(this.flags):void 0,rooms:this.rooms?.length?this.rooms:void 0,except:this.except?.length?this.except:void 0}}static fromJSON(e){return new ze(e.flags&&JSON.parse(e.flags),e.rooms,e.except)}}const Fe=(()=>!("undefined"==typeof process||!process.versions?.node))(),Ke=1,We=2,Qe=3,Ze=4;class $e{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($e.isBuffer(e))return Ke;const t=typeof e;return"string"===t?We:"number"===t?Qe:Ze}static isBuffer(e){return Fe&&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 Xe extends i{data;data1;static create(e,t){throw new TypeError("Must be implemented in a child class!")}}class et extends Xe{data;data1;static TYPE=(()=>$e.getPacketType(Qe,Ke))();static DESCRIPTOR_NAME="NumberBytesPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"bytes",id:2}}};constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new et(e.data,e.data1)}static create(e,t){return new et(e,t)}}class tt extends Xe{data;data1;static TYPE=(()=>$e.getPacketType(We,Ke))();static DESCRIPTOR_NAME="StringBytesPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new tt(e.data,e.data1)}static create(e,t){return new tt(e,t)}}class nt extends Xe{data;data1;static TYPE=(()=>$e.getPacketType(Ke,Ke))();static DESCRIPTOR_NAME="BytesBytesPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"bytes",id:1},data1:{type:"bytes",id:2}}};constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new nt(e.data,e.data1)}static create(e,t){return new nt(e,t)}}class rt extends Xe{data;data1;static TYPE=(()=>$e.getPacketType(We,Ze))();static DESCRIPTOR_NAME="StringObjectPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};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 rt(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new rt(e,t)}}class st extends Xe{data;data1;static TYPE=(()=>$e.getPacketType(Qe,Ze))();static DESCRIPTOR_NAME="NumberObjectPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};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 st(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new st(e,t)}}class ot extends Xe{data;data1;static TYPE=(()=>$e.getPacketType(Ze,Ze))();static DESCRIPTOR_NAME="ObjectObjectPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};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 ot(e.data&&JSON.parse(e.data),e.data1&&JSON.parse(e.data1))}static create(e,t){return new ot(e,t)}}class it extends Xe{data;data1;static TYPE=(()=>$e.getPacketType(Ze,Ke))();static DESCRIPTOR_NAME="ObjectBufferPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};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)}}class at extends Xe{data;data1;static TYPE=(()=>$e.getPacketType(We,We))();static DESCRIPTOR_NAME="StringStringPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};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)}}class ct extends Xe{data;data1;static TYPE=(()=>$e.getPacketType(We,Qe))();static DESCRIPTOR_NAME="StringNumberPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"uint32",id:2}}};constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new ct(e.data,e.data1)}static create(e,t){return new ct(e,t)}}class dt extends Xe{data;data1;static TYPE=(()=>$e.getPacketType(Qe,Qe))();static DESCRIPTOR_NAME="NumberNumberPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"uint32",id:2}}};constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new dt(e.data,e.data1)}static create(e,t){return new dt(e,t)}}class ut extends Xe{data;data1;static TYPE=(()=>$e.getPacketType(Qe,We))();static DESCRIPTOR_NAME="NumberStringPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new ut(e.data,e.data1)}static create(e,t){return new ut(e,t)}}const lt=(()=>[et,tt,nt,rt,st,ot,it,at,ct,dt,ut].reduce((e,t)=>(e[t.TYPE]=t,e),{}))();class pt extends i{type;data;id;nsp;options;static TYPE=10;static DESCRIPTOR_NAME="PacketMessage";static 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}}};constructor(e,t,n,r="/",s){super(),this.type=e,this.data=t,this.id=n,this.nsp=r,this.options=s??new ze}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=l.encode(this.options),t=l.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 pt(e.type-10*t,l.decode(e.data,lt[t]),e.id,e.nsp,e.options?l.decode(e.options,ze):new ze)}static create(e,t={}){const n=$e.getPacketType($e.getType(e.data[0]),$e.getType(e.data[1]??e.data[0]));return new pt(e.type,lt[n].create(e.data[0],e.data[1]),e.id,e.nsp,new ze(t.flags,t.rooms,t.except))}}class ht{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 l.encode(pt.create(o,s))}decode(e){const t=l.decode(e,pt);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 ft=(()=>[Ce.EVENT,Ce.ACK,Ce.BINARY_ACK,Ce.BINARY_EVENT])();class mt extends je{_packetParser;constructor(e){super(),this._packetParser=e??new ht}encode(e){if(ft.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 yt extends De{_packetParser;constructor(e){super(),this._packetParser=e??new ht}add(e){if(!$e.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 gt{_context;_deferredPromise=function(){let e,t;const n=new Promise((n,r)=>{e=n,t=r});return{resolve:e,reject:t,promise:n}}();timeout;constructor(e,t){this._context=e,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 bt{_context;_requests=new Set;constructor(e){this._context=e}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 gt(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++))}}const Ot={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"};class wt extends((0,n.ObservableMixin)()){_requestsManager;_url;_socket;_socketAuth;_channels;_connectionAttempt=0;_token;_options;_connectionProvider;_userFactory;static STATE_DISCONNECTED=(()=>Ot.DISCONNECTED)();static STATE_CONNECTING=(()=>Ot.CONNECTING)();static STATE_CONNECTED=(()=>Ot.CONNECTED)();static _CHANGE_STATE_EVENT_PRIORITY=(()=>n.priorities.get("highest")+999999)();constructor(e,t,n,r,s){if(super(),this._token=t,this._options=n??{},this._connectionProvider=r??Je,this._userFactory=s??b.get,this._requestsManager=new bt(this),this._channels=new Map,!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=qe(e.replace(/^(?!(?:\w+:)?\/\/)/,"https://")),this.set("state",Ot.DISCONNECTED),this.set("socketId",void 0),this.set("me",void 0),this.on("change:state",async(e,t,n)=>{if(this._debugEvent("ws-gw:change:state",n),n!==wt.STATE_CONNECTED){if(n===wt.STATE_DISCONNECTED)return this._requestsManager.errorAll(new Ye("Not connected.",this))}else try{this.me=await this._userFactory.call(b,this,this._socketAuth?.userId)}catch(e){}},{priority:wt._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(){this.state!==Ot.DISCONNECTED&&(this._socket?.disconnect(),this._socket=void 0,this.state=Ot.DISCONNECTED)}async reconnect(){this._socket||this.state!==Ot.DISCONNECTED||(await this._token.refreshToken(),await this._connect())}static async connect(e,t="local.cs.dev:443/ws-v2",n={},r=Je,s=b.get){const o=new wt(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!==wt.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 Le(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(){if(this._socket)return this._socket;const e=this._url.port||this._getPortByProtocol(this._url.protocol),t=(this._url.protocol||"https:")+"//"+this._url.hostname+":"+e,n=this._url.pathname.match(/^\/.*\/ws/)?this._url.pathname.split("/ws")[0]:"",r=this._connectionProvider(t,{parser:{Encoder:mt,Decoder:yt},path:n+"/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:"53.0.0"},agent:this._options.agent??!1,closeOnBeforeunload:!1});return this.state=Ot.CONNECTING,r.on("connect",()=>{this._debugEvent("connect"),this.socketId=r.id}),r.on("connect_error",e=>{this._debugEvent("connect_error",e)}),r.on("disconnect",()=>{this._debugEvent("disconnect"),this._onDisconnect()}),r.io.on("reconnect",async()=>{this._debugEvent("reconnect"),await this._onReconnect()}),r.io.on("reconnect_attempt",e=>{this._debugEvent("reconnect_attempt",e),this.state=Ot.CONNECTING,this._connectionAttempt=e}),r.on("unauthorized",e=>{this._debugEvent("unauthorized"),this._onUnauthorized(e)}),r.on("authenticationRequest",async e=>{this._debugEvent("authenticationRequest",e.attempt),await this._onReconnect()}),this._socket=r,r}_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=Ot.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=Ot.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",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(){return!!n.global.window.localStorage&&"true"===(n.global.window.localStorage.getItem("csClientDebugMode")??"false").toLowerCase()}}const It=wt;class vt extends i{bundleVersion;static TYPE="131";static READABLE_TYPE_NAME="isEditorBundleUploaded";static DESCRIPTOR_NAME="IsEditorBundleUploadedMessage";static DESCRIPTOR={fields:{bundleVersion:{type:"string",id:1}}};constructor(e){super(),this.bundleVersion=e}toJSON(){return{bundleVersion:this.bundleVersion}}static fromJSON(e){return new vt(e.bundleVersion)}}class St extends i{isUploaded;static DESCRIPTOR_NAME="IsEditorBundleUploadedResponse";static DESCRIPTOR={fields:{isUploaded:{type:"bool",id:1}}};constructor(e){super(),this.isUploaded=e}toJSON(){return{isUploaded:this.isUploaded}}static fromJSON(e){return new St(e.isUploaded)}}class kt extends((0,n.EmitterMixin)()){static _SERVICE=13;static async isBundleUploaded(e,t){const n=new vt(t);if(e.state!==Ot.CONNECTED)throw new Ye("WebSocket Gateway is not connected.",e);const r=await e._sendRequest(kt._SERVICE,vt.TYPE,l.encode(n));return l.decode(r,St).isUploaded}}const Pt=kt;class At extends i{documentId;revisionId;static TYPE="123";static READABLE_TYPE_NAME="getRevision";static DESCRIPTOR_NAME="RevisionHistoryGetRevisionMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1},revisionId:{type:"string",id:2}}};constructor(e,t){super(),this.documentId=e,this.revisionId=t}toJSON(){return{documentId:this.documentId,revisionId:this.revisionId}}static fromJSON(e){return new At(e.documentId,e.revisionId)}}class Tt extends o{static DESCRIPTOR_NAME="RevisionDescriptor";static 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}}};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){return{revisionId:e.revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.stringify(e.authorsIds):void 0,diffData:e.diffData,createdAt:e.createdAt?.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})}}class _t extends i{revisionId;name;creatorId;authorsIds;createdAt;diffData;attributes;fromVersion;toVersion;isEmptyCurrent;static DESCRIPTOR_NAME="RevisionHistoryGetRevisionResponse";static DESCRIPTOR=(()=>Tt.DESCRIPTOR)();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 Tt.toJSON(this)}toObject(){return Tt.toObject(this)}static create(e){return new _t(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 _t(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)}}class Ct extends i{documentId;requestId;revisions;static TYPE="124";static READABLE_TYPE_NAME="updateRevisions";static DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};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(Tt.toJSON)}}toObject(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(Tt.toObject)}}static create(e){return new Ct(e.documentId,e.requestId,e.revisions.map(Tt.create))}static fromJSON(e){return new Ct(e.documentId,e.requestId,e.revisions.map(Tt.fromJSON))}}class jt extends i{requestId;static DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsResponse";static DESCRIPTOR={fields:{requestId:{type:"uint32",id:1}}};constructor(e){super(),this.requestId=e}toJSON(){return{requestId:this.requestId}}static fromJSON(e){return new jt(e.requestId)}}class Et extends i{documentId;static TYPE="121";static READABLE_TYPE_NAME="connectToRevisionHistory";static DESCRIPTOR_NAME="RevisionHistoryConnectMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Et(e.documentId)}}class Dt extends i{channel;requestId;revisions;static DESCRIPTOR_NAME="RevisionHistoryConnectResponse";static DESCRIPTOR={fields:{channel:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};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(Tt.toJSON)}}toObject(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(Tt.toObject)}}static fromJSON(e){return new Dt(e.channel,e.requestId,e.revisions.map(Tt.fromJSON))}}class xt extends i{documentId;requestId;static TYPE="122";static READABLE_TYPE_NAME="reconnectToRevisionHistory";static DESCRIPTOR_NAME="RevisionHistoryReconnectMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2}}};constructor(e,t){super(),this.documentId=e,this.requestId=t}toJSON(){return{documentId:this.documentId,requestId:this.requestId}}static fromJSON(e){return new xt(e.documentId,e.requestId)}}class Rt extends Ye{constructor(e,t){super(e+" Service is not connected.",t)}}class Nt extends((0,n.EmitterMixin)()){_documentId;_isConnected=!1;_wsGateway;_channel;static _SERVICE=12;constructor(e){super(),this._documentId=e}get isConnected(){return this._isConnected}connect(e){return this._isConnected?Promise.resolve():this._connect(e,new Et(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 xt(this._documentId,t))}async updateRevisions(e,t){const n=Ct.create({documentId:this._documentId,requestId:t,revisions:e}),r=await this._sendRequest(Ct.TYPE,n),{requestId:s}=l.decode(r,jt);return s}async getRevision(e){const t=new At(this._documentId,e),n=await this._sendRequest(At.TYPE,t);return l.decode(n,_t).toObject()}async _connect(e,t){if(e.state!==Ot.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,l.encode(t)),{channel:r,requestId:s,revisions:o}=l.decode(n,Dt).toObject();return this.listenTo(e,"change:state",(e,t,n)=>this._onWsGatewayStateChange(n),{priority:It._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(Nt._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(Ct.TYPE),(e,t)=>{const{documentId:n,requestId:r,revisions:s}=l.decode(t,Ct).toObject();this.fire("revisionsUpdated",{documentId:n,requestId:r,revisionsData:s})})}_onWsGatewayStateChange(e){e===Ot.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new Rt("Revision History",this);return this._wsGateway._sendRequest(12,e,l.encode(t))}}const Vt=Nt;class Mt extends i{id;documentId;type;data;originalSuggestionId;attributes;static TYPE="101";static READABLE_TYPE_NAME="addSuggestion";static DESCRIPTOR_NAME="TrackChangesAddSuggestionMessage";static 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}}};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){return new Mt(e.id,e.documentId,e.type,JSON.parse(e.data),e.originalSuggestionId??null,e.attributes?JSON.parse(e.attributes):null)}}class Bt extends i{id;authorId;type;hasComments;state;data;attributes;createdAt;static DESCRIPTOR_NAME="TrackChangesAddSuggestionResponse";static 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}}};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(){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 Bt(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}class Ut extends i{id;documentId;static TYPE="103";static READABLE_TYPE_NAME="getSuggestion";static DESCRIPTOR_NAME="TrackChangesGetSuggestionMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2}}};constructor(e,t){super(),this.id=e,this.documentId=t}toJSON(){return{id:this.id,documentId:this.documentId}}static fromJSON(e){return new Ut(e.id,e.documentId)}}class Jt extends i{id;authorId;type;hasComments;state;data;attributes;createdAt;static DESCRIPTOR_NAME="TrackChangesGetSuggestionResponse";static 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}}};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 Jt(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}class qt extends i{documentId;static TYPE="102";static READABLE_TYPE_NAME="getAllSuggestions";static DESCRIPTOR_NAME="TrackChangesGetAllSuggestionMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new qt(e.documentId)}}class Gt extends o{static DESCRIPTOR_NAME="SuggestionDescriptor";static 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"}}};static toJSON(e){return{...e,data:e.data?JSON.stringify(e.data):e.data,attributes:e.attributes?JSON.stringify(e.attributes):e.attributes,createdAt:e.createdAt?.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}}}class Lt extends i{_suggestions;_suggestionsV2;suggestions;static DESCRIPTOR_NAME="TrackChangesGetAllSuggestionsResponse";static DESCRIPTOR={fields:{suggestions:{type:"string",rule:"repeated",id:1},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:2}}};constructor(e,t){super(),this._suggestions=e,this._suggestionsV2=t,this.suggestions=t?.length?t:e}toJSON(){return{suggestions:this._suggestions?.map(e=>JSON.stringify(e)),suggestionsV2:this._suggestionsV2?.map(Gt.toJSON)}}static fromJSON(e){return new Lt(e.suggestions?.map(Yt),e.suggestionsV2?.map(Gt.fromJSON))}}function Yt(e){const t=JSON.parse(e);return t.createdAt=t.createdAt?new Date(t.createdAt):void 0,t}class Ht extends i{id;documentId;hasComments;isHasCommentsModified;state;attributes;static TYPE="104";static READABLE_TYPE_NAME="updateSuggestion";static DESCRIPTOR_NAME="TrackChangesUpdateSuggestionMessage";static 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}}};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 Ht(e.id,e.documentId,e.hasComments,e.isHasCommentsModified,e.state,e.attributes?JSON.parse(e.attributes):null)}}class zt extends i{documentId;static TYPE="105";static READABLE_TYPE_NAME="connectToSuggestions";static DESCRIPTOR_NAME="TrackChangesConnectMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new zt(e.documentId)}}class Ft extends i{channel;_suggestions;_suggestionsV2;suggestions;static DESCRIPTOR_NAME="TrackChangesConnectResponse";static DESCRIPTOR={fields:{channel:{type:"string",id:1},suggestions:{type:"string",rule:"repeated",id:2},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:3}}};constructor(e,t,n){super(),this.channel=e,this._suggestions=t,this._suggestionsV2=n,this.suggestions=n?.length?n:t}toJSON(){return{channel:this.channel,suggestions:this._suggestions?.map(e=>JSON.stringify(e)),suggestionsV2:this._suggestionsV2?.map(Gt.toJSON)}}static fromJSON(e){return new Ft(e.channel,e.suggestions?.map(e=>JSON.parse(e)),e.suggestionsV2?.map(Gt.fromJSON))}}class Kt extends i{ids;documentId;state;static TYPE="106";static READABLE_TYPE_NAME="batchUpdateSuggestionsState";static DESCRIPTOR_NAME="TrackChangesBatchUpdateSuggestionsStateMessage";static DESCRIPTOR={fields:{ids:{type:"string",rule:"repeated",id:1},documentId:{type:"string",id:2},state:{type:"string",id:3}}};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 Kt(e.ids,e.documentId,e.state)}}class Wt extends((0,n.EmitterMixin)()){_documentId;_isConnected=!1;_wsGateway;_channel;static _SERVICE=10;constructor(e){super(),this._documentId=e}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==Ot.CONNECTED)throw new Ye("WebSocket Gateway is not connected.",e);const t=new zt(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(10,zt.TYPE,l.encode(t)),r=l.decode(n,Ft);return this.listenTo(e,"change:state",(e,t,n)=>this._onWsGatewayStateChange(n),{priority:It._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 Mt(e,this._documentId,t,n,r,s),i=await this._sendRequest(Mt.TYPE,o);return l.decode(i,Bt)}async get(e,t=1){const n=new Ut(e,this._documentId);try{const e=await this._sendRequest(Ut.TYPE,n);return l.decode(e,Jt)}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 qt(this._documentId),t=await this._sendRequest(qt.TYPE,e),{suggestions:n}=l.decode(t,Lt);return n}async update(e,t={}){const{hasComments:n,state:r,attributes:s}=t,o=void 0!==n,i=new Ht(e,this._documentId,n,o,r,s);await this._sendRequest(Ht.TYPE,i)}async batchUpdateState(e){const t=new Kt(e.ids,this._documentId,e.state);await this._sendRequest(Kt.TYPE,t)}_connectToChannel(e,t){this._channel=e._getChannel(Wt._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(Ht.TYPE),(e,t)=>{const n=l.decode(t,Ht);this.fire("suggestionUpdated",n)})}_onWsGatewayStateChange(e){e===Ot.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new Rt("Track Changes",this);return this._wsGateway._sendRequest(10,e,l.encode(t))}}const Qt=Wt,Zt={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let $t;const Xt=new Uint8Array(16);function en(){if(!$t&&($t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!$t))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return $t(Xt)}const tn=[];for(let e=0;e<256;++e)tn.push((e+256).toString(16).slice(1));function nn(e,t=0){return tn[e[t+0]]+tn[e[t+1]]+tn[e[t+2]]+tn[e[t+3]]+"-"+tn[e[t+4]]+tn[e[t+5]]+"-"+tn[e[t+6]]+tn[e[t+7]]+"-"+tn[e[t+8]]+tn[e[t+9]]+"-"+tn[e[t+10]]+tn[e[t+11]]+tn[e[t+12]]+tn[e[t+13]]+tn[e[t+14]]+tn[e[t+15]]}const rn=function(e,t,n){if(Zt.randomUUID&&!t&&!e)return Zt.randomUUID();const r=(e=e||{}).random||(e.rng||en)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return nn(r)};class sn extends i{channel;sockets;static DESCRIPTOR_NAME="SessionsConnectResponse";static DESCRIPTOR={fields:{channel:{type:"string",id:1},sockets:{rule:"repeated",type:"SessionsSocketDescriptor",id:2}}};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 sn(e.channel,e.sockets.map(e=>({id:e.session,userId:e.user,role:e.role,permissions:e.permissions})))}}class on extends i{id;sessionType;static TYPE="31";static READABLE_TYPE_NAME="getConnectedSockets";static DESCRIPTOR_NAME="SessionsConnectMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1},sessionType:{type:"uint32",id:2}}};constructor(e,t){super(),this.id=e,this.sessionType=t}toJSON(){return{id:this.id,sessionType:this.sessionType}}static fromJSON(e){return new on(e.id,e.sessionType)}}class an extends i{id;userId;role;permissions;static TYPE="32";static READABLE_TYPE_NAME="connectSocket";static DESCRIPTOR_NAME="SocketConnectMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1},userId:{type:"string",id:2},role:{type:"string",id:3},permissions:{rule:"repeated",type:"string",id:4}}};constructor(e,t,n,r){super(),this.id=e,this.userId=t,this.role=n,this.permissions=r}toJSON(){return{id:this.id,userId:this.userId??void 0,role:this.role??void 0,permissions:this.permissions??void 0}}static fromJSON(e){return new an(e.id,e.userId,e.role,e.permissions)}}class cn extends i{id;static TYPE="33";static READABLE_TYPE_NAME="disconnectSocket";static DESCRIPTOR_NAME="SocketDisconnectMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1}}};constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new cn(e.id)}}const dn=class extends n.Collection{_id;_sessionType;_handlers=new Map;_channel;_wsGateway;_connected;_eventsQueue=[];_isRunning=!1;constructor(e,t){super({idProperty:"id"}),this._id=e,this._sessionType=t}async connect(e){this._wsGateway=e,this.stopListening(e,"change:state");const t=new on(this._id,this._sessionType);let n;try{const e=await this._wsGateway._sendRequest(3,on.TYPE,l.encode(t));n=l.decode(e,sn)}catch(e){n=new sn(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 b.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 b,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:It._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,an.TYPE,async t=>{const n=l.decode(t,an);if(-1===this.getIndex(n.id)){const t={id:n.id,role:n.role,permissions:n.permissions};n.userId&&(t.user=await b.get(e,n.userId)),super.add(t)}}),this._addHandler(this._channel,cn.TYPE,e=>{const t=l.decode(e,cn);-1!==this.getIndex(t.id)&&super.remove(t.id)}))}async _onWsGatewayStateChange(e){e===It.STATE_DISCONNECTED&&this.disconnect(!1),e===It.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)}};class un{static async getConnectedSessions(e,t,n){const r=new dn(t,n);return await r.connect(e),r}}class ln extends i{id;buffers;types;bundleVersion;lastOperationId;static TYPE="11";static READABLE_TYPE_NAME="connectToDocument";static DESCRIPTOR_NAME="CollaborativeEditingConnectMessage";static 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}}};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 ln(e.id,e.buffers,e.types,e.bundleVersion,e.lastOperationId)}}class pn{static prepareMetadataForOperations(e,t){if(!e?.length||!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?.length||!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 hn extends o{static DESCRIPTOR_NAME="OperationMetadataDescriptor";static DESCRIPTOR={fields:{userId:{type:"string",id:1},type:{type:"string",id:2},createdAt:{type:"string",id:3}}};static toJSON({createdAt:e,...t}){const n={...t};return e?.toISOString&&(n.createdAt=e.toISOString()),n}static fromJSON({createdAt:e,...t}){const n={...t};return e&&(n.createdAt=new Date(e)),n}}class fn extends i{id;buffers;types;baseVersion;metadata;lastOperationId;static TYPE="13";static READABLE_TYPE_NAME="updateDocument";static DESCRIPTOR_NAME="CollaborativeEditingUpdateMessage";static 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}}};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:pn.removeUnnecessaryMetadata(this.types,this.metadata).map(hn.toJSON),lastOperationId:this.lastOperationId}}static fromJSON(e){return new fn(e.id,e.buffers,e.types,e.baseVersion,pn.prepareMetadataForOperations(e.types,e.metadata).map(hn.fromJSON),e.lastOperationId)}}class mn extends i{id;lastKnowVersion;bundleVersion;static TYPE="12";static READABLE_TYPE_NAME="reconnectToDocument";static DESCRIPTOR_NAME="CollaborativeEditingReconnectMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},lastKnowVersion:{type:"uint32",id:3}}};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 mn(e.id,e.lastKnowVersion,e.bundleVersion)}}class yn extends i{version;buffers;types;metadata;lastOperationId;lastOperationAcceptedAt;static DESCRIPTOR_NAME="CollaborativeEditingResponse";static 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}}};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(){return!this.types?.length}toJSON(){return{version:this.version,buffers:this.buffers,types:this.types,metadata:pn.removeUnnecessaryMetadata(this.types,this.metadata).map(hn.toJSON),lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt instanceof Date?this.lastOperationAcceptedAt.toISOString():this.lastOperationAcceptedAt}}static fromJSON(e){return new yn(e.version,e.buffers,e.types,pn.prepareMetadataForOperations(e.types,e.metadata).map(hn.fromJSON),e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}static create(e){return new yn(e.version,e.buffers,e.types,e.metadata,e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}}class gn extends i{channel;version;buffers;types;offset;metadata;initData;sessionId;lastOperationId;sessionCreatedAt;static DESCRIPTOR_NAME="CollaborativeEditingConnectResponse";static 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:hn.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}}}))();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(){return!this.types?.length&&null===this.initData}toJSON(){return{channel:this.channel,version:this.version,sessionId:this.sessionId,buffers:this.buffers,types:this.types,offset:this.offset,metadata:pn.removeUnnecessaryMetadata(this.types,this.metadata).map(hn.toJSON),initData:this.initData??"",isInitialized:"string"==typeof this.initData,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt?this.sessionCreatedAt.toISOString():null}}static create(e){return new gn(e.channel,e.version,e.buffers,e.types,e.offset,e.metadata,e.initData,e.sessionId,e.lastOperationId,e.sessionCreatedAt)}static fromJSON(e){let t=null;return!0===e.isInitialized?t=e.initData??"":"boolean"!=typeof e.isInitialized&&e.initData&&(t=e.initData),gn.create({channel:e.channel,version:e.version,buffers:e.buffers,types:e.types,offset:e.offset,metadata:pn.prepareMetadataForOperations(e.types,e.metadata).map(hn.fromJSON),initData:t,sessionId:e.sessionId,lastOperationId:e.lastOperationId,sessionCreatedAt:e.sessionCreatedAt?new Date(e.sessionCreatedAt):null})}}class bn extends i{lastDocumentSession;currentDocumentSession;static DESCRIPTOR_NAME="GetDocumentDetailsResponse";static 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}}};constructor(e,t){super(),this.lastDocumentSession=e,this.currentDocumentSession=t}get data(){return{lastDocumentSessionId:this.lastDocumentSession?.id,lastDocumentSessionOperationId:this.lastDocumentSession?.lastOperationId,currentDocumentSessionId:this.currentDocumentSession?.id,currentDocumentSessionVersion:this.currentDocumentSession?.version,currentDocumentSessionOperationId:this.currentDocumentSession?.lastOperationId}}toJSON(){return{lastDocumentSessionId:this.lastDocumentSession?.id,lastDocumentSessionOperationId:this.lastDocumentSession?.lastOperationId,currentDocumentSessionId:this.currentDocumentSession?.id,currentDocumentSessionVersion:this.currentDocumentSession?.version,currentDocumentSessionOperationId:this.currentDocumentSession?.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 bn(t,n)}}class On extends i{documentId;static TYPE="14";static READABLE_TYPE_NAME="getDocumentDetails";static DESCRIPTOR_NAME="GetDocumentDetailsMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1},environmentId:{type:"string",id:2}}};constructor(e){super(),this.documentId=e}get data(){return{documentId:this.documentId}}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new On(e.documentId)}}const wn=class extends((0,n.EmitterMixin)()){static _SERVICE=1;_bundleVersion;_id;_isConnected;_wsGateway;_channel;_connectedSessions;constructor(e,t){if(super(),!e)throw new TypeError('Param "bundleVersion" must be provided.');this._id=t??rn(),this._isConnected=!1,this._bundleVersion=e}getId(){return this._id}isConnected(){return this._isConnected}connect(e,t={buffers:[],types:[]},n){const r=new ln(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 mn(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 On(this.getId());if(!this._wsGateway)throw new Rt("Collaborative Editing",this);const t=await this._wsGateway._sendRequest(1,On.TYPE,l.encode(e));return l.decode(t,bn)}async sendOperations(e,t,n){if(!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 fn(this.getId(),e.buffers,e.types,r,[],n);if(!this._wsGateway||!this._isConnected)throw new Rt("Collaborative Editing",this);const o=await this._wsGateway._sendRequest(1,fn.TYPE,l.encode(s));return l.decode(o,yn)}async getConnectedSessions(){if(!this._isConnected)throw new Rt("Collaborative Editing",this);return this._connectedSessions||(this._connectedSessions=await un.getConnectedSessions(this._wsGateway,this._id,1)),this._connectedSessions}static getConnectedSessions(e,t){return un.getConnectedSessions(e,t,1)}async _connect(e,t){if(this.isConnected())return;if(e.state!==It.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,l.encode(t)),r=l.decode(n,gn);return this.listenTo(e,"change:state",(e,t,n)=>this._onWsGatewayStateChange(n),{priority:It._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(fn.TYPE),(e,t)=>{const n=l.decode(t,fn);this.fire("operationsReceived",n.baseVersion,n.data,n.metadata)})}_onWsGatewayStateChange(e){e===It.STATE_DISCONNECTED&&this.disconnect()}};class In extends o{static DESCRIPTOR_NAME="CommentDescriptor";static 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"}}};static toJSON(e){return{...e,createdAt:e.createdAt?.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}}}class vn extends o{static DESCRIPTOR_NAME="CommentsThreadDescriptor";static 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}}};static toJSON(e){return{...e,createdAt:e.createdAt?.toISOString(),deletedAt:e.deletedAt?.toISOString(),resolvedAt:e.resolvedAt?.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null,context:e.context?JSON.stringify(e.context):e.context,comments:e.comments?.map(In.toJSON),unlinkedAt:e.unlinkedAt?.toISOString()}}static fromJSON(e){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:e.comments?.map(In.fromJSON),unlinkedAt:e.unlinkedAt?new Date(e.unlinkedAt):void 0}}}class Sn extends i{documentId;commentThreadId;content;commentId;userId;attributes;commentThread;createdAt;static TYPE="91";static READABLE_TYPE_NAME="addComment";static DESCRIPTOR_NAME="CommentsV2AddCommentMessage";static 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}}};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?vn.toJSON(this.commentThread):void 0}}static fromJSON(e){return new Sn(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?vn.fromJSON(e.commentThread):void 0)}}class kn extends i{commentThreadId;commentId;createdAt;static DESCRIPTOR_NAME="CommentsV2AddCommentResponse";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},createdAt:{type:"string",id:3}}};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 kn(e.commentThreadId,e.commentId,e.createdAt)}}class Pn extends i{documentId;static TYPE="92";static READABLE_TYPE_NAME="connectToComment";static DESCRIPTOR_NAME="CommentsV2ConnectMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Pn(e.documentId)}}class An extends i{channel;_threads;_threadsV2;threads;static DESCRIPTOR_NAME="CommentsV2ConnectResponse";static DESCRIPTOR={fields:{channel:{type:"string",id:1},threads:{type:"string",rule:"repeated",id:2},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:3}}};constructor(e,t,n){super(),this.channel=e,this._threads=t,this._threadsV2=n,this.threads=n?.length?n:t}toJSON(){return{channel:this.channel,threads:this._threads?.map(e=>JSON.stringify(e)),threadsV2:this._threadsV2?.map(vn.toJSON)}}static fromJSON(e){return new An(e.channel,e.threads?.map(e=>JSON.parse(e)),e.threadsV2?.map(vn.fromJSON))}}class Tn extends i{documentId;commentThreadId;commentId;static TYPE="95";static READABLE_TYPE_NAME="removeComment";static DESCRIPTOR_NAME="CommentsV2RemoveCommentMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},documentId:{type:"string",id:3}}};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 Tn(e.documentId,e.commentThreadId,e.commentId)}}class _n extends i{documentId;commentThreadId;static TYPE="97";static READABLE_TYPE_NAME="removeCommentThread";static DESCRIPTOR_NAME="CommentsV2RemoveCommentThreadMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};constructor(e,t){super(),this.documentId=e,this.commentThreadId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new _n(e.documentId,e.commentThreadId)}}class Cn extends i{documentId;commentThreadId;commentId;content;attributes;isAttributesUpdated;commentThread;static TYPE="96";static READABLE_TYPE_NAME="updateComment";static DESCRIPTOR_NAME="CommentsV2UpdateCommentMessage";static 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}}};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?vn.toJSON(this.commentThread):void 0}}static fromJSON(e){return new Cn(e.documentId,e.commentThreadId,e.commentId,e.content,e.attributes?JSON.parse(e.attributes):null,e.isAttributesUpdated,e.commentThread?vn.fromJSON(e.commentThread):void 0)}}class jn extends i{commentThreadId;documentId;static TYPE="93";static READABLE_TYPE_NAME="getComment";static DESCRIPTOR_NAME="CommentsV2GetCommentThreadMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId}}static fromJSON(e){return new jn(e.commentThreadId,e.documentId)}}class En extends i{commentThreadId;_comments;_commentsV2;resolvedBy;comments;createdAt;deletedAt;resolvedAt;attributes;context;unlinkedAt;static DESCRIPTOR_NAME="CommentsV2GetCommentThreadResponse";static 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}}};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=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(){return{commentThreadId:this.commentThreadId,comments:this._comments?.map(e=>JSON.stringify(e)),commentsV2:this._commentsV2?.map(In.toJSON),attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,context:this.context?JSON.stringify(this.context):this.context,resolvedBy:this.resolvedBy,createdAt:this.createdAt?.toISOString(),deletedAt:this.deletedAt?.toISOString(),resolvedAt:this.resolvedAt?.toISOString(),unlinkedAt:this.unlinkedAt?.toISOString()}}static fromJSON(e){return new En(e.commentThreadId,e.comments?.map(e=>function(e){const t=JSON.parse(e);return{...t,createdAt:new Date(t.createdAt)}}(e)),e.commentsV2?.map(In.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)}}class Dn extends i{documentId;static TYPE="94";static READABLE_TYPE_NAME="getDocumentThreads";static DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Dn(e.documentId)}}class xn extends i{_threads;_threadsV2;threads;static DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsResponse";static DESCRIPTOR={fields:{threads:{type:"string",rule:"repeated",id:1},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:2}}};constructor(e,t){super(),this._threads=e,this._threadsV2=t,this.threads=t?.length?t:e}toJSON(){return{threads:this._threads?.map(e=>JSON.stringify(e)),threadsV2:this._threadsV2?.map(vn.toJSON)}}static fromJSON(e){return new xn(e.threads?.map(e=>function(e){const t=JSON.parse(e),n={...t};return t.comments&&(n.comments=t.comments?.map(e=>({...e,createdAt:new Date(e.createdAt)}))),n}(e)),e.threadsV2?.map(vn.fromJSON))}}class Rn extends o{static DESCRIPTOR_NAME="CommentThreadAddedCommentDescriptor";static DESCRIPTOR={fields:{commentId:{id:1,type:"string"},createdAt:{id:2,type:"string"}}};static toJSON(e){return{commentId:e.commentId,createdAt:e.createdAt?.toISOString()}}static fromJSON(e){return{commentId:e.commentId,createdAt:new Date(e.createdAt)}}}class Nn extends i{commentThreadId;comments;createdAt;static DESCRIPTOR_NAME="CommentsV2AddCommentThreadResponse";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},createdAt:{type:"string",id:2},comments:{type:"CommentThreadAddedCommentDescriptor",rule:"repeated",id:3}}};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=>Rn.toJSON(e))}}static fromJSON(e){return new Nn(e.commentThreadId,e.createdAt,e.comments.map(e=>Rn.fromJSON(e)))}}class Vn extends i{documentId;commentThreadId;comments;context;resolvedBy;attributes;createdAt;resolvedAt;deletedAt;static TYPE="140";static READABLE_TYPE_NAME="addCommentThread";static DESCRIPTOR_NAME="CommentsV2AddCommentThreadMessage";static 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}}};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(){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:this.comments?.map(e=>In.toJSON(e))}}static fromJSON(e){return new Vn(e.documentId,e.commentThreadId,e.comments?.map(t=>In.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)}}class Mn extends i{commentThreadId;documentId;resolvedBy;resolvedAt;static TYPE="142";static READABLE_TYPE_NAME="resolveCommentThread";static DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedBy:{type:"string",id:3},resolvedAt:{type:"string",id:4}}};constructor(e,t,n,r){super(),this.commentThreadId=e,this.documentId=t,this.resolvedBy=n,this.resolvedAt=r?new Date(r):void 0}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt?.toISOString()}}static fromJSON(e){return new Mn(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}class Bn extends i{commentThreadId;documentId;static TYPE="141";static READABLE_TYPE_NAME="reopenCommentThread";static DESCRIPTOR_NAME="CommentsV2ReopenCommentThreadMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new Bn(e.commentThreadId,e.documentId)}}class Un extends i{commentThreadId;documentId;context;attributes;unlinkedAt;static TYPE="143";static READABLE_TYPE_NAME="updateCommentThread";static DESCRIPTOR_NAME="CommentsV2UpdateCommentThreadMessage";static 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}}};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 Un(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)}}class Jn extends i{commentThreadId;documentId;resolvedBy;resolvedAt;static DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadResponse";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4}}};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 Jn(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}class qn extends((0,n.EmitterMixin)()){_documentId;_isConnected=!1;_wsGateway;_channel;_connectedSessions;static _SERVICE=9;constructor(e){super(),this._documentId=e}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==Ot.CONNECTED)throw new Ye("WebSocket Gateway is not connected.",e);const t=new Pn(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(9,Pn.TYPE,l.encode(t)),{channel:r,threads:s}=l.decode(n,An);return this.listenTo(e,"change:state",(e,t,n)=>this._onWsGatewayStateChange(n),{priority:It._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 Sn(this._documentId,e,n,t,void 0,void 0,r),o=await this._sendRequest(Sn.TYPE,s);return l.decode(o,kn)}async updateComment(e,t,n,r){const s=void 0!==r,o=new Cn(this._documentId,e,t,n,r,s);await this._sendRequest(Cn.TYPE,o)}async removeComment(e,t){const n=new Tn(this._documentId,e,t);await this._sendRequest(Tn.TYPE,n)}async removeCommentThread(e){const t=new _n(this._documentId,e);await this._sendRequest(_n.TYPE,t)}async addCommentThread(e){const t=new Vn(this._documentId,e.commentThreadId,e.comments?.map(t=>({...t,documentId:this._documentId,commentThreadId:e.commentThreadId})),e.context,e.resolvedBy,e.createdAt,e.resolvedAt,e.deletedAt,e.attributes),n=await this._sendRequest(Vn.TYPE,t);return l.decode(n,Nn)}async resolveCommentThread(e){const t=new Mn(e,this._documentId),n=await this._sendRequest(Mn.TYPE,t);return l.decode(n,Jn)}async reopenCommentThread(e){const t=new Bn(e,this._documentId);await this._sendRequest(Bn.TYPE,t)}async updateCommentThread(e){const t=new Un(e.commentThreadId,this._documentId,e.context,e.attributes,e.unlinkedAt);await this._sendRequest(Un.TYPE,t)}async getCommentThread(e,t=1){const n=new jn(e,this._documentId);try{const e=await this._sendRequest(jn.TYPE,n),t=l.decode(e,En);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 Dn(this._documentId),t=await this._sendRequest(Dn.TYPE,e),{threads:n}=l.decode(t,xn);return{threads:n}}async getConnectedSessions(){if(!this._isConnected)throw new Rt("Comments",this);return this._connectedSessions||(this._connectedSessions=await un.getConnectedSessions(this._wsGateway,this._documentId,9)),this._connectedSessions}_connectToChannel(e,t){this._channel=e._getChannel(qn._SERVICE,t),this._channel&&(this.listenTo(this._channel,this._channel.getEventName(Sn.TYPE),(e,t)=>{const n=l.decode(t,Sn);this.fire("commentAdded",n)}),this.listenTo(this._channel,this._channel.getEventName(Tn.TYPE),(e,t)=>{const n=l.decode(t,Tn);this.fire("commentRemoved",n)}),this.listenTo(this._channel,this._channel.getEventName(Cn.TYPE),(e,t)=>{const n=l.decode(t,Cn);this.fire("commentUpdated",n)}),this.listenTo(this._channel,this._channel.getEventName(_n.TYPE),(e,t)=>{const n=l.decode(t,_n);this.fire("commentThreadRemoved",n)}),this.listenTo(this._channel,this._channel.getEventName(Vn.TYPE),(e,t)=>{const n=l.decode(t,Vn);this.fire("commentThreadAdded",n)}),this.listenTo(this._channel,this._channel.getEventName(Un.TYPE),(e,t)=>{const n=l.decode(t,Un);this.fire("commentThreadUpdated",n)}),this.listenTo(this._channel,this._channel.getEventName(Mn.TYPE),(e,t)=>{const n=l.decode(t,Mn);this.fire("commentThreadResolved",n)}),this.listenTo(this._channel,this._channel.getEventName(Bn.TYPE),(e,t)=>{const n=l.decode(t,Bn);this.fire("commentThreadReopened",n)}))}_onWsGatewayStateChange(e){e===Ot.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new Rt("Comments",this);return this._wsGateway._sendRequest(9,e,l.encode(t))}}const Gn=qn,Ln=zn;!function(e){const t=zn,n=e();for(;;)try{if(147639===parseInt(t(123))/1*(-parseInt(t(121))/2)+-parseInt(t(154))/3+parseInt(t(148))/4+parseInt(t(117))/5*(-parseInt(t(157))/6)+parseInt(t(188))/7+parseInt(t(118))/8+parseInt(t(167))/9)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Hn);class Yn extends t.ContextPlugin{static[Ln(186)]=(()=>It)();static[Ln(130)]=1e3;[Ln(120)];[Ln(180)];[Ln(139)];[Ln(183)];static get[Ln(181)](){return[Ln(144),r.Notification]}static get[Ln(162)](){return Ln(186)}static get[Ln(156)](){return!0}static get[Ln(170)](){return!0}constructor(e){const t=Ln;super(e),this[t(187)](t(146),Ot[t(135)]),this[t(187)](t(165),!1),this[t(180)]=new Set,this[t(139)]=!1,this[t(183)]=new((0,n.DomEmitterMixin)())}[Ln(174)](){const e=Ln,t=this[e(133)],s=t[e(127)][e(155)](e(144)),o=t[e(127)][e(155)](r.Notification);if(!s[e(175)])throw new n.CKEditorError(e(125),this);if(!s[e(160)])throw new n.CKEditorError(e(178),this);return this[e(183)][e(152)](window,e(119),()=>this[e(165)]=!0),this[e(183)][e(152)](window,e(161),()=>this[e(165)]=!1),this[e(133)][e(166)][e(179)](e(169),10),this[e(133)][e(166)][e(179)](e(126),20),Yn[e(186)][e(159)](s[e(175)],s[e(160)],{timeout:1e3*this[e(133)][e(166)][e(155)](e(169)),requestTimeout:1e3*this[e(133)][e(166)][e(155)](e(126))})[e(164)](t=>{const r=e;if(this[r(120)]=t,this[r(132)](r(146)).to(t,r(146),this,r(165),(e,t)=>(r(129)!==e&&(this[r(139)]=!0),t||e!==Ot[r(135)]?Ot[r(163)]:this[r(146)]==Ot[r(163)]&&this[r(139)]?(this[r(139)]=!1,this[r(158)](),Ot[r(150)]):Ot[r(135)])),this[r(120)].on(r(142),(e,t)=>{const s=r;if(s(185)!==t[s(128)])throw console[s(142)](t),new n.CKEditorError(s(122),null,{originalError:t});o[s(137)](s(168),{title:s(134),namespace:s(176)})}),!t.me)return new Promise(e=>t.on(r(145),e))})[e(151)](t=>{const r=e;throw console[r(142)](t),new n.CKEditorError(r(122),null,{originalError:t})})}[Ln(116)](e){const t=Ln;if(t(131)!=typeof e[t(143)])throw new n.CKEditorError(t(173),this);if(this[t(182)](e))throw new n.CKEditorError(t(172),this,{name:e[t(184)][t(162)]});this[t(180)][t(153)](e)}[Ln(136)](e){const t=Ln;this[t(180)][t(140)](e)}[Ln(182)](e){const t=Ln;return this[t(180)][t(171)](e)}[Ln(158)](){const e=Ln;return this[e(120)][e(143)]()[e(164)](()=>Promise[e(138)](Array[e(141)](this[e(180)],t=>t[e(143)]())))[e(164)](()=>this[e(146)]=Ot[e(135)])[e(151)](t=>{const r=e;throw console[r(142)](t),new n.CKEditorError(r(149),this[r(133)])})}[Ln(177)](){const e=Ln;this[e(120)]&&this[e(120)][e(177)](),this[e(146)]=Ot[e(163)],this[e(183)][e(147)]()}[Ln(124)](){const e=Ln;this[e(177)](),super[e(124)]()}}function Hn(){const e=["pluginName","DISCONNECTED","then","_isBrowserOffline","config","3416589ujMqCu","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.","cloudServices.connectionTimeout","isPremiumPlugin","has","websocketgateway-plugin-already-registered","websocketgateway-invalid-plugin-interface","init","token","real-time-collaboration","disconnect","websocketgateway-missing-websocket-url","define","_reconnectionStack","requires","isInReconnectionStack","_domEmitter","constructor","limitExceeded","WebSocketGateway","set","1543073iMLvJi","addToReconnectionStack","80ogKtQw","493112NJKVkT","offline","connection","98gBBrYt","cloudservices-init","5901lDmYqI","destroy","websocketgateway-missing-token","cloudServices.requestTimeout","plugins","code","connected","initialReconnectionInterval","function","bind","context","Connected users limit exceeded","CONNECTED","removeFromReconnectionStack","showWarning","all","_shouldPluginsReconnect","delete","from","error","reconnect","CloudServices","change:me","state","stopListening","588940YTgzvm","cloudservices-reconnection-error","CONNECTING","catch","listenTo","add","431430VFzZnf","get","isOfficialPlugin","85626HxGfHM","_reconnect","connect","webSocketUrl","online"];return(Hn=function(){return e})()}function zn(e,t){const n=Hn();return(zn=function(e,t){return n[e-=116]})(e,t)}var Fn=__webpack_require__(211);const Kn=Wn;function Wn(e,t){const n=Qn();return(Wn=function(e,t){return n[e-=406]})(e,t)}function Qn(){const e=["context","sessionId","getUserBySessionId","role","add","fire","getUserSessions","_handleSessionAdd","3744zXxQmL","allConnectedUsers","_uniqueUsersCount","set","register","49719dZylsf","sessionAdd:","sessions-register-already-registered","listenTo","channelSessions","size","isPremiumPlugin","pluginName","_handleSessionRemove","plugins","_createUser","Sessions","assign","has","init","_registeredSessions","get","_users","34017401fHiYEB","orderNumber","requires","sessions-unregister-not-exist","10oVxjOU","16qZkhaC","clear","4860SxorKb","user","addUser","6609981sOsQve","delete","getUser","isMe","remove","3051963hmPVgC","change:state","defineMe","stopListening","2888796dpsira","connection","channelConnectedUsers","isOfficialPlugin","connected","forEach","state","unregister","mySessionId","8LnsqDd","1449377YphruP","getUserRole","values"];return(Qn=function(){return e})()}!function(e){const t=Wn,n=e();for(;;)try{if(920634===-parseInt(t(407))/1+-parseInt(t(446))/2*(-parseInt(t(423))/3)+-parseInt(t(418))/4*(-parseInt(t(448))/5)+-parseInt(t(460))/6+-parseInt(t(451))/7*(parseInt(t(406))/8)+-parseInt(t(456))/9*(parseInt(t(445))/10)+parseInt(t(441))/11)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Qn);class Zn extends t.ContextPlugin{[Kn(427)];[Kn(462)];[Kn(419)];[Kn(438)];[Kn(420)];[Kn(440)];static get[Kn(430)](){return Kn(434)}static get[Kn(463)](){return!0}static get[Kn(429)](){return!0}static get[Kn(443)](){return[Yn,Fn.Users]}constructor(e){const t=Kn;super(e),this[t(427)]=new Map,this[t(462)]=new Map,this[t(419)]=new n.Collection,this[t(438)]=new Map,this[t(420)]=0,this[t(440)]=this[t(410)][t(432)][t(439)](Fn.Users)}[Kn(437)](){const e=Kn,t=this[e(410)][e(432)][e(439)](Yn);this[e(426)](t,e(457),(t,n,r)=>{const s=e;if(s(464)!==r)this[s(427)][s(465)](e=>e[s(447)]()),this[s(462)][s(465)](e=>e[s(447)]()),this[s(419)][s(447)]();else for(const[e,t]of this[s(438)])for(const n of t)this[s(417)](e,n)}),this[e(433)](t[e(461)].me,!0)}[Kn(422)](e,t){const r=Kn;if(this[r(438)][r(436)](e))throw new n.CKEditorError(r(425),null,{channelId:e});this[r(438)][r(421)](e,t),this[r(427)][r(421)](e,new n.Collection),this[r(462)][r(421)](e,new n.Collection),this[r(426)](t,r(414),(t,n)=>this[r(417)](e,n)),this[r(426)](t,r(455),(t,n)=>this[r(431)](e,n));for(const n of t)this[r(417)](e,n)}[Kn(467)](e){const t=Kn;if(!this[t(438)][t(436)](e))throw new n.CKEditorError(t(444),null,{channelId:e});const r=this[t(438)][t(439)](e);this[t(459)](r);for(const n of r)t(464)===this[t(410)][t(432)][t(439)](Yn)[t(466)]&&this[t(431)](e,n);this[t(438)][t(452)](e),this[t(427)][t(452)](e),this[t(462)][t(452)](e)}get[Kn(468)](){const e=Kn;return this[e(410)][e(432)][e(439)](Yn)[e(461)][e(411)]}[Kn(412)](e){const t=Kn;for(const n of this[t(427)][t(409)]())for(const r of n)if(r.id===e)return r[t(449)]}[Kn(416)](e,t){const n=Kn,r=t?[this[n(427)][n(439)](t)]:this[n(427)][n(409)](),s=new Set;for(const t of r)for(const r of t)r[n(449)].id===e.id&&s[n(414)](r.id);return s}[Kn(408)](e){const t=Kn;for(const n of this[t(427)][t(409)]())for(const r of n)if(r[t(449)]===e)return r[t(413)]}[Kn(417)](e,t){const n=Kn;if(n(464)!==this[n(410)][n(432)][n(439)](Yn)[n(466)])return;const r=t[n(449)],s=this[n(440)][n(453)](r.id)||this[n(433)](r),o=Object[n(435)]({},t,{user:s});this[n(427)][n(439)](e)[n(414)](o);const i=this[n(462)][n(439)](e);i[n(436)](s.id)||i[n(414)](s),this[n(419)][n(436)](s.id)||this[n(419)][n(414)](s,s[n(454)]?0:void 0),this[n(415)](n(424)+e,{channelId:e,session:o})}[Kn(431)](e,t){const n=Kn;if(n(464)!==this[n(410)][n(432)][n(439)](Yn)[n(466)])return;const r=this[n(462)][n(439)](e),s=t[n(449)];s.id&&(this[n(427)][n(439)](e)[n(455)](t.id),r[n(436)](s.id)&&!this[n(416)](s,e)[n(428)]&&r[n(455)](s.id),this[n(419)][n(439)](s.id)&&!this[n(416)](s)[n(428)]&&this[n(419)][n(455)](s.id))}[Kn(433)](e,t){const n=Kn,r=this[n(440)][n(450)](e);return t&&this[n(440)][n(458)](e.id),r[n(442)]=this[n(420)]++,r}}var $n=__webpack_require__(673),Xn=__webpack_require__.n($n),er=__webpack_require__(545),tr=__webpack_require__.n(er),nr=__webpack_require__(262),rr=__webpack_require__.n(nr),sr=__webpack_require__(667),or=__webpack_require__.n(sr),ir=__webpack_require__(357),ar=__webpack_require__.n(ir),cr=__webpack_require__(535),dr={attributes:{"data-cke":!0}};dr.setAttributes=or(),dr.insert=rr().bind(null,"head"),dr.domAPI=tr(),dr.insertStyleElement=ar();Xn()(cr.A,dr);cr.A&&cr.A.locals&&cr.A.locals;const ur=lr;function lr(e,t){const n=pr();return(lr=function(e,t){return n[e-=490]})(e,t)}function pr(){const e=["user:position","commands","setAttribute","selection","toRange","spellcheck","editingDowncast","element","rootName","user:position:","createRange","isInline","289656yLIeOM","model","hasDomSelection","5xPwTki",'⁠<span class="ck-user__marker-line" contenteditable="false"><span class="ck-user__marker-dot"></span></span>',"remove","set","textContent","change","schema","106278chXaNQ","addMarker","view","afterInit","type","deletionPosition","UserMarkers","getPositions","mouseenter","9wFFHfo","false","isCollapsed","createUIElement","editor","ck-user__marker_hovered","newRange","removeMarker","$text","isDocumentOperation","setCustomProperty","getSelectionClass","isSimilar","_domEmitter","markerNameToElements","tableCell","91WQxCWu","isPremiumPlugin","outerHTML","detach","listenTo","ck-user__marker-tooltip","document","update:user:range","markers","orderNumber","conversion","classList","color","root","init","2641914tyilAj","getStart","destroy","ck-user__marker ","1993272DUGUMr","markerRange","user:","parent","Escape","hasContent","getCustomProperty","isLimit","mapper","isOfficialPlugin","add","keydown","createUserMarkerOperations","innerHTML","enqueueChange","contenteditable","checkChild","getMarkerClass","addEventListener","user:range","render","oldRange","pluginName","highest","isObject","1063232mNmAfG","has","for","change:range","split","undo","user:range:","5849720cTDhOR","fromRange","ck-user__selection","nodeAfter","markerName","marker","start","batch","mouseleave","requires","size","getRange","end","toDomElement","stopListening","reconvertMarker","getNearestSelectionRange","updateMarker","plugins","createElement","userPositionMarker","startsWith","name","markerToHighlight","$graveyard","removeClass","getAttribute","applyOperation","936076HMmTQc","mySessionId","data-session-id","_createdBatches","clear","getContainedElement","getFirstRange","delete","get","getUserBySessionId","markerToElement","editing","span"];return(pr=function(){return e})()}!function(e){const t=lr,n=e();for(;;)try{if(540468===-parseInt(t(599))/1+parseInt(t(514))/2+-parseInt(t(510))/3+-parseInt(t(574))/4*(parseInt(t(602))/5)+-parseInt(t(609))/6*(-parseInt(t(495))/7)+parseInt(t(539))/8+-parseInt(t(618))/9*(-parseInt(t(546))/10))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(pr);class hr extends t.Plugin{[ur(492)]=new((0,n.DomEmitterMixin)());static get[ur(555)](){return[Zn]}static get[ur(536)](){return ur(615)}static get[ur(523)](){return!0}static get[ur(496)](){return!0}[ur(509)](){const e=ur,t=this[e(622)],r=t[e(564)][e(582)](Zn);t[e(505)][e(541)](e(593))[e(584)]({model:e(587),view:(n,{writer:s})=>function(t,n,r,s){const o=e,i=t[o(550)][o(543)](":")[2],a=r[o(583)](i);if(!a||i===r[o(575)])return;if(!s[o(600)][o(608)][o(530)](t[o(515)][o(552)],o(626)))return;const c={class:o(513)+a[o(507)][o(531)](),"data-name":a[o(568)],"data-session-id":i},d=s[o(600)][o(503)][o(582)](t[o(550)])[o(511)](),u=d[o(549)],l=s[o(600)][o(608)];if(u&&l[o(538)](u)&&l[o(598)](u)&&!s[o(600)][o(503)][o(582)](o(545)+i)[o(557)]()[o(620)])return;const p=d[o(517)];return s[o(600)][o(608)][o(521)](p)&&!s[o(600)][o(519)](p)&&(c[o(529)]=!1),function(e,t,n){const r=o,s=e[r(621)](r(586),t);return e[r(628)](r(566),!0,s),s[r(534)]=function(e){const t=r,s=this[t(559)](e),o=document[t(565)](t(586));return o[t(506)][t(524)](t(500)),o[t(589)](t(529),t(619)),o[t(589)](t(592),t(619)),o[t(606)]=n[t(568)],s[t(527)]=t(603)+o[t(497)]+"⁠",s[t(532)](t(617),()=>{const e=t;s[e(506)][e(524)](e(623))}),s[t(532)](t(554),()=>{const e=t;s[e(506)][e(604)](e(623))}),s},s[r(491)]=function(e){const t=r;return!(!this[t(520)](t(566))||!e[t(520)](t(566))||this[t(572)](t(576))!=e[t(572)](t(576)))},s}(n,c,a)}(n,s,r,t)}),t[e(505)][e(541)](e(593))[e(569)]({model:e(533),view:t=>function(t,n){const r=e,s=t[r(550)][r(543)](":")[2];if(s===n[r(575)])return null;const o=n[r(583)](s);return o?{id:s,classes:[r(548),o[r(507)][r(490)]()],attributes:{"data-session-id":s},priority:2e3+o[r(504)]}:{id:s,classes:[]}}(t,r)}),function(t){const n=e,r=t[n(600)],o=new Map,i=t[n(564)][n(582)](Zn);r[n(503)].on(n(502),(e,a,c,d)=>{const u=n;if(!d&&o[u(582)](a[u(568)]))return o[u(582)](a[u(568)])[u(498)](),void o[u(581)](a[u(568)]);const l=a[u(568)][u(543)](":")[2];if(l===i[u(575)])return;const p=u(596)+l;r[u(503)][u(540)](p)&&t[u(585)][u(561)](p),a.on(u(542),(e,t,n)=>{const i=u;if(i(570)!=t[i(508)][i(595)]&&i(570)==a[i(557)]()[i(508)][i(595)]&&!o[i(540)](a[i(568)])){const e=r[i(608)][i(562)](n[i(614)]);if(e){const t=s.ModelLiveRange[i(547)](e);o[i(605)](a[i(568)],t),t.on(i(542),(e,n,s)=>{const c=i;if(c(570)==t[c(508)][c(595)]){const e=r[c(608)][c(562)](s[c(614)]);e?(t[c(552)]=e[c(552)],t[c(558)]=e[c(558)]):(o[c(581)](a[c(568)]),t[c(498)]())}})}}})}),r[n(501)].on(n(607),()=>{const e=n;o[e(556)]>0&&r[e(528)]({isUndoable:!1},t=>{const n=e;for(const[e,s]of o)n(570)==r[n(503)][n(582)](e)[n(557)]()[n(508)][n(595)]&&(fr(e[n(543)](":")[2],s[n(591)](),r,t),s[n(498)]());o[n(578)]()})})}(t),this[e(492)][e(499)](n.global[e(501)],e(525),(n,{key:r})=>{const s=e;s(518)===r&&function(e){const t=s;e[t(585)][t(611)][t(607)](n=>{const r=t;for(const t of e[r(600)][r(503)]){if(!t[r(568)][r(567)](r(587)))continue;const s=e[r(585)][r(522)][r(493)](t[r(568)]);if(s)for(const e of s)n[r(571)](r(623),e)}})}(t)},{useCapture:!0})}[ur(612)](){const e=ur,t=this[e(622)],n=t[e(588)][e(582)](e(544));n&&t[e(600)].on(e(573),(r,s)=>{const o=e,i=s[0];if(!i[o(627)])return;if(o(551)!=i[o(613)]||!i[o(568)][o(567)](o(516)))return;const a=i[o(553)];n[o(577)][o(540)](a)&&(i[o(624)]=i[o(535)]?t[o(600)][o(597)](i[o(535)][o(552)],i[o(535)][o(558)]):null)},{priority:e(537)})}[ur(512)](){const e=ur;return this[e(492)][e(560)](),super[e(512)]()}[ur(526)](){const e=ur,t=this[e(622)],n=t[e(600)][e(501)],r=t[e(564)][e(582)](Zn);t[e(600)][e(528)]({isUndoable:!1},s=>{const o=e,i=o(545)+r[o(575)],a=o(596)+r[o(575)],c=t[o(600)][o(503)][o(540)](i);t[o(585)][o(611)][o(601)]?fr(r[o(575)],n[o(590)][o(580)](),t[o(600)],s):c&&(s[o(625)](i),s[o(625)](a))})}}function fr(e,t,n,r){const s=ur,o=s(545)+e,i=s(596)+e,a=t[s(579)]();let c=t[s(552)];if(a&&a.is(s(594),s(494))){const e=function(e,t){const n=s;for(const r of e[n(616)]())if(t[n(608)][n(530)](r,n(626)))return r}(t,n);e&&(c=e,t=r[s(597)](c))}const d=r[s(597)](c);n[s(503)][s(540)](o)?(r[s(563)](o,{range:t}),r[s(563)](i,{range:d})):(r[s(610)](o,{range:t,usingOperation:!0}),r[s(610)](i,{range:d,usingOperation:!0}))}function mr(e,t,n){const r=e.t,s=e.t;switch(t){case"PENDING_ACTION_SENDING_DATA":return s({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 s("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 s("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 s("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 s("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 s("Synchronization issue");case"Connected users list dropdown menu":return s("Connected users list dropdown menu");case"Collapsed connected users list (press ENTER to open it)":return s("Collapsed connected users list (press ENTER to open it)");case"Connected users list":return s("Connected users list");case"PENDING_ACTION_REVISION_HISTORY":return r({string:"Unsaved change in revision history.",id:"PENDING_ACTION_REVISION_HISTORY"});case"CONNECTED_USERS":return s({string:"1 connected user (me)",plural:"%0 connected users",id:"CONNECTED_USERS"},n);default:return""}}const yr=(()=>{var e=d.Reader,t=d.Writer,n=d.util,r=d.roots.default||(d.roots.default={});return r.AttributeOperation=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.range=null,s.prototype.key="",s.prototype.oldValueBoolean=!1,s.prototype.oldValueJson="",s.prototype.newValueBoolean=!1,s.prototype.newValueJson="",s.prototype.wasUndone=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.range&&Object.hasOwnProperty.call(e,"range")&&r.Range.encode(e.range,n.uint32(10).fork()).ldelim(),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&n.uint32(18).string(e.key),null!=e.oldValueBoolean&&Object.hasOwnProperty.call(e,"oldValueBoolean")&&n.uint32(24).bool(e.oldValueBoolean),null!=e.oldValueJson&&Object.hasOwnProperty.call(e,"oldValueJson")&&n.uint32(34).string(e.oldValueJson),null!=e.newValueBoolean&&Object.hasOwnProperty.call(e,"newValueBoolean")&&n.uint32(40).bool(e.newValueBoolean),null!=e.newValueJson&&Object.hasOwnProperty.call(e,"newValueJson")&&n.uint32(50).string(e.newValueJson),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&n.uint32(56).bool(e.wasUndone),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.AttributeOperation;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.range=r.Range.decode(t,t.uint32());break;case 2:o.key=t.string();break;case 3:o.oldValueBoolean=t.bool();break;case 4:o.oldValueJson=t.string();break;case 5:o.newValueBoolean=t.bool();break;case 6:o.newValueJson=t.string();break;case 7:o.wasUndone=t.bool();break;default:t.skipType(7&i)}}return o},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.range&&e.hasOwnProperty("range")){var t=r.Range.verify(e.range);if(t)return"range."+t}return null!=e.key&&e.hasOwnProperty("key")&&!n.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")&&!n.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")&&!n.isString(e.newValueJson)?"newValueJson: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(e){if(e instanceof r.AttributeOperation)return e;var t=new r.AttributeOperation;if(null!=e.range){if("object"!=typeof e.range)throw TypeError(".AttributeOperation.range: object expected");t.range=r.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},s.toObject=function(e,t){t||(t={});var 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=r.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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/AttributeOperation"},s}(),r.InsertOperation=function(){function s(e){if(this.nodes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.position=null,s.prototype.nodes=n.emptyArray,s.prototype.shouldReceiveAttributes=!1,s.prototype.wasUndone=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&r.Position.encode(e.position,n.uint32(10).fork()).ldelim(),null!=e.nodes&&e.nodes.length)for(var s=0;s<e.nodes.length;++s)r.Element.encode(e.nodes[s],n.uint32(18).fork()).ldelim();return null!=e.shouldReceiveAttributes&&Object.hasOwnProperty.call(e,"shouldReceiveAttributes")&&n.uint32(24).bool(e.shouldReceiveAttributes),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&n.uint32(32).bool(e.wasUndone),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.InsertOperation;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.position=r.Position.decode(t,t.uint32());break;case 2:o.nodes&&o.nodes.length||(o.nodes=[]),o.nodes.push(r.Element.decode(t,t.uint32()));break;case 3:o.shouldReceiveAttributes=t.bool();break;case 4:o.wasUndone=t.bool();break;default:t.skipType(7&i)}}return o},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.position&&e.hasOwnProperty("position")&&(n=r.Position.verify(e.position)))return"position."+n;if(null!=e.nodes&&e.hasOwnProperty("nodes")){if(!Array.isArray(e.nodes))return"nodes: array expected";for(var t=0;t<e.nodes.length;++t){var n;if(n=r.Element.verify(e.nodes[t]))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},s.fromObject=function(e){if(e instanceof r.InsertOperation)return e;var t=new r.InsertOperation;if(null!=e.position){if("object"!=typeof e.position)throw TypeError(".InsertOperation.position: object expected");t.position=r.Position.fromObject(e.position)}if(e.nodes){if(!Array.isArray(e.nodes))throw TypeError(".InsertOperation.nodes: array expected");t.nodes=[];for(var n=0;n<e.nodes.length;++n){if("object"!=typeof e.nodes[n])throw TypeError(".InsertOperation.nodes: object expected");t.nodes[n]=r.Element.fromObject(e.nodes[n])}}return null!=e.shouldReceiveAttributes&&(t.shouldReceiveAttributes=Boolean(e.shouldReceiveAttributes)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},s.toObject=function(e,t){t||(t={});var 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=r.Position.toObject(e.position,t)),e.nodes&&e.nodes.length){n.nodes=[];for(var s=0;s<e.nodes.length;++s)n.nodes[s]=r.Element.toObject(e.nodes[s],t)}return null!=e.shouldReceiveAttributes&&e.hasOwnProperty("shouldReceiveAttributes")&&(n.shouldReceiveAttributes=e.shouldReceiveAttributes),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/InsertOperation"},s}(),r.MarkerOperation=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.name="",s.prototype.oldRange=null,s.prototype.newRange=null,s.prototype.affectsData=!1,s.prototype.wasUndone=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&n.uint32(10).string(e.name),null!=e.oldRange&&Object.hasOwnProperty.call(e,"oldRange")&&r.Range.encode(e.oldRange,n.uint32(18).fork()).ldelim(),null!=e.newRange&&Object.hasOwnProperty.call(e,"newRange")&&r.Range.encode(e.newRange,n.uint32(26).fork()).ldelim(),null!=e.affectsData&&Object.hasOwnProperty.call(e,"affectsData")&&n.uint32(32).bool(e.affectsData),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&n.uint32(40).bool(e.wasUndone),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.MarkerOperation;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.name=t.string();break;case 2:o.oldRange=r.Range.decode(t,t.uint32());break;case 3:o.newRange=r.Range.decode(t,t.uint32());break;case 4:o.affectsData=t.bool();break;case 5:o.wasUndone=t.bool();break;default:t.skipType(7&i)}}return o},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!n.isString(e.name))return"name: string expected";var t;if(null!=e.oldRange&&e.hasOwnProperty("oldRange")&&(t=r.Range.verify(e.oldRange)))return"oldRange."+t;if(null!=e.newRange&&e.hasOwnProperty("newRange")&&(t=r.Range.verify(e.newRange)))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},s.fromObject=function(e){if(e instanceof r.MarkerOperation)return e;var t=new r.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=r.Range.fromObject(e.oldRange)}if(null!=e.newRange){if("object"!=typeof e.newRange)throw TypeError(".MarkerOperation.newRange: object expected");t.newRange=r.Range.fromObject(e.newRange)}return null!=e.affectsData&&(t.affectsData=Boolean(e.affectsData)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},s.toObject=function(e,t){t||(t={});var 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=r.Range.toObject(e.oldRange,t)),null!=e.newRange&&e.hasOwnProperty("newRange")&&(n.newRange=r.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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MarkerOperation"},s}(),r.MergeOperation=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.sourcePosition=null,s.prototype.targetPosition=null,s.prototype.graveyardPosition=null,s.prototype.howMany=0,s.prototype.wasUndone=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.sourcePosition&&Object.hasOwnProperty.call(e,"sourcePosition")&&r.Position.encode(e.sourcePosition,n.uint32(10).fork()).ldelim(),null!=e.targetPosition&&Object.hasOwnProperty.call(e,"targetPosition")&&r.Position.encode(e.targetPosition,n.uint32(18).fork()).ldelim(),null!=e.graveyardPosition&&Object.hasOwnProperty.call(e,"graveyardPosition")&&r.Position.encode(e.graveyardPosition,n.uint32(26).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&n.uint32(32).uint32(e.howMany),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&n.uint32(40).bool(e.wasUndone),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.MergeOperation;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.sourcePosition=r.Position.decode(t,t.uint32());break;case 2:o.targetPosition=r.Position.decode(t,t.uint32());break;case 3:o.graveyardPosition=r.Position.decode(t,t.uint32());break;case 4:o.howMany=t.uint32();break;case 5:o.wasUndone=t.bool();break;default:t.skipType(7&i)}}return o},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t;if(null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")&&(t=r.Position.verify(e.sourcePosition)))return"sourcePosition."+t;if(null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(t=r.Position.verify(e.targetPosition)))return"targetPosition."+t;if(null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(t=r.Position.verify(e.graveyardPosition)))return"graveyardPosition."+t;return null!=e.howMany&&e.hasOwnProperty("howMany")&&!n.isInteger(e.howMany)?"howMany: integer expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(e){if(e instanceof r.MergeOperation)return e;var t=new r.MergeOperation;if(null!=e.sourcePosition){if("object"!=typeof e.sourcePosition)throw TypeError(".MergeOperation.sourcePosition: object expected");t.sourcePosition=r.Position.fromObject(e.sourcePosition)}if(null!=e.targetPosition){if("object"!=typeof e.targetPosition)throw TypeError(".MergeOperation.targetPosition: object expected");t.targetPosition=r.Position.fromObject(e.targetPosition)}if(null!=e.graveyardPosition){if("object"!=typeof e.graveyardPosition)throw TypeError(".MergeOperation.graveyardPosition: object expected");t.graveyardPosition=r.Position.fromObject(e.graveyardPosition)}return null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},s.toObject=function(e,t){t||(t={});var 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=r.Position.toObject(e.sourcePosition,t)),null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(n.targetPosition=r.Position.toObject(e.targetPosition,t)),null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=r.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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MergeOperation"},s}(),r.MoveOperation=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.sourcePosition=null,s.prototype.howMany=0,s.prototype.targetPosition=null,s.prototype.wasUndone=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.sourcePosition&&Object.hasOwnProperty.call(e,"sourcePosition")&&r.Position.encode(e.sourcePosition,n.uint32(10).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&n.uint32(16).uint32(e.howMany),null!=e.targetPosition&&Object.hasOwnProperty.call(e,"targetPosition")&&r.Position.encode(e.targetPosition,n.uint32(26).fork()).ldelim(),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&n.uint32(32).bool(e.wasUndone),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.MoveOperation;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.sourcePosition=r.Position.decode(t,t.uint32());break;case 2:o.howMany=t.uint32();break;case 3:o.targetPosition=r.Position.decode(t,t.uint32());break;case 4:o.wasUndone=t.bool();break;default:t.skipType(7&i)}}return o},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t;if(null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")&&(t=r.Position.verify(e.sourcePosition)))return"sourcePosition."+t;if(null!=e.howMany&&e.hasOwnProperty("howMany")&&!n.isInteger(e.howMany))return"howMany: integer expected";if(null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(t=r.Position.verify(e.targetPosition)))return"targetPosition."+t;return null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(e){if(e instanceof r.MoveOperation)return e;var t=new r.MoveOperation;if(null!=e.sourcePosition){if("object"!=typeof e.sourcePosition)throw TypeError(".MoveOperation.sourcePosition: object expected");t.sourcePosition=r.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=r.Position.fromObject(e.targetPosition)}return null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.sourcePosition=null,n.howMany=0,n.targetPosition=null,n.wasUndone=!1),null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")&&(n.sourcePosition=r.Position.toObject(e.sourcePosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(n.targetPosition=r.Position.toObject(e.targetPosition,t)),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MoveOperation"},s}(),r.RenameOperation=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.position=null,s.prototype.oldName="",s.prototype.newName="",s.prototype.wasUndone=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&r.Position.encode(e.position,n.uint32(10).fork()).ldelim(),null!=e.oldName&&Object.hasOwnProperty.call(e,"oldName")&&n.uint32(18).string(e.oldName),null!=e.newName&&Object.hasOwnProperty.call(e,"newName")&&n.uint32(26).string(e.newName),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&n.uint32(32).bool(e.wasUndone),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RenameOperation;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.position=r.Position.decode(t,t.uint32());break;case 2:o.oldName=t.string();break;case 3:o.newName=t.string();break;case 4:o.wasUndone=t.bool();break;default:t.skipType(7&i)}}return o},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.position&&e.hasOwnProperty("position")){var t=r.Position.verify(e.position);if(t)return"position."+t}return null!=e.oldName&&e.hasOwnProperty("oldName")&&!n.isString(e.oldName)?"oldName: string expected":null!=e.newName&&e.hasOwnProperty("newName")&&!n.isString(e.newName)?"newName: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(e){if(e instanceof r.RenameOperation)return e;var t=new r.RenameOperation;if(null!=e.position){if("object"!=typeof e.position)throw TypeError(".RenameOperation.position: object expected");t.position=r.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},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.position=null,n.oldName="",n.newName="",n.wasUndone=!1),null!=e.position&&e.hasOwnProperty("position")&&(n.position=r.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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RenameOperation"},s}(),r.RootAttributeOperation=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.root="",s.prototype.key="",s.prototype.oldValueBoolean=!1,s.prototype.oldValueJson="",s.prototype.newValueBoolean=!1,s.prototype.newValueJson="",s.prototype.wasUndone=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.root&&Object.hasOwnProperty.call(e,"root")&&n.uint32(10).string(e.root),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&n.uint32(18).string(e.key),null!=e.oldValueBoolean&&Object.hasOwnProperty.call(e,"oldValueBoolean")&&n.uint32(24).bool(e.oldValueBoolean),null!=e.oldValueJson&&Object.hasOwnProperty.call(e,"oldValueJson")&&n.uint32(34).string(e.oldValueJson),null!=e.newValueBoolean&&Object.hasOwnProperty.call(e,"newValueBoolean")&&n.uint32(40).bool(e.newValueBoolean),null!=e.newValueJson&&Object.hasOwnProperty.call(e,"newValueJson")&&n.uint32(50).string(e.newValueJson),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&n.uint32(56).bool(e.wasUndone),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RootAttributeOperation;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.root=t.string();break;case 2:o.key=t.string();break;case 3:o.oldValueBoolean=t.bool();break;case 4:o.oldValueJson=t.string();break;case 5:o.newValueBoolean=t.bool();break;case 6:o.newValueJson=t.string();break;case 7:o.wasUndone=t.bool();break;default:t.skipType(7&i)}}return o},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.root&&e.hasOwnProperty("root")&&!n.isString(e.root)?"root: string expected":null!=e.key&&e.hasOwnProperty("key")&&!n.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")&&!n.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")&&!n.isString(e.newValueJson)?"newValueJson: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(e){if(e instanceof r.RootAttributeOperation)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RootAttributeOperation"},s}(),r.RootOperation=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.rootName="",s.prototype.elementName="",s.prototype.isAdd=!1,s.prototype.wasUndone=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.rootName&&Object.hasOwnProperty.call(e,"rootName")&&n.uint32(10).string(e.rootName),null!=e.elementName&&Object.hasOwnProperty.call(e,"elementName")&&n.uint32(18).string(e.elementName),null!=e.isAdd&&Object.hasOwnProperty.call(e,"isAdd")&&n.uint32(24).bool(e.isAdd),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&n.uint32(32).bool(e.wasUndone),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RootOperation;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.rootName=t.string();break;case 2:o.elementName=t.string();break;case 3:o.isAdd=t.bool();break;case 4:o.wasUndone=t.bool();break;default:t.skipType(7&i)}}return o},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.rootName&&e.hasOwnProperty("rootName")&&!n.isString(e.rootName)?"rootName: string expected":null!=e.elementName&&e.hasOwnProperty("elementName")&&!n.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},s.fromObject=function(e){if(e instanceof r.RootOperation)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RootOperation"},s}(),r.SplitOperation=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.splitPosition=null,s.prototype.graveyardPosition=null,s.prototype.howMany=0,s.prototype.insertionPosition=null,s.prototype.wasUndone=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.splitPosition&&Object.hasOwnProperty.call(e,"splitPosition")&&r.Position.encode(e.splitPosition,n.uint32(10).fork()).ldelim(),null!=e.graveyardPosition&&Object.hasOwnProperty.call(e,"graveyardPosition")&&r.Position.encode(e.graveyardPosition,n.uint32(18).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&n.uint32(24).uint32(e.howMany),null!=e.insertionPosition&&Object.hasOwnProperty.call(e,"insertionPosition")&&r.Position.encode(e.insertionPosition,n.uint32(34).fork()).ldelim(),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&n.uint32(40).bool(e.wasUndone),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.SplitOperation;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.splitPosition=r.Position.decode(t,t.uint32());break;case 2:o.graveyardPosition=r.Position.decode(t,t.uint32());break;case 3:o.howMany=t.uint32();break;case 4:o.insertionPosition=r.Position.decode(t,t.uint32());break;case 5:o.wasUndone=t.bool();break;default:t.skipType(7&i)}}return o},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t;if(null!=e.splitPosition&&e.hasOwnProperty("splitPosition")&&(t=r.Position.verify(e.splitPosition)))return"splitPosition."+t;if(null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(t=r.Position.verify(e.graveyardPosition)))return"graveyardPosition."+t;if(null!=e.howMany&&e.hasOwnProperty("howMany")&&!n.isInteger(e.howMany))return"howMany: integer expected";if(null!=e.insertionPosition&&e.hasOwnProperty("insertionPosition")&&(t=r.Position.verify(e.insertionPosition)))return"insertionPosition."+t;return null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(e){if(e instanceof r.SplitOperation)return e;var t=new r.SplitOperation;if(null!=e.splitPosition){if("object"!=typeof e.splitPosition)throw TypeError(".SplitOperation.splitPosition: object expected");t.splitPosition=r.Position.fromObject(e.splitPosition)}if(null!=e.graveyardPosition){if("object"!=typeof e.graveyardPosition)throw TypeError(".SplitOperation.graveyardPosition: object expected");t.graveyardPosition=r.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=r.Position.fromObject(e.insertionPosition)}return null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},s.toObject=function(e,t){t||(t={});var 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=r.Position.toObject(e.splitPosition,t)),null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=r.Position.toObject(e.graveyardPosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.insertionPosition&&e.hasOwnProperty("insertionPosition")&&(n.insertionPosition=r.Position.toObject(e.insertionPosition,t)),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SplitOperation"},s}(),r.Position=function(){function s(e){if(this.path=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.root="",s.prototype.rootMain=!1,s.prototype.rootGraveyard=!1,s.prototype.path=n.emptyArray,s.prototype.stickiness="",s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.root&&Object.hasOwnProperty.call(e,"root")&&n.uint32(10).string(e.root),null!=e.rootMain&&Object.hasOwnProperty.call(e,"rootMain")&&n.uint32(16).bool(e.rootMain),null!=e.rootGraveyard&&Object.hasOwnProperty.call(e,"rootGraveyard")&&n.uint32(24).bool(e.rootGraveyard),null!=e.path&&e.path.length){n.uint32(34).fork();for(var r=0;r<e.path.length;++r)n.uint32(e.path[r]);n.ldelim()}return null!=e.stickiness&&Object.hasOwnProperty.call(e,"stickiness")&&n.uint32(42).string(e.stickiness),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.Position;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.root=t.string();break;case 2:o.rootMain=t.bool();break;case 3:o.rootGraveyard=t.bool();break;case 4:if(o.path&&o.path.length||(o.path=[]),2==(7&i))for(var a=t.uint32()+t.pos;t.pos<a;)o.path.push(t.uint32());else o.path.push(t.uint32());break;case 5:o.stickiness=t.string();break;default:t.skipType(7&i)}}return o},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.root&&e.hasOwnProperty("root")&&!n.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(var t=0;t<e.path.length;++t)if(!n.isInteger(e.path[t]))return"path: integer[] expected"}return null!=e.stickiness&&e.hasOwnProperty("stickiness")&&!n.isString(e.stickiness)?"stickiness: string expected":null},s.fromObject=function(e){if(e instanceof r.Position)return e;var t=new r.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(var n=0;n<e.path.length;++n)t.path[n]=e.path[n]>>>0}return null!=e.stickiness&&(t.stickiness=String(e.stickiness)),t},s.toObject=function(e,t){t||(t={});var 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(var r=0;r<e.path.length;++r)n.path[r]=e.path[r]}return null!=e.stickiness&&e.hasOwnProperty("stickiness")&&(n.stickiness=e.stickiness),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Position"},s}(),r.Range=function(){function n(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return n.prototype.start=null,n.prototype.end=null,n.create=function(e){return new n(e)},n.encode=function(e,n){return n||(n=t.create()),null!=e.start&&Object.hasOwnProperty.call(e,"start")&&r.Position.encode(e.start,n.uint32(10).fork()).ldelim(),null!=e.end&&Object.hasOwnProperty.call(e,"end")&&r.Position.encode(e.end,n.uint32(18).fork()).ldelim(),n},n.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},n.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.Range;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.start=r.Position.decode(t,t.uint32());break;case 2:o.end=r.Position.decode(t,t.uint32());break;default:t.skipType(7&i)}}return o},n.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},n.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t;if(null!=e.start&&e.hasOwnProperty("start")&&(t=r.Position.verify(e.start)))return"start."+t;if(null!=e.end&&e.hasOwnProperty("end")&&(t=r.Position.verify(e.end)))return"end."+t;return null},n.fromObject=function(e){if(e instanceof r.Range)return e;var t=new r.Range;if(null!=e.start){if("object"!=typeof e.start)throw TypeError(".Range.start: object expected");t.start=r.Position.fromObject(e.start)}if(null!=e.end){if("object"!=typeof e.end)throw TypeError(".Range.end: object expected");t.end=r.Position.fromObject(e.end)}return t},n.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.start=null,n.end=null),null!=e.start&&e.hasOwnProperty("start")&&(n.start=r.Position.toObject(e.start,t)),null!=e.end&&e.hasOwnProperty("end")&&(n.end=r.Position.toObject(e.end,t)),n},n.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},n.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Range"},n}(),r.Element=function(){function s(e){if(this.children=[],this.attributesBoolean={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.name="",s.prototype.children=n.emptyArray,s.prototype.data="",s.prototype.attributesBoolean=n.emptyObject,s.prototype.attributesJson="",s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&n.uint32(10).string(e.name),null!=e.children&&e.children.length)for(var s=0;s<e.children.length;++s)r.Element.encode(e.children[s],n.uint32(18).fork()).ldelim();if(null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(26).string(e.data),null!=e.attributesBoolean&&Object.hasOwnProperty.call(e,"attributesBoolean")){var o=Object.keys(e.attributesBoolean);for(s=0;s<o.length;++s)n.uint32(34).fork().uint32(10).string(o[s]).uint32(16).bool(e.attributesBoolean[o[s]]).ldelim()}return null!=e.attributesJson&&Object.hasOwnProperty.call(e,"attributesJson")&&n.uint32(42).string(e.attributesJson),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,s){t instanceof e||(t=e.create(t));for(var o,i,a=void 0===s?t.len:t.pos+s,c=new r.Element;t.pos<a;){var d=t.uint32();switch(d>>>3){case 1:c.name=t.string();break;case 2:c.children&&c.children.length||(c.children=[]),c.children.push(r.Element.decode(t,t.uint32()));break;case 3:c.data=t.string();break;case 4:c.attributesBoolean===n.emptyObject&&(c.attributesBoolean={});var u=t.uint32()+t.pos;for(o="",i=!1;t.pos<u;){var l=t.uint32();switch(l>>>3){case 1:o=t.string();break;case 2:i=t.bool();break;default:t.skipType(7&l)}}c.attributesBoolean[o]=i;break;case 5:c.attributesJson=t.string();break;default:t.skipType(7&d)}}return c},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!n.isString(e.name))return"name: string expected";if(null!=e.children&&e.hasOwnProperty("children")){if(!Array.isArray(e.children))return"children: array expected";for(var t=0;t<e.children.length;++t){var s=r.Element.verify(e.children[t]);if(s)return"children."+s}}if(null!=e.data&&e.hasOwnProperty("data")&&!n.isString(e.data))return"data: string expected";if(null!=e.attributesBoolean&&e.hasOwnProperty("attributesBoolean")){if(!n.isObject(e.attributesBoolean))return"attributesBoolean: object expected";var o=Object.keys(e.attributesBoolean);for(t=0;t<o.length;++t)if("boolean"!=typeof e.attributesBoolean[o[t]])return"attributesBoolean: boolean{k:string} expected"}return null!=e.attributesJson&&e.hasOwnProperty("attributesJson")&&!n.isString(e.attributesJson)?"attributesJson: string expected":null},s.fromObject=function(e){if(e instanceof r.Element)return e;var t=new r.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(var n=0;n<e.children.length;++n){if("object"!=typeof e.children[n])throw TypeError(".Element.children: object expected");t.children[n]=r.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={};var s=Object.keys(e.attributesBoolean);for(n=0;n<s.length;++n)t.attributesBoolean[s[n]]=Boolean(e.attributesBoolean[s[n]])}return null!=e.attributesJson&&(t.attributesJson=String(e.attributesJson)),t},s.toObject=function(e,t){t||(t={});var n,s={};if((t.arrays||t.defaults)&&(s.children=[]),(t.objects||t.defaults)&&(s.attributesBoolean={}),t.defaults&&(s.name="",s.data="",s.attributesJson=""),null!=e.name&&e.hasOwnProperty("name")&&(s.name=e.name),e.children&&e.children.length){s.children=[];for(var o=0;o<e.children.length;++o)s.children[o]=r.Element.toObject(e.children[o],t)}if(null!=e.data&&e.hasOwnProperty("data")&&(s.data=e.data),e.attributesBoolean&&(n=Object.keys(e.attributesBoolean)).length){s.attributesBoolean={};for(o=0;o<n.length;++o)s.attributesBoolean[n[o]]=e.attributesBoolean[n[o]]}return null!=e.attributesJson&&e.hasOwnProperty("attributesJson")&&(s.attributesJson=e.attributesJson),s},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Element"},s}(),r})();class gr{_protobufRoot;constructor(){this._protobufRoot=yr}getDescriptor(e){return new br(this._protobufRoot[e])}}class br{_protobuf;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})}}function Or(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function wr(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Ir="[object RegExp]",vr="[object String]",Sr="[object Number]",kr="[object Boolean]",Pr="[object Arguments]",Ar="[object Symbol]",Tr="[object Date]",_r="[object Map]",Cr="[object Set]",jr="[object Array]",Er="[object ArrayBuffer]",Dr="[object Object]",xr="[object DataView]",Rr="[object Uint8Array]",Nr="[object Uint8ClampedArray]",Vr="[object Uint16Array]",Mr="[object Uint32Array]",Br="[object Int8Array]",Ur="[object Int16Array]",Jr="[object Int32Array]",qr="[object Float32Array]",Gr="[object Float64Array]";function Lr(e,t,n,r=new Map,s=void 0){const o=s?.(e,t,n,r);if(null!=o)return o;if(function(e){return null==e||"object"!=typeof e&&"function"!=typeof e}(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const t=new Array(e.length);r.set(e,t);for(let o=0;o<e.length;o++)t[o]=Lr(e[o],o,n,r,s);return Object.hasOwn(e,"index")&&(t.index=e.index),Object.hasOwn(e,"input")&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){const t=new Map;r.set(e,t);for(const[o,i]of e)t.set(o,Lr(i,o,n,r,s));return t}if(e instanceof Set){const t=new Set;r.set(e,t);for(const o of e)t.add(Lr(o,void 0,n,r,s));return t}if("undefined"!=typeof Buffer&&Buffer.isBuffer(e))return e.subarray();if(function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(e)){const t=new(Object.getPrototypeOf(e).constructor)(e.length);r.set(e,t);for(let o=0;o<e.length;o++)t[o]=Lr(e[o],o,n,r,s);return t}if(e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),Yr(t,e,n,r,s),t}if("undefined"!=typeof File&&e instanceof File){const t=new File([e],e.name,{type:e.type});return r.set(e,t),Yr(t,e,n,r,s),t}if(e instanceof Blob){const t=new Blob([e],{type:e.type});return r.set(e,t),Yr(t,e,n,r,s),t}if(e instanceof Error){const t=new e.constructor;return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,Yr(t,e,n,r,s),t}if("object"==typeof e&&function(e){switch(wr(e)){case Pr:case jr:case Er:case xr:case kr:case Tr:case qr:case Gr:case Br:case Ur:case Jr:case _r:case Sr:case Dr:case Ir:case Cr:case vr:case Ar:case Rr:case Nr:case Vr:case Mr:return!0;default:return!1}}(e)){const t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),Yr(t,e,n,r,s),t}return e}function Yr(e,t,n=e,r,s){const o=[...Object.keys(t),...Or(t)];for(let i=0;i<o.length;i++){const a=o[i],c=Object.getOwnPropertyDescriptor(e,a);(null==c||c.writable)&&(e[a]=Lr(t[a],a,n,r,s))}}function Hr(e,t){return function(e,t){return Lr(e,void 0,e,new Map,t)}(e,(n,r,s,o)=>{const i=t?.(n,r,s,o);if(null!=i)return i;if("object"==typeof e)switch(Object.prototype.toString.call(e)){case Sr:case vr:case kr:{const t=new e.constructor(e?.valueOf());return Yr(t,e),t}case Pr:{const t={};return Yr(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}})}function zr(e){return Hr(e)}function Fr(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t))&&"[object Object]"===Object.prototype.toString.call(e)}function Kr(e,t,n,r,s,o,i){const a=i(e,t,n,r,s,o);if(void 0!==a)return a;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return e===t;case"number":return e===t||Object.is(e,t);case"object":return Wr(e,t,o,i)}return Wr(e,t,o,i)}function Wr(e,t,n,r){if(Object.is(e,t))return!0;let s=wr(e),o=wr(t);if(s===Pr&&(s=Dr),o===Pr&&(o=Dr),s!==o)return!1;switch(s){case vr:return e.toString()===t.toString();case Sr:return function(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}(e.valueOf(),t.valueOf());case kr:case Tr:case Ar:return Object.is(e.valueOf(),t.valueOf());case Ir:return e.source===t.source&&e.flags===t.flags;case"[object Function]":return e===t}const i=(n=n??new Map).get(e),a=n.get(t);if(null!=i&&null!=a)return i===t;n.set(e,t),n.set(t,e);try{switch(s){case _r:if(e.size!==t.size)return!1;for(const[s,o]of e.entries())if(!t.has(s)||!Kr(o,t.get(s),s,e,t,n,r))return!1;return!0;case Cr:{if(e.size!==t.size)return!1;const s=Array.from(e.values()),o=Array.from(t.values());for(let i=0;i<s.length;i++){const a=s[i],c=o.findIndex(s=>Kr(a,s,void 0,e,t,n,r));if(-1===c)return!1;o.splice(c,1)}return!0}case jr:case Rr:case Nr:case Vr:case Mr:case"[object BigUint64Array]":case Br:case Ur:case Jr:case"[object BigInt64Array]":case qr:case Gr:if("undefined"!=typeof Buffer&&Buffer.isBuffer(e)!==Buffer.isBuffer(t))return!1;if(e.length!==t.length)return!1;for(let s=0;s<e.length;s++)if(!Kr(e[s],t[s],s,e,t,n,r))return!1;return!0;case Er:return e.byteLength===t.byteLength&&Wr(new Uint8Array(e),new Uint8Array(t),n,r);case xr:return e.byteLength===t.byteLength&&e.byteOffset===t.byteOffset&&Wr(new Uint8Array(e),new Uint8Array(t),n,r);case"[object Error]":return e.name===t.name&&e.message===t.message;case Dr:{if(!(Wr(e.constructor,t.constructor,n,r)||Fr(e)&&Fr(t)))return!1;const s=[...Object.keys(e),...Or(e)],o=[...Object.keys(t),...Or(t)];if(s.length!==o.length)return!1;for(let o=0;o<s.length;o++){const i=s[o],a=e[i];if(!Object.hasOwn(t,i))return!1;if(!Kr(a,t[i],i,e,t,n,r))return!1}return!0}default:return!1}}finally{n.delete(e),n.delete(t)}}function Qr(){}function Zr(e,t){return function(e,t,n){return Kr(e,t,void 0,void 0,void 0,void 0,n)}(e,t,Qr)}function $r(e){return null!==e&&("object"==typeof e||"function"==typeof e)}function Xr(e,t){const n=zr(e);return n.path[n.path.length-1]+=t,n}function es(e,t){return e.root===t.root&&Zr(e.path,t.path)}function ts(e){rs(e,e=>("main"==e.root?(e.rootMain=!0,delete e.root):"$graveyard"==e.root&&(e.rootGraveyard=!0,delete e.root),e))}function ns(e){rs(e,e=>(e.rootMain?(e.root="main",delete e.rootMain):e.rootGraveyard&&(e.root="$graveyard",delete e.rootGraveyard),e))}function rs(e,t){for(const n in e){const r=e[n];"nodes"!==n&&$r(r)&&(r.path&&(r.root||r.rootMain||r.rootGraveyard)?e[n]=t(r):rs(r,t))}return e}class ss{_id;_operationName;_protobufDescriptor;constructor(e,t,n){this._id=e,this._operationName=t,this._protobufDescriptor=n}compress(e,t){const n=t.shift();return ts(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());ns(n),n.__className=this._operationName,e.push(n)}}class os extends ss{compress(e,t){const n=t.shift();return this._serializeOneOf("oldValue",n),this._serializeOneOf("newValue",n),ts(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),ns(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 is extends ss{compress(e,t){const n=t.shift();return this._serializeNodesAttributes(n.nodes),ts(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),ns(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 as extends ss{decompress(e,t){super.decompress(e,t);const n=e[e.length-1];n.oldRange||(n.oldRange=null),n.newRange||(n.newRange=null)}}class cs extends ss{compress(e,t){return t.shift(),e.types.push(this._id),!0}decompress(e,t){t.types.shift(),e.push({__className:this._operationName})}}class ds extends as{_omittedNamespace;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 us{_id;_context;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=zr(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 ls extends us{_combineNext(e,t){return t.nodes[0].data+=e.nodes[0].data,t}_splitCurrent(e){const t=zr(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=Xr(e.position,o),t}_compareOperations(e,t){if(this._checkOperation(e)&&this._checkOperation(t)){const n=e.nodes[0].data.length,r=es(Xr(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 ps extends us{_combineNext(e,t){return t.howMany++,t.sourcePosition=zr(e.sourcePosition),t}_splitCurrent(e){const t=zr(e);return e.howMany--,t.howMany=1,t.sourcePosition=Xr(t.sourcePosition,e.howMany),t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(es(Xr(e.sourcePosition,-1),t.sourcePosition)&&es(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 hs extends us{_combineNext(e,t){return t.howMany++,t}_splitCurrent(e){const t=zr(e);return t.howMany=1,e.howMany--,t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(es(e.sourcePosition,t.sourcePosition)&&es(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 fs extends us{compress(e,t){if(!this._compareOperations(t[0],t[1]))return!1;const n=t.shift();return n.oldRange=null,n.newRange&&es(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=zr(n.newRange.start));const r=zr(n);r.newRange&&(r.newRange.start.stickiness="toNone",r.newRange.end=zr(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 ms{_compressorById;_compressorByName;_protobufFactory;constructor(){this._compressorById=new Map,this._compressorByName=new Map,this._protobufFactory=new gr;const e=this._protobufFactory.getDescriptor("MarkerOperation");this._registerCompressor(1,"NoOperation",new cs(1,"NoOperation",void 0)),this._registerOperationCompressor(10,"AttributeOperation",os),this._registerOperationCompressor(11,"InsertOperation",is),this._registerOperationCompressor(12,"MarkerOperation",as),this._registerOperationCompressor(13,"MergeOperation",ss),this._registerOperationCompressor(14,"MoveOperation",ss),this._registerOperationCompressor(15,"RenameOperation",ss),this._registerOperationCompressor(16,"RootAttributeOperation",os),this._registerOperationCompressor(17,"SplitOperation",ss),this._registerCompressor(18,"CommentMarkerOperation",new ds(18,"MarkerOperation",e,"comment")),this._registerCompressor(19,"SuggestionMarkerOperation",new ds(19,"MarkerOperation",e,"suggestion")),this._registerOperationCompressor(20,"RootOperation",ss),this._registerActionCompressor(100,"TypingAction",ls),this._registerActionCompressor(101,"DeletingAction",ps),this._registerActionCompressor(102,"ForwardDeletingAction",hs),this._registerActionCompressor(103,"UserSelectionAction",fs)}compress(e){if(!e||!e[0])throw new n.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;){const r=this._compressorById.get(e.types[0]);if(!r)throw new n.CKEditorError("decompress-compressor-not-found",this,{type:e.types[0]});r.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)}}const ys=ws;function gs(){const e=["enqueueChange","_isDisconnection","_offset","isEnabled","register","differ","_setPendingAction","change:_isPendingUpdate","4447768oaSKhx","clone","change:range","getMany","_hasSelectionChanged","size","_compressor","6084280aToVKy","requires","_updateServerHistory","_crash","define","finally","realtimecollaborationclient-init-service-incorrect-server-operation","rtc-offline","suppressErrorInCollaboration","setPermissions","_handleReceivedOperations","_baseBufferDelay","_decompressOperations","cloud-services-internal-error: Collaborative Editing Service is not connected.","The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.","realtimecollaborationclient-init-non-existent-root","start","rootName","baseVersion","The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.","multi-root-editor-root-attributes-no-root","view","_service","roots","newRange","createUserMarkerOperations","_knownRootNames","stop","directChange","__className","realtimecollaborationclient-init-service-internal-error","_isPendingUpdate","high","cloudDocumentVersion","bind","currentDocumentSession","loadRoot","Permissions","change:hasDomSelection","round","_handleReconnectionResponse","_isConnected","lastSyncVersion","realtimecollaborationclient","createPositionFromPath","config","catch","_isAttached","version","fromJSON","CommentsOnly","reconnection: flushed session","add","_shouldSendUpdate","isPremiumPlugin","lastOperationId","871266XecORe","_isInit","reconnect","_ignoredOperations","addOperation","wereChangesApplied","409","_authorId","_handleReconnectionError","addRoot","change:_isEditingAllowed","realtimecollaborationclient-init-connection-failed","_disconnectService","includes","getDocumentDetails","mySessionId","_connectAfterSessionHasBeenFlushed","6KrLEhn","$root","listenTo","_saveOperationInBuffer","getUser","then","path","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.","connection","_initSessionsHandling","affectsData","6kNfYUo","_loadRoot","cs:removeUser","realtimecollaborationclient-error","_connectService","set","_lastSyncedOperationId","locale","_isEditingAllowed","_handleExternalOperations","Synchronization issue","get","attributes","_fetchMissingUsers","message","_compressOperations","disconnect","_operationToId","3017245rrWwUl","end","_applyOperationsSet","targetPosition","enableReadOnlyMode","applyOperation","initData","_bufferRootLoad","insert","getOperationAuthor","sendOperations","626794gszYPg","position","isDocumentOperation","removeFromReconnectionStack","_knownOperations","addToReconnectionStack","code","toJSON","_sendBufferedOperationsDelayed","collaboration.channelId","type","_shouldSendSelectionUpdate","disconnected","_addKnownRoot","entries","document","rtc-destroyed","_getAffectedRoot","InsertOperation","_bufferedOperations","markers","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.","metadata","isUndoneOperation","_lastServerVersion","sessionAdd:","remove","createRange","batch","RealTimeCollaborationClient","slice","model","off","unregister","_currentBufferDelay","_initThrowingOnDataSet","channelSessions","document:write","isReadOnly","Notification","forEach","selection","getConnectedSessions","_waitUntilSynced","offset","realtimecollaborationclient-sendbufferedoperations","lastOperationAcceptedAt","20808030buPJcg","sessionId","realtimecollaborationclient-init-session-connection-error","_handleInitialConnectionData","addUser","editing","real-time-collaboration","editor","wasUndone","reset","state","history","_sendBufferedOperations","pluginName","getIdOfTheLastOperation","ready","_clearPendingAction","startsWith","cloud-services-internal-error: Not connected.","realtimecollaborationclient-init-document-already-initialized","from","keys","_setUpDataInit","_handleServerResponse","8HvpwYo","affectedSelectable","isOfficialPlugin","7090137CRdJNT","length","collaboration","plugins","rootsAttributes","decompress","CollaborativeEditingService","_getOperationsFromInitData","getOperations","userId","parse","404","data","getRoot","PENDING_ACTION_SENDING_DATA","operationsReceived","_document","_hasSynchronizationProblem","map","filter","return","showWarning","cloud-services-internal-error: Request timeout.","cloudServices.bundleVersion","error","apply","_disconnectionOperations","disableReadOnlyMode","serverHistory","push","createRoot","_channelId","lastDocumentSession","has","stopListening","createdAt","destroy","_handleSendingSelectionMarkers","createPositionAt","connect","addRootAttribute","realtimecollaborationclient-handleserverresponse","string","collaboration-missing-channelid","_pendingAction","move","realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration","root","setIdForTheLastOperation","_isLoaded","permissions","_refreshUserSelectionMarkers","marker","_sendBufferedOperationsDelayId","init","compress","sessionCreatedAt","_operationIdentifier","connected","fire"];return(gs=function(){return e})()}!function(e){const t=ws,n=e();for(;;)try{if(722417===parseInt(t(470))/1+-parseInt(t(441))/2*(parseInt(t(413))/3)+-parseInt(t(350))/4+parseInt(t(357))/5+-parseInt(t(430))/6*(parseInt(t(459))/7)+parseInt(t(279))/8*(-parseInt(t(282))/9)+parseInt(t(255))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(gs);let bs=1;class Os extends t.Plugin{static[ys(288)]=(()=>wn)();[ys(344)];[ys(256)];[ys(310)];[ys(313)];[ys(379)];[ys(298)];[ys(356)];[ys(489)];[ys(474)];[ys(383)];[ys(326)];[ys(354)];[ys(335)];[ys(368)];[ys(242)];[ys(447)];[ys(308)];[ys(339)];static get[ys(358)](){return[Yn,Zn,hr,t.PendingActions,Fn.Users,r.Notification]}static get[ys(268)](){return ys(237)}static get[ys(281)](){return!0}static get[ys(411)](){return!0}get[ys(390)](){const e=ys;return this[e(232)]+this[e(344)]}get[ys(232)](){const e=ys;return this[e(310)][e(405)]-this[e(344)]}get[ys(399)](){const e=ys,t=this[e(310)][e(290)]();for(let n=t[e(283)]-1;n>=0;n--){const r=t[n];if(!this[e(308)][e(315)](r))return r[e(375)]+1-this[e(344)]}return 0}constructor(e){const t=ys;if(super(e),this[t(344)]=0,this[t(256)]=null,this[t(310)]=new s.History,this[t(262)][t(402)][t(361)](t(284),{}),this[t(313)]=this[t(262)][t(402)][t(452)](t(479)),!this[t(313)])throw new n.CKEditorError(t(325),this);const r=e[t(402)][t(452)](t(305))||n.version;this[t(379)]=new(Os[t(288)])(r,this[t(313)]),this[t(298)]=this[t(262)][t(239)][t(485)],this[t(356)]=new ms,this[t(489)]=[],this[t(474)]=new WeakSet,this[t(383)]=new Set,this[t(446)](t(388),!1),this[t(446)](t(299),!1),this[t(326)]=null,this[t(354)]=!1,this[t(335)]=null,this[t(368)]=300,this[t(242)]=this[t(368)],this[t(447)]=null,this[t(308)]=new WeakSet,this[t(339)]=new Ss(this[t(308)])}[ys(336)](){const e=ys,t=this[e(262)],n=t[e(285)][e(452)](Fn.Users),r=t[e(285)][e(452)](Yn);this[e(432)](n,e(468),(t,r)=>{const s=e,o=r[0];o[s(420)]&&(t[s(302)]=n[s(434)](o[s(420)]),t[s(384)]()),null===o[s(420)]&&(t[s(302)]=null,t[s(384)]())},{priority:e(389)}),this[e(432)](t[e(239)][e(485)][e(249)],e(352),(t,n)=>{const r=e;n[r(385)]&&this[r(333)]()}),this[e(432)](t[e(260)][e(378)],e(395),()=>{this[e(333)]()}),this[e(243)](),t[e(239)].on(e(464),(t,n)=>{const r=e,s=n[0];s[r(472)]&&(this[r(433)](s),this[r(410)]()&&this[r(478)]())}),this[e(277)](),this[e(391)](e(449)).to(r,e(265),this,e(299),(t,n)=>e(340)===t&&!n),this.on(e(423),()=>{const n=e;this[n(449)]?t[n(309)](n(364)):t[n(463)](n(364))}),this[e(449)]?t[e(309)](e(364)):t[e(463)](e(364)),this[e(446)](e(398),!1)}async[ys(415)](){const e=ys,t=this[e(262)][e(285)][e(452)](Zn),n=this[e(262)][e(285)][e(452)](Yn);try{this[e(388)]=!0,t[e(241)](this[e(313)]);const r=await this[e(379)][e(415)](n[e(438)],this[e(399)]);await this[e(397)](r)&&(this[e(388)]=!1,this[e(271)]());const s=await this[e(379)][e(250)]();t[e(346)](this[e(313)],s),this[e(319)](),this[e(398)]=!0}catch(t){if(function(t){const n=e;return n(293)===t[n(476)]}(t)&&this[e(256)])await this[e(429)]();else if(function(t){const n=e;return n(419)===t[n(476)]}(t)){const t=mr(this[e(262)][e(448)],e(371));this[e(421)](t)}else{if(!(t instanceof Is))throw t;this[e(421)]()}}}[ys(318)](){const e=ys,t=this[e(262)][e(285)][e(452)](Yn),n=this[e(262)][e(285)][e(452)](Zn);this[e(262)][e(463)](e(486)),n[e(244)][e(315)](this[e(313)])&&n[e(241)](this[e(313)]),t[e(473)](this),this[e(425)](),super[e(318)]()}async[ys(397)](e){const t=ys;if(this[t(256)]!==e[t(256)]&&this[t(447)]!==e[t(412)])throw new Is;return this[t(256)]=e[t(256)],this[t(278)]([],{...e,wereChangesApplied:!1,data:e[t(294)]},t(415))}async[ys(445)](e,t=!1){const n=ys,{connection:r}=this[n(262)][n(285)][n(452)](Yn);Os[n(288)][n(250)](r,this[n(313)])[n(435)](e=>this[n(439)](e))[n(403)](e=>{const t=n;this[t(360)](t(257),e)}),this[n(432)](this[n(379)],n(297),this[n(367)][n(391)](this)),this[n(432)](this[n(379)],n(306),(e,t)=>{const r=n;this[r(360)](r(387),t)}),this[n(432)](this[n(379)],n(482),()=>{this[n(398)]=!1});const s=this[n(339)][n(269)](e);this[n(388)]=!0;const o=await this[n(379)][n(321)](r,this[n(456)](e),s);if(this[n(256)]=o[n(256)],t){if(!o[n(418)])return void this[n(421)]();this[n(388)]=!1,this[n(271)](),this[n(310)][n(264)](),this[n(344)]=o[n(252)],this[n(310)][n(405)]=this[n(344)],await this[n(278)](e,o,n(408))}else await this[n(258)](o,e);this[n(319)](),this[n(398)]=!0}[ys(319)](){const e=ys,t=this[e(262)][e(285)][e(452)](Zn),n=this[e(262)][e(285)][e(452)](hr),r=t[e(244)][e(452)](this[e(313)]);r&&r[e(283)]>1?n[e(382)]():this[e(432)](t,e(233)+this[e(313)],()=>{const r=e;2===t[r(244)][r(452)](this[r(313)])[r(283)]&&n[r(382)]()})}async[ys(367)](e,t,n,r){const s=ys;if(!this[s(388)]&&this[s(298)][s(405)]==t){const e=this[s(369)](n,r);await this[s(454)](e),this[s(450)](e,t,n[s(412)])||this[s(360)](s(363))}}async[ys(429)](){const e=ys;this[e(425)]();const{locale:t}=this[e(262)];let n;try{n=await this[e(379)][e(427)]()}catch{const n=mr(t,e(376));return void this[e(421)](n)}const r=n[e(392)]||n[e(314)];if(this[e(447)]!==r[e(412)]){const n=mr(t,e(437));return void this[e(421)](n)}await this[e(445)](this[e(262)][e(239)][e(485)][e(266)][e(290)](),!0)}[ys(425)](){const e=ys;this[e(379)][e(457)](),this[e(489)]=[],clearTimeout(this[e(335)]),this[e(316)](this[e(379)])}[ys(439)](e){const t=ys,n=this[t(262)][t(285)][t(452)](Zn);this[t(432)](n,t(233)+this[t(313)],(e,{session:r})=>{const s=t;if(r.id===n[s(428)]){e[s(240)]();const t=this[s(262)][s(285)][s(315)](s(407))&&this[s(262)][s(285)][s(452)](s(407));let n=r[s(332)];t&&t[s(345)]&&(n=n[s(301)](e=>s(245)!==e)),this[s(262)][s(285)][s(452)](s(394))[s(366)](n,this[s(313)])}}),n[t(346)](this[t(313)],e)}[ys(243)](){const e=ys,t=this[e(262)][e(294)][e(446)];this[e(262)][e(294)][e(446)]=(...r)=>{const s=e;if(!r[r[s(283)]-1][s(365)])throw new n.CKEditorError(s(328),this);t[s(307)](this[s(262)][s(294)],r)}}[ys(277)](){const e=ys;this[e(262)][e(294)].on(e(336),(t,[r])=>{const o=e;if(this[o(298)][o(405)])throw new n.CKEditorError(o(274),this);t[o(384)](),this[o(348)]();const i=this[o(262)][o(402)][o(452)](o(286)),a=this[o(289)](r,i);0==a[o(283)]&&a[o(311)](new s.NoOperation(0)),t[o(302)]=this[o(445)](a)[o(435)](()=>{const e=o;this[e(262)][e(285)][e(452)](Yn)[e(475)](this),this[e(262)][e(294)][e(341)](e(270))})[o(403)](e=>this[o(360)](o(424),e))[o(362)](()=>this[o(271)]())},{priority:e(389)}),this[e(262)].on(e(393),async(t,[n,r])=>{const s=e;t[s(384)]();const o=this[s(262)][s(239)][s(485)][s(295)](n);if(!this[s(383)][s(315)](n)){const e=r&&r[s(294)]?r[s(294)]:"",t=r&&r[s(453)]?r[s(453)]:{};await this[s(442)](n,e,t)}this[s(262)][s(239)][s(342)]({isUndoable:!1},()=>{const e=s;o[e(331)]=!0,this[e(262)][e(239)][e(485)][e(347)][e(466)](o)})},{priority:e(389)})}async[ys(454)](e){const t=ys,n=this[t(262)][t(285)][t(452)](Fn.Users),{connection:r}=this[t(262)][t(285)][t(452)](Yn),s=new Set;for(const r of e){const e=r[t(420)];e&&!n[t(434)](e)&&s[t(409)](e)}if(0===s[t(355)])return;const o=await b[t(353)](r,Array[t(275)](s));for(const e of o)n[t(434)](e.id)||n[t(259)](e)}[ys(289)](e,t={}){const r=ys,o=this[r(262)][r(239)],i=[];let a=0;const c=r(324)==typeof e?{main:e}:e;for(const e of Object[r(276)](c)){if(!this[r(298)][r(380)][r(315)](e))throw new n.CKEditorError(r(372),this);const t=this[r(262)][r(294)][r(292)](c[e]),d=this[r(298)][r(295)](e),u=new s.InsertOperation(o[r(320)](d,0),t,a++);i[r(311)](u);for(const[e,n]of t[r(490)]){const t=o[r(235)](o[r(401)](d,n[r(373)][r(436)][r(238)]()),o[r(401)](d,n[r(460)][r(436)][r(238)]())),c=new s.MarkerOperation(e,null,t,o[r(490)],!0,a++);i[r(311)](c)}}if(t)for(const[e,c]of Object[r(484)](t)){const t=o[r(485)][r(295)](e);if(!t)throw new n.CKEditorError(r(377),null);for(const[e,n]of Object[r(484)](c))if(null!==n){const o=new s.RootAttributeOperation(t,e,null,n,a++);i[r(311)](o)}}return i}async[ys(442)](e,t,n){const r=ys;this[r(289)]({[e]:t},{[e]:n})[r(248)]((e,t)=>{const n=r;e[n(375)]=this[n(298)][n(405)]+t,e[n(414)]=!0,this[n(433)](e)}),this[r(478)](),await this[r(251)]()}async[ys(258)](e,t){const n=ys;let r;this[n(344)]=e[n(252)];const s=e[n(418)]&&!e[n(465)],o=s?0:e[n(294)][n(375)];if(t[n(248)](t=>{const r=n;t[r(414)]=!0,t[r(317)]=e[r(338)],t[r(420)]=null}),s)r=t,this[n(461)](r,s);else{if(e[n(465)]){const t=this[n(289)](e[n(465)]);this[n(298)][n(266)][n(405)]=-t[n(283)],t[n(248)](r=>{const s=n;r[s(375)]-=t[s(283)],r[s(317)]=e[s(338)],r[s(414)]=!0,r[s(420)]=null}),this[n(461)](t,!0),this[n(310)][n(405)]=-t[n(283)]+this[n(344)],this[n(359)](t)}this[n(298)][n(266)][n(405)]=o,r=this[n(369)](e[n(294)],e[n(492)]),await this[n(454)](r),this[n(461)](r,s)}e[n(412)]&&(this[n(339)][n(330)](r,e[n(412)]),this[n(447)]=e[n(412)]),this[n(310)][n(405)]=o+this[n(344)],this[n(359)](r),t[n(301)](e=>{const t=n,r=this[t(487)](e);return r&&!this[t(383)][t(315)](r)})[n(248)]((e,t)=>{const r=n;e[r(375)]=this[r(298)][r(405)]+t,this[r(433)](e)}),this[n(410)]()?(this[n(242)]=0,this[n(478)](!0),await this[n(251)]()):(this[n(388)]=!1,this[n(271)]())}[ys(360)](e,t){const r=ys,s=t&&t[r(455)];if(s&&s[r(272)](r(400)))throw t;const o=this[r(262)][r(285)][r(452)](Yn);throw this[r(388)]=!0,o[r(457)](),this[r(262)][r(463)](r(444)),new n.CKEditorError(e,this[r(262)],s?{originalError:s}:void 0)}[ys(433)](e){const t=ys;this[t(474)][t(315)](e)||(this[t(474)][t(409)](e),this[t(489)][t(311)](e),this[t(326)]||t(334)==e[t(480)]&&!e[t(440)]||this[t(348)]())}[ys(478)](e=!1){const t=ys;!e&&this[t(388)]||(this[t(388)]=!0,clearTimeout(this[t(335)]),this[t(335)]=setTimeout(()=>{const e=t;this[e(267)]()[e(435)](t=>{const n=e;t&&(this[n(271)](),this[n(388)]=!1)})[e(403)](t=>{const n=e;this[n(271)](),this[n(388)]=!1,function(e){const t=n;return e[t(455)][t(272)](t(273))||e[t(455)][t(272)](t(370))||e[t(455)][t(272)](t(304))}(t)||this[n(360)](t[n(455)],t)})},this[t(242)]))}[ys(251)](){return new Promise(e=>{const t=ws;this.on(t(349),()=>{e()})})}async[ys(267)](){const e=ys,t=this[e(262)][e(285)][e(452)](hr);if(this[e(481)]()&&(t[e(382)](),this[e(354)]=!1),!this[e(410)]())return!0;const n=[...this[e(489)]];for(const t of n)t[e(263)]=this[e(298)][e(266)][e(493)](t);const r=this[e(339)][e(269)](n),s=bs++,o=this[e(456)](n),i=await this[e(379)][e(469)](o,o[e(375)],r);try{return await this[e(278)](n,i,s)}catch(t){return this[e(360)](e(253),t)}}async[ys(278)](e,t,n){const r=ys;if(r(306)in t)throw t[r(306)];let s=!1;if(t[r(418)]){t[r(412)]&&(this[r(447)]=t[r(412)]),this[r(489)]=this[r(489)][r(301)](t=>!e[r(426)](t));for(const n of e)n[r(317)]=r(254)in t&&t[r(254)]||void 0;vs(e,t[r(405)]-e[r(283)]),this[r(359)](e);const n=e[r(301)](e=>{const t=r;if(!e[t(414)])return!1;const n=this[t(487)](e);return n&&!this[t(383)][t(315)](n)});vs(n,this[r(298)][r(405)]),this[r(461)](n),s=!0,this[r(242)]=this[r(368)]}else{const e=this[r(369)](t[r(294)],t[r(492)])[r(301)](e=>e[r(375)]>=this[r(232)]);e[r(248)](e=>this[r(483)](e)),this[r(489)]=this[r(489)][r(301)](e=>!e[r(414)]||!this[r(383)][r(315)](this[r(487)](e))),this[r(489)][r(283)]&&vs(this[r(489)],this[r(489)][0][r(375)]),await this[r(454)](e),s=this[r(450)](e,t[r(405)],t[r(412)]),this[r(242)]=Math[r(396)](this[r(242)]/2)}return s?!this[r(410)]()||(this[r(478)](!0),!1):this[r(360)](r(323))}[ys(450)](e,t,n){const r=ys;try{const o={document:this[r(298)],useRelations:!1,padWithNoOps:!0},{operationsA:i,operationsB:a,originalOperations:c}=(0,s.transformOperationSets)(e,this[r(489)],o);vs(i,this[r(298)][r(405)]),vs(a,t);for(const e of i){const t=c[r(452)](e);e[r(420)]=t?t[r(420)]:null}n&&(this[r(339)][r(330)](e,n),this[r(447)]=n),this[r(489)]=[...a],this[r(461)](i),this[r(359)](e)}catch(e){return console[r(306)](e),!1}return!0}[ys(461)](e,t=!1){const n=ys;this[n(262)][n(239)][n(342)]({isUndoable:!1,isLocal:!1},t=>{const r=n;for(const n of e)this[r(474)][r(409)](n),this[r(483)](n),t[r(236)][r(417)](n),this[r(262)][r(239)][r(464)](n)})}[ys(483)](e){const t=ys,n=this[t(487)](e);n&&this[t(383)][t(409)](n)}[ys(487)](e){const t=ys;let n,r;switch(e[t(480)]){case t(467):n=e[t(471)][t(329)];break;case t(334):if(r=e[t(381)],!r)return null;n=r[t(329)];break;case t(322):n=e[t(329)];break;case t(422):n=e[t(280)];break;case t(327):n=e[t(462)][t(329)];break;default:return null}return n[t(374)]}[ys(359)](e){const t=ys;e[t(248)](e=>{const n=t,r=e[n(351)]();r[n(420)]=e[n(420)],r[n(414)]=!!e[n(414)],r[n(317)]=e[n(317)],r[n(375)]+=this[n(344)],e[n(343)]&&this[n(308)][n(409)](r),this[n(310)][n(417)](r)})}[ys(421)](e){const t=ys,n=this[t(262)][t(285)][t(452)](t(247)),r=this[t(262)][t(448)];e||(e=mr(r,t(491))),n[t(303)](e,{title:mr(r,t(451)),namespace:t(261)}),this[t(299)]=!0,clearTimeout(this[t(335)]),this[t(489)]=[],this[t(262)][t(285)][t(452)](Yn)[t(457)]()}[ys(348)](){const e=ys;this[e(326)]||(this[e(326)]=this[e(262)][e(285)][e(452)](t.PendingActions)[e(409)](mr(this[e(262)][e(448)],e(296))))}[ys(271)](){const e=ys;this[e(326)]&&(this[e(262)][e(285)][e(452)](t.PendingActions)[e(234)](this[e(326)]),this[e(326)]=null)}[ys(456)](e){const t=ys,n=e[t(300)](e=>e[t(477)]());return this[t(356)][t(337)](n)}[ys(369)](e,t){const n=ys;return this[n(356)][n(287)](e)[n(300)]((e,r)=>{const o=n,i=o(336)==t[r][o(480)];if(o(488)==e[o(386)]){const t=e[o(471)][o(329)];!this[o(298)][o(295)](t)&&(this[o(298)][o(312)](o(431),t)[o(404)]=!1)}const a=s.OperationFactory[o(406)](e,this[o(298)]);return a[o(263)]=e[o(263)],a[o(414)]=i,a[o(420)]=i?null:t[r][o(291)],a[o(343)]=o(443)===t[r][o(480)],a[o(317)]=t[r][o(317)],a})}[ys(333)](){const e=ys;this[e(354)]=!0,this[e(481)]()?this[e(478)]():this[e(354)]=!1}[ys(481)](){const e=ys,t=this[e(262)][e(285)][e(452)](Zn)[e(244)][e(452)](this[e(313)]);return!this[e(262)][e(246)]&&!!t&&t[e(283)]>1&&this[e(354)]}[ys(410)](){const e=ys;return this[e(489)][e(283)]>0||this[e(481)]()}}function ws(e,t){const n=gs();return(ws=function(e,t){return n[e-=232]})(e,t)}class Is extends Error{}function vs(e,t){const n=ys;for(const r of e)r[n(375)]=t++}class Ss{[ys(416)];[ys(458)];constructor(e){const t=ys;this[t(416)]=e,this[t(458)]=new WeakMap}[ys(269)](e){const t=ys;let r=e[t(283)];for(;r--;){const s=e[r];if(!this[t(416)][t(315)](s)){if(!this[t(458)][t(315)](s)){const e=(0,n.uid)()[t(238)](1,18);this[t(458)][t(446)](s,e)}return this[t(458)][t(452)](s)}}}[ys(330)](e,t){const n=ys;if(!t)return;let r=e[n(283)];for(;r--;){const s=e[r];this[n(416)][n(315)](s)||this[n(458)][n(446)](s,t)}}}function ks(){var e=["375625LLencZ","3678GnfkND","18aqiZSa","33480xTPWor","RealTimeCollaborativeEditing","3577XcthRi","526510uHnmhZ","836216cNhRMV","1636782ZVBCxu","15PPrpEt","pluginName","requires","isPremiumPlugin","isOfficialPlugin","286488ScmJQi"];return(ks=function(){return e})()}var Ps=As;function As(e,t){var n=ks();return(As=function(e,t){return n[e-=116]})(e,t)}!function(e){for(var t=As,n=e();;)try{if(277125===-parseInt(t(117))/1*(-parseInt(t(126))/2)+parseInt(t(116))/3+-parseInt(t(122))/4+parseInt(t(123))/5+parseInt(t(124))/6*(-parseInt(t(128))/7)+-parseInt(t(130))/8+parseInt(t(125))/9*(-parseInt(t(129))/10))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(ks);class Ts extends t.Plugin{static get[Ps(119)](){return[Os]}static get[Ps(118)](){return Ps(127)}static get[Ps(121)](){return!0}static get[Ps(120)](){return!0}}const _s=Es;!function(e){const t=Es,n=e();for(;;)try{if(769596===-parseInt(t(274))/1*(parseInt(t(207))/2)+parseInt(t(226))/3*(parseInt(t(189))/4)+-parseInt(t(276))/5*(parseInt(t(292))/6)+-parseInt(t(233))/7+parseInt(t(208))/8*(-parseInt(t(196))/9)+parseInt(t(262))/10*(-parseInt(t(290))/11)+parseInt(t(272))/12*(parseInt(t(247))/13))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(js);class Cs extends t.ContextPlugin{static[_s(269)]=(()=>Gn)();[_s(230)];static get[_s(238)](){return[Yn,_s(225),Zn,Fn.Users]}static get[_s(236)](){return _s(284)}static get[_s(271)](){return!0}static get[_s(280)](){return!0}constructor(e){const t=_s;super(e),this[t(230)]=new Map}async[_s(248)](){const e=_s,n=this[e(214)],r=n[e(216)][e(234)](e(225));if(n[e(216)][e(234)](Yn)[e(201)](this),r[e(221)]={addCommentThread:async({channelId:t,threadId:n,comments:r,resolvedAt:s,resolvedBy:o,context:i,attributes:a})=>{const c=e,d=await this[c(241)](t)[c(231)]({commentThreadId:n,comments:r[c(243)](e=>function(e,t,n){const r=c;return{commentThreadId:n,commentId:e[r(278)],userId:e[r(222)],content:e[r(203)],documentId:t,createdAt:e[r(202)],attributes:e[r(209)]||{}}}(e,t,n)),resolvedAt:s,resolvedBy:o,context:i,attributes:a})[c(261)](xs);return{threadId:d[c(193)],comments:d[c(275)]}},getCommentThread:async({channelId:t,threadId:n})=>{const r=e,s=await this[r(241)](t)[r(215)](n)[r(261)](xs);return s[r(206)]?null:(await this[r(249)]([s]),{threadId:s[r(193)],comments:s[r(275)][r(243)](Rs),context:s[r(214)],resolvedAt:s[r(250)],resolvedBy:s[r(258)],attributes:s[r(209)]||{}})},updateCommentThread:async({channelId:t,threadId:n,context:r,unlinkedAt:s,attributes:o})=>this[e(241)](t)[e(190)]({commentThreadId:n,context:r,attributes:o,unlinkedAt:s})[e(261)](Ds)[e(261)](xs),resolveCommentThread:async({channelId:t,threadId:n})=>{const r=e,s=await this[r(241)](t)[r(257)](n)[r(261)](Ds)[r(261)](xs);return{threadId:s[r(193)],resolvedAt:s[r(250)],resolvedBy:s[r(258)]}},reopenCommentThread:async({channelId:t,threadId:n})=>this[e(241)](t)[e(283)](n)[e(261)](Ds)[e(261)](xs),removeCommentThread:({channelId:t,threadId:n})=>this[e(241)](t)[e(188)](n)[e(261)](Ds)[e(261)](xs),addComment:({channelId:t,threadId:n,commentId:r,content:s,attributes:o})=>this[e(241)](t)[e(192)](n,r,s,o)[e(261)](xs),updateComment:({channelId:t,threadId:n,commentId:r,content:s,attributes:o})=>this[e(241)](t)[e(200)](n,r,s,o)[e(261)](Ds)[e(261)](xs),removeComment:({channelId:t,threadId:n,commentId:r})=>this[e(241)](t)[e(235)](n,r)[e(261)](Ds)[e(261)](xs)},n instanceof t.Context){const t=n[e(195)][e(234)](e(204)),r=n[e(216)][e(234)](Zn);await this[e(255)](t);const s=await this[e(230)][e(234)](t)[e(268)]();this[e(197)](r,e(263)+t,(n,{session:s})=>{const o=e;s.id===r[o(285)]&&(n[o(219)](),this[o(214)][o(216)][o(234)](o(281))[o(256)](s[o(199)],t))}),r[e(246)](t,s)}}async[_s(255)](e){const t=_s;if(this[t(230)][t(245)](e))throw new n.CKEditorError(t(220),null,{channelId:e});const r=this[t(214)][t(216)][t(234)](t(225)),s=new(Cs[t(269)])(e);this[t(230)][t(244)](e,s),this[t(197)](s,t(224),(e,n)=>{const s=t,{commentThreadId:o,documentId:i,context:a,attributes:c,resolvedAt:d,resolvedBy:u,comments:l}=n;r[s(215)](o)||r[s(231)]({threadId:o,channelId:i,comments:l?l[s(243)](Rs):[],context:a,attributes:c,resolvedAt:d,resolvedBy:u,isFromAdapter:!0})}),this[t(197)](s,t(194),(e,{commentThreadId:n,documentId:s,context:o,unlinkedAt:i,attributes:a})=>{const c=t;r[c(215)](n)&&r[c(190)]({threadId:n,channelId:s,context:o,unlinkedAt:i,attributes:a,isFromAdapter:!0})}),this[t(197)](s,t(198),(e,{commentThreadId:n,resolvedBy:s,resolvedAt:o})=>{const i=t,a=r[i(215)](n);a&&a[i(251)]({resolvedBy:s,resolvedAt:o,isFromAdapter:!0})}),this[t(197)](s,t(254),(e,{commentThreadId:n})=>{const s=t,o=r[s(215)](n);o&&o[s(191)]({isFromAdapter:!0})}),this[t(197)](s,t(237),(e,{commentThreadId:n})=>{const s=t,o=r[s(215)](n);o&&o[s(279)]({isFromAdapter:!0})}),this[t(197)](s,t(252),(e,n)=>{const s=t,o=n[s(193)],i=r[s(215)](o);i&&i[s(192)]({...Rs(n),isFromAdapter:!0})}),this[t(197)](s,t(264),(e,{commentThreadId:n,commentId:s,content:o,attributes:i})=>{const a=t,c=r[a(215)](n);if(c){const e=c[a(266)](s);e&&e[a(213)]({content:o,attributes:i,isFromAdapter:!0})}}),this[t(197)](s,t(291),(e,{commentThreadId:n,commentId:s})=>{const o=t,i=r[o(215)](n);if(i){const e=i[o(266)](s);e&&e[o(279)]({isFromAdapter:!0})}}),await this[t(239)](e)}[_s(277)](){const e=_s;if(this[e(214)]instanceof t.Context){const t=this[e(214)][e(195)][e(234)](e(204));this[e(289)](t)}}[_s(289)](e){const t=_s;if(!this[t(230)][t(245)](e))throw new n.CKEditorError(t(229),null,{channelId:e});this[t(241)](e)[t(287)](),this[t(230)][t(288)](e)}async[_s(232)](){const e=_s;for(const t of this[e(230)][e(240)]())await this[e(239)](t);if(this[e(214)]instanceof t.Context){const t=this[e(214)][e(195)][e(234)](e(204)),n=this[e(214)][e(216)][e(234)](Zn);n[e(265)](t);const r=await this[e(230)][e(234)](t)[e(268)]();n[e(246)](t,r)}}async[_s(239)](e){const t=_s,{connection:n}=this[t(214)][t(216)][t(234)](Yn),r=this[t(214)][t(216)][t(234)](t(225)),s=this[t(230)][t(234)](e),o=await s[t(205)](n);await this[t(249)](o);const i=new Set(Array[t(286)](r[t(273)]({channelId:e}),e=>e.id));for(const e of o)e[t(206)]||i[t(288)](e[t(193)]);for(const e of i)r[t(215)](e)[t(279)]({isFromAdapter:!0});for(const n of o){let s=r[t(215)](n[t(193)]);const{commentThreadId:o,context:i,attributes:a,resolvedBy:c,resolvedAt:d,unlinkedAt:u,deletedAt:l}=n;if(l)continue;s||(s=r[t(231)]({channelId:e,threadId:o,context:i,attributes:a||{},resolvedBy:c,resolvedAt:d,unlinkedAt:u,isFromAdapter:!0}));const p=new Set(Array[t(286)](s[t(275)],e=>e.id));for(const e of n[t(275)])p[t(288)](e[t(278)]);for(const e of p)s[t(266)](e)[t(279)]({isFromAdapter:!0});for(const e of n[t(275)]){const n=s[t(266)](e[t(278)]);n?n[t(203)]!==e[t(203)]&&n[t(213)]({content:e[t(203)],isFromAdapter:!0}):s[t(192)](Object[t(228)](Rs(e),{isFromAdapter:!0}))}}}[_s(241)](e){const t=_s;if(!this[t(230)][t(245)](e))throw new n.CKEditorError(t(227),null,{channelId:e});return this[t(230)][t(234)](e)}async[_s(249)](e){const t=_s,n=this[t(214)][t(216)][t(234)](Fn.Users),{connection:r}=this[t(214)][t(216)][t(234)](Yn),s=new Set;for(const{resolvedBy:r,comments:o}of e){r&&!n[t(260)](r)&&s[t(267)](r);for(const{userId:e}of o)n[t(260)](e)||s[t(267)](e)}if(0===s[t(282)])return;const o=await b[t(242)](r,Array[t(286)](s));for(const e of o)n[t(260)](e.id)||n[t(212)](e)}}function js(){const e=["unregister","getComment","add","getConnectedSessions","CommentsService","cloud-services-internal-error: Request timeout.","isOfficialPlugin","2664KEGXDP","getCommentThreads","61062lJVYpj","comments","369680YECzLX","destroy","commentId","remove","isPremiumPlugin","Permissions","size","reopenCommentThread","CloudServicesCommentsAdapter","mySessionId","from","disconnect","delete","_terminateService","11342122bplaCS","commentRemoved","66dskxWC","removeCommentThread","5473848CRmViE","updateCommentThread","reopen","addComment","commentThreadId","commentThreadUpdated","config","47844yFELWG","listenTo","commentThreadResolved","permissions","updateComment","addToReconnectionStack","createdAt","content","collaboration.channelId","connect","deletedAt","2LUoUwk","1504essVMh","attributes","userId","404","addUser","update","context","getCommentThread","plugins","message","startsWith","off","cloudservicescommentsadapter-connect-already-connected","adapter","authorId","cloud-services-internal-error: Not connected.","commentThreadAdded","CommentsRepository","3Wenbrc","cloudservicescommentsadapter-service-not-exist","assign","cloudservicescommentsadapter-disconnect-not-exist","_services","addCommentThread","reconnect","10667594vkijJT","get","removeComment","pluginName","commentThreadRemoved","requires","_connectService","keys","_getService","getMany","map","set","has","register","224276XoPUcK","init","_fetchMissingUsersForThreads","resolvedAt","resolve","commentAdded","code","commentThreadReopened","_setUpService","setPermissions","resolveCommentThread","resolvedBy","cloud-services-internal-error: Comments Service is not connected.","getUser","catch","10spCjSc","sessionAdd:","commentUpdated"];return(js=function(){return e})()}function Es(e,t){const n=js();return(Es=function(e,t){return n[e-=188]})(e,t)}async function Ds(e){const t=_s;if(t(211)!==e[t(253)])throw e}function xs(e){const t=_s;if((n=e)[t(217)][t(218)](t(259))||n[t(217)][t(218)](t(223))||n[t(217)][t(218)](t(270)))return new Promise(()=>{});var n;throw e}function Rs(e){const t=_s;return{threadId:e[t(193)],commentId:e[t(278)],content:e[t(203)],createdAt:e[t(202)],authorId:e[t(210)],attributes:e[t(209)]||{}}}const Ns=Vs;function Vs(e,t){const n=Ms();return(Vs=function(e,t){return n[e-=327]})(e,t)}function Ms(){const e=["then","connection","isOfficialPlugin","2203983JCfgOo","connected","1870816usKbyw","cloud-services-internal-error: Request timeout.","isConnected","reconnect","find","data","off","addToReconnectionStack","startsWith","getMany","_bufferedRequests","add","init","catch","_fetchMissingUsersForThreads","type","state","30oIyQzp","suggestionUpdated","_waitForServiceReady","requires","addSuggestionData","2037oUcUjV","get","size","delete","getUser","connect","config","TrackChangesService","values","adapter","plugins","open","set","from","pluginName","listenTo","CloudServicesTrackChangesAdapter","addUser","collaboration.channelId","editor","_saved","79064TPWjYf","hasSuggestion","59154zFILPA","update","isPremiumPlugin","originalSuggestionId","TrackChangesEditing","484YWmwFP","cloud-services-internal-error: Not connected.","message","790449wGIdln","_trackChangesService","173789TTkmUv","getSuggestion","attributes"];return(Ms=function(){return e})()}!function(e){const t=Vs,n=e();for(;;)try{if(263137===parseInt(t(372))/1*(parseInt(t(337))/2)+parseInt(t(340))/3+parseInt(t(330))/4+-parseInt(t(367))/5*(parseInt(t(332))/6)+parseInt(t(342))/7+-parseInt(t(350))/8+-parseInt(t(348))/9)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Ms);class Bs extends t.Plugin{static[Ns(379)]=(()=>Qt)();[Ns(360)];[Ns(341)];static get[Ns(370)](){return[Cs,Ns(336),Yn]}static get[Ns(386)](){return Ns(388)}static get[Ns(347)](){return!0}static get[Ns(334)](){return!0}constructor(e){const t=Ns;super(e);const n=this[t(328)][t(378)][t(373)](t(327));this[t(360)]=new Map,this[t(341)]=new(Bs[t(379)])(n)}[Ns(362)](){const e=Ns,t=this[e(328)][e(382)][e(373)](Yn),n=this[e(328)][e(382)][e(373)](e(336));return n[e(381)]={getSuggestion:async t=>{const n=e;await this[n(369)]();const r=await this[n(341)][n(373)](t)[n(363)](Us);return await this[n(364)]([r]),r},addSuggestion:async({id:t,type:n,data:r,originalSuggestionId:s,attributes:o})=>{const i=e;await this[i(369)]();const a={id:t,type:n,data:r,originalSuggestionId:s,attributes:o},c=await this[i(341)][i(361)](t,n,r,s,o)[i(363)](e=>{if(Js(e))return new Promise(e=>{const n=Vs;this[n(360)][n(384)](t,{resolve:e,suggestionData:a})});throw e});return this[i(360)][i(375)](t),c},updateSuggestion:async(t,n)=>{const r=e;if(await this[r(369)](),r(383)!==n[r(366)])return this[r(341)][r(333)](t,n)[r(363)](Us)}},this[e(387)](this[e(341)],e(368),(t,r)=>{const s=e;n[s(331)](r.id)&&(n[s(343)](r.id)[s(344)]=r[s(344)])}),this[e(341)][e(377)](t[e(346)])[e(345)](r=>(t[e(357)](this),this[e(364)](r)[e(345)](()=>{const t=e;for(const e of r)n[t(371)](e)[t(329)]=!0})))}async[Ns(353)](){const e=Ns,t=this[e(328)][e(382)][e(373)](e(336)),{connection:n}=this[e(328)][e(382)][e(373)](Yn),r=await this[e(341)][e(377)](n);await this[e(364)](r);for(const{suggestionData:t,resolve:n}of this[e(360)][e(380)]()){let s=r[e(354)](e=>e.id===t.id);s||(s=await this[e(341)][e(361)](t.id,t[e(365)],t[e(355)],t[e(335)])),n(s)}for(const n of r)t[e(331)](n.id)||t[e(371)](n)}async[Ns(369)](){const e=Ns;this[e(341)][e(352)]||await new Promise(t=>{const n=e;this[n(387)](this[n(341)],n(349),e=>{e[n(356)](),t()})})}async[Ns(364)](e){const t=Ns,n=this[t(328)][t(382)][t(373)](Fn.Users),{connection:r}=this[t(328)][t(382)][t(373)](Yn),s=new Set;for(const{authorId:r}of e)n[t(376)](r)||s[t(361)](r);if(0===s[t(374)])return;const o=await b[t(359)](r,Array[t(385)](s));for(const e of o)n[t(376)](e.id)||n[t(389)](e)}}function Us(e){if(Js(e))return new Promise(()=>{});throw e}function Js(e){const t=Ns;return e[t(339)][t(358)](t(338))||e[t(339)][t(358)](t(351))}function qs(e,t){const n=Ls();return(qs=function(e,t){return n[e-=470]})(e,t)}const Gs=qs;function Ls(){const e=["listenTo","destroy","86mpGQMs","594SdiMDQ","Comments","5665572UjwrTb","once","CommentsRepository","CommentsEditing","isOfficialPlugin","ready","4367268cfvYRU","switchReadOnly","7WTgZoA","plugins","4536816esPfvx","connected","init","_setUpService","isPremiumPlugin","RealTimeCollaborativeComments","change:state","72652CTIrfB","config","collaboration.channelId","980OMksdj","9KYgeRG","41145qUcyOj","get","requires","6378670VewfWL","3WiLPif","data","_terminateService","pluginName","isThreadsLoadingPaused","editor"];return(Ls=function(){return e})()}!function(e){const t=qs,n=e();for(;;)try{if(512670===-parseInt(t(478))/1*(-parseInt(t(492))/2)+-parseInt(t(484))/3*(parseInt(t(475))/4)+parseInt(t(480))/5*(parseInt(t(493))/6)+parseInt(t(503))/7*(-parseInt(t(505))/8)+-parseInt(t(479))/9*(parseInt(t(483))/10)+parseInt(t(495))/11+parseInt(t(501))/12)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Ls);class Ys extends t.Plugin{static get[Gs(482)](){return[Gs(494),Cs,Ts,Yn]}static get[Gs(487)](){return Gs(473)}static get[Gs(499)](){return!0}static get[Gs(472)](){return!0}[Gs(470)](){const e=Gs,t=this[e(489)][e(504)][e(481)](Yn),n=this[e(489)][e(504)][e(481)](e(498)),r=this[e(489)][e(504)][e(481)](Cs);return this[e(489)][e(485)][e(496)](e(500),()=>{const r=e;this[r(490)](t,r(474),(e,t,s)=>{const o=r;n[o(488)]=o(506)!==s})}),this[e(490)](t,e(474),(t,n,r)=>{const s=e;this[s(489)][s(504)][s(481)](s(497))[s(502)](s(506)!==r)}),r[e(471)](this[e(489)][e(476)][e(481)](e(477)))}[Gs(491)](){const e=Gs;this[e(489)][e(504)][e(481)](Cs)[e(486)](this[e(489)][e(476)][e(481)](e(477))),super[e(491)]()}}var Hs=Fs;function zs(){var e=["4DXihJs","12371984NfvMdv","pluginName","requires","isOfficialPlugin","77838xBKbaL","TrackChanges","RealTimeCollaborativeTrackChanges","47360JRQMuR","87hHCqsW","720mYAFCB","25362458IDVGWW","6353055mUhwrd","658zbTusV","isPremiumPlugin","654GCPmca","343406kWQSDs"];return(zs=function(){return e})()}function Fs(e,t){var n=zs();return(Fs=function(e,t){return n[e-=334]})(e,t)}!function(e){for(var t=Fs,n=e();;)try{if(928042===-parseInt(t(342))/1+-parseInt(t(348))/2*(-parseInt(t(335))/3)+-parseInt(t(343))/4*(-parseInt(t(338))/5)+-parseInt(t(341))/6*(-parseInt(t(339))/7)+parseInt(t(344))/8+-parseInt(t(336))/9*(parseInt(t(334))/10)+-parseInt(t(337))/11)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(zs);class Ks extends t.Plugin{static get[Hs(346)](){return[Ys,Bs,Hs(349)]}static get[Hs(345)](){return Hs(350)}static get[Hs(347)](){return!0}static get[Hs(340)](){return!0}}const Ws=Zs;function Qs(){const e=["type","_bufferUpdate","isEnabled","getRevisions","_handleReconnectionError","requires","_getLatestVersion","4axjHqD","serverHistory","_isConnected","creatorId","_lastRequestId","createdAt","off","updateRevisions","reverse","RevisionTracker","9IFBvwr","repository","_createCurrentRevision","pluginName","sessionId","reInit","getUser","_waitForServiceReady","_preventResendingRevisionData","length","wrongRequestId","adapter","change:_isConnected","_getLatestVersionFromServerOperations","connect","message","fromVersion","bind","_startingVersion","change:_isPendingUpdate","buildRevisionData","RevisionHistory","size","5095705cyOFLi","init","catch","733140isjLAG","_revisions","diffData","getMany","startsWith","affectsData","_update","setSource","keys","authors","552FLqgkO","marker","_bufferedUpdates","cloud-services-internal-error: Request timeout.","_revisionDataBuilder","4313716JCDDrg","code","isConnected","remove","state","has","plugins","setRevisionData","isPremiumPlugin","17885290SHmjpj","400","currentRevision","CONNECTED","RevisionHistoryService","getRevision","reconnect","isEmptyCurrent","baseVersion","connected","editor","_fixRevision","destroy","_handleRevisionsUpdate","_revisionHistoryService","addUser","map","max","data","CloudServicesRevisionHistoryAdapter","cloud-services-internal-error: Not connected.","from","_offset","addRevisionData","addToReconnectionStack","connection","1171125XlJzlc","authorsIds","once","_oldOffset","isOfficialPlugin","_isPendingUpdate","_fetchMissingUsers","config","listenTo","6692496rLHpBH","cloudServices.bundleVersion","sendBufferedUpdates","get","add","_revisionTracker","isBundleUploaded","getOperations","toVersion","collaboration.channelId","then","122017cwoMZl","revisionsUpdated","cloud-services-internal-error: Revision History Service is not connected."];return(Qs=function(){return e})()}function Zs(e,t){const n=Qs();return(Zs=function(e,t){return n[e-=264]})(e,t)}!function(e){const t=Zs,n=e();for(;;)try{if(636524===-parseInt(t(270))/1+-parseInt(t(350))/2*(-parseInt(t(320))/3)+parseInt(t(285))/4+-parseInt(t(267))/5+parseInt(t(329))/6+parseInt(t(340))/7*(parseInt(t(280))/8)+-parseInt(t(360))/9*(parseInt(t(294))/10))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Qs);class $s extends t.Plugin{static[Ws(298)]=(()=>Vt)();[Ws(354)];[Ws(334)];[Ws(308)];[Ws(323)];static get[Ws(348)](){return[Yn,Os,Ws(265),Zn,Fn.Users]}static get[Ws(363)](){return Ws(313)}static get[Ws(324)](){return!0}static get[Ws(293)](){return!0}constructor(e){const t=Ws;super(e);const n=this[t(304)][t(327)][t(332)](t(338));this[t(354)]=null,this[t(334)]=this[t(304)][t(291)][t(332)](t(359)),this[t(308)]=new($s[t(298)])(n)}async[Ws(268)](){const e=Ws,t=this[e(304)][e(291)][e(332)](Os),r=t[e(351)],s=this[e(304)][e(291)][e(332)](Yn);this[e(334)][e(277)]({history:r,getLatestVersion:()=>this[e(349)](),getCurrentRevisionId:()=>t[e(364)]});const o=this[e(304)][e(327)][e(332)](e(330))||n.version,i=await Pt[e(335)](s[e(319)],o);this[e(304)][e(291)][e(332)](e(265))[e(371)]={getRevision:async({revisionId:t})=>(await this[e(367)](),await this[e(308)][e(299)](t)),updateRevisions:async t=>{const n=e;await this[n(367)]();const r=this[n(334)][n(296)];if(i&&1===t[n(369)]&&t[0].id===r.id)return t;for(const e of t)e.id===r.id&&(e[n(301)]=e[n(376)]===e[n(337)]);return this[n(308)][n(357)](t,this[n(354)])[n(339)](e=>(this[n(354)]=e,t))[n(269)](e=>{const r=n;if(Xs(e)||r(295)===e[r(286)]&&void 0!==e[r(312)][r(370)]){for(const e of t)!this[r(334)][r(361)][r(299)](e.id)||this[r(334)][r(344)](e.id,e,!1);if(Xs(e))throw e;return t}throw e})}},this[e(328)](this[e(308)],e(341),(t,{revisionsData:n,requestId:r})=>{const s=e;Math[s(311)](...n[s(310)](e=>e[s(337)]))>this[s(373)]()-1?this[s(349)]()[s(339)](()=>{this[s(307)](n,r)}):this[s(307)](n,r)});const{revisions:a,requestId:c}=await this[e(308)][e(374)](s[e(319)]);s[e(318)](this),this[e(354)]=c,await this[e(326)](a);for(const t of a)this[e(334)][e(317)](t);this[e(328)](t,e(372),(n,r,s)=>{const o=e;s&&(this[o(323)]=t[o(316)],n[o(356)]())}),this[e(334)][e(377)](e(345)).to(s,e(289),t=>t===Ot[e(297)])}async[Ws(300)](){const e=Ws,t=this[e(304)][e(291)][e(332)](Yn),n=this[e(304)][e(291)][e(332)](Os),r=async()=>{const r=e,s=this[r(334)][r(296)],o=s.id,i=o!==n[r(364)];if(i){const e=n[r(316)]-this[r(323)],t=this[r(373)]();if(this[r(334)][r(284)][r(365)](),s[r(337)]+e!==t){const n=s[r(376)]+e,o=this[r(304)][r(291)][r(332)](Fn.Users),i=this[r(334)][r(264)]({revision:s,from:n,to:t});i.id=s.id;const a=i[r(321)][r(310)](e=>o[r(366)](e));s[r(276)]({...i,authors:a},!0),this[r(334)][r(344)](s.id,i,!0)}this[r(334)][r(378)]=t,s[r(337)]===s[r(376)]&&!this[r(334)][r(282)][r(290)](o)&&this[r(334)][r(361)][r(271)][r(288)](o),this[r(334)][r(362)](t)}const{revisions:a,requestId:c}=await this[r(308)][r(300)](t[r(319)],this[r(354)]);i&&a[r(369)]>0?n[r(347)]():(await this[r(326)](a),this[r(307)](a,c),this[r(334)][r(331)]())};return n[e(352)]?r():new Promise((t,s)=>{const o=e;n[o(322)](o(372),()=>{const e=o;r()[e(339)](t)[e(269)](s)})})}[Ws(306)](){super[Ws(306)]()}async[Ws(367)](){const e=Ws;this[e(308)][e(287)]||await new Promise(t=>{const n=e;this[n(328)](this[n(308)],n(303),e=>{e[n(356)](),t()})})}[Ws(373)](){const e=Ws,t=this[e(304)][e(291)][e(332)](Os)[e(351)][e(336)]()[e(358)]();for(const n of t)if(e(281)!==n[e(343)]||n[e(275)])return n[e(302)]+1}[Ws(349)](){const e=Ws,t=this[e(304)][e(291)][e(332)](Os);return new Promise(n=>{const r=e;t[r(325)]?t[r(322)](r(379),()=>{n(this[r(373)]())}):n(this[r(373)]())})}[Ws(307)](e,t){const n=Ws,r=this[n(334)][n(361)];this[n(354)]=t;for(const t of e){const e=r[n(299)](t.id);if(e){if((t[n(376)]||t[n(337)])&&(t[n(272)]=null),e===this[n(334)][n(296)]){const r=Math[n(311)](e[n(337)],t[n(337)]),s=Math[n(311)](e[n(376)],t[n(376)]);let o;e[n(337)]===t[n(337)]&&e[n(376)]===t[n(376)]?(o=!0,this[n(368)](t)):t[n(337)]===r&&t[n(376)]===s?o=!1:(e[n(337)]===r&&e[n(376)]===s||this[n(305)]({revision:e,from:s,to:r}),o=!0),o&&(delete t[n(376)],delete t[n(337)],delete t[n(272)],delete t[n(355)],delete t[n(321)])}this[n(334)][n(292)](t),this[n(368)](t)}else this[n(334)][n(317)](t)}const s=r[n(346)]();s[n(358)]();for(let e=0;e<s[n(369)]-1;e++){const t=s[e],r=s[e+1];if(t[n(376)]<r[n(337)]){const e=r[n(337)],s=Math[n(311)](e,t[n(337)]);this[n(305)]({revision:t,from:e,to:s})}}}[Ws(305)]({revision:e,from:t,to:n}={}){const r=Ws,s=this[r(304)][r(291)][r(332)](Fn.Users),o=this[r(334)][r(264)]({revision:e,from:t,to:n});o[r(279)]=o[r(321)][r(310)](e=>s[r(366)](e)),e[r(276)](o)}[Ws(368)](e){const t=Ws,n={};n.id=e.id;for(const r of Object[t(278)](e))"id"!==r&&(n[r]=void 0);this[t(334)][t(344)](n.id,n,!0)}async[Ws(326)](e){const t=Ws,n=this[t(304)][t(291)][t(332)](Fn.Users),{connection:r}=this[t(304)][t(291)][t(332)](Yn),s=new Set;for(const n of e){for(const e of n[t(321)])i(e);n[t(353)]&&i(n[t(353)])}if(0===s[t(266)])return;const o=await b[t(273)](r,Array[t(315)](s));for(const e of o)n[t(366)](e.id)||n[t(309)](e);function i(e){const r=t;n[r(366)](e)||s[r(333)](e)}}}function Xs(e){const t=Ws;return e[t(375)][t(274)](t(342))||e[t(375)][t(274)](t(314))||e[t(375)][t(274)](t(283))}function eo(e,t){var n=to();return(eo=function(e,t){return n[e-=430]})(e,t)}function to(){var e=["4837536ioNfzQ","69lzbYlr","RealTimeCollaborativeRevisionHistory","11030FNpcXd","2182135vHFsfm","1242988csvNrf","pluginName","232036RWkJpD","10667685fPPFyu","RevisionHistory","2oXvyvH","requires","9585CmQwbl","1994927emCFog","isPremiumPlugin","isOfficialPlugin","6fqOLWB"];return(to=function(){return e})()}var no=eo;!function(e){for(var t=eo,n=e();;)try{if(790101===parseInt(t(430))/1*(-parseInt(t(435))/2)+parseInt(t(443))/3*(parseInt(t(432))/4)+parseInt(t(446))/5*(-parseInt(t(441))/6)+parseInt(t(433))/7+parseInt(t(442))/8+parseInt(t(437))/9*(-parseInt(t(445))/10)+parseInt(t(438))/11)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(to);class ro extends t.Plugin{static get[no(436)](){return[no(434),$s,Ts]}static get[no(431)](){return no(444)}static get[no(440)](){return!0}static get[no(439)](){return!0}}function so(e){return function(e){return"object"==typeof e&&null!==e}(e)&&1===e.nodeType&&!function(e){if("object"!=typeof e)return!1;if(null==e)return!1;if(null===Object.getPrototypeOf(e))return!0;if("[object Object]"!==Object.prototype.toString.call(e)){const t=e[Symbol.toStringTag];return null!=t&&(!!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable&&e.toString()===`[object ${t}]`)}let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e)}function oo(){const e=["ck-presence-list__counter--hidden","bind","154634nuingF","20zbEmdK","bindTemplate","224rmnGOZ","ck-presence-list__users-counter","ck-presence-list__users-counter__text","406380iOnLqt","146927ASajBG","ck-presence-list__list-item","setTemplate","listitem","toString","usersCount","688QyiSHC","div","36GhtqLq","_collapseAt","5850aUKQSf","isHidden","873426mwgzkH","set","57736gxguha","5CQuJIq","2411667kfkTor","1kRmXTx"];return(oo=function(){return e})()}const io=ao;function ao(e,t){const n=oo();return(ao=function(e,t){return n[e-=114]})(e,t)}!function(e){const t=ao,n=e();for(;;)try{if(216597===-parseInt(t(119))/1*(parseInt(t(122))/2)+-parseInt(t(139))/3*(-parseInt(t(135))/4)+parseInt(t(117))/5*(-parseInt(t(114))/6)+-parseInt(t(125))/7*(parseInt(t(116))/8)+parseInt(t(118))/9+parseInt(t(123))/10*(-parseInt(t(129))/11)+parseInt(t(137))/12*(parseInt(t(128))/13))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(oo);class co extends r.View{[io(138)];constructor(e,t=6){const n=io;super(e);const r=this[n(124)];this[n(115)](n(140),!0),this[n(115)](n(134),0),this[n(138)]=t,this[n(121)](n(140)).to(this,n(134),e=>e<t),this[n(131)]({tag:n(136),attributes:{class:["ck",n(130),r.if(n(140),n(120))],role:n(132)},children:[{tag:n(136),attributes:{class:["ck",n(126)]},children:[{tag:n(136),attributes:{class:["ck",n(127)]},children:[{text:r.to(n(134),e=>"+"+(e-this[n(138)]+2)[n(133)]())}]}]}]})}}function uo(){const e=["ck-presence-list__list","relatedTarget",".ck-presence-list__dropdown-list","presencelist:hide","104709AfswTt","9879732eOXgCw","change:hasPopup","list","presencelist:show","render","keystrokes","element","contains","items","hasPopup","querySelector","2250tMcdek","isExpanded","createCollection","1kIfCrE","setAttribute","5259192CVnXwH","57306yHYlMl","div","listenTo","130frEiAh","focus","removeAttribute","aria-expanded","fire","5kNOydh","35136YYpfRs","451824XLyjfo","set","1675202PJJqnR",".ck-balloon-panel_with-arrow","Collapsed connected users list (press ENTER to open it)","setTemplate","742TIgChu","Connected users list","bindTemplate"];return(uo=function(){return e})()}const lo=po;function po(e,t){const n=uo();return(po=function(e,t){return n[e-=283]})(e,t)}!function(e){const t=po,n=e();for(;;)try{if(808179===-parseInt(t(309))/1*(parseInt(t(283))/2)+parseInt(t(322))/3+parseInt(t(311))/4*(-parseInt(t(320))/5)+parseInt(t(312))/6*(parseInt(t(287))/7)+parseInt(t(321))/8*(parseInt(t(306))/9)+-parseInt(t(315))/10*(parseInt(t(294))/11)+parseInt(t(295))/12)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(uo);class ho extends r.View{[lo(303)];[lo(300)];constructor(e){const t=lo;super(e);const r=this[t(289)];this[t(303)]=this[t(308)](),this[t(300)]=new n.KeystrokeHandler,this[t(323)]({hasPopup:!1,isExpanded:!1}),this[t(286)]({tag:t(313),attributes:{"aria-haspopup":r.if(t(304)),"aria-expanded":r.to(t(307),e=>this[t(304)]&&String(e)),"aria-label":r.to(t(304),n=>mr(e,t(n?285:288))),role:t(297),tabindex:r.to(t(304),e=>!!e&&0),class:["ck",t(290)]},children:this[t(303)],on:{mouseenter:r.to(()=>this[t(319)](t(298))),mouseleave:r.to(e=>{const n=t,r=e,s=document[n(305)](n(292)),o=document[n(305)](n(284));s?.[n(302)](r[n(291)])||o?.[n(302)](r[n(291)])||this[n(319)](n(293))})}}),this.on(t(296),(e,n,r)=>{const s=t;this[s(301)]&&(r?this[s(301)][s(310)](s(318),String(this[s(307)])):this[s(301)][s(317)](s(318)))})}[lo(316)](){const e=lo;this[e(301)][e(316)]()}[lo(299)](){const e=lo;super[e(299)](),this[e(300)][e(314)](this[e(301)])}}var fo=__webpack_require__(106),mo={attributes:{"data-cke":!0}};mo.setAttributes=or(),mo.insert=rr().bind(null,"head"),mo.domAPI=tr(),mo.insertStyleElement=ar();Xn()(fo.A,mo);fo.A&&fo.A.locals&&fo.A.locals;const yo=go;function go(e,t){const n=Oo();return(go=function(e,t){return n[e-=355]})(e,t)}!function(e){const t=go,n=e();for(;;)try{if(184031===-parseInt(t(377))/1+-parseInt(t(362))/2+parseInt(t(366))/3+parseInt(t(365))/4+-parseInt(t(381))/5*(parseInt(t(356))/6)+-parseInt(t(364))/7*(-parseInt(t(363))/8)+-parseInt(t(360))/9)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Oo);class bo extends r.View{[yo(368)];[yo(357)];constructor(e,t=6){const n=yo;super(e);const r=this[n(380)];this[n(361)](n(367),!0),this[n(368)]=new co(this[n(359)],t),this[n(357)]=new ho(e),this[n(357)][n(379)](n(355)).to(this,n(367)),this[n(375)](this[n(357)][n(378)],n(372),()=>{const e=n;for(const t of this[e(357)][e(378)])t[e(371)]="s";this[e(357)][e(378)][e(358)]&&(this[e(357)][e(378)][e(358)][e(371)]="se")}),this[n(369)]({tag:n(370),attributes:{class:["ck",n(376),n(373),n(382),r.if(n(367),n(374))]},children:[this[n(357)]]})}}function Oo(){const e=["hasPopup","240102oYMPyO","inlineListView","first","locale","2265939glmJLu","set","304026cFFfuA","72776KeSxZV","63REtWzZ","1311072BddcUs","802446zpBNuu","isCollapsed","counterView","setTemplate","div","tooltipPosition","change","ck-reset","ck-presence-list--collapsed","listenTo","ck-presence-list","49291pCxYSx","items","bind","bindTemplate","5pdsefs","ck-rounded-corners"];return(Oo=function(){return e})()}const wo=vo;function Io(){const e=["4272640unBhfE","setTemplate","ariaLabel","contains","listWrapperView","relatedTarget","10310050ywXaGm","ck-presence-list__dropdown-list-wrapper","presencelist:hide","ck-presence-list__dropdown-list","247761NgdBPY","max","window","6YWJoUZ",".ck-presence-list__list","64cpxjkc","ck-reset","728851MDVlQa","ariaLabelledBy","9Geiwdb","635284iLQcYh","innerHeight","244755UptxUI","listenTo",".ck-balloon-panel_with-arrow","_isScrollable","bindTemplate","items","role","fire","element","clientHeight","change","1233146FFnKzE","ck-list","resize","checkIfScrollable","scrollHeight","application","div","querySelector","ck-presence-list__dropdown-list-wrapper_scrollable","render","Connected users list dropdown menu","set"];return(Io=function(){return e})()}function vo(e,t){const n=Io();return(vo=function(e,t){return n[e-=466]})(e,t)}!function(e){const t=vo,n=e();for(;;)try{if(725929===-parseInt(t(469))/1+parseInt(t(485))/2+-parseInt(t(471))/3*(-parseInt(t(472))/4)+-parseInt(t(497))/5*(parseInt(t(510))/6)+-parseInt(t(474))/7+parseInt(t(467))/8*(parseInt(t(507))/9)+parseInt(t(503))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Io);class So extends r.View{[wo(501)];constructor(e,t){const n=wo;super(e);const r=this[n(478)];this[n(501)]=new ko(e,t),this[n(498)]({tag:n(491),attributes:{tabindex:-1,role:n(490),class:["ck",n(506)],"aria-label":mr(e,n(495))},children:[this[n(501)]],on:{mouseleave:r.to(e=>{const t=n,r=e,s=document[t(492)](t(466)),o=document[t(492)](t(476));s?.[t(500)](r[t(502)])||o?.[t(500)](r[t(502)])||this[t(481)](t(505))})}})}}class ko extends r.ListView{constructor(e,t){const r=wo;super(e);const s=this[r(478)];this[r(496)](r(477),!1),this[r(498)]({tag:t?r(491):"ul",attributes:{class:["ck",r(468),r(486),r(504),s.if(r(477),r(493))],role:s.to(r(480)),"aria-label":s.to(r(499)),"aria-labelledby":s.to(r(470))},children:this[r(479)]}),this[r(475)](n.global[r(509)],r(487),()=>this[r(488)]()),this[r(479)].on(r(484),()=>this[r(488)]())}[wo(494)](){const e=wo;super[e(494)](),this[e(488)]()}[wo(488)](){const e=wo,t=this[e(482)];t&&(this[e(477)]=Math[e(508)](t[e(489)],t[e(483)])>.8*window[e(473)])}}function Po(){const e=["ck-presence-list__marker","8894851fvfTHJ","focus","getBackgroundColorClass","true","tag","fire","1297546cLxDoy","presentation","element","21aTpVJk","9147546degwkw","719228sPVMZg","userView","execute","color","2wSJyIf","4290008WcQEcA","name","30DZciiS","span","setTemplate","ck-presence-list__dropdown-list-item","button","ck-user__full-name","187465xlenyl","bindTemplate","21984070prBkKD"];return(Po=function(){return e})()}const Ao=To;function To(e,t){const n=Po();return(To=function(e,t){return n[e-=445]})(e,t)}!function(e){const t=To,n=e();for(;;)try{if(851293===-parseInt(t(463))/1*(-parseInt(t(472))/2)+parseInt(t(466))/3*(-parseInt(t(468))/4)+-parseInt(t(453))/5*(-parseInt(t(447))/6)+parseInt(t(457))/7+parseInt(t(445))/8+parseInt(t(467))/9+-parseInt(t(455))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Po);class _o extends r.ListItemView{[Ao(469)];constructor(e,t,n){const r=Ao;super(e);const s=this[r(454)];this[r(469)]=new Fn.UserView(e,t);const o={tag:"li",attributes:{class:["ck",r(450)],tabindex:-1,role:r(464),"aria-label":t[r(446)]},children:[this[r(469)],{tag:r(448),attributes:{class:["ck",r(452)]},children:[{text:t[r(446)]}]},{tag:r(448),attributes:{class:["ck",r(456),t[r(471)][r(459)]()],"aria-hidden":r(460)}}]};n&&(o[r(461)]=r(451),o.on={click:s.to(()=>this[r(462)](r(470)))}),this[r(449)](o)}[Ao(458)](){const e=Ao;this[e(465)][e(458)]()}}function Co(e,t){const n=jo();return(Co=function(e,t){return n[e-=359]})(e,t)}function jo(){const e=["text","execute","tag","hasTooltip","4460235buidPL","14589003JMddQO","color","button","isFocusable","listitem","ck-presence-list__list-item__tooltip","setTemplate","888867gCjske","14692nxKgGP","200LdVPbB","true","markerView","userView","156sIlIlf","473625ZplLfD","tooltipPosition","bindTemplate","div","5008386kVZYrV","779478ZehJOV","template","name","getBackgroundColorClass","fire","ck-presence-list__list-item","span","40AMDiCW","2yTFUcR","ck-presence-list__marker","set"];return(jo=function(){return e})()}const Eo=Co;!function(e){const t=Co,n=e();for(;;)try{if(571392===parseInt(t(376))/1*(parseInt(t(368))/2)+-parseInt(t(362))/3*(parseInt(t(392))/4)+parseInt(t(383))/5+parseInt(t(367))/6+parseInt(t(391))/7*(parseInt(t(375))/8)+parseInt(t(363))/9*(-parseInt(t(393))/10)+-parseInt(t(384))/11)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(jo);class Do extends r.View{[Eo(361)];[Eo(360)];constructor(e,t,n){const s=Eo;super(e);const o=this[s(365)];this[s(378)](s(387),!1),this[s(378)](s(382),!0),this[s(378)](s(364),""),this[s(361)]=new Fn.UserView(e,t),this[s(360)]=new xo(e,t);const i=new r.LabelView(e);i[s(369)][s(381)]=s(374),i[s(379)]=t[s(370)];const a={tag:s(366),attributes:{class:["ck",s(373)],role:s(388),tabindex:o.to(s(387),e=>!!e&&0),"aria-labelledby":i.id,"data-cke-tooltip-text":this[s(361)][s(370)],"data-cke-tooltip-position":o.to(s(364)),"data-cke-tooltip-disabled":o.to(s(382),e=>!e),"data-cke-tooltip-class":s(389)},children:[this[s(361)],this[s(360)],i]};n&&(a[s(381)]=s(386),a.on={click:o.to(()=>this[s(372)](s(380)))}),this[s(390)](a)}}class xo extends r.View{constructor(e,t){const n=Eo;super(e),this[n(390)]({tag:n(374),attributes:{class:["ck",n(377),t[n(385)][n(371)]()],"aria-hidden":n(359)}})}}const Ro=Vo;function No(){const e=["isMe","focusTracker","set","Shift+Tab","[tabindex]","change:isFocused","hasTooltip","plugins","checkIfScrollable","hideDropdown","config","input","presencelist-missing-container","appendChild","presencelist:hide","_bodyCollection","class","locale","join","button","init","2858040eEHgyc","pin","attachToDom","content","element","isOfficialPlugin","presenceList.displayMe","requires","bind","inlineListView","focus","activeElement","[contenteditable]","Enter","showDropdown","counterView","2323932bJDQqn","onClick","_handleUserRemove","isPremiumPlugin","detachFromDom","861854KznbUT","view","bindTo","currentDisplayedUsers","243438iZyBZu","min","using","_allConnectedUsers","select","_createView","context","remove","isRendered","ck ck-presence-list__balloon","offsetWidth","querySelectorAll",':not([disabled]):not([tabindex="-1"])',"offsetHeight","isExpanded","indexOf","presencelist:show","map","textarea","find","reverse","pluginName","Tab","tabIndex","body","17824752OzwMwD","keystrokes","presencelist-collapseat-invalid-format","items","length","presenceList","presenceList.collapseAt","balloonPanelView","presenceList.container","unpin","execute","usersCount","number","displayMe","6521144GqJZZh","3WJRLcD","render","from","define","3701780mPeYCz","listenTo","isFocusable","allConnectedUsers","presenceDropdownView","sort","filter","isVisible","PresenceListUI","get","destroy","_handleUserAdd","isCollapsed","Esc","add"];return(No=function(){return e})()}function Vo(e,t){const n=No();return(Vo=function(e,t){return n[e-=299]})(e,t)}!function(e){const t=Vo,n=e();for(;;)try{if(532070===parseInt(t(367))/1+-parseInt(t(371))/2*(-parseInt(t(306))/3)+parseInt(t(362))/4+parseInt(t(310))/5+-parseInt(t(346))/6+parseInt(t(305))/7+-parseInt(t(396))/8)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(No);const Mo={collapseAt:6,displayMe:!0};class Bo extends t.ContextPlugin{[Ro(370)];[Ro(403)];[Ro(368)];[Ro(314)];[Ro(340)]=null;static get[Ro(392)](){return Ro(318)}static get[Ro(351)](){return!0}static get[Ro(365)](){return!0}constructor(e){const t=Ro;super(e),this[t(377)][t(335)][t(309)](t(401),Mo);const s=e[t(335)][t(319)](t(402));if(t(303)!=typeof s)throw new n.CKEditorError(t(398),this);if(s<1)throw new n.CKEditorError(t(398),this);this[t(374)]=this[t(377)][t(332)][t(319)](Zn)[t(313)],this[t(327)](t(302),0),this[t(370)]=new n.Collection,this[t(403)]=new r.BalloonPanelView,this[t(403)][t(341)]=t(380),this[t(368)]=this[t(376)](),this[t(314)]=void 0}static get[Ro(353)](){return[Zn]}[Ro(345)](){const e=Ro;for(const t of this[e(374)])this[e(321)](t);this[e(311)](this[e(374)],e(324),(t,n)=>{this[e(321)](n)}),this[e(311)](this[e(374)],e(378),(t,n)=>{this[e(364)](n)})}[Ro(376)](){const e=Ro,t=this[e(377)],s=new bo(this[e(377)][e(342)],this[e(377)][e(335)][e(319)](e(402))),o=this[e(403)];if(!so(t[e(335)][e(319)](e(299))))throw new n.CKEditorError(e(337),this);return s[e(361)][e(354)](e(302)).to(this),s[e(354)](e(322)).to(this,e(302),n=>{const r=e,{collapseAt:o}=t[r(335)][r(319)](r(401)),i=n>=o;if(i&&!s[r(355)][r(399)][r(390)](e=>e instanceof co)){const e=this[r(377)][r(335)][r(319)](r(402))-1;this[r(370)][r(400)]==e&&this[r(370)][r(400)]>1&&this[r(370)][r(378)](this[r(370)][r(400)]-1),s[r(355)][r(399)][r(324)](s[r(361)])}return i||this[r(334)](),i}),s[e(355)][e(399)][e(369)](this[e(370)])[e(373)](n=>{const r=e,o=t[r(335)][r(319)](r(401)),i=new Do(t[r(342)],n,!!o[r(363)]);return i[r(354)](r(331)).to(s,r(322),e=>!e),i[r(354)](r(312)).to(s,r(322),e=>!e),o[r(363)]&&this[r(311)](i,r(301),()=>{const e=r;this[e(368)][e(322)]||o[e(363)](n,i[e(350)])}),i}),this[e(311)](s[e(355)],e(387),()=>{const t=e;this[t(368)][t(322)]&&this[t(360)]()}),this[e(311)](s[e(355)],e(339),()=>{const t=e;this[t(314)]&&this[t(334)]()}),s[e(355)][e(397)][e(327)](e(359),(t,n)=>{const r=e;this[r(368)][r(322)]&&(this[r(360)](),n())}),s[e(307)](),o[e(307)](),(0,r.clickOutsideHandler)({emitter:s,activator:()=>o[e(317)],contextElements:[o[e(350)],s[e(355)][e(350)]],callback:()=>this[e(334)]()}),t[e(335)][e(319)](e(299))[e(338)](s[e(350)]),this[e(340)]=new r.BodyCollection(this[e(377)][e(342)]),this[e(340)][e(348)](),this[e(340)][e(324)](this[e(403)]),s}[Ro(321)](e){const t=Ro;if(!this[t(377)][t(335)][t(319)](t(352))&&e[t(325)])return;const n=this[t(377)][t(335)][t(319)](t(402))-1;for(this[t(302)]++;this[t(370)][t(400)]>=n-(this[t(368)][t(322)]?1:0)&&this[t(370)][t(400)]>1;)this[t(370)][t(378)](1);const r=e[t(325)]?0:this[t(370)][t(400)];this[t(370)][t(324)](e,r)}[Ro(364)](e){const t=Ro;this[t(302)]--;const{collapseAt:n}=this[t(377)][t(335)][t(319)](t(401)),r=this[t(302)]>=n;if(this[t(370)][t(319)](e.id))this[t(370)][t(378)](e.id);else if(r&&this[t(370)][t(400)]+1===n-1)return;if(this[t(370)][t(400)]+(r?1:0)<this[t(302)])for(const e of Array[t(308)](this[t(374)])[t(391)]())if(!this[t(370)][t(319)](e.id)&&(this[t(370)][t(324)](e,Math[t(372)](this[t(370)][t(400)]-(r?1:0),1)),this[t(370)][t(400)]+(r?1:0)===n-1))return}[Ro(360)](){const e=Ro;if(this[e(314)])return;const t=this[e(377)][e(335)][e(319)](e(401));this[e(314)]=new So(this[e(377)][e(342)],!!t[e(363)]),this[e(368)][e(355)][e(385)]=!0,this[e(311)](this[e(314)],e(339),()=>{const t=e;this[t(314)]&&this[t(334)]()});const{listWrapperView:n}=this[e(314)];n[e(399)][e(369)](this[e(374)])[e(373)](n=>{const r=e;if(!t[r(304)]&&n[r(325)])return null;const s=new _o(this[r(377)][r(342)],n,!!t[r(363)]);return t[r(363)]&&this[r(311)](s,r(301),()=>{const e=r;t[e(363)](n,s[e(350)])}),s}),this[e(403)][e(349)][e(324)](this[e(314)]),this[e(403)][e(347)]({target:this[e(368)][e(355)][e(350)]}),n[e(356)](),n[e(333)]();const r=(t,n)=>{const r=e;this[r(334)](),this[r(368)][r(355)][r(356)](),n()};n[e(397)][e(327)](e(323),r),n[e(397)][e(327)](e(328),r),n[e(397)][e(327)](e(393),(t,n)=>{const r=e;!function(e){const t=Vo,n=["a",t(344),t(336),t(375),t(389),t(329),t(358)][t(388)](e=>e+t(383))[t(343)](","),r=[...document[t(395)][t(382)](n)][t(316)](e=>e===document[t(357)]||e[t(381)]+e[t(384)]>0)[t(315)]((e,n)=>(e[t(394)]||0)-(n[t(394)]||0)),s=r[t(386)](e),o=r[(s+1)%r[t(400)]];o&&o[t(356)]()}(this[r(368)][r(350)]),this[r(334)](),n()}),n[e(326)][e(324)](this[e(368)][e(350)]),n[e(326)].on(e(330),(t,n,r)=>{r||this[e(334)]()})}[Ro(334)](){const e=Ro;this[e(314)]&&(this[e(368)][e(355)][e(385)]=!1,this[e(403)][e(300)](),this[e(403)][e(349)][e(378)](this[e(314)]),this[e(314)][e(320)](),this[e(314)]=void 0)}[Ro(320)](){const e=Ro;super[e(320)](),this[e(368)]&&this[e(368)][e(379)]&&this[e(368)][e(320)](),this[e(340)]&&(this[e(340)][e(366)](),this[e(340)][e(320)](),this[e(340)]=null)}}function Uo(e,t){var n=qo();return(Uo=function(e,t){return n[e-=419]})(e,t)}var Jo=Uo;function qo(){var e=["7qbkSSh","requires","12ZAUWQE","593830MXzxsc","140pyrgjE","3966760oDbJgK","isPremiumPlugin","PresenceList","304162TpMALG","3615975CLDHrh","isOfficialPlugin","pluginName","173532phRDcq","696624BgeWft","34801300LmVIKb"];return(qo=function(){return e})()}!function(e){for(var t=Uo,n=e();;)try{if(965323===-parseInt(t(432))/1+-parseInt(t(422))/2*(parseInt(t(431))/3)+-parseInt(t(419))/4+-parseInt(t(433))/5*(parseInt(t(426))/6)+parseInt(t(429))/7*(parseInt(t(427))/8)+parseInt(t(423))/9+parseInt(t(428))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(qo);class Go extends t.ContextPlugin{static get[Jo(430)](){return[Zn,Bo]}static get[Jo(425)](){return Jo(421)}static get[Jo(424)](){return!0}static get[Jo(420)](){return!0}}function Lo(e,t){var n=Yo();return(Lo=function(e,t){return n[e-=286]})(e,t)}function Yo(){var e=["288748KhlDFx","3038966WRmVqR","98092FGyPGS","3799030vaRPvK","3811152bUGOuH","8GpcGOz","44ciotHV","5385816RzFque","10mFzOFK","1557369GnqcBm","2pgwbQs"];return(Yo=function(){return e})()}!function(e){for(var t=Lo,n=e();;)try{if(363417===-parseInt(t(293))/1+parseInt(t(292))/2*(-parseInt(t(291))/3)+parseInt(t(295))/4*(parseInt(t(290))/5)+parseInt(t(286))/6+parseInt(t(294))/7*(-parseInt(t(287))/8)+-parseInt(t(289))/9+-parseInt(t(296))/10*(-parseInt(t(288))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Yo)})(),(window.CKEditor5=window.CKEditor5||{}).realTimeCollaboration=__webpack_exports__})();
5
+ */(()=>{var __webpack_modules__={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()}},106:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(168),s=n.n(r),o=n(433),i=n.n(o)()(s());i.push([e.id,'.ck.ck-balloon-panel.ck-tooltip{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;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:inline-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;flex-direction:row;justify-content:flex-end;position:relative}.ck.ck-presence-list__list:after{background:transparent;bottom:-15px;content:"";height:15px;left:0;position:absolute;width:100%}.ck.ck-presence-list__counter--hidden{display:none}.ck.ck-presence-list__list-item{background:none;border:1px solid transparent;color:inherit;font:inherit;margin-left:var(--ck-spacing-medium);outline:none;padding:0;position:relative}.ck.ck-presence-list__list-item:focus{border:var(--ck-focus-ring);border-radius:0;box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck-rounded-corners .ck.ck-presence-list__list-item:focus,.ck.ck-presence-list__list-item.ck-rounded-corners:focus{border-radius:var(--ck-border-radius)}.ck.ck-presence-list__list-item .ck-label{height:0;overflow:hidden;width:0}.ck.ck-presence-list__list-item:first-child{margin-left:0}.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:5px;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{border:1px solid transparent;min-width:calc(var(--ck-user-avatar-size)*2);padding-left:1px}.ck.ck-presence-list--collapsed .ck-presence-list__list *{cursor:pointer;transition:all .4s ease-in-out}.ck.ck-presence-list--collapsed .ck-presence-list__list:focus{border:var(--ck-focus-ring);border-radius:0;box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck-rounded-corners .ck.ck-presence-list--collapsed .ck-presence-list__list:focus,.ck.ck-presence-list--collapsed .ck-presence-list__list.ck-rounded-corners:focus{border-radius:var(--ck-border-radius)}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item{border:0;margin-left:calc(var(--ck-user-avatar-size)*-.35);padding:0}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:first-child{margin-left:0}.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 .ck-user{--ck-presence-list-avatar-border-color:var(--ck-color-base-foreground);border:2px solid var(--ck-presence-list-avatar-border-color);margin-left:0;margin-right:0}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item.ck-presence-list__users-counter{margin-left:0;margin-right:0}.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}@media (prefers-reduced-motion:reduce){.ck.ck-presence-list__balloon{animation:none}}.ck.ck-presence-list__balloon ul{background-color:var(--ck-color-presence-list-dropdown-background)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-wrapper{border-radius:var(--ck-border-radius);max-width:var(--ck-presence-list-dropdown-list-max-width);min-width:var(--ck-presence-list-dropdown-list-min-width)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-wrapper.ck-presence-list__dropdown-list-wrapper_scrollable{max-height:80vh;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:focus{box-shadow:var(--ck-focus-outer-shadow),0 0;outline:var(--ck-focus-ring);outline-offset:-1px;position:relative;z-index:1}.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}.ck.ck-presence-list__users-counter{--ck-presence-list-counter-border-color:var(--ck-user-avatar-background);--ck-presence-list-counter-background-color:var(--ck-user-avatar-color);align-items:center;background-color:var(--ck-presence-list-counter-background-color);border:2px solid var(--ck-presence-list-counter-border-color);border-radius:50%;box-sizing:border-box;display:flex;height:calc(var(--ck-user-avatar-size) - 4px);justify-content:center;line-height:100%;margin:4px 2px 2px;position:relative;width:calc(var(--ck-user-avatar-size) - 4px)}.ck.ck-presence-list__users-counter__text{--ck-presence-list-counter-text-color:var(--ck-user-avatar-background);color:var(--ck-presence-list-counter-text-color);cursor:default;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}',""]);const a=i},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}},156:e=>{"use strict";e.exports={}},168:e=>{"use strict";e.exports=function(e){return e[1]}},178:(e,t,n)=>{"use strict";t.Service=n(418)},199:(e,t,n)=>{"use strict";e.exports=n(995)},211:(e,t,n)=>{e.exports=n(312)("./src/collaboration-core.js")},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},237:e=>{"use strict";e.exports=CKEditor5.dll},262:e=>{"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},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))}})}},311:(e,t,n)=>{e.exports=n(237)("./src/ui.js")},312:e=>{"use strict";e.exports=CKEditor5.collaborationDll},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}}},357:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},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)},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)}})}},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}},433:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,s,o){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(i[c]=!0)}for(var d=0;d<e.length;d++){var u=[].concat(e[d]);r&&i[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),s&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=s):u[4]="".concat(s)),t.push(u))}},t}},535:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(168),s=n.n(r),o=n(433),i=n.n(o)()(s());i.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}@media (prefers-reduced-motion:reduce){.ck .ck-user__marker-tooltip{transition:none}}.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}@media (prefers-reduced-motion:reduce){.ck .ck-user__marker,.ck .ck-user__marker *,.ck .ck-user__marker:after{animation:none!important}}@keyframes fadeInLeft{0%{opacity:0;transform:translateX(-10px)}to{opacity:1;transform:translateX(0)}}",""]);const a=i},545:e=>{"use strict";var t,n=(t=[],function(e,n){return t[e]=n,t.filter(Boolean).join("\n")});function r(e,t,r,s){var o;if(r)o="";else{o="",s.supports&&(o+="@supports (".concat(s.supports,") {")),s.media&&(o+="@media ".concat(s.media," {"));var i=void 0!==s.layer;i&&(o+="@layer".concat(s.layer.length>0?" ".concat(s.layer):""," {")),o+=s.css,i&&(o+="}"),s.media&&(o+="}"),s.supports&&(o+="}")}if(e.styleSheet)e.styleSheet.cssText=n(t,o);else{var a=document.createTextNode(o),c=e.childNodes;c[t]&&e.removeChild(c[t]),c.length?e.insertBefore(a,c[t]):e.appendChild(a)}}var s={singleton:null,singletonCounter:0};e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=s.singletonCounter++,n=s.singleton||(s.singleton=e.insertStyleElement(e));return{update:function(e){r(n,t,!1,e)},remove:function(e){r(n,t,!0,e)}}}},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}},584:(e,t,n)=>{e.exports=n(237)("./src/utils.js")},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()},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)}},667:e=>{"use strict";e.exports=function(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}},673:e=>{"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var o={},i=[],a=0;a<e.length;a++){var c=e[a],d=r.base?c[0]+r.base:c[0],u=o[d]||0,l="".concat(d," ").concat(u);o[d]=u+1;var p=n(l),h={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==p)t[p].references++,t[p].updater(h);else{var f=s(h,r);r.byIndex=a,t.splice(a,0,{identifier:l,updater:f,references:1})}i.push(l)}return i}function s(e,t){var n=t.domAPI(t);n.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,s){var o=r(e=e||[],s=s||{});return function(e){e=e||[];for(var i=0;i<o.length;i++){var a=n(o[i]);t[a].references--}for(var c=r(e,s),d=0;d<o.length;d++){var u=n(o[d]);0===t[u].references&&(t[u].updater(),t.splice(u,1))}o=c}}},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}},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}},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}},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}},782:(e,t,n)=>{e.exports=n(237)("./src/core.js")},783:(e,t,n)=>{e.exports=n(237)("./src/engine.js")},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},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()},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()}},__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})};var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CloudServicesCommentsAdapter:()=>js,CloudServicesRevisionHistoryAdapter:()=>Zs,CloudServicesTrackChangesAdapter:()=>Ms,PresenceList:()=>Go,PresenceListUI:()=>Bo,RealTimeCollaborationClient:()=>bs,RealTimeCollaborativeComments:()=>Ys,RealTimeCollaborativeEditing:()=>Ts,RealTimeCollaborativeRevisionHistory:()=>ro,RealTimeCollaborativeTrackChanges:()=>Ks,Sessions:()=>Qn,WebSocketGateway:()=>zn});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{Decoder:()=>De,Encoder:()=>je,PacketType:()=>Ce,protocol:()=>_e});var t=__webpack_require__(782),n=__webpack_require__(584),r=__webpack_require__(311),s=__webpack_require__(783);class o{static DESCRIPTOR_NAME;static DESCRIPTOR;constructor(...e){}}class i extends o{static TYPE="1000";static READABLE_TYPE_NAME;constructor(...e){super()}static fromJSON(e){throw new TypeError("Must be implemented in a child class!")}}class a extends i{id;static TYPE="21";static READABLE_TYPE_NAME="getUser";static DESCRIPTOR_NAME="GetUserMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1}}};constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new a(e.id)}}class c extends i{attributes;static DESCRIPTOR_NAME="GetUserResponse";static DESCRIPTOR={fields:{attributes:{rule:"repeated",type:"KeyValueDescriptor",id:1}}};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 c(t)}}var d=__webpack_require__(199);const u=(()=>{var e=d.Reader,t=d.Writer,n=d.util,r=d.roots.default||(d.roots.default={});return r.OperationMetadataDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.userId="",s.prototype.type="",s.prototype.createdAt="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(10).string(e.userId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&n.uint32(18).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(26).string(e.createdAt),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.OperationMetadataDescriptor;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.userId=t.string();break;case 2:i.type=t.string();break;case 3:i.createdAt=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.userId&&e.hasOwnProperty("userId")&&!n.isString(e.userId)?"userId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!n.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null},s.fromObject=function(e){if(e instanceof r.OperationMetadataDescriptor)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/OperationMetadataDescriptor"},s}(),r.CollaborativeEditingConnectMessage=function(){function s(e){if(this.buffers=[],this.types=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.bundleVersion="",s.prototype.buffers=n.emptyArray,s.prototype.types=n.emptyArray,s.prototype.lastOperationId="",s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&n.uint32(18).string(e.bundleVersion),null!=e.buffers&&e.buffers.length)for(var r=0;r<e.buffers.length;++r)n.uint32(26).bytes(e.buffers[r]);if(null!=e.types&&e.types.length){for(n.uint32(34).fork(),r=0;r<e.types.length;++r)n.uint32(e.types[r]);n.ldelim()}return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&n.uint32(42).string(e.lastOperationId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CollaborativeEditingConnectMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.bundleVersion=t.string();break;case 3:i.buffers&&i.buffers.length||(i.buffers=[]),i.buffers.push(t.bytes());break;case 4:if(i.types&&i.types.length||(i.types=[]),2==(7&a))for(var c=t.uint32()+t.pos;t.pos<c;)i.types.push(t.uint32());else i.types.push(t.uint32());break;case 5:i.lastOperationId=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id))return"id: string expected";if(null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!n.isString(e.bundleVersion))return"bundleVersion: string expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(var t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||n.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(t=0;t<e.types.length;++t)if(!n.isInteger(e.types[t]))return"types: integer[] expected"}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!n.isString(e.lastOperationId)?"lastOperationId: string expected":null},s.fromObject=function(e){if(e instanceof r.CollaborativeEditingConnectMessage)return e;var t=new r.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(var s=0;s<e.buffers.length;++s)"string"==typeof e.buffers[s]?n.base64.decode(e.buffers[s],t.buffers[s]=n.newBuffer(n.base64.length(e.buffers[s])),0):e.buffers[s].length>=0&&(t.buffers[s]=e.buffers[s])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingConnectMessage.types: array expected");for(t.types=[],s=0;s<e.types.length;++s)t.types[s]=e.types[s]>>>0}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),t},s.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.buffers=[],r.types=[]),t.defaults&&(r.id="",r.bundleVersion="",r.lastOperationId=""),null!=e.id&&e.hasOwnProperty("id")&&(r.id=e.id),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(r.bundleVersion=e.bundleVersion),e.buffers&&e.buffers.length){r.buffers=[];for(var s=0;s<e.buffers.length;++s)r.buffers[s]=t.bytes===String?n.base64.encode(e.buffers[s],0,e.buffers[s].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[s]):e.buffers[s]}if(e.types&&e.types.length)for(r.types=[],s=0;s<e.types.length;++s)r.types[s]=e.types[s];return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(r.lastOperationId=e.lastOperationId),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingConnectMessage"},s}(),r.CollaborativeEditingReconnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.bundleVersion="",s.prototype.lastKnowVersion=0,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&n.uint32(18).string(e.bundleVersion),null!=e.lastKnowVersion&&Object.hasOwnProperty.call(e,"lastKnowVersion")&&n.uint32(24).uint32(e.lastKnowVersion),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CollaborativeEditingReconnectMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.bundleVersion=t.string();break;case 3:i.lastKnowVersion=t.uint32();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id)?"id: string expected":null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!n.isString(e.bundleVersion)?"bundleVersion: string expected":null!=e.lastKnowVersion&&e.hasOwnProperty("lastKnowVersion")&&!n.isInteger(e.lastKnowVersion)?"lastKnowVersion: integer expected":null},s.fromObject=function(e){if(e instanceof r.CollaborativeEditingReconnectMessage)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingReconnectMessage"},s}(),r.CollaborativeEditingUpdateMessage=function(){function s(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.baseVersion=0,s.prototype.buffers=n.emptyArray,s.prototype.types=n.emptyArray,s.prototype.metadata=n.emptyArray,s.prototype.lastOperationId="",s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.baseVersion&&Object.hasOwnProperty.call(e,"baseVersion")&&n.uint32(16).uint32(e.baseVersion),null!=e.buffers&&e.buffers.length)for(var s=0;s<e.buffers.length;++s)n.uint32(26).bytes(e.buffers[s]);if(null!=e.types&&e.types.length){for(n.uint32(34).fork(),s=0;s<e.types.length;++s)n.uint32(e.types[s]);n.ldelim()}if(null!=e.metadata&&e.metadata.length)for(s=0;s<e.metadata.length;++s)r.OperationMetadataDescriptor.encode(e.metadata[s],n.uint32(50).fork()).ldelim();return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&n.uint32(58).string(e.lastOperationId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CollaborativeEditingUpdateMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.baseVersion=t.uint32();break;case 3:i.buffers&&i.buffers.length||(i.buffers=[]),i.buffers.push(t.bytes());break;case 4:if(i.types&&i.types.length||(i.types=[]),2==(7&a))for(var c=t.uint32()+t.pos;t.pos<c;)i.types.push(t.uint32());else i.types.push(t.uint32());break;case 6:i.metadata&&i.metadata.length||(i.metadata=[]),i.metadata.push(r.OperationMetadataDescriptor.decode(t,t.uint32()));break;case 7:i.lastOperationId=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id))return"id: string expected";if(null!=e.baseVersion&&e.hasOwnProperty("baseVersion")&&!n.isInteger(e.baseVersion))return"baseVersion: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(var t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||n.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(t=0;t<e.types.length;++t)if(!n.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(t=0;t<e.metadata.length;++t){var s=r.OperationMetadataDescriptor.verify(e.metadata[t]);if(s)return"metadata."+s}}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!n.isString(e.lastOperationId)?"lastOperationId: string expected":null},s.fromObject=function(e){if(e instanceof r.CollaborativeEditingUpdateMessage)return e;var t=new r.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(var s=0;s<e.buffers.length;++s)"string"==typeof e.buffers[s]?n.base64.decode(e.buffers[s],t.buffers[s]=n.newBuffer(n.base64.length(e.buffers[s])),0):e.buffers[s].length>=0&&(t.buffers[s]=e.buffers[s])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingUpdateMessage.types: array expected");for(t.types=[],s=0;s<e.types.length;++s)t.types[s]=e.types[s]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingUpdateMessage.metadata: array expected");for(t.metadata=[],s=0;s<e.metadata.length;++s){if("object"!=typeof e.metadata[s])throw TypeError(".CollaborativeEditingUpdateMessage.metadata: object expected");t.metadata[s]=r.OperationMetadataDescriptor.fromObject(e.metadata[s])}}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),t},s.toObject=function(e,t){t||(t={});var s={};if((t.arrays||t.defaults)&&(s.buffers=[],s.types=[],s.metadata=[]),t.defaults&&(s.id="",s.baseVersion=0,s.lastOperationId=""),null!=e.id&&e.hasOwnProperty("id")&&(s.id=e.id),null!=e.baseVersion&&e.hasOwnProperty("baseVersion")&&(s.baseVersion=e.baseVersion),e.buffers&&e.buffers.length){s.buffers=[];for(var o=0;o<e.buffers.length;++o)s.buffers[o]=t.bytes===String?n.base64.encode(e.buffers[o],0,e.buffers[o].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[o]):e.buffers[o]}if(e.types&&e.types.length)for(s.types=[],o=0;o<e.types.length;++o)s.types[o]=e.types[o];if(e.metadata&&e.metadata.length)for(s.metadata=[],o=0;o<e.metadata.length;++o)s.metadata[o]=r.OperationMetadataDescriptor.toObject(e.metadata[o],t);return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(s.lastOperationId=e.lastOperationId),s},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingUpdateMessage"},s}(),r.GetDocumentDetailsMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.environmentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(10).string(e.documentId),null!=e.environmentId&&Object.hasOwnProperty.call(e,"environmentId")&&n.uint32(18).string(e.environmentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.GetDocumentDetailsMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.documentId=t.string();break;case 2:i.environmentId=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null!=e.environmentId&&e.hasOwnProperty("environmentId")&&!n.isString(e.environmentId)?"environmentId: string expected":null},s.fromObject=function(e){if(e instanceof r.GetDocumentDetailsMessage)return e;var t=new r.GetDocumentDetailsMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.environmentId&&(t.environmentId=String(e.environmentId)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetDocumentDetailsMessage"},s}(),r.CollaborativeEditingConnectResponse=function(){function s(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.offset=0,s.prototype.version=0,s.prototype.buffers=n.emptyArray,s.prototype.types=n.emptyArray,s.prototype.metadata=n.emptyArray,s.prototype.initData="",s.prototype.isInitialized=!1,s.prototype.sessionId="",s.prototype.lastOperationId="",s.prototype.sessionCreatedAt="",s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&n.uint32(10).string(e.channel),null!=e.offset&&Object.hasOwnProperty.call(e,"offset")&&n.uint32(16).uint32(e.offset),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&n.uint32(24).uint32(e.version),null!=e.buffers&&e.buffers.length)for(var s=0;s<e.buffers.length;++s)n.uint32(34).bytes(e.buffers[s]);if(null!=e.types&&e.types.length){for(n.uint32(42).fork(),s=0;s<e.types.length;++s)n.uint32(e.types[s]);n.ldelim()}if(null!=e.metadata&&e.metadata.length)for(s=0;s<e.metadata.length;++s)r.OperationMetadataDescriptor.encode(e.metadata[s],n.uint32(58).fork()).ldelim();return null!=e.initData&&Object.hasOwnProperty.call(e,"initData")&&n.uint32(66).string(e.initData),null!=e.isInitialized&&Object.hasOwnProperty.call(e,"isInitialized")&&n.uint32(72).bool(e.isInitialized),null!=e.sessionId&&Object.hasOwnProperty.call(e,"sessionId")&&n.uint32(82).string(e.sessionId),null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&n.uint32(90).string(e.lastOperationId),null!=e.sessionCreatedAt&&Object.hasOwnProperty.call(e,"sessionCreatedAt")&&n.uint32(98).string(e.sessionCreatedAt),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CollaborativeEditingConnectResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.channel=t.string();break;case 2:i.offset=t.uint32();break;case 3:i.version=t.uint32();break;case 4:i.buffers&&i.buffers.length||(i.buffers=[]),i.buffers.push(t.bytes());break;case 5:if(i.types&&i.types.length||(i.types=[]),2==(7&a))for(var c=t.uint32()+t.pos;t.pos<c;)i.types.push(t.uint32());else i.types.push(t.uint32());break;case 7:i.metadata&&i.metadata.length||(i.metadata=[]),i.metadata.push(r.OperationMetadataDescriptor.decode(t,t.uint32()));break;case 8:i.initData=t.string();break;case 9:i.isInitialized=t.bool();break;case 10:i.sessionId=t.string();break;case 11:i.lastOperationId=t.string();break;case 12:i.sessionCreatedAt=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!n.isString(e.channel))return"channel: string expected";if(null!=e.offset&&e.hasOwnProperty("offset")&&!n.isInteger(e.offset))return"offset: integer expected";if(null!=e.version&&e.hasOwnProperty("version")&&!n.isInteger(e.version))return"version: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(var t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||n.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(t=0;t<e.types.length;++t)if(!n.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(t=0;t<e.metadata.length;++t){var s=r.OperationMetadataDescriptor.verify(e.metadata[t]);if(s)return"metadata."+s}}return null!=e.initData&&e.hasOwnProperty("initData")&&!n.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")&&!n.isString(e.sessionId)?"sessionId: string expected":null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!n.isString(e.lastOperationId)?"lastOperationId: string expected":null!=e.sessionCreatedAt&&e.hasOwnProperty("sessionCreatedAt")&&!n.isString(e.sessionCreatedAt)?"sessionCreatedAt: string expected":null},s.fromObject=function(e){if(e instanceof r.CollaborativeEditingConnectResponse)return e;var t=new r.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(var s=0;s<e.buffers.length;++s)"string"==typeof e.buffers[s]?n.base64.decode(e.buffers[s],t.buffers[s]=n.newBuffer(n.base64.length(e.buffers[s])),0):e.buffers[s].length>=0&&(t.buffers[s]=e.buffers[s])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingConnectResponse.types: array expected");for(t.types=[],s=0;s<e.types.length;++s)t.types[s]=e.types[s]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingConnectResponse.metadata: array expected");for(t.metadata=[],s=0;s<e.metadata.length;++s){if("object"!=typeof e.metadata[s])throw TypeError(".CollaborativeEditingConnectResponse.metadata: object expected");t.metadata[s]=r.OperationMetadataDescriptor.fromObject(e.metadata[s])}}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},s.toObject=function(e,t){t||(t={});var s={};if((t.arrays||t.defaults)&&(s.buffers=[],s.types=[],s.metadata=[]),t.defaults&&(s.channel="",s.offset=0,s.version=0,s.initData="",s.isInitialized=!1,s.sessionId="",s.lastOperationId="",s.sessionCreatedAt=""),null!=e.channel&&e.hasOwnProperty("channel")&&(s.channel=e.channel),null!=e.offset&&e.hasOwnProperty("offset")&&(s.offset=e.offset),null!=e.version&&e.hasOwnProperty("version")&&(s.version=e.version),e.buffers&&e.buffers.length){s.buffers=[];for(var o=0;o<e.buffers.length;++o)s.buffers[o]=t.bytes===String?n.base64.encode(e.buffers[o],0,e.buffers[o].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[o]):e.buffers[o]}if(e.types&&e.types.length)for(s.types=[],o=0;o<e.types.length;++o)s.types[o]=e.types[o];if(e.metadata&&e.metadata.length)for(s.metadata=[],o=0;o<e.metadata.length;++o)s.metadata[o]=r.OperationMetadataDescriptor.toObject(e.metadata[o],t);return null!=e.initData&&e.hasOwnProperty("initData")&&(s.initData=e.initData),null!=e.isInitialized&&e.hasOwnProperty("isInitialized")&&(s.isInitialized=e.isInitialized),null!=e.sessionId&&e.hasOwnProperty("sessionId")&&(s.sessionId=e.sessionId),null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(s.lastOperationId=e.lastOperationId),null!=e.sessionCreatedAt&&e.hasOwnProperty("sessionCreatedAt")&&(s.sessionCreatedAt=e.sessionCreatedAt),s},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingConnectResponse"},s}(),r.CollaborativeEditingResponse=function(){function s(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.version=0,s.prototype.buffers=n.emptyArray,s.prototype.types=n.emptyArray,s.prototype.metadata=n.emptyArray,s.prototype.lastOperationId="",s.prototype.lastOperationAcceptedAt="",s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&n.uint32(8).uint32(e.version),null!=e.buffers&&e.buffers.length)for(var s=0;s<e.buffers.length;++s)n.uint32(18).bytes(e.buffers[s]);if(null!=e.types&&e.types.length){for(n.uint32(26).fork(),s=0;s<e.types.length;++s)n.uint32(e.types[s]);n.ldelim()}if(null!=e.metadata&&e.metadata.length)for(s=0;s<e.metadata.length;++s)r.OperationMetadataDescriptor.encode(e.metadata[s],n.uint32(42).fork()).ldelim();return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&n.uint32(50).string(e.lastOperationId),null!=e.lastOperationAcceptedAt&&Object.hasOwnProperty.call(e,"lastOperationAcceptedAt")&&n.uint32(58).string(e.lastOperationAcceptedAt),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CollaborativeEditingResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.version=t.uint32();break;case 2:i.buffers&&i.buffers.length||(i.buffers=[]),i.buffers.push(t.bytes());break;case 3:if(i.types&&i.types.length||(i.types=[]),2==(7&a))for(var c=t.uint32()+t.pos;t.pos<c;)i.types.push(t.uint32());else i.types.push(t.uint32());break;case 5:i.metadata&&i.metadata.length||(i.metadata=[]),i.metadata.push(r.OperationMetadataDescriptor.decode(t,t.uint32()));break;case 6:i.lastOperationId=t.string();break;case 7:i.lastOperationAcceptedAt=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.version&&e.hasOwnProperty("version")&&!n.isInteger(e.version))return"version: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(var t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||n.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(t=0;t<e.types.length;++t)if(!n.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(t=0;t<e.metadata.length;++t){var s=r.OperationMetadataDescriptor.verify(e.metadata[t]);if(s)return"metadata."+s}}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!n.isString(e.lastOperationId)?"lastOperationId: string expected":null!=e.lastOperationAcceptedAt&&e.hasOwnProperty("lastOperationAcceptedAt")&&!n.isString(e.lastOperationAcceptedAt)?"lastOperationAcceptedAt: string expected":null},s.fromObject=function(e){if(e instanceof r.CollaborativeEditingResponse)return e;var t=new r.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(var s=0;s<e.buffers.length;++s)"string"==typeof e.buffers[s]?n.base64.decode(e.buffers[s],t.buffers[s]=n.newBuffer(n.base64.length(e.buffers[s])),0):e.buffers[s].length>=0&&(t.buffers[s]=e.buffers[s])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingResponse.types: array expected");for(t.types=[],s=0;s<e.types.length;++s)t.types[s]=e.types[s]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingResponse.metadata: array expected");for(t.metadata=[],s=0;s<e.metadata.length;++s){if("object"!=typeof e.metadata[s])throw TypeError(".CollaborativeEditingResponse.metadata: object expected");t.metadata[s]=r.OperationMetadataDescriptor.fromObject(e.metadata[s])}}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),null!=e.lastOperationAcceptedAt&&(t.lastOperationAcceptedAt=String(e.lastOperationAcceptedAt)),t},s.toObject=function(e,t){t||(t={});var s={};if((t.arrays||t.defaults)&&(s.buffers=[],s.types=[],s.metadata=[]),t.defaults&&(s.version=0,s.lastOperationId="",s.lastOperationAcceptedAt=""),null!=e.version&&e.hasOwnProperty("version")&&(s.version=e.version),e.buffers&&e.buffers.length){s.buffers=[];for(var o=0;o<e.buffers.length;++o)s.buffers[o]=t.bytes===String?n.base64.encode(e.buffers[o],0,e.buffers[o].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[o]):e.buffers[o]}if(e.types&&e.types.length)for(s.types=[],o=0;o<e.types.length;++o)s.types[o]=e.types[o];if(e.metadata&&e.metadata.length)for(s.metadata=[],o=0;o<e.metadata.length;++o)s.metadata[o]=r.OperationMetadataDescriptor.toObject(e.metadata[o],t);return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(s.lastOperationId=e.lastOperationId),null!=e.lastOperationAcceptedAt&&e.hasOwnProperty("lastOperationAcceptedAt")&&(s.lastOperationAcceptedAt=e.lastOperationAcceptedAt),s},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingResponse"},s}(),r.GetDocumentDetailsResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.lastDocumentSessionId="",s.prototype.lastDocumentSessionOperationId="",s.prototype.currentDocumentSessionId="",s.prototype.currentDocumentSessionVersion=0,s.prototype.currentDocumentSessionOperationId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.lastDocumentSessionId&&Object.hasOwnProperty.call(e,"lastDocumentSessionId")&&n.uint32(10).string(e.lastDocumentSessionId),null!=e.lastDocumentSessionOperationId&&Object.hasOwnProperty.call(e,"lastDocumentSessionOperationId")&&n.uint32(18).string(e.lastDocumentSessionOperationId),null!=e.currentDocumentSessionId&&Object.hasOwnProperty.call(e,"currentDocumentSessionId")&&n.uint32(26).string(e.currentDocumentSessionId),null!=e.currentDocumentSessionVersion&&Object.hasOwnProperty.call(e,"currentDocumentSessionVersion")&&n.uint32(32).uint32(e.currentDocumentSessionVersion),null!=e.currentDocumentSessionOperationId&&Object.hasOwnProperty.call(e,"currentDocumentSessionOperationId")&&n.uint32(42).string(e.currentDocumentSessionOperationId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.GetDocumentDetailsResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.lastDocumentSessionId=t.string();break;case 2:i.lastDocumentSessionOperationId=t.string();break;case 3:i.currentDocumentSessionId=t.string();break;case 4:i.currentDocumentSessionVersion=t.uint32();break;case 5:i.currentDocumentSessionOperationId=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.lastDocumentSessionId&&e.hasOwnProperty("lastDocumentSessionId")&&!n.isString(e.lastDocumentSessionId)?"lastDocumentSessionId: string expected":null!=e.lastDocumentSessionOperationId&&e.hasOwnProperty("lastDocumentSessionOperationId")&&!n.isString(e.lastDocumentSessionOperationId)?"lastDocumentSessionOperationId: string expected":null!=e.currentDocumentSessionId&&e.hasOwnProperty("currentDocumentSessionId")&&!n.isString(e.currentDocumentSessionId)?"currentDocumentSessionId: string expected":null!=e.currentDocumentSessionVersion&&e.hasOwnProperty("currentDocumentSessionVersion")&&!n.isInteger(e.currentDocumentSessionVersion)?"currentDocumentSessionVersion: integer expected":null!=e.currentDocumentSessionOperationId&&e.hasOwnProperty("currentDocumentSessionOperationId")&&!n.isString(e.currentDocumentSessionOperationId)?"currentDocumentSessionOperationId: string expected":null},s.fromObject=function(e){if(e instanceof r.GetDocumentDetailsResponse)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetDocumentDetailsResponse"},s}(),r.CommentDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentId="",s.prototype.commentThreadId="",s.prototype.userId="",s.prototype.content="",s.prototype.documentId="",s.prototype.createdAt="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&n.uint32(10).string(e.commentId),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(18).string(e.commentThreadId),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(26).string(e.userId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&n.uint32(34).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(42).string(e.documentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(58).string(e.attributes),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentDescriptor;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentId=t.string();break;case 2:i.commentThreadId=t.string();break;case 3:i.userId=t.string();break;case 4:i.content=t.string();break;case 5:i.documentId=t.string();break;case 6:i.createdAt=t.string();break;case 7:i.attributes=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!n.isString(e.commentId)?"commentId: string expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.userId&&e.hasOwnProperty("userId")&&!n.isString(e.userId)?"userId: string expected":null!=e.content&&e.hasOwnProperty("content")&&!n.isString(e.content)?"content: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentDescriptor)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentDescriptor"},s}(),r.CommentsThreadDescriptor=function(){function s(e){if(this.comments=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.comments=n.emptyArray,s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.prototype.context="",s.prototype.createdAt="",s.prototype.deletedAt="",s.prototype.attributes="",s.prototype.unlinkedAt="",s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.comments&&e.comments.length)for(var s=0;s<e.comments.length;++s)r.CommentDescriptor.encode(e.comments[s],n.uint32(18).fork()).ldelim();return null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&n.uint32(26).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&n.uint32(34).string(e.resolvedBy),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&n.uint32(42).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(50).string(e.createdAt),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&n.uint32(58).string(e.deletedAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(66).string(e.attributes),null!=e.unlinkedAt&&Object.hasOwnProperty.call(e,"unlinkedAt")&&n.uint32(74).string(e.unlinkedAt),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsThreadDescriptor;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.comments&&i.comments.length||(i.comments=[]),i.comments.push(r.CommentDescriptor.decode(t,t.uint32()));break;case 3:i.resolvedAt=t.string();break;case 4:i.resolvedBy=t.string();break;case 5:i.context=t.string();break;case 6:i.createdAt=t.string();break;case 7:i.deletedAt=t.string();break;case 8:i.attributes=t.string();break;case 9:i.unlinkedAt=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(var t=0;t<e.comments.length;++t){var s=r.CommentDescriptor.verify(e.comments[t]);if(s)return"comments."+s}}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!n.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!n.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.context&&e.hasOwnProperty("context")&&!n.isString(e.context)?"context: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!n.isString(e.deletedAt)?"deletedAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&!n.isString(e.unlinkedAt)?"unlinkedAt: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsThreadDescriptor)return e;var t=new r.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(var n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsThreadDescriptor.comments: object expected");t.comments[n]=r.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},s.toObject=function(e,t){t||(t={});var 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(var s=0;s<e.comments.length;++s)n.comments[s]=r.CommentDescriptor.toObject(e.comments[s],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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsThreadDescriptor"},s}(),r.CommentThreadAddedCommentDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentId="",s.prototype.createdAt="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&n.uint32(10).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(18).string(e.createdAt),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentThreadAddedCommentDescriptor;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentId=t.string();break;case 2:i.createdAt=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!n.isString(e.commentId)?"commentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentThreadAddedCommentDescriptor)return e;var t=new r.CommentThreadAddedCommentDescriptor;return null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentThreadAddedCommentDescriptor"},s}(),r.CommentsV2AddCommentMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.content="",s.prototype.documentId="",s.prototype.commentId="",s.prototype.createdAt="",s.prototype.userId="",s.prototype.attributes="",s.prototype.commentThread=null,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&n.uint32(18).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(26).string(e.documentId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&n.uint32(34).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(42).string(e.createdAt),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(50).string(e.userId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(58).string(e.attributes),null!=e.commentThread&&Object.hasOwnProperty.call(e,"commentThread")&&r.CommentsThreadDescriptor.encode(e.commentThread,n.uint32(66).fork()).ldelim(),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2AddCommentMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.content=t.string();break;case 3:i.documentId=t.string();break;case 4:i.commentId=t.string();break;case 5:i.createdAt=t.string();break;case 6:i.userId=t.string();break;case 7:i.attributes=t.string();break;case 8:i.commentThread=r.CommentsThreadDescriptor.decode(t,t.uint32());break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.content&&e.hasOwnProperty("content")&&!n.isString(e.content))return"content: string expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId))return"documentId: string expected";if(null!=e.commentId&&e.hasOwnProperty("commentId")&&!n.isString(e.commentId))return"commentId: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt))return"createdAt: string expected";if(null!=e.userId&&e.hasOwnProperty("userId")&&!n.isString(e.userId))return"userId: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes))return"attributes: string expected";if(null!=e.commentThread&&e.hasOwnProperty("commentThread")){var t=r.CommentsThreadDescriptor.verify(e.commentThread);if(t)return"commentThread."+t}return null},s.fromObject=function(e){if(e instanceof r.CommentsV2AddCommentMessage)return e;var t=new r.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=r.CommentsThreadDescriptor.fromObject(e.commentThread)}return t},s.toObject=function(e,t){t||(t={});var 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=r.CommentsThreadDescriptor.toObject(e.commentThread,t)),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentMessage"},s}(),r.CommentsV2AddCommentThreadMessage=function(){function s(e){if(this.comments=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.commentThreadId="",s.prototype.context="",s.prototype.createdAt="",s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.prototype.attributes="",s.prototype.deletedAt="",s.prototype.comments=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(10).string(e.documentId),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(18).string(e.commentThreadId),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&n.uint32(26).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(34).string(e.createdAt),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&n.uint32(42).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&n.uint32(50).string(e.resolvedBy),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(58).string(e.attributes),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&n.uint32(66).string(e.deletedAt),null!=e.comments&&e.comments.length)for(var s=0;s<e.comments.length;++s)r.CommentDescriptor.encode(e.comments[s],n.uint32(74).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2AddCommentThreadMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.documentId=t.string();break;case 2:i.commentThreadId=t.string();break;case 3:i.context=t.string();break;case 4:i.createdAt=t.string();break;case 5:i.resolvedAt=t.string();break;case 6:i.resolvedBy=t.string();break;case 7:i.attributes=t.string();break;case 8:i.deletedAt=t.string();break;case 9:i.comments&&i.comments.length||(i.comments=[]),i.comments.push(r.CommentDescriptor.decode(t,t.uint32()));break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId))return"documentId: string expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.context&&e.hasOwnProperty("context")&&!n.isString(e.context))return"context: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt))return"createdAt: string expected";if(null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!n.isString(e.resolvedAt))return"resolvedAt: string expected";if(null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!n.isString(e.resolvedBy))return"resolvedBy: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes))return"attributes: string expected";if(null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!n.isString(e.deletedAt))return"deletedAt: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(var t=0;t<e.comments.length;++t){var s=r.CommentDescriptor.verify(e.comments[t]);if(s)return"comments."+s}}return null},s.fromObject=function(e){if(e instanceof r.CommentsV2AddCommentThreadMessage)return e;var t=new r.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(var n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsV2AddCommentThreadMessage.comments: object expected");t.comments[n]=r.CommentDescriptor.fromObject(e.comments[n])}}return t},s.toObject=function(e,t){t||(t={});var 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(var s=0;s<e.comments.length;++s)n.comments[s]=r.CommentDescriptor.toObject(e.comments[s],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentThreadMessage"},s}(),r.CommentsV2ReopenCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(18).string(e.documentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2ReopenCommentThreadMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.documentId=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2ReopenCommentThreadMessage)return e;var t=new r.CommentsV2ReopenCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ReopenCommentThreadMessage"},s}(),r.CommentsV2ResolveCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.resolvedBy="",s.prototype.resolvedAt="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(18).string(e.documentId),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&n.uint32(26).string(e.resolvedBy),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&n.uint32(34).string(e.resolvedAt),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2ResolveCommentThreadMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.documentId=t.string();break;case 3:i.resolvedBy=t.string();break;case 4:i.resolvedAt=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!n.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!n.isString(e.resolvedAt)?"resolvedAt: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2ResolveCommentThreadMessage)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ResolveCommentThreadMessage"},s}(),r.CommentsV2UpdateCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.context="",s.prototype.attributes="",s.prototype.unlinkedAt="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(18).string(e.documentId),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&n.uint32(26).string(e.context),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(34).string(e.attributes),null!=e.unlinkedAt&&Object.hasOwnProperty.call(e,"unlinkedAt")&&n.uint32(42).string(e.unlinkedAt),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2UpdateCommentThreadMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.documentId=t.string();break;case 3:i.context=t.string();break;case 4:i.attributes=t.string();break;case 5:i.unlinkedAt=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null!=e.context&&e.hasOwnProperty("context")&&!n.isString(e.context)?"context: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&!n.isString(e.unlinkedAt)?"unlinkedAt: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2UpdateCommentThreadMessage)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2UpdateCommentThreadMessage"},s}(),r.CommentsV2ConnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(10).string(e.documentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2ConnectMessage;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?i.documentId=t.string():t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2ConnectMessage)return e;var t=new r.CommentsV2ConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ConnectMessage"},s}(),r.CommentsV2GetCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(18).string(e.documentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2GetCommentThreadMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.documentId=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2GetCommentThreadMessage)return e;var t=new r.CommentsV2GetCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetCommentThreadMessage"},s}(),r.CommentsV2GetDocumentThreadsMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(10).string(e.documentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2GetDocumentThreadsMessage;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?i.documentId=t.string():t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2GetDocumentThreadsMessage)return e;var t=new r.CommentsV2GetDocumentThreadsMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetDocumentThreadsMessage"},s}(),r.CommentsV2RemoveCommentMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.commentId="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&n.uint32(18).string(e.commentId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(26).string(e.documentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2RemoveCommentMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.commentId=t.string();break;case 3:i.documentId=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!n.isString(e.commentId)?"commentId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2RemoveCommentMessage)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2RemoveCommentMessage"},s}(),r.CommentsV2RemoveCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(18).string(e.documentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2RemoveCommentThreadMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.documentId=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2RemoveCommentThreadMessage)return e;var t=new r.CommentsV2RemoveCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2RemoveCommentThreadMessage"},s}(),r.CommentsV2UpdateCommentMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.commentId="",s.prototype.content="",s.prototype.documentId="",s.prototype.attributes="",s.prototype.isAttributesUpdated=!1,s.prototype.commentThread=null,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&n.uint32(18).string(e.commentId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&n.uint32(26).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(34).string(e.documentId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(42).string(e.attributes),null!=e.isAttributesUpdated&&Object.hasOwnProperty.call(e,"isAttributesUpdated")&&n.uint32(48).bool(e.isAttributesUpdated),null!=e.commentThread&&Object.hasOwnProperty.call(e,"commentThread")&&r.CommentsThreadDescriptor.encode(e.commentThread,n.uint32(58).fork()).ldelim(),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2UpdateCommentMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.commentId=t.string();break;case 3:i.content=t.string();break;case 4:i.documentId=t.string();break;case 5:i.attributes=t.string();break;case 6:i.isAttributesUpdated=t.bool();break;case 7:i.commentThread=r.CommentsThreadDescriptor.decode(t,t.uint32());break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.commentId&&e.hasOwnProperty("commentId")&&!n.isString(e.commentId))return"commentId: string expected";if(null!=e.content&&e.hasOwnProperty("content")&&!n.isString(e.content))return"content: string expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId))return"documentId: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.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")){var t=r.CommentsThreadDescriptor.verify(e.commentThread);if(t)return"commentThread."+t}return null},s.fromObject=function(e){if(e instanceof r.CommentsV2UpdateCommentMessage)return e;var t=new r.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=r.CommentsThreadDescriptor.fromObject(e.commentThread)}return t},s.toObject=function(e,t){t||(t={});var 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=r.CommentsThreadDescriptor.toObject(e.commentThread,t)),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2UpdateCommentMessage"},s}(),r.CommentsV2AddCommentResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.commentId="",s.prototype.createdAt="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&n.uint32(18).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(26).string(e.createdAt),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2AddCommentResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.commentId=t.string();break;case 3:i.createdAt=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!n.isString(e.commentId)?"commentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2AddCommentResponse)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentResponse"},s}(),r.CommentsV2AddCommentThreadResponse=function(){function s(e){if(this.comments=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.createdAt="",s.prototype.comments=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(18).string(e.createdAt),null!=e.comments&&e.comments.length)for(var s=0;s<e.comments.length;++s)r.CommentThreadAddedCommentDescriptor.encode(e.comments[s],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2AddCommentThreadResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.createdAt=t.string();break;case 3:i.comments&&i.comments.length||(i.comments=[]),i.comments.push(r.CommentThreadAddedCommentDescriptor.decode(t,t.uint32()));break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt))return"createdAt: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(var t=0;t<e.comments.length;++t){var s=r.CommentThreadAddedCommentDescriptor.verify(e.comments[t]);if(s)return"comments."+s}}return null},s.fromObject=function(e){if(e instanceof r.CommentsV2AddCommentThreadResponse)return e;var t=new r.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(var n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsV2AddCommentThreadResponse.comments: object expected");t.comments[n]=r.CommentThreadAddedCommentDescriptor.fromObject(e.comments[n])}}return t},s.toObject=function(e,t){t||(t={});var 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(var s=0;s<e.comments.length;++s)n.comments[s]=r.CommentThreadAddedCommentDescriptor.toObject(e.comments[s],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentThreadResponse"},s}(),r.CommentsV2ResolveCommentThreadResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(18).string(e.documentId),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&n.uint32(26).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&n.uint32(34).string(e.resolvedBy),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2ResolveCommentThreadResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.documentId=t.string();break;case 3:i.resolvedAt=t.string();break;case 4:i.resolvedBy=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!n.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!n.isString(e.resolvedBy)?"resolvedBy: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2ResolveCommentThreadResponse)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ResolveCommentThreadResponse"},s}(),r.CommentsV2ConnectResponse=function(){function s(e){if(this.threads=[],this.threadsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.threads=n.emptyArray,s.prototype.threadsV2=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&n.uint32(10).string(e.channel),null!=e.threads&&e.threads.length)for(var s=0;s<e.threads.length;++s)n.uint32(18).string(e.threads[s]);if(null!=e.threadsV2&&e.threadsV2.length)for(s=0;s<e.threadsV2.length;++s)r.CommentsThreadDescriptor.encode(e.threadsV2[s],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2ConnectResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.channel=t.string();break;case 2:i.threads&&i.threads.length||(i.threads=[]),i.threads.push(t.string());break;case 3:i.threadsV2&&i.threadsV2.length||(i.threadsV2=[]),i.threadsV2.push(r.CommentsThreadDescriptor.decode(t,t.uint32()));break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!n.isString(e.channel))return"channel: string expected";if(null!=e.threads&&e.hasOwnProperty("threads")){if(!Array.isArray(e.threads))return"threads: array expected";for(var t=0;t<e.threads.length;++t)if(!n.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(t=0;t<e.threadsV2.length;++t){var s=r.CommentsThreadDescriptor.verify(e.threadsV2[t]);if(s)return"threadsV2."+s}}return null},s.fromObject=function(e){if(e instanceof r.CommentsV2ConnectResponse)return e;var t=new r.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(var 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");for(t.threadsV2=[],n=0;n<e.threadsV2.length;++n){if("object"!=typeof e.threadsV2[n])throw TypeError(".CommentsV2ConnectResponse.threadsV2: object expected");t.threadsV2[n]=r.CommentsThreadDescriptor.fromObject(e.threadsV2[n])}}return t},s.toObject=function(e,t){t||(t={});var 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(var s=0;s<e.threads.length;++s)n.threads[s]=e.threads[s]}if(e.threadsV2&&e.threadsV2.length)for(n.threadsV2=[],s=0;s<e.threadsV2.length;++s)n.threadsV2[s]=r.CommentsThreadDescriptor.toObject(e.threadsV2[s],t);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ConnectResponse"},s}(),r.CommentsV2GetCommentThreadResponse=function(){function s(e){if(this.comments=[],this.commentsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.comments=n.emptyArray,s.prototype.commentsV2=n.emptyArray,s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.prototype.context="",s.prototype.createdAt="",s.prototype.deletedAt="",s.prototype.attributes="",s.prototype.unlinkedAt="",s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&n.uint32(10).string(e.commentThreadId),null!=e.comments&&e.comments.length)for(var s=0;s<e.comments.length;++s)n.uint32(18).string(e.comments[s]);if(null!=e.commentsV2&&e.commentsV2.length)for(s=0;s<e.commentsV2.length;++s)r.CommentDescriptor.encode(e.commentsV2[s],n.uint32(26).fork()).ldelim();return null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&n.uint32(34).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&n.uint32(42).string(e.resolvedBy),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&n.uint32(50).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(58).string(e.createdAt),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&n.uint32(66).string(e.deletedAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(74).string(e.attributes),null!=e.unlinkedAt&&Object.hasOwnProperty.call(e,"unlinkedAt")&&n.uint32(82).string(e.unlinkedAt),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2GetCommentThreadResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=t.string();break;case 2:i.comments&&i.comments.length||(i.comments=[]),i.comments.push(t.string());break;case 3:i.commentsV2&&i.commentsV2.length||(i.commentsV2=[]),i.commentsV2.push(r.CommentDescriptor.decode(t,t.uint32()));break;case 4:i.resolvedAt=t.string();break;case 5:i.resolvedBy=t.string();break;case 6:i.context=t.string();break;case 7:i.createdAt=t.string();break;case 8:i.deletedAt=t.string();break;case 9:i.attributes=t.string();break;case 10:i.unlinkedAt=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!n.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(var t=0;t<e.comments.length;++t)if(!n.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(t=0;t<e.commentsV2.length;++t){var s=r.CommentDescriptor.verify(e.commentsV2[t]);if(s)return"commentsV2."+s}}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!n.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!n.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.context&&e.hasOwnProperty("context")&&!n.isString(e.context)?"context: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!n.isString(e.deletedAt)?"deletedAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&!n.isString(e.unlinkedAt)?"unlinkedAt: string expected":null},s.fromObject=function(e){if(e instanceof r.CommentsV2GetCommentThreadResponse)return e;var t=new r.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(var 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");for(t.commentsV2=[],n=0;n<e.commentsV2.length;++n){if("object"!=typeof e.commentsV2[n])throw TypeError(".CommentsV2GetCommentThreadResponse.commentsV2: object expected");t.commentsV2[n]=r.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},s.toObject=function(e,t){t||(t={});var 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(var s=0;s<e.comments.length;++s)n.comments[s]=e.comments[s]}if(e.commentsV2&&e.commentsV2.length)for(n.commentsV2=[],s=0;s<e.commentsV2.length;++s)n.commentsV2[s]=r.CommentDescriptor.toObject(e.commentsV2[s],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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetCommentThreadResponse"},s}(),r.CommentsV2GetDocumentThreadsResponse=function(){function s(e){if(this.threads=[],this.threadsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.threads=n.emptyArray,s.prototype.threadsV2=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.threads&&e.threads.length)for(var s=0;s<e.threads.length;++s)n.uint32(10).string(e.threads[s]);if(null!=e.threadsV2&&e.threadsV2.length)for(s=0;s<e.threadsV2.length;++s)r.CommentsThreadDescriptor.encode(e.threadsV2[s],n.uint32(18).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.CommentsV2GetDocumentThreadsResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.threads&&i.threads.length||(i.threads=[]),i.threads.push(t.string());break;case 2:i.threadsV2&&i.threadsV2.length||(i.threadsV2=[]),i.threadsV2.push(r.CommentsThreadDescriptor.decode(t,t.uint32()));break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.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(var t=0;t<e.threads.length;++t)if(!n.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(t=0;t<e.threadsV2.length;++t){var s=r.CommentsThreadDescriptor.verify(e.threadsV2[t]);if(s)return"threadsV2."+s}}return null},s.fromObject=function(e){if(e instanceof r.CommentsV2GetDocumentThreadsResponse)return e;var t=new r.CommentsV2GetDocumentThreadsResponse;if(e.threads){if(!Array.isArray(e.threads))throw TypeError(".CommentsV2GetDocumentThreadsResponse.threads: array expected");t.threads=[];for(var 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");for(t.threadsV2=[],n=0;n<e.threadsV2.length;++n){if("object"!=typeof e.threadsV2[n])throw TypeError(".CommentsV2GetDocumentThreadsResponse.threadsV2: object expected");t.threadsV2[n]=r.CommentsThreadDescriptor.fromObject(e.threadsV2[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.threads=[],n.threadsV2=[]),e.threads&&e.threads.length){n.threads=[];for(var s=0;s<e.threads.length;++s)n.threads[s]=e.threads[s]}if(e.threadsV2&&e.threadsV2.length)for(n.threadsV2=[],s=0;s<e.threadsV2.length;++s)n.threadsV2[s]=r.CommentsThreadDescriptor.toObject(e.threadsV2[s],t);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetDocumentThreadsResponse"},s}(),r.KeyValueDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.key="",s.prototype.value="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&n.uint32(10).string(e.key),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&n.uint32(18).string(e.value),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.KeyValueDescriptor;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.key=t.string();break;case 2:i.value=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!n.isString(e.key)?"key: string expected":null!=e.value&&e.hasOwnProperty("value")&&!n.isString(e.value)?"value: string expected":null},s.fromObject=function(e){if(e instanceof r.KeyValueDescriptor)return e;var t=new r.KeyValueDescriptor;return null!=e.key&&(t.key=String(e.key)),null!=e.value&&(t.value=String(e.value)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/KeyValueDescriptor"},s}(),r.IsEditorBundleUploadedMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.bundleVersion="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&n.uint32(10).string(e.bundleVersion),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.IsEditorBundleUploadedMessage;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?i.bundleVersion=t.string():t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!n.isString(e.bundleVersion)?"bundleVersion: string expected":null},s.fromObject=function(e){if(e instanceof r.IsEditorBundleUploadedMessage)return e;var t=new r.IsEditorBundleUploadedMessage;return null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.bundleVersion=""),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/IsEditorBundleUploadedMessage"},s}(),r.IsEditorBundleUploadedResponse=function(){function n(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return n.prototype.isUploaded=!1,n.create=function(e){return new n(e)},n.encode=function(e,n){return n||(n=t.create()),null!=e.isUploaded&&Object.hasOwnProperty.call(e,"isUploaded")&&n.uint32(8).bool(e.isUploaded),n},n.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},n.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.IsEditorBundleUploadedResponse;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?i.isUploaded=t.bool():t.skipType(7&a)}return i},n.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},n.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},n.fromObject=function(e){if(e instanceof r.IsEditorBundleUploadedResponse)return e;var t=new r.IsEditorBundleUploadedResponse;return null!=e.isUploaded&&(t.isUploaded=Boolean(e.isUploaded)),t},n.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.isUploaded=!1),null!=e.isUploaded&&e.hasOwnProperty("isUploaded")&&(n.isUploaded=e.isUploaded),n},n.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},n.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/IsEditorBundleUploadedResponse"},n}(),r.RevisionDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.revisionId="",s.prototype.name="",s.prototype.creatorId="",s.prototype.authorsIds="",s.prototype.diffData="",s.prototype.createdAt="",s.prototype.attributes="",s.prototype.toVersion=0,s.prototype.fromVersion=0,s.prototype.isEmptyCurrent=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&n.uint32(10).string(e.revisionId),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&n.uint32(18).string(e.name),null!=e.creatorId&&Object.hasOwnProperty.call(e,"creatorId")&&n.uint32(26).string(e.creatorId),null!=e.authorsIds&&Object.hasOwnProperty.call(e,"authorsIds")&&n.uint32(34).string(e.authorsIds),null!=e.diffData&&Object.hasOwnProperty.call(e,"diffData")&&n.uint32(42).string(e.diffData),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(58).string(e.attributes),null!=e.toVersion&&Object.hasOwnProperty.call(e,"toVersion")&&n.uint32(64).uint32(e.toVersion),null!=e.fromVersion&&Object.hasOwnProperty.call(e,"fromVersion")&&n.uint32(72).uint32(e.fromVersion),null!=e.isEmptyCurrent&&Object.hasOwnProperty.call(e,"isEmptyCurrent")&&n.uint32(80).bool(e.isEmptyCurrent),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.RevisionDescriptor;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.revisionId=t.string();break;case 2:i.name=t.string();break;case 3:i.creatorId=t.string();break;case 4:i.authorsIds=t.string();break;case 5:i.diffData=t.string();break;case 6:i.createdAt=t.string();break;case 7:i.attributes=t.string();break;case 8:i.toVersion=t.uint32();break;case 9:i.fromVersion=t.uint32();break;case 10:i.isEmptyCurrent=t.bool();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!n.isString(e.revisionId)?"revisionId: string expected":null!=e.name&&e.hasOwnProperty("name")&&!n.isString(e.name)?"name: string expected":null!=e.creatorId&&e.hasOwnProperty("creatorId")&&!n.isString(e.creatorId)?"creatorId: string expected":null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&!n.isString(e.authorsIds)?"authorsIds: string expected":null!=e.diffData&&e.hasOwnProperty("diffData")&&!n.isString(e.diffData)?"diffData: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null!=e.toVersion&&e.hasOwnProperty("toVersion")&&!n.isInteger(e.toVersion)?"toVersion: integer expected":null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&!n.isInteger(e.fromVersion)?"fromVersion: integer expected":null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof e.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},s.fromObject=function(e){if(e instanceof r.RevisionDescriptor)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionDescriptor"},s}(),r.RevisionHistoryConnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(10).string(e.documentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.RevisionHistoryConnectMessage;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?i.documentId=t.string():t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof r.RevisionHistoryConnectMessage)return e;var t=new r.RevisionHistoryConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryConnectMessage"},s}(),r.RevisionHistoryGetRevisionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.revisionId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(10).string(e.documentId),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&n.uint32(18).string(e.revisionId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.RevisionHistoryGetRevisionMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.documentId=t.string();break;case 2:i.revisionId=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!n.isString(e.revisionId)?"revisionId: string expected":null},s.fromObject=function(e){if(e instanceof r.RevisionHistoryGetRevisionMessage)return e;var t=new r.RevisionHistoryGetRevisionMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.revisionId&&(t.revisionId=String(e.revisionId)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryGetRevisionMessage"},s}(),r.RevisionHistoryReconnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.requestId=0,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(10).string(e.documentId),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&n.uint32(16).uint32(e.requestId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.RevisionHistoryReconnectMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.documentId=t.string();break;case 2:i.requestId=t.uint32();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null!=e.requestId&&e.hasOwnProperty("requestId")&&!n.isInteger(e.requestId)?"requestId: integer expected":null},s.fromObject=function(e){if(e instanceof r.RevisionHistoryReconnectMessage)return e;var t=new r.RevisionHistoryReconnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.requestId&&(t.requestId=e.requestId>>>0),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryReconnectMessage"},s}(),r.RevisionHistoryUpdateRevisionsMessage=function(){function s(e){if(this.revisions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.requestId=0,s.prototype.revisions=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(10).string(e.documentId),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&n.uint32(16).uint32(e.requestId),null!=e.revisions&&e.revisions.length)for(var s=0;s<e.revisions.length;++s)r.RevisionDescriptor.encode(e.revisions[s],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.RevisionHistoryUpdateRevisionsMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.documentId=t.string();break;case 2:i.requestId=t.uint32();break;case 3:i.revisions&&i.revisions.length||(i.revisions=[]),i.revisions.push(r.RevisionDescriptor.decode(t,t.uint32()));break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId))return"documentId: string expected";if(null!=e.requestId&&e.hasOwnProperty("requestId")&&!n.isInteger(e.requestId))return"requestId: integer expected";if(null!=e.revisions&&e.hasOwnProperty("revisions")){if(!Array.isArray(e.revisions))return"revisions: array expected";for(var t=0;t<e.revisions.length;++t){var s=r.RevisionDescriptor.verify(e.revisions[t]);if(s)return"revisions."+s}}return null},s.fromObject=function(e){if(e instanceof r.RevisionHistoryUpdateRevisionsMessage)return e;var t=new r.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(var n=0;n<e.revisions.length;++n){if("object"!=typeof e.revisions[n])throw TypeError(".RevisionHistoryUpdateRevisionsMessage.revisions: object expected");t.revisions[n]=r.RevisionDescriptor.fromObject(e.revisions[n])}}return t},s.toObject=function(e,t){t||(t={});var 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(var s=0;s<e.revisions.length;++s)n.revisions[s]=r.RevisionDescriptor.toObject(e.revisions[s],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryUpdateRevisionsMessage"},s}(),r.RevisionHistoryConnectResponse=function(){function s(e){if(this.revisions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.requestId=0,s.prototype.revisions=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&n.uint32(10).string(e.channel),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&n.uint32(16).uint32(e.requestId),null!=e.revisions&&e.revisions.length)for(var s=0;s<e.revisions.length;++s)r.RevisionDescriptor.encode(e.revisions[s],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.RevisionHistoryConnectResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.channel=t.string();break;case 2:i.requestId=t.uint32();break;case 3:i.revisions&&i.revisions.length||(i.revisions=[]),i.revisions.push(r.RevisionDescriptor.decode(t,t.uint32()));break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!n.isString(e.channel))return"channel: string expected";if(null!=e.requestId&&e.hasOwnProperty("requestId")&&!n.isInteger(e.requestId))return"requestId: integer expected";if(null!=e.revisions&&e.hasOwnProperty("revisions")){if(!Array.isArray(e.revisions))return"revisions: array expected";for(var t=0;t<e.revisions.length;++t){var s=r.RevisionDescriptor.verify(e.revisions[t]);if(s)return"revisions."+s}}return null},s.fromObject=function(e){if(e instanceof r.RevisionHistoryConnectResponse)return e;var t=new r.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(var n=0;n<e.revisions.length;++n){if("object"!=typeof e.revisions[n])throw TypeError(".RevisionHistoryConnectResponse.revisions: object expected");t.revisions[n]=r.RevisionDescriptor.fromObject(e.revisions[n])}}return t},s.toObject=function(e,t){t||(t={});var 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(var s=0;s<e.revisions.length;++s)n.revisions[s]=r.RevisionDescriptor.toObject(e.revisions[s],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryConnectResponse"},s}(),r.RevisionHistoryGetRevisionResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.revisionId="",s.prototype.name="",s.prototype.creatorId="",s.prototype.authorsIds="",s.prototype.diffData="",s.prototype.createdAt="",s.prototype.attributes="",s.prototype.toVersion=0,s.prototype.fromVersion=0,s.prototype.isEmptyCurrent=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&n.uint32(10).string(e.revisionId),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&n.uint32(18).string(e.name),null!=e.creatorId&&Object.hasOwnProperty.call(e,"creatorId")&&n.uint32(26).string(e.creatorId),null!=e.authorsIds&&Object.hasOwnProperty.call(e,"authorsIds")&&n.uint32(34).string(e.authorsIds),null!=e.diffData&&Object.hasOwnProperty.call(e,"diffData")&&n.uint32(42).string(e.diffData),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(58).string(e.attributes),null!=e.toVersion&&Object.hasOwnProperty.call(e,"toVersion")&&n.uint32(64).uint32(e.toVersion),null!=e.fromVersion&&Object.hasOwnProperty.call(e,"fromVersion")&&n.uint32(72).uint32(e.fromVersion),null!=e.isEmptyCurrent&&Object.hasOwnProperty.call(e,"isEmptyCurrent")&&n.uint32(80).bool(e.isEmptyCurrent),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.RevisionHistoryGetRevisionResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.revisionId=t.string();break;case 2:i.name=t.string();break;case 3:i.creatorId=t.string();break;case 4:i.authorsIds=t.string();break;case 5:i.diffData=t.string();break;case 6:i.createdAt=t.string();break;case 7:i.attributes=t.string();break;case 8:i.toVersion=t.uint32();break;case 9:i.fromVersion=t.uint32();break;case 10:i.isEmptyCurrent=t.bool();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!n.isString(e.revisionId)?"revisionId: string expected":null!=e.name&&e.hasOwnProperty("name")&&!n.isString(e.name)?"name: string expected":null!=e.creatorId&&e.hasOwnProperty("creatorId")&&!n.isString(e.creatorId)?"creatorId: string expected":null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&!n.isString(e.authorsIds)?"authorsIds: string expected":null!=e.diffData&&e.hasOwnProperty("diffData")&&!n.isString(e.diffData)?"diffData: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null!=e.toVersion&&e.hasOwnProperty("toVersion")&&!n.isInteger(e.toVersion)?"toVersion: integer expected":null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&!n.isInteger(e.fromVersion)?"fromVersion: integer expected":null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof e.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},s.fromObject=function(e){if(e instanceof r.RevisionHistoryGetRevisionResponse)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryGetRevisionResponse"},s}(),r.RevisionHistoryUpdateRevisionsResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.requestId=0,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&n.uint32(8).uint32(e.requestId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.RevisionHistoryUpdateRevisionsResponse;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?i.requestId=t.uint32():t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.requestId&&e.hasOwnProperty("requestId")&&!n.isInteger(e.requestId)?"requestId: integer expected":null},s.fromObject=function(e){if(e instanceof r.RevisionHistoryUpdateRevisionsResponse)return e;var t=new r.RevisionHistoryUpdateRevisionsResponse;return null!=e.requestId&&(t.requestId=e.requestId>>>0),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.requestId=0),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryUpdateRevisionsResponse"},s}(),r.SessionsSocketDescriptor=function(){function s(e){if(this.permissions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.session="",s.prototype.user="",s.prototype.role="",s.prototype.permissions=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.session&&Object.hasOwnProperty.call(e,"session")&&n.uint32(10).string(e.session),null!=e.user&&Object.hasOwnProperty.call(e,"user")&&n.uint32(18).string(e.user),null!=e.role&&Object.hasOwnProperty.call(e,"role")&&n.uint32(26).string(e.role),null!=e.permissions&&e.permissions.length)for(var r=0;r<e.permissions.length;++r)n.uint32(34).string(e.permissions[r]);return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.SessionsSocketDescriptor;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.session=t.string();break;case 2:i.user=t.string();break;case 3:i.role=t.string();break;case 4:i.permissions&&i.permissions.length||(i.permissions=[]),i.permissions.push(t.string());break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.session&&e.hasOwnProperty("session")&&!n.isString(e.session))return"session: string expected";if(null!=e.user&&e.hasOwnProperty("user")&&!n.isString(e.user))return"user: string expected";if(null!=e.role&&e.hasOwnProperty("role")&&!n.isString(e.role))return"role: string expected";if(null!=e.permissions&&e.hasOwnProperty("permissions")){if(!Array.isArray(e.permissions))return"permissions: array expected";for(var t=0;t<e.permissions.length;++t)if(!n.isString(e.permissions[t]))return"permissions: string[] expected"}return null},s.fromObject=function(e){if(e instanceof r.SessionsSocketDescriptor)return e;var t=new r.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(var n=0;n<e.permissions.length;++n)t.permissions[n]=String(e.permissions[n])}return t},s.toObject=function(e,t){t||(t={});var 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(var r=0;r<e.permissions.length;++r)n.permissions[r]=e.permissions[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsSocketDescriptor"},s}(),r.SessionsConnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.sessionType=0,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.sessionType&&Object.hasOwnProperty.call(e,"sessionType")&&n.uint32(16).uint32(e.sessionType),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.SessionsConnectMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.sessionType=t.uint32();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id)?"id: string expected":null!=e.sessionType&&e.hasOwnProperty("sessionType")&&!n.isInteger(e.sessionType)?"sessionType: integer expected":null},s.fromObject=function(e){if(e instanceof r.SessionsConnectMessage)return e;var t=new r.SessionsConnectMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.sessionType&&(t.sessionType=e.sessionType>>>0),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsConnectMessage"},s}(),r.SocketConnectMessage=function(){function s(e){if(this.permissions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.userId="",s.prototype.role="",s.prototype.permissions=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(18).string(e.userId),null!=e.role&&Object.hasOwnProperty.call(e,"role")&&n.uint32(26).string(e.role),null!=e.permissions&&e.permissions.length)for(var r=0;r<e.permissions.length;++r)n.uint32(34).string(e.permissions[r]);return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.SocketConnectMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.userId=t.string();break;case 3:i.role=t.string();break;case 4:i.permissions&&i.permissions.length||(i.permissions=[]),i.permissions.push(t.string());break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id))return"id: string expected";if(null!=e.userId&&e.hasOwnProperty("userId")&&!n.isString(e.userId))return"userId: string expected";if(null!=e.role&&e.hasOwnProperty("role")&&!n.isString(e.role))return"role: string expected";if(null!=e.permissions&&e.hasOwnProperty("permissions")){if(!Array.isArray(e.permissions))return"permissions: array expected";for(var t=0;t<e.permissions.length;++t)if(!n.isString(e.permissions[t]))return"permissions: string[] expected"}return null},s.fromObject=function(e){if(e instanceof r.SocketConnectMessage)return e;var t=new r.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(var n=0;n<e.permissions.length;++n)t.permissions[n]=String(e.permissions[n])}return t},s.toObject=function(e,t){t||(t={});var 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(var r=0;r<e.permissions.length;++r)n.permissions[r]=e.permissions[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SocketConnectMessage"},s}(),r.SocketDisconnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.SocketDisconnectMessage;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?i.id=t.string():t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id)?"id: string expected":null},s.fromObject=function(e){if(e instanceof r.SocketDisconnectMessage)return e;var t=new r.SocketDisconnectMessage;return null!=e.id&&(t.id=String(e.id)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SocketDisconnectMessage"},s}(),r.SessionsConnectResponse=function(){function s(e){if(this.sockets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.sockets=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&n.uint32(10).string(e.channel),null!=e.sockets&&e.sockets.length)for(var s=0;s<e.sockets.length;++s)r.SessionsSocketDescriptor.encode(e.sockets[s],n.uint32(18).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.SessionsConnectResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.channel=t.string();break;case 2:i.sockets&&i.sockets.length||(i.sockets=[]),i.sockets.push(r.SessionsSocketDescriptor.decode(t,t.uint32()));break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!n.isString(e.channel))return"channel: string expected";if(null!=e.sockets&&e.hasOwnProperty("sockets")){if(!Array.isArray(e.sockets))return"sockets: array expected";for(var t=0;t<e.sockets.length;++t){var s=r.SessionsSocketDescriptor.verify(e.sockets[t]);if(s)return"sockets."+s}}return null},s.fromObject=function(e){if(e instanceof r.SessionsConnectResponse)return e;var t=new r.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(var n=0;n<e.sockets.length;++n){if("object"!=typeof e.sockets[n])throw TypeError(".SessionsConnectResponse.sockets: object expected");t.sockets[n]=r.SessionsSocketDescriptor.fromObject(e.sockets[n])}}return t},s.toObject=function(e,t){t||(t={});var 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(var s=0;s<e.sockets.length;++s)n.sockets[s]=r.SessionsSocketDescriptor.toObject(e.sockets[s],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsConnectResponse"},s}(),r.SuggestionDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.authorId="",s.prototype.type="",s.prototype.createdAt="",s.prototype.data="",s.prototype.hasComments=!1,s.prototype.state="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&n.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&n.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&n.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&n.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(66).string(e.attributes),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.SuggestionDescriptor;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.authorId=t.string();break;case 3:i.type=t.string();break;case 4:i.createdAt=t.string();break;case 5:i.data=t.string();break;case 6:i.hasComments=t.bool();break;case 7:i.state=t.string();break;case 8:i.attributes=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!n.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!n.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!n.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")&&!n.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof r.SuggestionDescriptor)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SuggestionDescriptor"},s}(),r.TrackChangesAddSuggestionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.documentId="",s.prototype.type="",s.prototype.data="",s.prototype.originalSuggestionId="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(18).string(e.documentId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&n.uint32(26).string(e.type),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(34).string(e.data),null!=e.originalSuggestionId&&Object.hasOwnProperty.call(e,"originalSuggestionId")&&n.uint32(42).string(e.originalSuggestionId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(50).string(e.attributes),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.TrackChangesAddSuggestionMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.documentId=t.string();break;case 3:i.type=t.string();break;case 4:i.data=t.string();break;case 5:i.originalSuggestionId=t.string();break;case 6:i.attributes=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!n.isString(e.type)?"type: string expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isString(e.data)?"data: string expected":null!=e.originalSuggestionId&&e.hasOwnProperty("originalSuggestionId")&&!n.isString(e.originalSuggestionId)?"originalSuggestionId: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof r.TrackChangesAddSuggestionMessage)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesAddSuggestionMessage"},s}(),r.TrackChangesBatchUpdateSuggestionsStateMessage=function(){function s(e){if(this.ids=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.ids=n.emptyArray,s.prototype.documentId="",s.prototype.state="",s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.ids&&e.ids.length)for(var r=0;r<e.ids.length;++r)n.uint32(10).string(e.ids[r]);return null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(18).string(e.documentId),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&n.uint32(26).string(e.state),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.TrackChangesBatchUpdateSuggestionsStateMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.ids&&i.ids.length||(i.ids=[]),i.ids.push(t.string());break;case 2:i.documentId=t.string();break;case 3:i.state=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.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(var t=0;t<e.ids.length;++t)if(!n.isString(e.ids[t]))return"ids: string[] expected"}return null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null!=e.state&&e.hasOwnProperty("state")&&!n.isString(e.state)?"state: string expected":null},s.fromObject=function(e){if(e instanceof r.TrackChangesBatchUpdateSuggestionsStateMessage)return e;var t=new r.TrackChangesBatchUpdateSuggestionsStateMessage;if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".TrackChangesBatchUpdateSuggestionsStateMessage.ids: array expected");t.ids=[];for(var 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},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.ids=[]),t.defaults&&(n.documentId="",n.state=""),e.ids&&e.ids.length){n.ids=[];for(var r=0;r<e.ids.length;++r)n.ids[r]=e.ids[r]}return null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesBatchUpdateSuggestionsStateMessage"},s}(),r.TrackChangesConnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(10).string(e.documentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.TrackChangesConnectMessage;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?i.documentId=t.string():t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof r.TrackChangesConnectMessage)return e;var t=new r.TrackChangesConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesConnectMessage"},s}(),r.TrackChangesGetAllSuggestionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(10).string(e.documentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.TrackChangesGetAllSuggestionMessage;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?i.documentId=t.string():t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof r.TrackChangesGetAllSuggestionMessage)return e;var t=new r.TrackChangesGetAllSuggestionMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetAllSuggestionMessage"},s}(),r.TrackChangesGetSuggestionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(18).string(e.documentId),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.TrackChangesGetSuggestionMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.documentId=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof r.TrackChangesGetSuggestionMessage)return e;var t=new r.TrackChangesGetSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetSuggestionMessage"},s}(),r.TrackChangesUpdateSuggestionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.documentId="",s.prototype.hasComments=!1,s.prototype.isHasCommentsModified=!1,s.prototype.state="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&n.uint32(18).string(e.documentId),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&n.uint32(24).bool(e.hasComments),null!=e.isHasCommentsModified&&Object.hasOwnProperty.call(e,"isHasCommentsModified")&&n.uint32(32).bool(e.isHasCommentsModified),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&n.uint32(42).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(50).string(e.attributes),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.TrackChangesUpdateSuggestionMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.documentId=t.string();break;case 3:i.hasComments=t.bool();break;case 4:i.isHasCommentsModified=t.bool();break;case 5:i.state=t.string();break;case 6:i.attributes=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!n.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")&&!n.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof r.TrackChangesUpdateSuggestionMessage)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesUpdateSuggestionMessage"},s}(),r.TrackChangesAddSuggestionResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.authorId="",s.prototype.type="",s.prototype.createdAt="",s.prototype.data="",s.prototype.hasComments=!1,s.prototype.state="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&n.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&n.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&n.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&n.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(66).string(e.attributes),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.TrackChangesAddSuggestionResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.authorId=t.string();break;case 3:i.type=t.string();break;case 4:i.createdAt=t.string();break;case 5:i.data=t.string();break;case 6:i.hasComments=t.bool();break;case 7:i.state=t.string();break;case 8:i.attributes=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!n.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!n.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!n.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")&&!n.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof r.TrackChangesAddSuggestionResponse)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesAddSuggestionResponse"},s}(),r.TrackChangesConnectResponse=function(){function s(e){if(this.suggestions=[],this.suggestionsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.suggestions=n.emptyArray,s.prototype.suggestionsV2=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&n.uint32(10).string(e.channel),null!=e.suggestions&&e.suggestions.length)for(var s=0;s<e.suggestions.length;++s)n.uint32(18).string(e.suggestions[s]);if(null!=e.suggestionsV2&&e.suggestionsV2.length)for(s=0;s<e.suggestionsV2.length;++s)r.SuggestionDescriptor.encode(e.suggestionsV2[s],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.TrackChangesConnectResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.channel=t.string();break;case 2:i.suggestions&&i.suggestions.length||(i.suggestions=[]),i.suggestions.push(t.string());break;case 3:i.suggestionsV2&&i.suggestionsV2.length||(i.suggestionsV2=[]),i.suggestionsV2.push(r.SuggestionDescriptor.decode(t,t.uint32()));break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!n.isString(e.channel))return"channel: string expected";if(null!=e.suggestions&&e.hasOwnProperty("suggestions")){if(!Array.isArray(e.suggestions))return"suggestions: array expected";for(var t=0;t<e.suggestions.length;++t)if(!n.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(t=0;t<e.suggestionsV2.length;++t){var s=r.SuggestionDescriptor.verify(e.suggestionsV2[t]);if(s)return"suggestionsV2."+s}}return null},s.fromObject=function(e){if(e instanceof r.TrackChangesConnectResponse)return e;var t=new r.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(var 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");for(t.suggestionsV2=[],n=0;n<e.suggestionsV2.length;++n){if("object"!=typeof e.suggestionsV2[n])throw TypeError(".TrackChangesConnectResponse.suggestionsV2: object expected");t.suggestionsV2[n]=r.SuggestionDescriptor.fromObject(e.suggestionsV2[n])}}return t},s.toObject=function(e,t){t||(t={});var 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(var s=0;s<e.suggestions.length;++s)n.suggestions[s]=e.suggestions[s]}if(e.suggestionsV2&&e.suggestionsV2.length)for(n.suggestionsV2=[],s=0;s<e.suggestionsV2.length;++s)n.suggestionsV2[s]=r.SuggestionDescriptor.toObject(e.suggestionsV2[s],t);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesConnectResponse"},s}(),r.TrackChangesGetAllSuggestionsResponse=function(){function s(e){if(this.suggestions=[],this.suggestionsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.suggestions=n.emptyArray,s.prototype.suggestionsV2=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.suggestions&&e.suggestions.length)for(var s=0;s<e.suggestions.length;++s)n.uint32(10).string(e.suggestions[s]);if(null!=e.suggestionsV2&&e.suggestionsV2.length)for(s=0;s<e.suggestionsV2.length;++s)r.SuggestionDescriptor.encode(e.suggestionsV2[s],n.uint32(18).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.TrackChangesGetAllSuggestionsResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.suggestions&&i.suggestions.length||(i.suggestions=[]),i.suggestions.push(t.string());break;case 2:i.suggestionsV2&&i.suggestionsV2.length||(i.suggestionsV2=[]),i.suggestionsV2.push(r.SuggestionDescriptor.decode(t,t.uint32()));break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.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(var t=0;t<e.suggestions.length;++t)if(!n.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(t=0;t<e.suggestionsV2.length;++t){var s=r.SuggestionDescriptor.verify(e.suggestionsV2[t]);if(s)return"suggestionsV2."+s}}return null},s.fromObject=function(e){if(e instanceof r.TrackChangesGetAllSuggestionsResponse)return e;var t=new r.TrackChangesGetAllSuggestionsResponse;if(e.suggestions){if(!Array.isArray(e.suggestions))throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestions: array expected");t.suggestions=[];for(var 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");for(t.suggestionsV2=[],n=0;n<e.suggestionsV2.length;++n){if("object"!=typeof e.suggestionsV2[n])throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestionsV2: object expected");t.suggestionsV2[n]=r.SuggestionDescriptor.fromObject(e.suggestionsV2[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.suggestions=[],n.suggestionsV2=[]),e.suggestions&&e.suggestions.length){n.suggestions=[];for(var s=0;s<e.suggestions.length;++s)n.suggestions[s]=e.suggestions[s]}if(e.suggestionsV2&&e.suggestionsV2.length)for(n.suggestionsV2=[],s=0;s<e.suggestionsV2.length;++s)n.suggestionsV2[s]=r.SuggestionDescriptor.toObject(e.suggestionsV2[s],t);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetAllSuggestionsResponse"},s}(),r.TrackChangesGetSuggestionResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.authorId="",s.prototype.type="",s.prototype.createdAt="",s.prototype.data="",s.prototype.hasComments=!1,s.prototype.state="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&n.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&n.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&n.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&n.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&n.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&n.uint32(66).string(e.attributes),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.TrackChangesGetSuggestionResponse;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=t.string();break;case 2:i.authorId=t.string();break;case 3:i.type=t.string();break;case 4:i.createdAt=t.string();break;case 5:i.data=t.string();break;case 6:i.hasComments=t.bool();break;case 7:i.state=t.string();break;case 8:i.attributes=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!n.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!n.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!n.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!n.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")&&!n.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!n.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof r.TrackChangesGetSuggestionResponse)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetSuggestionResponse"},s}(),r.UserDescriptor=function(){function s(e){if(this.attributes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.attributes=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.attributes&&e.attributes.length)for(var s=0;s<e.attributes.length;++s)r.KeyValueDescriptor.encode(e.attributes[s],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.UserDescriptor;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?(i.attributes&&i.attributes.length||(i.attributes=[]),i.attributes.push(r.KeyValueDescriptor.decode(t,t.uint32()))):t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.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(var t=0;t<e.attributes.length;++t){var n=r.KeyValueDescriptor.verify(e.attributes[t]);if(n)return"attributes."+n}}return null},s.fromObject=function(e){if(e instanceof r.UserDescriptor)return e;var t=new r.UserDescriptor;if(e.attributes){if(!Array.isArray(e.attributes))throw TypeError(".UserDescriptor.attributes: array expected");t.attributes=[];for(var n=0;n<e.attributes.length;++n){if("object"!=typeof e.attributes[n])throw TypeError(".UserDescriptor.attributes: object expected");t.attributes[n]=r.KeyValueDescriptor.fromObject(e.attributes[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.attributes=[]),e.attributes&&e.attributes.length){n.attributes=[];for(var s=0;s<e.attributes.length;++s)n.attributes[s]=r.KeyValueDescriptor.toObject(e.attributes[s],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/UserDescriptor"},s}(),r.GetManyUsersMessage=function(){function s(e){if(this.ids=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.ids=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.ids&&e.ids.length)for(var r=0;r<e.ids.length;++r)n.uint32(10).string(e.ids[r]);return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.GetManyUsersMessage;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?(i.ids&&i.ids.length||(i.ids=[]),i.ids.push(t.string())):t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.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(var t=0;t<e.ids.length;++t)if(!n.isString(e.ids[t]))return"ids: string[] expected"}return null},s.fromObject=function(e){if(e instanceof r.GetManyUsersMessage)return e;var t=new r.GetManyUsersMessage;if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".GetManyUsersMessage.ids: array expected");t.ids=[];for(var n=0;n<e.ids.length;++n)t.ids[n]=String(e.ids[n])}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.ids=[]),e.ids&&e.ids.length){n.ids=[];for(var r=0;r<e.ids.length;++r)n.ids[r]=e.ids[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetManyUsersMessage"},s}(),r.GetUserMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.GetUserMessage;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?i.id=t.string():t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isString(e.id)?"id: string expected":null},s.fromObject=function(e){if(e instanceof r.GetUserMessage)return e;var t=new r.GetUserMessage;return null!=e.id&&(t.id=String(e.id)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetUserMessage"},s}(),r.GetManyUsersResponse=function(){function s(e){if(this.users=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.users=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.users&&e.users.length)for(var s=0;s<e.users.length;++s)r.UserDescriptor.encode(e.users[s],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.GetManyUsersResponse;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?(i.users&&i.users.length||(i.users=[]),i.users.push(r.UserDescriptor.decode(t,t.uint32()))):t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.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(var t=0;t<e.users.length;++t){var n=r.UserDescriptor.verify(e.users[t]);if(n)return"users."+n}}return null},s.fromObject=function(e){if(e instanceof r.GetManyUsersResponse)return e;var t=new r.GetManyUsersResponse;if(e.users){if(!Array.isArray(e.users))throw TypeError(".GetManyUsersResponse.users: array expected");t.users=[];for(var n=0;n<e.users.length;++n){if("object"!=typeof e.users[n])throw TypeError(".GetManyUsersResponse.users: object expected");t.users[n]=r.UserDescriptor.fromObject(e.users[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.users=[]),e.users&&e.users.length){n.users=[];for(var s=0;s<e.users.length;++s)n.users[s]=r.UserDescriptor.toObject(e.users[s],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetManyUsersResponse"},s}(),r.GetUserResponse=function(){function s(e){if(this.attributes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.attributes=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.attributes&&e.attributes.length)for(var s=0;s<e.attributes.length;++s)r.KeyValueDescriptor.encode(e.attributes[s],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.GetUserResponse;t.pos<o;){var a=t.uint32();if(a===s)break;a>>>3==1?(i.attributes&&i.attributes.length||(i.attributes=[]),i.attributes.push(r.KeyValueDescriptor.decode(t,t.uint32()))):t.skipType(7&a)}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.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(var t=0;t<e.attributes.length;++t){var n=r.KeyValueDescriptor.verify(e.attributes[t]);if(n)return"attributes."+n}}return null},s.fromObject=function(e){if(e instanceof r.GetUserResponse)return e;var t=new r.GetUserResponse;if(e.attributes){if(!Array.isArray(e.attributes))throw TypeError(".GetUserResponse.attributes: array expected");t.attributes=[];for(var n=0;n<e.attributes.length;++n){if("object"!=typeof e.attributes[n])throw TypeError(".GetUserResponse.attributes: object expected");t.attributes[n]=r.KeyValueDescriptor.fromObject(e.attributes[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.attributes=[]),e.attributes&&e.attributes.length){n.attributes=[];for(var s=0;s<e.attributes.length;++s)n.attributes[s]=r.KeyValueDescriptor.toObject(e.attributes[s],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetUserResponse"},s}(),r.ChannelMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.type=0,s.prototype.socketId="",s.prototype.data=n.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&n.uint32(8).uint32(e.type),null!=e.socketId&&Object.hasOwnProperty.call(e,"socketId")&&n.uint32(18).string(e.socketId),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(26).bytes(e.data),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.ChannelMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.type=t.uint32();break;case 2:i.socketId=t.string();break;case 3:i.data=t.bytes();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!n.isInteger(e.type)?"type: integer expected":null!=e.socketId&&e.hasOwnProperty("socketId")&&!n.isString(e.socketId)?"socketId: string expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||n.isString(e.data))?"data: buffer expected":null},s.fromObject=function(e){if(e instanceof r.ChannelMessage)return e;var t=new r.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?n.base64.decode(e.data,t.data=n.newBuffer(n.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),t},s.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.type=0,r.socketId="",t.bytes===String?r.data="":(r.data=[],t.bytes!==Array&&(r.data=n.newBuffer(r.data)))),null!=e.type&&e.hasOwnProperty("type")&&(r.type=e.type),null!=e.socketId&&e.hasOwnProperty("socketId")&&(r.socketId=e.socketId),null!=e.data&&e.hasOwnProperty("data")&&(r.data=t.bytes===String?n.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ChannelMessage"},s}(),r.BytesBytesPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=n.newBuffer([]),s.prototype.data1=n.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(10).bytes(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(18).bytes(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.BytesBytesPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.bytes();break;case 2:i.data1=t.bytes();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||n.isString(e.data))?"data: buffer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||n.isString(e.data1))?"data1: buffer expected":null},s.fromObject=function(e){if(e instanceof r.BytesBytesPacketDataMessage)return e;var t=new r.BytesBytesPacketDataMessage;return null!=e.data&&("string"==typeof e.data?n.base64.decode(e.data,t.data=n.newBuffer(n.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),null!=e.data1&&("string"==typeof e.data1?n.base64.decode(e.data1,t.data1=n.newBuffer(n.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},s.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.data="":(r.data=[],t.bytes!==Array&&(r.data=n.newBuffer(r.data))),t.bytes===String?r.data1="":(r.data1=[],t.bytes!==Array&&(r.data1=n.newBuffer(r.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(r.data=t.bytes===String?n.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")&&(r.data1=t.bytes===String?n.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/BytesBytesPacketDataMessage"},s}(),r.NumberBytesPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=0,s.prototype.data1=n.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(18).bytes(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.NumberBytesPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.uint32();break;case 2:i.data1=t.bytes();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||n.isString(e.data1))?"data1: buffer expected":null},s.fromObject=function(e){if(e instanceof r.NumberBytesPacketDataMessage)return e;var t=new r.NumberBytesPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&("string"==typeof e.data1?n.base64.decode(e.data1,t.data1=n.newBuffer(n.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},s.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.data=0,t.bytes===String?r.data1="":(r.data1=[],t.bytes!==Array&&(r.data1=n.newBuffer(r.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(r.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(r.data1=t.bytes===String?n.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberBytesPacketDataMessage"},s}(),r.NumberNumberPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=0,s.prototype.data1=0,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(16).uint32(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.NumberNumberPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.uint32();break;case 2:i.data1=t.uint32();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!n.isInteger(e.data1)?"data1: integer expected":null},s.fromObject=function(e){if(e instanceof r.NumberNumberPacketDataMessage)return e;var t=new r.NumberNumberPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=e.data1>>>0),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberNumberPacketDataMessage"},s}(),r.NumberObjectPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=0,s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(18).string(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.NumberObjectPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.uint32();break;case 2:i.data1=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!n.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof r.NumberObjectPacketDataMessage)return e;var t=new r.NumberObjectPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberObjectPacketDataMessage"},s}(),r.NumberStringPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=0,s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(18).string(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.NumberStringPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.uint32();break;case 2:i.data1=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!n.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof r.NumberStringPacketDataMessage)return e;var t=new r.NumberStringPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberStringPacketDataMessage"},s}(),r.ObjectBufferPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1=n.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(18).bytes(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.ObjectBufferPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.string();break;case 2:i.data1=t.bytes();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||n.isString(e.data1))?"data1: buffer expected":null},s.fromObject=function(e){if(e instanceof r.ObjectBufferPacketDataMessage)return e;var t=new r.ObjectBufferPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&("string"==typeof e.data1?n.base64.decode(e.data1,t.data1=n.newBuffer(n.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},s.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.data="",t.bytes===String?r.data1="":(r.data1=[],t.bytes!==Array&&(r.data1=n.newBuffer(r.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(r.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(r.data1=t.bytes===String?n.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ObjectBufferPacketDataMessage"},s}(),r.ObjectObjectPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(18).string(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.ObjectObjectPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.string();break;case 2:i.data1=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!n.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof r.ObjectObjectPacketDataMessage)return e;var t=new r.ObjectObjectPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ObjectObjectPacketDataMessage"},s}(),r.PacketMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.type=0,s.prototype.id=0,s.prototype.nsp="",s.prototype.data=n.newBuffer([]),s.prototype.options=n.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&n.uint32(8).uint32(e.type),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&n.uint32(16).uint32(e.id),null!=e.nsp&&Object.hasOwnProperty.call(e,"nsp")&&n.uint32(26).string(e.nsp),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(34).bytes(e.data),null!=e.options&&Object.hasOwnProperty.call(e,"options")&&n.uint32(42).bytes(e.options),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.PacketMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.type=t.uint32();break;case 2:i.id=t.uint32();break;case 3:i.nsp=t.string();break;case 4:i.data=t.bytes();break;case 5:i.options=t.bytes();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!n.isInteger(e.type)?"type: integer expected":null!=e.id&&e.hasOwnProperty("id")&&!n.isInteger(e.id)?"id: integer expected":null!=e.nsp&&e.hasOwnProperty("nsp")&&!n.isString(e.nsp)?"nsp: string expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||n.isString(e.data))?"data: buffer expected":null!=e.options&&e.hasOwnProperty("options")&&!(e.options&&"number"==typeof e.options.length||n.isString(e.options))?"options: buffer expected":null},s.fromObject=function(e){if(e instanceof r.PacketMessage)return e;var t=new r.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?n.base64.decode(e.data,t.data=n.newBuffer(n.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),null!=e.options&&("string"==typeof e.options?n.base64.decode(e.options,t.options=n.newBuffer(n.base64.length(e.options)),0):e.options.length>=0&&(t.options=e.options)),t},s.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.type=0,r.id=0,r.nsp="",t.bytes===String?r.data="":(r.data=[],t.bytes!==Array&&(r.data=n.newBuffer(r.data))),t.bytes===String?r.options="":(r.options=[],t.bytes!==Array&&(r.options=n.newBuffer(r.options)))),null!=e.type&&e.hasOwnProperty("type")&&(r.type=e.type),null!=e.id&&e.hasOwnProperty("id")&&(r.id=e.id),null!=e.nsp&&e.hasOwnProperty("nsp")&&(r.nsp=e.nsp),null!=e.data&&e.hasOwnProperty("data")&&(r.data=t.bytes===String?n.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")&&(r.options=t.bytes===String?n.base64.encode(e.options,0,e.options.length):t.bytes===Array?Array.prototype.slice.call(e.options):e.options),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/PacketMessage"},s}(),r.PacketOptionsMessage=function(){function s(e){if(this.rooms=[],this.except=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.flags="",s.prototype.rooms=n.emptyArray,s.prototype.except=n.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.flags&&Object.hasOwnProperty.call(e,"flags")&&n.uint32(10).string(e.flags),null!=e.rooms&&e.rooms.length)for(var r=0;r<e.rooms.length;++r)n.uint32(18).string(e.rooms[r]);if(null!=e.except&&e.except.length)for(r=0;r<e.except.length;++r)n.uint32(26).string(e.except[r]);return n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.PacketOptionsMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.flags=t.string();break;case 2:i.rooms&&i.rooms.length||(i.rooms=[]),i.rooms.push(t.string());break;case 3:i.except&&i.except.length||(i.except=[]),i.except.push(t.string());break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.flags&&e.hasOwnProperty("flags")&&!n.isString(e.flags))return"flags: string expected";if(null!=e.rooms&&e.hasOwnProperty("rooms")){if(!Array.isArray(e.rooms))return"rooms: array expected";for(var t=0;t<e.rooms.length;++t)if(!n.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(t=0;t<e.except.length;++t)if(!n.isString(e.except[t]))return"except: string[] expected"}return null},s.fromObject=function(e){if(e instanceof r.PacketOptionsMessage)return e;var t=new r.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(var 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");for(t.except=[],n=0;n<e.except.length;++n)t.except[n]=String(e.except[n])}return t},s.toObject=function(e,t){t||(t={});var 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(var r=0;r<e.rooms.length;++r)n.rooms[r]=e.rooms[r]}if(e.except&&e.except.length)for(n.except=[],r=0;r<e.except.length;++r)n.except[r]=e.except[r];return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/PacketOptionsMessage"},s}(),r.StringBytesPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1=n.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(18).bytes(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.StringBytesPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.string();break;case 2:i.data1=t.bytes();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||n.isString(e.data1))?"data1: buffer expected":null},s.fromObject=function(e){if(e instanceof r.StringBytesPacketDataMessage)return e;var t=new r.StringBytesPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&("string"==typeof e.data1?n.base64.decode(e.data1,t.data1=n.newBuffer(n.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},s.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.data="",t.bytes===String?r.data1="":(r.data1=[],t.bytes!==Array&&(r.data1=n.newBuffer(r.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(r.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(r.data1=t.bytes===String?n.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringBytesPacketDataMessage"},s}(),r.StringNumberPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1=0,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(16).uint32(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.StringNumberPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.string();break;case 2:i.data1=t.uint32();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!n.isInteger(e.data1)?"data1: integer expected":null},s.fromObject=function(e){if(e instanceof r.StringNumberPacketDataMessage)return e;var t=new r.StringNumberPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=e.data1>>>0),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringNumberPacketDataMessage"},s}(),r.StringObjectPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(18).string(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.StringObjectPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.string();break;case 2:i.data1=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!n.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof r.StringObjectPacketDataMessage)return e;var t=new r.StringObjectPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringObjectPacketDataMessage"},s}(),r.StringStringPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&n.uint32(18).string(e.data1),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n,s){t instanceof e||(t=e.create(t));for(var o=void 0===n?t.len:t.pos+n,i=new r.StringStringPacketDataMessage;t.pos<o;){var a=t.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=t.string();break;case 2:i.data1=t.string();break;default:t.skipType(7&a)}}return i},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!n.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!n.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof r.StringStringPacketDataMessage)return e;var t=new r.StringStringPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringStringPacketDataMessage"},s}(),r})();class l{static decode(e,t){const n=p(t).decode("undefined"==typeof window?e:new Uint8Array(e));return t.fromJSON({...n})}static encode(e){const t=p(e.constructor),n=e.toJSON(),r=t.verify(n);if(r)throw Error(r);return t.encode(t.create(n)).finish()}}function p(e){return u[e.DESCRIPTOR_NAME]}class h extends i{ids;static TYPE="22";static READABLE_TYPE_NAME="getManyUsers";static DESCRIPTOR_NAME="GetManyUsersMessage";static DESCRIPTOR={fields:{ids:{id:1,type:"string",rule:"repeated"}}};constructor(e){super(),this.ids=e}toJSON(){return{ids:this.ids}}static fromJSON(e){return new h(e.ids)}}class f extends i{users;static DESCRIPTOR_NAME="GetManyUsersResponse";static DESCRIPTOR={fields:{users:{rule:"repeated",type:"UserDescriptor",id:1}}};constructor(e){super(),this.users=e}toJSON(){return{users:this.users.map(m)}}static fromJSON(e){return new f(e.users.map(y))}}function m(e){return{attributes:Object.keys(e).map(t=>({key:t,value:JSON.stringify(e[t])}))}}function y(e){return e.attributes.reduce((e,t)=>(e[t.key]=t.value?JSON.parse(t.value):null,e),{})}class g{static _SERVICE=2;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 g(e)}static async get(e,t){const n=new a(t);try{const t=await e._sendRequest(g._SERVICE,a.TYPE,l.encode(n)),r=l.decode(t,c);return new g(r.attributes)}catch(e){return new g({id:t})}}static async getMany(e,t){const n=new h(t);try{const t=await e._sendRequest(g._SERVICE,h.TYPE,l.encode(n));return l.decode(t,f).users.map(e=>new g(e))}catch(e){return t.map(e=>new g({id:e}))}}}const b=g,O=Object.create(null);O.open="0",O.close="1",O.ping="2",O.pong="3",O.message="4",O.upgrade="5",O.noop="6";const w=Object.create(null);Object.keys(O).forEach(e=>{w[O[e]]=e});const I={type:"error",data:"parser error"},v="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),S="function"==typeof ArrayBuffer,k=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,P=({type:e,data:t},n,r)=>v&&t instanceof Blob?n?r(t):A(t,r):S&&(t instanceof ArrayBuffer||k(t))?n?r(t):A(new Blob([t]),r):r(O[e]+(t||"")),A=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)};function T(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let _;const C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)j[C.charCodeAt(e)]=e;const E="function"==typeof ArrayBuffer,D=(e,t)=>{if("string"!=typeof e)return{type:"message",data:x(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:R(e.substring(1),t)};return w[n]?e.length>1?{type:w[n],data:e.substring(1)}:{type:w[n]}:I},R=(e,t)=>{if(E){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=j[e.charCodeAt(t)],r=j[e.charCodeAt(t+1)],s=j[e.charCodeAt(t+2)],o=j[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 x(n,t)}return{base64:!0,data:e}},x=(e,t)=>"blob"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,N=String.fromCharCode(30);function V(){return new TransformStream({transform(e,t){!function(e,t){v&&e.data instanceof Blob?e.data.arrayBuffer().then(T).then(t):S&&(e.data instanceof ArrayBuffer||k(e.data))?t(T(e.data)):P(e,!1,e=>{_||(_=new TextEncoder),t(_.encode(e))})}(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const e=new DataView(s.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{s=new Uint8Array(9);const e=new DataView(s.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&"string"!=typeof e.data&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let M;function B(e){return e.reduce((e,t)=>e+t.length,0)}function U(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function J(e){if(e)return function(e){for(var t in J.prototype)e[t]=J.prototype[t];return e}(e)}J.prototype.on=J.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},J.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},J.prototype.off=J.prototype.removeListener=J.prototype.removeAllListeners=J.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},J.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},J.prototype.emitReserved=J.prototype.emit,J.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},J.prototype.hasListeners=function(e){return!!this.listeners(e).length};const q="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function G(e,...t){return t.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{})}const L=q.setTimeout,Y=q.clearTimeout;function H(e,t){t.useNativeTimers?(e.setTimeoutFn=L.bind(q),e.clearTimeoutFn=Y.bind(q)):(e.setTimeoutFn=q.setTimeout.bind(q),e.clearTimeoutFn=q.clearTimeout.bind(q))}function z(e){return"string"==typeof e?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}(e):Math.ceil(1.33*(e.byteLength||e.size))}class F extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class K extends J{constructor(e){super(),this.writable=!1,H(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new F(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=D(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return-1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){const t=function(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}(e);return t.length?"?"+t:""}}const W="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Q={};let Z,X=0,$=0;function ee(e){let t="";do{t=W[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function te(){const e=ee(+new Date);return e!==Z?(X=0,Z=e):e+"."+ee(X++)}for(;$<64;$++)Q[W[$]]=$;let ne=!1;try{ne="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}const re=ne;function se(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||re))return new XMLHttpRequest}catch(e){}if(!t)try{return new(q[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}function oe(){}const ie=null!=new se({xdomain:!1}).responseType;class ae extends J{constructor(e,t){super(),H(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.data=void 0!==t.data?t.data:null,this.create()}create(){var e;const t=G(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd;const n=this.xhr=new se(t);try{n.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&n.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(e){}if("POST"===this.method)try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{n.setRequestHeader("Accept","*/*")}catch(e){}null===(e=this.opts.cookieJar)||void 0===e||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{var e;3===n.readyState&&(null===(e=this.opts.cookieJar)||void 0===e||e.parseCookies(n)),4===n.readyState&&(200===n.status||1223===n.status?this.onLoad():this.setTimeoutFn(()=>{this.onError("number"==typeof n.status?n.status:0)},0))},n.send(this.data)}catch(e){return void this.setTimeoutFn(()=>{this.onError(e)},0)}"undefined"!=typeof document&&(this.index=ae.requestsCount++,ae.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=oe,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete ae.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(ae.requestsCount=0,ae.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",ce);else if("function"==typeof addEventListener){addEventListener("onpagehide"in q?"pagehide":"unload",ce,!1)}function ce(){for(let e in ae.requests)ae.requests.hasOwnProperty(e)&&ae.requests[e].abort()}const de="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),ue=q.WebSocket||q.MozWebSocket,le="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const pe={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=le?{}:G(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=le?new ue(e,t,n):t?new ue(e,t):new ue(e)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,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;P(n,this.supportsBinary,e=>{try{this.ws.send(e)}catch(e){}r&&de(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=te()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}check(){return!!ue}},webtransport:class extends K{get name(){return"webtransport"}doOpen(){"function"==typeof WebTransport&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(e=>{const t=function(e,t){M||(M=new TextDecoder);const n=[];let r=0,s=-1,o=!1;return new TransformStream({transform(i,a){for(n.push(i);;){if(0===r){if(B(n)<1)break;const e=U(n,1);o=!(128&~e[0]),s=127&e[0],r=s<126?3:126===s?1:2}else if(1===r){if(B(n)<2)break;const e=U(n,2);s=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(2===r){if(B(n)<8)break;const e=U(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),o=t.getUint32(0);if(o>Math.pow(2,21)-1){a.enqueue(I);break}s=o*Math.pow(2,32)+t.getUint32(4),r=3}else{if(B(n)<s)break;const e=U(n,s);a.enqueue(D(o?e:M.decode(e),t)),r=0}if(0===s||s>e){a.enqueue(I);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=V();r.readable.pipeTo(e.writable),this.writer=r.writable.getWriter();const s=()=>{n.read().then(({done:e,value:t})=>{e||(this.onPacket(t),s())}).catch(e=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;this.writer.write(n).then(()=>{r&&de(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;null===(e=this.transport)||void 0===e||e.close()}},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}const t=e&&e.forceBase64;this.supportsBinary=ie&&!t,this.opts.withCredentials&&(this.cookieJar=void 0)}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(N),r=[];for(let e=0;e<n.length;e++){const s=D(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)=>{P(e,!1,e=>{r[o]=e,++s===n&&t(r.join(N))})})})(e,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=te()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new ae(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}}},he=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,fe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function me(e){if(e.length>2e3)throw"URI too long";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=he.exec(e||""),o={},i=14;for(;i--;)o[fe[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 ye extends J{constructor(e,t={}){super(),this.binaryType="arraybuffer",this.writeBuffer=[],e&&"object"==typeof e&&(t=e,e=null),e?(e=me(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=me(t.host).host),H(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","webtransport"],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:!1},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,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new pe[e](n)}open(){let e;if(this.opts.rememberUpgrade&&ye.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;ye.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;ye.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),-1!==this.upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onOpen(){if(this.readyState="open",ye.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"),this.resetPingTimeout(),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":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 t=0;t<this.writeBuffer.length;t++){const n=this.writeBuffer[t].data;if(n&&(e+=z(n)),t>0&&e>this.maxPayload)return this.writeBuffer.slice(0,t);e+=2}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){ye.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}}ye.protocol=4;ye.protocol;const ge="function"==typeof ArrayBuffer,be=Object.prototype.toString,Oe="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===be.call(Blob),we="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===be.call(File);function Ie(e){return ge&&(e instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||Oe&&e instanceof Blob||we&&e instanceof File}function ve(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(ve(e[t]))return!0;return!1}if(Ie(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return ve(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&ve(e[t]))return!0;return!1}function Se(e){const t=[],n=e.data,r=e;return r.data=ke(n,t),r.attachments=t.length,{packet:r,buffers:t}}function ke(e,t){if(!e)return e;if(Ie(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]=ke(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]=ke(e[r],t));return n}return e}function Pe(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 Te=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],_e=5;var Ce;!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"}(Ce||(Ce={}));class je{constructor(e){this.replacer=e}encode(e){return e.type!==Ce.EVENT&&e.type!==Ce.ACK||!ve(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===Ce.EVENT?Ce.BINARY_EVENT:Ce.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==Ce.BINARY_EVENT&&e.type!==Ce.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 Ee(e){return"[object Object]"===Object.prototype.toString.call(e)}class De extends J{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===Ce.BINARY_EVENT;n||t.type===Ce.BINARY_ACK?(t.type=n?Ce.EVENT:Ce.ACK,this.reconstructor=new Re(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!Ie(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===Ce[n.type])throw new Error("unknown packet type "+n.type);if(n.type===Ce.BINARY_EVENT||n.type===Ce.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(!De.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 Ce.CONNECT:return Ee(t);case Ce.DISCONNECT:return void 0===t;case Ce.CONNECT_ERROR:return"string"==typeof t||Ee(t);case Ce.EVENT:case Ce.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===Te.indexOf(t[0]));case Ce.ACK:case Ce.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Re{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=Pe(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function xe(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Ne=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ve extends J{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=[xe(e,"open",this.onopen.bind(this)),xe(e,"packet",this.onpacket.bind(this)),xe(e,"error",this.onerror.bind(this)),xe(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(Ne.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:Ce.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:Ce.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 Ce.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 Ce.EVENT:case Ce.BINARY_EVENT:this.onevent(e);break;case Ce.ACK:case Ce.BINARY_ACK:this.onack(e);break;case Ce.DISCONNECT:this.ondisconnect();break;case Ce.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:Ce.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:Ce.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 Me(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}Me.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)},Me.prototype.reset=function(){this.attempts=0},Me.prototype.setMin=function(e){this.ms=e},Me.prototype.setMax=function(e){this.max=e},Me.prototype.setJitter=function(e){this.jitter=e};class Be extends J{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,H(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 Me({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 ye(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=xe(t,"open",function(){n.onopen(),e&&e()}),s=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},o=xe(t,"error",s);if(!1!==this._timeout){const e=this._timeout,n=this.setTimeoutFn(()=>{r(),s(new Error("timeout")),t.close()},e);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(xe(e,"ping",this.onping.bind(this)),xe(e,"data",this.ondata.bind(this)),xe(e,"error",this.onerror.bind(this)),xe(e,"close",this.onclose.bind(this)),xe(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){de(()=>{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 Ve(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(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Ue={};function Je(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=me(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=Ue[s]&&o in Ue[s].nsps;let a;return t.forceNew||t["force new connection"]||!1===t.multiplex||i?a=new Be(r,t):(Ue[s]||(Ue[s]=new Be(r,t)),a=Ue[s]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}Object.assign(Je,{Manager:Be,Socket:Ve,io:Je,connect:Je});var qe=__webpack_require__(835);class Ge extends i{type;socketId;data;static DESCRIPTOR_NAME="ChannelMessage";static DESCRIPTOR={fields:{type:{type:"uint32",id:1},socketId:{type:"string",id:2},data:{type:"bytes",id:3}}};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 Ge(e.type,e.socketId,e.data)}}const Le=class extends((0,n.EmitterMixin)()){_channelName;_wsGateway;_socket;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=l.decode(e,Ge);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)})}};class Ye extends Error{context;code;data;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 He extends Error{code;traceId;data;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)}}class ze extends i{flags;rooms;except;static TYPE=11;static DESCRIPTOR_NAME="PacketOptionsMessage";static DESCRIPTOR={fields:{flags:{type:"string",id:1},rooms:{type:"string",id:2,rule:"repeated"},except:{type:"string",id:3,rule:"repeated"}}};constructor(e,t=[],n=[]){super(),this.flags=e,this.rooms=t,this.except=n}toJSON(){return{flags:this.flags?JSON.stringify(this.flags):void 0,rooms:this.rooms?.length?this.rooms:void 0,except:this.except?.length?this.except:void 0}}static fromJSON(e){return new ze(e.flags&&JSON.parse(e.flags),e.rooms,e.except)}}const Fe=(()=>!("undefined"==typeof process||!process.versions?.node))(),Ke=1,We=2,Qe=3,Ze=4;class Xe{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(Xe.isBuffer(e))return Ke;const t=typeof e;return"string"===t?We:"number"===t?Qe:Ze}static isBuffer(e){return Fe&&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 $e extends i{data;data1;static create(e,t){throw new TypeError("Must be implemented in a child class!")}}class et extends $e{data;data1;static TYPE=(()=>Xe.getPacketType(Qe,Ke))();static DESCRIPTOR_NAME="NumberBytesPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"bytes",id:2}}};constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new et(e.data,e.data1)}static create(e,t){return new et(e,t)}}class tt extends $e{data;data1;static TYPE=(()=>Xe.getPacketType(We,Ke))();static DESCRIPTOR_NAME="StringBytesPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new tt(e.data,e.data1)}static create(e,t){return new tt(e,t)}}class nt extends $e{data;data1;static TYPE=(()=>Xe.getPacketType(Ke,Ke))();static DESCRIPTOR_NAME="BytesBytesPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"bytes",id:1},data1:{type:"bytes",id:2}}};constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new nt(e.data,e.data1)}static create(e,t){return new nt(e,t)}}class rt extends $e{data;data1;static TYPE=(()=>Xe.getPacketType(We,Ze))();static DESCRIPTOR_NAME="StringObjectPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};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 rt(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new rt(e,t)}}class st extends $e{data;data1;static TYPE=(()=>Xe.getPacketType(Qe,Ze))();static DESCRIPTOR_NAME="NumberObjectPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};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 st(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new st(e,t)}}class ot extends $e{data;data1;static TYPE=(()=>Xe.getPacketType(Ze,Ze))();static DESCRIPTOR_NAME="ObjectObjectPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};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 ot(e.data&&JSON.parse(e.data),e.data1&&JSON.parse(e.data1))}static create(e,t){return new ot(e,t)}}class it extends $e{data;data1;static TYPE=(()=>Xe.getPacketType(Ze,Ke))();static DESCRIPTOR_NAME="ObjectBufferPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};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)}}class at extends $e{data;data1;static TYPE=(()=>Xe.getPacketType(We,We))();static DESCRIPTOR_NAME="StringStringPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};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)}}class ct extends $e{data;data1;static TYPE=(()=>Xe.getPacketType(We,Qe))();static DESCRIPTOR_NAME="StringNumberPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"uint32",id:2}}};constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new ct(e.data,e.data1)}static create(e,t){return new ct(e,t)}}class dt extends $e{data;data1;static TYPE=(()=>Xe.getPacketType(Qe,Qe))();static DESCRIPTOR_NAME="NumberNumberPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"uint32",id:2}}};constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new dt(e.data,e.data1)}static create(e,t){return new dt(e,t)}}class ut extends $e{data;data1;static TYPE=(()=>Xe.getPacketType(Qe,We))();static DESCRIPTOR_NAME="NumberStringPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new ut(e.data,e.data1)}static create(e,t){return new ut(e,t)}}const lt=(()=>[et,tt,nt,rt,st,ot,it,at,ct,dt,ut].reduce((e,t)=>(e[t.TYPE]=t,e),{}))();class pt extends i{type;data;id;nsp;options;static TYPE=10;static DESCRIPTOR_NAME="PacketMessage";static 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}}};constructor(e,t,n,r="/",s){super(),this.type=e,this.data=t,this.id=n,this.nsp=r,this.options=s??new ze}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=l.encode(this.options),t=l.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 pt(e.type-10*t,l.decode(e.data,lt[t]),e.id,e.nsp,e.options?l.decode(e.options,ze):new ze)}static create(e,t={}){const n=Xe.getPacketType(Xe.getType(e.data[0]),Xe.getType(e.data[1]??e.data[0]));return new pt(e.type,lt[n].create(e.data[0],e.data[1]),e.id,e.nsp,new ze(t.flags,t.rooms,t.except))}}class ht{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 l.encode(pt.create(o,s))}decode(e){const t=l.decode(e,pt);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 ft=(()=>[Ce.EVENT,Ce.ACK,Ce.BINARY_ACK,Ce.BINARY_EVENT])();class mt extends je{_packetParser;constructor(e){super(),this._packetParser=e??new ht}encode(e){if(ft.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 yt extends De{_packetParser;constructor(e){super(),this._packetParser=e??new ht}add(e){if(!Xe.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 gt{_context;_deferredPromise=function(){let e,t;const n=new Promise((n,r)=>{e=n,t=r});return{resolve:e,reject:t,promise:n}}();timeout;constructor(e,t){this._context=e,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 bt{_context;_requests=new Set;constructor(e){this._context=e}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 gt(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++))}}const Ot={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"};class wt extends((0,n.ObservableMixin)()){_requestsManager;_url;_socket;_socketAuth;_channels;_connectionAttempt=0;_token;_options;_connectionProvider;_userFactory;static STATE_DISCONNECTED=(()=>Ot.DISCONNECTED)();static STATE_CONNECTING=(()=>Ot.CONNECTING)();static STATE_CONNECTED=(()=>Ot.CONNECTED)();static _CHANGE_STATE_EVENT_PRIORITY=(()=>n.priorities.get("highest")+999999)();constructor(e,t,n,r,s){if(super(),this._token=t,this._options=n??{},this._connectionProvider=r??Je,this._userFactory=s??b.get,this._requestsManager=new bt(this),this._channels=new Map,!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=qe(e.replace(/^(?!(?:\w+:)?\/\/)/,"https://")),this.set("state",Ot.DISCONNECTED),this.set("socketId",void 0),this.set("me",void 0),this.on("change:state",async(e,t,n)=>{if(this._debugEvent("ws-gw:change:state",n),n!==wt.STATE_CONNECTED){if(n===wt.STATE_DISCONNECTED)return this._requestsManager.errorAll(new Ye("Not connected.",this))}else try{this.me=await this._userFactory.call(b,this,this._socketAuth?.userId)}catch(e){}},{priority:wt._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(){this.state!==Ot.DISCONNECTED&&(this._socket?.disconnect(),this._socket=void 0,this.state=Ot.DISCONNECTED)}async reconnect(){this._socket||this.state!==Ot.DISCONNECTED||(await this._token.refreshToken(),await this._connect())}static async connect(e,t="local.cs.dev:443/ws-v2",n={},r=Je,s=b.get){const o=new wt(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!==wt.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 Le(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(){if(this._socket)return this._socket;const e=this._url.port||this._getPortByProtocol(this._url.protocol),t=(this._url.protocol||"https:")+"//"+this._url.hostname+":"+e,n=this._url.pathname.match(/^\/.*\/ws/)?this._url.pathname.split("/ws")[0]:"",r=this._connectionProvider(t,{parser:{Encoder:mt,Decoder:yt},path:n+"/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:"53.0.0"},agent:this._options.agent??!1,closeOnBeforeunload:!1});return this.state=Ot.CONNECTING,r.on("connect",()=>{this._debugEvent("connect"),this.socketId=r.id}),r.on("connect_error",e=>{this._debugEvent("connect_error",e)}),r.on("disconnect",()=>{this._debugEvent("disconnect"),this._onDisconnect()}),r.io.on("reconnect",async()=>{this._debugEvent("reconnect"),await this._onReconnect()}),r.io.on("reconnect_attempt",e=>{this._debugEvent("reconnect_attempt",e),this.state=Ot.CONNECTING,this._connectionAttempt=e}),r.on("unauthorized",e=>{this._debugEvent("unauthorized"),this._onUnauthorized(e)}),r.on("authenticationRequest",async e=>{this._debugEvent("authenticationRequest",e.attempt),await this._onReconnect()}),this._socket=r,r}_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=Ot.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=Ot.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",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(){return!!n.global.window.localStorage&&"true"===(n.global.window.localStorage.getItem("csClientDebugMode")??"false").toLowerCase()}}const It=wt;class vt extends i{bundleVersion;static TYPE="131";static READABLE_TYPE_NAME="isEditorBundleUploaded";static DESCRIPTOR_NAME="IsEditorBundleUploadedMessage";static DESCRIPTOR={fields:{bundleVersion:{type:"string",id:1}}};constructor(e){super(),this.bundleVersion=e}toJSON(){return{bundleVersion:this.bundleVersion}}static fromJSON(e){return new vt(e.bundleVersion)}}class St extends i{isUploaded;static DESCRIPTOR_NAME="IsEditorBundleUploadedResponse";static DESCRIPTOR={fields:{isUploaded:{type:"bool",id:1}}};constructor(e){super(),this.isUploaded=e}toJSON(){return{isUploaded:this.isUploaded}}static fromJSON(e){return new St(e.isUploaded)}}class kt extends((0,n.EmitterMixin)()){static _SERVICE=13;static async isBundleUploaded(e,t){const n=new vt(t);if(e.state!==Ot.CONNECTED)throw new Ye("WebSocket Gateway is not connected.",e);const r=await e._sendRequest(kt._SERVICE,vt.TYPE,l.encode(n));return l.decode(r,St).isUploaded}}const Pt=kt;class At extends i{documentId;revisionId;static TYPE="123";static READABLE_TYPE_NAME="getRevision";static DESCRIPTOR_NAME="RevisionHistoryGetRevisionMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1},revisionId:{type:"string",id:2}}};constructor(e,t){super(),this.documentId=e,this.revisionId=t}toJSON(){return{documentId:this.documentId,revisionId:this.revisionId}}static fromJSON(e){return new At(e.documentId,e.revisionId)}}class Tt extends o{static DESCRIPTOR_NAME="RevisionDescriptor";static 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}}};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){return{revisionId:e.revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.stringify(e.authorsIds):void 0,diffData:e.diffData,createdAt:e.createdAt?.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})}}class _t extends i{revisionId;name;creatorId;authorsIds;createdAt;diffData;attributes;fromVersion;toVersion;isEmptyCurrent;static DESCRIPTOR_NAME="RevisionHistoryGetRevisionResponse";static DESCRIPTOR=(()=>Tt.DESCRIPTOR)();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 Tt.toJSON(this)}toObject(){return Tt.toObject(this)}static create(e){return new _t(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 _t(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)}}class Ct extends i{documentId;requestId;revisions;static TYPE="124";static READABLE_TYPE_NAME="updateRevisions";static DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};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(Tt.toJSON)}}toObject(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(Tt.toObject)}}static create(e){return new Ct(e.documentId,e.requestId,e.revisions.map(Tt.create))}static fromJSON(e){return new Ct(e.documentId,e.requestId,e.revisions.map(Tt.fromJSON))}}class jt extends i{requestId;static DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsResponse";static DESCRIPTOR={fields:{requestId:{type:"uint32",id:1}}};constructor(e){super(),this.requestId=e}toJSON(){return{requestId:this.requestId}}static fromJSON(e){return new jt(e.requestId)}}class Et extends i{documentId;static TYPE="121";static READABLE_TYPE_NAME="connectToRevisionHistory";static DESCRIPTOR_NAME="RevisionHistoryConnectMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Et(e.documentId)}}class Dt extends i{channel;requestId;revisions;static DESCRIPTOR_NAME="RevisionHistoryConnectResponse";static DESCRIPTOR={fields:{channel:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};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(Tt.toJSON)}}toObject(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(Tt.toObject)}}static fromJSON(e){return new Dt(e.channel,e.requestId,e.revisions.map(Tt.fromJSON))}}class Rt extends i{documentId;requestId;static TYPE="122";static READABLE_TYPE_NAME="reconnectToRevisionHistory";static DESCRIPTOR_NAME="RevisionHistoryReconnectMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2}}};constructor(e,t){super(),this.documentId=e,this.requestId=t}toJSON(){return{documentId:this.documentId,requestId:this.requestId}}static fromJSON(e){return new Rt(e.documentId,e.requestId)}}class xt extends Ye{constructor(e,t){super(e+" Service is not connected.",t)}}class Nt extends((0,n.EmitterMixin)()){_documentId;_isConnected=!1;_wsGateway;_channel;static _SERVICE=12;constructor(e){super(),this._documentId=e}get isConnected(){return this._isConnected}connect(e){return this._isConnected?Promise.resolve():this._connect(e,new Et(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 Rt(this._documentId,t))}async updateRevisions(e,t){const n=Ct.create({documentId:this._documentId,requestId:t,revisions:e}),r=await this._sendRequest(Ct.TYPE,n),{requestId:s}=l.decode(r,jt);return s}async getRevision(e){const t=new At(this._documentId,e),n=await this._sendRequest(At.TYPE,t);return l.decode(n,_t).toObject()}async _connect(e,t){if(e.state!==Ot.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,l.encode(t)),{channel:r,requestId:s,revisions:o}=l.decode(n,Dt).toObject();return this.listenTo(e,"change:state",(e,t,n)=>this._onWsGatewayStateChange(n),{priority:It._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(Nt._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(Ct.TYPE),(e,t)=>{const{documentId:n,requestId:r,revisions:s}=l.decode(t,Ct).toObject();this.fire("revisionsUpdated",{documentId:n,requestId:r,revisionsData:s})})}_onWsGatewayStateChange(e){e===Ot.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new xt("Revision History",this);return this._wsGateway._sendRequest(12,e,l.encode(t))}}const Vt=Nt;class Mt extends i{id;documentId;type;data;originalSuggestionId;attributes;static TYPE="101";static READABLE_TYPE_NAME="addSuggestion";static DESCRIPTOR_NAME="TrackChangesAddSuggestionMessage";static 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}}};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){return new Mt(e.id,e.documentId,e.type,JSON.parse(e.data),e.originalSuggestionId??null,e.attributes?JSON.parse(e.attributes):null)}}class Bt extends i{id;authorId;type;hasComments;state;data;attributes;createdAt;static DESCRIPTOR_NAME="TrackChangesAddSuggestionResponse";static 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}}};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(){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 Bt(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}class Ut extends i{id;documentId;static TYPE="103";static READABLE_TYPE_NAME="getSuggestion";static DESCRIPTOR_NAME="TrackChangesGetSuggestionMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2}}};constructor(e,t){super(),this.id=e,this.documentId=t}toJSON(){return{id:this.id,documentId:this.documentId}}static fromJSON(e){return new Ut(e.id,e.documentId)}}class Jt extends i{id;authorId;type;hasComments;state;data;attributes;createdAt;static DESCRIPTOR_NAME="TrackChangesGetSuggestionResponse";static 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}}};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 Jt(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}class qt extends i{documentId;static TYPE="102";static READABLE_TYPE_NAME="getAllSuggestions";static DESCRIPTOR_NAME="TrackChangesGetAllSuggestionMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new qt(e.documentId)}}class Gt extends o{static DESCRIPTOR_NAME="SuggestionDescriptor";static 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"}}};static toJSON(e){return{...e,data:e.data?JSON.stringify(e.data):e.data,attributes:e.attributes?JSON.stringify(e.attributes):e.attributes,createdAt:e.createdAt?.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}}}class Lt extends i{_suggestions;_suggestionsV2;suggestions;static DESCRIPTOR_NAME="TrackChangesGetAllSuggestionsResponse";static DESCRIPTOR={fields:{suggestions:{type:"string",rule:"repeated",id:1},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:2}}};constructor(e,t){super(),this._suggestions=e,this._suggestionsV2=t,this.suggestions=t?.length?t:e}toJSON(){return{suggestions:this._suggestions?.map(e=>JSON.stringify(e)),suggestionsV2:this._suggestionsV2?.map(Gt.toJSON)}}static fromJSON(e){return new Lt(e.suggestions?.map(Yt),e.suggestionsV2?.map(Gt.fromJSON))}}function Yt(e){const t=JSON.parse(e);return t.createdAt=t.createdAt?new Date(t.createdAt):void 0,t}class Ht extends i{id;documentId;hasComments;isHasCommentsModified;state;attributes;static TYPE="104";static READABLE_TYPE_NAME="updateSuggestion";static DESCRIPTOR_NAME="TrackChangesUpdateSuggestionMessage";static 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}}};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 Ht(e.id,e.documentId,e.hasComments,e.isHasCommentsModified,e.state,e.attributes?JSON.parse(e.attributes):null)}}class zt extends i{documentId;static TYPE="105";static READABLE_TYPE_NAME="connectToSuggestions";static DESCRIPTOR_NAME="TrackChangesConnectMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new zt(e.documentId)}}class Ft extends i{channel;_suggestions;_suggestionsV2;suggestions;static DESCRIPTOR_NAME="TrackChangesConnectResponse";static DESCRIPTOR={fields:{channel:{type:"string",id:1},suggestions:{type:"string",rule:"repeated",id:2},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:3}}};constructor(e,t,n){super(),this.channel=e,this._suggestions=t,this._suggestionsV2=n,this.suggestions=n?.length?n:t}toJSON(){return{channel:this.channel,suggestions:this._suggestions?.map(e=>JSON.stringify(e)),suggestionsV2:this._suggestionsV2?.map(Gt.toJSON)}}static fromJSON(e){return new Ft(e.channel,e.suggestions?.map(e=>JSON.parse(e)),e.suggestionsV2?.map(Gt.fromJSON))}}class Kt extends i{ids;documentId;state;static TYPE="106";static READABLE_TYPE_NAME="batchUpdateSuggestionsState";static DESCRIPTOR_NAME="TrackChangesBatchUpdateSuggestionsStateMessage";static DESCRIPTOR={fields:{ids:{type:"string",rule:"repeated",id:1},documentId:{type:"string",id:2},state:{type:"string",id:3}}};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 Kt(e.ids,e.documentId,e.state)}}class Wt extends((0,n.EmitterMixin)()){_documentId;_isConnected=!1;_wsGateway;_channel;static _SERVICE=10;constructor(e){super(),this._documentId=e}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==Ot.CONNECTED)throw new Ye("WebSocket Gateway is not connected.",e);const t=new zt(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(10,zt.TYPE,l.encode(t)),r=l.decode(n,Ft);return this.listenTo(e,"change:state",(e,t,n)=>this._onWsGatewayStateChange(n),{priority:It._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 Mt(e,this._documentId,t,n,r,s),i=await this._sendRequest(Mt.TYPE,o);return l.decode(i,Bt)}async get(e,t=1){const n=new Ut(e,this._documentId);try{const e=await this._sendRequest(Ut.TYPE,n);return l.decode(e,Jt)}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 qt(this._documentId),t=await this._sendRequest(qt.TYPE,e),{suggestions:n}=l.decode(t,Lt);return n}async update(e,t={}){const{hasComments:n,state:r,attributes:s}=t,o=void 0!==n,i=new Ht(e,this._documentId,n,o,r,s);await this._sendRequest(Ht.TYPE,i)}async batchUpdateState(e){const t=new Kt(e.ids,this._documentId,e.state);await this._sendRequest(Kt.TYPE,t)}_connectToChannel(e,t){this._channel=e._getChannel(Wt._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(Ht.TYPE),(e,t)=>{const n=l.decode(t,Ht);this.fire("suggestionUpdated",n)})}_onWsGatewayStateChange(e){e===Ot.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new xt("Track Changes",this);return this._wsGateway._sendRequest(10,e,l.encode(t))}}const Qt=Wt,Zt={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Xt;const $t=new Uint8Array(16);function en(){if(!Xt&&(Xt="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Xt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Xt($t)}const tn=[];for(let e=0;e<256;++e)tn.push((e+256).toString(16).slice(1));function nn(e,t=0){return tn[e[t+0]]+tn[e[t+1]]+tn[e[t+2]]+tn[e[t+3]]+"-"+tn[e[t+4]]+tn[e[t+5]]+"-"+tn[e[t+6]]+tn[e[t+7]]+"-"+tn[e[t+8]]+tn[e[t+9]]+"-"+tn[e[t+10]]+tn[e[t+11]]+tn[e[t+12]]+tn[e[t+13]]+tn[e[t+14]]+tn[e[t+15]]}const rn=function(e,t,n){if(Zt.randomUUID&&!t&&!e)return Zt.randomUUID();const r=(e=e||{}).random||(e.rng||en)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return nn(r)};class sn extends i{channel;sockets;static DESCRIPTOR_NAME="SessionsConnectResponse";static DESCRIPTOR={fields:{channel:{type:"string",id:1},sockets:{rule:"repeated",type:"SessionsSocketDescriptor",id:2}}};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 sn(e.channel,e.sockets.map(e=>({id:e.session,userId:e.user,role:e.role,permissions:e.permissions})))}}class on extends i{id;sessionType;static TYPE="31";static READABLE_TYPE_NAME="getConnectedSockets";static DESCRIPTOR_NAME="SessionsConnectMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1},sessionType:{type:"uint32",id:2}}};constructor(e,t){super(),this.id=e,this.sessionType=t}toJSON(){return{id:this.id,sessionType:this.sessionType}}static fromJSON(e){return new on(e.id,e.sessionType)}}class an extends i{id;userId;role;permissions;static TYPE="32";static READABLE_TYPE_NAME="connectSocket";static DESCRIPTOR_NAME="SocketConnectMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1},userId:{type:"string",id:2},role:{type:"string",id:3},permissions:{rule:"repeated",type:"string",id:4}}};constructor(e,t,n,r){super(),this.id=e,this.userId=t,this.role=n,this.permissions=r}toJSON(){return{id:this.id,userId:this.userId??void 0,role:this.role??void 0,permissions:this.permissions??void 0}}static fromJSON(e){return new an(e.id,e.userId,e.role,e.permissions)}}class cn extends i{id;static TYPE="33";static READABLE_TYPE_NAME="disconnectSocket";static DESCRIPTOR_NAME="SocketDisconnectMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1}}};constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new cn(e.id)}}const dn=class extends n.Collection{_id;_sessionType;_handlers=new Map;_channel;_wsGateway;_connected;_eventsQueue=[];_isRunning=!1;constructor(e,t){super({idProperty:"id"}),this._id=e,this._sessionType=t}async connect(e){this._wsGateway=e,this.stopListening(e,"change:state");const t=new on(this._id,this._sessionType);let n;try{const e=await this._wsGateway._sendRequest(3,on.TYPE,l.encode(t));n=l.decode(e,sn)}catch(e){n=new sn(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 b.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 b,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:It._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,an.TYPE,async t=>{const n=l.decode(t,an);if(-1===this.getIndex(n.id)){const t={id:n.id,role:n.role,permissions:n.permissions};n.userId&&(t.user=await b.get(e,n.userId)),super.add(t)}}),this._addHandler(this._channel,cn.TYPE,e=>{const t=l.decode(e,cn);-1!==this.getIndex(t.id)&&super.remove(t.id)}))}async _onWsGatewayStateChange(e){e===It.STATE_DISCONNECTED&&this.disconnect(!1),e===It.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)}};class un{static async getConnectedSessions(e,t,n){const r=new dn(t,n);return await r.connect(e),r}}class ln extends i{id;buffers;types;bundleVersion;lastOperationId;static TYPE="11";static READABLE_TYPE_NAME="connectToDocument";static DESCRIPTOR_NAME="CollaborativeEditingConnectMessage";static 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}}};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 ln(e.id,e.buffers,e.types,e.bundleVersion,e.lastOperationId)}}class pn{static prepareMetadataForOperations(e,t){if(!e?.length||!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?.length||!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 hn extends o{static DESCRIPTOR_NAME="OperationMetadataDescriptor";static DESCRIPTOR={fields:{userId:{type:"string",id:1},type:{type:"string",id:2},createdAt:{type:"string",id:3}}};static toJSON({createdAt:e,...t}){const n={...t};return e?.toISOString&&(n.createdAt=e.toISOString()),n}static fromJSON({createdAt:e,...t}){const n={...t};return e&&(n.createdAt=new Date(e)),n}}class fn extends i{id;buffers;types;baseVersion;metadata;lastOperationId;static TYPE="13";static READABLE_TYPE_NAME="updateDocument";static DESCRIPTOR_NAME="CollaborativeEditingUpdateMessage";static 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}}};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:pn.removeUnnecessaryMetadata(this.types,this.metadata).map(hn.toJSON),lastOperationId:this.lastOperationId}}static fromJSON(e){return new fn(e.id,e.buffers,e.types,e.baseVersion,pn.prepareMetadataForOperations(e.types,e.metadata).map(hn.fromJSON),e.lastOperationId)}}class mn extends i{id;lastKnowVersion;bundleVersion;static TYPE="12";static READABLE_TYPE_NAME="reconnectToDocument";static DESCRIPTOR_NAME="CollaborativeEditingReconnectMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},lastKnowVersion:{type:"uint32",id:3}}};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 mn(e.id,e.lastKnowVersion,e.bundleVersion)}}class yn extends i{version;buffers;types;metadata;lastOperationId;lastOperationAcceptedAt;static DESCRIPTOR_NAME="CollaborativeEditingResponse";static 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}}};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(){return!this.types?.length}toJSON(){return{version:this.version,buffers:this.buffers,types:this.types,metadata:pn.removeUnnecessaryMetadata(this.types,this.metadata).map(hn.toJSON),lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt instanceof Date?this.lastOperationAcceptedAt.toISOString():this.lastOperationAcceptedAt}}static fromJSON(e){return new yn(e.version,e.buffers,e.types,pn.prepareMetadataForOperations(e.types,e.metadata).map(hn.fromJSON),e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}static create(e){return new yn(e.version,e.buffers,e.types,e.metadata,e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}}class gn extends i{channel;version;buffers;types;offset;metadata;initData;sessionId;lastOperationId;sessionCreatedAt;static DESCRIPTOR_NAME="CollaborativeEditingConnectResponse";static 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:hn.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}}}))();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(){return!this.types?.length&&null===this.initData}toJSON(){return{channel:this.channel,version:this.version,sessionId:this.sessionId,buffers:this.buffers,types:this.types,offset:this.offset,metadata:pn.removeUnnecessaryMetadata(this.types,this.metadata).map(hn.toJSON),initData:this.initData??"",isInitialized:"string"==typeof this.initData,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt?this.sessionCreatedAt.toISOString():null}}static create(e){return new gn(e.channel,e.version,e.buffers,e.types,e.offset,e.metadata,e.initData,e.sessionId,e.lastOperationId,e.sessionCreatedAt)}static fromJSON(e){let t=null;return!0===e.isInitialized?t=e.initData??"":"boolean"!=typeof e.isInitialized&&e.initData&&(t=e.initData),gn.create({channel:e.channel,version:e.version,buffers:e.buffers,types:e.types,offset:e.offset,metadata:pn.prepareMetadataForOperations(e.types,e.metadata).map(hn.fromJSON),initData:t,sessionId:e.sessionId,lastOperationId:e.lastOperationId,sessionCreatedAt:e.sessionCreatedAt?new Date(e.sessionCreatedAt):null})}}class bn extends i{lastDocumentSession;currentDocumentSession;static DESCRIPTOR_NAME="GetDocumentDetailsResponse";static 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}}};constructor(e,t){super(),this.lastDocumentSession=e,this.currentDocumentSession=t}get data(){return{lastDocumentSessionId:this.lastDocumentSession?.id,lastDocumentSessionOperationId:this.lastDocumentSession?.lastOperationId,currentDocumentSessionId:this.currentDocumentSession?.id,currentDocumentSessionVersion:this.currentDocumentSession?.version,currentDocumentSessionOperationId:this.currentDocumentSession?.lastOperationId}}toJSON(){return{lastDocumentSessionId:this.lastDocumentSession?.id,lastDocumentSessionOperationId:this.lastDocumentSession?.lastOperationId,currentDocumentSessionId:this.currentDocumentSession?.id,currentDocumentSessionVersion:this.currentDocumentSession?.version,currentDocumentSessionOperationId:this.currentDocumentSession?.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 bn(t,n)}}class On extends i{documentId;static TYPE="14";static READABLE_TYPE_NAME="getDocumentDetails";static DESCRIPTOR_NAME="GetDocumentDetailsMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1},environmentId:{type:"string",id:2}}};constructor(e){super(),this.documentId=e}get data(){return{documentId:this.documentId}}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new On(e.documentId)}}const wn=class extends((0,n.EmitterMixin)()){static _SERVICE=1;_bundleVersion;_id;_isConnected;_wsGateway;_channel;_connectedSessions;constructor(e,t){if(super(),!e)throw new TypeError('Param "bundleVersion" must be provided.');this._id=t??rn(),this._isConnected=!1,this._bundleVersion=e}getId(){return this._id}isConnected(){return this._isConnected}connect(e,t={buffers:[],types:[]},n){const r=new ln(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 mn(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 On(this.getId());if(!this._wsGateway)throw new xt("Collaborative Editing",this);const t=await this._wsGateway._sendRequest(1,On.TYPE,l.encode(e));return l.decode(t,bn)}async sendOperations(e,t,n){if(!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 fn(this.getId(),e.buffers,e.types,r,[],n);if(!this._wsGateway||!this._isConnected)throw new xt("Collaborative Editing",this);const o=await this._wsGateway._sendRequest(1,fn.TYPE,l.encode(s));return l.decode(o,yn)}async getConnectedSessions(){if(!this._isConnected)throw new xt("Collaborative Editing",this);return this._connectedSessions||(this._connectedSessions=await un.getConnectedSessions(this._wsGateway,this._id,1)),this._connectedSessions}static getConnectedSessions(e,t){return un.getConnectedSessions(e,t,1)}async _connect(e,t){if(this.isConnected())return;if(e.state!==It.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,l.encode(t)),r=l.decode(n,gn);return this.listenTo(e,"change:state",(e,t,n)=>this._onWsGatewayStateChange(n),{priority:It._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(fn.TYPE),(e,t)=>{const n=l.decode(t,fn);this.fire("operationsReceived",n.baseVersion,n.data,n.metadata)})}_onWsGatewayStateChange(e){e===It.STATE_DISCONNECTED&&this.disconnect()}};class In extends o{static DESCRIPTOR_NAME="CommentDescriptor";static 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"}}};static toJSON(e){return{...e,createdAt:e.createdAt?.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}}}class vn extends o{static DESCRIPTOR_NAME="CommentsThreadDescriptor";static 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}}};static toJSON(e){return{...e,createdAt:e.createdAt?.toISOString(),deletedAt:e.deletedAt?.toISOString(),resolvedAt:e.resolvedAt?.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null,context:e.context?JSON.stringify(e.context):e.context,comments:e.comments?.map(In.toJSON),unlinkedAt:e.unlinkedAt?.toISOString()}}static fromJSON(e){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:e.comments?.map(In.fromJSON),unlinkedAt:e.unlinkedAt?new Date(e.unlinkedAt):void 0}}}class Sn extends i{documentId;commentThreadId;content;commentId;userId;attributes;commentThread;createdAt;static TYPE="91";static READABLE_TYPE_NAME="addComment";static DESCRIPTOR_NAME="CommentsV2AddCommentMessage";static 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}}};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?vn.toJSON(this.commentThread):void 0}}static fromJSON(e){return new Sn(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?vn.fromJSON(e.commentThread):void 0)}}class kn extends i{commentThreadId;commentId;createdAt;static DESCRIPTOR_NAME="CommentsV2AddCommentResponse";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},createdAt:{type:"string",id:3}}};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 kn(e.commentThreadId,e.commentId,e.createdAt)}}class Pn extends i{documentId;static TYPE="92";static READABLE_TYPE_NAME="connectToComment";static DESCRIPTOR_NAME="CommentsV2ConnectMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Pn(e.documentId)}}class An extends i{channel;_threads;_threadsV2;threads;static DESCRIPTOR_NAME="CommentsV2ConnectResponse";static DESCRIPTOR={fields:{channel:{type:"string",id:1},threads:{type:"string",rule:"repeated",id:2},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:3}}};constructor(e,t,n){super(),this.channel=e,this._threads=t,this._threadsV2=n,this.threads=n?.length?n:t}toJSON(){return{channel:this.channel,threads:this._threads?.map(e=>JSON.stringify(e)),threadsV2:this._threadsV2?.map(vn.toJSON)}}static fromJSON(e){return new An(e.channel,e.threads?.map(e=>JSON.parse(e)),e.threadsV2?.map(vn.fromJSON))}}class Tn extends i{documentId;commentThreadId;commentId;static TYPE="95";static READABLE_TYPE_NAME="removeComment";static DESCRIPTOR_NAME="CommentsV2RemoveCommentMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},documentId:{type:"string",id:3}}};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 Tn(e.documentId,e.commentThreadId,e.commentId)}}class _n extends i{documentId;commentThreadId;static TYPE="97";static READABLE_TYPE_NAME="removeCommentThread";static DESCRIPTOR_NAME="CommentsV2RemoveCommentThreadMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};constructor(e,t){super(),this.documentId=e,this.commentThreadId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new _n(e.documentId,e.commentThreadId)}}class Cn extends i{documentId;commentThreadId;commentId;content;attributes;isAttributesUpdated;commentThread;static TYPE="96";static READABLE_TYPE_NAME="updateComment";static DESCRIPTOR_NAME="CommentsV2UpdateCommentMessage";static 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}}};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?vn.toJSON(this.commentThread):void 0}}static fromJSON(e){return new Cn(e.documentId,e.commentThreadId,e.commentId,e.content,e.attributes?JSON.parse(e.attributes):null,e.isAttributesUpdated,e.commentThread?vn.fromJSON(e.commentThread):void 0)}}class jn extends i{commentThreadId;documentId;static TYPE="93";static READABLE_TYPE_NAME="getComment";static DESCRIPTOR_NAME="CommentsV2GetCommentThreadMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId}}static fromJSON(e){return new jn(e.commentThreadId,e.documentId)}}class En extends i{commentThreadId;_comments;_commentsV2;resolvedBy;comments;createdAt;deletedAt;resolvedAt;attributes;context;unlinkedAt;static DESCRIPTOR_NAME="CommentsV2GetCommentThreadResponse";static 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}}};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=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(){return{commentThreadId:this.commentThreadId,comments:this._comments?.map(e=>JSON.stringify(e)),commentsV2:this._commentsV2?.map(In.toJSON),attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,context:this.context?JSON.stringify(this.context):this.context,resolvedBy:this.resolvedBy,createdAt:this.createdAt?.toISOString(),deletedAt:this.deletedAt?.toISOString(),resolvedAt:this.resolvedAt?.toISOString(),unlinkedAt:this.unlinkedAt?.toISOString()}}static fromJSON(e){return new En(e.commentThreadId,e.comments?.map(e=>function(e){const t=JSON.parse(e);return{...t,createdAt:new Date(t.createdAt)}}(e)),e.commentsV2?.map(In.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)}}class Dn extends i{documentId;static TYPE="94";static READABLE_TYPE_NAME="getDocumentThreads";static DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Dn(e.documentId)}}class Rn extends i{_threads;_threadsV2;threads;static DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsResponse";static DESCRIPTOR={fields:{threads:{type:"string",rule:"repeated",id:1},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:2}}};constructor(e,t){super(),this._threads=e,this._threadsV2=t,this.threads=t?.length?t:e}toJSON(){return{threads:this._threads?.map(e=>JSON.stringify(e)),threadsV2:this._threadsV2?.map(vn.toJSON)}}static fromJSON(e){return new Rn(e.threads?.map(e=>function(e){const t=JSON.parse(e),n={...t};return t.comments&&(n.comments=t.comments?.map(e=>({...e,createdAt:new Date(e.createdAt)}))),n}(e)),e.threadsV2?.map(vn.fromJSON))}}class xn extends o{static DESCRIPTOR_NAME="CommentThreadAddedCommentDescriptor";static DESCRIPTOR={fields:{commentId:{id:1,type:"string"},createdAt:{id:2,type:"string"}}};static toJSON(e){return{commentId:e.commentId,createdAt:e.createdAt?.toISOString()}}static fromJSON(e){return{commentId:e.commentId,createdAt:new Date(e.createdAt)}}}class Nn extends i{commentThreadId;comments;createdAt;static DESCRIPTOR_NAME="CommentsV2AddCommentThreadResponse";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},createdAt:{type:"string",id:2},comments:{type:"CommentThreadAddedCommentDescriptor",rule:"repeated",id:3}}};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 Nn(e.commentThreadId,e.createdAt,e.comments.map(e=>xn.fromJSON(e)))}}class Vn extends i{documentId;commentThreadId;comments;context;resolvedBy;attributes;createdAt;resolvedAt;deletedAt;static TYPE="140";static READABLE_TYPE_NAME="addCommentThread";static DESCRIPTOR_NAME="CommentsV2AddCommentThreadMessage";static 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}}};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(){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:this.comments?.map(e=>In.toJSON(e))}}static fromJSON(e){return new Vn(e.documentId,e.commentThreadId,e.comments?.map(t=>In.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)}}class Mn extends i{commentThreadId;documentId;resolvedBy;resolvedAt;static TYPE="142";static READABLE_TYPE_NAME="resolveCommentThread";static DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedBy:{type:"string",id:3},resolvedAt:{type:"string",id:4}}};constructor(e,t,n,r){super(),this.commentThreadId=e,this.documentId=t,this.resolvedBy=n,this.resolvedAt=r?new Date(r):void 0}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt?.toISOString()}}static fromJSON(e){return new Mn(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}class Bn extends i{commentThreadId;documentId;static TYPE="141";static READABLE_TYPE_NAME="reopenCommentThread";static DESCRIPTOR_NAME="CommentsV2ReopenCommentThreadMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new Bn(e.commentThreadId,e.documentId)}}class Un extends i{commentThreadId;documentId;context;attributes;unlinkedAt;static TYPE="143";static READABLE_TYPE_NAME="updateCommentThread";static DESCRIPTOR_NAME="CommentsV2UpdateCommentThreadMessage";static 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}}};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 Un(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)}}class Jn extends i{commentThreadId;documentId;resolvedBy;resolvedAt;static DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadResponse";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4}}};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 Jn(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}class qn extends((0,n.EmitterMixin)()){_documentId;_isConnected=!1;_wsGateway;_channel;_connectedSessions;static _SERVICE=9;constructor(e){super(),this._documentId=e}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==Ot.CONNECTED)throw new Ye("WebSocket Gateway is not connected.",e);const t=new Pn(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(9,Pn.TYPE,l.encode(t)),{channel:r,threads:s}=l.decode(n,An);return this.listenTo(e,"change:state",(e,t,n)=>this._onWsGatewayStateChange(n),{priority:It._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 Sn(this._documentId,e,n,t,void 0,void 0,r),o=await this._sendRequest(Sn.TYPE,s);return l.decode(o,kn)}async updateComment(e,t,n,r){const s=void 0!==r,o=new Cn(this._documentId,e,t,n,r,s);await this._sendRequest(Cn.TYPE,o)}async removeComment(e,t){const n=new Tn(this._documentId,e,t);await this._sendRequest(Tn.TYPE,n)}async removeCommentThread(e){const t=new _n(this._documentId,e);await this._sendRequest(_n.TYPE,t)}async addCommentThread(e){const t=new Vn(this._documentId,e.commentThreadId,e.comments?.map(t=>({...t,documentId:this._documentId,commentThreadId:e.commentThreadId})),e.context,e.resolvedBy,e.createdAt,e.resolvedAt,e.deletedAt,e.attributes),n=await this._sendRequest(Vn.TYPE,t);return l.decode(n,Nn)}async resolveCommentThread(e){const t=new Mn(e,this._documentId),n=await this._sendRequest(Mn.TYPE,t);return l.decode(n,Jn)}async reopenCommentThread(e){const t=new Bn(e,this._documentId);await this._sendRequest(Bn.TYPE,t)}async updateCommentThread(e){const t=new Un(e.commentThreadId,this._documentId,e.context,e.attributes,e.unlinkedAt);await this._sendRequest(Un.TYPE,t)}async getCommentThread(e,t=1){const n=new jn(e,this._documentId);try{const e=await this._sendRequest(jn.TYPE,n),t=l.decode(e,En);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 Dn(this._documentId),t=await this._sendRequest(Dn.TYPE,e),{threads:n}=l.decode(t,Rn);return{threads:n}}async getConnectedSessions(){if(!this._isConnected)throw new xt("Comments",this);return this._connectedSessions||(this._connectedSessions=await un.getConnectedSessions(this._wsGateway,this._documentId,9)),this._connectedSessions}_connectToChannel(e,t){this._channel=e._getChannel(qn._SERVICE,t),this._channel&&(this.listenTo(this._channel,this._channel.getEventName(Sn.TYPE),(e,t)=>{const n=l.decode(t,Sn);this.fire("commentAdded",n)}),this.listenTo(this._channel,this._channel.getEventName(Tn.TYPE),(e,t)=>{const n=l.decode(t,Tn);this.fire("commentRemoved",n)}),this.listenTo(this._channel,this._channel.getEventName(Cn.TYPE),(e,t)=>{const n=l.decode(t,Cn);this.fire("commentUpdated",n)}),this.listenTo(this._channel,this._channel.getEventName(_n.TYPE),(e,t)=>{const n=l.decode(t,_n);this.fire("commentThreadRemoved",n)}),this.listenTo(this._channel,this._channel.getEventName(Vn.TYPE),(e,t)=>{const n=l.decode(t,Vn);this.fire("commentThreadAdded",n)}),this.listenTo(this._channel,this._channel.getEventName(Un.TYPE),(e,t)=>{const n=l.decode(t,Un);this.fire("commentThreadUpdated",n)}),this.listenTo(this._channel,this._channel.getEventName(Mn.TYPE),(e,t)=>{const n=l.decode(t,Mn);this.fire("commentThreadResolved",n)}),this.listenTo(this._channel,this._channel.getEventName(Bn.TYPE),(e,t)=>{const n=l.decode(t,Bn);this.fire("commentThreadReopened",n)}))}_onWsGatewayStateChange(e){e===Ot.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new xt("Comments",this);return this._wsGateway._sendRequest(9,e,l.encode(t))}}const Gn=qn,Ln=Yn;function Yn(e,t){const n=Hn();return(Yn=function(e,t){return n[e-=278]})(e,t)}function Hn(){const e=["all","disconnect","define","996wAyIVL","_domEmitter","54jTbGGs","_shouldPluginsReconnect","1360100PcEkaz","pluginName","limitExceeded","219036rhjoyt","offline","has","config","requires","websocketgateway-invalid-plugin-interface","from","cloudservices-reconnection-error","webSocketUrl","CONNECTING","CloudServices","constructor","connection","function","cloudServices.requestTimeout","get","4144lZndWf","DISCONNECTED","websocketgateway-missing-token","add","CONNECTED","3142508esMJiY","3kFIGrp","_isBrowserOffline","init","websocketgateway-missing-websocket-url","stopListening","isOfficialPlugin","bind","544aLcrNx","isInReconnectionStack","token","websocketgateway-plugin-already-registered","77nzfUYQ","listenTo","change:me","Connected users limit exceeded","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.","10524QxUVeO","removeFromReconnectionStack","addToReconnectionStack","reconnect","_reconnect","state","9970ABWiZK","error","showWarning","145uDjmJN","isPremiumPlugin","WebSocketGateway","initialReconnectionInterval","delete","code","plugins","_reconnectionStack","real-time-collaboration","90202dsuynx","online","set","context","then","cloudservices-init","destroy","connect","36829nNPpQM","connected","catch","cloudServices.connectionTimeout"];return(Hn=function(){return e})()}!function(e){const t=Yn,n=e();for(;;)try{if(491644===-parseInt(t(306))/1*(-parseInt(t(297))/2)+-parseInt(t(281))/3*(-parseInt(t(280))/4)+parseInt(t(303))/5*(-parseInt(t(330))/6)+-parseInt(t(315))/7*(parseInt(t(288))/8)+-parseInt(t(332))/9*(parseInt(t(334))/10)+-parseInt(t(292))/11*(-parseInt(t(337))/12)+-parseInt(t(323))/13*(-parseInt(t(353))/14))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Hn);class zn extends t.ContextPlugin{static[Ln(308)]=(()=>It)();static[Ln(309)]=1e3;[Ln(349)];[Ln(313)];[Ln(333)];[Ln(331)];static get[Ln(341)](){return[Ln(347),r.Notification]}static get[Ln(335)](){return Ln(308)}static get[Ln(286)](){return!0}static get[Ln(307)](){return!0}constructor(e){const t=Ln;super(e),this[t(317)](t(302),Ot[t(279)]),this[t(317)](t(282),!1),this[t(313)]=new Set,this[t(333)]=!1,this[t(331)]=new((0,n.DomEmitterMixin)())}[Ln(283)](){const e=Ln,t=this[e(318)],s=t[e(312)][e(352)](e(347)),o=t[e(312)][e(352)](r.Notification);if(!s[e(290)])throw new n.CKEditorError(e(355),this);if(!s[e(345)])throw new n.CKEditorError(e(284),this);return this[e(331)][e(293)](window,e(338),()=>this[e(282)]=!0),this[e(331)][e(293)](window,e(316),()=>this[e(282)]=!1),this[e(318)][e(340)][e(329)](e(326),10),this[e(318)][e(340)][e(329)](e(351),20),zn[e(308)][e(322)](s[e(290)],s[e(345)],{timeout:1e3*this[e(318)][e(340)][e(352)](e(326)),requestTimeout:1e3*this[e(318)][e(340)][e(352)](e(351))})[e(319)](t=>{const r=e;if(this[r(349)]=t,this[r(287)](r(302)).to(t,r(302),this,r(282),(e,t)=>(r(324)!==e&&(this[r(333)]=!0),t||e!==Ot[r(279)]?Ot[r(354)]:this[r(302)]==Ot[r(354)]&&this[r(333)]?(this[r(333)]=!1,this[r(301)](),Ot[r(346)]):Ot[r(279)])),this[r(349)].on(r(304),(e,t)=>{const s=r;if(s(336)!==t[s(311)])throw console[s(304)](t),new n.CKEditorError(s(320),null,{originalError:t});o[s(305)](s(296),{title:s(295),namespace:s(314)})}),!t.me)return new Promise(e=>t.on(r(294),e))})[e(325)](t=>{const r=e;throw console[r(304)](t),new n.CKEditorError(r(320),null,{originalError:t})})}[Ln(299)](e){const t=Ln;if(t(350)!=typeof e[t(300)])throw new n.CKEditorError(t(342),this);if(this[t(289)](e))throw new n.CKEditorError(t(291),this,{name:e[t(348)][t(335)]});this[t(313)][t(278)](e)}[Ln(298)](e){const t=Ln;this[t(313)][t(310)](e)}[Ln(289)](e){const t=Ln;return this[t(313)][t(339)](e)}[Ln(301)](){const e=Ln;return this[e(349)][e(300)]()[e(319)](()=>Promise[e(327)](Array[e(343)](this[e(313)],t=>t[e(300)]())))[e(319)](()=>this[e(302)]=Ot[e(279)])[e(325)](t=>{const r=e;throw console[r(304)](t),new n.CKEditorError(r(344),this[r(318)])})}[Ln(328)](){const e=Ln;this[e(349)]&&this[e(349)][e(328)](),this[e(302)]=Ot[e(354)],this[e(331)][e(285)]()}[Ln(321)](){const e=Ln;this[e(328)](),super[e(321)]()}}var Fn=__webpack_require__(211);const Kn=Wn;function Wn(e,t){const n=Zn();return(Wn=function(e,t){return n[e-=350]})(e,t)}!function(e){const t=Wn,n=e();for(;;)try{if(515689===parseInt(t(397))/1*(parseInt(t(407))/2)+parseInt(t(350))/3*(-parseInt(t(379))/4)+parseInt(t(372))/5*(parseInt(t(405))/6)+-parseInt(t(390))/7+parseInt(t(395))/8+parseInt(t(376))/9+parseInt(t(396))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Zn);class Qn extends t.ContextPlugin{[Kn(388)];[Kn(398)];[Kn(367)];[Kn(355)];[Kn(402)];[Kn(366)];static get[Kn(387)](){return Kn(360)}static get[Kn(383)](){return!0}static get[Kn(359)](){return!0}static get[Kn(358)](){return[zn,Fn.Users]}constructor(e){const t=Kn;super(e),this[t(388)]=new Map,this[t(398)]=new Map,this[t(367)]=new n.Collection,this[t(355)]=new Map,this[t(402)]=0,this[t(366)]=this[t(411)][t(373)][t(378)](Fn.Users)}[Kn(352)](){const e=Kn,t=this[e(411)][e(373)][e(378)](zn);this[e(357)](t,e(368),(t,n,r)=>{const s=e;if(s(380)!==r)this[s(388)][s(403)](e=>e[s(394)]()),this[s(398)][s(403)](e=>e[s(394)]()),this[s(367)][s(394)]();else for(const[e,t]of this[s(355)])for(const n of t)this[s(369)](e,n)}),this[e(409)](t[e(370)].me,!0)}[Kn(404)](e,t){const r=Kn;if(this[r(355)][r(375)](e))throw new n.CKEditorError(r(371),null,{channelId:e});this[r(355)][r(393)](e,t),this[r(388)][r(393)](e,new n.Collection),this[r(398)][r(393)](e,new n.Collection),this[r(357)](t,r(356),(t,n)=>this[r(369)](e,n)),this[r(357)](t,r(381),(t,n)=>this[r(410)](e,n));for(const n of t)this[r(369)](e,n)}[Kn(406)](e){const t=Kn;if(!this[t(355)][t(375)](e))throw new n.CKEditorError(t(392),null,{channelId:e});const r=this[t(355)][t(378)](e);this[t(362)](r);for(const n of r)t(380)===this[t(411)][t(373)][t(378)](zn)[t(408)]&&this[t(410)](e,n);this[t(355)][t(399)](e),this[t(388)][t(399)](e),this[t(398)][t(399)](e)}get[Kn(377)](){const e=Kn;return this[e(411)][e(373)][e(378)](zn)[e(370)][e(401)]}[Kn(361)](e){const t=Kn;for(const n of this[t(388)][t(365)]())for(const r of n)if(r.id===e)return r[t(400)]}[Kn(385)](e,t){const n=Kn,r=t?[this[n(388)][n(378)](t)]:this[n(388)][n(365)](),s=new Set;for(const t of r)for(const r of t)r[n(400)].id===e.id&&s[n(356)](r.id);return s}[Kn(391)](e){const t=Kn;for(const n of this[t(388)][t(365)]())for(const r of n)if(r[t(400)]===e)return r[t(374)]}[Kn(369)](e,t){const n=Kn;if(n(380)!==this[n(411)][n(373)][n(378)](zn)[n(408)])return;const r=t[n(400)],s=this[n(366)][n(353)](r.id)||this[n(409)](r),o=Object[n(351)]({},t,{user:s});this[n(388)][n(378)](e)[n(356)](o);const i=this[n(398)][n(378)](e);i[n(375)](s.id)||i[n(356)](s),this[n(367)][n(375)](s.id)||this[n(367)][n(356)](s,s[n(382)]?0:void 0),this[n(386)](n(363)+e,{channelId:e,session:o})}[Kn(410)](e,t){const n=Kn;if(n(380)!==this[n(411)][n(373)][n(378)](zn)[n(408)])return;const r=this[n(398)][n(378)](e),s=t[n(400)];s.id&&(this[n(388)][n(378)](e)[n(381)](t.id),r[n(375)](s.id)&&!this[n(385)](s,e)[n(354)]&&r[n(381)](s.id),this[n(367)][n(378)](s.id)&&!this[n(385)](s)[n(354)]&&this[n(367)][n(381)](s.id))}[Kn(409)](e,t){const n=Kn,r=this[n(366)][n(389)](e);return t&&this[n(366)][n(384)](e.id),r[n(364)]=this[n(402)]++,r}}function Zn(){const e=["remove","isMe","isOfficialPlugin","defineMe","getUserSessions","fire","pluginName","channelSessions","addUser","2705920KRPYvG","getUserRole","sessions-unregister-not-exist","set","clear","440576fCdfER","2203740YIDepG","212453vRxTYr","channelConnectedUsers","delete","user","sessionId","_uniqueUsersCount","forEach","register","516rTSBgN","unregister","2tLJCwA","state","_createUser","_handleSessionRemove","context","888270FDUHDG","assign","init","getUser","size","_registeredSessions","add","listenTo","requires","isPremiumPlugin","Sessions","getUserBySessionId","stopListening","sessionAdd:","orderNumber","values","_users","allConnectedUsers","change:state","_handleSessionAdd","connection","sessions-register-already-registered","32320XdrwXg","plugins","role","has","1390824KADVBa","mySessionId","get","4meVvuw","connected"];return(Zn=function(){return e})()}var Xn=__webpack_require__(673),$n=__webpack_require__.n(Xn),er=__webpack_require__(545),tr=__webpack_require__.n(er),nr=__webpack_require__(262),rr=__webpack_require__.n(nr),sr=__webpack_require__(667),or=__webpack_require__.n(sr),ir=__webpack_require__(357),ar=__webpack_require__.n(ir),cr=__webpack_require__(535),dr={attributes:{"data-cke":!0}};dr.setAttributes=or(),dr.insert=rr().bind(null,"head"),dr.domAPI=tr(),dr.insertStyleElement=ar();$n()(cr.A,dr);cr.A&&cr.A.locals&&cr.A.locals;const ur=pr;!function(e){const t=pr,n=e();for(;;)try{if(569661===parseInt(t(300))/1*(-parseInt(t(186))/2)+-parseInt(t(316))/3+-parseInt(t(260))/4+parseInt(t(203))/5+-parseInt(t(293))/6+parseInt(t(249))/7+parseInt(t(287))/8*(parseInt(t(320))/9))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(fr);class lr extends t.Plugin{[ur(294)]=new((0,n.DomEmitterMixin)());static get[ur(295)](){return[Qn]}static get[ur(192)](){return ur(187)}static get[ur(265)](){return!0}static get[ur(211)](){return!0}[ur(207)](){const e=ur,t=this[e(191)],r=t[e(214)][e(228)](Qn);t[e(282)][e(184)](e(308))[e(275)]({model:e(262),view:(n,{writer:s})=>function(t,n,r,s){const o=e,i=t[o(238)][o(194)](":")[2],a=r[o(196)](i);if(!a||i===r[o(243)])return;if(!s[o(257)][o(274)][o(299)](t[o(212)][o(193)],o(209)))return;const c={class:o(234)+a[o(278)][o(201)](),"data-name":a[o(229)],"data-session-id":i},d=s[o(257)][o(198)][o(228)](t[o(238)])[o(321)](),u=d[o(213)],l=s[o(257)][o(274)];if(u&&l[o(252)](u)&&l[o(297)](u)&&!s[o(257)][o(198)][o(228)](o(296)+i)[o(302)]()[o(233)])return;const p=d[o(291)];return s[o(257)][o(274)][o(288)](p)&&!s[o(257)][o(304)](p)&&(c[o(311)]=!1),function(e,t,n){const r=o,s=e[r(284)](r(210),t);return e[r(270)](r(303),!0,s),s[r(253)]=function(e){const t=r,s=this[t(258)](e),o=document[t(254)](t(210));return o[t(188)][t(204)](t(271)),o[t(244)](t(311),t(266)),o[t(244)](t(226),t(266)),o[t(286)]=n[t(229)],s[t(185)]=t(285)+o[t(268)]+"⁠",s[t(218)](t(292),()=>{const e=t;s[e(188)][e(204)](e(298))}),s[t(218)](t(236),()=>{const e=t;s[e(188)][e(206)](e(298))}),s},s[r(251)]=function(e){const t=r;return!(!this[t(217)](t(303))||!e[t(217)](t(303))||this[t(216)](t(309))!=e[t(216)](t(309)))},s}(n,c,a)}(n,s,r,t)}),t[e(282)][e(184)](e(308))[e(279)]({model:e(277),view:t=>function(t,n){const r=e,s=t[r(238)][r(194)](":")[2];if(s===n[r(243)])return null;const o=n[r(196)](s);return o?{id:s,classes:[r(241),o[r(278)][r(227)]()],attributes:{"data-session-id":s},priority:2e3+o[r(250)]}:{id:s,classes:[]}}(t,r)}),function(t){const n=e,r=t[n(257)],o=new Map,i=t[n(214)][n(228)](Qn);r[n(198)].on(n(267),(e,a,c,d)=>{const u=n;if(!d&&o[u(228)](a[u(229)]))return o[u(228)](a[u(229)])[u(306)](),void o[u(220)](a[u(229)]);const l=a[u(229)][u(194)](":")[2];if(l===i[u(243)])return;const p=u(264)+l;r[u(198)][u(273)](p)&&t[u(312)][u(305)](p),a.on(u(219),(e,t,n)=>{const i=u;if(i(301)!=t[i(195)][i(242)]&&i(301)==a[i(302)]()[i(195)][i(242)]&&!o[i(273)](a[i(229)])){const e=r[i(274)][i(222)](n[i(290)]);if(e){const t=s.ModelLiveRange[i(223)](e);o[i(232)](a[i(229)],t),t.on(i(219),(e,n,s)=>{const c=i;if(c(301)==t[c(195)][c(242)]){const e=r[c(274)][c(222)](s[c(290)]);e?(t[c(193)]=e[c(193)],t[c(221)]=e[c(221)]):(o[c(220)](a[c(229)]),t[c(306)]())}})}}})}),r[n(283)].on(n(239),()=>{const e=n;o[e(263)]>0&&r[e(261)]({isUndoable:!1},t=>{const n=e;for(const[e,s]of o)n(301)==r[n(198)][n(228)](e)[n(302)]()[n(195)][n(242)]&&(hr(e[n(194)](":")[2],s[n(215)](),r,t),s[n(306)]());o[n(225)]()})})}(t),this[e(294)][e(256)](n.global[e(283)],e(197),(n,{key:r})=>{const s=e;s(224)===r&&function(e){const t=s;e[t(312)][t(248)][t(239)](n=>{const r=t;for(const t of e[r(257)][r(198)]){if(!t[r(229)][r(189)](r(262)))continue;const s=e[r(312)][r(318)][r(319)](t[r(229)]);if(s)for(const e of s)n[r(281)](r(298),e)}})}(t)},{useCapture:!0})}[ur(190)](){const e=ur,t=this[e(191)],n=t[e(240)][e(228)](e(200));n&&t[e(257)].on(e(317),(r,s)=>{const o=e,i=s[0];if(!i[o(289)])return;if(o(307)!=i[o(199)]||!i[o(229)][o(189)](o(269)))return;const a=i[o(246)];n[o(280)][o(273)](a)&&(i[o(230)]=i[o(237)]?t[o(257)][o(276)](i[o(237)][o(193)],i[o(237)][o(221)]):null)},{priority:e(231)})}[ur(245)](){const e=ur;return this[e(294)][e(315)](),super[e(245)]()}[ur(314)](){const e=ur,t=this[e(191)],n=t[e(257)][e(283)],r=t[e(214)][e(228)](Qn);t[e(257)][e(261)]({isUndoable:!1},s=>{const o=e,i=o(296)+r[o(243)],a=o(264)+r[o(243)],c=t[o(257)][o(198)][o(273)](i);t[o(312)][o(248)][o(272)]?hr(r[o(243)],n[o(205)][o(310)](),t[o(257)],s):c&&(s[o(235)](i),s[o(235)](a))})}}function pr(e,t){const n=fr();return(pr=function(e,t){return n[e-=184]})(e,t)}function hr(e,t,n,r){const s=ur,o=s(296)+e,i=s(264)+e,a=t[s(313)]();let c=t[s(193)];if(a&&a.is(s(259),s(247))){const e=function(e,t){const n=s;for(const r of e[n(202)]())if(t[n(274)][n(299)](r,n(209)))return r}(t,n);e&&(c=e,t=r[s(276)](c))}const d=r[s(276)](c);n[s(198)][s(273)](o)?(r[s(208)](o,{range:t}),r[s(208)](i,{range:d})):(r[s(255)](o,{range:t,usingOperation:!0}),r[s(255)](i,{range:d,usingOperation:!0}))}function fr(){const e=["mouseleave","oldRange","markerName","change","commands","ck-user__selection","rootName","mySessionId","setAttribute","destroy","batch","tableCell","view","6256873ppkTeA","orderNumber","isSimilar","isObject","render","createElement","addMarker","listenTo","model","toDomElement","element","3926824VjfIMG","enqueueChange","user:position","size","user:position:","isOfficialPlugin","false","update:user:range","outerHTML","user:","setCustomProperty","ck-user__marker-tooltip","hasDomSelection","has","schema","markerToElement","createRange","user:range","color","markerToHighlight","_createdBatches","removeClass","conversion","document","createUIElement",'⁠<span class="ck-user__marker-line" contenteditable="false"><span class="ck-user__marker-dot"></span></span>',"textContent","3448dametE","isLimit","isDocumentOperation","deletionPosition","parent","mouseenter","1224528tnidUG","_domEmitter","requires","user:range:","isInline","ck-user__marker_hovered","checkChild","4LXPyxo","$graveyard","getRange","userPositionMarker","hasContent","reconvertMarker","detach","marker","editingDowncast","data-session-id","getFirstRange","contenteditable","editing","getContainedElement","createUserMarkerOperations","stopListening","786291gVhnnN","applyOperation","mapper","markerNameToElements","34119ucfOMK","getStart","for","innerHTML","353110wBNhXo","UserMarkers","classList","startsWith","afterInit","editor","pluginName","start","split","root","getUserBySessionId","keydown","markers","type","undo","getMarkerClass","getPositions","980060BpkfgQ","add","selection","remove","init","updateMarker","$text","span","isPremiumPlugin","markerRange","nodeAfter","plugins","toRange","getAttribute","getCustomProperty","addEventListener","change:range","delete","end","getNearestSelectionRange","fromRange","Escape","clear","spellcheck","getSelectionClass","get","name","newRange","highest","set","isCollapsed","ck-user__marker ","removeMarker"];return(fr=function(){return e})()}function mr(e,t,n){const r=e.t,s=e.t;switch(t){case"PENDING_ACTION_SENDING_DATA":return s({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 s("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 s("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 s("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 s("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 s("Synchronization issue");case"Connected users list dropdown menu":return s("Connected users list dropdown menu");case"Collapsed connected users list (press ENTER to open it)":return s("Collapsed connected users list (press ENTER to open it)");case"Connected users list":return s("Connected users list");case"PENDING_ACTION_REVISION_HISTORY":return r({string:"Unsaved change in revision history.",id:"PENDING_ACTION_REVISION_HISTORY"});case"CONNECTED_USERS":return s({string:"1 connected user (me)",plural:"%0 connected users",id:"CONNECTED_USERS"},n);default:return""}}const yr=(()=>{var e=d.Reader,t=d.Writer,n=d.util,r=d.roots.default||(d.roots.default={});return r.AttributeOperation=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.range=null,s.prototype.key="",s.prototype.oldValueBoolean=!1,s.prototype.oldValueJson="",s.prototype.newValueBoolean=!1,s.prototype.newValueJson="",s.prototype.wasUndone=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.range&&Object.hasOwnProperty.call(e,"range")&&r.Range.encode(e.range,n.uint32(10).fork()).ldelim(),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&n.uint32(18).string(e.key),null!=e.oldValueBoolean&&Object.hasOwnProperty.call(e,"oldValueBoolean")&&n.uint32(24).bool(e.oldValueBoolean),null!=e.oldValueJson&&Object.hasOwnProperty.call(e,"oldValueJson")&&n.uint32(34).string(e.oldValueJson),null!=e.newValueBoolean&&Object.hasOwnProperty.call(e,"newValueBoolean")&&n.uint32(40).bool(e.newValueBoolean),null!=e.newValueJson&&Object.hasOwnProperty.call(e,"newValueJson")&&n.uint32(50).string(e.newValueJson),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&n.uint32(56).bool(e.wasUndone),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.AttributeOperation;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.range=r.Range.decode(t,t.uint32());break;case 2:o.key=t.string();break;case 3:o.oldValueBoolean=t.bool();break;case 4:o.oldValueJson=t.string();break;case 5:o.newValueBoolean=t.bool();break;case 6:o.newValueJson=t.string();break;case 7:o.wasUndone=t.bool();break;default:t.skipType(7&i)}}return o},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.range&&e.hasOwnProperty("range")){var t=r.Range.verify(e.range);if(t)return"range."+t}return null!=e.key&&e.hasOwnProperty("key")&&!n.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")&&!n.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")&&!n.isString(e.newValueJson)?"newValueJson: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(e){if(e instanceof r.AttributeOperation)return e;var t=new r.AttributeOperation;if(null!=e.range){if("object"!=typeof e.range)throw TypeError(".AttributeOperation.range: object expected");t.range=r.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},s.toObject=function(e,t){t||(t={});var 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=r.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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/AttributeOperation"},s}(),r.InsertOperation=function(){function s(e){if(this.nodes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.position=null,s.prototype.nodes=n.emptyArray,s.prototype.shouldReceiveAttributes=!1,s.prototype.wasUndone=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&r.Position.encode(e.position,n.uint32(10).fork()).ldelim(),null!=e.nodes&&e.nodes.length)for(var s=0;s<e.nodes.length;++s)r.Element.encode(e.nodes[s],n.uint32(18).fork()).ldelim();return null!=e.shouldReceiveAttributes&&Object.hasOwnProperty.call(e,"shouldReceiveAttributes")&&n.uint32(24).bool(e.shouldReceiveAttributes),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&n.uint32(32).bool(e.wasUndone),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.InsertOperation;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.position=r.Position.decode(t,t.uint32());break;case 2:o.nodes&&o.nodes.length||(o.nodes=[]),o.nodes.push(r.Element.decode(t,t.uint32()));break;case 3:o.shouldReceiveAttributes=t.bool();break;case 4:o.wasUndone=t.bool();break;default:t.skipType(7&i)}}return o},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.position&&e.hasOwnProperty("position")&&(n=r.Position.verify(e.position)))return"position."+n;if(null!=e.nodes&&e.hasOwnProperty("nodes")){if(!Array.isArray(e.nodes))return"nodes: array expected";for(var t=0;t<e.nodes.length;++t){var n;if(n=r.Element.verify(e.nodes[t]))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},s.fromObject=function(e){if(e instanceof r.InsertOperation)return e;var t=new r.InsertOperation;if(null!=e.position){if("object"!=typeof e.position)throw TypeError(".InsertOperation.position: object expected");t.position=r.Position.fromObject(e.position)}if(e.nodes){if(!Array.isArray(e.nodes))throw TypeError(".InsertOperation.nodes: array expected");t.nodes=[];for(var n=0;n<e.nodes.length;++n){if("object"!=typeof e.nodes[n])throw TypeError(".InsertOperation.nodes: object expected");t.nodes[n]=r.Element.fromObject(e.nodes[n])}}return null!=e.shouldReceiveAttributes&&(t.shouldReceiveAttributes=Boolean(e.shouldReceiveAttributes)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},s.toObject=function(e,t){t||(t={});var 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=r.Position.toObject(e.position,t)),e.nodes&&e.nodes.length){n.nodes=[];for(var s=0;s<e.nodes.length;++s)n.nodes[s]=r.Element.toObject(e.nodes[s],t)}return null!=e.shouldReceiveAttributes&&e.hasOwnProperty("shouldReceiveAttributes")&&(n.shouldReceiveAttributes=e.shouldReceiveAttributes),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/InsertOperation"},s}(),r.MarkerOperation=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.name="",s.prototype.oldRange=null,s.prototype.newRange=null,s.prototype.affectsData=!1,s.prototype.wasUndone=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&n.uint32(10).string(e.name),null!=e.oldRange&&Object.hasOwnProperty.call(e,"oldRange")&&r.Range.encode(e.oldRange,n.uint32(18).fork()).ldelim(),null!=e.newRange&&Object.hasOwnProperty.call(e,"newRange")&&r.Range.encode(e.newRange,n.uint32(26).fork()).ldelim(),null!=e.affectsData&&Object.hasOwnProperty.call(e,"affectsData")&&n.uint32(32).bool(e.affectsData),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&n.uint32(40).bool(e.wasUndone),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.MarkerOperation;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.name=t.string();break;case 2:o.oldRange=r.Range.decode(t,t.uint32());break;case 3:o.newRange=r.Range.decode(t,t.uint32());break;case 4:o.affectsData=t.bool();break;case 5:o.wasUndone=t.bool();break;default:t.skipType(7&i)}}return o},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!n.isString(e.name))return"name: string expected";var t;if(null!=e.oldRange&&e.hasOwnProperty("oldRange")&&(t=r.Range.verify(e.oldRange)))return"oldRange."+t;if(null!=e.newRange&&e.hasOwnProperty("newRange")&&(t=r.Range.verify(e.newRange)))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},s.fromObject=function(e){if(e instanceof r.MarkerOperation)return e;var t=new r.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=r.Range.fromObject(e.oldRange)}if(null!=e.newRange){if("object"!=typeof e.newRange)throw TypeError(".MarkerOperation.newRange: object expected");t.newRange=r.Range.fromObject(e.newRange)}return null!=e.affectsData&&(t.affectsData=Boolean(e.affectsData)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},s.toObject=function(e,t){t||(t={});var 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=r.Range.toObject(e.oldRange,t)),null!=e.newRange&&e.hasOwnProperty("newRange")&&(n.newRange=r.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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MarkerOperation"},s}(),r.MergeOperation=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.sourcePosition=null,s.prototype.targetPosition=null,s.prototype.graveyardPosition=null,s.prototype.howMany=0,s.prototype.wasUndone=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.sourcePosition&&Object.hasOwnProperty.call(e,"sourcePosition")&&r.Position.encode(e.sourcePosition,n.uint32(10).fork()).ldelim(),null!=e.targetPosition&&Object.hasOwnProperty.call(e,"targetPosition")&&r.Position.encode(e.targetPosition,n.uint32(18).fork()).ldelim(),null!=e.graveyardPosition&&Object.hasOwnProperty.call(e,"graveyardPosition")&&r.Position.encode(e.graveyardPosition,n.uint32(26).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&n.uint32(32).uint32(e.howMany),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&n.uint32(40).bool(e.wasUndone),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.MergeOperation;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.sourcePosition=r.Position.decode(t,t.uint32());break;case 2:o.targetPosition=r.Position.decode(t,t.uint32());break;case 3:o.graveyardPosition=r.Position.decode(t,t.uint32());break;case 4:o.howMany=t.uint32();break;case 5:o.wasUndone=t.bool();break;default:t.skipType(7&i)}}return o},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t;if(null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")&&(t=r.Position.verify(e.sourcePosition)))return"sourcePosition."+t;if(null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(t=r.Position.verify(e.targetPosition)))return"targetPosition."+t;if(null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(t=r.Position.verify(e.graveyardPosition)))return"graveyardPosition."+t;return null!=e.howMany&&e.hasOwnProperty("howMany")&&!n.isInteger(e.howMany)?"howMany: integer expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(e){if(e instanceof r.MergeOperation)return e;var t=new r.MergeOperation;if(null!=e.sourcePosition){if("object"!=typeof e.sourcePosition)throw TypeError(".MergeOperation.sourcePosition: object expected");t.sourcePosition=r.Position.fromObject(e.sourcePosition)}if(null!=e.targetPosition){if("object"!=typeof e.targetPosition)throw TypeError(".MergeOperation.targetPosition: object expected");t.targetPosition=r.Position.fromObject(e.targetPosition)}if(null!=e.graveyardPosition){if("object"!=typeof e.graveyardPosition)throw TypeError(".MergeOperation.graveyardPosition: object expected");t.graveyardPosition=r.Position.fromObject(e.graveyardPosition)}return null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},s.toObject=function(e,t){t||(t={});var 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=r.Position.toObject(e.sourcePosition,t)),null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(n.targetPosition=r.Position.toObject(e.targetPosition,t)),null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=r.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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MergeOperation"},s}(),r.MoveOperation=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.sourcePosition=null,s.prototype.howMany=0,s.prototype.targetPosition=null,s.prototype.wasUndone=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.sourcePosition&&Object.hasOwnProperty.call(e,"sourcePosition")&&r.Position.encode(e.sourcePosition,n.uint32(10).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&n.uint32(16).uint32(e.howMany),null!=e.targetPosition&&Object.hasOwnProperty.call(e,"targetPosition")&&r.Position.encode(e.targetPosition,n.uint32(26).fork()).ldelim(),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&n.uint32(32).bool(e.wasUndone),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.MoveOperation;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.sourcePosition=r.Position.decode(t,t.uint32());break;case 2:o.howMany=t.uint32();break;case 3:o.targetPosition=r.Position.decode(t,t.uint32());break;case 4:o.wasUndone=t.bool();break;default:t.skipType(7&i)}}return o},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t;if(null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")&&(t=r.Position.verify(e.sourcePosition)))return"sourcePosition."+t;if(null!=e.howMany&&e.hasOwnProperty("howMany")&&!n.isInteger(e.howMany))return"howMany: integer expected";if(null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(t=r.Position.verify(e.targetPosition)))return"targetPosition."+t;return null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(e){if(e instanceof r.MoveOperation)return e;var t=new r.MoveOperation;if(null!=e.sourcePosition){if("object"!=typeof e.sourcePosition)throw TypeError(".MoveOperation.sourcePosition: object expected");t.sourcePosition=r.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=r.Position.fromObject(e.targetPosition)}return null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.sourcePosition=null,n.howMany=0,n.targetPosition=null,n.wasUndone=!1),null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")&&(n.sourcePosition=r.Position.toObject(e.sourcePosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(n.targetPosition=r.Position.toObject(e.targetPosition,t)),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MoveOperation"},s}(),r.RenameOperation=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.position=null,s.prototype.oldName="",s.prototype.newName="",s.prototype.wasUndone=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&r.Position.encode(e.position,n.uint32(10).fork()).ldelim(),null!=e.oldName&&Object.hasOwnProperty.call(e,"oldName")&&n.uint32(18).string(e.oldName),null!=e.newName&&Object.hasOwnProperty.call(e,"newName")&&n.uint32(26).string(e.newName),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&n.uint32(32).bool(e.wasUndone),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RenameOperation;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.position=r.Position.decode(t,t.uint32());break;case 2:o.oldName=t.string();break;case 3:o.newName=t.string();break;case 4:o.wasUndone=t.bool();break;default:t.skipType(7&i)}}return o},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.position&&e.hasOwnProperty("position")){var t=r.Position.verify(e.position);if(t)return"position."+t}return null!=e.oldName&&e.hasOwnProperty("oldName")&&!n.isString(e.oldName)?"oldName: string expected":null!=e.newName&&e.hasOwnProperty("newName")&&!n.isString(e.newName)?"newName: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(e){if(e instanceof r.RenameOperation)return e;var t=new r.RenameOperation;if(null!=e.position){if("object"!=typeof e.position)throw TypeError(".RenameOperation.position: object expected");t.position=r.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},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.position=null,n.oldName="",n.newName="",n.wasUndone=!1),null!=e.position&&e.hasOwnProperty("position")&&(n.position=r.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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RenameOperation"},s}(),r.RootAttributeOperation=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.root="",s.prototype.key="",s.prototype.oldValueBoolean=!1,s.prototype.oldValueJson="",s.prototype.newValueBoolean=!1,s.prototype.newValueJson="",s.prototype.wasUndone=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.root&&Object.hasOwnProperty.call(e,"root")&&n.uint32(10).string(e.root),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&n.uint32(18).string(e.key),null!=e.oldValueBoolean&&Object.hasOwnProperty.call(e,"oldValueBoolean")&&n.uint32(24).bool(e.oldValueBoolean),null!=e.oldValueJson&&Object.hasOwnProperty.call(e,"oldValueJson")&&n.uint32(34).string(e.oldValueJson),null!=e.newValueBoolean&&Object.hasOwnProperty.call(e,"newValueBoolean")&&n.uint32(40).bool(e.newValueBoolean),null!=e.newValueJson&&Object.hasOwnProperty.call(e,"newValueJson")&&n.uint32(50).string(e.newValueJson),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&n.uint32(56).bool(e.wasUndone),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RootAttributeOperation;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.root=t.string();break;case 2:o.key=t.string();break;case 3:o.oldValueBoolean=t.bool();break;case 4:o.oldValueJson=t.string();break;case 5:o.newValueBoolean=t.bool();break;case 6:o.newValueJson=t.string();break;case 7:o.wasUndone=t.bool();break;default:t.skipType(7&i)}}return o},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.root&&e.hasOwnProperty("root")&&!n.isString(e.root)?"root: string expected":null!=e.key&&e.hasOwnProperty("key")&&!n.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")&&!n.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")&&!n.isString(e.newValueJson)?"newValueJson: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(e){if(e instanceof r.RootAttributeOperation)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RootAttributeOperation"},s}(),r.RootOperation=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.rootName="",s.prototype.elementName="",s.prototype.isAdd=!1,s.prototype.wasUndone=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.rootName&&Object.hasOwnProperty.call(e,"rootName")&&n.uint32(10).string(e.rootName),null!=e.elementName&&Object.hasOwnProperty.call(e,"elementName")&&n.uint32(18).string(e.elementName),null!=e.isAdd&&Object.hasOwnProperty.call(e,"isAdd")&&n.uint32(24).bool(e.isAdd),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&n.uint32(32).bool(e.wasUndone),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RootOperation;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.rootName=t.string();break;case 2:o.elementName=t.string();break;case 3:o.isAdd=t.bool();break;case 4:o.wasUndone=t.bool();break;default:t.skipType(7&i)}}return o},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.rootName&&e.hasOwnProperty("rootName")&&!n.isString(e.rootName)?"rootName: string expected":null!=e.elementName&&e.hasOwnProperty("elementName")&&!n.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},s.fromObject=function(e){if(e instanceof r.RootOperation)return e;var t=new r.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},s.toObject=function(e,t){t||(t={});var 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},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RootOperation"},s}(),r.SplitOperation=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.splitPosition=null,s.prototype.graveyardPosition=null,s.prototype.howMany=0,s.prototype.insertionPosition=null,s.prototype.wasUndone=!1,s.create=function(e){return new s(e)},s.encode=function(e,n){return n||(n=t.create()),null!=e.splitPosition&&Object.hasOwnProperty.call(e,"splitPosition")&&r.Position.encode(e.splitPosition,n.uint32(10).fork()).ldelim(),null!=e.graveyardPosition&&Object.hasOwnProperty.call(e,"graveyardPosition")&&r.Position.encode(e.graveyardPosition,n.uint32(18).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&n.uint32(24).uint32(e.howMany),null!=e.insertionPosition&&Object.hasOwnProperty.call(e,"insertionPosition")&&r.Position.encode(e.insertionPosition,n.uint32(34).fork()).ldelim(),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&n.uint32(40).bool(e.wasUndone),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.SplitOperation;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.splitPosition=r.Position.decode(t,t.uint32());break;case 2:o.graveyardPosition=r.Position.decode(t,t.uint32());break;case 3:o.howMany=t.uint32();break;case 4:o.insertionPosition=r.Position.decode(t,t.uint32());break;case 5:o.wasUndone=t.bool();break;default:t.skipType(7&i)}}return o},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t;if(null!=e.splitPosition&&e.hasOwnProperty("splitPosition")&&(t=r.Position.verify(e.splitPosition)))return"splitPosition."+t;if(null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(t=r.Position.verify(e.graveyardPosition)))return"graveyardPosition."+t;if(null!=e.howMany&&e.hasOwnProperty("howMany")&&!n.isInteger(e.howMany))return"howMany: integer expected";if(null!=e.insertionPosition&&e.hasOwnProperty("insertionPosition")&&(t=r.Position.verify(e.insertionPosition)))return"insertionPosition."+t;return null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(e){if(e instanceof r.SplitOperation)return e;var t=new r.SplitOperation;if(null!=e.splitPosition){if("object"!=typeof e.splitPosition)throw TypeError(".SplitOperation.splitPosition: object expected");t.splitPosition=r.Position.fromObject(e.splitPosition)}if(null!=e.graveyardPosition){if("object"!=typeof e.graveyardPosition)throw TypeError(".SplitOperation.graveyardPosition: object expected");t.graveyardPosition=r.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=r.Position.fromObject(e.insertionPosition)}return null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},s.toObject=function(e,t){t||(t={});var 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=r.Position.toObject(e.splitPosition,t)),null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=r.Position.toObject(e.graveyardPosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.insertionPosition&&e.hasOwnProperty("insertionPosition")&&(n.insertionPosition=r.Position.toObject(e.insertionPosition,t)),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SplitOperation"},s}(),r.Position=function(){function s(e){if(this.path=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.root="",s.prototype.rootMain=!1,s.prototype.rootGraveyard=!1,s.prototype.path=n.emptyArray,s.prototype.stickiness="",s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.root&&Object.hasOwnProperty.call(e,"root")&&n.uint32(10).string(e.root),null!=e.rootMain&&Object.hasOwnProperty.call(e,"rootMain")&&n.uint32(16).bool(e.rootMain),null!=e.rootGraveyard&&Object.hasOwnProperty.call(e,"rootGraveyard")&&n.uint32(24).bool(e.rootGraveyard),null!=e.path&&e.path.length){n.uint32(34).fork();for(var r=0;r<e.path.length;++r)n.uint32(e.path[r]);n.ldelim()}return null!=e.stickiness&&Object.hasOwnProperty.call(e,"stickiness")&&n.uint32(42).string(e.stickiness),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.Position;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.root=t.string();break;case 2:o.rootMain=t.bool();break;case 3:o.rootGraveyard=t.bool();break;case 4:if(o.path&&o.path.length||(o.path=[]),2==(7&i))for(var a=t.uint32()+t.pos;t.pos<a;)o.path.push(t.uint32());else o.path.push(t.uint32());break;case 5:o.stickiness=t.string();break;default:t.skipType(7&i)}}return o},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.root&&e.hasOwnProperty("root")&&!n.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(var t=0;t<e.path.length;++t)if(!n.isInteger(e.path[t]))return"path: integer[] expected"}return null!=e.stickiness&&e.hasOwnProperty("stickiness")&&!n.isString(e.stickiness)?"stickiness: string expected":null},s.fromObject=function(e){if(e instanceof r.Position)return e;var t=new r.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(var n=0;n<e.path.length;++n)t.path[n]=e.path[n]>>>0}return null!=e.stickiness&&(t.stickiness=String(e.stickiness)),t},s.toObject=function(e,t){t||(t={});var 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(var r=0;r<e.path.length;++r)n.path[r]=e.path[r]}return null!=e.stickiness&&e.hasOwnProperty("stickiness")&&(n.stickiness=e.stickiness),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Position"},s}(),r.Range=function(){function n(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return n.prototype.start=null,n.prototype.end=null,n.create=function(e){return new n(e)},n.encode=function(e,n){return n||(n=t.create()),null!=e.start&&Object.hasOwnProperty.call(e,"start")&&r.Position.encode(e.start,n.uint32(10).fork()).ldelim(),null!=e.end&&Object.hasOwnProperty.call(e,"end")&&r.Position.encode(e.end,n.uint32(18).fork()).ldelim(),n},n.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},n.decode=function(t,n){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.Range;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.start=r.Position.decode(t,t.uint32());break;case 2:o.end=r.Position.decode(t,t.uint32());break;default:t.skipType(7&i)}}return o},n.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},n.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t;if(null!=e.start&&e.hasOwnProperty("start")&&(t=r.Position.verify(e.start)))return"start."+t;if(null!=e.end&&e.hasOwnProperty("end")&&(t=r.Position.verify(e.end)))return"end."+t;return null},n.fromObject=function(e){if(e instanceof r.Range)return e;var t=new r.Range;if(null!=e.start){if("object"!=typeof e.start)throw TypeError(".Range.start: object expected");t.start=r.Position.fromObject(e.start)}if(null!=e.end){if("object"!=typeof e.end)throw TypeError(".Range.end: object expected");t.end=r.Position.fromObject(e.end)}return t},n.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.start=null,n.end=null),null!=e.start&&e.hasOwnProperty("start")&&(n.start=r.Position.toObject(e.start,t)),null!=e.end&&e.hasOwnProperty("end")&&(n.end=r.Position.toObject(e.end,t)),n},n.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},n.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Range"},n}(),r.Element=function(){function s(e){if(this.children=[],this.attributesBoolean={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.name="",s.prototype.children=n.emptyArray,s.prototype.data="",s.prototype.attributesBoolean=n.emptyObject,s.prototype.attributesJson="",s.create=function(e){return new s(e)},s.encode=function(e,n){if(n||(n=t.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&n.uint32(10).string(e.name),null!=e.children&&e.children.length)for(var s=0;s<e.children.length;++s)r.Element.encode(e.children[s],n.uint32(18).fork()).ldelim();if(null!=e.data&&Object.hasOwnProperty.call(e,"data")&&n.uint32(26).string(e.data),null!=e.attributesBoolean&&Object.hasOwnProperty.call(e,"attributesBoolean")){var o=Object.keys(e.attributesBoolean);for(s=0;s<o.length;++s)n.uint32(34).fork().uint32(10).string(o[s]).uint32(16).bool(e.attributesBoolean[o[s]]).ldelim()}return null!=e.attributesJson&&Object.hasOwnProperty.call(e,"attributesJson")&&n.uint32(42).string(e.attributesJson),n},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(t,s){t instanceof e||(t=e.create(t));for(var o,i,a=void 0===s?t.len:t.pos+s,c=new r.Element;t.pos<a;){var d=t.uint32();switch(d>>>3){case 1:c.name=t.string();break;case 2:c.children&&c.children.length||(c.children=[]),c.children.push(r.Element.decode(t,t.uint32()));break;case 3:c.data=t.string();break;case 4:c.attributesBoolean===n.emptyObject&&(c.attributesBoolean={});var u=t.uint32()+t.pos;for(o="",i=!1;t.pos<u;){var l=t.uint32();switch(l>>>3){case 1:o=t.string();break;case 2:i=t.bool();break;default:t.skipType(7&l)}}c.attributesBoolean[o]=i;break;case 5:c.attributesJson=t.string();break;default:t.skipType(7&d)}}return c},s.decodeDelimited=function(t){return t instanceof e||(t=new e(t)),this.decode(t,t.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!n.isString(e.name))return"name: string expected";if(null!=e.children&&e.hasOwnProperty("children")){if(!Array.isArray(e.children))return"children: array expected";for(var t=0;t<e.children.length;++t){var s=r.Element.verify(e.children[t]);if(s)return"children."+s}}if(null!=e.data&&e.hasOwnProperty("data")&&!n.isString(e.data))return"data: string expected";if(null!=e.attributesBoolean&&e.hasOwnProperty("attributesBoolean")){if(!n.isObject(e.attributesBoolean))return"attributesBoolean: object expected";var o=Object.keys(e.attributesBoolean);for(t=0;t<o.length;++t)if("boolean"!=typeof e.attributesBoolean[o[t]])return"attributesBoolean: boolean{k:string} expected"}return null!=e.attributesJson&&e.hasOwnProperty("attributesJson")&&!n.isString(e.attributesJson)?"attributesJson: string expected":null},s.fromObject=function(e){if(e instanceof r.Element)return e;var t=new r.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(var n=0;n<e.children.length;++n){if("object"!=typeof e.children[n])throw TypeError(".Element.children: object expected");t.children[n]=r.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={};var s=Object.keys(e.attributesBoolean);for(n=0;n<s.length;++n)t.attributesBoolean[s[n]]=Boolean(e.attributesBoolean[s[n]])}return null!=e.attributesJson&&(t.attributesJson=String(e.attributesJson)),t},s.toObject=function(e,t){t||(t={});var n,s={};if((t.arrays||t.defaults)&&(s.children=[]),(t.objects||t.defaults)&&(s.attributesBoolean={}),t.defaults&&(s.name="",s.data="",s.attributesJson=""),null!=e.name&&e.hasOwnProperty("name")&&(s.name=e.name),e.children&&e.children.length){s.children=[];for(var o=0;o<e.children.length;++o)s.children[o]=r.Element.toObject(e.children[o],t)}if(null!=e.data&&e.hasOwnProperty("data")&&(s.data=e.data),e.attributesBoolean&&(n=Object.keys(e.attributesBoolean)).length){s.attributesBoolean={};for(o=0;o<n.length;++o)s.attributesBoolean[n[o]]=e.attributesBoolean[n[o]]}return null!=e.attributesJson&&e.hasOwnProperty("attributesJson")&&(s.attributesJson=e.attributesJson),s},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Element"},s}(),r})();class gr{_protobufRoot;constructor(){this._protobufRoot=yr}getDescriptor(e){return new br(this._protobufRoot[e])}}class br{_protobuf;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})}}function Or(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function wr(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Ir="[object RegExp]",vr="[object String]",Sr="[object Number]",kr="[object Boolean]",Pr="[object Arguments]",Ar="[object Symbol]",Tr="[object Date]",_r="[object Map]",Cr="[object Set]",jr="[object Array]",Er="[object ArrayBuffer]",Dr="[object Object]",Rr="[object DataView]",xr="[object Uint8Array]",Nr="[object Uint8ClampedArray]",Vr="[object Uint16Array]",Mr="[object Uint32Array]",Br="[object Int8Array]",Ur="[object Int16Array]",Jr="[object Int32Array]",qr="[object Float32Array]",Gr="[object Float64Array]";function Lr(e,t,n,r=new Map,s=void 0){const o=s?.(e,t,n,r);if(null!=o)return o;if(function(e){return null==e||"object"!=typeof e&&"function"!=typeof e}(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const t=new Array(e.length);r.set(e,t);for(let o=0;o<e.length;o++)t[o]=Lr(e[o],o,n,r,s);return Object.hasOwn(e,"index")&&(t.index=e.index),Object.hasOwn(e,"input")&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){const t=new Map;r.set(e,t);for(const[o,i]of e)t.set(o,Lr(i,o,n,r,s));return t}if(e instanceof Set){const t=new Set;r.set(e,t);for(const o of e)t.add(Lr(o,void 0,n,r,s));return t}if("undefined"!=typeof Buffer&&Buffer.isBuffer(e))return e.subarray();if(function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(e)){const t=new(Object.getPrototypeOf(e).constructor)(e.length);r.set(e,t);for(let o=0;o<e.length;o++)t[o]=Lr(e[o],o,n,r,s);return t}if(e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),Yr(t,e,n,r,s),t}if("undefined"!=typeof File&&e instanceof File){const t=new File([e],e.name,{type:e.type});return r.set(e,t),Yr(t,e,n,r,s),t}if(e instanceof Blob){const t=new Blob([e],{type:e.type});return r.set(e,t),Yr(t,e,n,r,s),t}if(e instanceof Error){const t=new e.constructor;return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,Yr(t,e,n,r,s),t}if("object"==typeof e&&function(e){switch(wr(e)){case Pr:case jr:case Er:case Rr:case kr:case Tr:case qr:case Gr:case Br:case Ur:case Jr:case _r:case Sr:case Dr:case Ir:case Cr:case vr:case Ar:case xr:case Nr:case Vr:case Mr:return!0;default:return!1}}(e)){const t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),Yr(t,e,n,r,s),t}return e}function Yr(e,t,n=e,r,s){const o=[...Object.keys(t),...Or(t)];for(let i=0;i<o.length;i++){const a=o[i],c=Object.getOwnPropertyDescriptor(e,a);(null==c||c.writable)&&(e[a]=Lr(t[a],a,n,r,s))}}function Hr(e,t){return function(e,t){return Lr(e,void 0,e,new Map,t)}(e,(n,r,s,o)=>{const i=t?.(n,r,s,o);if(null!=i)return i;if("object"==typeof e)switch(Object.prototype.toString.call(e)){case Sr:case vr:case kr:{const t=new e.constructor(e?.valueOf());return Yr(t,e),t}case Pr:{const t={};return Yr(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}})}function zr(e){return Hr(e)}function Fr(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t))&&"[object Object]"===Object.prototype.toString.call(e)}function Kr(e,t,n,r,s,o,i){const a=i(e,t,n,r,s,o);if(void 0!==a)return a;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return e===t;case"number":return e===t||Object.is(e,t);case"object":return Wr(e,t,o,i)}return Wr(e,t,o,i)}function Wr(e,t,n,r){if(Object.is(e,t))return!0;let s=wr(e),o=wr(t);if(s===Pr&&(s=Dr),o===Pr&&(o=Dr),s!==o)return!1;switch(s){case vr:return e.toString()===t.toString();case Sr:return function(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}(e.valueOf(),t.valueOf());case kr:case Tr:case Ar:return Object.is(e.valueOf(),t.valueOf());case Ir:return e.source===t.source&&e.flags===t.flags;case"[object Function]":return e===t}const i=(n=n??new Map).get(e),a=n.get(t);if(null!=i&&null!=a)return i===t;n.set(e,t),n.set(t,e);try{switch(s){case _r:if(e.size!==t.size)return!1;for(const[s,o]of e.entries())if(!t.has(s)||!Kr(o,t.get(s),s,e,t,n,r))return!1;return!0;case Cr:{if(e.size!==t.size)return!1;const s=Array.from(e.values()),o=Array.from(t.values());for(let i=0;i<s.length;i++){const a=s[i],c=o.findIndex(s=>Kr(a,s,void 0,e,t,n,r));if(-1===c)return!1;o.splice(c,1)}return!0}case jr:case xr:case Nr:case Vr:case Mr:case"[object BigUint64Array]":case Br:case Ur:case Jr:case"[object BigInt64Array]":case qr:case Gr:if("undefined"!=typeof Buffer&&Buffer.isBuffer(e)!==Buffer.isBuffer(t))return!1;if(e.length!==t.length)return!1;for(let s=0;s<e.length;s++)if(!Kr(e[s],t[s],s,e,t,n,r))return!1;return!0;case Er:return e.byteLength===t.byteLength&&Wr(new Uint8Array(e),new Uint8Array(t),n,r);case Rr:return e.byteLength===t.byteLength&&e.byteOffset===t.byteOffset&&Wr(new Uint8Array(e),new Uint8Array(t),n,r);case"[object Error]":return e.name===t.name&&e.message===t.message;case Dr:{if(!(Wr(e.constructor,t.constructor,n,r)||Fr(e)&&Fr(t)))return!1;const s=[...Object.keys(e),...Or(e)],o=[...Object.keys(t),...Or(t)];if(s.length!==o.length)return!1;for(let o=0;o<s.length;o++){const i=s[o],a=e[i];if(!Object.hasOwn(t,i))return!1;if(!Kr(a,t[i],i,e,t,n,r))return!1}return!0}default:return!1}}finally{n.delete(e),n.delete(t)}}function Qr(){}function Zr(e,t){return function(e,t,n){return Kr(e,t,void 0,void 0,void 0,void 0,n)}(e,t,Qr)}function Xr(e){return null!==e&&("object"==typeof e||"function"==typeof e)}function $r(e,t){const n=zr(e);return n.path[n.path.length-1]+=t,n}function es(e,t){return e.root===t.root&&Zr(e.path,t.path)}function ts(e){rs(e,e=>("main"==e.root?(e.rootMain=!0,delete e.root):"$graveyard"==e.root&&(e.rootGraveyard=!0,delete e.root),e))}function ns(e){rs(e,e=>(e.rootMain?(e.root="main",delete e.rootMain):e.rootGraveyard&&(e.root="$graveyard",delete e.rootGraveyard),e))}function rs(e,t){for(const n in e){const r=e[n];"nodes"!==n&&Xr(r)&&(r.path&&(r.root||r.rootMain||r.rootGraveyard)?e[n]=t(r):rs(r,t))}return e}class ss{_id;_operationName;_protobufDescriptor;constructor(e,t,n){this._id=e,this._operationName=t,this._protobufDescriptor=n}compress(e,t){const n=t.shift();return ts(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());ns(n),n.__className=this._operationName,e.push(n)}}class os extends ss{compress(e,t){const n=t.shift();return this._serializeOneOf("oldValue",n),this._serializeOneOf("newValue",n),ts(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),ns(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 is extends ss{compress(e,t){const n=t.shift();return this._serializeNodesAttributes(n.nodes),ts(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),ns(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 as extends ss{decompress(e,t){super.decompress(e,t);const n=e[e.length-1];n.oldRange||(n.oldRange=null),n.newRange||(n.newRange=null)}}class cs extends ss{compress(e,t){return t.shift(),e.types.push(this._id),!0}decompress(e,t){t.types.shift(),e.push({__className:this._operationName})}}class ds extends as{_omittedNamespace;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 us{_id;_context;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=zr(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 ls extends us{_combineNext(e,t){return t.nodes[0].data+=e.nodes[0].data,t}_splitCurrent(e){const t=zr(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=$r(e.position,o),t}_compareOperations(e,t){if(this._checkOperation(e)&&this._checkOperation(t)){const n=e.nodes[0].data.length,r=es($r(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 ps extends us{_combineNext(e,t){return t.howMany++,t.sourcePosition=zr(e.sourcePosition),t}_splitCurrent(e){const t=zr(e);return e.howMany--,t.howMany=1,t.sourcePosition=$r(t.sourcePosition,e.howMany),t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(es($r(e.sourcePosition,-1),t.sourcePosition)&&es(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 hs extends us{_combineNext(e,t){return t.howMany++,t}_splitCurrent(e){const t=zr(e);return t.howMany=1,e.howMany--,t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(es(e.sourcePosition,t.sourcePosition)&&es(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 fs extends us{compress(e,t){if(!this._compareOperations(t[0],t[1]))return!1;const n=t.shift();return n.oldRange=null,n.newRange&&es(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=zr(n.newRange.start));const r=zr(n);r.newRange&&(r.newRange.start.stickiness="toNone",r.newRange.end=zr(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 ms{_compressorById;_compressorByName;_protobufFactory;constructor(){this._compressorById=new Map,this._compressorByName=new Map,this._protobufFactory=new gr;const e=this._protobufFactory.getDescriptor("MarkerOperation");this._registerCompressor(1,"NoOperation",new cs(1,"NoOperation",void 0)),this._registerOperationCompressor(10,"AttributeOperation",os),this._registerOperationCompressor(11,"InsertOperation",is),this._registerOperationCompressor(12,"MarkerOperation",as),this._registerOperationCompressor(13,"MergeOperation",ss),this._registerOperationCompressor(14,"MoveOperation",ss),this._registerOperationCompressor(15,"RenameOperation",ss),this._registerOperationCompressor(16,"RootAttributeOperation",os),this._registerOperationCompressor(17,"SplitOperation",ss),this._registerCompressor(18,"CommentMarkerOperation",new ds(18,"MarkerOperation",e,"comment")),this._registerCompressor(19,"SuggestionMarkerOperation",new ds(19,"MarkerOperation",e,"suggestion")),this._registerOperationCompressor(20,"RootOperation",ss),this._registerActionCompressor(100,"TypingAction",ls),this._registerActionCompressor(101,"DeletingAction",ps),this._registerActionCompressor(102,"ForwardDeletingAction",hs),this._registerActionCompressor(103,"UserSelectionAction",fs)}compress(e){if(!e||!e[0])throw new n.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;){const r=this._compressorById.get(e.types[0]);if(!r)throw new n.CKEditorError("decompress-compressor-not-found",this,{type:e.types[0]});r.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)}}const ys=vs;!function(e){const t=vs,n=e();for(;;)try{if(817987===-parseInt(t(537))/1*(parseInt(t(396))/2)+parseInt(t(469))/3+parseInt(t(369))/4*(parseInt(t(404))/5)+-parseInt(t(424))/6*(-parseInt(t(571))/7)+parseInt(t(399))/8*(-parseInt(t(497))/9)+parseInt(t(552))/10*(-parseInt(t(488))/11)+parseInt(t(567))/12*(parseInt(t(443))/13))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Is);let gs=1;class bs extends t.Plugin{static[ys(549)]=(()=>wn)();[ys(560)];[ys(358)];[ys(575)];[ys(506)];[ys(470)];[ys(359)];[ys(410)];[ys(422)];[ys(548)];[ys(495)];[ys(346)];[ys(465)];[ys(460)];[ys(446)];[ys(526)];[ys(360)];[ys(493)];[ys(543)];static get[ys(546)](){return[zn,Qn,lr,t.PendingActions,Fn.Users,r.Notification]}static get[ys(597)](){return ys(533)}static get[ys(555)](){return!0}static get[ys(355)](){return!0}get[ys(544)](){const e=ys;return this[e(382)]+this[e(560)]}get[ys(382)](){const e=ys;return this[e(575)][e(491)]-this[e(560)]}get[ys(426)](){const e=ys,t=this[e(575)][e(504)]();for(let n=t[e(487)]-1;n>=0;n--){const r=t[n];if(!this[e(493)][e(474)](r))return r[e(511)]+1-this[e(560)]}return 0}constructor(e){const t=ys;if(super(e),this[t(560)]=0,this[t(358)]=null,this[t(575)]=new s.History,this[t(442)][t(348)][t(380)](t(405),{}),this[t(506)]=this[t(442)][t(348)][t(452)](t(450)),!this[t(506)])throw new n.CKEditorError(t(441),this);const r=e[t(348)][t(452)](t(468))||n.version;this[t(470)]=new(bs[t(549)])(r,this[t(506)]),this[t(359)]=this[t(442)][t(494)][t(509)],this[t(410)]=new ms,this[t(422)]=[],this[t(548)]=new WeakSet,this[t(495)]=new Set,this[t(367)](t(439),!1),this[t(367)](t(508),!1),this[t(346)]=null,this[t(465)]=!1,this[t(460)]=null,this[t(446)]=300,this[t(526)]=this[t(446)],this[t(360)]=null,this[t(493)]=new WeakSet,this[t(543)]=new Ss(this[t(493)])}[ys(530)](){const e=ys,t=this[e(442)],n=t[e(344)][e(452)](Fn.Users),r=t[e(344)][e(452)](zn);this[e(476)](n,e(457),(t,r)=>{const s=e,o=r[0];o[s(528)]&&(t[s(390)]=n[s(602)](o[s(528)]),t[s(481)]()),null===o[s(528)]&&(t[s(390)]=null,t[s(481)]())},{priority:e(409)}),this[e(476)](t[e(494)][e(509)][e(373)],e(585),(t,n)=>{const r=e;n[r(343)]&&this[r(478)]()}),this[e(476)](t[e(397)][e(525)],e(463),()=>{this[e(478)]()}),this[e(601)](),t[e(494)].on(e(581),(t,n)=>{const r=e,s=n[0];s[r(538)]&&(this[r(454)](s),this[r(381)]()&&this[r(577)]())}),this[e(471)](),this[e(576)](e(556)).to(r,e(516),this,e(508),(t,n)=>e(569)===t&&!n),this.on(e(573),()=>{const n=e;this[n(556)]?t[n(445)](n(458)):t[n(563)](n(458))}),this[e(556)]?t[e(445)](e(458)):t[e(563)](e(458)),this[e(367)](e(353),!1)}async[ys(519)](){const e=ys,t=this[e(442)][e(344)][e(452)](Qn),n=this[e(442)][e(344)][e(452)](zn);try{this[e(439)]=!0,t[e(407)](this[e(506)]);const r=await this[e(470)][e(519)](n[e(582)],this[e(426)]);await this[e(535)](r)&&(this[e(439)]=!1,this[e(517)]());const s=await this[e(470)][e(531)]();t[e(371)](this[e(506)],s),this[e(554)](),this[e(353)]=!0}catch(t){if(function(t){const n=e;return n(489)===t[n(398)]}(t)&&this[e(358)])await this[e(532)]();else if(function(t){const n=e;return n(435)===t[n(398)]}(t)){const t=mr(this[e(442)][e(558)],e(374));this[e(362)](t)}else{if(!(t instanceof Os))throw t;this[e(362)]()}}}[ys(539)](){const e=ys,t=this[e(442)][e(344)][e(452)](zn),n=this[e(442)][e(344)][e(452)](Qn);this[e(442)][e(563)](e(415)),n[e(559)][e(474)](this[e(506)])&&n[e(407)](this[e(506)]),t[e(361)](this),this[e(550)](),super[e(539)]()}async[ys(535)](e){const t=ys;if(this[t(358)]!==e[t(358)]&&this[t(360)]!==e[t(570)])throw new Os;return this[t(358)]=e[t(358)],this[t(400)]([],{...e,wereChangesApplied:!1,data:e[t(564)]},t(519))}async[ys(484)](e,t=!1){const n=ys,{connection:r}=this[n(442)][n(344)][n(452)](zn);bs[n(549)][n(531)](r,this[n(506)])[n(568)](e=>this[n(448)](e))[n(431)](e=>{const t=n;this[t(593)](t(420),e)}),this[n(476)](this[n(470)],n(402),this[n(490)][n(576)](this)),this[n(476)](this[n(470)],n(366),(e,t)=>{const r=n;this[r(593)](r(605),t)}),this[n(476)](this[n(470)],n(408),()=>{this[n(353)]=!1});const s=this[n(543)][n(391)](e);this[n(439)]=!0;const o=await this[n(470)][n(356)](r,this[n(574)](e),s);if(this[n(358)]=o[n(358)],t){if(!o[n(425)])return void this[n(362)]();this[n(439)]=!1,this[n(517)](),this[n(575)][n(521)](),this[n(560)]=o[n(392)],this[n(575)][n(491)]=this[n(560)],await this[n(400)](e,o,n(541))}else await this[n(423)](o,e);this[n(554)](),this[n(353)]=!0}[ys(554)](){const e=ys,t=this[e(442)][e(344)][e(452)](Qn),n=this[e(442)][e(344)][e(452)](lr),r=t[e(559)][e(452)](this[e(506)]);r&&r[e(487)]>1?n[e(472)]():this[e(476)](t,e(492)+this[e(506)],()=>{const r=e;2===t[r(559)][r(452)](this[r(506)])[r(487)]&&n[r(472)]()})}async[ys(490)](e,t,n,r){const s=ys;if(!this[s(439)]&&this[s(359)][s(491)]==t){const e=this[s(352)](n,r);await this[s(553)](e),this[s(510)](e,t,n[s(570)])||this[s(593)](s(385))}}async[ys(532)](){const e=ys;this[e(550)]();const{locale:t}=this[e(442)];let n;try{n=await this[e(470)][e(414)]()}catch{const n=mr(t,e(455));return void this[e(362)](n)}const r=n[e(357)]||n[e(578)];if(this[e(360)]!==r[e(570)]){const n=mr(t,e(589));return void this[e(362)](n)}await this[e(484)](this[e(442)][e(494)][e(509)][e(345)][e(504)](),!0)}[ys(550)](){const e=ys;this[e(470)][e(419)](),this[e(422)]=[],clearTimeout(this[e(460)]),this[e(351)](this[e(470)])}[ys(448)](e){const t=ys,n=this[t(442)][t(344)][t(452)](Qn);this[t(476)](n,t(492)+this[t(506)],(e,{session:r})=>{const s=t;if(r.id===n[s(604)]){e[s(430)]();const t=this[s(442)][s(344)][s(474)](s(499))&&this[s(442)][s(344)][s(452)](s(499));let n=r[s(394)];t&&t[s(513)]&&(n=n[s(551)](e=>s(502)!==e)),this[s(442)][s(344)][s(452)](s(586))[s(583)](n,this[s(506)])}}),n[t(371)](this[t(506)],e)}[ys(601)](){const e=ys,t=this[e(442)][e(564)][e(367)];this[e(442)][e(564)][e(367)]=(...r)=>{const s=e;if(!r[r[s(487)]-1][s(440)])throw new n.CKEditorError(s(475),this);t[s(379)](this[s(442)][s(564)],r)}}[ys(471)](){const e=ys;this[e(442)][e(564)].on(e(530),(t,[r])=>{const o=e;if(this[o(359)][o(491)])throw new n.CKEditorError(o(603),this);t[o(481)](),this[o(461)]();const i=this[o(442)][o(348)][o(452)](o(395)),a=this[o(534)](r,i);0==a[o(487)]&&a[o(588)](new s.NoOperation(0)),t[o(390)]=this[o(484)](a)[o(568)](()=>{const e=o;this[e(442)][e(344)][e(452)](zn)[e(480)](this),this[e(442)][e(564)][e(349)](e(384))})[o(431)](e=>this[o(593)](o(437),e))[o(411)](()=>this[o(517)]())},{priority:e(409)}),this[e(442)].on(e(520),async(t,[n,r])=>{const s=e;t[s(481)]();const o=this[s(442)][s(494)][s(509)][s(500)](n);if(!this[s(495)][s(474)](n)){const e=r&&r[s(564)]?r[s(564)]:"",t=r&&r[s(485)]?r[s(485)]:{};await this[s(584)](n,e,t)}this[s(442)][s(494)][s(507)]({isUndoable:!1},()=>{const e=s;o[e(401)]=!0,this[e(442)][e(494)][e(509)][e(388)][e(579)](o)})},{priority:e(409)})}async[ys(553)](e){const t=ys,n=this[t(442)][t(344)][t(452)](Fn.Users),{connection:r}=this[t(442)][t(344)][t(452)](zn),s=new Set;for(const r of e){const e=r[t(528)];e&&!n[t(602)](e)&&s[t(444)](e)}if(0===s[t(561)])return;const o=await b[t(600)](r,Array[t(354)](s));for(const e of o)n[t(602)](e.id)||n[t(406)](e)}[ys(534)](e,t={}){const r=ys,o=this[r(442)][r(494)],i=[];let a=0;const c=r(595)==typeof e?{main:e}:e;for(const e of Object[r(350)](c)){if(!this[r(359)][r(436)][r(474)](e))throw new n.CKEditorError(r(529),this);const t=this[r(442)][r(564)][r(438)](c[e]),d=this[r(359)][r(500)](e),u=new s.InsertOperation(o[r(368)](d,0),t,a++);i[r(588)](u);for(const[e,n]of t[r(363)]){const t=o[r(413)](o[r(370)](d,n[r(505)][r(389)][r(545)]()),o[r(370)](d,n[r(432)][r(389)][r(545)]())),c=new s.MarkerOperation(e,null,t,o[r(363)],!0,a++);i[r(588)](c)}}if(t)for(const[e,c]of Object[r(433)](t)){const t=o[r(509)][r(500)](e);if(!t)throw new n.CKEditorError(r(524),null);for(const[e,n]of Object[r(433)](c))if(null!==n){const o=new s.RootAttributeOperation(t,e,null,n,a++);i[r(588)](o)}}return i}async[ys(584)](e,t,n){const r=ys;this[r(534)]({[e]:t},{[e]:n})[r(522)]((e,t)=>{const n=r;e[n(511)]=this[n(359)][n(491)]+t,e[n(456)]=!0,this[n(454)](e)}),this[r(577)](),await this[r(501)]()}async[ys(423)](e,t){const n=ys;let r;this[n(560)]=e[n(392)];const s=e[n(425)]&&!e[n(482)],o=s?0:e[n(564)][n(511)];if(t[n(522)](t=>{const r=n;t[r(456)]=!0,t[r(453)]=e[r(566)],t[r(528)]=null}),s)r=t,this[n(599)](r,s);else{if(e[n(482)]){const t=this[n(534)](e[n(482)]);this[n(359)][n(345)][n(491)]=-t[n(487)],t[n(522)](r=>{const s=n;r[s(511)]-=t[s(487)],r[s(453)]=e[s(566)],r[s(456)]=!0,r[s(528)]=null}),this[n(599)](t,!0),this[n(575)][n(491)]=-t[n(487)]+this[n(560)],this[n(486)](t)}this[n(359)][n(345)][n(491)]=o,r=this[n(352)](e[n(564)],e[n(562)]),await this[n(553)](r),this[n(599)](r,s)}e[n(570)]&&(this[n(543)][n(498)](r,e[n(570)]),this[n(360)]=e[n(570)]),this[n(575)][n(491)]=o+this[n(560)],this[n(486)](r),t[n(551)](e=>{const t=n,r=this[t(459)](e);return r&&!this[t(495)][t(474)](r)})[n(522)]((e,t)=>{const r=n;e[r(511)]=this[r(359)][r(491)]+t,this[r(454)](e)}),this[n(381)]()?(this[n(526)]=0,this[n(577)](!0),await this[n(501)]()):(this[n(439)]=!1,this[n(517)]())}[ys(593)](e,t){const r=ys,s=t&&t[r(483)];if(s&&s[r(467)](r(596)))throw t;const o=this[r(442)][r(344)][r(452)](zn);throw this[r(439)]=!0,o[r(419)](),this[r(442)][r(563)](r(418)),new n.CKEditorError(e,this[r(442)],s?{originalError:s}:void 0)}[ys(454)](e){const t=ys;this[t(548)][t(474)](e)||(this[t(548)][t(444)](e),this[t(422)][t(588)](e),this[t(346)]||t(403)==e[t(547)]&&!e[t(429)]||this[t(461)]())}[ys(577)](e=!1){const t=ys;!e&&this[t(439)]||(this[t(439)]=!0,clearTimeout(this[t(460)]),this[t(460)]=setTimeout(()=>{const e=t;this[e(447)]()[e(568)](t=>{const n=e;t&&(this[n(517)](),this[n(439)]=!1)})[e(431)](t=>{const n=e;this[n(517)](),this[n(439)]=!1,function(e){const t=n;return e[t(483)][t(467)](t(383))||e[t(483)][t(467)](t(542))||e[t(483)][t(467)](t(598))}(t)||this[n(593)](t[n(483)],t)})},this[t(526)]))}[ys(501)](){return new Promise(e=>{const t=vs;this.on(t(594),()=>{e()})})}async[ys(447)](){const e=ys,t=this[e(442)][e(344)][e(452)](lr);if(this[e(557)]()&&(t[e(472)](),this[e(465)]=!1),!this[e(381)]())return!0;const n=[...this[e(422)]];for(const t of n)t[e(523)]=this[e(359)][e(345)][e(375)](t);const r=this[e(543)][e(391)](n),s=gs++,o=this[e(574)](n),i=await this[e(470)][e(421)](o,o[e(511)],r);try{return await this[e(400)](n,i,s)}catch(t){return this[e(593)](e(428),t)}}async[ys(400)](e,t,n){const r=ys;if(r(366)in t)throw t[r(366)];let s=!1;if(t[r(425)]){t[r(570)]&&(this[r(360)]=t[r(570)]),this[r(422)]=this[r(422)][r(551)](t=>!e[r(540)](t));for(const n of e)n[r(453)]=r(515)in t&&t[r(515)]||void 0;ws(e,t[r(491)]-e[r(487)]),this[r(486)](e);const n=e[r(551)](e=>{const t=r;if(!e[t(456)])return!1;const n=this[t(459)](e);return n&&!this[t(495)][t(474)](n)});ws(n,this[r(359)][r(491)]),this[r(599)](n),s=!0,this[r(526)]=this[r(446)]}else{const e=this[r(352)](t[r(564)],t[r(562)])[r(551)](e=>e[r(511)]>=this[r(382)]);e[r(522)](e=>this[r(514)](e)),this[r(422)]=this[r(422)][r(551)](e=>!e[r(456)]||!this[r(495)][r(474)](this[r(459)](e))),this[r(422)][r(487)]&&ws(this[r(422)],this[r(422)][0][r(511)]),await this[r(553)](e),s=this[r(510)](e,t[r(491)],t[r(570)]),this[r(526)]=Math[r(364)](this[r(526)]/2)}return s?!this[r(381)]()||(this[r(577)](!0),!1):this[r(593)](r(496))}[ys(510)](e,t,n){const r=ys;try{const o={document:this[r(359)],useRelations:!1,padWithNoOps:!0},{operationsA:i,operationsB:a,originalOperations:c}=(0,s.transformOperationSets)(e,this[r(422)],o);ws(i,this[r(359)][r(491)]),ws(a,t);for(const e of i){const t=c[r(452)](e);e[r(528)]=t?t[r(528)]:null}n&&(this[r(543)][r(498)](e,n),this[r(360)]=n),this[r(422)]=[...a],this[r(599)](i),this[r(486)](e)}catch(e){return console[r(366)](e),!1}return!0}[ys(599)](e,t=!1){const n=ys;this[n(442)][n(494)][n(507)]({isUndoable:!1,isLocal:!1},t=>{const r=n;for(const n of e)this[r(548)][r(444)](n),this[r(514)](n),t[r(587)][r(412)](n),this[r(442)][r(494)][r(581)](n)})}[ys(514)](e){const t=ys,n=this[t(459)](e);n&&this[t(495)][t(444)](n)}[ys(459)](e){const t=ys;let n,r;switch(e[t(547)]){case t(417):n=e[t(518)][t(473)];break;case t(403):if(r=e[t(591)],!r)return null;n=r[t(473)];break;case t(536):n=e[t(473)];break;case t(376):n=e[t(378)];break;case t(592):n=e[t(607)][t(473)];break;default:return null}return n[t(466)]}[ys(486)](e){const t=ys;e[t(522)](e=>{const n=t,r=e[n(606)]();r[n(528)]=e[n(528)],r[n(456)]=!!e[n(456)],r[n(453)]=e[n(453)],r[n(511)]+=this[n(560)],e[n(365)]&&this[n(493)][n(444)](r),this[n(575)][n(412)](r)})}[ys(362)](e){const t=ys,n=this[t(442)][t(344)][t(452)](t(503)),r=this[t(442)][t(558)];e||(e=mr(r,t(512))),n[t(386)](e,{title:mr(r,t(372)),namespace:t(377)}),this[t(508)]=!0,clearTimeout(this[t(460)]),this[t(422)]=[],this[t(442)][t(344)][t(452)](zn)[t(419)]()}[ys(461)](){const e=ys;this[e(346)]||(this[e(346)]=this[e(442)][e(344)][e(452)](t.PendingActions)[e(444)](mr(this[e(442)][e(558)],e(479))))}[ys(517)](){const e=ys;this[e(346)]&&(this[e(442)][e(344)][e(452)](t.PendingActions)[e(434)](this[e(346)]),this[e(346)]=null)}[ys(574)](e){const t=ys,n=e[t(477)](e=>e[t(565)]());return this[t(410)][t(427)](n)}[ys(352)](e,t){const n=ys;return this[n(410)][n(393)](e)[n(477)]((e,r)=>{const o=n,i=o(530)==t[r][o(547)];if(o(527)==e[o(416)]){const t=e[o(518)][o(473)];!this[o(359)][o(500)](t)&&(this[o(359)][o(464)](o(572),t)[o(347)]=!1)}const a=s.OperationFactory[o(449)](e,this[o(359)]);return a[o(523)]=e[o(523)],a[o(456)]=i,a[o(528)]=i?null:t[r][o(451)],a[o(365)]=o(590)===t[r][o(547)],a[o(453)]=t[r][o(453)],a})}[ys(478)](){const e=ys;this[e(465)]=!0,this[e(557)]()?this[e(577)]():this[e(465)]=!1}[ys(557)](){const e=ys,t=this[e(442)][e(344)][e(452)](Qn)[e(559)][e(452)](this[e(506)]);return!this[e(442)][e(387)]&&!!t&&t[e(487)]>1&&this[e(465)]}[ys(381)](){const e=ys;return this[e(422)][e(487)]>0||this[e(557)]()}}class Os extends Error{}function ws(e,t){const n=ys;for(const r of e)r[n(511)]=t++}function Is(){const e=["stopListening","_decompressOperations","_isConnected","from","isPremiumPlugin","connect","currentDocumentSession","sessionId","_document","_lastSyncedOperationId","removeFromReconnectionStack","_handleReconnectionError","markers","round","_isDisconnection","error","set","createPositionAt","4GMFrmU","createPositionFromPath","register","Synchronization issue","selection","The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.","isUndoneOperation","addRoot","real-time-collaboration","affectedSelectable","apply","define","_shouldSendUpdate","_lastServerVersion","cloud-services-internal-error: Not connected.","ready","realtimecollaborationclient-init-service-incorrect-server-operation","showWarning","isReadOnly","differ","path","return","getIdOfTheLastOperation","offset","decompress","permissions","rootsAttributes","4LEZASU","editing","code","280gBmRGl","_handleServerResponse","_isLoaded","operationsReceived","marker","6657190ZhkSvD","collaboration","addUser","unregister","disconnected","high","_compressor","finally","addOperation","createRange","getDocumentDetails","rtc-destroyed","__className","insert","realtimecollaborationclient-error","disconnect","realtimecollaborationclient-init-session-connection-error","sendOperations","_bufferedOperations","_handleInitialConnectionData","4011804ySLodC","wereChangesApplied","lastSyncVersion","compress","realtimecollaborationclient-sendbufferedoperations","affectsData","off","catch","end","entries","remove","409","roots","realtimecollaborationclient-init-connection-failed","parse","_isPendingUpdate","suppressErrorInCollaboration","collaboration-missing-channelid","editor","13733707EdaZqA","add","disableReadOnlyMode","_baseBufferDelay","_sendBufferedOperations","_initSessionsHandling","fromJSON","collaboration.channelId","userId","get","createdAt","_saveOperationInBuffer","The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.","_isInit","getOperationAuthor","rtc-offline","_getAffectedRoot","_sendBufferedOperationsDelayId","_setPendingAction","_operationToId","change:hasDomSelection","createRoot","_hasSelectionChanged","rootName","startsWith","cloudServices.bundleVersion","3160053QGBlwm","_service","_setUpDataInit","createUserMarkerOperations","root","has","realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration","listenTo","map","_refreshUserSelectionMarkers","PENDING_ACTION_SENDING_DATA","addToReconnectionStack","stop","initData","message","_connectService","attributes","_updateServerHistory","length","15861890CniXny","404","_handleReceivedOperations","version","sessionAdd:","_disconnectionOperations","model","_knownRootNames","realtimecollaborationclient-handleserverresponse","102411gzyEYI","setIdForTheLastOperation","CommentsOnly","getRoot","_waitUntilSynced","document:write","Notification","getOperations","start","_channelId","enqueueChange","_hasSynchronizationProblem","document","_handleExternalOperations","baseVersion","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.","isEnabled","_addKnownRoot","lastOperationAcceptedAt","state","_clearPendingAction","position","reconnect","loadRoot","reset","forEach","wasUndone","multi-root-editor-root-attributes-no-root","view","_currentBufferDelay","InsertOperation","_authorId","realtimecollaborationclient-init-non-existent-root","init","getConnectedSessions","_connectAfterSessionHasBeenFlushed","RealTimeCollaborationClient","_getOperationsFromInitData","_handleReconnectionResponse","addRootAttribute","725810qwuyNf","isDocumentOperation","destroy","includes","reconnection: flushed session","cloud-services-internal-error: Collaborative Editing Service is not connected.","_operationIdentifier","cloudDocumentVersion","slice","requires","type","_knownOperations","CollaborativeEditingService","_disconnectService","filter","10HLGAsp","_fetchMissingUsers","_handleSendingSelectionMarkers","isOfficialPlugin","_isEditingAllowed","_shouldSendSelectionUpdate","locale","channelSessions","_offset","size","metadata","enableReadOnlyMode","data","toJSON","sessionCreatedAt","12ilZgOX","then","connected","lastOperationId","7TPEYgF","$root","change:_isEditingAllowed","_compressOperations","serverHistory","bind","_sendBufferedOperationsDelayed","lastDocumentSession","_bufferRootLoad","_ignoredOperations","applyOperation","connection","setPermissions","_loadRoot","change:range","Permissions","batch","push","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.","cs:removeUser","newRange","move","_crash","change:_isPendingUpdate","string","realtimecollaborationclient","pluginName","cloud-services-internal-error: Request timeout.","_applyOperationsSet","getMany","_initThrowingOnDataSet","getUser","realtimecollaborationclient-init-document-already-initialized","mySessionId","realtimecollaborationclient-init-service-internal-error","clone","targetPosition","directChange","plugins","history","_pendingAction","_isAttached","config","fire","keys"];return(Is=function(){return e})()}function vs(e,t){const n=Is();return(vs=function(e,t){return n[e-=343]})(e,t)}class Ss{[ys(580)];[ys(462)];constructor(e){const t=ys;this[t(580)]=e,this[t(462)]=new WeakMap}[ys(391)](e){const t=ys;let r=e[t(487)];for(;r--;){const s=e[r];if(!this[t(580)][t(474)](s)){if(!this[t(462)][t(474)](s)){const e=(0,n.uid)()[t(545)](1,18);this[t(462)][t(367)](s,e)}return this[t(462)][t(452)](s)}}}[ys(498)](e,t){const n=ys;if(!t)return;let r=e[n(487)];for(;r--;){const s=e[r];this[n(580)][n(474)](s)||this[n(462)][n(367)](s,t)}}}function ks(){var e=["375625LLencZ","3678GnfkND","18aqiZSa","33480xTPWor","RealTimeCollaborativeEditing","3577XcthRi","526510uHnmhZ","836216cNhRMV","1636782ZVBCxu","15PPrpEt","pluginName","requires","isPremiumPlugin","isOfficialPlugin","286488ScmJQi"];return(ks=function(){return e})()}var Ps=As;function As(e,t){var n=ks();return(As=function(e,t){return n[e-=116]})(e,t)}!function(e){for(var t=As,n=e();;)try{if(277125===-parseInt(t(117))/1*(-parseInt(t(126))/2)+parseInt(t(116))/3+-parseInt(t(122))/4+parseInt(t(123))/5+parseInt(t(124))/6*(-parseInt(t(128))/7)+-parseInt(t(130))/8+parseInt(t(125))/9*(-parseInt(t(129))/10))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(ks);class Ts extends t.Plugin{static get[Ps(119)](){return[bs]}static get[Ps(118)](){return Ps(127)}static get[Ps(121)](){return!0}static get[Ps(120)](){return!0}}const _s=Cs;function Cs(e,t){const n=Es();return(Cs=function(e,t){return n[e-=480]})(e,t)}!function(e){const t=Cs,n=e();for(;;)try{if(659024===-parseInt(t(557))/1*(-parseInt(t(493))/2)+-parseInt(t(515))/3+-parseInt(t(575))/4*(parseInt(t(534))/5)+parseInt(t(548))/6+parseInt(t(514))/7+-parseInt(t(563))/8+-parseInt(t(562))/9)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Es);class js extends t.ContextPlugin{static[_s(533)]=(()=>Gn)();[_s(546)];static get[_s(523)](){return[zn,_s(485),Qn,Fn.Users]}static get[_s(558)](){return _s(521)}static get[_s(540)](){return!0}static get[_s(552)](){return!0}constructor(e){const t=_s;super(e),this[t(546)]=new Map}async[_s(494)](){const e=_s,n=this[e(555)],r=n[e(509)][e(484)](e(485));if(n[e(509)][e(484)](zn)[e(481)](this),r[e(490)]={addCommentThread:async({channelId:t,threadId:n,comments:r,resolvedAt:s,resolvedBy:o,context:i,attributes:a})=>{const c=e,d=await this[c(539)](t)[c(561)]({commentThreadId:n,comments:r[c(517)](e=>function(e,t,n){const r=c;return{commentThreadId:n,commentId:e[r(554)],userId:e[r(518)],content:e[r(576)],documentId:t,createdAt:e[r(537)],attributes:e[r(543)]||{}}}(e,t,n)),resolvedAt:s,resolvedBy:o,context:i,attributes:a})[c(506)](Rs);return{threadId:d[c(578)],comments:d[c(524)]}},getCommentThread:async({channelId:t,threadId:n})=>{const r=e,s=await this[r(539)](t)[r(526)](n)[r(506)](Rs);return s[r(503)]?null:(await this[r(519)]([s]),{threadId:s[r(578)],comments:s[r(524)][r(517)](xs),context:s[r(555)],resolvedAt:s[r(560)],resolvedBy:s[r(569)],attributes:s[r(543)]||{}})},updateCommentThread:async({channelId:t,threadId:n,context:r,unlinkedAt:s,attributes:o})=>this[e(539)](t)[e(480)]({commentThreadId:n,context:r,attributes:o,unlinkedAt:s})[e(506)](Ds)[e(506)](Rs),resolveCommentThread:async({channelId:t,threadId:n})=>{const r=e,s=await this[r(539)](t)[r(508)](n)[r(506)](Ds)[r(506)](Rs);return{threadId:s[r(578)],resolvedAt:s[r(560)],resolvedBy:s[r(569)]}},reopenCommentThread:async({channelId:t,threadId:n})=>this[e(539)](t)[e(538)](n)[e(506)](Ds)[e(506)](Rs),removeCommentThread:({channelId:t,threadId:n})=>this[e(539)](t)[e(573)](n)[e(506)](Ds)[e(506)](Rs),addComment:({channelId:t,threadId:n,commentId:r,content:s,attributes:o})=>this[e(539)](t)[e(488)](n,r,s,o)[e(506)](Rs),updateComment:({channelId:t,threadId:n,commentId:r,content:s,attributes:o})=>this[e(539)](t)[e(544)](n,r,s,o)[e(506)](Ds)[e(506)](Rs),removeComment:({channelId:t,threadId:n,commentId:r})=>this[e(539)](t)[e(556)](n,r)[e(506)](Ds)[e(506)](Rs)},n instanceof t.Context){const t=n[e(486)][e(484)](e(550)),r=n[e(509)][e(484)](Qn);await this[e(574)](t);const s=await this[e(546)][e(484)](t)[e(522)]();this[e(497)](r,e(566)+t,(n,{session:s})=>{const o=e;s.id===r[o(527)]&&(n[o(530)](),this[o(555)][o(509)][o(484)](o(499))[o(504)](s[o(564)],t))}),r[e(501)](t,s)}}async[_s(574)](e){const t=_s;if(this[t(546)][t(498)](e))throw new n.CKEditorError(t(528),null,{channelId:e});const r=this[t(555)][t(509)][t(484)](t(485)),s=new(js[t(533)])(e);this[t(546)][t(535)](e,s),this[t(497)](s,t(500),(e,n)=>{const s=t,{commentThreadId:o,documentId:i,context:a,attributes:c,resolvedAt:d,resolvedBy:u,comments:l}=n;r[s(526)](o)||r[s(561)]({threadId:o,channelId:i,comments:l?l[s(517)](xs):[],context:a,attributes:c,resolvedAt:d,resolvedBy:u,isFromAdapter:!0})}),this[t(497)](s,t(577),(e,{commentThreadId:n,documentId:s,context:o,unlinkedAt:i,attributes:a})=>{const c=t;r[c(526)](n)&&r[c(480)]({threadId:n,channelId:s,context:o,unlinkedAt:i,attributes:a,isFromAdapter:!0})}),this[t(497)](s,t(579),(e,{commentThreadId:n,resolvedBy:s,resolvedAt:o})=>{const i=t,a=r[i(526)](n);a&&a[i(570)]({resolvedBy:s,resolvedAt:o,isFromAdapter:!0})}),this[t(497)](s,t(482),(e,{commentThreadId:n})=>{const s=t,o=r[s(526)](n);o&&o[s(542)]({isFromAdapter:!0})}),this[t(497)](s,t(516),(e,{commentThreadId:n})=>{const s=t,o=r[s(526)](n);o&&o[s(487)]({isFromAdapter:!0})}),this[t(497)](s,t(559),(e,n)=>{const s=t,o=n[s(578)],i=r[s(526)](o);i&&i[s(488)]({...xs(n),isFromAdapter:!0})}),this[t(497)](s,t(510),(e,{commentThreadId:n,commentId:s,content:o,attributes:i})=>{const a=t,c=r[a(526)](n);if(c){const e=c[a(553)](s);e&&e[a(571)]({content:o,attributes:i,isFromAdapter:!0})}}),this[t(497)](s,t(507),(e,{commentThreadId:n,commentId:s})=>{const o=t,i=r[o(526)](n);if(i){const e=i[o(553)](s);e&&e[o(487)]({isFromAdapter:!0})}}),await this[t(545)](e)}[_s(525)](){const e=_s;if(this[e(555)]instanceof t.Context){const t=this[e(555)][e(486)][e(484)](e(550));this[e(567)](t)}}[_s(567)](e){const t=_s;if(!this[t(546)][t(498)](e))throw new n.CKEditorError(t(541),null,{channelId:e});this[t(539)](e)[t(502)](),this[t(546)][t(511)](e)}async[_s(496)](){const e=_s;for(const t of this[e(546)][e(572)]())await this[e(545)](t);if(this[e(555)]instanceof t.Context){const t=this[e(555)][e(486)][e(484)](e(550)),n=this[e(555)][e(509)][e(484)](Qn);n[e(512)](t);const r=await this[e(546)][e(484)](t)[e(522)]();n[e(501)](t,r)}}async[_s(545)](e){const t=_s,{connection:n}=this[t(555)][t(509)][t(484)](zn),r=this[t(555)][t(509)][t(484)](t(485)),s=this[t(546)][t(484)](e),o=await s[t(492)](n);await this[t(519)](o);const i=new Set(Array[t(495)](r[t(529)]({channelId:e}),e=>e.id));for(const e of o)e[t(503)]||i[t(511)](e[t(578)]);for(const e of i)r[t(526)](e)[t(487)]({isFromAdapter:!0});for(const n of o){let s=r[t(526)](n[t(578)]);const{commentThreadId:o,context:i,attributes:a,resolvedBy:c,resolvedAt:d,unlinkedAt:u,deletedAt:l}=n;if(l)continue;s||(s=r[t(561)]({channelId:e,threadId:o,context:i,attributes:a||{},resolvedBy:c,resolvedAt:d,unlinkedAt:u,isFromAdapter:!0}));const p=new Set(Array[t(495)](s[t(524)],e=>e.id));for(const e of n[t(524)])p[t(511)](e[t(554)]);for(const e of p)s[t(553)](e)[t(487)]({isFromAdapter:!0});for(const e of n[t(524)]){const n=s[t(553)](e[t(554)]);n?n[t(576)]!==e[t(576)]&&n[t(571)]({content:e[t(576)],isFromAdapter:!0}):s[t(488)](Object[t(489)](xs(e),{isFromAdapter:!0}))}}}[_s(539)](e){const t=_s;if(!this[t(546)][t(498)](e))throw new n.CKEditorError(t(483),null,{channelId:e});return this[t(546)][t(484)](e)}async[_s(519)](e){const t=_s,n=this[t(555)][t(509)][t(484)](Fn.Users),{connection:r}=this[t(555)][t(509)][t(484)](zn),s=new Set;for(const{resolvedBy:r,comments:o}of e){r&&!n[t(568)](r)&&s[t(520)](r);for(const{userId:e}of o)n[t(568)](e)||s[t(520)](e)}if(0===s[t(551)])return;const o=await b[t(531)](r,Array[t(495)](s));for(const e of o)n[t(568)](e.id)||n[t(549)](e)}}function Es(){const e=["reconnect","listenTo","has","Permissions","commentThreadAdded","register","disconnect","deletedAt","setPermissions","code","catch","commentRemoved","resolveCommentThread","plugins","commentUpdated","delete","unregister","message","8577555JonhYW","3825636uaVivD","commentThreadRemoved","map","authorId","_fetchMissingUsersForThreads","add","CloudServicesCommentsAdapter","getConnectedSessions","requires","comments","destroy","getCommentThread","mySessionId","cloudservicescommentsadapter-connect-already-connected","getCommentThreads","off","getMany","404","CommentsService","289890TqPblA","set","userId","createdAt","reopenCommentThread","_getService","isOfficialPlugin","cloudservicescommentsadapter-disconnect-not-exist","reopen","attributes","updateComment","_connectService","_services","cloud-services-internal-error: Comments Service is not connected.","2628822hTBARz","addUser","collaboration.channelId","size","isPremiumPlugin","getComment","commentId","context","removeComment","806423UyCloQ","pluginName","commentAdded","resolvedAt","addCommentThread","2646990gLQwKq","1004984itFUva","permissions","cloud-services-internal-error: Request timeout.","sessionAdd:","_terminateService","getUser","resolvedBy","resolve","update","keys","removeCommentThread","_setUpService","8ogjzOf","content","commentThreadUpdated","commentThreadId","commentThreadResolved","cloud-services-internal-error: Not connected.","updateCommentThread","addToReconnectionStack","commentThreadReopened","cloudservicescommentsadapter-service-not-exist","get","CommentsRepository","config","remove","addComment","assign","adapter","startsWith","connect","2iHSeUX","init","from"];return(Es=function(){return e})()}async function Ds(e){const t=_s;if(t(532)!==e[t(505)])throw e}function Rs(e){const t=_s;if((n=e)[t(513)][t(491)](t(547))||n[t(513)][t(491)](t(580))||n[t(513)][t(491)](t(565)))return new Promise(()=>{});var n;throw e}function xs(e){const t=_s;return{threadId:e[t(578)],commentId:e[t(554)],content:e[t(576)],createdAt:e[t(537)],authorId:e[t(536)],attributes:e[t(543)]||{}}}const Ns=Us;function Vs(){const e=["8664HlKUrX","_bufferedRequests","catch","14KIwxIi","289371vBlmAn","isOfficialPlugin","originalSuggestionId","size","config","editor","isPremiumPlugin","12EHYoeb","7423fkYxrG","pluginName","CloudServicesTrackChangesAdapter","connected","from","addSuggestionData","then","30VXNTxm","getMany","addToReconnectionStack","connect","state","6wSzcWX","TrackChangesService","reconnect","find","_waitForServiceReady","requires","getUser","addUser","plugins","342175bRJejE","suggestionUpdated","init","_saved","connection","collaboration.channelId","cloud-services-internal-error: Request timeout.","1498MoqSmv","data","values","_trackChangesService","attributes","hasSuggestion","open","3055261voHwQq","getSuggestion","4nDOkdq","listenTo","type","off","adapter","add","cloud-services-internal-error: Not connected.","update","set","get","6125717ZNRgtx","_fetchMissingUsersForThreads","message","delete","isConnected","385209IFyIXq","20GVtNDf","TrackChangesEditing","startsWith"];return(Vs=function(){return e})()}!function(e){const t=Us,n=e();for(;;)try{if(192351===-parseInt(t(492))/1*(-parseInt(t(545))/2)+parseInt(t(484))/3*(parseInt(t(529))/4)+parseInt(t(513))/5*(-parseInt(t(504))/6)+-parseInt(t(520))/7*(parseInt(t(480))/8)+parseInt(t(544))/9*(parseInt(t(499))/10)+parseInt(t(527))/11*(-parseInt(t(491))/12)+parseInt(t(539))/13*(parseInt(t(483))/14))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Vs);class Ms extends t.Plugin{static[Ns(505)]=(()=>Qt)();[Ns(481)];[Ns(523)];static get[Ns(509)](){return[js,Ns(546),zn]}static get[Ns(493)](){return Ns(494)}static get[Ns(485)](){return!0}static get[Ns(490)](){return!0}constructor(e){const t=Ns;super(e);const n=this[t(489)][t(488)][t(538)](t(518));this[t(481)]=new Map,this[t(523)]=new(Ms[t(505)])(n)}[Ns(515)](){const e=Ns,t=this[e(489)][e(512)][e(538)](zn),n=this[e(489)][e(512)][e(538)](e(546));return n[e(533)]={getSuggestion:async t=>{const n=e;await this[n(508)]();const r=await this[n(523)][n(538)](t)[n(482)](Bs);return await this[n(540)]([r]),r},addSuggestion:async({id:t,type:n,data:r,originalSuggestionId:s,attributes:o})=>{const i=e;await this[i(508)]();const a={id:t,type:n,data:r,originalSuggestionId:s,attributes:o},c=await this[i(523)][i(534)](t,n,r,s,o)[i(482)](e=>{if(Js(e))return new Promise(e=>{const n=Us;this[n(481)][n(537)](t,{resolve:e,suggestionData:a})});throw e});return this[i(481)][i(542)](t),c},updateSuggestion:async(t,n)=>{const r=e;if(await this[r(508)](),r(526)!==n[r(503)])return this[r(523)][r(536)](t,n)[r(482)](Bs)}},this[e(530)](this[e(523)],e(514),(t,r)=>{const s=e;n[s(525)](r.id)&&(n[s(528)](r.id)[s(524)]=r[s(524)])}),this[e(523)][e(502)](t[e(517)])[e(498)](r=>(t[e(501)](this),this[e(540)](r)[e(498)](()=>{const t=e;for(const e of r)n[t(497)](e)[t(516)]=!0})))}async[Ns(506)](){const e=Ns,t=this[e(489)][e(512)][e(538)](e(546)),{connection:n}=this[e(489)][e(512)][e(538)](zn),r=await this[e(523)][e(502)](n);await this[e(540)](r);for(const{suggestionData:t,resolve:n}of this[e(481)][e(522)]()){let s=r[e(507)](e=>e.id===t.id);s||(s=await this[e(523)][e(534)](t.id,t[e(531)],t[e(521)],t[e(486)])),n(s)}for(const n of r)t[e(525)](n.id)||t[e(497)](n)}async[Ns(508)](){const e=Ns;this[e(523)][e(543)]||await new Promise(t=>{const n=e;this[n(530)](this[n(523)],n(495),e=>{e[n(532)](),t()})})}async[Ns(540)](e){const t=Ns,n=this[t(489)][t(512)][t(538)](Fn.Users),{connection:r}=this[t(489)][t(512)][t(538)](zn),s=new Set;for(const{authorId:r}of e)n[t(510)](r)||s[t(534)](r);if(0===s[t(487)])return;const o=await b[t(500)](r,Array[t(496)](s));for(const e of o)n[t(510)](e.id)||n[t(511)](e)}}function Bs(e){if(Js(e))return new Promise(()=>{});throw e}function Us(e,t){const n=Vs();return(Us=function(e,t){return n[e-=480]})(e,t)}function Js(e){const t=Ns;return e[t(541)][t(547)](t(535))||e[t(541)][t(547)](t(519))}function qs(e,t){const n=Ls();return(qs=function(e,t){return n[e-=470]})(e,t)}const Gs=qs;function Ls(){const e=["listenTo","destroy","86mpGQMs","594SdiMDQ","Comments","5665572UjwrTb","once","CommentsRepository","CommentsEditing","isOfficialPlugin","ready","4367268cfvYRU","switchReadOnly","7WTgZoA","plugins","4536816esPfvx","connected","init","_setUpService","isPremiumPlugin","RealTimeCollaborativeComments","change:state","72652CTIrfB","config","collaboration.channelId","980OMksdj","9KYgeRG","41145qUcyOj","get","requires","6378670VewfWL","3WiLPif","data","_terminateService","pluginName","isThreadsLoadingPaused","editor"];return(Ls=function(){return e})()}!function(e){const t=qs,n=e();for(;;)try{if(512670===-parseInt(t(478))/1*(-parseInt(t(492))/2)+-parseInt(t(484))/3*(parseInt(t(475))/4)+parseInt(t(480))/5*(parseInt(t(493))/6)+parseInt(t(503))/7*(-parseInt(t(505))/8)+-parseInt(t(479))/9*(parseInt(t(483))/10)+parseInt(t(495))/11+parseInt(t(501))/12)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Ls);class Ys extends t.Plugin{static get[Gs(482)](){return[Gs(494),js,Ts,zn]}static get[Gs(487)](){return Gs(473)}static get[Gs(499)](){return!0}static get[Gs(472)](){return!0}[Gs(470)](){const e=Gs,t=this[e(489)][e(504)][e(481)](zn),n=this[e(489)][e(504)][e(481)](e(498)),r=this[e(489)][e(504)][e(481)](js);return this[e(489)][e(485)][e(496)](e(500),()=>{const r=e;this[r(490)](t,r(474),(e,t,s)=>{const o=r;n[o(488)]=o(506)!==s})}),this[e(490)](t,e(474),(t,n,r)=>{const s=e;this[s(489)][s(504)][s(481)](s(497))[s(502)](s(506)!==r)}),r[e(471)](this[e(489)][e(476)][e(481)](e(477)))}[Gs(491)](){const e=Gs;this[e(489)][e(504)][e(481)](js)[e(486)](this[e(489)][e(476)][e(481)](e(477))),super[e(491)]()}}var Hs=Fs;function zs(){var e=["4DXihJs","12371984NfvMdv","pluginName","requires","isOfficialPlugin","77838xBKbaL","TrackChanges","RealTimeCollaborativeTrackChanges","47360JRQMuR","87hHCqsW","720mYAFCB","25362458IDVGWW","6353055mUhwrd","658zbTusV","isPremiumPlugin","654GCPmca","343406kWQSDs"];return(zs=function(){return e})()}function Fs(e,t){var n=zs();return(Fs=function(e,t){return n[e-=334]})(e,t)}!function(e){for(var t=Fs,n=e();;)try{if(928042===-parseInt(t(342))/1+-parseInt(t(348))/2*(-parseInt(t(335))/3)+-parseInt(t(343))/4*(-parseInt(t(338))/5)+-parseInt(t(341))/6*(-parseInt(t(339))/7)+parseInt(t(344))/8+-parseInt(t(336))/9*(parseInt(t(334))/10)+-parseInt(t(337))/11)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(zs);class Ks extends t.Plugin{static get[Hs(346)](){return[Ys,Ms,Hs(349)]}static get[Hs(345)](){return Hs(350)}static get[Hs(347)](){return!0}static get[Hs(340)](){return!0}}const Ws=Xs;function Qs(){const e=["size","_fetchMissingUsers","_getLatestVersionFromServerOperations","_createCurrentRevision","toVersion","10zGDiPz","max","isConnected","cloud-services-internal-error: Revision History Service is not connected.","isBundleUploaded","CONNECTED","revisionsUpdated","catch","sendBufferedUpdates","_handleRevisionsUpdate","remove","reverse","cloud-services-internal-error: Not connected.","data","_revisions","marker","diffData","authorsIds","connected","RevisionTracker","getUser","config","baseVersion","_getLatestVersion","repository","bind","_preventResendingRevisionData","_startingVersion","RevisionHistoryService","setRevisionData","connect","setSource","_update","_oldOffset","createdAt","startsWith","creatorId","_bufferedUpdates","once","listenTo","requires","cloud-services-internal-error: Request timeout.","367685AgvOZs","off","14121oBpNNK","_handleReconnectionError","RevisionHistory","_isPendingUpdate","_isConnected","400","15880DhpibR","change:_isConnected","addUser","getRevision","CloudServicesRevisionHistoryAdapter","then","_offset","currentRevision","connection","reconnect","from","addToReconnectionStack","buildRevisionData","_revisionHistoryService","fromVersion","getMany","map","1161622JhVHfk","getOperations","adapter","5318005sYTyfj","collaboration.channelId","wrongRequestId","code","cloudServices.bundleVersion","get","getRevisions","has","length","message","1807914AokUol","2437892SNsiHE","type","destroy","editor","init","serverHistory","_revisionTracker","isOfficialPlugin","affectsData","authors","_waitForServiceReady","pluginName","_bufferUpdate","isEnabled","addRevisionData","sessionId","isPremiumPlugin","_revisionDataBuilder","change:_isPendingUpdate","plugins","state","_lastRequestId","updateRevisions","add","isEmptyCurrent","4164939yTnWdd","keys","_fixRevision","reInit"];return(Qs=function(){return e})()}!function(e){const t=Xs,n=e();for(;;)try{if(746476===parseInt(t(425))/1+-parseInt(t(335))/2+-parseInt(t(374))/3+-parseInt(t(349))/4+-parseInt(t(383))/5*(-parseInt(t(348))/6)+-parseInt(t(338))/7+-parseInt(t(433))/8*(-parseInt(t(427))/9))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Qs);class Zs extends t.Plugin{static[Ws(411)]=(()=>Vt)();[Ws(370)];[Ws(355)];[Ws(331)];[Ws(416)];static get[Ws(423)](){return[zn,bs,Ws(429),Qn,Fn.Users]}static get[Ws(360)](){return Ws(437)}static get[Ws(356)](){return!0}static get[Ws(365)](){return!0}constructor(e){const t=Ws;super(e);const n=this[t(352)][t(404)][t(343)](t(339));this[t(370)]=null,this[t(355)]=this[t(352)][t(368)][t(343)](t(402)),this[t(331)]=new(Zs[t(411)])(n)}async[Ws(353)](){const e=Ws,t=this[e(352)][e(368)][e(343)](bs),r=t[e(354)],s=this[e(352)][e(368)][e(343)](zn);this[e(355)][e(414)]({history:r,getLatestVersion:()=>this[e(406)](),getCurrentRevisionId:()=>t[e(364)]});const o=this[e(352)][e(404)][e(343)](e(342))||n.version,i=await Pt[e(387)](s[e(441)],o);this[e(352)][e(368)][e(343)](e(429))[e(337)]={getRevision:async({revisionId:t})=>(await this[e(359)](),await this[e(331)][e(436)](t)),updateRevisions:async t=>{const n=e;await this[n(359)]();const r=this[n(355)][n(440)];if(i&&1===t[n(346)]&&t[0].id===r.id)return t;for(const e of t)e.id===r.id&&(e[n(373)]=e[n(332)]===e[n(382)]);return this[n(331)][n(371)](t,this[n(370)])[n(438)](e=>(this[n(370)]=e,t))[n(390)](e=>{const r=n;if($s(e)||r(432)===e[r(341)]&&void 0!==e[r(396)][r(340)]){for(const e of t)!this[r(355)][r(407)][r(436)](e.id)||this[r(355)][r(361)](e.id,e,!1);if($s(e))throw e;return t}throw e})}},this[e(422)](this[e(331)],e(389),(t,{revisionsData:n,requestId:r})=>{const s=e;Math[s(384)](...n[s(334)](e=>e[s(382)]))>this[s(380)]()-1?this[s(406)]()[s(438)](()=>{this[s(392)](n,r)}):this[s(392)](n,r)});const{revisions:a,requestId:c}=await this[e(331)][e(413)](s[e(441)]);s[e(444)](this),this[e(370)]=c,await this[e(379)](a);for(const t of a)this[e(355)][e(363)](t);this[e(422)](t,e(434),(n,r,s)=>{const o=e;s&&(this[o(416)]=t[o(439)],n[o(426)]())}),this[e(355)][e(408)](e(362)).to(s,e(369),t=>t===Ot[e(388)])}async[Ws(442)](){const e=Ws,t=this[e(352)][e(368)][e(343)](zn),n=this[e(352)][e(368)][e(343)](bs),r=async()=>{const r=e,s=this[r(355)][r(440)],o=s.id,i=o!==n[r(364)];if(i){const e=n[r(439)]-this[r(416)],t=this[r(380)]();if(this[r(355)][r(366)][r(377)](),s[r(382)]+e!==t){const n=s[r(332)]+e,o=this[r(352)][r(368)][r(343)](Fn.Users),i=this[r(355)][r(445)]({revision:s,from:n,to:t});i.id=s.id;const a=i[r(400)][r(334)](e=>o[r(403)](e));s[r(415)]({...i,authors:a},!0),this[r(355)][r(361)](s.id,i,!0)}this[r(355)][r(410)]=t,s[r(382)]===s[r(332)]&&!this[r(355)][r(420)][r(345)](o)&&this[r(355)][r(407)][r(397)][r(393)](o),this[r(355)][r(381)](t)}const{revisions:a,requestId:c}=await this[r(331)][r(442)](t[r(441)],this[r(370)]);i&&a[r(346)]>0?n[r(428)]():(await this[r(379)](a),this[r(392)](a,c),this[r(355)][r(391)]())};return n[e(431)]?r():new Promise((t,s)=>{const o=e;n[o(421)](o(434),()=>{const e=o;r()[e(438)](t)[e(390)](s)})})}[Ws(351)](){super[Ws(351)]()}async[Ws(359)](){const e=Ws;this[e(331)][e(385)]||await new Promise(t=>{const n=e;this[n(422)](this[n(331)],n(401),e=>{e[n(426)](),t()})})}[Ws(380)](){const e=Ws,t=this[e(352)][e(368)][e(343)](bs)[e(354)][e(336)]()[e(394)]();for(const n of t)if(e(398)!==n[e(350)]||n[e(357)])return n[e(405)]+1}[Ws(406)](){const e=Ws,t=this[e(352)][e(368)][e(343)](bs);return new Promise(n=>{const r=e;t[r(430)]?t[r(421)](r(367),()=>{n(this[r(380)]())}):n(this[r(380)]())})}[Ws(392)](e,t){const n=Ws,r=this[n(355)][n(407)];this[n(370)]=t;for(const t of e){const e=r[n(436)](t.id);if(e){if((t[n(332)]||t[n(382)])&&(t[n(399)]=null),e===this[n(355)][n(440)]){const r=Math[n(384)](e[n(382)],t[n(382)]),s=Math[n(384)](e[n(332)],t[n(332)]);let o;e[n(382)]===t[n(382)]&&e[n(332)]===t[n(332)]?(o=!0,this[n(409)](t)):t[n(382)]===r&&t[n(332)]===s?o=!1:(e[n(382)]===r&&e[n(332)]===s||this[n(376)]({revision:e,from:s,to:r}),o=!0),o&&(delete t[n(332)],delete t[n(382)],delete t[n(399)],delete t[n(417)],delete t[n(400)])}this[n(355)][n(412)](t),this[n(409)](t)}else this[n(355)][n(363)](t)}const s=r[n(344)]();s[n(394)]();for(let e=0;e<s[n(346)]-1;e++){const t=s[e],r=s[e+1];if(t[n(332)]<r[n(382)]){const e=r[n(382)],s=Math[n(384)](e,t[n(382)]);this[n(376)]({revision:t,from:e,to:s})}}}[Ws(376)]({revision:e,from:t,to:n}={}){const r=Ws,s=this[r(352)][r(368)][r(343)](Fn.Users),o=this[r(355)][r(445)]({revision:e,from:t,to:n});o[r(358)]=o[r(400)][r(334)](e=>s[r(403)](e)),e[r(415)](o)}[Ws(409)](e){const t=Ws,n={};n.id=e.id;for(const r of Object[t(375)](e))"id"!==r&&(n[r]=void 0);this[t(355)][t(361)](n.id,n,!0)}async[Ws(379)](e){const t=Ws,n=this[t(352)][t(368)][t(343)](Fn.Users),{connection:r}=this[t(352)][t(368)][t(343)](zn),s=new Set;for(const n of e){for(const e of n[t(400)])i(e);n[t(419)]&&i(n[t(419)])}if(0===s[t(378)])return;const o=await b[t(333)](r,Array[t(443)](s));for(const e of o)n[t(403)](e.id)||n[t(435)](e);function i(e){const r=t;n[r(403)](e)||s[r(372)](e)}}}function Xs(e,t){const n=Qs();return(Xs=function(e,t){return n[e-=331]})(e,t)}function $s(e){const t=Ws;return e[t(347)][t(418)](t(386))||e[t(347)][t(418)](t(395))||e[t(347)][t(418)](t(424))}function eo(e,t){var n=to();return(eo=function(e,t){return n[e-=430]})(e,t)}function to(){var e=["4837536ioNfzQ","69lzbYlr","RealTimeCollaborativeRevisionHistory","11030FNpcXd","2182135vHFsfm","1242988csvNrf","pluginName","232036RWkJpD","10667685fPPFyu","RevisionHistory","2oXvyvH","requires","9585CmQwbl","1994927emCFog","isPremiumPlugin","isOfficialPlugin","6fqOLWB"];return(to=function(){return e})()}var no=eo;!function(e){for(var t=eo,n=e();;)try{if(790101===parseInt(t(430))/1*(-parseInt(t(435))/2)+parseInt(t(443))/3*(parseInt(t(432))/4)+parseInt(t(446))/5*(-parseInt(t(441))/6)+parseInt(t(433))/7+parseInt(t(442))/8+parseInt(t(437))/9*(-parseInt(t(445))/10)+parseInt(t(438))/11)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(to);class ro extends t.Plugin{static get[no(436)](){return[no(434),Zs,Ts]}static get[no(431)](){return no(444)}static get[no(440)](){return!0}static get[no(439)](){return!0}}function so(e){return function(e){return"object"==typeof e&&null!==e}(e)&&1===e.nodeType&&!function(e){if("object"!=typeof e)return!1;if(null==e)return!1;if(null===Object.getPrototypeOf(e))return!0;if("[object Object]"!==Object.prototype.toString.call(e)){const t=e[Symbol.toStringTag];return null!=t&&(!!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable&&e.toString()===`[object ${t}]`)}let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e)}function oo(){const e=["ck-presence-list__counter--hidden","bind","154634nuingF","20zbEmdK","bindTemplate","224rmnGOZ","ck-presence-list__users-counter","ck-presence-list__users-counter__text","406380iOnLqt","146927ASajBG","ck-presence-list__list-item","setTemplate","listitem","toString","usersCount","688QyiSHC","div","36GhtqLq","_collapseAt","5850aUKQSf","isHidden","873426mwgzkH","set","57736gxguha","5CQuJIq","2411667kfkTor","1kRmXTx"];return(oo=function(){return e})()}const io=ao;function ao(e,t){const n=oo();return(ao=function(e,t){return n[e-=114]})(e,t)}!function(e){const t=ao,n=e();for(;;)try{if(216597===-parseInt(t(119))/1*(parseInt(t(122))/2)+-parseInt(t(139))/3*(-parseInt(t(135))/4)+parseInt(t(117))/5*(-parseInt(t(114))/6)+-parseInt(t(125))/7*(parseInt(t(116))/8)+parseInt(t(118))/9+parseInt(t(123))/10*(-parseInt(t(129))/11)+parseInt(t(137))/12*(parseInt(t(128))/13))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(oo);class co extends r.View{[io(138)];constructor(e,t=6){const n=io;super(e);const r=this[n(124)];this[n(115)](n(140),!0),this[n(115)](n(134),0),this[n(138)]=t,this[n(121)](n(140)).to(this,n(134),e=>e<t),this[n(131)]({tag:n(136),attributes:{class:["ck",n(130),r.if(n(140),n(120))],role:n(132)},children:[{tag:n(136),attributes:{class:["ck",n(126)]},children:[{tag:n(136),attributes:{class:["ck",n(127)]},children:[{text:r.to(n(134),e=>"+"+(e-this[n(138)]+2)[n(133)]())}]}]}]})}}const uo=lo;function lo(e,t){const n=po();return(lo=function(e,t){return n[e-=165]})(e,t)}function po(){const e=["presencelist:hide","4360nzKnZq","setTemplate","set","contains","357965mEzJmo","render","5851040OaqNPA",".ck-presence-list__dropdown-list","change:hasPopup","hasPopup","keystrokes","list","focus","removeAttribute","105AJoFDP","fire","31653KPkYoe","div","items","relatedTarget","setAttribute","aria-expanded","querySelector","bindTemplate","element","6495CoBQlM","3410379djweTK","3534trnxNA","isExpanded","presencelist:show","Collapsed connected users list (press ENTER to open it)","44376JLRMBl",".ck-balloon-panel_with-arrow","1435254OvVFlF","listenTo","ck-presence-list__list","Connected users list","createCollection"];return(po=function(){return e})()}!function(e){const t=lo,n=e();for(;;)try{if(590458===-parseInt(t(200))/1+-parseInt(t(190))/2+parseInt(t(171))/3*(-parseInt(t(188))/4)+-parseInt(t(182))/5*(-parseInt(t(184))/6)+parseInt(t(183))/7+-parseInt(t(202))/8+-parseInt(t(173))/9*(-parseInt(t(196))/10))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(po);class ho extends r.View{[uo(175)];[uo(167)];constructor(e){const t=uo;super(e);const r=this[t(180)];this[t(175)]=this[t(194)](),this[t(167)]=new n.KeystrokeHandler,this[t(198)]({hasPopup:!1,isExpanded:!1}),this[t(197)]({tag:t(174),attributes:{"aria-haspopup":r.if(t(166)),"aria-expanded":r.to(t(185),e=>this[t(166)]&&String(e)),"aria-label":r.to(t(166),n=>mr(e,t(n?187:193))),role:t(168),tabindex:r.to(t(166),e=>!!e&&0),class:["ck",t(192)]},children:this[t(175)],on:{mouseenter:r.to(()=>this[t(172)](t(186))),mouseleave:r.to(e=>{const n=t,r=e,s=document[n(179)](n(203)),o=document[n(179)](n(189));s?.[n(199)](r[n(176)])||o?.[n(199)](r[n(176)])||this[n(172)](n(195))})}}),this.on(t(165),(e,n,r)=>{const s=t;this[s(181)]&&(r?this[s(181)][s(177)](s(178),String(this[s(185)])):this[s(181)][s(170)](s(178)))})}[uo(169)](){const e=uo;this[e(181)][e(169)]()}[uo(201)](){const e=uo;super[e(201)](),this[e(167)][e(191)](this[e(181)])}}var fo=__webpack_require__(106),mo={attributes:{"data-cke":!0}};mo.setAttributes=or(),mo.insert=rr().bind(null,"head"),mo.domAPI=tr(),mo.insertStyleElement=ar();$n()(fo.A,mo);fo.A&&fo.A.locals&&fo.A.locals;const yo=go;function go(e,t){const n=Oo();return(go=function(e,t){return n[e-=355]})(e,t)}!function(e){const t=go,n=e();for(;;)try{if(184031===-parseInt(t(377))/1+-parseInt(t(362))/2+parseInt(t(366))/3+parseInt(t(365))/4+-parseInt(t(381))/5*(parseInt(t(356))/6)+-parseInt(t(364))/7*(-parseInt(t(363))/8)+-parseInt(t(360))/9)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Oo);class bo extends r.View{[yo(368)];[yo(357)];constructor(e,t=6){const n=yo;super(e);const r=this[n(380)];this[n(361)](n(367),!0),this[n(368)]=new co(this[n(359)],t),this[n(357)]=new ho(e),this[n(357)][n(379)](n(355)).to(this,n(367)),this[n(375)](this[n(357)][n(378)],n(372),()=>{const e=n;for(const t of this[e(357)][e(378)])t[e(371)]="s";this[e(357)][e(378)][e(358)]&&(this[e(357)][e(378)][e(358)][e(371)]="se")}),this[n(369)]({tag:n(370),attributes:{class:["ck",n(376),n(373),n(382),r.if(n(367),n(374))]},children:[this[n(357)]]})}}function Oo(){const e=["hasPopup","240102oYMPyO","inlineListView","first","locale","2265939glmJLu","set","304026cFFfuA","72776KeSxZV","63REtWzZ","1311072BddcUs","802446zpBNuu","isCollapsed","counterView","setTemplate","div","tooltipPosition","change","ck-reset","ck-presence-list--collapsed","listenTo","ck-presence-list","49291pCxYSx","items","bind","bindTemplate","5pdsefs","ck-rounded-corners"];return(Oo=function(){return e})()}function wo(e,t){const n=Io();return(wo=function(e,t){return n[e-=367]})(e,t)}function Io(){const e=["div","element","45VsOFSj","listenTo","presencelist:hide","items","fire","change","176472AyFRAh","2nDVygp","Connected users list dropdown menu","bindTemplate","ariaLabelledBy","282SAepuY","607797PZXwPI","84052kMuXFu","listWrapperView","8lsHpYQ","ck-presence-list__dropdown-list-wrapper_scrollable","ck-presence-list__dropdown-list-wrapper","1549361sfoIQO","max","scrollHeight","role","checkIfScrollable","window",".ck-presence-list__list","relatedTarget","render","application","querySelector","4128648hZYelu","91111TZJUfO","ck-list","clientHeight","innerHeight","resize","set","7091YgypiQ",".ck-balloon-panel_with-arrow","ck-reset","_isScrollable","ck-presence-list__dropdown-list","setTemplate","10wBRiPM","contains","ariaLabel"];return(Io=function(){return e})()}const vo=wo;!function(e){const t=wo,n=e();for(;;)try{if(125931===-parseInt(t(393))/1*(parseInt(t(370))/2)+-parseInt(t(369))/3+parseInt(t(376))/4*(-parseInt(t(410))/5)+parseInt(t(374))/6*(parseInt(t(399))/7)+parseInt(t(378))/8*(-parseInt(t(375))/9)+-parseInt(t(405))/10*(-parseInt(t(381))/11)+parseInt(t(392))/12)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Io);class So extends r.View{[vo(377)];constructor(e,t){const n=vo;super(e);const r=this[n(372)];this[n(377)]=new ko(e,t),this[n(404)]({tag:n(408),attributes:{tabindex:-1,role:n(390),class:["ck",n(403)],"aria-label":mr(e,n(371))},children:[this[n(377)]],on:{mouseleave:r.to(e=>{const t=n,r=e,s=document[t(391)](t(387)),o=document[t(391)](t(400));s?.[t(406)](r[t(388)])||o?.[t(406)](r[t(388)])||this[t(367)](t(412))})}})}}class ko extends r.ListView{constructor(e,t){const r=vo;super(e);const s=this[r(372)];this[r(398)](r(402),!1),this[r(404)]({tag:t?r(408):"ul",attributes:{class:["ck",r(401),r(394),r(380),s.if(r(402),r(379))],role:s.to(r(384)),"aria-label":s.to(r(407)),"aria-labelledby":s.to(r(373))},children:this[r(413)]}),this[r(411)](n.global[r(386)],r(397),()=>this[r(385)]()),this[r(413)].on(r(368),()=>this[r(385)]())}[vo(389)](){const e=vo;super[e(389)](),this[e(385)]()}[vo(385)](){const e=vo,t=this[e(409)];t&&(this[e(402)]=Math[e(382)](t[e(383)],t[e(395)])>.8*window[e(396)])}}const Po=To;function Ao(){const e=["execute","button","name","354eCYFmo","span","ck-presence-list__dropdown-list-item","1552239QlhETG","9588imZnUh","ck-user__full-name","28373hONlqQ","bindTemplate","presentation","color","4721563wMDlBu","focus","ck-presence-list__marker","fire","setTemplate","1534774DfaeuF","getBackgroundColorClass","24pLnRFe","element","39955YEqUSz","tag","userView","1516MUTfzb","true","33830390oSpaBG"];return(Ao=function(){return e})()}function To(e,t){const n=Ao();return(To=function(e,t){return n[e-=295]})(e,t)}!function(e){const t=To,n=e();for(;;)try{if(747430===-parseInt(t(322))/1+-parseInt(t(303))/2+parseInt(t(320))/3*(-parseInt(t(310))/4)+-parseInt(t(307))/5*(parseInt(t(316))/6)+-parseInt(t(298))/7+-parseInt(t(305))/8*(-parseInt(t(319))/9)+parseInt(t(312))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Ao);class _o extends r.ListItemView{[Po(309)];constructor(e,t,n){const r=Po;super(e);const s=this[r(295)];this[r(309)]=new Fn.UserView(e,t);const o={tag:"li",attributes:{class:["ck",r(318)],tabindex:-1,role:r(296),"aria-label":t[r(315)]},children:[this[r(309)],{tag:r(317),attributes:{class:["ck",r(321)]},children:[{text:t[r(315)]}]},{tag:r(317),attributes:{class:["ck",r(300),t[r(297)][r(304)]()],"aria-hidden":r(311)}}]};n&&(o[r(308)]=r(314),o.on={click:s.to(()=>this[r(301)](r(313)))}),this[r(302)](o)}[Po(299)](){const e=Po;this[e(306)][e(299)]()}}const Co=jo;function jo(e,t){const n=Eo();return(jo=function(e,t){return n[e-=326]})(e,t)}function Eo(){const e=["7vHISDh","1678tvzWoX","1607070UEusFg","26162wClEGD","tooltipPosition","bindTemplate","execute","template","button","405705ApwrZJ","1296485OYrCUP","isFocusable","true","hasTooltip","name","set","listitem","userView","text","div","markerView","fire","ck-presence-list__list-item","setTemplate","span","getBackgroundColorClass","color","159084jfTgZa","4055320mmKRio","ck-presence-list__list-item__tooltip","tag","ck-presence-list__marker"];return(Eo=function(){return e})()}!function(e){const t=jo,n=e();for(;;)try{if(141014===parseInt(t(334))/1+-parseInt(t(332))/2+parseInt(t(340))/3+-parseInt(t(326))/4+parseInt(t(341))/5+-parseInt(t(333))/6*(-parseInt(t(331))/7)+-parseInt(t(327))/8)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Eo);class Do extends r.View{[Co(348)];[Co(351)];constructor(e,t,n){const s=Co;super(e);const o=this[s(336)];this[s(346)](s(342),!1),this[s(346)](s(344),!0),this[s(346)](s(335),""),this[s(348)]=new Fn.UserView(e,t),this[s(351)]=new Ro(e,t);const i=new r.LabelView(e);i[s(338)][s(329)]=s(355),i[s(349)]=t[s(345)];const a={tag:s(350),attributes:{class:["ck",s(353)],role:s(347),tabindex:o.to(s(342),e=>!!e&&0),"aria-labelledby":i.id,"data-cke-tooltip-text":this[s(348)][s(345)],"data-cke-tooltip-position":o.to(s(335)),"data-cke-tooltip-disabled":o.to(s(344),e=>!e),"data-cke-tooltip-class":s(328)},children:[this[s(348)],this[s(351)],i]};n&&(a[s(329)]=s(339),a.on={click:o.to(()=>this[s(352)](s(337)))}),this[s(354)](a)}}class Ro extends r.View{constructor(e,t){const n=Co;super(e),this[n(354)]({tag:n(355),attributes:{class:["ck",n(330),t[n(357)][n(356)]()],"aria-hidden":n(343)}})}}const xo=Vo;function No(){const e=["isMe","focusTracker","set","Shift+Tab","[tabindex]","change:isFocused","hasTooltip","plugins","checkIfScrollable","hideDropdown","config","input","presencelist-missing-container","appendChild","presencelist:hide","_bodyCollection","class","locale","join","button","init","2858040eEHgyc","pin","attachToDom","content","element","isOfficialPlugin","presenceList.displayMe","requires","bind","inlineListView","focus","activeElement","[contenteditable]","Enter","showDropdown","counterView","2323932bJDQqn","onClick","_handleUserRemove","isPremiumPlugin","detachFromDom","861854KznbUT","view","bindTo","currentDisplayedUsers","243438iZyBZu","min","using","_allConnectedUsers","select","_createView","context","remove","isRendered","ck ck-presence-list__balloon","offsetWidth","querySelectorAll",':not([disabled]):not([tabindex="-1"])',"offsetHeight","isExpanded","indexOf","presencelist:show","map","textarea","find","reverse","pluginName","Tab","tabIndex","body","17824752OzwMwD","keystrokes","presencelist-collapseat-invalid-format","items","length","presenceList","presenceList.collapseAt","balloonPanelView","presenceList.container","unpin","execute","usersCount","number","displayMe","6521144GqJZZh","3WJRLcD","render","from","define","3701780mPeYCz","listenTo","isFocusable","allConnectedUsers","presenceDropdownView","sort","filter","isVisible","PresenceListUI","get","destroy","_handleUserAdd","isCollapsed","Esc","add"];return(No=function(){return e})()}function Vo(e,t){const n=No();return(Vo=function(e,t){return n[e-=299]})(e,t)}!function(e){const t=Vo,n=e();for(;;)try{if(532070===parseInt(t(367))/1+-parseInt(t(371))/2*(-parseInt(t(306))/3)+parseInt(t(362))/4+parseInt(t(310))/5+-parseInt(t(346))/6+parseInt(t(305))/7+-parseInt(t(396))/8)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(No);const Mo={collapseAt:6,displayMe:!0};class Bo extends t.ContextPlugin{[xo(370)];[xo(403)];[xo(368)];[xo(314)];[xo(340)]=null;static get[xo(392)](){return xo(318)}static get[xo(351)](){return!0}static get[xo(365)](){return!0}constructor(e){const t=xo;super(e),this[t(377)][t(335)][t(309)](t(401),Mo);const s=e[t(335)][t(319)](t(402));if(t(303)!=typeof s)throw new n.CKEditorError(t(398),this);if(s<1)throw new n.CKEditorError(t(398),this);this[t(374)]=this[t(377)][t(332)][t(319)](Qn)[t(313)],this[t(327)](t(302),0),this[t(370)]=new n.Collection,this[t(403)]=new r.BalloonPanelView,this[t(403)][t(341)]=t(380),this[t(368)]=this[t(376)](),this[t(314)]=void 0}static get[xo(353)](){return[Qn]}[xo(345)](){const e=xo;for(const t of this[e(374)])this[e(321)](t);this[e(311)](this[e(374)],e(324),(t,n)=>{this[e(321)](n)}),this[e(311)](this[e(374)],e(378),(t,n)=>{this[e(364)](n)})}[xo(376)](){const e=xo,t=this[e(377)],s=new bo(this[e(377)][e(342)],this[e(377)][e(335)][e(319)](e(402))),o=this[e(403)];if(!so(t[e(335)][e(319)](e(299))))throw new n.CKEditorError(e(337),this);return s[e(361)][e(354)](e(302)).to(this),s[e(354)](e(322)).to(this,e(302),n=>{const r=e,{collapseAt:o}=t[r(335)][r(319)](r(401)),i=n>=o;if(i&&!s[r(355)][r(399)][r(390)](e=>e instanceof co)){const e=this[r(377)][r(335)][r(319)](r(402))-1;this[r(370)][r(400)]==e&&this[r(370)][r(400)]>1&&this[r(370)][r(378)](this[r(370)][r(400)]-1),s[r(355)][r(399)][r(324)](s[r(361)])}return i||this[r(334)](),i}),s[e(355)][e(399)][e(369)](this[e(370)])[e(373)](n=>{const r=e,o=t[r(335)][r(319)](r(401)),i=new Do(t[r(342)],n,!!o[r(363)]);return i[r(354)](r(331)).to(s,r(322),e=>!e),i[r(354)](r(312)).to(s,r(322),e=>!e),o[r(363)]&&this[r(311)](i,r(301),()=>{const e=r;this[e(368)][e(322)]||o[e(363)](n,i[e(350)])}),i}),this[e(311)](s[e(355)],e(387),()=>{const t=e;this[t(368)][t(322)]&&this[t(360)]()}),this[e(311)](s[e(355)],e(339),()=>{const t=e;this[t(314)]&&this[t(334)]()}),s[e(355)][e(397)][e(327)](e(359),(t,n)=>{const r=e;this[r(368)][r(322)]&&(this[r(360)](),n())}),s[e(307)](),o[e(307)](),(0,r.clickOutsideHandler)({emitter:s,activator:()=>o[e(317)],contextElements:[o[e(350)],s[e(355)][e(350)]],callback:()=>this[e(334)]()}),t[e(335)][e(319)](e(299))[e(338)](s[e(350)]),this[e(340)]=new r.BodyCollection(this[e(377)][e(342)]),this[e(340)][e(348)](),this[e(340)][e(324)](this[e(403)]),s}[xo(321)](e){const t=xo;if(!this[t(377)][t(335)][t(319)](t(352))&&e[t(325)])return;const n=this[t(377)][t(335)][t(319)](t(402))-1;for(this[t(302)]++;this[t(370)][t(400)]>=n-(this[t(368)][t(322)]?1:0)&&this[t(370)][t(400)]>1;)this[t(370)][t(378)](1);const r=e[t(325)]?0:this[t(370)][t(400)];this[t(370)][t(324)](e,r)}[xo(364)](e){const t=xo;this[t(302)]--;const{collapseAt:n}=this[t(377)][t(335)][t(319)](t(401)),r=this[t(302)]>=n;if(this[t(370)][t(319)](e.id))this[t(370)][t(378)](e.id);else if(r&&this[t(370)][t(400)]+1===n-1)return;if(this[t(370)][t(400)]+(r?1:0)<this[t(302)])for(const e of Array[t(308)](this[t(374)])[t(391)]())if(!this[t(370)][t(319)](e.id)&&(this[t(370)][t(324)](e,Math[t(372)](this[t(370)][t(400)]-(r?1:0),1)),this[t(370)][t(400)]+(r?1:0)===n-1))return}[xo(360)](){const e=xo;if(this[e(314)])return;const t=this[e(377)][e(335)][e(319)](e(401));this[e(314)]=new So(this[e(377)][e(342)],!!t[e(363)]),this[e(368)][e(355)][e(385)]=!0,this[e(311)](this[e(314)],e(339),()=>{const t=e;this[t(314)]&&this[t(334)]()});const{listWrapperView:n}=this[e(314)];n[e(399)][e(369)](this[e(374)])[e(373)](n=>{const r=e;if(!t[r(304)]&&n[r(325)])return null;const s=new _o(this[r(377)][r(342)],n,!!t[r(363)]);return t[r(363)]&&this[r(311)](s,r(301),()=>{const e=r;t[e(363)](n,s[e(350)])}),s}),this[e(403)][e(349)][e(324)](this[e(314)]),this[e(403)][e(347)]({target:this[e(368)][e(355)][e(350)]}),n[e(356)](),n[e(333)]();const r=(t,n)=>{const r=e;this[r(334)](),this[r(368)][r(355)][r(356)](),n()};n[e(397)][e(327)](e(323),r),n[e(397)][e(327)](e(328),r),n[e(397)][e(327)](e(393),(t,n)=>{const r=e;!function(e){const t=Vo,n=["a",t(344),t(336),t(375),t(389),t(329),t(358)][t(388)](e=>e+t(383))[t(343)](","),r=[...document[t(395)][t(382)](n)][t(316)](e=>e===document[t(357)]||e[t(381)]+e[t(384)]>0)[t(315)]((e,n)=>(e[t(394)]||0)-(n[t(394)]||0)),s=r[t(386)](e),o=r[(s+1)%r[t(400)]];o&&o[t(356)]()}(this[r(368)][r(350)]),this[r(334)](),n()}),n[e(326)][e(324)](this[e(368)][e(350)]),n[e(326)].on(e(330),(t,n,r)=>{r||this[e(334)]()})}[xo(334)](){const e=xo;this[e(314)]&&(this[e(368)][e(355)][e(385)]=!1,this[e(403)][e(300)](),this[e(403)][e(349)][e(378)](this[e(314)]),this[e(314)][e(320)](),this[e(314)]=void 0)}[xo(320)](){const e=xo;super[e(320)](),this[e(368)]&&this[e(368)][e(379)]&&this[e(368)][e(320)](),this[e(340)]&&(this[e(340)][e(366)](),this[e(340)][e(320)](),this[e(340)]=null)}}function Uo(e,t){var n=qo();return(Uo=function(e,t){return n[e-=419]})(e,t)}var Jo=Uo;function qo(){var e=["7qbkSSh","requires","12ZAUWQE","593830MXzxsc","140pyrgjE","3966760oDbJgK","isPremiumPlugin","PresenceList","304162TpMALG","3615975CLDHrh","isOfficialPlugin","pluginName","173532phRDcq","696624BgeWft","34801300LmVIKb"];return(qo=function(){return e})()}!function(e){for(var t=Uo,n=e();;)try{if(965323===-parseInt(t(432))/1+-parseInt(t(422))/2*(parseInt(t(431))/3)+-parseInt(t(419))/4+-parseInt(t(433))/5*(parseInt(t(426))/6)+parseInt(t(429))/7*(parseInt(t(427))/8)+parseInt(t(423))/9+parseInt(t(428))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(qo);class Go extends t.ContextPlugin{static get[Jo(430)](){return[Qn,Bo]}static get[Jo(425)](){return Jo(421)}static get[Jo(424)](){return!0}static get[Jo(420)](){return!0}}function Lo(e,t){var n=Yo();return(Lo=function(e,t){return n[e-=286]})(e,t)}function Yo(){var e=["288748KhlDFx","3038966WRmVqR","98092FGyPGS","3799030vaRPvK","3811152bUGOuH","8GpcGOz","44ciotHV","5385816RzFque","10mFzOFK","1557369GnqcBm","2pgwbQs"];return(Yo=function(){return e})()}!function(e){for(var t=Lo,n=e();;)try{if(363417===-parseInt(t(293))/1+parseInt(t(292))/2*(-parseInt(t(291))/3)+parseInt(t(295))/4*(parseInt(t(290))/5)+parseInt(t(286))/6+parseInt(t(294))/7*(-parseInt(t(287))/8)+-parseInt(t(289))/9+-parseInt(t(296))/10*(-parseInt(t(288))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Yo)})(),(window.CKEditor5=window.CKEditor5||{}).realTimeCollaboration=__webpack_exports__})();