@ckeditor/ckeditor5-real-time-collaboration 44.3.0-alpha.3 → 44.3.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/real-time-collaboration.js +1 -1
- package/dist/index.js +6 -6
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +14 -14
- package/src/common-translations.js +1 -1
- package/src/index.js +1 -1
- package/src/presencelist/presencelistui.js +1 -1
- package/src/presencelist/view/presencecounterview.js +1 -1
- package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
- package/src/presencelist/view/presencedropdownlistview.js +1 -1
- package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
- package/src/presencelist/view/presenceinlinelistview.js +1 -1
- package/src/presencelist/view/presencelistview.js +1 -1
- package/src/presencelist.js +1 -1
- package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +1 -1
- package/src/realtimecollaborativecomments.js +1 -1
- package/src/realtimecollaborativeediting/realtimecollaborationclient.js +1 -1
- package/src/realtimecollaborativeediting/sessions.js +1 -1
- package/src/realtimecollaborativeediting/usermarkers.js +1 -1
- package/src/realtimecollaborativeediting/websocketgateway.js +1 -1
- package/src/realtimecollaborativeediting.js +1 -1
- package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +1 -1
- package/src/realtimecollaborativerevisionhistory.js +1 -1
- package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +1 -1
- package/src/realtimecollaborativetrackchanges.js +1 -1
|
@@ -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: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}.ck.ck-presence-list__counter{color:var(--ck-color-base-text);margin-right:var(--ck-spacing-large)}.ck.ck-presence-list__counter--hidden{display:none}.ck.ck-presence-list__list-item{background:none;border:1px solid transparent;color:inherit;font:inherit;margin-left:var(--ck-spacing-small);outline:none;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-tooltip.ck-presence-list__list-item__tooltip>.ck-tooltip__text{display:inline-block;max-width:var(--ck-presence-list-users-tooltip-max-width);overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.ck.ck-presence-list__marker{display:block;height:3px;margin-top:3px;position:relative;width:100%}.ck-presence-list__balloon button.ck-presence-list__dropdown-list-item *,.ck-presence-list__list button.ck-presence-list__list-item *{cursor:pointer}.ck.ck-presence-list--collapsed .ck-presence-list__list{border:1px solid transparent;min-width:calc(var(--ck-user-avatar-size)*2)}.ck.ck-presence-list--collapsed .ck-presence-list__list *{cursor:pointer;transition:all .4s ease-in-out}.ck.ck-presence-list--collapsed .ck-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)*-1 + 7px);padding: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:nth-last-child(2){opacity:.75}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(3){opacity:.55}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(4){opacity:.35}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(5){opacity:.15}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(n+6){display:none}.ck.ck-presence-list__balloon{--ck-color-panel-border:var(--ck-color-presence-list-dropdown-arrow-border);--ck-color-panel-background:var(--ck-color-presence-list-dropdown-background);animation:fadeIn .3s ease-in-out;background-color:var(--ck-color-presence-list-dropdown-background);border:0;opacity:1}@media (prefers-reduced-motion:reduce){.ck.ck-presence-list__balloon{animation:none}}.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}@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,v=this,I=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,v.slashes=a.slashes||o&&t.slashes,v.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(v.protocol)))&&(O[3]=[/(.*)/,"pathname"]);I<O.length;I++)"function"!=typeof(d=O[I])?(c=d[0],b=d[1],c!=c?v[b]=e:"string"==typeof c?~(h="@"===c?e.lastIndexOf(c):e.indexOf(c))&&("number"==typeof d[2]?(v[b]=e.slice(0,h),e=e.slice(h+d[2])):(v[b]=e.slice(h),e=e.slice(0,h))):(h=c.exec(e))&&(v[b]=h[1],e=e.slice(0,h.index)),v[b]=v[b]||o&&d[3]&&t[b]||"",d[4]&&(v[b]=v[b].toLowerCase())):e=d(e,v);n&&(v.query=n(v.query)),o&&t.slashes&&"/"!==v.pathname.charAt(0)&&(""!==v.pathname||""!==t.pathname)&&(v.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("/")}(v.pathname,t.pathname)),"/"!==v.pathname.charAt(0)&&m(v.protocol)&&(v.pathname="/"+v.pathname),r(v.port,v.protocol)||(v.host=v.hostname,v.port=""),v.username=v.password="",v.auth&&(~(h=v.auth.indexOf(":"))?(v.username=v.auth.slice(0,h),v.username=encodeURIComponent(decodeURIComponent(v.username)),v.password=v.auth.slice(h+1),v.password=encodeURIComponent(decodeURIComponent(v.password))):v.username=encodeURIComponent(decodeURIComponent(v.auth)),v.auth=v.password?v.username+":"+v.password:v.username),v.origin="file:"!==v.protocol&&m(v.protocol)&&v.host?v.protocol+"//"+v.host:"null",v.href=v.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:()=>td,CloudServicesRevisionHistoryAdapter:()=>Sd,CloudServicesTrackChangesAdapter:()=>dd,PresenceList:()=>yu,RealTimeCollaborationClient:()=>Gc,RealTimeCollaborativeComments:()=>md,RealTimeCollaborativeEditing:()=>Qc,RealTimeCollaborativeRevisionHistory:()=>Cd,RealTimeCollaborativeTrackChanges:()=>Od,Sessions:()=>ys});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{Decoder:()=>Ve,Encoder:()=>Re,PacketType:()=>xe,protocol:()=>De});var t=__webpack_require__(782),n=__webpack_require__(584),r=__webpack_require__(311),s=__webpack_require__(783);class o{constructor(...e){}}class i extends o{constructor(...e){super()}static fromJSON(e){throw new TypeError("Must be implemented in a child class!")}}i.TYPE="1000";const a=i;class c extends a{constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new c(e.id)}}c.TYPE="21",c.READABLE_TYPE_NAME="getUser",c.DESCRIPTOR_NAME="GetUserMessage",c.DESCRIPTOR={fields:{id:{type:"string",id:1}}};const d=c;class u extends a{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 u(t)}}u.DESCRIPTOR_NAME="GetUserResponse",u.DESCRIPTOR={fields:{attributes:{rule:"repeated",type:"KeyValueDescriptor",id:1}}};const l=u;var p=__webpack_require__(199);const h=(()=>{var e=p.Reader,t=p.Writer,n=p.util,r=p.roots.default||(p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.OperationMetadataDescriptor;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.userId=t.string();break;case 2:o.type=t.string();break;case 3:o.createdAt=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CollaborativeEditingConnectMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.bundleVersion=t.string();break;case 3:o.buffers&&o.buffers.length||(o.buffers=[]),o.buffers.push(t.bytes());break;case 4:if(o.types&&o.types.length||(o.types=[]),2==(7&i))for(var a=t.uint32()+t.pos;t.pos<a;)o.types.push(t.uint32());else o.types.push(t.uint32());break;case 5:o.lastOperationId=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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CollaborativeEditingReconnectMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.bundleVersion=t.string();break;case 3:o.lastKnowVersion=t.uint32();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CollaborativeEditingUpdateMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.baseVersion=t.uint32();break;case 3:o.buffers&&o.buffers.length||(o.buffers=[]),o.buffers.push(t.bytes());break;case 4:if(o.types&&o.types.length||(o.types=[]),2==(7&i))for(var a=t.uint32()+t.pos;t.pos<a;)o.types.push(t.uint32());else o.types.push(t.uint32());break;case 6:o.metadata&&o.metadata.length||(o.metadata=[]),o.metadata.push(r.OperationMetadataDescriptor.decode(t,t.uint32()));break;case 7:o.lastOperationId=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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.GetDocumentDetailsMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.documentId=t.string();break;case 2:o.environmentId=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CollaborativeEditingConnectResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.channel=t.string();break;case 2:o.offset=t.uint32();break;case 3:o.version=t.uint32();break;case 4:o.buffers&&o.buffers.length||(o.buffers=[]),o.buffers.push(t.bytes());break;case 5:if(o.types&&o.types.length||(o.types=[]),2==(7&i))for(var a=t.uint32()+t.pos;t.pos<a;)o.types.push(t.uint32());else o.types.push(t.uint32());break;case 7:o.metadata&&o.metadata.length||(o.metadata=[]),o.metadata.push(r.OperationMetadataDescriptor.decode(t,t.uint32()));break;case 8:o.initData=t.string();break;case 9:o.isInitialized=t.bool();break;case 10:o.sessionId=t.string();break;case 11:o.lastOperationId=t.string();break;case 12:o.sessionCreatedAt=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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CollaborativeEditingResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.version=t.uint32();break;case 2:o.buffers&&o.buffers.length||(o.buffers=[]),o.buffers.push(t.bytes());break;case 3:if(o.types&&o.types.length||(o.types=[]),2==(7&i))for(var a=t.uint32()+t.pos;t.pos<a;)o.types.push(t.uint32());else o.types.push(t.uint32());break;case 5:o.metadata&&o.metadata.length||(o.metadata=[]),o.metadata.push(r.OperationMetadataDescriptor.decode(t,t.uint32()));break;case 6:o.lastOperationId=t.string();break;case 7:o.lastOperationAcceptedAt=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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.GetDocumentDetailsResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.lastDocumentSessionId=t.string();break;case 2:o.lastDocumentSessionOperationId=t.string();break;case 3:o.currentDocumentSessionId=t.string();break;case 4:o.currentDocumentSessionVersion=t.uint32();break;case 5:o.currentDocumentSessionOperationId=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentDescriptor;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentId=t.string();break;case 2:o.commentThreadId=t.string();break;case 3:o.userId=t.string();break;case 4:o.content=t.string();break;case 5:o.documentId=t.string();break;case 6:o.createdAt=t.string();break;case 7:o.attributes=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsThreadDescriptor;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.comments&&o.comments.length||(o.comments=[]),o.comments.push(r.CommentDescriptor.decode(t,t.uint32()));break;case 3:o.resolvedAt=t.string();break;case 4:o.resolvedBy=t.string();break;case 5:o.context=t.string();break;case 6:o.createdAt=t.string();break;case 7:o.deletedAt=t.string();break;case 8:o.attributes=t.string();break;case 9:o.unlinkedAt=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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentThreadAddedCommentDescriptor;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentId=t.string();break;case 2:o.createdAt=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2AddCommentMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.content=t.string();break;case 3:o.documentId=t.string();break;case 4:o.commentId=t.string();break;case 5:o.createdAt=t.string();break;case 6:o.userId=t.string();break;case 7:o.attributes=t.string();break;case 8:o.commentThread=r.CommentsThreadDescriptor.decode(t,t.uint32());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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2AddCommentThreadMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.documentId=t.string();break;case 2:o.commentThreadId=t.string();break;case 3:o.context=t.string();break;case 4:o.createdAt=t.string();break;case 5:o.resolvedAt=t.string();break;case 6:o.resolvedBy=t.string();break;case 7:o.attributes=t.string();break;case 8:o.deletedAt=t.string();break;case 9:o.comments&&o.comments.length||(o.comments=[]),o.comments.push(r.CommentDescriptor.decode(t,t.uint32()));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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2ReopenCommentThreadMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.documentId=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2ResolveCommentThreadMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.documentId=t.string();break;case 3:o.resolvedBy=t.string();break;case 4:o.resolvedAt=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2UpdateCommentThreadMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.documentId=t.string();break;case 3:o.context=t.string();break;case 4:o.attributes=t.string();break;case 5:o.unlinkedAt=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2ConnectMessage;t.pos<s;){var i=t.uint32();i>>>3==1?o.documentId=t.string():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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2GetCommentThreadMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.documentId=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2GetDocumentThreadsMessage;t.pos<s;){var i=t.uint32();i>>>3==1?o.documentId=t.string():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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2RemoveCommentMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.commentId=t.string();break;case 3:o.documentId=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2RemoveCommentThreadMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.documentId=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2UpdateCommentMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.commentId=t.string();break;case 3:o.content=t.string();break;case 4:o.documentId=t.string();break;case 5:o.attributes=t.string();break;case 6:o.isAttributesUpdated=t.bool();break;case 7:o.commentThread=r.CommentsThreadDescriptor.decode(t,t.uint32());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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2AddCommentResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.commentId=t.string();break;case 3:o.createdAt=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2AddCommentThreadResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.createdAt=t.string();break;case 3:o.comments&&o.comments.length||(o.comments=[]),o.comments.push(r.CommentThreadAddedCommentDescriptor.decode(t,t.uint32()));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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2ResolveCommentThreadResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.documentId=t.string();break;case 3:o.resolvedAt=t.string();break;case 4:o.resolvedBy=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2ConnectResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.channel=t.string();break;case 2:o.threads&&o.threads.length||(o.threads=[]),o.threads.push(t.string());break;case 3:o.threadsV2&&o.threadsV2.length||(o.threadsV2=[]),o.threadsV2.push(r.CommentsThreadDescriptor.decode(t,t.uint32()));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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2GetCommentThreadResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.comments&&o.comments.length||(o.comments=[]),o.comments.push(t.string());break;case 3:o.commentsV2&&o.commentsV2.length||(o.commentsV2=[]),o.commentsV2.push(r.CommentDescriptor.decode(t,t.uint32()));break;case 4:o.resolvedAt=t.string();break;case 5:o.resolvedBy=t.string();break;case 6:o.context=t.string();break;case 7:o.createdAt=t.string();break;case 8:o.deletedAt=t.string();break;case 9:o.attributes=t.string();break;case 10:o.unlinkedAt=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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2GetDocumentThreadsResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.threads&&o.threads.length||(o.threads=[]),o.threads.push(t.string());break;case 2:o.threadsV2&&o.threadsV2.length||(o.threadsV2=[]),o.threadsV2.push(r.CommentsThreadDescriptor.decode(t,t.uint32()));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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.KeyValueDescriptor;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.key=t.string();break;case 2:o.value=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.IsEditorBundleUploadedMessage;t.pos<s;){var i=t.uint32();i>>>3==1?o.bundleVersion=t.string():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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.IsEditorBundleUploadedResponse;t.pos<s;){var i=t.uint32();i>>>3==1?o.isUploaded=t.bool():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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RevisionDescriptor;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.revisionId=t.string();break;case 2:o.name=t.string();break;case 3:o.creatorId=t.string();break;case 4:o.authorsIds=t.string();break;case 5:o.diffData=t.string();break;case 6:o.createdAt=t.string();break;case 7:o.attributes=t.string();break;case 8:o.toVersion=t.uint32();break;case 9:o.fromVersion=t.uint32();break;case 10:o.isEmptyCurrent=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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RevisionHistoryConnectMessage;t.pos<s;){var i=t.uint32();i>>>3==1?o.documentId=t.string():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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RevisionHistoryGetRevisionMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.documentId=t.string();break;case 2:o.revisionId=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RevisionHistoryReconnectMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.documentId=t.string();break;case 2:o.requestId=t.uint32();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RevisionHistoryUpdateRevisionsMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.documentId=t.string();break;case 2:o.requestId=t.uint32();break;case 3:o.revisions&&o.revisions.length||(o.revisions=[]),o.revisions.push(r.RevisionDescriptor.decode(t,t.uint32()));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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RevisionHistoryConnectResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.channel=t.string();break;case 2:o.requestId=t.uint32();break;case 3:o.revisions&&o.revisions.length||(o.revisions=[]),o.revisions.push(r.RevisionDescriptor.decode(t,t.uint32()));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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RevisionHistoryGetRevisionResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.revisionId=t.string();break;case 2:o.name=t.string();break;case 3:o.creatorId=t.string();break;case 4:o.authorsIds=t.string();break;case 5:o.diffData=t.string();break;case 6:o.createdAt=t.string();break;case 7:o.attributes=t.string();break;case 8:o.toVersion=t.uint32();break;case 9:o.fromVersion=t.uint32();break;case 10:o.isEmptyCurrent=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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RevisionHistoryUpdateRevisionsResponse;t.pos<s;){var i=t.uint32();i>>>3==1?o.requestId=t.uint32():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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.SessionsSocketDescriptor;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.session=t.string();break;case 2:o.user=t.string();break;case 3:o.role=t.string();break;case 4:o.permissions&&o.permissions.length||(o.permissions=[]),o.permissions.push(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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.SessionsConnectMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.sessionType=t.uint32();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.SocketConnectMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.userId=t.string();break;case 3:o.role=t.string();break;case 4:o.permissions&&o.permissions.length||(o.permissions=[]),o.permissions.push(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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.SocketDisconnectMessage;t.pos<s;){var i=t.uint32();i>>>3==1?o.id=t.string():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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.SessionsConnectResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.channel=t.string();break;case 2:o.sockets&&o.sockets.length||(o.sockets=[]),o.sockets.push(r.SessionsSocketDescriptor.decode(t,t.uint32()));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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.SuggestionDescriptor;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.authorId=t.string();break;case 3:o.type=t.string();break;case 4:o.createdAt=t.string();break;case 5:o.data=t.string();break;case 6:o.hasComments=t.bool();break;case 7:o.state=t.string();break;case 8:o.attributes=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.TrackChangesAddSuggestionMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.documentId=t.string();break;case 3:o.type=t.string();break;case 4:o.data=t.string();break;case 5:o.originalSuggestionId=t.string();break;case 6:o.attributes=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.TrackChangesBatchUpdateSuggestionsStateMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.ids&&o.ids.length||(o.ids=[]),o.ids.push(t.string());break;case 2:o.documentId=t.string();break;case 3:o.state=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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.TrackChangesConnectMessage;t.pos<s;){var i=t.uint32();i>>>3==1?o.documentId=t.string():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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.TrackChangesGetAllSuggestionMessage;t.pos<s;){var i=t.uint32();i>>>3==1?o.documentId=t.string():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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.TrackChangesGetSuggestionMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.documentId=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.TrackChangesUpdateSuggestionMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.documentId=t.string();break;case 3:o.hasComments=t.bool();break;case 4:o.isHasCommentsModified=t.bool();break;case 5:o.state=t.string();break;case 6:o.attributes=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.TrackChangesAddSuggestionResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.authorId=t.string();break;case 3:o.type=t.string();break;case 4:o.createdAt=t.string();break;case 5:o.data=t.string();break;case 6:o.hasComments=t.bool();break;case 7:o.state=t.string();break;case 8:o.attributes=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.TrackChangesConnectResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.channel=t.string();break;case 2:o.suggestions&&o.suggestions.length||(o.suggestions=[]),o.suggestions.push(t.string());break;case 3:o.suggestionsV2&&o.suggestionsV2.length||(o.suggestionsV2=[]),o.suggestionsV2.push(r.SuggestionDescriptor.decode(t,t.uint32()));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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.TrackChangesGetAllSuggestionsResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.suggestions&&o.suggestions.length||(o.suggestions=[]),o.suggestions.push(t.string());break;case 2:o.suggestionsV2&&o.suggestionsV2.length||(o.suggestionsV2=[]),o.suggestionsV2.push(r.SuggestionDescriptor.decode(t,t.uint32()));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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.TrackChangesGetSuggestionResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.authorId=t.string();break;case 3:o.type=t.string();break;case 4:o.createdAt=t.string();break;case 5:o.data=t.string();break;case 6:o.hasComments=t.bool();break;case 7:o.state=t.string();break;case 8:o.attributes=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.UserDescriptor;t.pos<s;){var i=t.uint32();i>>>3==1?(o.attributes&&o.attributes.length||(o.attributes=[]),o.attributes.push(r.KeyValueDescriptor.decode(t,t.uint32()))):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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.GetManyUsersMessage;t.pos<s;){var i=t.uint32();i>>>3==1?(o.ids&&o.ids.length||(o.ids=[]),o.ids.push(t.string())):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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.GetUserMessage;t.pos<s;){var i=t.uint32();i>>>3==1?o.id=t.string():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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.GetManyUsersResponse;t.pos<s;){var i=t.uint32();i>>>3==1?(o.users&&o.users.length||(o.users=[]),o.users.push(r.UserDescriptor.decode(t,t.uint32()))):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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.GetUserResponse;t.pos<s;){var i=t.uint32();i>>>3==1?(o.attributes&&o.attributes.length||(o.attributes=[]),o.attributes.push(r.KeyValueDescriptor.decode(t,t.uint32()))):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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.ChannelMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.type=t.uint32();break;case 2:o.socketId=t.string();break;case 3:o.data=t.bytes();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.BytesBytesPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.bytes();break;case 2:o.data1=t.bytes();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.NumberBytesPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.uint32();break;case 2:o.data1=t.bytes();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.NumberNumberPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.uint32();break;case 2:o.data1=t.uint32();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.NumberObjectPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.uint32();break;case 2:o.data1=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.NumberStringPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.uint32();break;case 2:o.data1=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.ObjectBufferPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.string();break;case 2:o.data1=t.bytes();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.ObjectObjectPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.string();break;case 2:o.data1=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.PacketMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.type=t.uint32();break;case 2:o.id=t.uint32();break;case 3:o.nsp=t.string();break;case 4:o.data=t.bytes();break;case 5:o.options=t.bytes();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.PacketOptionsMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.flags=t.string();break;case 2:o.rooms&&o.rooms.length||(o.rooms=[]),o.rooms.push(t.string());break;case 3:o.except&&o.except.length||(o.except=[]),o.except.push(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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.StringBytesPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.string();break;case 2:o.data1=t.bytes();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.StringNumberPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.string();break;case 2:o.data1=t.uint32();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.StringObjectPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.string();break;case 2:o.data1=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.StringStringPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.string();break;case 2:o.data1=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){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,p.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringStringPacketDataMessage"},s}(),r})();class f{static decode(e,t){const n=m(t).decode("undefined"==typeof window?e:new Uint8Array(e));return t.fromJSON({...n})}static encode(e){const t=m(e.constructor),n=e.toJSON(),r=t.verify(n);if(r)throw Error(r);return t.encode(t.create(n)).finish()}}function m(e){return h[e.DESCRIPTOR_NAME]}class y extends a{constructor(e){super(),this.ids=e}toJSON(){return{ids:this.ids}}static fromJSON(e){return new y(e.ids)}}y.TYPE="22",y.READABLE_TYPE_NAME="getManyUsers",y.DESCRIPTOR_NAME="GetManyUsersMessage",y.DESCRIPTOR={fields:{ids:{id:1,type:"string",rule:"repeated"}}};const g=y;class b extends a{constructor(e){super(),this.users=e}toJSON(){return{users:this.users.map(w)}}static fromJSON(e){return new b(e.users.map(v))}}b.DESCRIPTOR_NAME="GetManyUsersResponse",b.DESCRIPTOR={fields:{users:{rule:"repeated",type:"UserDescriptor",id:1}}};const O=b;function w(e){return{attributes:Object.keys(e).map((t=>({key:t,value:JSON.stringify(e[t])})))}}function v(e){return e.attributes.reduce(((e,t)=>(e[t.key]=t.value?JSON.parse(t.value):null,e)),{})}class I{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 I(e)}static async get(e,t){const n=new d(t);try{const t=await e._sendRequest(I._SERVICE,d.TYPE,f.encode(n)),r=f.decode(t,l);return new I(r.attributes)}catch(e){return new I({id:t})}}static async getMany(e,t){const n=new g(t);try{const t=await e._sendRequest(I._SERVICE,g.TYPE,f.encode(n));return f.decode(t,O).users.map((e=>new I(e)))}catch(e){return t.map((e=>new I({id:e})))}}}I._SERVICE=2;const S=I,P=Object.create(null);P.open="0",P.close="1",P.ping="2",P.pong="3",P.message="4",P.upgrade="5",P.noop="6";const k=Object.create(null);Object.keys(P).forEach((e=>{k[P[e]]=e}));const A={type:"error",data:"parser error"},_="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),T="function"==typeof ArrayBuffer,C=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,j=({type:e,data:t},n,r)=>_&&t instanceof Blob?n?r(t):E(t,r):T&&(t instanceof ArrayBuffer||C(t))?n?r(t):E(new Blob([t]),r):r(P[e]+(t||"")),E=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)};function D(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let x;const R="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)N[R.charCodeAt(e)]=e;const V="function"==typeof ArrayBuffer,M=(e,t)=>{if("string"!=typeof e)return{type:"message",data:B(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:U(e.substring(1),t)};return k[n]?e.length>1?{type:k[n],data:e.substring(1)}:{type:k[n]}:A},U=(e,t)=>{if(V){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=N[e.charCodeAt(t)],r=N[e.charCodeAt(t+1)],s=N[e.charCodeAt(t+2)],o=N[e.charCodeAt(t+3)],u[c++]=n<<2|r>>4,u[c++]=(15&r)<<4|s>>2,u[c++]=(3&s)<<6|63&o;return d})(e);return B(n,t)}return{base64:!0,data:e}},B=(e,t)=>"blob"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,J=String.fromCharCode(30);function q(){return new TransformStream({transform(e,t){!function(e,t){_&&e.data instanceof Blob?e.data.arrayBuffer().then(D).then(t):T&&(e.data instanceof ArrayBuffer||C(e.data))?t(D(e.data)):j(e,!1,(e=>{x||(x=new TextEncoder),t(x.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 G;function L(e){return e.reduce(((e,t)=>e+t.length),0)}function H(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 z(e){if(e)return function(e){for(var t in z.prototype)e[t]=z.prototype[t];return e}(e)}z.prototype.on=z.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},z.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},z.prototype.off=z.prototype.removeListener=z.prototype.removeAllListeners=z.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},z.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},z.prototype.emitReserved=z.prototype.emit,z.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},z.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Y="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function F(e,...t){return t.reduce(((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const K=Y.setTimeout,W=Y.clearTimeout;function Q(e,t){t.useNativeTimers?(e.setTimeoutFn=K.bind(Y),e.clearTimeoutFn=W.bind(Y)):(e.setTimeoutFn=Y.setTimeout.bind(Y),e.clearTimeoutFn=Y.clearTimeout.bind(Y))}class $ extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class Z extends z{constructor(e){super(),this.writable=!1,Q(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new $(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=M(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 X="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),ee={};let te,ne=0,re=0;function se(e){let t="";do{t=X[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function oe(){const e=se(+new Date);return e!==te?(ne=0,te=e):e+"."+se(ne++)}for(;re<64;re++)ee[X[re]]=re;let ie=!1;try{ie="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}const ae=ie;function ce(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||ae))return new XMLHttpRequest}catch(e){}if(!t)try{return new(Y[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}function de(){}const ue=null!=new ce({xdomain:!1}).responseType;class le extends z{constructor(e,t){super(),Q(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=F(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd;const n=this.xhr=new ce(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=le.requestsCount++,le.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=de,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete le.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(le.requestsCount=0,le.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",pe);else if("function"==typeof addEventListener){addEventListener("onpagehide"in Y?"pagehide":"unload",pe,!1)}function pe(){for(let e in le.requests)le.requests.hasOwnProperty(e)&&le.requests[e].abort()}const he="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),fe=Y.WebSocket||Y.MozWebSocket,me="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const ye={websocket:class extends Z{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=me?{}:F(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=me?new fe(e,t,n):t?new fe(e,t):new fe(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;j(n,this.supportsBinary,(e=>{try{this.ws.send(e)}catch(e){}r&&he((()=>{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]=oe()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}check(){return!!fe}},webtransport:class extends Z{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){G||(G=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(L(n)<1)break;const e=H(n,1);o=!(128&~e[0]),s=127&e[0],r=s<126?3:126===s?1:2}else if(1===r){if(L(n)<2)break;const e=H(n,2);s=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(2===r){if(L(n)<8)break;const e=H(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),o=t.getUint32(0);if(o>Math.pow(2,21)-1){a.enqueue(A);break}s=o*Math.pow(2,32)+t.getUint32(4),r=3}else{if(L(n)<s)break;const e=H(n,s);a.enqueue(M(o?e:G.decode(e),t)),r=0}if(0===s||s>e){a.enqueue(A);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=q();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&&he((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var e;null===(e=this.transport)||void 0===e||e.close()}},polling:class extends Z{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=ue&&!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(J),r=[];for(let e=0;e<n.length;e++){const s=M(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)=>{j(e,!1,(e=>{r[o]=e,++s===n&&t(r.join(J))}))}))})(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]=oe()),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 le(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}}},ge=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,be=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Oe(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=ge.exec(e||""),o={},i=14;for(;i--;)o[be[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 we extends z{constructor(e,t={}){super(),this.binaryType="arraybuffer",this.writeBuffer=[],e&&"object"==typeof e&&(t=e,e=null),e?(e=Oe(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=Oe(t.host).host),Q(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 ye[e](n)}open(){let e;if(this.opts.rememberUpgrade&&we.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;we.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;we.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",we.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 n=0;n<this.writeBuffer.length;n++){const r=this.writeBuffer[n].data;if(r&&(e+="string"==typeof(t=r)?function(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}(t):Math.ceil(1.33*(t.byteLength||t.size))),n>0&&e>this.maxPayload)return this.writeBuffer.slice(0,n);e+=2}var t;return this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const s={type:e,data:t,options:n};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(e){we.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}}we.protocol=4;we.protocol;const ve="function"==typeof ArrayBuffer,Ie=Object.prototype.toString,Se="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Ie.call(Blob),Pe="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===Ie.call(File);function ke(e){return ve&&(e instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||Se&&e instanceof Blob||Pe&&e instanceof File}function Ae(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(Ae(e[t]))return!0;return!1}if(ke(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return Ae(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&Ae(e[t]))return!0;return!1}function _e(e){const t=[],n=e.data,r=e;return r.data=Te(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Te(e,t){if(!e)return e;if(ke(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]=Te(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]=Te(e[r],t));return n}return e}function Ce(e,t){return e.data=je(e.data,t),delete e.attachments,e}function je(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]=je(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=je(e[n],t));return e}const Ee=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],De=5;var xe;!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"}(xe||(xe={}));class Re{constructor(e){this.replacer=e}encode(e){return e.type!==xe.EVENT&&e.type!==xe.ACK||!Ae(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===xe.EVENT?xe.BINARY_EVENT:xe.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==xe.BINARY_EVENT&&e.type!==xe.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=_e(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}}function Ne(e){return"[object Object]"===Object.prototype.toString.call(e)}class Ve extends z{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===xe.BINARY_EVENT;n||t.type===xe.BINARY_ACK?(t.type=n?xe.EVENT:xe.ACK,this.reconstructor=new Me(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!ke(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===xe[n.type])throw new Error("unknown packet type "+n.type);if(n.type===xe.BINARY_EVENT||n.type===xe.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(!Ve.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 xe.CONNECT:return Ne(t);case xe.DISCONNECT:return void 0===t;case xe.CONNECT_ERROR:return"string"==typeof t||Ne(t);case xe.EVENT:case xe.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===Ee.indexOf(t[0]));case xe.ACK:case xe.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Me{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=Ce(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Ue(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Be=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Je extends z{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=[Ue(e,"open",this.onopen.bind(this)),Ue(e,"packet",this.onpacket.bind(this)),Ue(e,"error",this.onerror.bind(this)),Ue(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(Be.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const n={type:xe.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:xe.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 xe.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 xe.EVENT:case xe.BINARY_EVENT:this.onevent(e);break;case xe.ACK:case xe.BINARY_ACK:this.onack(e);break;case xe.DISCONNECT:this.ondisconnect();break;case xe.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:xe.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:xe.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 qe(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}qe.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)},qe.prototype.reset=function(){this.attempts=0},qe.prototype.setMin=function(e){this.ms=e},qe.prototype.setMax=function(e){this.max=e},qe.prototype.setJitter=function(e){this.jitter=e};class Ge extends z{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,Q(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 qe({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 we(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=Ue(t,"open",(function(){n.onopen(),e&&e()})),s=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},o=Ue(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(Ue(e,"ping",this.onping.bind(this)),Ue(e,"data",this.ondata.bind(this)),Ue(e,"error",this.onerror.bind(this)),Ue(e,"close",this.onclose.bind(this)),Ue(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){he((()=>{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 Je(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 Le={};function He(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=Oe(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=Le[s]&&o in Le[s].nsps;let a;return t.forceNew||t["force new connection"]||!1===t.multiplex||i?a=new Ge(r,t):(Le[s]||(Le[s]=new Ge(r,t)),a=Le[s]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}Object.assign(He,{Manager:Ge,Socket:Je,io:He,connect:He});var ze=__webpack_require__(835);class Ye extends a{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 Ye(e.type,e.socketId,e.data)}}Ye.DESCRIPTOR_NAME="ChannelMessage",Ye.DESCRIPTOR={fields:{type:{type:"uint32",id:1},socketId:{type:"string",id:2},data:{type:"bytes",id:3}}};const Fe=Ye,Ke=class extends((0,n.EmitterMixin)()){constructor(e,t,n){super(),this._channelName=e,this._wsGateway=t,this._socket=n,this._subscribeToChannel()}remove(){this._socket.off(this._channelName)}getEventName(e,t=!1){let n="";return t&&(n+="all:"),n+="event",e&&(n+=":"+e),n}_subscribeToChannel(){this._socket.on(this._channelName,(e=>{const t=f.decode(e,Fe);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 We extends Error{constructor(e,t,n=null,r={}){super("cloud-services-internal-error: "+e),this.context=t,this.code=n,this.data=r,this.name="CKEditorError"}static fromPublicError(e){return new We(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 Qe extends Error{constructor(e,t){super(),this.name="CKEditorCloudServicesServerError",this.stack=void 0,this.message=e,this.code=t.code,this.traceId=t.traceId,this.data=t.data}static fromPublicError(e){return new Qe(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 $e extends a{constructor(e,t=[],n=[]){super(),this.flags=e,this.rooms=t,this.except=n}toJSON(){var e,t;return{flags:this.flags?JSON.stringify(this.flags):void 0,rooms:(null===(e=this.rooms)||void 0===e?void 0:e.length)?this.rooms:void 0,except:(null===(t=this.except)||void 0===t?void 0:t.length)?this.except:void 0}}static fromJSON(e){return new $e(e.flags&&JSON.parse(e.flags),e.rooms,e.except)}}$e.TYPE=11,$e.DESCRIPTOR_NAME="PacketOptionsMessage",$e.DESCRIPTOR={fields:{flags:{type:"string",id:1},rooms:{type:"string",id:2,rule:"repeated"},except:{type:"string",id:3,rule:"repeated"}}};const Ze=$e,Xe=(()=>!("undefined"==typeof process||!process.versions||!process.versions.node))(),et=1,tt=2,nt=3,rt=4;class st{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(st.isBuffer(e))return et;const t=typeof e;return"string"===t?tt:"number"===t?nt:rt}static isBuffer(e){return Xe&&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 ot extends a{static create(e,t){throw new TypeError("Must be implemented in a child class!")}}class it extends ot{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new it(e.data,e.data1)}static create(e,t){return new it(e,t)}}it.TYPE=(()=>st.getPacketType(nt,et))(),it.DESCRIPTOR_NAME="NumberBytesPacketDataMessage",it.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"bytes",id:2}}};const at=it;class ct extends ot{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)}}ct.TYPE=(()=>st.getPacketType(tt,et))(),ct.DESCRIPTOR_NAME="StringBytesPacketDataMessage",ct.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};const dt=ct;class ut extends ot{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)}}ut.TYPE=(()=>st.getPacketType(et,et))(),ut.DESCRIPTOR_NAME="BytesBytesPacketDataMessage",ut.DESCRIPTOR={fields:{data:{type:"bytes",id:1},data1:{type:"bytes",id:2}}};const lt=ut;class pt extends ot{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 pt(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new pt(e,t)}}pt.TYPE=(()=>st.getPacketType(tt,rt))(),pt.DESCRIPTOR_NAME="StringObjectPacketDataMessage",pt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};const ht=pt;class ft extends ot{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 ft(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new ft(e,t)}}ft.TYPE=(()=>st.getPacketType(nt,rt))(),ft.DESCRIPTOR_NAME="NumberObjectPacketDataMessage",ft.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};const mt=ft;class yt extends ot{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 yt(e.data&&JSON.parse(e.data),e.data1&&JSON.parse(e.data1))}static create(e,t){return new yt(e,t)}}yt.TYPE=(()=>st.getPacketType(rt,rt))(),yt.DESCRIPTOR_NAME="ObjectObjectPacketDataMessage",yt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};const gt=yt;class bt extends ot{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1}}static fromJSON(e){return new bt(e.data&&JSON.parse(e.data),e.data1)}static create(e,t){return new bt(e,t)}}bt.TYPE=(()=>st.getPacketType(rt,et))(),bt.DESCRIPTOR_NAME="ObjectBufferPacketDataMessage",bt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};const Ot=bt;class wt extends ot{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new wt(e.data,e.data1)}static create(e,t){return new wt(e,t)}}wt.TYPE=(()=>st.getPacketType(tt,tt))(),wt.DESCRIPTOR_NAME="StringStringPacketDataMessage",wt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};const vt=wt;class It extends ot{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new It(e.data,e.data1)}static create(e,t){return new It(e,t)}}It.TYPE=(()=>st.getPacketType(tt,nt))(),It.DESCRIPTOR_NAME="StringNumberPacketDataMessage",It.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"uint32",id:2}}};const St=It;class Pt extends ot{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new Pt(e.data,e.data1)}static create(e,t){return new Pt(e,t)}}Pt.TYPE=(()=>st.getPacketType(nt,nt))(),Pt.DESCRIPTOR_NAME="NumberNumberPacketDataMessage",Pt.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"uint32",id:2}}};const kt=Pt;class At extends ot{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new At(e.data,e.data1)}static create(e,t){return new At(e,t)}}At.TYPE=(()=>st.getPacketType(nt,tt))(),At.DESCRIPTOR_NAME="NumberStringPacketDataMessage",At.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};const _t=At,Tt=(()=>[at,dt,lt,ht,mt,gt,Ot,vt,St,kt,_t].reduce(((e,t)=>(e[t.TYPE]=t,e)),{}))();class Ct extends a{constructor(e,t,n,r="/",s){super(),this.type=e,this.data=t,this.id=n,this.nsp=r,this.options=null!=s?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=f.encode(this.options),t=f.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 Ct(e.type-10*t,f.decode(e.data,Tt[t]),e.id,e.nsp,e.options?f.decode(e.options,Ze):new Ze)}static create(e,t={}){var n;const r=st.getPacketType(st.getType(e.data[0]),st.getType(null!==(n=e.data[1])&&void 0!==n?n:e.data[0]));return new Ct(e.type,Tt[r].create(e.data[0],e.data[1]),e.id,e.nsp,new Ze(t.flags,t.rooms,t.except))}}Ct.TYPE=10,Ct.DESCRIPTOR_NAME="PacketMessage",Ct.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}}};const jt=Ct;class Et{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 f.encode(jt.create(o,s))}decode(e){const t=f.decode(e,jt);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 Dt=(()=>[xe.EVENT,xe.ACK,xe.BINARY_ACK,xe.BINARY_EVENT])();class xt extends Re{constructor(e){super(),this._packetParser=null!=e?e:new Et}encode(e){if(Dt.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 Rt extends Ve{constructor(e){super(),this._packetParser=null!=e?e:new Et}add(e){if(!st.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 Nt{constructor(e,t){this._context=e,this._deferredPromise=function(){let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return{resolve:e,reject:t,promise:n}}(),this.timeout=setTimeout((()=>this.error(new We("Request timeout.",this._context))),t)}get promise(){return this._deferredPromise.promise}response(e){this._deferredPromise.resolve(e)}error(e){this._deferredPromise.reject(e)}}class Vt{constructor(e){this._context=e,this._requests=new Set}async send(e,t=45e3){const n=this._createRequest(t);try{return e(n),await n.promise}finally{this._finishRequest(n)}}errorAll(e){for(const t of this._requests)t.error(e)}waitForAllRequests(e=45e3){return this._waitForRequests(e)}_createRequest(e){const t=new Nt(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 Mt={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"};class Ut extends((0,n.ObservableMixin)()){constructor(e,t,n,r,s){if(super(),this._connectionAttempt=0,this._token=t,this._options=null!=n?n:{},this._connectionProvider=null!=r?r:He,this._userFactory=null!=s?s:S.get,this._requestsManager=new Vt(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=ze(e.replace(/^(?!(?:\w+:)?\/\/)/,"https://")),this.set("state",Mt.DISCONNECTED),this.set("socketId",void 0),this.set("me",void 0),this.on("change:state",(async(e,t,n)=>{var r;if(this._debugEvent("ws-gw:change:state",n),n!==Ut.STATE_CONNECTED){if(n===Ut.STATE_DISCONNECTED)return this._requestsManager.errorAll(new We("Not connected.",this))}else try{this.me=await this._userFactory.call(S,this,null===(r=this._socketAuth)||void 0===r?void 0:r.userId)}catch(e){}}),{priority:Ut._CHANGE_STATE_EVENT_PRIORITY}),this.on("error",((e,t)=>{this._options.onError?this._options.onError(t):console.error(t)}))}get sessionId(){return this.socketId}waitForAllRequests(e){return this._requestsManager.waitForAllRequests(e)}disconnect(){var e;this.state!==Mt.DISCONNECTED&&(null===(e=this._socket)||void 0===e||e.disconnect(),this._socket=void 0,this.state=Mt.DISCONNECTED)}async reconnect(){this._socket||this.state!==Mt.DISCONNECTED||(await this._token.refreshToken(),await this._connect())}static async connect(e,t="local.cs.dev:443/ws-v2",n={},r=He,s=S.get){const o=new Ut(t,e,n,r,s);return await o._connect(),o}_sendRequest(e,t,n){if(!e)throw new We("`serviceName` must be provided.",this);if(this.state!==Ut.STATE_CONNECTED)throw new We("Not connected.",this);if(!this._socketAuth||!this._socketAuth.isAuthenticated)throw new We("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 Ke(n,this,this._socket)),this._channels.get(n)}_connect(){return new Promise(((e,t)=>{const n=this._setupSocket();!this.socketId&&n.io.on("reconnect_error",(()=>{this._debugEvent("reconnect_error"),this._reconnectionAttemptError(t)})),n.once("connect",(async()=>{this._debugEvent("once-connect");try{await this._onConnect(),e()}catch(e){t(e)}})),n.connect()}))}_getPortByProtocol(e){return["http:","ws:"].includes(e)?80:443}_setupSocket(){var e;if(this._socket)return this._socket;const t=this._url.port||this._getPortByProtocol(this._url.protocol),n=(this._url.protocol||"https:")+"//"+this._url.hostname+":"+t,r=this._url.pathname.match(/^\/.*\/ws/)?this._url.pathname.split("/ws")[0]:"",s=this._connectionProvider(n,{parser:{Encoder:xt,Decoder:Rt},path:r+"/ws-v2/ws",transports:["websocket"],timeout:void 0!==this._options.timeout?this._options.timeout:5e3,reconnection:void 0===this._options.autoReconnect||this._options.autoReconnect,reconnectionDelay:1e3,reconnectionDelayMax:5e3,rejectUnauthorized:void 0===this._options.rejectUnauthorized||this._options.rejectUnauthorized,query:{version:"52.6.11"},agent:null!==(e=this._options.agent)&&void 0!==e&&e,closeOnBeforeunload:!1});return this.state=Mt.CONNECTING,s.on("connect",(()=>{this._debugEvent("connect"),this.socketId=s.id})),s.on("connect_error",(e=>{this._debugEvent("connect_error",e)})),s.on("disconnect",(()=>{this._debugEvent("disconnect"),this._onDisconnect()})),s.io.on("reconnect",(async()=>{this._debugEvent("reconnect"),await this._onReconnect()})),s.io.on("reconnect_attempt",(e=>{this._debugEvent("reconnect_attempt",e),this.state=Mt.CONNECTING,this._connectionAttempt=e})),s.on("unauthorized",(e=>{this._debugEvent("unauthorized"),this._onUnauthorized(e)})),s.on("authenticationRequest",(async e=>{this._debugEvent("authenticationRequest",e.attempt),await this._onReconnect()})),this._socket=s,s}_emit(e,t){const n=this._socket;return this._requestsManager.send((r=>{n.emit(e,t,((e,t)=>{if(e)return r.error(Qe.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=Mt.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=Mt.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(We.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",Qe.fromPublicError(e))}async _authenticate(e){try{this._debugEvent("authenticate:start");const t=await this._emit(2,{token:e});this._debugEvent("authenticate:success","envId: "+t.environmentId+", userId: "+t.userId),this._addAuthData(t.environmentId,t.userId)}catch(e){throw this._debugEvent("authenticate:error",e.message),this._removeAuthData(),e}}_isDebugModeEnabled(){var e;return!!n.global.window.localStorage&&"true"===(null!==(e=n.global.window.localStorage.getItem("csClientDebugMode"))&&void 0!==e?e:"false").toLowerCase()}}Ut.STATE_DISCONNECTED=(()=>Mt.DISCONNECTED)(),Ut.STATE_CONNECTING=(()=>Mt.CONNECTING)(),Ut.STATE_CONNECTED=(()=>Mt.CONNECTED)(),Ut._CHANGE_STATE_EVENT_PRIORITY=(()=>n.priorities.get("highest")+999999)();const Bt=Ut;class Jt extends a{constructor(e){super(),this.bundleVersion=e}toJSON(){return{bundleVersion:this.bundleVersion}}static fromJSON(e){return new Jt(e.bundleVersion)}}Jt.TYPE="131",Jt.READABLE_TYPE_NAME="isEditorBundleUploaded",Jt.DESCRIPTOR_NAME="IsEditorBundleUploadedMessage",Jt.DESCRIPTOR={fields:{bundleVersion:{type:"string",id:1}}};const qt=Jt;class Gt extends a{constructor(e){super(),this.isUploaded=e}toJSON(){return{isUploaded:this.isUploaded}}static fromJSON(e){return new Gt(e.isUploaded)}}Gt.DESCRIPTOR_NAME="IsEditorBundleUploadedResponse",Gt.DESCRIPTOR={fields:{isUploaded:{type:"bool",id:1}}};const Lt=Gt;class Ht extends((0,n.EmitterMixin)()){static async isBundleUploaded(e,t){const n=new qt(t);if(e.state!==Mt.CONNECTED)throw new We("WebSocket Gateway is not connected.",e);const r=await e._sendRequest(Ht._SERVICE,qt.TYPE,f.encode(n));return f.decode(r,Lt).isUploaded}}Ht._SERVICE=13;const zt=Ht;class Yt extends a{constructor(e,t){super(),this.documentId=e,this.revisionId=t}toJSON(){return{documentId:this.documentId,revisionId:this.revisionId}}static fromJSON(e){return new Yt(e.documentId,e.revisionId)}}Yt.TYPE="123",Yt.READABLE_TYPE_NAME="getRevision",Yt.DESCRIPTOR_NAME="RevisionHistoryGetRevisionMessage",Yt.DESCRIPTOR={fields:{documentId:{type:"string",id:1},revisionId:{type:"string",id:2}}};const Ft=Yt;class Kt extends o{static create(e){return{revisionId:e.id,name:e.name,creatorId:e.creatorId,createdAt:e.createdAt,fromVersion:e.fromVersion,toVersion:e.toVersion,isEmptyCurrent:e.isEmptyCurrent,diffData:e.diffData?JSON.stringify(e.diffData):void 0,attributes:e.attributes,authorsIds:e.authorsIds}}static toJSON(e){var t;return{revisionId:e.revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.stringify(e.authorsIds):void 0,diffData:e.diffData,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):void 0,toVersion:e.toVersion,fromVersion:e.fromVersion,isEmptyCurrent:e.isEmptyCurrent}}static fromJSON(e){return{revisionId:(e={...e}).revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.parse(e.authorsIds):void 0,diffData:e.diffData,createdAt:e.createdAt?new Date(e.createdAt):void 0,attributes:e.attributes?JSON.parse(e.attributes):void 0,toVersion:e.toVersion,fromVersion:e.fromVersion,isEmptyCurrent:e.isEmptyCurrent}}static toObject(e){return function(e){for(const[t,n]of Object.entries(e))void 0===n&&delete e[t];return e}({id:e.revisionId,name:e.name,creatorId:e.creatorId,createdAt:e.createdAt,fromVersion:e.fromVersion,toVersion:e.toVersion,isEmptyCurrent:e.isEmptyCurrent,diffData:e.diffData?JSON.parse(e.diffData):void 0,attributes:e.attributes,authorsIds:e.authorsIds})}}Kt.DESCRIPTOR_NAME="RevisionDescriptor",Kt.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}}};const Wt=Kt;class Qt extends a{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 Wt.toJSON(this)}toObject(){return Wt.toObject(this)}static create(e){return new Qt(e.revisionId,e.name,e.creatorId,e.authorsIds,e.createdAt,e.diffData,e.attributes,e.fromVersion,e.toVersion,e.isEmptyCurrent)}static fromJSON(e){return new Qt(e.revisionId,e.name,e.creatorId,e.authorsIds?JSON.parse(e.authorsIds):void 0,e.createdAt?new Date(e.createdAt):void 0,e.diffData,e.attributes?JSON.parse(e.attributes):void 0,e.fromVersion,e.toVersion,e.isEmptyCurrent)}}Qt.DESCRIPTOR_NAME="RevisionHistoryGetRevisionResponse",Qt.DESCRIPTOR=Wt.DESCRIPTOR;const $t=Qt;class Zt extends a{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(Wt.toJSON)}}toObject(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(Wt.toObject)}}static create(e){return new Zt(e.documentId,e.requestId,e.revisions.map(Wt.create))}static fromJSON(e){return new Zt(e.documentId,e.requestId,e.revisions.map(Wt.fromJSON))}}Zt.TYPE="124",Zt.READABLE_TYPE_NAME="updateRevisions",Zt.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsMessage",Zt.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};const Xt=Zt;class en extends a{constructor(e){super(),this.requestId=e}toJSON(){return{requestId:this.requestId}}static fromJSON(e){return new en(e.requestId)}}en.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsResponse",en.DESCRIPTOR={fields:{requestId:{type:"uint32",id:1}}};const tn=en;class nn extends a{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new nn(e.documentId)}}nn.TYPE="121",nn.READABLE_TYPE_NAME="connectToRevisionHistory",nn.DESCRIPTOR_NAME="RevisionHistoryConnectMessage",nn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};const rn=nn;class sn extends a{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(Wt.toJSON)}}toObject(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(Wt.toObject)}}static fromJSON(e){return new sn(e.channel,e.requestId,e.revisions.map(Wt.fromJSON))}}sn.DESCRIPTOR_NAME="RevisionHistoryConnectResponse",sn.DESCRIPTOR={fields:{channel:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};const on=sn;class an extends a{constructor(e,t){super(),this.documentId=e,this.requestId=t}toJSON(){return{documentId:this.documentId,requestId:this.requestId}}static fromJSON(e){return new an(e.documentId,e.requestId)}}an.TYPE="122",an.READABLE_TYPE_NAME="reconnectToRevisionHistory",an.DESCRIPTOR_NAME="RevisionHistoryReconnectMessage",an.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2}}};const cn=an;class dn extends We{constructor(e,t){super(e+" Service is not connected.",t)}}class un extends((0,n.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}connect(e){return this._isConnected?Promise.resolve():this._connect(e,new rn(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 We("Cannot reconnect to already connected service.",e);return this._connect(e,new cn(this._documentId,t))}async updateRevisions(e,t){const n=Xt.create({documentId:this._documentId,requestId:t,revisions:e}),r=await this._sendRequest(Xt.TYPE,n),{requestId:s}=f.decode(r,tn);return s}async getRevision(e){const t=new Ft(this._documentId,e),n=await this._sendRequest(Ft.TYPE,t);return f.decode(n,$t).toObject()}async _connect(e,t){if(e.state!==Mt.CONNECTED)throw new We("WebSocket Gateway is not connected.",e);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(12,t.constructor.TYPE,f.encode(t)),{channel:r,requestId:s,revisions:o}=f.decode(n,on).toObject();return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Bt._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(un._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(Xt.TYPE),((e,t)=>{const{documentId:n,requestId:r,revisions:s}=f.decode(t,Xt).toObject();this.fire("revisionsUpdated",{documentId:n,requestId:r,revisionsData:s})}))}_onWsGatewayStateChange(e){e===Mt.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new dn("Revision History",this);return this._wsGateway._sendRequest(12,e,f.encode(t))}}un._SERVICE=12;const ln=un;class pn extends a{constructor(e,t,n,r={},s=null,o=null){super(),this.id=e,this.documentId=t,this.type=n,this.data=r,this.originalSuggestionId=s,this.attributes=o}toJSON(){return{id:this.id,documentId:this.documentId,type:this.type,data:JSON.stringify(this.data),originalSuggestionId:this.originalSuggestionId,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){var t;return new pn(e.id,e.documentId,e.type,JSON.parse(e.data),null!==(t=e.originalSuggestionId)&&void 0!==t?t:null,e.attributes?JSON.parse(e.attributes):null)}}pn.TYPE="101",pn.READABLE_TYPE_NAME="addSuggestion",pn.DESCRIPTOR_NAME="TrackChangesAddSuggestionMessage",pn.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}}};const hn=pn;class fn extends a{constructor(e,t,n,r,s,o,i={},a=null){super(),this.id=e,this.authorId=t,this.type=n,this.hasComments=s,this.state=o,this.data=i,this.attributes=a,this.createdAt=r?new Date(r):void 0}toJSON(){var e;return{id:this.id,authorId:this.authorId,type:this.type,createdAt:null===(e=this.createdAt)||void 0===e?void 0:e.toISOString(),data:JSON.stringify(this.data),hasComments:this.hasComments,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new fn(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}fn.DESCRIPTOR_NAME="TrackChangesAddSuggestionResponse",fn.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}}};const mn=fn;class yn extends a{constructor(e,t){super(),this.id=e,this.documentId=t}toJSON(){return{id:this.id,documentId:this.documentId}}static fromJSON(e){return new yn(e.id,e.documentId)}}yn.TYPE="103",yn.READABLE_TYPE_NAME="getSuggestion",yn.DESCRIPTOR_NAME="TrackChangesGetSuggestionMessage",yn.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2}}};const gn=yn;class bn extends a{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 bn(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}bn.DESCRIPTOR_NAME="TrackChangesGetSuggestionResponse",bn.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}}};const On=bn;class wn extends a{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new wn(e.documentId)}}wn.TYPE="102",wn.READABLE_TYPE_NAME="getAllSuggestions",wn.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionMessage",wn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};const vn=wn;class In extends o{static toJSON(e){var t;return{...e,data:e.data?JSON.stringify(e.data):e.data,attributes:e.attributes?JSON.stringify(e.attributes):e.attributes,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(e){return{...e,data:e.data?JSON.parse(e.data):e.data,attributes:e.attributes?JSON.parse(e.attributes):e.attributes,createdAt:e.createdAt?new Date(e.createdAt):void 0}}}In.DESCRIPTOR_NAME="SuggestionDescriptor",In.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"}}};const Sn=In;class Pn extends a{constructor(e,t){super(),this._suggestions=e,this._suggestionsV2=t,this.suggestions=(null==t?void 0:t.length)?t:e}toJSON(){var e,t;return{suggestions:null===(e=this._suggestions)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),suggestionsV2:null===(t=this._suggestionsV2)||void 0===t?void 0:t.map(Sn.toJSON)}}static fromJSON(e){var t,n;return new Pn(null===(t=e.suggestions)||void 0===t?void 0:t.map(An),null===(n=e.suggestionsV2)||void 0===n?void 0:n.map(Sn.fromJSON))}}Pn.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionsResponse",Pn.DESCRIPTOR={fields:{suggestions:{type:"string",rule:"repeated",id:1},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:2}}};const kn=Pn;function An(e){const t=JSON.parse(e);return t.createdAt=t.createdAt?new Date(t.createdAt):void 0,t}class _n extends a{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 _n(e.id,e.documentId,e.hasComments,e.isHasCommentsModified,e.state,e.attributes?JSON.parse(e.attributes):null)}}_n.TYPE="104",_n.READABLE_TYPE_NAME="updateSuggestion",_n.DESCRIPTOR_NAME="TrackChangesUpdateSuggestionMessage",_n.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}}};const Tn=_n;class Cn extends a{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Cn(e.documentId)}}Cn.TYPE="105",Cn.READABLE_TYPE_NAME="connectToSuggestions",Cn.DESCRIPTOR_NAME="TrackChangesConnectMessage",Cn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};const jn=Cn;class En extends a{constructor(e,t,n){super(),this.channel=e,this._suggestions=t,this._suggestionsV2=n,this.suggestions=(null==n?void 0:n.length)?n:t}toJSON(){var e,t;return{channel:this.channel,suggestions:null===(e=this._suggestions)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),suggestionsV2:null===(t=this._suggestionsV2)||void 0===t?void 0:t.map(Sn.toJSON)}}static fromJSON(e){var t,n;return new En(e.channel,null===(t=e.suggestions)||void 0===t?void 0:t.map((e=>JSON.parse(e))),null===(n=e.suggestionsV2)||void 0===n?void 0:n.map(Sn.fromJSON))}}En.DESCRIPTOR_NAME="TrackChangesConnectResponse",En.DESCRIPTOR={fields:{channel:{type:"string",id:1},suggestions:{type:"string",rule:"repeated",id:2},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:3}}};const Dn=En;class xn extends a{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 xn(e.ids,e.documentId,e.state)}}xn.TYPE="106",xn.READABLE_TYPE_NAME="batchUpdateSuggestionsState",xn.DESCRIPTOR_NAME="TrackChangesBatchUpdateSuggestionsStateMessage",xn.DESCRIPTOR={fields:{ids:{type:"string",rule:"repeated",id:1},documentId:{type:"string",id:2},state:{type:"string",id:3}}};const Rn=xn;class Nn extends((0,n.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==Mt.CONNECTED)throw new We("WebSocket Gateway is not connected.",e);const t=new jn(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(10,jn.TYPE,f.encode(t)),r=f.decode(n,Dn);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Bt._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 hn(e,this._documentId,t,n,r,s),i=await this._sendRequest(hn.TYPE,o);return f.decode(i,mn)}async get(e,t=1){const n=new gn(e,this._documentId);try{const e=await this._sendRequest(gn.TYPE,n);return f.decode(e,On)}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 Qe.fromPublicError(n)}var r}async getAll(){const e=new vn(this._documentId),t=await this._sendRequest(vn.TYPE,e),{suggestions:n}=f.decode(t,kn);return n}async update(e,t={}){const{hasComments:n,state:r,attributes:s}=t,o=void 0!==n,i=new Tn(e,this._documentId,n,o,r,s);await this._sendRequest(Tn.TYPE,i)}async batchUpdateState(e){const t=new Rn(e.ids,this._documentId,e.state);await this._sendRequest(Rn.TYPE,t)}_connectToChannel(e,t){this._channel=e._getChannel(Nn._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(Tn.TYPE),((e,t)=>{const n=f.decode(t,Tn);this.fire("suggestionUpdated",n)}))}_onWsGatewayStateChange(e){e===Mt.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new dn("Track Changes",this);return this._wsGateway._sendRequest(10,e,f.encode(t))}}Nn._SERVICE=10;const Vn=Nn,Mn={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Un;const Bn=new Uint8Array(16);function Jn(){if(!Un&&(Un="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Un))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Un(Bn)}const qn=[];for(let e=0;e<256;++e)qn.push((e+256).toString(16).slice(1));function Gn(e,t=0){return qn[e[t+0]]+qn[e[t+1]]+qn[e[t+2]]+qn[e[t+3]]+"-"+qn[e[t+4]]+qn[e[t+5]]+"-"+qn[e[t+6]]+qn[e[t+7]]+"-"+qn[e[t+8]]+qn[e[t+9]]+"-"+qn[e[t+10]]+qn[e[t+11]]+qn[e[t+12]]+qn[e[t+13]]+qn[e[t+14]]+qn[e[t+15]]}const Ln=function(e,t,n){if(Mn.randomUUID&&!t&&!e)return Mn.randomUUID();const r=(e=e||{}).random||(e.rng||Jn)();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 Gn(r)};class Hn extends a{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 Hn(e.channel,e.sockets.map((e=>({id:e.session,userId:e.user,role:e.role,permissions:e.permissions}))))}}Hn.DESCRIPTOR_NAME="SessionsConnectResponse",Hn.DESCRIPTOR={fields:{channel:{type:"string",id:1},sockets:{rule:"repeated",type:"SessionsSocketDescriptor",id:2}}};const zn=Hn;class Yn extends a{constructor(e,t){super(),this.id=e,this.sessionType=t}toJSON(){return{id:this.id,sessionType:this.sessionType}}static fromJSON(e){return new Yn(e.id,e.sessionType)}}Yn.TYPE="31",Yn.READABLE_TYPE_NAME="getConnectedSockets",Yn.DESCRIPTOR_NAME="SessionsConnectMessage",Yn.DESCRIPTOR={fields:{id:{type:"string",id:1},sessionType:{type:"uint32",id:2}}};const Fn=Yn;class Kn extends a{constructor(e,t,n,r){super(),this.id=e,this.userId=t,this.role=n,this.permissions=r}toJSON(){var e,t,n;return{id:this.id,userId:null!==(e=this.userId)&&void 0!==e?e:void 0,role:null!==(t=this.role)&&void 0!==t?t:void 0,permissions:null!==(n=this.permissions)&&void 0!==n?n:void 0}}static fromJSON(e){return new Kn(e.id,e.userId,e.role,e.permissions)}}Kn.TYPE="32",Kn.READABLE_TYPE_NAME="connectSocket",Kn.DESCRIPTOR_NAME="SocketConnectMessage",Kn.DESCRIPTOR={fields:{id:{type:"string",id:1},userId:{type:"string",id:2},role:{type:"string",id:3},permissions:{rule:"repeated",type:"string",id:4}}};const Wn=Kn;class Qn extends a{constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new Qn(e.id)}}Qn.TYPE="33",Qn.READABLE_TYPE_NAME="disconnectSocket",Qn.DESCRIPTOR_NAME="SocketDisconnectMessage",Qn.DESCRIPTOR={fields:{id:{type:"string",id:1}}};const $n=Qn,Zn=class extends n.Collection{constructor(e,t){super({idProperty:"id"}),this._id=e,this._sessionType=t,this._handlers=new Map,this._eventsQueue=[],this._isRunning=!1}async connect(e){this._wsGateway=e,this.stopListening(e,"change:state");const t=new Fn(this._id,this._sessionType);let n;try{const e=await this._wsGateway._sendRequest(3,Fn.TYPE,f.encode(t));n=f.decode(e,zn)}catch(e){n=new zn(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 S.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 S,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:Bt._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,Wn.TYPE,(async t=>{const n=f.decode(t,Wn);if(-1===this.getIndex(n.id)){const t={id:n.id,role:n.role,permissions:n.permissions};n.userId&&(t.user=await S.get(e,n.userId)),super.add(t)}})),this._addHandler(this._channel,$n.TYPE,(e=>{const t=f.decode(e,$n);-1!==this.getIndex(t.id)&&super.remove(t.id)})))}async _onWsGatewayStateChange(e){e===Bt.STATE_DISCONNECTED&&this.disconnect(!1),e===Bt.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 Xn{static async getConnectedSessions(e,t,n){const r=new Zn(t,n);return await r.connect(e),r}}class er extends a{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 er(e.id,e.buffers,e.types,e.bundleVersion,e.lastOperationId)}}er.TYPE="11",er.READABLE_TYPE_NAME="connectToDocument",er.DESCRIPTOR_NAME="CollaborativeEditingConnectMessage",er.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}}};const tr=er;class nr{static prepareMetadataForOperations(e,t){if(!(e&&e.length&&t&&t.length))return[];const n=[];let r=0;for(const s of e)if(0!==s){if(!t[r])throw new Error("Missing metadata for a operation");n.push(t[r]),r++}else n.push(n[n.length-1]);return n}static removeUnnecessaryMetadata(e,t){if(!(e&&e.length&&t&&t.length))return[];const n=[];for(let r=0;r<e.length;r++)if(0!==e[r]){if(!t[r])throw new Error("Missing metadata for a operation");n.push(t[r])}return n}}class rr extends o{static toJSON({createdAt:e,...t}){const n={...t};return(null==e?void 0:e.toISOString)&&(n.createdAt=e.toISOString()),n}static fromJSON({createdAt:e,...t}){const n={...t};return e&&(n.createdAt=new Date(e)),n}}rr.DESCRIPTOR_NAME="OperationMetadataDescriptor",rr.DESCRIPTOR={fields:{userId:{type:"string",id:1},type:{type:"string",id:2},createdAt:{type:"string",id:3}}};const sr=rr;class or extends a{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:nr.removeUnnecessaryMetadata(this.types,this.metadata).map(sr.toJSON),lastOperationId:this.lastOperationId}}static fromJSON(e){return new or(e.id,e.buffers,e.types,e.baseVersion,nr.prepareMetadataForOperations(e.types,e.metadata).map(sr.fromJSON),e.lastOperationId)}}or.TYPE="13",or.READABLE_TYPE_NAME="updateDocument",or.DESCRIPTOR_NAME="CollaborativeEditingUpdateMessage",or.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}}};const ir=or;class ar extends a{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 ar(e.id,e.lastKnowVersion,e.bundleVersion)}}ar.TYPE="12",ar.READABLE_TYPE_NAME="reconnectToDocument",ar.DESCRIPTOR_NAME="CollaborativeEditingReconnectMessage",ar.DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},lastKnowVersion:{type:"uint32",id:3}}};const cr=ar;class dr extends a{constructor(e,t=[],n=[],r=[],s="",o=null){super(),this.version=e,this.buffers=t,this.types=n,this.metadata=r,this.lastOperationId=s,this.lastOperationAcceptedAt=o}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.version-this.types.length,lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt}}get wereChangesApplied(){var e;return!(null===(e=this.types)||void 0===e?void 0:e.length)}toJSON(){return{version:this.version,buffers:this.buffers,types:this.types,metadata:nr.removeUnnecessaryMetadata(this.types,this.metadata).map(sr.toJSON),lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt instanceof Date?this.lastOperationAcceptedAt.toISOString():this.lastOperationAcceptedAt}}static fromJSON(e){return new dr(e.version,e.buffers,e.types,nr.prepareMetadataForOperations(e.types,e.metadata).map(sr.fromJSON),e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}static create(e){return new dr(e.version,e.buffers,e.types,e.metadata,e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}}dr.DESCRIPTOR_NAME="CollaborativeEditingResponse",dr.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}}};const ur=dr;class lr extends a{constructor(e,t,n=[],r=[],s=0,o=[],i=null,a="",c="",d=null){super(),this.channel=e,this.version=t,this.buffers=n,this.types=r,this.offset=s,this.metadata=o,this.initData=i,this.sessionId=a,this.lastOperationId=c,this.sessionCreatedAt=d}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.version-this.types.length,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt}}get wereChangesApplied(){var e;return!(null===(e=this.types)||void 0===e?void 0:e.length)&&null===this.initData}toJSON(){var e;return{channel:this.channel,version:this.version,sessionId:this.sessionId,buffers:this.buffers,types:this.types,offset:this.offset,metadata:nr.removeUnnecessaryMetadata(this.types,this.metadata).map(sr.toJSON),initData:null!==(e=this.initData)&&void 0!==e?e:"",isInitialized:"string"==typeof this.initData,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt?this.sessionCreatedAt.toISOString():null}}static create(e){return new lr(e.channel,e.version,e.buffers,e.types,e.offset,e.metadata,e.initData,e.sessionId,e.lastOperationId,e.sessionCreatedAt)}static fromJSON(e){var t;let n=null;return!0===e.isInitialized?n=null!==(t=e.initData)&&void 0!==t?t:"":"boolean"!=typeof e.isInitialized&&e.initData&&(n=e.initData),lr.create({channel:e.channel,version:e.version,buffers:e.buffers,types:e.types,offset:e.offset,metadata:nr.prepareMetadataForOperations(e.types,e.metadata).map(sr.fromJSON),initData:n,sessionId:e.sessionId,lastOperationId:e.lastOperationId,sessionCreatedAt:e.sessionCreatedAt?new Date(e.sessionCreatedAt):null})}}lr.DESCRIPTOR_NAME="CollaborativeEditingConnectResponse",lr.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:sr.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}}};const pr=lr;class hr extends a{constructor(e,t){super(),this.lastDocumentSession=e,this.currentDocumentSession=t}get data(){var e,t,n,r,s;return{lastDocumentSessionId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.id,lastDocumentSessionOperationId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(s=this.currentDocumentSession)||void 0===s?void 0:s.lastOperationId}}toJSON(){var e,t,n,r,s;return{lastDocumentSessionId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.id,lastDocumentSessionOperationId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(s=this.currentDocumentSession)||void 0===s?void 0:s.lastOperationId}}static fromJSON(e){const t=e.lastDocumentSessionId?{id:e.lastDocumentSessionId,lastOperationId:e.lastDocumentSessionOperationId}:void 0,n=e.currentDocumentSessionId?{lastOperationId:e.currentDocumentSessionOperationId,version:e.currentDocumentSessionVersion,id:e.currentDocumentSessionId}:void 0;return new hr(t,n)}}hr.DESCRIPTOR_NAME="GetDocumentDetailsResponse",hr.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}}};const fr=hr;class mr extends a{constructor(e){super(),this.documentId=e}get data(){return{documentId:this.documentId}}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new mr(e.documentId)}}mr.TYPE="14",mr.READABLE_TYPE_NAME="getDocumentDetails",mr.DESCRIPTOR_NAME="GetDocumentDetailsMessage",mr.DESCRIPTOR={fields:{documentId:{type:"string",id:1},environmentId:{type:"string",id:2}}};const yr=mr;class gr extends((0,n.EmitterMixin)()){constructor(e,t){if(super(),!e)throw new TypeError('Param "bundleVersion" must be provided.');this._id=null!=t?t:Ln(),this._isConnected=!1,this._bundleVersion=e}getId(){return this._id}isConnected(){return this._isConnected}connect(e,t={buffers:[],types:[]},n){const r=new tr(this.getId(),t.buffers,t.types,this._bundleVersion,n);return this._connect(e,r)}reconnect(e,t){if(this.isConnected())throw new We("Cannot reconnect to already connected service.",e);return this._connect(e,new cr(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 yr(this.getId());if(!this._wsGateway)throw new dn("Collaborative Editing",this);const t=await this._wsGateway._sendRequest(1,yr.TYPE,f.encode(e));return f.decode(t,fr)}async sendOperations(e,t,n){if(!e||!e.types||!e.types.length)throw new We("Cannot send empty update.",this._wsGateway);const r="number"==typeof t?t:parseInt(t);if(!Number.isInteger(r)||r<0)throw new We("Base version not provided.",this._wsGateway);const s=new ir(this.getId(),e.buffers,e.types,r,[],n);if(!this._wsGateway||!this._isConnected)throw new dn("Collaborative Editing",this);const o=await this._wsGateway._sendRequest(1,ir.TYPE,f.encode(s));return f.decode(o,ur)}async getConnectedSessions(){if(!this._isConnected)throw new dn("Collaborative Editing",this);return this._connectedSessions||(this._connectedSessions=await Xn.getConnectedSessions(this._wsGateway,this._id,1)),this._connectedSessions}static getConnectedSessions(e,t){return Xn.getConnectedSessions(e,t,1)}async _connect(e,t){if(this.isConnected())return;if(e.state!==Bt.STATE_CONNECTED)throw new We("WebSocket Gateway is not connected.",e);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(1,t.constructor.TYPE,f.encode(t)),r=f.decode(n,pr);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Bt._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(ir.TYPE),((e,t)=>{const n=f.decode(t,ir);this.fire("operationsReceived",n.baseVersion,n.data,n.metadata)}))}_onWsGatewayStateChange(e){e===Bt.STATE_DISCONNECTED&&this.disconnect()}}gr._SERVICE=1;const br=gr;class Or extends o{static toJSON(e){var t;return{...e,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null}}static fromJSON(e){return{...e,createdAt:new Date(e.createdAt),attributes:e.attributes?JSON.parse(e.attributes):null}}}Or.DESCRIPTOR_NAME="CommentDescriptor",Or.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"}}};const wr=Or;class vr extends o{static toJSON(e){var t,n,r,s,o;return{...e,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),deletedAt:null===(n=e.deletedAt)||void 0===n?void 0:n.toISOString(),resolvedAt:null===(r=e.resolvedAt)||void 0===r?void 0:r.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null,context:e.context?JSON.stringify(e.context):e.context,comments:null===(s=e.comments)||void 0===s?void 0:s.map(wr.toJSON),unlinkedAt:null===(o=e.unlinkedAt)||void 0===o?void 0:o.toISOString()}}static fromJSON(e){var t;return{...e,createdAt:e.createdAt?new Date(e.createdAt):void 0,deletedAt:e.deletedAt?new Date(e.deletedAt):void 0,resolvedAt:e.resolvedAt?new Date(e.resolvedAt):void 0,attributes:e.attributes?JSON.parse(e.attributes):null,context:e.context?JSON.parse(e.context):void 0,comments:null===(t=e.comments)||void 0===t?void 0:t.map(wr.fromJSON),unlinkedAt:e.unlinkedAt?new Date(e.unlinkedAt):void 0}}}vr.DESCRIPTOR_NAME="CommentsThreadDescriptor",vr.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}}};const Ir=vr;class Sr extends a{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?Ir.toJSON(this.commentThread):void 0}}static fromJSON(e){return new Sr(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?Ir.fromJSON(e.commentThread):void 0)}}Sr.TYPE="91",Sr.READABLE_TYPE_NAME="addComment",Sr.DESCRIPTOR_NAME="CommentsV2AddCommentMessage",Sr.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}}};const Pr=Sr;class kr extends a{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 kr(e.commentThreadId,e.commentId,e.createdAt)}}kr.DESCRIPTOR_NAME="CommentsV2AddCommentResponse",kr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},createdAt:{type:"string",id:3}}};const Ar=kr;class _r extends a{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new _r(e.documentId)}}_r.TYPE="92",_r.READABLE_TYPE_NAME="connectToComment",_r.DESCRIPTOR_NAME="CommentsV2ConnectMessage",_r.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};const Tr=_r;class Cr extends a{constructor(e,t,n){super(),this.channel=e,this._threads=t,this._threadsV2=n,this.threads=(null==n?void 0:n.length)?n:t}toJSON(){var e,t;return{channel:this.channel,threads:null===(e=this._threads)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),threadsV2:null===(t=this._threadsV2)||void 0===t?void 0:t.map(Ir.toJSON)}}static fromJSON(e){var t,n;return new Cr(e.channel,null===(t=e.threads)||void 0===t?void 0:t.map((e=>JSON.parse(e))),null===(n=e.threadsV2)||void 0===n?void 0:n.map(Ir.fromJSON))}}Cr.DESCRIPTOR_NAME="CommentsV2ConnectResponse",Cr.DESCRIPTOR={fields:{channel:{type:"string",id:1},threads:{type:"string",rule:"repeated",id:2},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:3}}};const jr=Cr;class Er extends a{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 Er(e.documentId,e.commentThreadId,e.commentId)}}Er.TYPE="95",Er.READABLE_TYPE_NAME="removeComment",Er.DESCRIPTOR_NAME="CommentsV2RemoveCommentMessage",Er.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},documentId:{type:"string",id:3}}};const Dr=Er;class xr extends a{constructor(e,t){super(),this.documentId=e,this.commentThreadId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new xr(e.documentId,e.commentThreadId)}}xr.TYPE="97",xr.READABLE_TYPE_NAME="removeCommentThread",xr.DESCRIPTOR_NAME="CommentsV2RemoveCommentThreadMessage",xr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};const Rr=xr;class Nr extends a{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?Ir.toJSON(this.commentThread):void 0}}static fromJSON(e){return new Nr(e.documentId,e.commentThreadId,e.commentId,e.content,e.attributes?JSON.parse(e.attributes):null,e.isAttributesUpdated,e.commentThread?Ir.fromJSON(e.commentThread):void 0)}}Nr.TYPE="96",Nr.READABLE_TYPE_NAME="updateComment",Nr.DESCRIPTOR_NAME="CommentsV2UpdateCommentMessage",Nr.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}}};const Vr=Nr;class Mr extends a{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId}}static fromJSON(e){return new Mr(e.commentThreadId,e.documentId)}}Mr.TYPE="93",Mr.READABLE_TYPE_NAME="getComment",Mr.DESCRIPTOR_NAME="CommentsV2GetCommentThreadMessage",Mr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};const Ur=Mr;class Br extends a{constructor(e,t,n,r,s,o,i,a,c,d){super(),this.commentThreadId=e,this._comments=t,this._commentsV2=n,this.resolvedBy=s,this.comments=(null==n?void 0:n.length)?n:t,this.createdAt=i?new Date(i):void 0,this.deletedAt="string"==typeof a?new Date(a):a,this.resolvedAt="string"==typeof c?new Date(c):c,this.unlinkedAt="string"==typeof d?new Date(d):d,this.attributes="string"==typeof r?JSON.parse(r):r,this.context="string"==typeof o?JSON.parse(o):o}toJSON(){var e,t,n,r,s,o;return{commentThreadId:this.commentThreadId,comments:null===(e=this._comments)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),commentsV2:null===(t=this._commentsV2)||void 0===t?void 0:t.map(wr.toJSON),attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,context:this.context?JSON.stringify(this.context):this.context,resolvedBy:this.resolvedBy,createdAt:null===(n=this.createdAt)||void 0===n?void 0:n.toISOString(),deletedAt:null===(r=this.deletedAt)||void 0===r?void 0:r.toISOString(),resolvedAt:null===(s=this.resolvedAt)||void 0===s?void 0:s.toISOString(),unlinkedAt:null===(o=this.unlinkedAt)||void 0===o?void 0:o.toISOString()}}static fromJSON(e){var t,n;return new Br(e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((e=>function(e){const t=JSON.parse(e);return{...t,createdAt:new Date(t.createdAt)}}(e))),null===(n=e.commentsV2)||void 0===n?void 0:n.map(wr.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)}}Br.DESCRIPTOR_NAME="CommentsV2GetCommentThreadResponse",Br.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}}};const Jr=Br;class qr extends a{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new qr(e.documentId)}}qr.TYPE="94",qr.READABLE_TYPE_NAME="getDocumentThreads",qr.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsMessage",qr.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};const Gr=qr;class Lr extends a{constructor(e,t){super(),this._threads=e,this._threadsV2=t,this.threads=(null==t?void 0:t.length)?t:e}toJSON(){var e,t;return{threads:null===(e=this._threads)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),threadsV2:null===(t=this._threadsV2)||void 0===t?void 0:t.map(Ir.toJSON)}}static fromJSON(e){var t,n;return new Lr(null===(t=e.threads)||void 0===t?void 0:t.map((e=>function(e){var t;const n=JSON.parse(e),r={...n};return n.comments&&(r.comments=null===(t=n.comments)||void 0===t?void 0:t.map((e=>({...e,createdAt:new Date(e.createdAt)})))),r}(e))),null===(n=e.threadsV2)||void 0===n?void 0:n.map(Ir.fromJSON))}}Lr.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsResponse",Lr.DESCRIPTOR={fields:{threads:{type:"string",rule:"repeated",id:1},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:2}}};const Hr=Lr;class zr extends o{static toJSON(e){var t;return{commentId:e.commentId,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(e){return{commentId:e.commentId,createdAt:new Date(e.createdAt)}}}zr.DESCRIPTOR_NAME="CommentThreadAddedCommentDescriptor",zr.DESCRIPTOR={fields:{commentId:{id:1,type:"string"},createdAt:{id:2,type:"string"}}};const Yr=zr;class Fr extends a{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=>Yr.toJSON(e)))}}static fromJSON(e){return new Fr(e.commentThreadId,e.createdAt,e.comments.map((e=>Yr.fromJSON(e))))}}Fr.DESCRIPTOR_NAME="CommentsV2AddCommentThreadResponse",Fr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},createdAt:{type:"string",id:2},comments:{type:"CommentThreadAddedCommentDescriptor",rule:"repeated",id:3}}};const Kr=Fr;class Wr extends a{constructor(e,t,n=[],r,s=null,o=null,i=null,a=null,c=null){super(),this.documentId=e,this.commentThreadId=t,this.comments=n,this.context=r,this.resolvedBy=s,this.attributes=c,this.createdAt=o?new Date(o):"",this.resolvedAt=i?new Date(i):"",this.deletedAt=a?new Date(a):""}toJSON(){var e;return{commentThreadId:this.commentThreadId,context:this.context?JSON.stringify(this.context):this.context,documentId:this.documentId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt instanceof Date?this.resolvedAt.toISOString():this.resolvedAt,deletedAt:this.deletedAt instanceof Date?this.deletedAt.toISOString():this.deletedAt,createdAt:this.createdAt instanceof Date?this.createdAt.toISOString():this.createdAt,attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,comments:null===(e=this.comments)||void 0===e?void 0:e.map((e=>wr.toJSON(e)))}}static fromJSON(e){var t;return new Wr(e.documentId,e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((t=>wr.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)}}Wr.TYPE="140",Wr.READABLE_TYPE_NAME="addCommentThread",Wr.DESCRIPTOR_NAME="CommentsV2AddCommentThreadMessage",Wr.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}}};const Qr=Wr;class $r extends a{constructor(e,t,n,r){super(),this.commentThreadId=e,this.documentId=t,this.resolvedBy=n,this.resolvedAt=r?new Date(r):void 0}toJSON(){var e;return{documentId:this.documentId,commentThreadId:this.commentThreadId,resolvedBy:this.resolvedBy,resolvedAt:null===(e=this.resolvedAt)||void 0===e?void 0:e.toISOString()}}static fromJSON(e){return new $r(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}$r.TYPE="142",$r.READABLE_TYPE_NAME="resolveCommentThread",$r.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadMessage",$r.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedBy:{type:"string",id:3},resolvedAt:{type:"string",id:4}}};const Zr=$r;class Xr extends a{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new Xr(e.commentThreadId,e.documentId)}}Xr.TYPE="141",Xr.READABLE_TYPE_NAME="reopenCommentThread",Xr.DESCRIPTOR_NAME="CommentsV2ReopenCommentThreadMessage",Xr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};const es=Xr;class ts extends a{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 ts(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)}}ts.TYPE="143",ts.READABLE_TYPE_NAME="updateCommentThread",ts.DESCRIPTOR_NAME="CommentsV2UpdateCommentThreadMessage",ts.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}}};const ns=ts;class rs extends a{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 rs(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}rs.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadResponse",rs.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4}}};const ss=rs;class os extends((0,n.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==Mt.CONNECTED)throw new We("WebSocket Gateway is not connected.",e);const t=new Tr(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(9,Tr.TYPE,f.encode(t)),{channel:r,threads:s}=f.decode(n,jr);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Bt._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 Pr(this._documentId,e,n,t,void 0,void 0,r),o=await this._sendRequest(Pr.TYPE,s);return f.decode(o,Ar)}async updateComment(e,t,n,r){const s=void 0!==r,o=new Vr(this._documentId,e,t,n,r,s);await this._sendRequest(Vr.TYPE,o)}async removeComment(e,t){const n=new Dr(this._documentId,e,t);await this._sendRequest(Dr.TYPE,n)}async removeCommentThread(e){const t=new Rr(this._documentId,e);await this._sendRequest(Rr.TYPE,t)}async addCommentThread(e){var t;const n=new Qr(this._documentId,e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((t=>({...t,documentId:this._documentId,commentThreadId:e.commentThreadId}))),e.context,e.resolvedBy,e.createdAt,e.resolvedAt,e.deletedAt,e.attributes),r=await this._sendRequest(Qr.TYPE,n);return f.decode(r,Kr)}async resolveCommentThread(e){const t=new Zr(e,this._documentId),n=await this._sendRequest(Zr.TYPE,t);return f.decode(n,ss)}async reopenCommentThread(e){const t=new es(e,this._documentId);await this._sendRequest(es.TYPE,t)}async updateCommentThread(e){const t=new ns(e.commentThreadId,this._documentId,e.context,e.attributes,e.unlinkedAt);await this._sendRequest(ns.TYPE,t)}async getCommentThread(e,t=1){const n=new Ur(e,this._documentId);try{const e=await this._sendRequest(Ur.TYPE,n),t=f.decode(e,Jr);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 Qe.fromPublicError(n)}var r}async getDocumentThreads(){const e=new Gr(this._documentId),t=await this._sendRequest(Gr.TYPE,e),{threads:n}=f.decode(t,Hr);return{threads:n}}async getConnectedSessions(){if(!this._isConnected)throw new dn("Comments",this);return this._connectedSessions||(this._connectedSessions=await Xn.getConnectedSessions(this._wsGateway,this._documentId,9)),this._connectedSessions}_connectToChannel(e,t){this._channel=e._getChannel(os._SERVICE,t),this._channel&&(this.listenTo(this._channel,this._channel.getEventName(Pr.TYPE),((e,t)=>{const n=f.decode(t,Pr);this.fire("commentAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(Dr.TYPE),((e,t)=>{const n=f.decode(t,Dr);this.fire("commentRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(Vr.TYPE),((e,t)=>{const n=f.decode(t,Vr);this.fire("commentUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(Rr.TYPE),((e,t)=>{const n=f.decode(t,Rr);this.fire("commentThreadRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(Qr.TYPE),((e,t)=>{const n=f.decode(t,Qr);this.fire("commentThreadAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(ns.TYPE),((e,t)=>{const n=f.decode(t,ns);this.fire("commentThreadUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(Zr.TYPE),((e,t)=>{const n=f.decode(t,Zr);this.fire("commentThreadResolved",n)})),this.listenTo(this._channel,this._channel.getEventName(es.TYPE),((e,t)=>{const n=f.decode(t,es);this.fire("commentThreadReopened",n)})))}_onWsGatewayStateChange(e){e===Mt.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new dn("Comments",this);return this._wsGateway._sendRequest(9,e,f.encode(t))}}os._SERVICE=9;const is=os,as=ds;function cs(){const e=["_shouldPluginsReconnect","cloudservices-reconnection-error","token","all","cloudServices.connectionTimeout","context","239940EGOgph","define","create","from","reconnect","listenTo","_isBrowserOffline","online","error","showWarning","24PbjkNl","offline","delete","bind","connect","constructor","725956sTqLEN","60zOfPOw","isInReconnectionStack","addToReconnectionStack","_reconnect","connected","real-time-collaboration","requires","state","pluginName","141039MElkZm","isPremiumPlugin","cloudServices.requestTimeout","limitExceeded","code","84455WxMQSJ","CONNECTING","init","isOfficialPlugin","1306129UtupZP","4792774RayTzU","stopListening","change:me","set","add","removeFromReconnectionStack","has","disconnect","232oHHaUH","catch","_reconnectionStack","cloudservices-init","36978OUcWHB","config","function","webSocketUrl","websocketgateway-missing-token","CONNECTED","connection","then","_domEmitter","get","CloudServices","destroy","DISCONNECTED","websocketgateway-missing-websocket-url","initialReconnectionInterval","170UonRku","Connected users limit exceeded","WebSocketGateway","websocketgateway-invalid-plugin-interface","plugins","websocketgateway-plugin-already-registered","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."];return(cs=function(){return e})()}function ds(e,t){const n=cs();return(ds=function(e,t){return n[e-=348]})(e,t)}!function(e){const t=ds,n=e();for(;;)try{if(503930===parseInt(t(412))/1+-parseInt(t(352))/2+-parseInt(t(384))/3*(parseInt(t(353))/4)+-parseInt(t(367))/5*(parseInt(t(422))/6)+-parseInt(t(372))/7+-parseInt(t(380))/8*(parseInt(t(362))/9)+-parseInt(t(399))/10*(-parseInt(t(371))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(cs);class us extends t.ContextPlugin{static get[as(359)](){return[as(394),r.Notification]}static get[as(361)](){return as(401)}static get[as(370)](){return!0}static get[as(363)](){return!0}constructor(e){const t=as;super(e),this[t(375)](t(360),Mt[t(389)]),this[t(375)](t(418),!1),this[t(382)]=new Set,this[t(406)]=!1,this[t(392)]=Object[t(414)](n.DomEmitterMixin)}[as(369)](){const e=as,t=this[e(411)],s=t[e(403)][e(393)](e(394)),o=t[e(403)][e(393)](r.Notification);if(!s[e(408)])throw new n.CKEditorError(e(388),this);if(!s[e(387)])throw new n.CKEditorError(e(397),this);return this[e(392)][e(417)](window,e(423),(()=>this[e(418)]=!0)),this[e(392)][e(417)](window,e(419),(()=>this[e(418)]=!1)),this[e(411)][e(385)][e(413)](e(410),10),this[e(411)][e(385)][e(413)](e(364),20),us[e(401)][e(350)](s[e(408)],s[e(387)],{timeout:1e3*this[e(411)][e(385)][e(393)](e(410)),requestTimeout:1e3*this[e(411)][e(385)][e(393)](e(364))})[e(391)]((t=>{const r=e;if(this[r(390)]=t,this[r(349)](r(360)).to(t,r(360),this,r(418),((e,t)=>(r(357)!==e&&(this[r(406)]=!0),t||e!==Mt[r(389)]?Mt[r(396)]:this[r(360)]==Mt[r(396)]&&this[r(406)]?(this[r(406)]=!1,this[r(356)](),Mt[r(368)]):Mt[r(389)]))),this[r(390)].on(r(420),((e,t)=>{const s=r;if(s(365)!==t[s(366)])throw console[s(420)](t),new n.CKEditorError(s(383),null,{originalError:t});o[s(421)](s(405),{title:s(400),namespace:s(358)})})),!t.me)return new Promise((e=>t.on(r(374),e)))}))[e(381)]((t=>{const r=e;throw console[r(420)](t),new n.CKEditorError(r(383),null,{originalError:t})}))}[as(355)](e){const t=as;if(t(386)!=typeof e[t(416)])throw new n.CKEditorError(t(402),this);if(this[t(354)](e))throw new n.CKEditorError(t(404),this,{name:e[t(351)][t(361)]});this[t(382)][t(376)](e)}[as(377)](e){const t=as;this[t(382)][t(348)](e)}[as(354)](e){const t=as;return this[t(382)][t(378)](e)}[as(356)](){const e=as;return this[e(390)][e(416)]()[e(391)]((()=>Promise[e(409)](Array[e(415)](this[e(382)],(t=>t[e(416)]())))))[e(391)]((()=>this[e(360)]=Mt[e(389)]))[e(381)]((t=>{const r=e;throw console[r(420)](t),new n.CKEditorError(r(407),this[r(411)])}))}[as(379)](){const e=as;this[e(390)]&&this[e(390)][e(379)](),this[e(360)]=Mt[e(396)],this[e(392)][e(373)]()}[as(395)](){const e=as;this[e(379)](),super[e(395)]()}}us[as(401)]=Bt,us[as(398)]=1e3;const ls=us;var ps=__webpack_require__(211);function hs(){const e=["pluginName","isMe","_registeredSessions","2133943fOXCSK","size","_handleSessionRemove","766812dFXdoe","8JxCAvn","1878520ZwHkKX","4802274oAzWOc","forEach","sessionAdd:","unregister","allConnectedUsers","has","state","_users","set","add","stopListening","connected","fire","isOfficialPlugin","clear","addUser","init","connection","24124793JaObTg","listenTo","role","getUserBySessionId","channelConnectedUsers","sessions-register-already-registered","getUserRole","user","isPremiumPlugin","mySessionId","46678CDDIfG","plugins","context","5mIAsxO","_createUser","defineMe","12aTSHDn","sessions-unregister-not-exist","get","channelSessions","change:state","requires","_uniqueUsersCount","sessionId","values","1270852PkJkAw","register","orderNumber","getUserSessions","delete","Sessions","assign","remove","_handleSessionAdd","147CRCzmx","getUser"];return(hs=function(){return e})()}const fs=ms;function ms(e,t){const n=hs();return(ms=function(e,t){return n[e-=496]})(e,t)}!function(e){const t=ms,n=e();for(;;)try{if(918133===-parseInt(t(547))/1+-parseInt(t(532))/2*(parseInt(t(556))/3)+parseInt(t(501))/4*(-parseInt(t(535))/5)+parseInt(t(538))/6*(parseInt(t(498))/7)+-parseInt(t(502))/8*(-parseInt(t(504))/9)+parseInt(t(503))/10+parseInt(t(522))/11)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(hs);class ys extends t.ContextPlugin{static get[fs(558)](){return fs(552)}static get[fs(517)](){return!0}static get[fs(530)](){return!0}static get[fs(543)](){return[ls,ps.Users]}constructor(e){const t=fs;super(e),this[t(541)]=new Map,this[t(526)]=new Map,this[t(508)]=new n.Collection,this[t(497)]=new Map,this[t(544)]=0,this[t(511)]=this[t(534)][t(533)][t(540)](ps.Users)}[fs(520)](){const e=fs,t=this[e(534)][e(533)][e(540)](ls);this[e(523)](t,e(542),((t,n,r)=>{const s=e;if(s(515)!==r)this[s(541)][s(505)]((e=>e[s(518)]())),this[s(526)][s(505)]((e=>e[s(518)]())),this[s(508)][s(518)]();else for(const[e,t]of this[s(497)])for(const n of t)this[s(555)](e,n)})),this[e(536)](t[e(521)].me,!0)}[fs(548)](e,t){const r=fs;if(this[r(497)][r(509)](e))throw new n.CKEditorError(r(527),null,{channelId:e});this[r(497)][r(512)](e,t),this[r(541)][r(512)](e,new n.Collection),this[r(526)][r(512)](e,new n.Collection),this[r(523)](t,r(513),((t,n)=>this[r(555)](e,n))),this[r(523)](t,r(554),((t,n)=>this[r(500)](e,n)));for(const n of t)this[r(555)](e,n)}[fs(507)](e){const t=fs;if(!this[t(497)][t(509)](e))throw new n.CKEditorError(t(539),null,{channelId:e});const r=this[t(497)][t(540)](e);this[t(514)](r);for(const n of r)t(515)===this[t(534)][t(533)][t(540)](ls)[t(510)]&&this[t(500)](e,n);this[t(497)][t(551)](e),this[t(541)][t(551)](e),this[t(526)][t(551)](e)}get[fs(531)](){const e=fs;return this[e(534)][e(533)][e(540)](ls)[e(521)][e(545)]}[fs(525)](e){const t=fs;for(const n of this[t(541)][t(546)]())for(const r of n)if(r.id===e)return r[t(529)]}[fs(550)](e,t){const n=fs,r=t?[this[n(541)][n(540)](t)]:this[n(541)][n(546)](),s=new Set;for(const t of r)for(const r of t)r[n(529)].id===e.id&&s[n(513)](r.id);return s}[fs(528)](e){const t=fs;for(const n of this[t(541)][t(546)]())for(const r of n)if(r[t(529)]===e)return r[t(524)]}[fs(555)](e,t){const n=fs;if(n(515)!==this[n(534)][n(533)][n(540)](ls)[n(510)])return;const r=t[n(529)],s=this[n(511)][n(557)](r.id)||this[n(536)](r),o=Object[n(553)]({},t,{user:s});this[n(541)][n(540)](e)[n(513)](o);const i=this[n(526)][n(540)](e);i[n(509)](s.id)||i[n(513)](s),this[n(508)][n(509)](s.id)||this[n(508)][n(513)](s,s[n(496)]?0:void 0),this[n(516)](n(506)+e,{channelId:e,session:o})}[fs(500)](e,t){const n=fs;if(n(515)!==this[n(534)][n(533)][n(540)](ls)[n(510)])return;const r=this[n(526)][n(540)](e),s=t[n(529)];s.id&&(this[n(541)][n(540)](e)[n(554)](t.id),r[n(509)](s.id)&&!this[n(550)](s,e)[n(499)]&&r[n(554)](s.id),this[n(508)][n(540)](s.id)&&!this[n(550)](s)[n(499)]&&this[n(508)][n(554)](s.id))}[fs(536)](e,t){const n=fs,r=this[n(511)][n(519)](e);return t&&this[n(511)][n(537)](e.id),r[n(549)]=this[n(544)]++,r}}var gs=__webpack_require__(673),bs=__webpack_require__.n(gs),Os=__webpack_require__(545),ws=__webpack_require__.n(Os),vs=__webpack_require__(262),Is=__webpack_require__.n(vs),Ss=__webpack_require__(667),Ps=__webpack_require__.n(Ss),ks=__webpack_require__(357),As=__webpack_require__.n(ks),_s=__webpack_require__(535),Ts={attributes:{"data-cke":!0}};Ts.setAttributes=Ps(),Ts.insert=Is().bind(null,"head"),Ts.domAPI=ws(),Ts.insertStyleElement=As();bs()(_s.A,Ts);_s.A&&_s.A.locals&&_s.A.locals;const Cs=js;function js(e,t){const n=Ds();return(js=function(e,t){return n[e-=112]})(e,t)}!function(e){const t=js,n=e();for(;;)try{if(235495===parseInt(t(239))/1+parseInt(t(139))/2+parseInt(t(136))/3*(parseInt(t(204))/4)+parseInt(t(195))/5+parseInt(t(142))/6+parseInt(t(197))/7*(-parseInt(t(217))/8)+-parseInt(t(140))/9)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Ds);class Es extends t.Plugin{constructor(){const e=js;super(...arguments),this[e(218)]=new((0,n.DomEmitterMixin)())}static get[Cs(212)](){return[ys]}static get[Cs(150)](){return Cs(184)}static get[Cs(210)](){return!0}static get[Cs(115)](){return!0}[Cs(219)](){const e=Cs,t=this[e(168)],r=t[e(249)][e(152)](ys);t[e(230)][e(124)](e(185))[e(165)]({model:e(237),view:(n,{writer:s})=>function(t,n,r,s){const o=e,i=t[o(234)][o(162)](":")[2],a=r[o(188)](i);if(!a||i===r[o(224)])return;if(!s[o(206)][o(181)][o(164)](t[o(207)][o(202)],o(179)))return;const c={class:o(134)+a[o(189)][o(182)](),"data-name":a[o(228)],"data-session-id":i},d=s[o(206)][o(205)][o(152)](t[o(234)])[o(196)](),u=d[o(240)],l=s[o(206)][o(181)];if(u&&l[o(157)](u)&&l[o(147)](u)&&!s[o(206)][o(205)][o(152)](o(232)+i)[o(148)]()[o(242)])return;const p=d[o(160)];return s[o(206)][o(181)][o(133)](p)&&!s[o(206)][o(187)](p)&&(c[o(146)]=!1),function(e,t,n){const r=o,s=e[r(156)](r(225),t);return e[r(203)](r(141),!0,s),s[r(177)]=function(e){const t=r,s=this[t(167)](e),o=document[t(215)](t(225));return o[t(193)][t(172)](t(130)),o[t(248)](t(146),t(170)),o[t(248)](t(125),t(170)),o[t(158)]=n[t(228)],s[t(119)]=t(131)+o[t(154)]+"",s[t(186)](t(118),(()=>{const e=t;s[e(193)][e(172)](e(128))})),s[t(186)](t(144),(()=>{const e=t;s[e(193)][e(201)](e(128))})),s},s[r(227)]=function(e){const t=r;return!(!this[t(126)](t(141))||!e[t(126)](t(141))||this[t(209)](t(213))!=e[t(209)](t(213)))},s}(n,c,a)}(n,s,r,t)}),t[e(230)][e(124)](e(185))[e(151)]({model:e(123),view:t=>function(t,n){const r=e,s=t[r(234)][r(162)](":")[2];if(s===n[r(224)])return null;const o=n[r(188)](s);return o?{id:s,classes:[r(178),o[r(189)][r(241)]()],attributes:{"data-session-id":s},priority:2e3+o[r(117)]}:{id:s,classes:[]}}(t,r)}),function(t){const n=e,r=t[n(206)],o=new Map,i=t[n(249)][n(152)](ys);r[n(205)].on(n(229),((e,a,c,d)=>{const u=n;if(!d&&o[u(152)](a[u(228)]))return o[u(152)](a[u(228)])[u(194)](),void o[u(238)](a[u(228)]);const l=a[u(228)][u(162)](":")[2];if(l===i[u(224)])return;const p=u(233)+l;r[u(205)][u(223)](p)&&t[u(137)][u(132)](p),a.on(u(198),((e,t,n)=>{const i=u;if(i(155)!=t[i(161)][i(127)]&&i(155)==a[i(148)]()[i(161)][i(127)]&&!o[i(223)](a[i(228)])){const e=r[i(181)][i(122)](n[i(220)]);if(e){const t=s.LiveRange[i(222)](e);o[i(180)](a[i(228)],t),t.on(i(198),((e,n,s)=>{const c=i;if(c(155)==t[c(161)][c(127)]){const e=r[c(181)][c(122)](s[c(220)]);e?(t[c(202)]=e[c(202)],t[c(236)]=e[c(236)]):(o[c(238)](a[c(228)]),t[c(194)]())}}))}}}))})),r[n(171)].on(n(116),(()=>{const e=n;o[e(245)]>0&&r[e(176)]({isUndoable:!1},(t=>{const n=e;for(const[e,s]of o)n(155)==r[n(205)][n(152)](e)[n(148)]()[n(161)][n(127)]&&(xs(e[n(162)](":")[2],s[n(199)](),r,t),s[n(194)]());o[n(112)]()}))}))}(t),this[e(218)][e(145)](n.global[e(171)],e(159),((n,{key:r})=>{const s=e;s(211)===r&&function(e){const t=s;e[t(137)][t(200)][t(116)]((n=>{const r=t;for(const t of e[r(206)][r(205)]){if(!t[r(228)][r(143)](r(237)))continue;const s=e[r(137)][r(135)][r(169)](t[r(228)]);if(s)for(const e of s)n[r(221)](r(128),e)}}))}(t)}),{useCapture:!0})}[Cs(163)](){const e=Cs,t=this[e(168)],n=t[e(175)][e(152)](e(120));n&&t[e(206)].on(e(243),((r,s)=>{const o=e,i=s[0];if(!i[o(121)])return;if(o(208)!=i[o(226)]||!i[o(228)][o(143)](o(192)))return;const a=i[o(153)];n[o(138)][o(223)](a)&&(i[o(244)]=i[o(114)]?t[o(206)][o(173)](i[o(114)][o(202)],i[o(114)][o(236)]):null)}),{priority:e(174)})}[Cs(214)](){const e=Cs;return this[e(218)][e(149)](),super[e(214)]()}[Cs(190)](){const e=Cs,t=this[e(168)],n=t[e(206)][e(171)],r=t[e(249)][e(152)](ys);t[e(206)][e(176)]({isUndoable:!1},(s=>{const o=e,i=o(232)+r[o(224)],a=o(233)+r[o(224)],c=t[o(206)][o(205)][o(223)](i);t[o(137)][o(200)][o(183)]?xs(r[o(224)],n[o(113)][o(246)](),t[o(206)],s):c&&(s[o(235)](i),s[o(235)](a))}))}}function Ds(){const e=["user:","classList","detach","462470EZwyEC","getStart","32039MeNPzB","change:range","toRange","view","remove","start","setCustomProperty","1525132TVhevj","markers","model","markerRange","marker","getAttribute","isOfficialPlugin","Escape","requires","data-session-id","destroy","createElement","tableCell","448iKcaNl","_domEmitter","init","deletionPosition","removeClass","fromRange","has","mySessionId","span","type","isSimilar","name","update:user:range","conversion","getPositions","user:range:","user:position:","markerName","removeMarker","end","user:position","delete","129096hJRuHt","nodeAfter","getSelectionClass","isCollapsed","applyOperation","newRange","size","getFirstRange","addMarker","setAttribute","plugins","clear","selection","oldRange","isPremiumPlugin","change","orderNumber","mouseenter","innerHTML","undo","isDocumentOperation","getNearestSelectionRange","user:range","for","spellcheck","getCustomProperty","rootName","ck-user__marker_hovered","element","ck-user__marker-tooltip",'<span class="ck-user__marker-line" contenteditable="false"><span class="ck-user__marker-dot"></span></span>',"reconvertMarker","isLimit","ck-user__marker ","mapper","3qqGcBo","editing","_createdBatches","275926eZIESO","2919861qyvlVz","userPositionMarker","452400hTUeWd","startsWith","mouseleave","listenTo","contenteditable","isInline","getRange","stopListening","pluginName","markerToHighlight","get","batch","outerHTML","$graveyard","createUIElement","isObject","textContent","keydown","parent","root","split","afterInit","checkChild","markerToElement","updateMarker","toDomElement","editor","markerNameToElements","false","document","add","createRange","highest","commands","enqueueChange","render","ck-user__selection","$text","set","schema","getMarkerClass","hasDomSelection","UserMarkers","editingDowncast","addEventListener","hasContent","getUserBySessionId","color","createUserMarkerOperations","getContainedElement"];return(Ds=function(){return e})()}function xs(e,t,n,r){const s=Cs,o=s(232)+e,i=s(233)+e,a=t[s(191)]();let c=t[s(202)];a&&a.is(s(129),s(216))&&(c=function(e,t){const n=s;for(const r of e[n(231)]())if(t[n(181)][n(164)](r,n(179)))return r}(t,n),t=r[s(173)](c));const d=r[s(173)](c);n[s(205)][s(223)](o)?(r[s(166)](o,{range:t}),r[s(166)](i,{range:d})):(r[s(247)](o,{range:t,usingOperation:!0}),r[s(247)](i,{range:d,usingOperation:!0}))}function Rs(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 Ns=(()=>{var e=p.Reader,t=p.Writer,n=p.util,r=p.roots.default||(p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Element"},s}(),r})();class Vs{constructor(){this._protobufRoot=Ns}getDescriptor(e){return new Ms(this._protobufRoot[e])}}class Ms{constructor(e){this._protobuf=e}compress(e){const t=this._protobuf.verify(e);if(t)throw Error(t);return this._protobuf.encode(this._protobuf.create(e)).finish()}decompress(e){return this._protobuf.toObject(this._protobuf.decode(e),{oneofs:!0})}}const Us=function(){this.__data__=[],this.size=0};const Bs=function(e,t){return e===t||e!=e&&t!=t};const Js=function(e,t){for(var n=e.length;n--;)if(Bs(e[n][0],t))return n;return-1};var qs=Array.prototype.splice;const Gs=function(e){var t=this.__data__,n=Js(t,e);return!(n<0)&&(n==t.length-1?t.pop():qs.call(t,n,1),--this.size,!0)};const Ls=function(e){var t=this.__data__,n=Js(t,e);return n<0?void 0:t[n][1]};const Hs=function(e){return Js(this.__data__,e)>-1};const zs=function(e,t){var n=this.__data__,r=Js(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Ys(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ys.prototype.clear=Us,Ys.prototype.delete=Gs,Ys.prototype.get=Ls,Ys.prototype.has=Hs,Ys.prototype.set=zs;const Fs=Ys;const Ks=function(){this.__data__=new Fs,this.size=0};const Ws=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};const Qs=function(e){return this.__data__.get(e)};const $s=function(e){return this.__data__.has(e)};const Zs="object"==typeof global&&global&&global.Object===Object&&global;var Xs="object"==typeof self&&self&&self.Object===Object&&self;const eo=Zs||Xs||Function("return this")();const to=eo.Symbol;var no=Object.prototype,ro=no.hasOwnProperty,so=no.toString,oo=to?to.toStringTag:void 0;const io=function(e){var t=ro.call(e,oo),n=e[oo];try{e[oo]=void 0;var r=!0}catch(e){}var s=so.call(e);return r&&(t?e[oo]=n:delete e[oo]),s};var ao=Object.prototype.toString;const co=function(e){return ao.call(e)};var uo=to?to.toStringTag:void 0;const lo=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":uo&&uo in Object(e)?io(e):co(e)};const po=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const ho=function(e){if(!po(e))return!1;var t=lo(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const fo=eo["__core-js_shared__"];var mo,yo=(mo=/[^.]+$/.exec(fo&&fo.keys&&fo.keys.IE_PROTO||""))?"Symbol(src)_1."+mo:"";const go=function(e){return!!yo&&yo in e};var bo=Function.prototype.toString;const Oo=function(e){if(null!=e){try{return bo.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var wo=/^\[object .+?Constructor\]$/,vo=Function.prototype,Io=Object.prototype,So=vo.toString,Po=Io.hasOwnProperty,ko=RegExp("^"+So.call(Po).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Ao=function(e){return!(!po(e)||go(e))&&(ho(e)?ko:wo).test(Oo(e))};const _o=function(e,t){return null==e?void 0:e[t]};const To=function(e,t){var n=_o(e,t);return Ao(n)?n:void 0};const Co=To(eo,"Map");const jo=To(Object,"create");const Eo=function(){this.__data__=jo?jo(null):{},this.size=0};const Do=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var xo=Object.prototype.hasOwnProperty;const Ro=function(e){var t=this.__data__;if(jo){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return xo.call(t,e)?t[e]:void 0};var No=Object.prototype.hasOwnProperty;const Vo=function(e){var t=this.__data__;return jo?void 0!==t[e]:No.call(t,e)};const Mo=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=jo&&void 0===t?"__lodash_hash_undefined__":t,this};function Uo(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Uo.prototype.clear=Eo,Uo.prototype.delete=Do,Uo.prototype.get=Ro,Uo.prototype.has=Vo,Uo.prototype.set=Mo;const Bo=Uo;const Jo=function(){this.size=0,this.__data__={hash:new Bo,map:new(Co||Fs),string:new Bo}};const qo=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const Go=function(e,t){var n=e.__data__;return qo(t)?n["string"==typeof t?"string":"hash"]:n.map};const Lo=function(e){var t=Go(this,e).delete(e);return this.size-=t?1:0,t};const Ho=function(e){return Go(this,e).get(e)};const zo=function(e){return Go(this,e).has(e)};const Yo=function(e,t){var n=Go(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Fo(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Fo.prototype.clear=Jo,Fo.prototype.delete=Lo,Fo.prototype.get=Ho,Fo.prototype.has=zo,Fo.prototype.set=Yo;const Ko=Fo;const Wo=function(e,t){var n=this.__data__;if(n instanceof Fs){var r=n.__data__;if(!Co||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ko(r)}return n.set(e,t),this.size=n.size,this};function Qo(e){var t=this.__data__=new Fs(e);this.size=t.size}Qo.prototype.clear=Ks,Qo.prototype.delete=Ws,Qo.prototype.get=Qs,Qo.prototype.has=$s,Qo.prototype.set=Wo;const $o=Qo;const Zo=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e};const Xo=function(){try{var e=To(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const ei=function(e,t,n){"__proto__"==t&&Xo?Xo(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var ti=Object.prototype.hasOwnProperty;const ni=function(e,t,n){var r=e[t];ti.call(e,t)&&Bs(r,n)&&(void 0!==n||t in e)||ei(e,t,n)};const ri=function(e,t,n,r){var s=!n;n||(n={});for(var o=-1,i=t.length;++o<i;){var a=t[o],c=r?r(n[a],e[a],a,n,e):void 0;void 0===c&&(c=e[a]),s?ei(n,a,c):ni(n,a,c)}return n};const si=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};const oi=function(e){return null!=e&&"object"==typeof e};const ii=function(e){return oi(e)&&"[object Arguments]"==lo(e)};var ai=Object.prototype,ci=ai.hasOwnProperty,di=ai.propertyIsEnumerable,ui=ii(function(){return arguments}())?ii:function(e){return oi(e)&&ci.call(e,"callee")&&!di.call(e,"callee")};const li=ui;const pi=Array.isArray;const hi=function(){return!1};var fi="object"==typeof exports&&exports&&!exports.nodeType&&exports,mi=fi&&"object"==typeof module&&module&&!module.nodeType&&module,yi=mi&&mi.exports===fi?eo.Buffer:void 0;const gi=(yi?yi.isBuffer:void 0)||hi;var bi=/^(?:0|[1-9]\d*)$/;const Oi=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&bi.test(e))&&e>-1&&e%1==0&&e<t};const wi=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var vi={};vi["[object Float32Array]"]=vi["[object Float64Array]"]=vi["[object Int8Array]"]=vi["[object Int16Array]"]=vi["[object Int32Array]"]=vi["[object Uint8Array]"]=vi["[object Uint8ClampedArray]"]=vi["[object Uint16Array]"]=vi["[object Uint32Array]"]=!0,vi["[object Arguments]"]=vi["[object Array]"]=vi["[object ArrayBuffer]"]=vi["[object Boolean]"]=vi["[object DataView]"]=vi["[object Date]"]=vi["[object Error]"]=vi["[object Function]"]=vi["[object Map]"]=vi["[object Number]"]=vi["[object Object]"]=vi["[object RegExp]"]=vi["[object Set]"]=vi["[object String]"]=vi["[object WeakMap]"]=!1;const Ii=function(e){return oi(e)&&wi(e.length)&&!!vi[lo(e)]};const Si=function(e){return function(t){return e(t)}};var Pi="object"==typeof exports&&exports&&!exports.nodeType&&exports,ki=Pi&&"object"==typeof module&&module&&!module.nodeType&&module,Ai=ki&&ki.exports===Pi&&Zs.process;const _i=function(){try{var e=ki&&ki.require&&ki.require("util").types;return e||Ai&&Ai.binding&&Ai.binding("util")}catch(e){}}();var Ti=_i&&_i.isTypedArray;const Ci=Ti?Si(Ti):Ii;var ji=Object.prototype.hasOwnProperty;const Ei=function(e,t){var n=pi(e),r=!n&&li(e),s=!n&&!r&&gi(e),o=!n&&!r&&!s&&Ci(e),i=n||r||s||o,a=i?si(e.length,String):[],c=a.length;for(var d in e)!t&&!ji.call(e,d)||i&&("length"==d||s&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||Oi(d,c))||a.push(d);return a};var Di=Object.prototype;const xi=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Di)};const Ri=function(e,t){return function(n){return e(t(n))}};const Ni=Ri(Object.keys,Object);var Vi=Object.prototype.hasOwnProperty;const Mi=function(e){if(!xi(e))return Ni(e);var t=[];for(var n in Object(e))Vi.call(e,n)&&"constructor"!=n&&t.push(n);return t};const Ui=function(e){return null!=e&&wi(e.length)&&!ho(e)};const Bi=function(e){return Ui(e)?Ei(e):Mi(e)};const Ji=function(e,t){return e&&ri(t,Bi(t),e)};const qi=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var Gi=Object.prototype.hasOwnProperty;const Li=function(e){if(!po(e))return qi(e);var t=xi(e),n=[];for(var r in e)("constructor"!=r||!t&&Gi.call(e,r))&&n.push(r);return n};const Hi=function(e){return Ui(e)?Ei(e,!0):Li(e)};const zi=function(e,t){return e&&ri(t,Hi(t),e)};var Yi="object"==typeof exports&&exports&&!exports.nodeType&&exports,Fi=Yi&&"object"==typeof module&&module&&!module.nodeType&&module,Ki=Fi&&Fi.exports===Yi?eo.Buffer:void 0,Wi=Ki?Ki.allocUnsafe:void 0;const Qi=function(e,t){if(t)return e.slice();var n=e.length,r=Wi?Wi(n):new e.constructor(n);return e.copy(r),r};const $i=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};const Zi=function(e,t){for(var n=-1,r=null==e?0:e.length,s=0,o=[];++n<r;){var i=e[n];t(i,n,e)&&(o[s++]=i)}return o};const Xi=function(){return[]};var ea=Object.prototype.propertyIsEnumerable,ta=Object.getOwnPropertySymbols;const na=ta?function(e){return null==e?[]:(e=Object(e),Zi(ta(e),(function(t){return ea.call(e,t)})))}:Xi;const ra=function(e,t){return ri(e,na(e),t)};const sa=function(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e};const oa=Ri(Object.getPrototypeOf,Object);const ia=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)sa(t,na(e)),e=oa(e);return t}:Xi;const aa=function(e,t){return ri(e,ia(e),t)};const ca=function(e,t,n){var r=t(e);return pi(e)?r:sa(r,n(e))};const da=function(e){return ca(e,Bi,na)};const ua=function(e){return ca(e,Hi,ia)};const la=To(eo,"DataView");const pa=To(eo,"Promise");const ha=To(eo,"Set");const fa=To(eo,"WeakMap");var ma="[object Map]",ya="[object Promise]",ga="[object Set]",ba="[object WeakMap]",Oa="[object DataView]",wa=Oo(la),va=Oo(Co),Ia=Oo(pa),Sa=Oo(ha),Pa=Oo(fa),ka=lo;(la&&ka(new la(new ArrayBuffer(1)))!=Oa||Co&&ka(new Co)!=ma||pa&&ka(pa.resolve())!=ya||ha&&ka(new ha)!=ga||fa&&ka(new fa)!=ba)&&(ka=function(e){var t=lo(e),n="[object Object]"==t?e.constructor:void 0,r=n?Oo(n):"";if(r)switch(r){case wa:return Oa;case va:return ma;case Ia:return ya;case Sa:return ga;case Pa:return ba}return t});const Aa=ka;var _a=Object.prototype.hasOwnProperty;const Ta=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&_a.call(e,"index")&&(n.index=e.index,n.input=e.input),n};const Ca=eo.Uint8Array;const ja=function(e){var t=new e.constructor(e.byteLength);return new Ca(t).set(new Ca(e)),t};const Ea=function(e,t){var n=t?ja(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)};var Da=/\w*$/;const xa=function(e){var t=new e.constructor(e.source,Da.exec(e));return t.lastIndex=e.lastIndex,t};var Ra=to?to.prototype:void 0,Na=Ra?Ra.valueOf:void 0;const Va=function(e){return Na?Object(Na.call(e)):{}};const Ma=function(e,t){var n=t?ja(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};const Ua=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return ja(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return Ea(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Ma(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return xa(e);case"[object Symbol]":return Va(e)}};var Ba=Object.create;const Ja=function(){function e(){}return function(t){if(!po(t))return{};if(Ba)return Ba(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const qa=function(e){return"function"!=typeof e.constructor||xi(e)?{}:Ja(oa(e))};const Ga=function(e){return oi(e)&&"[object Map]"==Aa(e)};var La=_i&&_i.isMap;const Ha=La?Si(La):Ga;const za=function(e){return oi(e)&&"[object Set]"==Aa(e)};var Ya=_i&&_i.isSet;const Fa=Ya?Si(Ya):za;var Ka="[object Arguments]",Wa="[object Function]",Qa="[object Object]",$a={};$a[Ka]=$a["[object Array]"]=$a["[object ArrayBuffer]"]=$a["[object DataView]"]=$a["[object Boolean]"]=$a["[object Date]"]=$a["[object Float32Array]"]=$a["[object Float64Array]"]=$a["[object Int8Array]"]=$a["[object Int16Array]"]=$a["[object Int32Array]"]=$a["[object Map]"]=$a["[object Number]"]=$a[Qa]=$a["[object RegExp]"]=$a["[object Set]"]=$a["[object String]"]=$a["[object Symbol]"]=$a["[object Uint8Array]"]=$a["[object Uint8ClampedArray]"]=$a["[object Uint16Array]"]=$a["[object Uint32Array]"]=!0,$a["[object Error]"]=$a[Wa]=$a["[object WeakMap]"]=!1;const Za=function e(t,n,r,s,o,i){var a,c=1&n,d=2&n,u=4&n;if(r&&(a=o?r(t,s,o,i):r(t)),void 0!==a)return a;if(!po(t))return t;var l=pi(t);if(l){if(a=Ta(t),!c)return $i(t,a)}else{var p=Aa(t),h=p==Wa||"[object GeneratorFunction]"==p;if(gi(t))return Qi(t,c);if(p==Qa||p==Ka||h&&!o){if(a=d||h?{}:qa(t),!c)return d?aa(t,zi(a,t)):ra(t,Ji(a,t))}else{if(!$a[p])return o?t:{};a=Ua(t,p,c)}}i||(i=new $o);var f=i.get(t);if(f)return f;i.set(t,a),Fa(t)?t.forEach((function(s){a.add(e(s,n,r,s,t,i))})):Ha(t)&&t.forEach((function(s,o){a.set(o,e(s,n,r,o,t,i))}));var m=l?void 0:(u?d?ua:da:d?Hi:Bi)(t);return Zo(m||t,(function(s,o){m&&(s=t[o=s]),ni(a,o,e(s,n,r,o,t,i))})),a};const Xa=function(e){return Za(e,5)};const ec=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const tc=function(e){return this.__data__.has(e)};function nc(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Ko;++t<n;)this.add(e[t])}nc.prototype.add=nc.prototype.push=ec,nc.prototype.has=tc;const rc=nc;const sc=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};const oc=function(e,t){return e.has(t)};const ic=function(e,t,n,r,s,o){var i=1&n,a=e.length,c=t.length;if(a!=c&&!(i&&c>a))return!1;var d=o.get(e),u=o.get(t);if(d&&u)return d==t&&u==e;var l=-1,p=!0,h=2&n?new rc:void 0;for(o.set(e,t),o.set(t,e);++l<a;){var f=e[l],m=t[l];if(r)var y=i?r(m,f,l,t,e,o):r(f,m,l,e,t,o);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!sc(t,(function(e,t){if(!oc(h,t)&&(f===e||s(f,e,n,r,o)))return h.push(t)}))){p=!1;break}}else if(f!==m&&!s(f,m,n,r,o)){p=!1;break}}return o.delete(e),o.delete(t),p};const ac=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n};const cc=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var dc=to?to.prototype:void 0,uc=dc?dc.valueOf:void 0;const lc=function(e,t,n,r,s,o,i){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new Ca(e),new Ca(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Bs(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=ac;case"[object Set]":var c=1&r;if(a||(a=cc),e.size!=t.size&&!c)return!1;var d=i.get(e);if(d)return d==t;r|=2,i.set(e,t);var u=ic(a(e),a(t),r,s,o,i);return i.delete(e),u;case"[object Symbol]":if(uc)return uc.call(e)==uc.call(t)}return!1};var pc=Object.prototype.hasOwnProperty;const hc=function(e,t,n,r,s,o){var i=1&n,a=da(e),c=a.length;if(c!=da(t).length&&!i)return!1;for(var d=c;d--;){var u=a[d];if(!(i?u in t:pc.call(t,u)))return!1}var l=o.get(e),p=o.get(t);if(l&&p)return l==t&&p==e;var h=!0;o.set(e,t),o.set(t,e);for(var f=i;++d<c;){var m=e[u=a[d]],y=t[u];if(r)var g=i?r(y,m,u,t,e,o):r(m,y,u,e,t,o);if(!(void 0===g?m===y||s(m,y,n,r,o):g)){h=!1;break}f||(f="constructor"==u)}if(h&&!f){var b=e.constructor,O=t.constructor;b==O||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof O&&O instanceof O||(h=!1)}return o.delete(e),o.delete(t),h};var fc="[object Arguments]",mc="[object Array]",yc="[object Object]",gc=Object.prototype.hasOwnProperty;const bc=function(e,t,n,r,s,o){var i=pi(e),a=pi(t),c=i?mc:Aa(e),d=a?mc:Aa(t),u=(c=c==fc?yc:c)==yc,l=(d=d==fc?yc:d)==yc,p=c==d;if(p&&gi(e)){if(!gi(t))return!1;i=!0,u=!1}if(p&&!u)return o||(o=new $o),i||Ci(e)?ic(e,t,n,r,s,o):lc(e,t,c,n,r,s,o);if(!(1&n)){var h=u&&gc.call(e,"__wrapped__"),f=l&&gc.call(t,"__wrapped__");if(h||f){var m=h?e.value():e,y=f?t.value():t;return o||(o=new $o),s(m,y,n,r,o)}}return!!p&&(o||(o=new $o),hc(e,t,n,r,s,o))};const Oc=function e(t,n,r,s,o){return t===n||(null==t||null==n||!oi(t)&&!oi(n)?t!=t&&n!=n:bc(t,n,r,s,e,o))};const wc=function(e,t){return Oc(e,t)};function vc(e,t){const n=Xa(e);return n.path[n.path.length-1]+=t,n}function Ic(e,t){return e.root===t.root&&wc(e.path,t.path)}function Sc(e){kc(e,(e=>("main"==e.root?(e.rootMain=!0,delete e.root):"$graveyard"==e.root&&(e.rootGraveyard=!0,delete e.root),e)))}function Pc(e){kc(e,(e=>(e.rootMain?(e.root="main",delete e.rootMain):e.rootGraveyard&&(e.root="$graveyard",delete e.rootGraveyard),e)))}function kc(e,t){for(const n in e){const r=e[n];"nodes"!==n&&po(r)&&(r.path&&(r.root||r.rootMain||r.rootGraveyard)?e[n]=t(r):kc(r,t))}return e}class Ac{constructor(e,t,n){this._id=e,this._operationName=t,this._protobufDescriptor=n}compress(e,t){const n=t.shift();return Sc(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());Pc(n),n.__className=this._operationName,e.push(n)}}class _c extends Ac{compress(e,t){const n=t.shift();return this._serializeOneOf("oldValue",n),this._serializeOneOf("newValue",n),Sc(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),Pc(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 Tc extends Ac{compress(e,t){const n=t.shift();return this._serializeNodesAttributes(n.nodes),Sc(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),Pc(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 Cc extends Ac{decompress(e,t){super.decompress(e,t);const n=e[e.length-1];n.oldRange||(n.oldRange=null),n.newRange||(n.newRange=null)}}class jc extends Ac{compress(e,t){return t.shift(),e.types.push(this._id),!0}decompress(e,t){t.types.shift(),e.push({__className:this._operationName})}}class Ec extends Cc{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 Dc{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=Xa(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 xc extends Dc{_combineNext(e,t){return t.nodes[0].data+=e.nodes[0].data,t}_splitCurrent(e){const t=Xa(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=vc(e.position,o),t}_compareOperations(e,t){if(this._checkOperation(e)&&this._checkOperation(t)){const n=e.nodes[0].data.length,r=Ic(vc(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 Rc extends Dc{_combineNext(e,t){return t.howMany++,t.sourcePosition=Xa(e.sourcePosition),t}_splitCurrent(e){const t=Xa(e);return e.howMany--,t.howMany=1,t.sourcePosition=vc(t.sourcePosition,e.howMany),t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(Ic(vc(e.sourcePosition,-1),t.sourcePosition)&&Ic(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 Nc extends Dc{_combineNext(e,t){return t.howMany++,t}_splitCurrent(e){const t=Xa(e);return t.howMany=1,e.howMany--,t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(Ic(e.sourcePosition,t.sourcePosition)&&Ic(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 Vc extends Dc{compress(e,t){if(!this._compareOperations(t[0],t[1]))return!1;const n=t.shift();return n.oldRange=null,n.newRange&&Ic(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=Xa(n.newRange.start));const r=Xa(n);r.newRange&&(r.newRange.start.stickiness="toNone",r.newRange.end=Xa(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 Mc{constructor(){this._compressorById=new Map,this._compressorByName=new Map,this._protobufFactory=new Vs;const e=this._protobufFactory.getDescriptor("MarkerOperation");this._registerCompressor(1,"NoOperation",new jc(1,"NoOperation",void 0)),this._registerOperationCompressor(10,"AttributeOperation",_c),this._registerOperationCompressor(11,"InsertOperation",Tc),this._registerOperationCompressor(12,"MarkerOperation",Cc),this._registerOperationCompressor(13,"MergeOperation",Ac),this._registerOperationCompressor(14,"MoveOperation",Ac),this._registerOperationCompressor(15,"RenameOperation",Ac),this._registerOperationCompressor(16,"RootAttributeOperation",_c),this._registerOperationCompressor(17,"SplitOperation",Ac),this._registerCompressor(18,"CommentMarkerOperation",new Ec(18,"MarkerOperation",e,"comment")),this._registerCompressor(19,"SuggestionMarkerOperation",new Ec(19,"MarkerOperation",e,"suggestion")),this._registerOperationCompressor(20,"RootOperation",Ac),this._registerActionCompressor(100,"TypingAction",xc),this._registerActionCompressor(101,"DeletingAction",Rc),this._registerActionCompressor(102,"ForwardDeletingAction",Nc),this._registerActionCompressor(103,"UserSelectionAction",Vc)}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 Uc=Bc;function Bc(e,t){const n=zc();return(Bc=function(e,t){return n[e-=193]})(e,t)}!function(e){const t=Bc,n=e();for(;;)try{if(683636===parseInt(t(396))/1*(-parseInt(t(270))/2)+parseInt(t(414))/3+parseInt(t(227))/4*(-parseInt(t(207))/5)+parseInt(t(337))/6*(-parseInt(t(402))/7)+-parseInt(t(209))/8+parseInt(t(446))/9+parseInt(t(397))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(zc);let Jc=1;class qc extends t.Plugin{static get[Uc(433)](){return[ls,ys,Es,t.PendingActions,ps.Users,r.Notification]}static get[Uc(440)](){return Uc(222)}static get[Uc(370)](){return!0}static get[Uc(201)](){return!0}get[Uc(302)](){const e=Uc;return this[e(385)]+this[e(407)]}get[Uc(385)](){const e=Uc;return this[e(359)][e(375)]-this[e(407)]}get[Uc(441)](){const e=Uc,t=this[e(359)][e(416)]();for(let n=t[e(348)]-1;n>=0;n--){const r=t[n];if(!this[e(453)][e(442)](r))return r[e(198)]+1-this[e(407)]}return 0}constructor(e){const t=Uc;if(super(e),this[t(407)]=0,this[t(241)]=null,this[t(359)]=new s.History,this[t(314)][t(394)][t(345)](t(413),{}),this[t(332)]=this[t(314)][t(394)][t(374)](t(454)),!this[t(332)])throw new n.CKEditorError(t(380),this);const r=e[t(394)][t(374)](t(365))||n.version;this[t(205)]=new(qc[t(298)])(r,this[t(332)]),this[t(231)]=this[t(314)][t(387)][t(194)],this[t(344)]=new Mc,this[t(215)]=[],this[t(398)]=new WeakSet,this[t(289)]=new Set,this[t(368)](t(301),!1),this[t(368)](t(306),!1),this[t(279)]=null,this[t(245)]=!1,this[t(408)]=null,this[t(309)]=300,this[t(362)]=this[t(309)],this[t(221)]=null,this[t(453)]=new WeakSet,this[t(258)]=new Yc(this[t(453)])}[Uc(261)](){const e=Uc,t=this[e(314)],n=t[e(212)][e(374)](ps.Users),r=t[e(212)][e(374)](ls);this[e(213)](n,e(313),((t,r)=>{const s=e,o=r[0];o[s(341)]&&(t[s(350)]=n[s(355)](o[s(341)]),t[s(334)]()),null===o[s(341)]&&(t[s(350)]=null,t[s(334)]())}),{priority:e(431)}),this[e(213)](t[e(387)][e(194)][e(411)],e(449),((t,n)=>{const r=e;n[r(351)]&&this[r(335)]()})),this[e(213)](t[e(378)][e(228)],e(419),(()=>{this[e(335)]()})),this[e(325)](),t[e(387)].on(e(401),((t,n)=>{const r=e,s=n[0];s[r(422)]&&(this[r(236)](s),this[r(353)]()&&this[r(303)]())})),this[e(304)](),this[e(249)](e(390)).to(r,e(287),this,e(306),((t,n)=>e(427)===t&&!n)),this.on(e(294),(()=>{const n=e;this[n(390)]?t[n(286)](n(264)):t[n(265)](n(264))})),this[e(390)]?t[e(286)](e(264)):t[e(265)](e(264)),this[e(368)](e(436),!1)}async[Uc(232)](){const e=Uc,t=this[e(314)][e(212)][e(374)](ys),n=this[e(314)][e(212)][e(374)](ls);try{this[e(301)]=!0,t[e(230)](this[e(332)]);const r=await this[e(205)][e(232)](n[e(357)],this[e(441)]);await this[e(354)](r)&&(this[e(301)]=!1,this[e(318)]());const s=await this[e(205)][e(364)]();t[e(346)](this[e(332)],s),this[e(225)](),this[e(436)]=!0}catch(t){if(function(t){const n=e;return n(197)===t[n(323)]}(t)&&this[e(241)])await this[e(229)]();else if(function(t){const n=e;return n(307)===t[n(323)]}(t)){const t=Rs(this[e(314)][e(253)],e(324));this[e(240)](t)}else{if(!(t instanceof Lc))throw t;this[e(240)]()}}}[Uc(382)](){const e=Uc,t=this[e(314)][e(212)][e(374)](ls),n=this[e(314)][e(212)][e(374)](ys);this[e(314)][e(265)](e(268)),n[e(452)][e(442)](this[e(332)])&&n[e(230)](this[e(332)]),t[e(271)](this),this[e(379)](),super[e(382)]()}async[Uc(354)](e){const t=Uc;if(this[t(241)]!==e[t(241)]&&this[t(221)]!==e[t(204)])throw new Lc;return this[t(241)]=e[t(241)],this[t(415)]([],{...e,wereChangesApplied:!1,data:e[t(376)]},t(232))}async[Uc(322)](e,t=!1){const n=Uc,{connection:r}=this[n(314)][n(212)][n(374)](ls);qc[n(298)][n(364)](r,this[n(332)])[n(336)]((e=>this[n(360)](e)))[n(400)]((e=>{const t=n;this[t(251)](t(437),e)})),this[n(213)](this[n(205)],n(386),this[n(297)][n(249)](this)),this[n(213)](this[n(205)],n(338),((e,t)=>{const r=n;this[r(251)](r(363),t)})),this[n(213)](this[n(205)],n(296),(()=>{this[n(436)]=!1}));const s=this[n(258)][n(369)](e);this[n(301)]=!0;const o=await this[n(205)][n(311)](r,this[n(226)](e),s);if(this[n(241)]=o[n(241)],t){if(!o[n(371)])return void this[n(240)]();this[n(301)]=!1,this[n(318)](),this[n(359)][n(439)](),this[n(407)]=o[n(239)],this[n(359)][n(375)]=this[n(407)],await this[n(415)](e,o,n(219))}else await this[n(410)](o,e);this[n(225)](),this[n(436)]=!0}[Uc(225)](){const e=Uc,t=this[e(314)][e(212)][e(374)](ys),n=this[e(314)][e(212)][e(374)](Es),r=t[e(452)][e(374)](this[e(332)]);r&&r[e(348)]>1?n[e(305)]():this[e(213)](t,e(430)+this[e(332)],(()=>{const r=e;2===t[r(452)][r(374)](this[r(332)])[r(348)]&&n[r(305)]()}))}async[Uc(297)](e,t,n,r){const s=Uc;if(!this[s(301)]&&this[s(231)][s(375)]==t){const e=this[s(420)](n,r);await this[s(278)](e),this[s(255)](e,t,n[s(204)])||this[s(251)](s(252))}}async[Uc(229)](){const e=Uc;this[e(379)]();const{locale:t}=this[e(314)];let n;try{n=await this[e(205)][e(319)]()}catch(n){const r=Rs(t,e(356));return void this[e(240)](r)}const r=n[e(317)]||n[e(254)];if(this[e(221)]===r[e(204)])await this[e(322)](this[e(314)][e(387)][e(194)][e(211)][e(416)](),!0);else{const n=Rs(t,e(196));this[e(240)](n)}}[Uc(379)](){const e=Uc;this[e(205)][e(447)](),this[e(215)]=[],clearTimeout(this[e(408)]),this[e(399)](this[e(205)])}[Uc(360)](e){const t=Uc,n=this[t(314)][t(212)][t(374)](ys);this[t(213)](n,t(430)+this[t(332)],((e,{session:r})=>{const s=t;if(r.id===n[s(361)]){e[s(262)]();const t=this[s(314)][s(212)][s(442)](s(320))&&this[s(314)][s(212)][s(374)](s(320));let n=r[s(417)];t&&t[s(412)]&&(n=n[s(326)]((e=>s(208)!==e))),this[s(314)][s(212)][s(374)](s(216))[s(352)](n,this[s(332)])}})),n[t(346)](this[t(332)],e)}[Uc(325)](){const e=Uc,t=this[e(314)][e(376)][e(368)];this[e(314)][e(376)][e(368)]=(...r)=>{const s=e;if(!r[r[s(348)]-1][s(343)])throw new n.CKEditorError(s(292),this);t[s(395)](this[s(314)][s(376)],r)}}[Uc(304)](){const e=Uc;this[e(314)][e(376)].on(e(261),((t,[r])=>{const o=e;if(this[o(231)][o(375)])throw new n.CKEditorError(o(235),this);t[o(334)](),this[o(285)]();const i=this[o(314)][o(394)][o(374)](o(284)),a=this[o(195)](r,i);0==a[o(348)]&&a[o(327)](new s.NoOperation(0)),t[o(350)]=this[o(322)](a)[o(336)]((()=>{const e=o;this[e(314)][e(212)][e(374)](ls)[e(220)](this),this[e(314)][e(376)][e(383)](e(206))}))[o(400)]((e=>this[o(251)](o(418),e)))[o(263)]((()=>this[o(318)]()))}),{priority:e(431)}),this[e(314)].on(e(451),(async(t,[n,r])=>{const s=e;t[s(334)]();const o=this[s(314)][s(387)][s(194)][s(347)](n);if(!this[s(289)][s(442)](n)){const e=r&&r[s(376)]?r[s(376)]:"",t=r&&r[s(200)]?r[s(200)]:{};await this[s(429)](n,e,t)}this[s(314)][s(387)][s(224)]({isUndoable:!1},(()=>{const e=s;o[e(432)]=!0,this[e(314)][e(387)][e(194)][e(277)][e(288)](o)}))}),{priority:e(431)})}async[Uc(278)](e){const t=Uc,n=this[t(314)][t(212)][t(374)](ps.Users),{connection:r}=this[t(314)][t(212)][t(374)](ls),s=new Set;for(const r of e){const e=r[t(341)];e&&!n[t(355)](e)&&s[t(310)](e)}if(0===s[t(276)])return;const o=await S[t(295)](r,Array[t(260)](s));for(const e of o)n[t(355)](e.id)||n[t(421)](e)}[Uc(195)](e,t={}){const r=Uc,o=this[r(314)][r(387)],i=[];let a=0;const c=r(282)==typeof e?{main:e}:e;for(const e of Object[r(448)](c)){if(!this[r(231)][r(199)][r(442)](e))throw new n.CKEditorError(r(275),this);const t=this[r(314)][r(376)][r(443)](c[e]),d=this[r(231)][r(347)](e),u=new s.InsertOperation(o[r(218)](d,0),t,a++);i[r(327)](u);for(const[e,n]of t[r(366)]){const t=o[r(256)](o[r(259)](d,n[r(425)][r(234)][r(381)]()),o[r(259)](d,n[r(405)][r(234)][r(381)]())),c=new s.MarkerOperation(e,null,t,o[r(366)],!0,a++);i[r(327)](c)}}if(t)for(const[e,c]of Object[r(223)](t)){const t=o[r(194)][r(347)](e);if(!t)throw new n.CKEditorError(r(392),null);for(const[e,n]of Object[r(223)](c))if(null!==n){const o=new s.RootAttributeOperation(t,e,null,n,a++);i[r(327)](o)}}return i}async[Uc(429)](e,t,n){const r=Uc;this[r(195)]({[e]:t},{[e]:n})[r(300)](((e,t)=>{const n=r;e[n(198)]=this[n(231)][n(375)]+t,e[n(202)]=!0,this[n(236)](e)})),this[r(303)](),await this[r(426)]()}async[Uc(410)](e,t){const n=Uc;let r;this[n(407)]=e[n(239)];const s=e[n(371)]&&!e[n(367)],o=s?0:e[n(376)][n(198)];if(t[n(300)]((t=>{const r=n;t[r(202)]=!0,t[r(203)]=e[r(269)],t[r(341)]=null})),s)r=t,this[n(247)](r,s);else{if(e[n(367)]){const t=this[n(195)](e[n(367)]);this[n(231)][n(211)][n(375)]=-t[n(348)],t[n(300)]((r=>{const s=n;r[s(198)]-=t[s(348)],r[s(203)]=e[s(269)],r[s(202)]=!0,r[s(341)]=null})),this[n(247)](t,!0),this[n(359)][n(375)]=-t[n(348)]+this[n(407)],this[n(246)](t)}this[n(231)][n(211)][n(375)]=o,r=this[n(420)](e[n(376)],e[n(445)]),await this[n(278)](r),this[n(247)](r,s)}e[n(204)]&&(this[n(258)][n(193)](r,e[n(204)]),this[n(221)]=e[n(204)]),this[n(359)][n(375)]=o+this[n(407)],this[n(246)](r),t[n(326)]((e=>{const t=n,r=this[t(281)](e);return r&&!this[t(289)][t(442)](r)}))[n(300)](((e,t)=>{const r=n;e[r(198)]=this[r(231)][r(375)]+t,this[r(236)](e)})),this[n(353)]()?(this[n(362)]=0,this[n(303)](!0),await this[n(426)]()):(this[n(301)]=!1,this[n(318)]())}[Uc(251)](e,t){const r=Uc,s=t&&t[r(329)];if(s&&s[r(273)](r(308)))throw t;const o=this[r(314)][r(212)][r(374)](ls);throw this[r(301)]=!0,o[r(447)](),this[r(314)][r(265)](r(312)),new n.CKEditorError(e,this[r(314)],s?{originalError:s}:void 0)}[Uc(236)](e){const t=Uc;this[t(398)][t(442)](e)||(this[t(398)][t(310)](e),this[t(215)][t(327)](e),this[t(279)]||t(266)==e[t(424)]&&!e[t(340)]||this[t(285)]())}[Uc(303)](e=!1){const t=Uc;!e&&this[t(301)]||(this[t(301)]=!0,clearTimeout(this[t(408)]),this[t(408)]=setTimeout((()=>{const e=t;this[e(217)]()[e(336)]((t=>{const n=e;t&&(this[n(318)](),this[n(301)]=!1)}))[e(400)]((t=>{const n=e;this[n(318)](),this[n(301)]=!1,function(e){const t=n;return e[t(329)][t(273)](t(237))||e[t(329)][t(273)](t(214))||e[t(329)][t(273)](t(291))}(t)||this[n(251)](t[n(329)],t)}))}),this[t(362)]))}[Uc(426)](){return new Promise((e=>{const t=Bc;this.on(t(238),(()=>{e()}))}))}async[Uc(217)](){const e=Uc,t=this[e(314)][e(212)][e(374)](Es);if(this[e(372)]()&&(t[e(305)](),this[e(245)]=!1),!this[e(353)]())return!0;const n=[...this[e(215)]];for(const t of n)t[e(434)]=this[e(231)][e(211)][e(409)](t);const r=this[e(258)][e(369)](n),s=Jc++,o=this[e(226)](n),i=await this[e(205)][e(210)](o,o[e(198)],r);try{return await this[e(415)](n,i,s)}catch(t){return this[e(251)](e(316),t)}}async[Uc(415)](e,t,n){const r=Uc;if(r(338)in t)throw t[r(338)];let s=!1;if(t[r(371)]){t[r(204)]&&(this[r(221)]=t[r(204)]),this[r(215)]=this[r(215)][r(326)]((t=>!e[r(331)](t)));for(const n of e)n[r(203)]=r(373)in t&&t[r(373)]||void 0;Hc(e,t[r(375)]-e[r(348)]),this[r(246)](e);const n=e[r(326)]((e=>{const t=r;if(!e[t(202)])return!1;const n=this[t(281)](e);return n&&!this[t(289)][t(442)](n)}));Hc(n,this[r(231)][r(375)]),this[r(247)](n),s=!0,this[r(362)]=this[r(309)]}else{const e=this[r(420)](t[r(376)],t[r(445)])[r(326)]((e=>e[r(198)]>=this[r(385)]));e[r(300)]((e=>this[r(450)](e))),this[r(215)]=this[r(215)][r(326)]((e=>!e[r(202)]||!this[r(289)][r(442)](this[r(281)](e)))),this[r(215)][r(348)]&&Hc(this[r(215)],this[r(215)][0][r(198)]),await this[r(278)](e),s=this[r(255)](e,t[r(375)],t[r(204)]),this[r(362)]=Math[r(339)](this[r(362)]/2)}return s?!this[r(353)]()||(this[r(303)](!0),!1):this[r(251)](r(243))}[Uc(255)](e,t,n){const r=Uc;try{const o={document:this[r(231)],useRelations:!1,padWithNoOps:!0},{operationsA:i,operationsB:a,originalOperations:c}=(0,s.transformSets)(e,this[r(215)],o);Hc(i,this[r(231)][r(375)]),Hc(a,t);for(const e of i){const t=c[r(374)](e);e[r(341)]=t?t[r(341)]:null}n&&(this[r(258)][r(193)](e,n),this[r(221)]=n),this[r(215)]=[...a],this[r(247)](i),this[r(246)](e)}catch(e){return console[r(338)](e),!1}return!0}[Uc(247)](e,t=!1){const n=Uc;this[n(314)][n(387)][n(224)]({isUndoable:!1,isLocal:!1},(t=>{const r=n;for(const n of e)this[r(398)][r(310)](n),this[r(450)](n),t[r(404)][r(290)](n),this[r(314)][r(387)][r(401)](n)}))}[Uc(450)](e){const t=Uc,n=this[t(281)](e);n&&this[t(289)][t(310)](n)}[Uc(281)](e){const t=Uc;let n,r;switch(e[t(424)]){case t(406):n=e[t(389)][t(444)];break;case t(266):if(r=e[t(272)],!r)return null;n=r[t(444)];break;case t(423):n=e[t(444)];break;case t(244):n=e[t(391)];break;case t(393):n=e[t(384)][t(444)];break;default:return null}return n[t(283)]}[Uc(246)](e){const t=Uc;e[t(300)]((e=>{const n=t,r=e[n(299)]();r[n(341)]=e[n(341)],r[n(202)]=!!e[n(202)],r[n(203)]=e[n(203)],r[n(198)]+=this[n(407)],e[n(388)]&&this[n(453)][n(310)](r),this[n(359)][n(290)](r)}))}[Uc(240)](e){const t=Uc,n=this[t(314)][t(212)][t(374)](t(342)),r=this[t(314)][t(253)];e||(e=Rs(r,t(267))),n[t(330)](e,{title:Rs(r,t(377)),namespace:t(293)}),this[t(306)]=!0,clearTimeout(this[t(408)]),this[t(215)]=[],this[t(314)][t(212)][t(374)](ls)[t(447)]()}[Uc(285)](){const e=Uc;this[e(279)]||(this[e(279)]=this[e(314)][e(212)][e(374)](t.PendingActions)[e(310)](Rs(this[e(314)][e(253)],e(315))))}[Uc(318)](){const e=Uc;this[e(279)]&&(this[e(314)][e(212)][e(374)](t.PendingActions)[e(257)](this[e(279)]),this[e(279)]=null)}[Uc(226)](e){const t=Uc,n=e[t(242)]((e=>e[t(280)]()));return this[t(344)][t(358)](n)}[Uc(420)](e,t){const n=Uc;return this[n(344)][n(321)](e)[n(242)](((e,r)=>{const o=n,i=o(261)==t[r][o(424)];if(o(328)==e[o(435)]){const t=e[o(389)][o(444)];!this[o(231)][o(347)](t)&&(this[o(231)][o(403)](o(438),t)[o(233)]=!1)}const a=s.OperationFactory[o(248)](e,this[o(231)]);return a[o(434)]=e[o(434)],a[o(202)]=i,a[o(341)]=i?null:t[r][o(428)],a[o(388)]=o(349)===t[r][o(424)],a[o(203)]=t[r][o(203)],a}))}[Uc(335)](){const e=Uc;this[e(245)]=!0,this[e(372)]()?this[e(303)]():this[e(245)]=!1}[Uc(372)](){const e=Uc,t=this[e(314)][e(212)][e(374)](ys)[e(452)][e(374)](this[e(332)]);return!this[e(314)][e(250)]&&!!t&&t[e(348)]>1&&this[e(245)]}[Uc(353)](){const e=Uc;return this[e(215)][e(348)]>0||this[e(372)]()}}qc[Uc(298)]=br;const Gc=qc;class Lc extends Error{}function Hc(e,t){const n=Uc;for(const r of e)r[n(198)]=t++}function zc(){const e=["message","showWarning","includes","_channelId","_operationToId","stop","_refreshUserSelectionMarkers","then","40578HNImfL","error","round","affectsData","_authorId","Notification","suppressErrorInCollaboration","_compressor","define","register","getRoot","length","cs:removeUser","return","directChange","setPermissions","_shouldSendUpdate","_handleReconnectionResponse","getUser","The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.","connection","compress","serverHistory","_initSessionsHandling","mySessionId","_currentBufferDelay","realtimecollaborationclient-init-service-internal-error","getConnectedSessions","cloudServices.bundleVersion","markers","initData","set","getIdOfTheLastOperation","isOfficialPlugin","wereChangesApplied","_shouldSendSelectionUpdate","lastOperationAcceptedAt","get","version","data","Synchronization issue","editing","_disconnectService","collaboration-missing-channelid","slice","destroy","fire","targetPosition","_lastServerVersion","operationsReceived","model","_isDisconnection","position","_isEditingAllowed","affectedSelectable","multi-root-editor-root-attributes-no-root","move","config","apply","45722rqDglv","15151560xXfNXb","_knownOperations","stopListening","catch","applyOperation","406iOzzqN","createRoot","batch","end","insert","_offset","_sendBufferedOperationsDelayId","isUndoneOperation","_handleInitialConnectionData","selection","isEnabled","collaboration","1453773uUOxma","_handleServerResponse","getOperations","permissions","realtimecollaborationclient-init-connection-failed","change:hasDomSelection","_decompressOperations","addUser","isDocumentOperation","addRootAttribute","type","start","_waitUntilSynced","connected","userId","_loadRoot","sessionAdd:","high","_isLoaded","requires","wasUndone","__className","_isConnected","realtimecollaborationclient-init-session-connection-error","$root","reset","pluginName","lastSyncVersion","has","parse","root","metadata","4368033ysuIcF","disconnect","keys","change:range","_addKnownRoot","loadRoot","channelSessions","_disconnectionOperations","collaboration.channelId","setIdForTheLastOperation","document","_getOperationsFromInitData","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.","404","baseVersion","roots","attributes","isPremiumPlugin","_isInit","createdAt","lastOperationId","_service","ready","3335eAsGym","document:write","10144728YqTpQB","sendOperations","history","plugins","listenTo","cloud-services-internal-error: Collaborative Editing Service is not connected.","_bufferedOperations","Permissions","_sendBufferedOperations","createPositionAt","reconnection: flushed session","addToReconnectionStack","_lastSyncedOperationId","RealTimeCollaborationClient","entries","enqueueChange","_handleSendingSelectionMarkers","_compressOperations","572CTEdVj","view","_connectAfterSessionHasBeenFlushed","unregister","_document","reconnect","_isAttached","path","realtimecollaborationclient-init-document-already-initialized","_saveOperationInBuffer","cloud-services-internal-error: Not connected.","change:_isPendingUpdate","offset","_handleReconnectionError","sessionId","map","realtimecollaborationclient-handleserverresponse","addRoot","_hasSelectionChanged","_updateServerHistory","_applyOperationsSet","fromJSON","bind","isReadOnly","_crash","realtimecollaborationclient-init-service-incorrect-server-operation","locale","lastDocumentSession","_handleExternalOperations","createRange","remove","_operationIdentifier","createPositionFromPath","from","init","off","finally","rtc-offline","enableReadOnlyMode","marker","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.","rtc-destroyed","sessionCreatedAt","2KObyAU","removeFromReconnectionStack","newRange","startsWith","_ignoredOperations","realtimecollaborationclient-init-non-existent-root","size","differ","_fetchMissingUsers","_pendingAction","toJSON","_getAffectedRoot","string","rootName","rootsAttributes","_setPendingAction","disableReadOnlyMode","state","_bufferRootLoad","_knownRootNames","addOperation","cloud-services-internal-error: Request timeout.","realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration","real-time-collaboration","change:_isEditingAllowed","getMany","disconnected","_handleReceivedOperations","CollaborativeEditingService","clone","forEach","_isPendingUpdate","cloudDocumentVersion","_sendBufferedOperationsDelayed","_setUpDataInit","createUserMarkerOperations","_hasSynchronizationProblem","409","realtimecollaborationclient","_baseBufferDelay","add","connect","realtimecollaborationclient-error","getOperationAuthor","editor","PENDING_ACTION_SENDING_DATA","realtimecollaborationclient-sendbufferedoperations","currentDocumentSession","_clearPendingAction","getDocumentDetails","CommentsOnly","decompress","_connectService","code","The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.","_initThrowingOnDataSet","filter","push","InsertOperation"];return(zc=function(){return e})()}class Yc{constructor(e){const t=Uc;this[t(274)]=e,this[t(333)]=new WeakMap}[Uc(369)](e){const t=Uc;let r=e[t(348)];for(;r--;){const s=e[r];if(!this[t(274)][t(442)](s)){if(!this[t(333)][t(442)](s)){const e=(0,n.uid)()[t(381)](1,18);this[t(333)][t(368)](s,e)}return this[t(333)][t(374)](s)}}}[Uc(193)](e,t){const n=Uc;if(!t)return;let r=e[n(348)];for(;r--;){const s=e[r];this[n(274)][n(442)](s)||this[n(333)][n(368)](s,t)}}}function Fc(){var e=["11HIwbZs","7twKCjb","27774wHShEt","requires","1081656FQxBMg","2175964Lnjgew","pluginName","3007180drFANL","isPremiumPlugin","2703480ctkWVK","isOfficialPlugin","1828005sRLMau","8624ZwvrJX","164ytRZAm","655FFxZvJ","RealTimeCollaborativeEditing"];return(Fc=function(){return e})()}var Kc=Wc;function Wc(e,t){var n=Fc();return(Wc=function(e,t){return n[e-=369]})(e,t)}!function(e){for(var t=Wc,n=e();;)try{if(534088===parseInt(t(379))/1*(-parseInt(t(380))/2)+parseInt(t(378))/3+parseInt(t(372))/4+parseInt(t(381))/5*(parseInt(t(369))/6)+parseInt(t(384))/7*(-parseInt(t(376))/8)+parseInt(t(371))/9+-parseInt(t(374))/10*(parseInt(t(383))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Fc);class Qc extends t.Plugin{static get[Kc(370)](){return[Gc]}static get[Kc(373)](){return Kc(382)}static get[Kc(377)](){return!0}static get[Kc(375)](){return!0}}function $c(e,t){const n=ed();return($c=function(e,t){return n[e-=382]})(e,t)}const Zc=$c;!function(e){const t=$c,n=e();for(;;)try{if(182619===parseInt(t(404))/1*(-parseInt(t(455))/2)+parseInt(t(423))/3+parseInt(t(479))/4*(-parseInt(t(470))/5)+-parseInt(t(430))/6+parseInt(t(449))/7*(parseInt(t(406))/8)+parseInt(t(395))/9+parseInt(t(403))/10*(parseInt(t(383))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(ed);class Xc extends t.ContextPlugin{static get[Zc(411)](){return[ls,Zc(435),ys,ps.Users]}static get[Zc(409)](){return Zc(384)}static get[Zc(467)](){return!0}static get[Zc(388)](){return!0}constructor(e){const t=Zc;super(e),this[t(444)]=new Map}async[Zc(392)](){const e=Zc,n=this[e(452)],r=n[e(407)][e(456)](e(435));if(n[e(407)][e(456)](ls)[e(464)](this),r[e(461)]={addCommentThread:async({channelId:t,threadId:n,comments:r,resolvedAt:s,resolvedBy:o,context:i,attributes:a})=>{const c=e,d=await this[c(468)](t)[c(478)]({commentThreadId:n,comments:r[c(462)]((e=>function(e,t,n){const r=c;return{commentThreadId:n,commentId:e[r(428)],userId:e[r(402)],content:e[r(482)],documentId:t,createdAt:e[r(447)],attributes:e[r(442)]||{}}}(e,t,n))),resolvedAt:s,resolvedBy:o,context:i,attributes:a})[c(386)](rd);return{threadId:d[c(433)],comments:d[c(414)]}},getCommentThread:async({channelId:t,threadId:n})=>{const r=e,s=await this[r(468)](t)[r(458)](n)[r(386)](rd);return s[r(474)]?null:(await this[r(465)]([s]),{threadId:s[r(433)],comments:s[r(414)][r(462)](sd),context:s[r(452)],resolvedAt:s[r(424)],resolvedBy:s[r(472)],attributes:s[r(442)]||{}})},updateCommentThread:async({channelId:t,threadId:n,context:r,unlinkedAt:s,attributes:o})=>this[e(468)](t)[e(399)]({commentThreadId:n,context:r,attributes:o,unlinkedAt:s})[e(386)](nd)[e(386)](rd),resolveCommentThread:async({channelId:t,threadId:n})=>{const r=e,s=await this[r(468)](t)[r(415)](n)[r(386)](nd)[r(386)](rd);return{threadId:s[r(433)],resolvedAt:s[r(424)],resolvedBy:s[r(472)]}},reopenCommentThread:async({channelId:t,threadId:n})=>this[e(468)](t)[e(460)](n)[e(386)](nd)[e(386)](rd),removeCommentThread:({channelId:t,threadId:n})=>this[e(468)](t)[e(473)](n)[e(386)](nd)[e(386)](rd),addComment:({channelId:t,threadId:n,commentId:r,content:s,attributes:o})=>this[e(468)](t)[e(390)](n,r,s,o)[e(386)](rd),updateComment:({channelId:t,threadId:n,commentId:r,content:s,attributes:o})=>this[e(468)](t)[e(477)](n,r,s,o)[e(386)](nd)[e(386)](rd),removeComment:({channelId:t,threadId:n,commentId:r})=>this[e(468)](t)[e(466)](n,r)[e(386)](nd)[e(386)](rd)},n instanceof t.Context){const t=n[e(434)][e(456)](e(400)),r=n[e(407)][e(456)](ys);await this[e(408)](t);const s=await this[e(444)][e(456)](t)[e(453)]();this[e(421)](r,e(396)+t,((n,{session:s})=>{const o=e;s.id===r[o(398)]&&(n[o(432)](),this[o(452)][o(407)][o(456)](o(438))[o(385)](s[o(483)],t))})),r[e(446)](t,s)}}async[Zc(408)](e){const t=Zc;if(this[t(444)][t(471)](e))throw new n.CKEditorError(t(431),null,{channelId:e});const r=this[t(452)][t(407)][t(456)](t(435)),s=new(Xc[t(475)])(e);this[t(444)][t(393)](e,s),this[t(421)](s,t(391),((e,n)=>{const s=t,{commentThreadId:o,documentId:i,context:a,attributes:c,resolvedAt:d,resolvedBy:u,comments:l}=n;r[s(458)](o)||r[s(478)]({threadId:o,channelId:i,comments:l?l[s(462)](sd):[],context:a,attributes:c,resolvedAt:d,resolvedBy:u,isFromAdapter:!0})})),this[t(421)](s,t(422),((e,{commentThreadId:n,documentId:s,context:o,unlinkedAt:i,attributes:a})=>{const c=t;r[c(458)](n)&&r[c(399)]({threadId:n,channelId:s,context:o,unlinkedAt:i,attributes:a,isFromAdapter:!0})})),this[t(421)](s,t(419),((e,{commentThreadId:n,resolvedBy:s,resolvedAt:o})=>{const i=t,a=r[i(458)](n);a&&a[i(445)]({resolvedBy:s,resolvedAt:o,isFromAdapter:!0})})),this[t(421)](s,t(394),((e,{commentThreadId:n})=>{const s=t,o=r[s(458)](n);o&&o[s(426)]({isFromAdapter:!0})})),this[t(421)](s,t(436),((e,{commentThreadId:n})=>{const s=t,o=r[s(458)](n);o&&o[s(413)]({isFromAdapter:!0})})),this[t(421)](s,t(440),((e,n)=>{const s=t,o=n[s(433)],i=r[s(458)](o);i&&i[s(390)]({...sd(n),isFromAdapter:!0})})),this[t(421)](s,t(459),((e,{commentThreadId:n,commentId:s,content:o,attributes:i})=>{const a=t,c=r[a(458)](n);if(c){const e=c[a(439)](s);e&&e[a(481)]({content:o,attributes:i,isFromAdapter:!0})}})),this[t(421)](s,t(425),((e,{commentThreadId:n,commentId:s})=>{const o=t,i=r[o(458)](n);if(i){const e=i[o(439)](s);e&&e[o(413)]({isFromAdapter:!0})}})),await this[t(469)](e)}[Zc(420)](){const e=Zc;if(this[e(452)]instanceof t.Context){const t=this[e(452)][e(434)][e(456)](e(400));this[e(382)](t)}}[Zc(382)](e){const t=Zc;if(!this[t(444)][t(471)](e))throw new n.CKEditorError(t(429),null,{channelId:e});this[t(468)](e)[t(448)](),this[t(444)][t(401)](e)}async[Zc(389)](){const e=Zc;for(const t of this[e(444)][e(480)]())await this[e(469)](t);if(this[e(452)]instanceof t.Context){const t=this[e(452)][e(434)][e(456)](e(400)),n=this[e(452)][e(407)][e(456)](ys);n[e(397)](t);const r=await this[e(444)][e(456)](t)[e(453)]();n[e(446)](t,r)}}async[Zc(469)](e){const t=Zc,{connection:n}=this[t(452)][t(407)][t(456)](ls),r=this[t(452)][t(407)][t(456)](t(435)),s=this[t(444)][t(456)](e),o=await s[t(476)](n);await this[t(465)](o);const i=new Set(Array[t(416)](r[t(463)]({channelId:e}),(e=>e.id)));for(const e of o)e[t(474)]||i[t(401)](e[t(433)]);for(const e of i)r[t(458)](e)[t(413)]({isFromAdapter:!0});for(const n of o){let s=r[t(458)](n[t(433)]);const{commentThreadId:o,context:i,attributes:a,resolvedBy:c,resolvedAt:d,unlinkedAt:u,deletedAt:l}=n;if(l)continue;s||(s=r[t(478)]({channelId:e,threadId:o,context:i,attributes:a||{},resolvedBy:c,resolvedAt:d,unlinkedAt:u,isFromAdapter:!0}));const p=new Set(Array[t(416)](s[t(414)],(e=>e.id)));for(const e of n[t(414)])p[t(401)](e[t(428)]);for(const e of p)s[t(439)](e)[t(413)]({isFromAdapter:!0});for(const e of n[t(414)]){const n=s[t(439)](e[t(428)]);n?n[t(482)]!==e[t(482)]&&n[t(481)]({content:e[t(482)],isFromAdapter:!0}):s[t(390)](Object[t(387)](sd(e),{isFromAdapter:!0}))}}}[Zc(468)](e){const t=Zc;if(!this[t(444)][t(471)](e))throw new n.CKEditorError(t(441),null,{channelId:e});return this[t(444)][t(456)](e)}async[Zc(465)](e){const t=Zc,n=this[t(452)][t(407)][t(456)](ps.Users),{connection:r}=this[t(452)][t(407)][t(456)](ls),s=new Set;for(const{resolvedBy:r,comments:o}of e){r&&!n[t(437)](r)&&s[t(418)](r);for(const{userId:e}of o)n[t(437)](e)||s[t(418)](e)}if(0===s[t(457)])return;const o=await S[t(410)](r,Array[t(416)](s));for(const e of o)n[t(437)](e.id)||n[t(484)](e)}}function ed(){const e=["userId","commentId","cloudservicescommentsadapter-disconnect-not-exist","874902isNrWn","cloudservicescommentsadapter-connect-already-connected","off","commentThreadId","config","CommentsRepository","commentThreadRemoved","getUser","Permissions","getComment","commentAdded","cloudservicescommentsadapter-service-not-exist","attributes","404","_services","resolve","register","createdAt","disconnect","7xgSfTv","cloud-services-internal-error: Request timeout.","cloud-services-internal-error: Comments Service is not connected.","context","getConnectedSessions","code","4wAzLWb","get","size","getCommentThread","commentUpdated","reopenCommentThread","adapter","map","getCommentThreads","addToReconnectionStack","_fetchMissingUsersForThreads","removeComment","isOfficialPlugin","_getService","_connectService","207885gUjTID","has","resolvedBy","removeCommentThread","deletedAt","CommentsService","connect","updateComment","addCommentThread","12nELrNe","keys","update","content","permissions","addUser","_terminateService","693WhbHgc","CloudServicesCommentsAdapter","setPermissions","catch","assign","isPremiumPlugin","reconnect","addComment","commentThreadAdded","init","set","commentThreadReopened","809865bMlmyR","sessionAdd:","unregister","mySessionId","updateCommentThread","collaboration.channelId","delete","authorId","36070TUCmFb","51704hCfOJr","startsWith","260872rhOywQ","plugins","_setUpService","pluginName","getMany","requires","message","remove","comments","resolveCommentThread","from","cloud-services-internal-error: Not connected.","add","commentThreadResolved","destroy","listenTo","commentThreadUpdated","620220BlcHwD","resolvedAt","commentRemoved","reopen"];return(ed=function(){return e})()}Xc[Zc(475)]=is;const td=Xc;async function nd(e){const t=Zc;if(t(443)!==e[t(454)])throw e}function rd(e){const t=Zc;if((n=e)[t(412)][t(405)](t(451))||n[t(412)][t(405)](t(417))||n[t(412)][t(405)](t(450)))return new Promise((()=>{}));var n;throw e}function sd(e){const t=Zc;return{threadId:e[t(433)],commentId:e[t(428)],content:e[t(482)],createdAt:e[t(447)],authorId:e[t(427)],attributes:e[t(442)]||{}}}const od=id;function id(e,t){const n=cd();return(id=function(e,t){return n[e-=119]})(e,t)}!function(e){const t=id,n=e();for(;;)try{if(429739===-parseInt(t(127))/1*(parseInt(t(176))/2)+parseInt(t(134))/3*(parseInt(t(131))/4)+-parseInt(t(180))/5+-parseInt(t(119))/6*(-parseInt(t(171))/7)+parseInt(t(182))/8*(parseInt(t(146))/9)+parseInt(t(153))/10*(-parseInt(t(151))/11)+-parseInt(t(154))/12*(-parseInt(t(168))/13))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(cd);class ad extends t.Plugin{static get[od(138)](){return[td,od(120),ls]}static get[od(140)](){return od(139)}static get[od(130)](){return!0}static get[od(156)](){return!0}constructor(e){const t=od;super(e);const n=this[t(145)][t(128)][t(167)](t(177));this[t(150)]=new Map,this[t(165)]=new(ad[t(160)])(n)}[od(159)](){const e=od,t=this[e(145)][e(125)][e(167)](ls),n=this[e(145)][e(125)][e(167)](e(120));return n[e(174)]={getSuggestion:async t=>{const n=e;await this[n(137)]();const r=await this[n(165)][n(167)](t)[n(185)](ud);return await this[n(126)]([r]),r},addSuggestion:async({id:t,type:n,data:r,originalSuggestionId:s,attributes:o})=>{const i=e;await this[i(137)]();const a={id:t,type:n,data:r,originalSuggestionId:s,attributes:o},c=await this[i(165)][i(135)](t,n,r,s,o)[i(185)]((e=>{if(ld(e))return new Promise((e=>{const n=id;this[n(150)][n(173)](t,{resolve:e,suggestionData:a})}));throw e}));return this[i(150)][i(144)](t),c},updateSuggestion:async(t,n)=>{const r=e;if(await this[r(137)](),r(164)!==n[r(178)])return this[r(165)][r(157)](t,n)[r(185)](ud)}},this[e(158)](this[e(165)],e(136),((t,r)=>{const s=e;n[s(183)](r.id)&&(n[s(123)](r.id)[s(169)]=r[s(169)])})),this[e(165)][e(152)](t[e(161)])[e(175)]((r=>(t[e(133)](this),this[e(126)](r)[e(175)]((()=>{const t=e;for(const e of r)n[t(155)](e)[t(141)]=!0})))))}async[od(122)](){const e=od,t=this[e(145)][e(125)][e(167)](e(120)),{connection:n}=this[e(145)][e(125)][e(167)](ls),r=await this[e(165)][e(152)](n);await this[e(126)](r);for(const{suggestionData:t,resolve:n}of this[e(150)][e(148)]()){let s=r[e(124)]((e=>e.id===t.id));s||(s=await this[e(165)][e(135)](t.id,t[e(142)],t[e(179)],t[e(162)])),n(s)}for(const n of r)t[e(183)](n.id)||t[e(155)](n)}async[od(137)](){const e=od;this[e(165)][e(166)]||await new Promise((t=>{const n=e;this[n(158)](this[n(165)],n(163),(e=>{e[n(129)](),t()}))}))}async[od(126)](e){const t=od,n=this[t(145)][t(125)][t(167)](ps.Users),{connection:r}=this[t(145)][t(125)][t(167)](ls),s=new Set;for(const{authorId:r}of e)n[t(121)](r)||s[t(135)](r);if(0===s[t(132)])return;const o=await S[t(170)](r,Array[t(147)](s));for(const e of o)n[t(121)](e.id)||n[t(143)](e)}}function cd(){const e=["addUser","delete","editor","9YgQuJq","from","values","message","_bufferedRequests","121uDLWSA","connect","303460DhcxmC","1567284EmorsL","addSuggestionData","isPremiumPlugin","update","listenTo","init","TrackChangesService","connection","originalSuggestionId","connected","open","_trackChangesService","isConnected","get","26eBXozZ","attributes","getMany","981232WNGyqu","startsWith","set","adapter","then","24dvrvJu","collaboration.channelId","state","data","978350LEoGOP","cloud-services-internal-error: Request timeout.","2872440hQaDgV","hasSuggestion","cloud-services-internal-error: Not connected.","catch","24rRmdQT","TrackChangesEditing","getUser","reconnect","getSuggestion","find","plugins","_fetchMissingUsersForThreads","63158ZfxTGx","config","off","isOfficialPlugin","2144552wfFmCy","size","addToReconnectionStack","3fRtrJA","add","suggestionUpdated","_waitForServiceReady","requires","CloudServicesTrackChangesAdapter","pluginName","_saved","type"];return(cd=function(){return e})()}ad[od(160)]=Vn;const dd=ad;function ud(e){if(ld(e))return new Promise((()=>{}));throw e}function ld(e){const t=od;return e[t(149)][t(172)](t(184))||e[t(149)][t(172)](t(181))}const pd=hd;function hd(e,t){const n=fd();return(hd=function(e,t){return n[e-=297]})(e,t)}function fd(){const e=["plugins","isOfficialPlugin","ready","_setUpService","data","2105816XlBHkI","config","isPremiumPlugin","collaboration.channelId","once","pluginName","CommentsEditing","connected","init","change:state","editor","isThreadsLoadingPaused","RealTimeCollaborativeComments","1918OKtwzx","1qcbGmO","switchReadOnly","4623340oORoDr","CommentsRepository","1235462cdVQNx","2068385MTXblE","get","4icDBVm","Comments","11955240NdCBIm","_terminateService","2267424ZMclOp","listenTo","10938obCkSA","requires","destroy"];return(fd=function(){return e})()}!function(e){const t=hd,n=e();for(;;)try{if(752365===-parseInt(t(321))/1*(parseInt(t(325))/2)+parseInt(t(297))/3+-parseInt(t(328))/4*(parseInt(t(326))/5)+-parseInt(t(299))/6*(parseInt(t(320))/7)+-parseInt(t(307))/8+parseInt(t(330))/9+parseInt(t(323))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(fd);class md extends t.Plugin{static get[pd(300)](){return[pd(329),td,Qc,ls]}static get[pd(312)](){return pd(319)}static get[pd(303)](){return!0}static get[pd(309)](){return!0}[pd(315)](){const e=pd,t=this[e(317)][e(302)][e(327)](ls),n=this[e(317)][e(302)][e(327)](e(313)),r=this[e(317)][e(302)][e(327)](td);return this[e(317)][e(306)][e(311)](e(304),(()=>{const r=e;this[r(298)](t,r(316),((e,t,s)=>{const o=r;n[o(318)]=o(314)!==s}))})),this[e(298)](t,e(316),((t,n,r)=>{const s=e;this[s(317)][s(302)][s(327)](s(324))[s(322)](s(314)!==r)})),r[e(305)](this[e(317)][e(308)][e(327)](e(310)))}[pd(301)](){const e=pd;this[e(317)][e(302)][e(327)](td)[e(331)](this[e(317)][e(308)][e(327)](e(310))),super[e(301)]()}}var yd=bd;function gd(){var e=["isPremiumPlugin","7695544lPOXFp","3789PdcUVm","10620036ioCiiG","1305531hfCMAU","347156GjAJYO","8xwemrX","pluginName","142330eRIXea","TrackChanges","RealTimeCollaborativeTrackChanges","isOfficialPlugin","310190XlPOaG","requires","90OesGdS","12551945mgXsEZ"];return(gd=function(){return e})()}function bd(e,t){var n=gd();return(bd=function(e,t){return n[e-=339]})(e,t)}!function(e){for(var t=bd,n=e();;)try{if(900776===parseInt(t(341))/1*(parseInt(t(351))/2)+-parseInt(t(349))/3+-parseInt(t(350))/4*(-parseInt(t(343))/5)+parseInt(t(348))/6+parseInt(t(344))/7+parseInt(t(346))/8+parseInt(t(347))/9*(-parseInt(t(353))/10))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(gd);class Od extends t.Plugin{static get[yd(342)](){return[md,dd,yd(354)]}static get[yd(352)](){return yd(339)}static get[yd(340)](){return!0}static get[yd(345)](){return!0}}const wd=vd;function vd(e,t){const n=Pd();return(vd=function(e,t){return n[e-=182]})(e,t)}!function(e){const t=vd,n=e();for(;;)try{if(864328===-parseInt(t(281))/1*(-parseInt(t(208))/2)+-parseInt(t(195))/3+-parseInt(t(194))/4+parseInt(t(290))/5*(-parseInt(t(251))/6)+-parseInt(t(213))/7+-parseInt(t(215))/8*(-parseInt(t(224))/9)+parseInt(t(246))/10*(parseInt(t(214))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Pd);class Id extends t.Plugin{static get[wd(279)](){return[ls,Gc,wd(276),ys,ps.Users]}static get[wd(275)](){return wd(218)}static get[wd(220)](){return!0}static get[wd(239)](){return!0}constructor(e){const t=wd;super(e);const n=this[t(206)][t(263)][t(189)](t(253));this[t(242)]=null,this[t(193)]=this[t(206)][t(285)][t(189)](t(276)),this[t(223)]=new(Id[t(258)])(n)}async[wd(293)](){const e=wd,t=this[e(206)][e(285)][e(189)](Gc),r=t[e(197)],s=this[e(206)][e(285)][e(189)](ls);this[e(193)][e(266)]({history:r,getLatestVersion:()=>this[e(186)](),getCurrentRevisionId:()=>t[e(277)]});const o=this[e(206)][e(263)][e(189)](e(297))||n.version,i=await zt[e(230)](s[e(247)],o);this[e(193)][e(212)]={getRevision:async({revisionId:t})=>(await this[e(216)](),await this[e(223)][e(268)](t)),updateRevisions:async t=>{const n=e;await this[n(216)]();const r=this[n(193)][n(273)];if(i&&1===t[n(210)]&&t[0].id===r.id)return t;for(const e of t)e.id===r.id&&(e[n(185)]=e[n(201)]===e[n(198)]);return this[n(223)][n(271)](t,this[n(242)])[n(205)]((e=>(this[n(242)]=e,t)))[n(202)]((e=>{const r=n;if(kd(e)||r(265)===e[r(200)]&&void 0!==e[r(249)][r(232)]){for(const e of t)!this[r(193)][r(283)][r(268)](e.id)||this[r(193)][r(244)](e.id,e,!1);if(kd(e))throw e;return t}throw e}))}},this[e(209)](this[e(223)],e(259),((t,{revisionsData:n,requestId:r})=>{const s=e;Math[s(269)](...n[s(286)]((e=>e[s(198)])))>this[s(282)]()-1?this[s(186)]()[s(205)]((()=>{this[s(250)](n,r)})):this[s(250)](n,r)}));const{revisions:a,requestId:c}=await this[e(223)][e(289)](s[e(247)]);s[e(199)](this),this[e(242)]=c,await this[e(274)](a);for(const t of a)this[e(193)][e(228)](t);this[e(209)](t,e(237),((n,r,s)=>{const o=e;s&&(this[o(211)]=t[o(267)],n[o(182)]())})),this[e(193)][e(256)](e(294)).to(s,e(227),(t=>t===Mt[e(252)]))}async[wd(278)](){const e=wd,t=this[e(206)][e(285)][e(189)](ls),n=this[e(206)][e(285)][e(189)](Gc),r=async()=>{const r=e,s=this[r(193)][r(273)],o=s.id,i=o!==n[r(277)];if(i){const e=n[r(267)]-this[r(211)],t=this[r(282)]();if(this[r(193)][r(225)][r(196)](),s[r(198)]+e!==t){const n=s[r(201)]+e,o=this[r(206)][r(285)][r(189)](ps.Users),i=this[r(193)][r(192)]({revision:s,from:n,to:t});i.id=s.id;const a=i[r(295)][r(286)]((e=>o[r(217)](e)));s[r(287)]({...i,authors:a},!0),this[r(193)][r(244)](s.id,i,!0)}this[r(193)][r(204)]=t,s[r(198)]===s[r(201)]&&!this[r(193)][r(222)][r(257)](o)&&this[r(193)][r(283)][r(255)][r(288)](o),this[r(193)][r(240)](t)}const{revisions:a,requestId:c}=await this[r(223)][r(278)](t[r(247)],this[r(242)]);i&&a[r(210)]>0?n[r(190)]():(await this[r(274)](a),this[r(250)](a,c),this[r(193)][r(188)]())};return n[e(245)]?r():new Promise(((t,s)=>{const o=e;n[o(183)](o(237),(()=>{const e=o;r()[e(205)](t)[e(202)](s)}))}))}[wd(233)](){super[wd(233)]()}async[wd(216)](){const e=wd;this[e(223)][e(280)]||await new Promise((t=>{const n=e;this[n(209)](this[n(223)],n(229),(e=>{e[n(182)](),t()}))}))}[wd(282)](){const e=wd,t=this[e(206)][e(285)][e(189)](Gc)[e(197)][e(296)]()[e(241)]();for(const n of t)if(e(284)!==n[e(203)]||n[e(238)])return n[e(207)]+1}[wd(186)](){const e=wd,t=this[e(206)][e(285)][e(189)](Gc);return new Promise((n=>{const r=e;t[r(226)]?t[r(183)](r(221),(()=>{n(this[r(282)]())})):n(this[r(282)]())}))}[wd(250)](e,t){const n=wd,r=this[n(193)][n(283)];this[n(242)]=t;for(const t of e){const e=r[n(268)](t.id);if(e){if((t[n(201)]||t[n(198)])&&(t[n(243)]=null),e===this[n(193)][n(273)]){const r=Math[n(269)](e[n(198)],t[n(198)]),s=Math[n(269)](e[n(201)],t[n(201)]);let o;e[n(198)]===t[n(198)]&&e[n(201)]===t[n(201)]?(o=!0,this[n(235)](t)):t[n(198)]===r&&t[n(201)]===s?o=!1:(e[n(198)]===r&&e[n(201)]===s||this[n(236)]({revision:e,from:s,to:r}),o=!0),o&&(delete t[n(201)],delete t[n(198)],delete t[n(243)],delete t[n(292)],delete t[n(295)])}this[n(193)][n(184)](t),this[n(235)](t)}else this[n(193)][n(228)](t)}const s=r[n(248)]();s[n(241)]();for(let e=0;e<s[n(210)]-1;e++){const t=s[e],r=s[e+1];if(t[n(201)]<r[n(198)]){const e=r[n(198)],s=Math[n(269)](e,t[n(198)]);this[n(236)]({revision:t,from:e,to:s})}}}[wd(236)]({revision:e,from:t,to:n}={}){const r=wd,s=this[r(206)][r(285)][r(189)](ps.Users),o=this[r(193)][r(192)]({revision:e,from:t,to:n});o[r(291)]=o[r(295)][r(286)]((e=>s[r(217)](e))),e[r(287)](o)}[wd(235)](e){const t=wd,n={};n.id=e.id;for(const r of Object[t(231)](e))"id"!==r&&(n[r]=void 0);this[t(193)][t(244)](n.id,n,!0)}async[wd(274)](e){const t=wd,n=this[t(206)][t(285)][t(189)](ps.Users),{connection:r}=this[t(206)][t(285)][t(189)](ls),s=new Set;for(const n of e){for(const e of n[t(295)])i(e);n[t(261)]&&i(n[t(261)])}if(0===s[t(264)])return;const o=await S[t(191)](r,Array[t(270)](s));for(const e of o)n[t(217)](e.id)||n[t(260)](e);function i(e){const r=t;n[r(217)](e)||s[r(262)](e)}}}Id[wd(258)]=ln;const Sd=Id;function Pd(){const e=["add","config","size","400","setSource","_offset","getRevision","max","from","updateRevisions","cloud-services-internal-error: Revision History Service is not connected.","currentRevision","_fetchMissingUsers","pluginName","RevisionTracker","sessionId","reconnect","requires","isConnected","7ORzHle","_getLatestVersionFromServerOperations","repository","marker","plugins","map","_update","remove","connect","10cdbOcU","authors","createdAt","init","isEnabled","authorsIds","getOperations","cloudServices.bundleVersion","off","once","setRevisionData","isEmptyCurrent","_getLatestVersion","cloud-services-internal-error: Request timeout.","sendBufferedUpdates","get","_handleReconnectionError","getMany","buildRevisionData","_revisionTracker","6159388MkiGxV","4655652SDmAoz","reInit","serverHistory","toVersion","addToReconnectionStack","code","fromVersion","catch","type","_startingVersion","then","editor","baseVersion","153278lrmskH","listenTo","length","_oldOffset","adapter","11244513tLqFer","11XCWIRB","464VtfedH","_waitForServiceReady","getUser","CloudServicesRevisionHistoryAdapter","startsWith","isOfficialPlugin","change:_isPendingUpdate","_bufferedUpdates","_revisionHistoryService","142353bkjJHK","_revisionDataBuilder","_isPendingUpdate","state","addRevisionData","connected","isBundleUploaded","keys","wrongRequestId","destroy","message","_preventResendingRevisionData","_fixRevision","change:_isConnected","affectsData","isPremiumPlugin","_createCurrentRevision","reverse","_lastRequestId","diffData","_bufferUpdate","_isConnected","48540850WzdQXw","connection","getRevisions","data","_handleRevisionsUpdate","2236578klvfNy","CONNECTED","collaboration.channelId","cloud-services-internal-error: Not connected.","_revisions","bind","has","RevisionHistoryService","revisionsUpdated","addUser","creatorId"];return(Pd=function(){return e})()}function kd(e){const t=wd;return e[t(234)][t(219)](t(272))||e[t(234)][t(219)](t(254))||e[t(234)][t(219)](t(187))}var Ad=_d;function _d(e,t){var n=Td();return(_d=function(e,t){return n[e-=100]})(e,t)}function Td(){var e=["1638721cYeIUH","pluginName","7214032GQztfP","RevisionHistory","602444jbQgeV","isOfficialPlugin","1865YgjHlN","10657422mLkGWW","78cHMHxD","RealTimeCollaborativeRevisionHistory","1447734sxIDSG","requires","18099NBJBHi","9774CRhbkl","isPremiumPlugin"];return(Td=function(){return e})()}!function(e){for(var t=_d,n=e();;)try{if(465004===-parseInt(t(109))/1*(-parseInt(t(105))/2)+-parseInt(t(107))/3+parseInt(t(101))/4+-parseInt(t(103))/5*(-parseInt(t(110))/6)+-parseInt(t(112))/7+parseInt(t(114))/8+-parseInt(t(104))/9)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Td);class Cd extends t.Plugin{static get[Ad(108)](){return[Ad(100),Sd,Qc]}static get[Ad(113)](){return Ad(106)}static get[Ad(102)](){return!0}static get[Ad(111)](){return!0}}var jd=Function.prototype,Ed=Object.prototype,Dd=jd.toString,xd=Ed.hasOwnProperty,Rd=Dd.call(Object);const Nd=function(e){if(!oi(e)||"[object Object]"!=lo(e))return!1;var t=oa(e);if(null===t)return!0;var n=xd.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Dd.call(n)==Rd};const Vd=function(e){return oi(e)&&1===e.nodeType&&!Nd(e)};function Md(){const e=["9hyWRnd","525004FpUIxp","1819308qGbtzr","bindTemplate","92858ZGQikv","116360SmyTPs","26qtKfvO","2331aVlGyX","ck-presence-list__counter","CONNECTED_USERS","isHidden","60290JUdtEp","div","6cIsOWA","282JIumHd","11ivDPJh","usersCount","setTemplate","ck-presence-list__counter--hidden","set","5lhjqDp","1006956nCsOht"];return(Md=function(){return e})()}function Ud(e,t){const n=Md();return(Ud=function(e,t){return n[e-=448]})(e,t)}!function(e){const t=Ud,n=e();for(;;)try{if(224122===-parseInt(t(463))/1*(parseInt(t(450))/2)+parseInt(t(458))/3+parseInt(t(460))/4*(-parseInt(t(457))/5)+-parseInt(t(451))/6*(-parseInt(t(466))/7)+-parseInt(t(464))/8*(parseInt(t(459))/9)+parseInt(t(448))/10*(-parseInt(t(452))/11)+-parseInt(t(461))/12*(-parseInt(t(465))/13))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Md);class Bd extends r.View{constructor(e){const t=Ud;super(e);const n=this[t(462)];this[t(456)](t(453),0),this[t(456)](t(469),!0),this[t(454)]({tag:t(449),attributes:{class:["ck",t(467),n.if(t(469),t(455))]},children:[{text:n.to(t(453),(n=>Rs(e,t(468),n)))}]})}}function Jd(){const e=["644520kHkYAI","set","7faQuKP","3udqcJS","keystrokes","fire","removeAttribute","ck-presence-list__list","2hwdbkg","46195QQVJqs","bindTemplate","isExpanded","aria-expanded","items","render","Connected users list","change:hasPopup","710955kvGkMq","Collapsed connected users list (press ENTER to open it)","createCollection","1412775FVseok","element","listenTo","div","list","2142008DDiRZP","696088IJhWik","setAttribute","103230VZRAAA","execute","focus","setTemplate","hasPopup"];return(Jd=function(){return e})()}const qd=Gd;function Gd(e,t){const n=Jd();return(Gd=function(e,t){return n[e-=318]})(e,t)}!function(e){const t=Gd,n=e();for(;;)try{if(143659===parseInt(t(345))/1*(-parseInt(t(344))/2)+parseInt(t(339))/3*(parseInt(t(329))/4)+-parseInt(t(320))/5+-parseInt(t(331))/6+-parseInt(t(338))/7*(-parseInt(t(328))/8)+-parseInt(t(323))/9+parseInt(t(336))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Jd);class Ld extends r.View{constructor(e){const t=Gd;super(e);const r=this[t(346)];this[t(349)]=this[t(322)](),this[t(340)]=new n.KeystrokeHandler,this[t(337)]({hasPopup:!1,isExpanded:!1}),this[t(334)]({tag:t(326),attributes:{"aria-haspopup":r.if(t(335)),"aria-expanded":r.to(t(347),(e=>this[t(335)]&&String(e))),"aria-label":r.to(t(335),(n=>Rs(e,t(n?321:318)))),role:t(327),tabindex:r.to(t(335),(e=>!!e&&0)),class:["ck",t(343)]},children:this[t(349)],on:{click:r.to((()=>this[t(341)](t(332))))}}),this.on(t(319),((e,n,r)=>{const s=t;this[s(324)]&&(r?this[s(324)][s(330)](s(348),String(this[s(347)])):this[s(324)][s(342)](s(348)))}))}[qd(333)](){const e=qd;this[e(324)][e(333)]()}[qd(350)](){const e=qd;super[e(350)](),this[e(340)][e(325)](this[e(324)])}}var Hd=__webpack_require__(106),zd={attributes:{"data-cke":!0}};zd.setAttributes=Ps(),zd.insert=Is().bind(null,"head"),zd.domAPI=ws(),zd.insertStyleElement=As();bs()(Hd.A,zd);Hd.A&&Hd.A.locals&&Hd.A.locals;function Yd(e,t){const n=Fd();return(Yd=function(e,t){return n[e-=112]})(e,t)}function Fd(){const e=["listenTo","378801VXbRdI","div","105gwfRlL","change","locale","isCollapsed","1627720JHTjeK","counterView","inlineListView","1910Jhiggj","bindTemplate","first","set","tooltipPosition","hasPopup","ck-presence-list","32824uSfpyB","220qLjXVK","ck-rounded-corners","1003206qdHsSk","ck-presence-list--collapsed","setTemplate","items","1NBhOEE","bind","2195109wesIEt","ck-reset","252189ZAddsv"];return(Fd=function(){return e})()}!function(e){const t=Yd,n=e();for(;;)try{if(367339===parseInt(t(137))/1*(parseInt(t(123))/2)+parseInt(t(114))/3+-parseInt(t(130))/4*(-parseInt(t(116))/5)+parseInt(t(133))/6+parseInt(t(139))/7+parseInt(t(120))/8+-parseInt(t(112))/9*(parseInt(t(131))/10))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Fd);class Kd extends r.View{constructor(e){const t=Yd;super(e);const n=this[t(124)];this[t(126)](t(119),!0),this[t(121)]=new Bd(this[t(118)]),this[t(122)]=new Ld(e),this[t(122)][t(138)](t(128)).to(this,t(119)),this[t(113)](this[t(122)][t(136)],t(117),(()=>{const e=t;for(const t of this[e(122)][e(136)])t[e(127)]="s";this[e(122)][e(136)][e(125)]&&(this[e(122)][e(136)][e(125)][e(127)]="se")})),this[t(135)]({tag:t(115),attributes:{class:["ck",t(129),t(140),t(132),n.if(t(119),t(134))]},children:[this[t(121)],this[t(122)]]})}}const Wd=Zd;!function(e){const t=Zd,n=e();for(;;)try{if(947342===parseInt(t(255))/1+-parseInt(t(263))/2*(-parseInt(t(260))/3)+-parseInt(t(269))/4*(parseInt(t(248))/5)+parseInt(t(234))/6*(parseInt(t(261))/7)+parseInt(t(238))/8+parseInt(t(267))/9+-parseInt(t(251))/10*(parseInt(t(258))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}($d);class Qd extends r.View{constructor(e,t){const n=Zd;super(e),this[n(256)]=new Xd(e,t),this[n(241)]({tag:n(265),attributes:{tabindex:-1,role:n(247),class:["ck",n(259)],"aria-label":Rs(e,n(257))},children:[this[n(256)]]})}}function $d(){const e=["11319372zFaDzB","render","775364qPdEOr","set","max","listenTo","26586JpixjE","checkIfScrollable","clientHeight","ariaLabelledBy","4486704fFhsPn","window","ck-list","setTemplate","scrollHeight","role","bindTemplate","ck-presence-list__dropdown-list-wrapper","ck-presence-list__dropdown-list-wrapper_scrollable","application","40qJfwvl","items","resize","24250730oxJxaX","ck-reset","element","innerHeight","475059ZvDvqM","listWrapperView","Connected users list dropdown menu","11VgSRDb","ck-presence-list__dropdown-list","141kHtXiM","1939VgjHcZ","ariaLabel","59666qWFmos","change","div","_isScrollable"];return($d=function(){return e})()}function Zd(e,t){const n=$d();return(Zd=function(e,t){return n[e-=234]})(e,t)}class Xd extends r.ListView{constructor(e,t){const r=Zd;super(e);const s=this[r(244)];this[r(270)](r(266),!1),this[r(241)]({tag:t?r(265):"ul",attributes:{class:["ck",r(252),r(240),r(245),s.if(r(266),r(246))],role:s.to(r(243)),"aria-label":s.to(r(262)),"aria-labelledby":s.to(r(237))},children:this[r(249)]}),this[r(272)](n.global[r(239)],r(250),(()=>this[r(235)]())),this[r(249)].on(r(264),(()=>this[r(235)]()))}[Wd(268)](){const e=Wd;super[e(268)](),this[e(235)]()}[Wd(235)](){const e=Wd,t=this[e(253)];t&&(this[e(266)]=Math[e(271)](t[e(242)],t[e(236)])>.8*window[e(254)])}}const eu=tu;function tu(e,t){const n=nu();return(tu=function(e,t){return n[e-=234]})(e,t)}function nu(){const e=["focus","947156bnIfnu","227869JZrqyI","name","18gZLWIV","execute","140xaffFy","388952GtsOUb","fire","setTemplate","button","color","367743himmEf","presentation","true","ck-presence-list__dropdown-list-item","bindTemplate","1698486bezStq","userView","getBackgroundColorClass","ck-presence-list__marker","1023044XnMDxn","element","tag","5xZcoqv","2372174ZphlSE","4AiNMQU","ck-user__full-name","span"];return(nu=function(){return e})()}!function(e){const t=tu,n=e();for(;;)try{if(232253===parseInt(t(235))/1*(parseInt(t(259))/2)+parseInt(t(245))/3+-parseInt(t(234))/4*(-parseInt(t(257))/5)+parseInt(t(250))/6+parseInt(t(258))/7+parseInt(t(240))/8*(parseInt(t(237))/9)+-parseInt(t(239))/10*(parseInt(t(254))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(nu);class ru extends r.ListItemView{constructor(e,t,n){const r=tu;super(e);const s=this[r(249)];this[r(251)]=new ps.UserView(e,t);const o={tag:"li",attributes:{class:["ck",r(248)],tabindex:-1,role:r(246),"aria-label":t[r(236)]},children:[this[r(251)],{tag:r(261),attributes:{class:["ck",r(260)]},children:[{text:t[r(236)]}]},{tag:r(261),attributes:{class:["ck",r(253),t[r(244)][r(252)]()],"aria-hidden":r(247)}}]};n&&(o[r(256)]=r(243),o.on={click:s.to((()=>this[r(241)](r(238))))}),this[r(242)](o)}[eu(262)](){const e=eu;this[e(255)][e(262)]()}}function su(){const e=["span","hasTooltip","102558ZoKYYB","12xDXRPx","8991037SxfnmH","markerView","tag","tooltipPosition","true","1284314ycPovR","fire","set","ck-presence-list__list-item__tooltip","button","color","listitem","template","text","949288mUewQw","230VcGDjY","div","3919832OAQRXL","getBackgroundColorClass","ck-presence-list__list-item","2825310IrRQRh","name","isFocusable","bindTemplate","execute","setTemplate","27SGYpiE","userView","2azziKB","ck-presence-list__marker","116517RSNEnn"];return(su=function(){return e})()}!function(e){const t=iu,n=e();for(;;)try{if(922372===parseInt(t(313))/1*(-parseInt(t(325))/2)+-parseInt(t(315))/3*(-parseInt(t(319))/4)+parseInt(t(300))/5*(parseInt(t(318))/6)+parseInt(t(302))/7+-parseInt(t(299))/8*(parseInt(t(311))/9)+parseInt(t(305))/10+parseInt(t(320))/11)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(su);class ou extends r.View{constructor(e,t,n){const s=iu;super(e);const o=this[s(308)];this[s(327)](s(307),!1),this[s(327)](s(317),!0),this[s(327)](s(323),""),this[s(312)]=new ps.UserView(e,t),this[s(321)]=new au(e,t);const i=new r.LabelView(e);i[s(297)][s(322)]=s(316),i[s(298)]=t[s(306)];const a={tag:s(301),attributes:{class:["ck",s(304)],role:s(296),tabindex:o.to(s(307),(e=>!!e&&0)),"aria-labelledby":i.id,"data-cke-tooltip-text":this[s(312)][s(306)],"data-cke-tooltip-position":o.to(s(323)),"data-cke-tooltip-disabled":o.to(s(317),(e=>!e)),"data-cke-tooltip-class":s(328)},children:[this[s(312)],this[s(321)],i]};n&&(a[s(322)]=s(294),a.on={click:o.to((()=>this[s(326)](s(309))))}),this[s(310)](a)}}function iu(e,t){const n=su();return(iu=function(e,t){return n[e-=294]})(e,t)}class au extends r.View{constructor(e,t){const n=iu;super(e),this[n(310)]({tag:n(316),attributes:{class:["ck",n(314),t[n(295)][n(303)]()],"aria-hidden":n(324)}})}}const cu=uu;function du(){const e=["currentDisplayedUsers","Shift+Tab","destroy","render","execute","bind","using","plugins","presencelist-missing-container","input","_handleUserRemove","detachFromDom","isMe","hasTooltip","content","appendChild","isRendered","presencelist-collapseat-invalid-format","get","class","112wgyLAj","33183jDlEpg","counterView","keystrokes","querySelectorAll","[tabindex]","focusTracker","isCollapsed","remove","balloonPanelView","items","hideDropdown","map","ck ck-presence-list__balloon","isVisible","length","4223825DKSozc","textarea","body","select","2608IiQkPe","listenTo","indexOf","presenceList.container","focus","locale","init","Tab","onClick","presenceList.collapseAt","reverse","Esc","presenceList.displayMe","checkIfScrollable","config","_handleUserAdd","4393098vcwJOI",':not([disabled]):not([tabindex="-1"])',"join","define","attachToDom","offsetWidth","number","Enter","tabIndex","1009902tUJqAl","usersCount","_bodyCollection","[contenteditable]","50364haANCG","activeElement","from","context","10043376MFauUh","sort","add","button","bindTo","inlineListView","isExpanded","unpin","min","presenceDropdownView","pin","set","presenceList","offsetHeight","3345776uaNVLZ","allConnectedUsers","_allConnectedUsers","view","_createView","requires","change:isFocused","showDropdown","isFocusable","isHidden","element","filter","displayMe"];return(du=function(){return e})()}function uu(e,t){const n=du();return(uu=function(e,t){return n[e-=246]})(e,t)}!function(e){const t=uu,n=e();for(;;)try{if(741462===parseInt(t(311))/1+parseInt(t(266))/2*(-parseInt(t(267))/3)+-parseInt(t(333))/4+parseInt(t(282))/5+parseInt(t(302))/6+parseInt(t(319))/7+-parseInt(t(286))/8*(parseInt(t(315))/9))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(du);const lu={collapseAt:6,displayMe:!0};class pu extends t.ContextPlugin{constructor(e){const t=uu;super(e),this[t(313)]=null,this[t(318)][t(300)][t(305)](t(331),lu);const s=e[t(300)][t(264)](t(295));if(t(308)!=typeof s)throw new n.CKEditorError(t(263),this);if(s<1)throw new n.CKEditorError(t(263),this);this[t(335)]=this[t(318)][t(253)][t(264)](ys)[t(334)],this[t(330)](t(312),0),this[t(246)]=new n.Collection,this[t(275)]=new r.BalloonPanelView,this[t(275)][t(265)]=t(279),this[t(336)]=this[t(337)](),this[t(328)]=void 0}static get[cu(338)](){return[ys]}[cu(292)](){const e=cu;for(const t of this[e(335)])this[e(301)](t);this[e(287)](this[e(335)],e(321),((t,n)=>{this[e(301)](n)})),this[e(287)](this[e(335)],e(274),((t,n)=>{this[e(256)](n)}))}[cu(337)](){const e=cu,t=this[e(318)],s=new Kd(this[e(318)][e(291)]),o=this[e(275)];if(!Vd(t[e(300)][e(264)](e(289))))throw new n.CKEditorError(e(254),this);return s[e(268)][e(251)](e(312)).to(this),s[e(251)](e(273)).to(this,e(312),(n=>{const r=e,{collapseAt:o,displayMe:i}=t[r(300)][r(264)](r(331)),a=n>=o;return s[r(268)][r(342)]=!(1==n&&i||a),a||this[r(277)](),a})),s[e(324)][e(276)][e(323)](this[e(246)])[e(252)]((n=>{const r=e,o=t[r(300)][r(264)](r(331)),i=new ou(t[r(291)],n,!!o[r(294)]);return i[r(251)](r(259)).to(s,r(273),(e=>!e)),i[r(251)](r(341)).to(s,r(273),(e=>!e)),o[r(294)]&&this[r(287)](i,r(250),(()=>{const e=r;this[e(336)][e(273)]||o[e(294)](n,i[e(343)])})),i})),this[e(287)](s[e(324)],e(250),(()=>{const t=e;this[t(328)]?this[t(277)]():this[t(336)][t(273)]&&this[t(340)]()})),s[e(324)][e(269)][e(330)](e(309),((t,n)=>{const r=e;this[r(336)][r(273)]&&(this[r(340)](),n())})),s[e(249)](),o[e(249)](),(0,r.clickOutsideHandler)({emitter:s,activator:()=>o[e(280)],contextElements:[o[e(343)],s[e(324)][e(343)]],callback:()=>this[e(277)]()}),t[e(300)][e(264)](e(289))[e(261)](s[e(343)]),this[e(313)]=new r.BodyCollection(this[e(318)][e(291)]),this[e(313)][e(306)](),this[e(313)][e(321)](this[e(275)]),s}[cu(301)](e){const t=cu;if(!this[t(318)][t(300)][t(264)](t(298))&&e[t(258)])return;const n=this[t(318)][t(300)][t(264)](t(295))-1;this[t(312)]++,this[t(246)][t(281)]==n&&this[t(246)][t(281)]>1&&this[t(246)][t(274)](1);const r=e[t(258)]?0:this[t(246)][t(281)];this[t(246)][t(321)](e,r)}[cu(256)](e){const t=cu;if(this[t(312)]--,this[t(246)][t(264)](e.id)&&(this[t(246)][t(274)](e.id),this[t(246)][t(281)]<this[t(312)]))for(const e of Array[t(317)](this[t(335)])[t(296)]())if(!this[t(246)][t(264)](e.id))return void this[t(246)][t(321)](e,Math[t(327)](this[t(246)][t(281)],1))}[cu(340)](){const e=cu;if(this[e(328)])return;const t=this[e(318)][e(300)][e(264)](e(331));this[e(328)]=new Qd(this[e(318)][e(291)],!!t[e(294)]),this[e(336)][e(324)][e(325)]=!0;const{listWrapperView:n}=this[e(328)];n[e(276)][e(323)](this[e(335)])[e(252)]((n=>{const r=e;if(!t[r(345)]&&n[r(258)])return null;const s=new ru(this[r(318)][r(291)],n,!!t[r(294)]);return t[r(294)]&&this[r(287)](s,r(250),(()=>{const e=r;t[e(294)](n,s[e(343)])})),s})),this[e(275)][e(260)][e(321)](this[e(328)]),this[e(275)][e(329)]({target:this[e(336)][e(324)][e(343)]}),n[e(290)](),n[e(299)]();const r=(t,n)=>{const r=e;this[r(277)](),this[r(336)][r(324)][r(290)](),n()};n[e(269)][e(330)](e(297),r),n[e(269)][e(330)](e(247),r),n[e(269)][e(330)](e(293),((t,n)=>{const r=e;!function(e){const t=uu,n=["a",t(322),t(255),t(285),t(283),t(271),t(314)][t(278)]((e=>e+t(303)))[t(304)](","),r=[...document[t(284)][t(270)](n)][t(344)]((e=>e===document[t(316)]||e[t(307)]+e[t(332)]>0))[t(320)](((e,n)=>(e[t(310)]||0)-(n[t(310)]||0))),s=r[t(288)](e),o=r[(s+1)%r[t(281)]];o&&o[t(290)]()}(this[r(336)][r(343)]),this[r(277)](),n()})),n[e(272)][e(321)](this[e(336)][e(343)]),n[e(272)].on(e(339),((t,n,r)=>{r||this[e(277)]()}))}[cu(277)](){const e=cu;this[e(328)]&&(this[e(336)][e(324)][e(325)]=!1,this[e(275)][e(326)](),this[e(275)][e(260)][e(274)](this[e(328)]),this[e(328)][e(248)](),this[e(328)]=void 0)}[cu(248)](){const e=cu;super[e(248)](),this[e(336)]&&this[e(336)][e(262)]&&this[e(336)][e(248)](),this[e(313)]&&(this[e(313)][e(257)](),this[e(313)][e(248)](),this[e(313)]=null)}}function hu(){var e=["requires","126YzyVPe","1581114rCHKPo","11ZiTVOP","pluginName","3459Tcdysc","1DymZYS","68730FPHIEO","249344omKEVp","3678003TLvMuE","isPremiumPlugin","isOfficialPlugin","PresenceList","18296230JLmWBN","2391220PkmSAu","508wcsqvF"];return(hu=function(){return e})()}var fu=mu;function mu(e,t){var n=hu();return(mu=function(e,t){return n[e-=140]})(e,t)}!function(e){for(var t=mu,n=e();;)try{if(397643===parseInt(t(141))/1*(-parseInt(t(153))/2)+parseInt(t(140))/3*(-parseInt(t(150))/4)+parseInt(t(149))/5+-parseInt(t(142))/6+-parseInt(t(144))/7+parseInt(t(143))/8*(-parseInt(t(152))/9)+parseInt(t(148))/10*(parseInt(t(154))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(hu);class yu extends t.ContextPlugin{static get[fu(151)](){return[ys,pu]}static get[fu(155)](){return fu(147)}static get[fu(146)](){return!0}static get[fu(145)](){return!0}}function gu(){var e=["5JmUOkd","4468fNgQOn","892143uFWNPn","15642nqsYnG","1335616rZKEIW","5031026FtyHcg","270700HRnCxu","930JhYqDw","14eWiEZm","787488xHfkpo","1720NhcWui"];return(gu=function(){return e})()}function bu(e,t){var n=gu();return(bu=function(e,t){return n[e-=450]})(e,t)}!function(e){for(var t=bu,n=e();;)try{if(536723===-parseInt(t(459))/1*(-parseInt(t(454))/2)+parseInt(t(450))/3+-parseInt(t(460))/4*(-parseInt(t(458))/5)+parseInt(t(457))/6+parseInt(t(456))/7*(-parseInt(t(452))/8)+parseInt(t(451))/9*(-parseInt(t(455))/10)+-parseInt(t(453))/11)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(gu)})(),(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: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}.ck.ck-presence-list__counter{color:var(--ck-color-base-text);margin-right:var(--ck-spacing-large)}.ck.ck-presence-list__counter--hidden{display:none}.ck.ck-presence-list__list-item{background:none;border:1px solid transparent;color:inherit;font:inherit;margin-left:var(--ck-spacing-small);outline:none;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-tooltip.ck-presence-list__list-item__tooltip>.ck-tooltip__text{display:inline-block;max-width:var(--ck-presence-list-users-tooltip-max-width);overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.ck.ck-presence-list__marker{display:block;height:3px;margin-top:3px;position:relative;width:100%}.ck-presence-list__balloon button.ck-presence-list__dropdown-list-item *,.ck-presence-list__list button.ck-presence-list__list-item *{cursor:pointer}.ck.ck-presence-list--collapsed .ck-presence-list__list{border:1px solid transparent;min-width:calc(var(--ck-user-avatar-size)*2)}.ck.ck-presence-list--collapsed .ck-presence-list__list *{cursor:pointer;transition:all .4s ease-in-out}.ck.ck-presence-list--collapsed .ck-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)*-1 + 7px);padding: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:nth-last-child(2){opacity:.75}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(3){opacity:.55}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(4){opacity:.35}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(5){opacity:.15}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(n+6){display:none}.ck.ck-presence-list__balloon{--ck-color-panel-border:var(--ck-color-presence-list-dropdown-arrow-border);--ck-color-panel-background:var(--ck-color-presence-list-dropdown-background);animation:fadeIn .3s ease-in-out;background-color:var(--ck-color-presence-list-dropdown-background);border:0;opacity:1}@media (prefers-reduced-motion:reduce){.ck.ck-presence-list__balloon{animation:none}}.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}@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,v=this,I=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,v.slashes=a.slashes||o&&t.slashes,v.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(v.protocol)))&&(O[3]=[/(.*)/,"pathname"]);I<O.length;I++)"function"!=typeof(d=O[I])?(c=d[0],b=d[1],c!=c?v[b]=e:"string"==typeof c?~(h="@"===c?e.lastIndexOf(c):e.indexOf(c))&&("number"==typeof d[2]?(v[b]=e.slice(0,h),e=e.slice(h+d[2])):(v[b]=e.slice(h),e=e.slice(0,h))):(h=c.exec(e))&&(v[b]=h[1],e=e.slice(0,h.index)),v[b]=v[b]||o&&d[3]&&t[b]||"",d[4]&&(v[b]=v[b].toLowerCase())):e=d(e,v);n&&(v.query=n(v.query)),o&&t.slashes&&"/"!==v.pathname.charAt(0)&&(""!==v.pathname||""!==t.pathname)&&(v.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("/")}(v.pathname,t.pathname)),"/"!==v.pathname.charAt(0)&&m(v.protocol)&&(v.pathname="/"+v.pathname),r(v.port,v.protocol)||(v.host=v.hostname,v.port=""),v.username=v.password="",v.auth&&(~(h=v.auth.indexOf(":"))?(v.username=v.auth.slice(0,h),v.username=encodeURIComponent(decodeURIComponent(v.username)),v.password=v.auth.slice(h+1),v.password=encodeURIComponent(decodeURIComponent(v.password))):v.username=encodeURIComponent(decodeURIComponent(v.auth)),v.auth=v.password?v.username+":"+v.password:v.username),v.origin="file:"!==v.protocol&&m(v.protocol)&&v.host?v.protocol+"//"+v.host:"null",v.href=v.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:()=>td,CloudServicesRevisionHistoryAdapter:()=>Pd,CloudServicesTrackChangesAdapter:()=>dd,PresenceList:()=>yu,RealTimeCollaborationClient:()=>Gc,RealTimeCollaborativeComments:()=>md,RealTimeCollaborativeEditing:()=>Qc,RealTimeCollaborativeRevisionHistory:()=>Cd,RealTimeCollaborativeTrackChanges:()=>Od,Sessions:()=>ys});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{Decoder:()=>Ve,Encoder:()=>Re,PacketType:()=>xe,protocol:()=>De});var t=__webpack_require__(782),n=__webpack_require__(584),r=__webpack_require__(311),s=__webpack_require__(783);class o{constructor(...e){}}class i extends o{constructor(...e){super()}static fromJSON(e){throw new TypeError("Must be implemented in a child class!")}}i.TYPE="1000";const a=i;class c extends a{constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new c(e.id)}}c.TYPE="21",c.READABLE_TYPE_NAME="getUser",c.DESCRIPTOR_NAME="GetUserMessage",c.DESCRIPTOR={fields:{id:{type:"string",id:1}}};const d=c;class u extends a{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 u(t)}}u.DESCRIPTOR_NAME="GetUserResponse",u.DESCRIPTOR={fields:{attributes:{rule:"repeated",type:"KeyValueDescriptor",id:1}}};const l=u;var p=__webpack_require__(199);const h=(()=>{var e=p.Reader,t=p.Writer,n=p.util,r=p.roots.default||(p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.OperationMetadataDescriptor;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.userId=t.string();break;case 2:o.type=t.string();break;case 3:o.createdAt=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CollaborativeEditingConnectMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.bundleVersion=t.string();break;case 3:o.buffers&&o.buffers.length||(o.buffers=[]),o.buffers.push(t.bytes());break;case 4:if(o.types&&o.types.length||(o.types=[]),2==(7&i))for(var a=t.uint32()+t.pos;t.pos<a;)o.types.push(t.uint32());else o.types.push(t.uint32());break;case 5:o.lastOperationId=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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CollaborativeEditingReconnectMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.bundleVersion=t.string();break;case 3:o.lastKnowVersion=t.uint32();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CollaborativeEditingUpdateMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.baseVersion=t.uint32();break;case 3:o.buffers&&o.buffers.length||(o.buffers=[]),o.buffers.push(t.bytes());break;case 4:if(o.types&&o.types.length||(o.types=[]),2==(7&i))for(var a=t.uint32()+t.pos;t.pos<a;)o.types.push(t.uint32());else o.types.push(t.uint32());break;case 6:o.metadata&&o.metadata.length||(o.metadata=[]),o.metadata.push(r.OperationMetadataDescriptor.decode(t,t.uint32()));break;case 7:o.lastOperationId=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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.GetDocumentDetailsMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.documentId=t.string();break;case 2:o.environmentId=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CollaborativeEditingConnectResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.channel=t.string();break;case 2:o.offset=t.uint32();break;case 3:o.version=t.uint32();break;case 4:o.buffers&&o.buffers.length||(o.buffers=[]),o.buffers.push(t.bytes());break;case 5:if(o.types&&o.types.length||(o.types=[]),2==(7&i))for(var a=t.uint32()+t.pos;t.pos<a;)o.types.push(t.uint32());else o.types.push(t.uint32());break;case 7:o.metadata&&o.metadata.length||(o.metadata=[]),o.metadata.push(r.OperationMetadataDescriptor.decode(t,t.uint32()));break;case 8:o.initData=t.string();break;case 9:o.isInitialized=t.bool();break;case 10:o.sessionId=t.string();break;case 11:o.lastOperationId=t.string();break;case 12:o.sessionCreatedAt=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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CollaborativeEditingResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.version=t.uint32();break;case 2:o.buffers&&o.buffers.length||(o.buffers=[]),o.buffers.push(t.bytes());break;case 3:if(o.types&&o.types.length||(o.types=[]),2==(7&i))for(var a=t.uint32()+t.pos;t.pos<a;)o.types.push(t.uint32());else o.types.push(t.uint32());break;case 5:o.metadata&&o.metadata.length||(o.metadata=[]),o.metadata.push(r.OperationMetadataDescriptor.decode(t,t.uint32()));break;case 6:o.lastOperationId=t.string();break;case 7:o.lastOperationAcceptedAt=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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.GetDocumentDetailsResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.lastDocumentSessionId=t.string();break;case 2:o.lastDocumentSessionOperationId=t.string();break;case 3:o.currentDocumentSessionId=t.string();break;case 4:o.currentDocumentSessionVersion=t.uint32();break;case 5:o.currentDocumentSessionOperationId=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentDescriptor;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentId=t.string();break;case 2:o.commentThreadId=t.string();break;case 3:o.userId=t.string();break;case 4:o.content=t.string();break;case 5:o.documentId=t.string();break;case 6:o.createdAt=t.string();break;case 7:o.attributes=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsThreadDescriptor;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.comments&&o.comments.length||(o.comments=[]),o.comments.push(r.CommentDescriptor.decode(t,t.uint32()));break;case 3:o.resolvedAt=t.string();break;case 4:o.resolvedBy=t.string();break;case 5:o.context=t.string();break;case 6:o.createdAt=t.string();break;case 7:o.deletedAt=t.string();break;case 8:o.attributes=t.string();break;case 9:o.unlinkedAt=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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentThreadAddedCommentDescriptor;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentId=t.string();break;case 2:o.createdAt=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2AddCommentMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.content=t.string();break;case 3:o.documentId=t.string();break;case 4:o.commentId=t.string();break;case 5:o.createdAt=t.string();break;case 6:o.userId=t.string();break;case 7:o.attributes=t.string();break;case 8:o.commentThread=r.CommentsThreadDescriptor.decode(t,t.uint32());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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2AddCommentThreadMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.documentId=t.string();break;case 2:o.commentThreadId=t.string();break;case 3:o.context=t.string();break;case 4:o.createdAt=t.string();break;case 5:o.resolvedAt=t.string();break;case 6:o.resolvedBy=t.string();break;case 7:o.attributes=t.string();break;case 8:o.deletedAt=t.string();break;case 9:o.comments&&o.comments.length||(o.comments=[]),o.comments.push(r.CommentDescriptor.decode(t,t.uint32()));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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2ReopenCommentThreadMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.documentId=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2ResolveCommentThreadMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.documentId=t.string();break;case 3:o.resolvedBy=t.string();break;case 4:o.resolvedAt=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2UpdateCommentThreadMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.documentId=t.string();break;case 3:o.context=t.string();break;case 4:o.attributes=t.string();break;case 5:o.unlinkedAt=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2ConnectMessage;t.pos<s;){var i=t.uint32();i>>>3==1?o.documentId=t.string():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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2GetCommentThreadMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.documentId=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2GetDocumentThreadsMessage;t.pos<s;){var i=t.uint32();i>>>3==1?o.documentId=t.string():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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2RemoveCommentMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.commentId=t.string();break;case 3:o.documentId=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2RemoveCommentThreadMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.documentId=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2UpdateCommentMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.commentId=t.string();break;case 3:o.content=t.string();break;case 4:o.documentId=t.string();break;case 5:o.attributes=t.string();break;case 6:o.isAttributesUpdated=t.bool();break;case 7:o.commentThread=r.CommentsThreadDescriptor.decode(t,t.uint32());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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2AddCommentResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.commentId=t.string();break;case 3:o.createdAt=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2AddCommentThreadResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.createdAt=t.string();break;case 3:o.comments&&o.comments.length||(o.comments=[]),o.comments.push(r.CommentThreadAddedCommentDescriptor.decode(t,t.uint32()));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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2ResolveCommentThreadResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.documentId=t.string();break;case 3:o.resolvedAt=t.string();break;case 4:o.resolvedBy=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2ConnectResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.channel=t.string();break;case 2:o.threads&&o.threads.length||(o.threads=[]),o.threads.push(t.string());break;case 3:o.threadsV2&&o.threadsV2.length||(o.threadsV2=[]),o.threadsV2.push(r.CommentsThreadDescriptor.decode(t,t.uint32()));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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2GetCommentThreadResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.commentThreadId=t.string();break;case 2:o.comments&&o.comments.length||(o.comments=[]),o.comments.push(t.string());break;case 3:o.commentsV2&&o.commentsV2.length||(o.commentsV2=[]),o.commentsV2.push(r.CommentDescriptor.decode(t,t.uint32()));break;case 4:o.resolvedAt=t.string();break;case 5:o.resolvedBy=t.string();break;case 6:o.context=t.string();break;case 7:o.createdAt=t.string();break;case 8:o.deletedAt=t.string();break;case 9:o.attributes=t.string();break;case 10:o.unlinkedAt=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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.CommentsV2GetDocumentThreadsResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.threads&&o.threads.length||(o.threads=[]),o.threads.push(t.string());break;case 2:o.threadsV2&&o.threadsV2.length||(o.threadsV2=[]),o.threadsV2.push(r.CommentsThreadDescriptor.decode(t,t.uint32()));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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.KeyValueDescriptor;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.key=t.string();break;case 2:o.value=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.IsEditorBundleUploadedMessage;t.pos<s;){var i=t.uint32();i>>>3==1?o.bundleVersion=t.string():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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.IsEditorBundleUploadedResponse;t.pos<s;){var i=t.uint32();i>>>3==1?o.isUploaded=t.bool():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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RevisionDescriptor;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.revisionId=t.string();break;case 2:o.name=t.string();break;case 3:o.creatorId=t.string();break;case 4:o.authorsIds=t.string();break;case 5:o.diffData=t.string();break;case 6:o.createdAt=t.string();break;case 7:o.attributes=t.string();break;case 8:o.toVersion=t.uint32();break;case 9:o.fromVersion=t.uint32();break;case 10:o.isEmptyCurrent=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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RevisionHistoryConnectMessage;t.pos<s;){var i=t.uint32();i>>>3==1?o.documentId=t.string():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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RevisionHistoryGetRevisionMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.documentId=t.string();break;case 2:o.revisionId=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RevisionHistoryReconnectMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.documentId=t.string();break;case 2:o.requestId=t.uint32();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RevisionHistoryUpdateRevisionsMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.documentId=t.string();break;case 2:o.requestId=t.uint32();break;case 3:o.revisions&&o.revisions.length||(o.revisions=[]),o.revisions.push(r.RevisionDescriptor.decode(t,t.uint32()));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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RevisionHistoryConnectResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.channel=t.string();break;case 2:o.requestId=t.uint32();break;case 3:o.revisions&&o.revisions.length||(o.revisions=[]),o.revisions.push(r.RevisionDescriptor.decode(t,t.uint32()));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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RevisionHistoryGetRevisionResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.revisionId=t.string();break;case 2:o.name=t.string();break;case 3:o.creatorId=t.string();break;case 4:o.authorsIds=t.string();break;case 5:o.diffData=t.string();break;case 6:o.createdAt=t.string();break;case 7:o.attributes=t.string();break;case 8:o.toVersion=t.uint32();break;case 9:o.fromVersion=t.uint32();break;case 10:o.isEmptyCurrent=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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.RevisionHistoryUpdateRevisionsResponse;t.pos<s;){var i=t.uint32();i>>>3==1?o.requestId=t.uint32():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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.SessionsSocketDescriptor;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.session=t.string();break;case 2:o.user=t.string();break;case 3:o.role=t.string();break;case 4:o.permissions&&o.permissions.length||(o.permissions=[]),o.permissions.push(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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.SessionsConnectMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.sessionType=t.uint32();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.SocketConnectMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.userId=t.string();break;case 3:o.role=t.string();break;case 4:o.permissions&&o.permissions.length||(o.permissions=[]),o.permissions.push(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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.SocketDisconnectMessage;t.pos<s;){var i=t.uint32();i>>>3==1?o.id=t.string():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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.SessionsConnectResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.channel=t.string();break;case 2:o.sockets&&o.sockets.length||(o.sockets=[]),o.sockets.push(r.SessionsSocketDescriptor.decode(t,t.uint32()));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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.SuggestionDescriptor;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.authorId=t.string();break;case 3:o.type=t.string();break;case 4:o.createdAt=t.string();break;case 5:o.data=t.string();break;case 6:o.hasComments=t.bool();break;case 7:o.state=t.string();break;case 8:o.attributes=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.TrackChangesAddSuggestionMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.documentId=t.string();break;case 3:o.type=t.string();break;case 4:o.data=t.string();break;case 5:o.originalSuggestionId=t.string();break;case 6:o.attributes=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.TrackChangesBatchUpdateSuggestionsStateMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.ids&&o.ids.length||(o.ids=[]),o.ids.push(t.string());break;case 2:o.documentId=t.string();break;case 3:o.state=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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.TrackChangesConnectMessage;t.pos<s;){var i=t.uint32();i>>>3==1?o.documentId=t.string():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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.TrackChangesGetAllSuggestionMessage;t.pos<s;){var i=t.uint32();i>>>3==1?o.documentId=t.string():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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.TrackChangesGetSuggestionMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.documentId=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.TrackChangesUpdateSuggestionMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.documentId=t.string();break;case 3:o.hasComments=t.bool();break;case 4:o.isHasCommentsModified=t.bool();break;case 5:o.state=t.string();break;case 6:o.attributes=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.TrackChangesAddSuggestionResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.authorId=t.string();break;case 3:o.type=t.string();break;case 4:o.createdAt=t.string();break;case 5:o.data=t.string();break;case 6:o.hasComments=t.bool();break;case 7:o.state=t.string();break;case 8:o.attributes=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.TrackChangesConnectResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.channel=t.string();break;case 2:o.suggestions&&o.suggestions.length||(o.suggestions=[]),o.suggestions.push(t.string());break;case 3:o.suggestionsV2&&o.suggestionsV2.length||(o.suggestionsV2=[]),o.suggestionsV2.push(r.SuggestionDescriptor.decode(t,t.uint32()));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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.TrackChangesGetAllSuggestionsResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.suggestions&&o.suggestions.length||(o.suggestions=[]),o.suggestions.push(t.string());break;case 2:o.suggestionsV2&&o.suggestionsV2.length||(o.suggestionsV2=[]),o.suggestionsV2.push(r.SuggestionDescriptor.decode(t,t.uint32()));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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.TrackChangesGetSuggestionResponse;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.id=t.string();break;case 2:o.authorId=t.string();break;case 3:o.type=t.string();break;case 4:o.createdAt=t.string();break;case 5:o.data=t.string();break;case 6:o.hasComments=t.bool();break;case 7:o.state=t.string();break;case 8:o.attributes=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.UserDescriptor;t.pos<s;){var i=t.uint32();i>>>3==1?(o.attributes&&o.attributes.length||(o.attributes=[]),o.attributes.push(r.KeyValueDescriptor.decode(t,t.uint32()))):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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.GetManyUsersMessage;t.pos<s;){var i=t.uint32();i>>>3==1?(o.ids&&o.ids.length||(o.ids=[]),o.ids.push(t.string())):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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.GetUserMessage;t.pos<s;){var i=t.uint32();i>>>3==1?o.id=t.string():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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.GetManyUsersResponse;t.pos<s;){var i=t.uint32();i>>>3==1?(o.users&&o.users.length||(o.users=[]),o.users.push(r.UserDescriptor.decode(t,t.uint32()))):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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.GetUserResponse;t.pos<s;){var i=t.uint32();i>>>3==1?(o.attributes&&o.attributes.length||(o.attributes=[]),o.attributes.push(r.KeyValueDescriptor.decode(t,t.uint32()))):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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.ChannelMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.type=t.uint32();break;case 2:o.socketId=t.string();break;case 3:o.data=t.bytes();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.BytesBytesPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.bytes();break;case 2:o.data1=t.bytes();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.NumberBytesPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.uint32();break;case 2:o.data1=t.bytes();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.NumberNumberPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.uint32();break;case 2:o.data1=t.uint32();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.NumberObjectPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.uint32();break;case 2:o.data1=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.NumberStringPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.uint32();break;case 2:o.data1=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.ObjectBufferPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.string();break;case 2:o.data1=t.bytes();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.ObjectObjectPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.string();break;case 2:o.data1=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.PacketMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.type=t.uint32();break;case 2:o.id=t.uint32();break;case 3:o.nsp=t.string();break;case 4:o.data=t.bytes();break;case 5:o.options=t.bytes();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.PacketOptionsMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.flags=t.string();break;case 2:o.rooms&&o.rooms.length||(o.rooms=[]),o.rooms.push(t.string());break;case 3:o.except&&o.except.length||(o.except=[]),o.except.push(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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.StringBytesPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.string();break;case 2:o.data1=t.bytes();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.StringNumberPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.string();break;case 2:o.data1=t.uint32();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.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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.StringObjectPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.string();break;case 2:o.data1=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){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,p.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){t instanceof e||(t=e.create(t));for(var s=void 0===n?t.len:t.pos+n,o=new r.StringStringPacketDataMessage;t.pos<s;){var i=t.uint32();switch(i>>>3){case 1:o.data=t.string();break;case 2:o.data1=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){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,p.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringStringPacketDataMessage"},s}(),r})();class f{static decode(e,t){const n=m(t).decode("undefined"==typeof window?e:new Uint8Array(e));return t.fromJSON({...n})}static encode(e){const t=m(e.constructor),n=e.toJSON(),r=t.verify(n);if(r)throw Error(r);return t.encode(t.create(n)).finish()}}function m(e){return h[e.DESCRIPTOR_NAME]}class y extends a{constructor(e){super(),this.ids=e}toJSON(){return{ids:this.ids}}static fromJSON(e){return new y(e.ids)}}y.TYPE="22",y.READABLE_TYPE_NAME="getManyUsers",y.DESCRIPTOR_NAME="GetManyUsersMessage",y.DESCRIPTOR={fields:{ids:{id:1,type:"string",rule:"repeated"}}};const g=y;class b extends a{constructor(e){super(),this.users=e}toJSON(){return{users:this.users.map(w)}}static fromJSON(e){return new b(e.users.map(v))}}b.DESCRIPTOR_NAME="GetManyUsersResponse",b.DESCRIPTOR={fields:{users:{rule:"repeated",type:"UserDescriptor",id:1}}};const O=b;function w(e){return{attributes:Object.keys(e).map((t=>({key:t,value:JSON.stringify(e[t])})))}}function v(e){return e.attributes.reduce(((e,t)=>(e[t.key]=t.value?JSON.parse(t.value):null,e)),{})}class I{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 I(e)}static async get(e,t){const n=new d(t);try{const t=await e._sendRequest(I._SERVICE,d.TYPE,f.encode(n)),r=f.decode(t,l);return new I(r.attributes)}catch(e){return new I({id:t})}}static async getMany(e,t){const n=new g(t);try{const t=await e._sendRequest(I._SERVICE,g.TYPE,f.encode(n));return f.decode(t,O).users.map((e=>new I(e)))}catch(e){return t.map((e=>new I({id:e})))}}}I._SERVICE=2;const S=I,P=Object.create(null);P.open="0",P.close="1",P.ping="2",P.pong="3",P.message="4",P.upgrade="5",P.noop="6";const k=Object.create(null);Object.keys(P).forEach((e=>{k[P[e]]=e}));const A={type:"error",data:"parser error"},_="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),T="function"==typeof ArrayBuffer,C=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,j=({type:e,data:t},n,r)=>_&&t instanceof Blob?n?r(t):E(t,r):T&&(t instanceof ArrayBuffer||C(t))?n?r(t):E(new Blob([t]),r):r(P[e]+(t||"")),E=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)};function D(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let x;const R="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)N[R.charCodeAt(e)]=e;const V="function"==typeof ArrayBuffer,M=(e,t)=>{if("string"!=typeof e)return{type:"message",data:U(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:B(e.substring(1),t)};return k[n]?e.length>1?{type:k[n],data:e.substring(1)}:{type:k[n]}:A},B=(e,t)=>{if(V){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=N[e.charCodeAt(t)],r=N[e.charCodeAt(t+1)],s=N[e.charCodeAt(t+2)],o=N[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 U(n,t)}return{base64:!0,data:e}},U=(e,t)=>"blob"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,J=String.fromCharCode(30);function q(){return new TransformStream({transform(e,t){!function(e,t){_&&e.data instanceof Blob?e.data.arrayBuffer().then(D).then(t):T&&(e.data instanceof ArrayBuffer||C(e.data))?t(D(e.data)):j(e,!1,(e=>{x||(x=new TextEncoder),t(x.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 L;function G(e){return e.reduce(((e,t)=>e+t.length),0)}function H(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 Y(e){if(e)return function(e){for(var t in Y.prototype)e[t]=Y.prototype[t];return e}(e)}Y.prototype.on=Y.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},Y.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},Y.prototype.off=Y.prototype.removeListener=Y.prototype.removeAllListeners=Y.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},Y.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},Y.prototype.emitReserved=Y.prototype.emit,Y.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},Y.prototype.hasListeners=function(e){return!!this.listeners(e).length};const z="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function F(e,...t){return t.reduce(((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const K=z.setTimeout,W=z.clearTimeout;function Q(e,t){t.useNativeTimers?(e.setTimeoutFn=K.bind(z),e.clearTimeoutFn=W.bind(z)):(e.setTimeoutFn=z.setTimeout.bind(z),e.clearTimeoutFn=z.clearTimeout.bind(z))}class $ extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class Z extends Y{constructor(e){super(),this.writable=!1,Q(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new $(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=M(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 X="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),ee={};let te,ne=0,re=0;function se(e){let t="";do{t=X[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function oe(){const e=se(+new Date);return e!==te?(ne=0,te=e):e+"."+se(ne++)}for(;re<64;re++)ee[X[re]]=re;let ie=!1;try{ie="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}const ae=ie;function ce(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||ae))return new XMLHttpRequest}catch(e){}if(!t)try{return new(z[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}function de(){}const ue=null!=new ce({xdomain:!1}).responseType;class le extends Y{constructor(e,t){super(),Q(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=F(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd;const n=this.xhr=new ce(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=le.requestsCount++,le.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=de,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete le.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(le.requestsCount=0,le.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",pe);else if("function"==typeof addEventListener){addEventListener("onpagehide"in z?"pagehide":"unload",pe,!1)}function pe(){for(let e in le.requests)le.requests.hasOwnProperty(e)&&le.requests[e].abort()}const he="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),fe=z.WebSocket||z.MozWebSocket,me="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const ye={websocket:class extends Z{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=me?{}:F(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=me?new fe(e,t,n):t?new fe(e,t):new fe(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;j(n,this.supportsBinary,(e=>{try{this.ws.send(e)}catch(e){}r&&he((()=>{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]=oe()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}check(){return!!fe}},webtransport:class extends Z{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){L||(L=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(G(n)<1)break;const e=H(n,1);o=!(128&~e[0]),s=127&e[0],r=s<126?3:126===s?1:2}else if(1===r){if(G(n)<2)break;const e=H(n,2);s=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(2===r){if(G(n)<8)break;const e=H(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),o=t.getUint32(0);if(o>Math.pow(2,21)-1){a.enqueue(A);break}s=o*Math.pow(2,32)+t.getUint32(4),r=3}else{if(G(n)<s)break;const e=H(n,s);a.enqueue(M(o?e:L.decode(e),t)),r=0}if(0===s||s>e){a.enqueue(A);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=q();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&&he((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var e;null===(e=this.transport)||void 0===e||e.close()}},polling:class extends Z{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=ue&&!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(J),r=[];for(let e=0;e<n.length;e++){const s=M(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)=>{j(e,!1,(e=>{r[o]=e,++s===n&&t(r.join(J))}))}))})(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]=oe()),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 le(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}}},ge=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,be=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Oe(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=ge.exec(e||""),o={},i=14;for(;i--;)o[be[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 we extends Y{constructor(e,t={}){super(),this.binaryType="arraybuffer",this.writeBuffer=[],e&&"object"==typeof e&&(t=e,e=null),e?(e=Oe(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=Oe(t.host).host),Q(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 ye[e](n)}open(){let e;if(this.opts.rememberUpgrade&&we.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;we.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;we.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",we.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 n=0;n<this.writeBuffer.length;n++){const r=this.writeBuffer[n].data;if(r&&(e+="string"==typeof(t=r)?function(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}(t):Math.ceil(1.33*(t.byteLength||t.size))),n>0&&e>this.maxPayload)return this.writeBuffer.slice(0,n);e+=2}var t;return this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const s={type:e,data:t,options:n};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(e){we.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}}we.protocol=4;we.protocol;const ve="function"==typeof ArrayBuffer,Ie=Object.prototype.toString,Se="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Ie.call(Blob),Pe="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===Ie.call(File);function ke(e){return ve&&(e instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||Se&&e instanceof Blob||Pe&&e instanceof File}function Ae(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(Ae(e[t]))return!0;return!1}if(ke(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return Ae(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&Ae(e[t]))return!0;return!1}function _e(e){const t=[],n=e.data,r=e;return r.data=Te(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Te(e,t){if(!e)return e;if(ke(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]=Te(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]=Te(e[r],t));return n}return e}function Ce(e,t){return e.data=je(e.data,t),delete e.attachments,e}function je(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]=je(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=je(e[n],t));return e}const Ee=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],De=5;var xe;!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"}(xe||(xe={}));class Re{constructor(e){this.replacer=e}encode(e){return e.type!==xe.EVENT&&e.type!==xe.ACK||!Ae(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===xe.EVENT?xe.BINARY_EVENT:xe.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==xe.BINARY_EVENT&&e.type!==xe.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=_e(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}}function Ne(e){return"[object Object]"===Object.prototype.toString.call(e)}class Ve extends Y{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===xe.BINARY_EVENT;n||t.type===xe.BINARY_ACK?(t.type=n?xe.EVENT:xe.ACK,this.reconstructor=new Me(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!ke(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===xe[n.type])throw new Error("unknown packet type "+n.type);if(n.type===xe.BINARY_EVENT||n.type===xe.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(!Ve.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 xe.CONNECT:return Ne(t);case xe.DISCONNECT:return void 0===t;case xe.CONNECT_ERROR:return"string"==typeof t||Ne(t);case xe.EVENT:case xe.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===Ee.indexOf(t[0]));case xe.ACK:case xe.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Me{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=Ce(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Be(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Ue=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Je extends Y{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=[Be(e,"open",this.onopen.bind(this)),Be(e,"packet",this.onpacket.bind(this)),Be(e,"error",this.onerror.bind(this)),Be(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(Ue.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:xe.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:xe.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 xe.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 xe.EVENT:case xe.BINARY_EVENT:this.onevent(e);break;case xe.ACK:case xe.BINARY_ACK:this.onack(e);break;case xe.DISCONNECT:this.ondisconnect();break;case xe.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:xe.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:xe.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 qe(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}qe.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)},qe.prototype.reset=function(){this.attempts=0},qe.prototype.setMin=function(e){this.ms=e},qe.prototype.setMax=function(e){this.max=e},qe.prototype.setJitter=function(e){this.jitter=e};class Le extends Y{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,Q(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 qe({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 we(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=Be(t,"open",(function(){n.onopen(),e&&e()})),s=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},o=Be(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(Be(e,"ping",this.onping.bind(this)),Be(e,"data",this.ondata.bind(this)),Be(e,"error",this.onerror.bind(this)),Be(e,"close",this.onclose.bind(this)),Be(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){he((()=>{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 Je(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 Ge={};function He(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=Oe(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=Ge[s]&&o in Ge[s].nsps;let a;return t.forceNew||t["force new connection"]||!1===t.multiplex||i?a=new Le(r,t):(Ge[s]||(Ge[s]=new Le(r,t)),a=Ge[s]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}Object.assign(He,{Manager:Le,Socket:Je,io:He,connect:He});var Ye=__webpack_require__(835);class ze extends a{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 ze(e.type,e.socketId,e.data)}}ze.DESCRIPTOR_NAME="ChannelMessage",ze.DESCRIPTOR={fields:{type:{type:"uint32",id:1},socketId:{type:"string",id:2},data:{type:"bytes",id:3}}};const Fe=ze,Ke=class extends((0,n.EmitterMixin)()){constructor(e,t,n){super(),this._channelName=e,this._wsGateway=t,this._socket=n,this._subscribeToChannel()}remove(){this._socket.off(this._channelName)}getEventName(e,t=!1){let n="";return t&&(n+="all:"),n+="event",e&&(n+=":"+e),n}_subscribeToChannel(){this._socket.on(this._channelName,(e=>{const t=f.decode(e,Fe);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 We extends Error{constructor(e,t,n=null,r={}){super("cloud-services-internal-error: "+e),this.context=t,this.code=n,this.data=r,this.name="CKEditorError"}static fromPublicError(e){return new We(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 Qe extends Error{constructor(e,t){super(),this.name="CKEditorCloudServicesServerError",this.stack=void 0,this.message=e,this.code=t.code,this.traceId=t.traceId,this.data=t.data}static fromPublicError(e){return new Qe(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 $e extends a{constructor(e,t=[],n=[]){super(),this.flags=e,this.rooms=t,this.except=n}toJSON(){var e,t;return{flags:this.flags?JSON.stringify(this.flags):void 0,rooms:(null===(e=this.rooms)||void 0===e?void 0:e.length)?this.rooms:void 0,except:(null===(t=this.except)||void 0===t?void 0:t.length)?this.except:void 0}}static fromJSON(e){return new $e(e.flags&&JSON.parse(e.flags),e.rooms,e.except)}}$e.TYPE=11,$e.DESCRIPTOR_NAME="PacketOptionsMessage",$e.DESCRIPTOR={fields:{flags:{type:"string",id:1},rooms:{type:"string",id:2,rule:"repeated"},except:{type:"string",id:3,rule:"repeated"}}};const Ze=$e,Xe=(()=>!("undefined"==typeof process||!process.versions||!process.versions.node))(),et=1,tt=2,nt=3,rt=4;class st{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(st.isBuffer(e))return et;const t=typeof e;return"string"===t?tt:"number"===t?nt:rt}static isBuffer(e){return Xe&&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 ot extends a{static create(e,t){throw new TypeError("Must be implemented in a child class!")}}class it extends ot{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new it(e.data,e.data1)}static create(e,t){return new it(e,t)}}it.TYPE=(()=>st.getPacketType(nt,et))(),it.DESCRIPTOR_NAME="NumberBytesPacketDataMessage",it.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"bytes",id:2}}};const at=it;class ct extends ot{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)}}ct.TYPE=(()=>st.getPacketType(tt,et))(),ct.DESCRIPTOR_NAME="StringBytesPacketDataMessage",ct.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};const dt=ct;class ut extends ot{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)}}ut.TYPE=(()=>st.getPacketType(et,et))(),ut.DESCRIPTOR_NAME="BytesBytesPacketDataMessage",ut.DESCRIPTOR={fields:{data:{type:"bytes",id:1},data1:{type:"bytes",id:2}}};const lt=ut;class pt extends ot{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 pt(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new pt(e,t)}}pt.TYPE=(()=>st.getPacketType(tt,rt))(),pt.DESCRIPTOR_NAME="StringObjectPacketDataMessage",pt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};const ht=pt;class ft extends ot{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 ft(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new ft(e,t)}}ft.TYPE=(()=>st.getPacketType(nt,rt))(),ft.DESCRIPTOR_NAME="NumberObjectPacketDataMessage",ft.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};const mt=ft;class yt extends ot{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 yt(e.data&&JSON.parse(e.data),e.data1&&JSON.parse(e.data1))}static create(e,t){return new yt(e,t)}}yt.TYPE=(()=>st.getPacketType(rt,rt))(),yt.DESCRIPTOR_NAME="ObjectObjectPacketDataMessage",yt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};const gt=yt;class bt extends ot{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1}}static fromJSON(e){return new bt(e.data&&JSON.parse(e.data),e.data1)}static create(e,t){return new bt(e,t)}}bt.TYPE=(()=>st.getPacketType(rt,et))(),bt.DESCRIPTOR_NAME="ObjectBufferPacketDataMessage",bt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};const Ot=bt;class wt extends ot{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new wt(e.data,e.data1)}static create(e,t){return new wt(e,t)}}wt.TYPE=(()=>st.getPacketType(tt,tt))(),wt.DESCRIPTOR_NAME="StringStringPacketDataMessage",wt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};const vt=wt;class It extends ot{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new It(e.data,e.data1)}static create(e,t){return new It(e,t)}}It.TYPE=(()=>st.getPacketType(tt,nt))(),It.DESCRIPTOR_NAME="StringNumberPacketDataMessage",It.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"uint32",id:2}}};const St=It;class Pt extends ot{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new Pt(e.data,e.data1)}static create(e,t){return new Pt(e,t)}}Pt.TYPE=(()=>st.getPacketType(nt,nt))(),Pt.DESCRIPTOR_NAME="NumberNumberPacketDataMessage",Pt.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"uint32",id:2}}};const kt=Pt;class At extends ot{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new At(e.data,e.data1)}static create(e,t){return new At(e,t)}}At.TYPE=(()=>st.getPacketType(nt,tt))(),At.DESCRIPTOR_NAME="NumberStringPacketDataMessage",At.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};const _t=At,Tt=(()=>[at,dt,lt,ht,mt,gt,Ot,vt,St,kt,_t].reduce(((e,t)=>(e[t.TYPE]=t,e)),{}))();class Ct extends a{constructor(e,t,n,r="/",s){super(),this.type=e,this.data=t,this.id=n,this.nsp=r,this.options=null!=s?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=f.encode(this.options),t=f.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 Ct(e.type-10*t,f.decode(e.data,Tt[t]),e.id,e.nsp,e.options?f.decode(e.options,Ze):new Ze)}static create(e,t={}){var n;const r=st.getPacketType(st.getType(e.data[0]),st.getType(null!==(n=e.data[1])&&void 0!==n?n:e.data[0]));return new Ct(e.type,Tt[r].create(e.data[0],e.data[1]),e.id,e.nsp,new Ze(t.flags,t.rooms,t.except))}}Ct.TYPE=10,Ct.DESCRIPTOR_NAME="PacketMessage",Ct.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}}};const jt=Ct;class Et{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 f.encode(jt.create(o,s))}decode(e){const t=f.decode(e,jt);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 Dt=(()=>[xe.EVENT,xe.ACK,xe.BINARY_ACK,xe.BINARY_EVENT])();class xt extends Re{constructor(e){super(),this._packetParser=null!=e?e:new Et}encode(e){if(Dt.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 Rt extends Ve{constructor(e){super(),this._packetParser=null!=e?e:new Et}add(e){if(!st.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 Nt{constructor(e,t){this._context=e,this._deferredPromise=function(){let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return{resolve:e,reject:t,promise:n}}(),this.timeout=setTimeout((()=>this.error(new We("Request timeout.",this._context))),t)}get promise(){return this._deferredPromise.promise}response(e){this._deferredPromise.resolve(e)}error(e){this._deferredPromise.reject(e)}}class Vt{constructor(e){this._context=e,this._requests=new Set}async send(e,t=45e3){const n=this._createRequest(t);try{return e(n),await n.promise}finally{this._finishRequest(n)}}errorAll(e){for(const t of this._requests)t.error(e)}waitForAllRequests(e=45e3){return this._waitForRequests(e)}_createRequest(e){const t=new Nt(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 Mt={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"};class Bt extends((0,n.ObservableMixin)()){constructor(e,t,n,r,s){if(super(),this._connectionAttempt=0,this._token=t,this._options=null!=n?n:{},this._connectionProvider=null!=r?r:He,this._userFactory=null!=s?s:S.get,this._requestsManager=new Vt(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=Ye(e.replace(/^(?!(?:\w+:)?\/\/)/,"https://")),this.set("state",Mt.DISCONNECTED),this.set("socketId",void 0),this.set("me",void 0),this.on("change:state",(async(e,t,n)=>{var r;if(this._debugEvent("ws-gw:change:state",n),n!==Bt.STATE_CONNECTED){if(n===Bt.STATE_DISCONNECTED)return this._requestsManager.errorAll(new We("Not connected.",this))}else try{this.me=await this._userFactory.call(S,this,null===(r=this._socketAuth)||void 0===r?void 0:r.userId)}catch(e){}}),{priority:Bt._CHANGE_STATE_EVENT_PRIORITY}),this.on("error",((e,t)=>{this._options.onError?this._options.onError(t):console.error(t)}))}get sessionId(){return this.socketId}waitForAllRequests(e){return this._requestsManager.waitForAllRequests(e)}disconnect(){var e;this.state!==Mt.DISCONNECTED&&(null===(e=this._socket)||void 0===e||e.disconnect(),this._socket=void 0,this.state=Mt.DISCONNECTED)}async reconnect(){this._socket||this.state!==Mt.DISCONNECTED||(await this._token.refreshToken(),await this._connect())}static async connect(e,t="local.cs.dev:443/ws-v2",n={},r=He,s=S.get){const o=new Bt(t,e,n,r,s);return await o._connect(),o}_sendRequest(e,t,n){if(!e)throw new We("`serviceName` must be provided.",this);if(this.state!==Bt.STATE_CONNECTED)throw new We("Not connected.",this);if(!this._socketAuth||!this._socketAuth.isAuthenticated)throw new We("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 Ke(n,this,this._socket)),this._channels.get(n)}_connect(){return new Promise(((e,t)=>{const n=this._setupSocket();!this.socketId&&n.io.on("reconnect_error",(()=>{this._debugEvent("reconnect_error"),this._reconnectionAttemptError(t)})),n.once("connect",(async()=>{this._debugEvent("once-connect");try{await this._onConnect(),e()}catch(e){t(e)}})),n.connect()}))}_getPortByProtocol(e){return["http:","ws:"].includes(e)?80:443}_setupSocket(){var e;if(this._socket)return this._socket;const t=this._url.port||this._getPortByProtocol(this._url.protocol),n=(this._url.protocol||"https:")+"//"+this._url.hostname+":"+t,r=this._url.pathname.match(/^\/.*\/ws/)?this._url.pathname.split("/ws")[0]:"",s=this._connectionProvider(n,{parser:{Encoder:xt,Decoder:Rt},path:r+"/ws-v2/ws",transports:["websocket"],timeout:void 0!==this._options.timeout?this._options.timeout:5e3,reconnection:void 0===this._options.autoReconnect||this._options.autoReconnect,reconnectionDelay:1e3,reconnectionDelayMax:5e3,rejectUnauthorized:void 0===this._options.rejectUnauthorized||this._options.rejectUnauthorized,query:{version:"52.6.11"},agent:null!==(e=this._options.agent)&&void 0!==e&&e,closeOnBeforeunload:!1});return this.state=Mt.CONNECTING,s.on("connect",(()=>{this._debugEvent("connect"),this.socketId=s.id})),s.on("connect_error",(e=>{this._debugEvent("connect_error",e)})),s.on("disconnect",(()=>{this._debugEvent("disconnect"),this._onDisconnect()})),s.io.on("reconnect",(async()=>{this._debugEvent("reconnect"),await this._onReconnect()})),s.io.on("reconnect_attempt",(e=>{this._debugEvent("reconnect_attempt",e),this.state=Mt.CONNECTING,this._connectionAttempt=e})),s.on("unauthorized",(e=>{this._debugEvent("unauthorized"),this._onUnauthorized(e)})),s.on("authenticationRequest",(async e=>{this._debugEvent("authenticationRequest",e.attempt),await this._onReconnect()})),this._socket=s,s}_emit(e,t){const n=this._socket;return this._requestsManager.send((r=>{n.emit(e,t,((e,t)=>{if(e)return r.error(Qe.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=Mt.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=Mt.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(We.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",Qe.fromPublicError(e))}async _authenticate(e){try{this._debugEvent("authenticate:start");const t=await this._emit(2,{token:e});this._debugEvent("authenticate:success","envId: "+t.environmentId+", userId: "+t.userId),this._addAuthData(t.environmentId,t.userId)}catch(e){throw this._debugEvent("authenticate:error",e.message),this._removeAuthData(),e}}_isDebugModeEnabled(){var e;return!!n.global.window.localStorage&&"true"===(null!==(e=n.global.window.localStorage.getItem("csClientDebugMode"))&&void 0!==e?e:"false").toLowerCase()}}Bt.STATE_DISCONNECTED=(()=>Mt.DISCONNECTED)(),Bt.STATE_CONNECTING=(()=>Mt.CONNECTING)(),Bt.STATE_CONNECTED=(()=>Mt.CONNECTED)(),Bt._CHANGE_STATE_EVENT_PRIORITY=(()=>n.priorities.get("highest")+999999)();const Ut=Bt;class Jt extends a{constructor(e){super(),this.bundleVersion=e}toJSON(){return{bundleVersion:this.bundleVersion}}static fromJSON(e){return new Jt(e.bundleVersion)}}Jt.TYPE="131",Jt.READABLE_TYPE_NAME="isEditorBundleUploaded",Jt.DESCRIPTOR_NAME="IsEditorBundleUploadedMessage",Jt.DESCRIPTOR={fields:{bundleVersion:{type:"string",id:1}}};const qt=Jt;class Lt extends a{constructor(e){super(),this.isUploaded=e}toJSON(){return{isUploaded:this.isUploaded}}static fromJSON(e){return new Lt(e.isUploaded)}}Lt.DESCRIPTOR_NAME="IsEditorBundleUploadedResponse",Lt.DESCRIPTOR={fields:{isUploaded:{type:"bool",id:1}}};const Gt=Lt;class Ht extends((0,n.EmitterMixin)()){static async isBundleUploaded(e,t){const n=new qt(t);if(e.state!==Mt.CONNECTED)throw new We("WebSocket Gateway is not connected.",e);const r=await e._sendRequest(Ht._SERVICE,qt.TYPE,f.encode(n));return f.decode(r,Gt).isUploaded}}Ht._SERVICE=13;const Yt=Ht;class zt extends a{constructor(e,t){super(),this.documentId=e,this.revisionId=t}toJSON(){return{documentId:this.documentId,revisionId:this.revisionId}}static fromJSON(e){return new zt(e.documentId,e.revisionId)}}zt.TYPE="123",zt.READABLE_TYPE_NAME="getRevision",zt.DESCRIPTOR_NAME="RevisionHistoryGetRevisionMessage",zt.DESCRIPTOR={fields:{documentId:{type:"string",id:1},revisionId:{type:"string",id:2}}};const Ft=zt;class Kt extends o{static create(e){return{revisionId:e.id,name:e.name,creatorId:e.creatorId,createdAt:e.createdAt,fromVersion:e.fromVersion,toVersion:e.toVersion,isEmptyCurrent:e.isEmptyCurrent,diffData:e.diffData?JSON.stringify(e.diffData):void 0,attributes:e.attributes,authorsIds:e.authorsIds}}static toJSON(e){var t;return{revisionId:e.revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.stringify(e.authorsIds):void 0,diffData:e.diffData,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):void 0,toVersion:e.toVersion,fromVersion:e.fromVersion,isEmptyCurrent:e.isEmptyCurrent}}static fromJSON(e){return{revisionId:(e={...e}).revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.parse(e.authorsIds):void 0,diffData:e.diffData,createdAt:e.createdAt?new Date(e.createdAt):void 0,attributes:e.attributes?JSON.parse(e.attributes):void 0,toVersion:e.toVersion,fromVersion:e.fromVersion,isEmptyCurrent:e.isEmptyCurrent}}static toObject(e){return function(e){for(const[t,n]of Object.entries(e))void 0===n&&delete e[t];return e}({id:e.revisionId,name:e.name,creatorId:e.creatorId,createdAt:e.createdAt,fromVersion:e.fromVersion,toVersion:e.toVersion,isEmptyCurrent:e.isEmptyCurrent,diffData:e.diffData?JSON.parse(e.diffData):void 0,attributes:e.attributes,authorsIds:e.authorsIds})}}Kt.DESCRIPTOR_NAME="RevisionDescriptor",Kt.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}}};const Wt=Kt;class Qt extends a{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 Wt.toJSON(this)}toObject(){return Wt.toObject(this)}static create(e){return new Qt(e.revisionId,e.name,e.creatorId,e.authorsIds,e.createdAt,e.diffData,e.attributes,e.fromVersion,e.toVersion,e.isEmptyCurrent)}static fromJSON(e){return new Qt(e.revisionId,e.name,e.creatorId,e.authorsIds?JSON.parse(e.authorsIds):void 0,e.createdAt?new Date(e.createdAt):void 0,e.diffData,e.attributes?JSON.parse(e.attributes):void 0,e.fromVersion,e.toVersion,e.isEmptyCurrent)}}Qt.DESCRIPTOR_NAME="RevisionHistoryGetRevisionResponse",Qt.DESCRIPTOR=Wt.DESCRIPTOR;const $t=Qt;class Zt extends a{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(Wt.toJSON)}}toObject(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(Wt.toObject)}}static create(e){return new Zt(e.documentId,e.requestId,e.revisions.map(Wt.create))}static fromJSON(e){return new Zt(e.documentId,e.requestId,e.revisions.map(Wt.fromJSON))}}Zt.TYPE="124",Zt.READABLE_TYPE_NAME="updateRevisions",Zt.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsMessage",Zt.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};const Xt=Zt;class en extends a{constructor(e){super(),this.requestId=e}toJSON(){return{requestId:this.requestId}}static fromJSON(e){return new en(e.requestId)}}en.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsResponse",en.DESCRIPTOR={fields:{requestId:{type:"uint32",id:1}}};const tn=en;class nn extends a{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new nn(e.documentId)}}nn.TYPE="121",nn.READABLE_TYPE_NAME="connectToRevisionHistory",nn.DESCRIPTOR_NAME="RevisionHistoryConnectMessage",nn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};const rn=nn;class sn extends a{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(Wt.toJSON)}}toObject(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(Wt.toObject)}}static fromJSON(e){return new sn(e.channel,e.requestId,e.revisions.map(Wt.fromJSON))}}sn.DESCRIPTOR_NAME="RevisionHistoryConnectResponse",sn.DESCRIPTOR={fields:{channel:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};const on=sn;class an extends a{constructor(e,t){super(),this.documentId=e,this.requestId=t}toJSON(){return{documentId:this.documentId,requestId:this.requestId}}static fromJSON(e){return new an(e.documentId,e.requestId)}}an.TYPE="122",an.READABLE_TYPE_NAME="reconnectToRevisionHistory",an.DESCRIPTOR_NAME="RevisionHistoryReconnectMessage",an.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2}}};const cn=an;class dn extends We{constructor(e,t){super(e+" Service is not connected.",t)}}class un extends((0,n.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}connect(e){return this._isConnected?Promise.resolve():this._connect(e,new rn(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 We("Cannot reconnect to already connected service.",e);return this._connect(e,new cn(this._documentId,t))}async updateRevisions(e,t){const n=Xt.create({documentId:this._documentId,requestId:t,revisions:e}),r=await this._sendRequest(Xt.TYPE,n),{requestId:s}=f.decode(r,tn);return s}async getRevision(e){const t=new Ft(this._documentId,e),n=await this._sendRequest(Ft.TYPE,t);return f.decode(n,$t).toObject()}async _connect(e,t){if(e.state!==Mt.CONNECTED)throw new We("WebSocket Gateway is not connected.",e);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(12,t.constructor.TYPE,f.encode(t)),{channel:r,requestId:s,revisions:o}=f.decode(n,on).toObject();return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Ut._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(un._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(Xt.TYPE),((e,t)=>{const{documentId:n,requestId:r,revisions:s}=f.decode(t,Xt).toObject();this.fire("revisionsUpdated",{documentId:n,requestId:r,revisionsData:s})}))}_onWsGatewayStateChange(e){e===Mt.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new dn("Revision History",this);return this._wsGateway._sendRequest(12,e,f.encode(t))}}un._SERVICE=12;const ln=un;class pn extends a{constructor(e,t,n,r={},s=null,o=null){super(),this.id=e,this.documentId=t,this.type=n,this.data=r,this.originalSuggestionId=s,this.attributes=o}toJSON(){return{id:this.id,documentId:this.documentId,type:this.type,data:JSON.stringify(this.data),originalSuggestionId:this.originalSuggestionId,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){var t;return new pn(e.id,e.documentId,e.type,JSON.parse(e.data),null!==(t=e.originalSuggestionId)&&void 0!==t?t:null,e.attributes?JSON.parse(e.attributes):null)}}pn.TYPE="101",pn.READABLE_TYPE_NAME="addSuggestion",pn.DESCRIPTOR_NAME="TrackChangesAddSuggestionMessage",pn.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}}};const hn=pn;class fn extends a{constructor(e,t,n,r,s,o,i={},a=null){super(),this.id=e,this.authorId=t,this.type=n,this.hasComments=s,this.state=o,this.data=i,this.attributes=a,this.createdAt=r?new Date(r):void 0}toJSON(){var e;return{id:this.id,authorId:this.authorId,type:this.type,createdAt:null===(e=this.createdAt)||void 0===e?void 0:e.toISOString(),data:JSON.stringify(this.data),hasComments:this.hasComments,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new fn(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}fn.DESCRIPTOR_NAME="TrackChangesAddSuggestionResponse",fn.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}}};const mn=fn;class yn extends a{constructor(e,t){super(),this.id=e,this.documentId=t}toJSON(){return{id:this.id,documentId:this.documentId}}static fromJSON(e){return new yn(e.id,e.documentId)}}yn.TYPE="103",yn.READABLE_TYPE_NAME="getSuggestion",yn.DESCRIPTOR_NAME="TrackChangesGetSuggestionMessage",yn.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2}}};const gn=yn;class bn extends a{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 bn(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}bn.DESCRIPTOR_NAME="TrackChangesGetSuggestionResponse",bn.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}}};const On=bn;class wn extends a{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new wn(e.documentId)}}wn.TYPE="102",wn.READABLE_TYPE_NAME="getAllSuggestions",wn.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionMessage",wn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};const vn=wn;class In extends o{static toJSON(e){var t;return{...e,data:e.data?JSON.stringify(e.data):e.data,attributes:e.attributes?JSON.stringify(e.attributes):e.attributes,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(e){return{...e,data:e.data?JSON.parse(e.data):e.data,attributes:e.attributes?JSON.parse(e.attributes):e.attributes,createdAt:e.createdAt?new Date(e.createdAt):void 0}}}In.DESCRIPTOR_NAME="SuggestionDescriptor",In.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"}}};const Sn=In;class Pn extends a{constructor(e,t){super(),this._suggestions=e,this._suggestionsV2=t,this.suggestions=(null==t?void 0:t.length)?t:e}toJSON(){var e,t;return{suggestions:null===(e=this._suggestions)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),suggestionsV2:null===(t=this._suggestionsV2)||void 0===t?void 0:t.map(Sn.toJSON)}}static fromJSON(e){var t,n;return new Pn(null===(t=e.suggestions)||void 0===t?void 0:t.map(An),null===(n=e.suggestionsV2)||void 0===n?void 0:n.map(Sn.fromJSON))}}Pn.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionsResponse",Pn.DESCRIPTOR={fields:{suggestions:{type:"string",rule:"repeated",id:1},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:2}}};const kn=Pn;function An(e){const t=JSON.parse(e);return t.createdAt=t.createdAt?new Date(t.createdAt):void 0,t}class _n extends a{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 _n(e.id,e.documentId,e.hasComments,e.isHasCommentsModified,e.state,e.attributes?JSON.parse(e.attributes):null)}}_n.TYPE="104",_n.READABLE_TYPE_NAME="updateSuggestion",_n.DESCRIPTOR_NAME="TrackChangesUpdateSuggestionMessage",_n.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}}};const Tn=_n;class Cn extends a{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Cn(e.documentId)}}Cn.TYPE="105",Cn.READABLE_TYPE_NAME="connectToSuggestions",Cn.DESCRIPTOR_NAME="TrackChangesConnectMessage",Cn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};const jn=Cn;class En extends a{constructor(e,t,n){super(),this.channel=e,this._suggestions=t,this._suggestionsV2=n,this.suggestions=(null==n?void 0:n.length)?n:t}toJSON(){var e,t;return{channel:this.channel,suggestions:null===(e=this._suggestions)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),suggestionsV2:null===(t=this._suggestionsV2)||void 0===t?void 0:t.map(Sn.toJSON)}}static fromJSON(e){var t,n;return new En(e.channel,null===(t=e.suggestions)||void 0===t?void 0:t.map((e=>JSON.parse(e))),null===(n=e.suggestionsV2)||void 0===n?void 0:n.map(Sn.fromJSON))}}En.DESCRIPTOR_NAME="TrackChangesConnectResponse",En.DESCRIPTOR={fields:{channel:{type:"string",id:1},suggestions:{type:"string",rule:"repeated",id:2},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:3}}};const Dn=En;class xn extends a{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 xn(e.ids,e.documentId,e.state)}}xn.TYPE="106",xn.READABLE_TYPE_NAME="batchUpdateSuggestionsState",xn.DESCRIPTOR_NAME="TrackChangesBatchUpdateSuggestionsStateMessage",xn.DESCRIPTOR={fields:{ids:{type:"string",rule:"repeated",id:1},documentId:{type:"string",id:2},state:{type:"string",id:3}}};const Rn=xn;class Nn extends((0,n.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==Mt.CONNECTED)throw new We("WebSocket Gateway is not connected.",e);const t=new jn(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(10,jn.TYPE,f.encode(t)),r=f.decode(n,Dn);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Ut._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 hn(e,this._documentId,t,n,r,s),i=await this._sendRequest(hn.TYPE,o);return f.decode(i,mn)}async get(e,t=1){const n=new gn(e,this._documentId);try{const e=await this._sendRequest(gn.TYPE,n);return f.decode(e,On)}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 Qe.fromPublicError(n)}var r}async getAll(){const e=new vn(this._documentId),t=await this._sendRequest(vn.TYPE,e),{suggestions:n}=f.decode(t,kn);return n}async update(e,t={}){const{hasComments:n,state:r,attributes:s}=t,o=void 0!==n,i=new Tn(e,this._documentId,n,o,r,s);await this._sendRequest(Tn.TYPE,i)}async batchUpdateState(e){const t=new Rn(e.ids,this._documentId,e.state);await this._sendRequest(Rn.TYPE,t)}_connectToChannel(e,t){this._channel=e._getChannel(Nn._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(Tn.TYPE),((e,t)=>{const n=f.decode(t,Tn);this.fire("suggestionUpdated",n)}))}_onWsGatewayStateChange(e){e===Mt.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new dn("Track Changes",this);return this._wsGateway._sendRequest(10,e,f.encode(t))}}Nn._SERVICE=10;const Vn=Nn,Mn={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Bn;const Un=new Uint8Array(16);function Jn(){if(!Bn&&(Bn="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Bn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bn(Un)}const qn=[];for(let e=0;e<256;++e)qn.push((e+256).toString(16).slice(1));function Ln(e,t=0){return qn[e[t+0]]+qn[e[t+1]]+qn[e[t+2]]+qn[e[t+3]]+"-"+qn[e[t+4]]+qn[e[t+5]]+"-"+qn[e[t+6]]+qn[e[t+7]]+"-"+qn[e[t+8]]+qn[e[t+9]]+"-"+qn[e[t+10]]+qn[e[t+11]]+qn[e[t+12]]+qn[e[t+13]]+qn[e[t+14]]+qn[e[t+15]]}const Gn=function(e,t,n){if(Mn.randomUUID&&!t&&!e)return Mn.randomUUID();const r=(e=e||{}).random||(e.rng||Jn)();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 Ln(r)};class Hn extends a{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 Hn(e.channel,e.sockets.map((e=>({id:e.session,userId:e.user,role:e.role,permissions:e.permissions}))))}}Hn.DESCRIPTOR_NAME="SessionsConnectResponse",Hn.DESCRIPTOR={fields:{channel:{type:"string",id:1},sockets:{rule:"repeated",type:"SessionsSocketDescriptor",id:2}}};const Yn=Hn;class zn extends a{constructor(e,t){super(),this.id=e,this.sessionType=t}toJSON(){return{id:this.id,sessionType:this.sessionType}}static fromJSON(e){return new zn(e.id,e.sessionType)}}zn.TYPE="31",zn.READABLE_TYPE_NAME="getConnectedSockets",zn.DESCRIPTOR_NAME="SessionsConnectMessage",zn.DESCRIPTOR={fields:{id:{type:"string",id:1},sessionType:{type:"uint32",id:2}}};const Fn=zn;class Kn extends a{constructor(e,t,n,r){super(),this.id=e,this.userId=t,this.role=n,this.permissions=r}toJSON(){var e,t,n;return{id:this.id,userId:null!==(e=this.userId)&&void 0!==e?e:void 0,role:null!==(t=this.role)&&void 0!==t?t:void 0,permissions:null!==(n=this.permissions)&&void 0!==n?n:void 0}}static fromJSON(e){return new Kn(e.id,e.userId,e.role,e.permissions)}}Kn.TYPE="32",Kn.READABLE_TYPE_NAME="connectSocket",Kn.DESCRIPTOR_NAME="SocketConnectMessage",Kn.DESCRIPTOR={fields:{id:{type:"string",id:1},userId:{type:"string",id:2},role:{type:"string",id:3},permissions:{rule:"repeated",type:"string",id:4}}};const Wn=Kn;class Qn extends a{constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new Qn(e.id)}}Qn.TYPE="33",Qn.READABLE_TYPE_NAME="disconnectSocket",Qn.DESCRIPTOR_NAME="SocketDisconnectMessage",Qn.DESCRIPTOR={fields:{id:{type:"string",id:1}}};const $n=Qn,Zn=class extends n.Collection{constructor(e,t){super({idProperty:"id"}),this._id=e,this._sessionType=t,this._handlers=new Map,this._eventsQueue=[],this._isRunning=!1}async connect(e){this._wsGateway=e,this.stopListening(e,"change:state");const t=new Fn(this._id,this._sessionType);let n;try{const e=await this._wsGateway._sendRequest(3,Fn.TYPE,f.encode(t));n=f.decode(e,Yn)}catch(e){n=new Yn(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 S.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 S,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:Ut._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,Wn.TYPE,(async t=>{const n=f.decode(t,Wn);if(-1===this.getIndex(n.id)){const t={id:n.id,role:n.role,permissions:n.permissions};n.userId&&(t.user=await S.get(e,n.userId)),super.add(t)}})),this._addHandler(this._channel,$n.TYPE,(e=>{const t=f.decode(e,$n);-1!==this.getIndex(t.id)&&super.remove(t.id)})))}async _onWsGatewayStateChange(e){e===Ut.STATE_DISCONNECTED&&this.disconnect(!1),e===Ut.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 Xn{static async getConnectedSessions(e,t,n){const r=new Zn(t,n);return await r.connect(e),r}}class er extends a{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 er(e.id,e.buffers,e.types,e.bundleVersion,e.lastOperationId)}}er.TYPE="11",er.READABLE_TYPE_NAME="connectToDocument",er.DESCRIPTOR_NAME="CollaborativeEditingConnectMessage",er.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}}};const tr=er;class nr{static prepareMetadataForOperations(e,t){if(!(e&&e.length&&t&&t.length))return[];const n=[];let r=0;for(const s of e)if(0!==s){if(!t[r])throw new Error("Missing metadata for a operation");n.push(t[r]),r++}else n.push(n[n.length-1]);return n}static removeUnnecessaryMetadata(e,t){if(!(e&&e.length&&t&&t.length))return[];const n=[];for(let r=0;r<e.length;r++)if(0!==e[r]){if(!t[r])throw new Error("Missing metadata for a operation");n.push(t[r])}return n}}class rr extends o{static toJSON({createdAt:e,...t}){const n={...t};return(null==e?void 0:e.toISOString)&&(n.createdAt=e.toISOString()),n}static fromJSON({createdAt:e,...t}){const n={...t};return e&&(n.createdAt=new Date(e)),n}}rr.DESCRIPTOR_NAME="OperationMetadataDescriptor",rr.DESCRIPTOR={fields:{userId:{type:"string",id:1},type:{type:"string",id:2},createdAt:{type:"string",id:3}}};const sr=rr;class or extends a{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:nr.removeUnnecessaryMetadata(this.types,this.metadata).map(sr.toJSON),lastOperationId:this.lastOperationId}}static fromJSON(e){return new or(e.id,e.buffers,e.types,e.baseVersion,nr.prepareMetadataForOperations(e.types,e.metadata).map(sr.fromJSON),e.lastOperationId)}}or.TYPE="13",or.READABLE_TYPE_NAME="updateDocument",or.DESCRIPTOR_NAME="CollaborativeEditingUpdateMessage",or.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}}};const ir=or;class ar extends a{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 ar(e.id,e.lastKnowVersion,e.bundleVersion)}}ar.TYPE="12",ar.READABLE_TYPE_NAME="reconnectToDocument",ar.DESCRIPTOR_NAME="CollaborativeEditingReconnectMessage",ar.DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},lastKnowVersion:{type:"uint32",id:3}}};const cr=ar;class dr extends a{constructor(e,t=[],n=[],r=[],s="",o=null){super(),this.version=e,this.buffers=t,this.types=n,this.metadata=r,this.lastOperationId=s,this.lastOperationAcceptedAt=o}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.version-this.types.length,lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt}}get wereChangesApplied(){var e;return!(null===(e=this.types)||void 0===e?void 0:e.length)}toJSON(){return{version:this.version,buffers:this.buffers,types:this.types,metadata:nr.removeUnnecessaryMetadata(this.types,this.metadata).map(sr.toJSON),lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt instanceof Date?this.lastOperationAcceptedAt.toISOString():this.lastOperationAcceptedAt}}static fromJSON(e){return new dr(e.version,e.buffers,e.types,nr.prepareMetadataForOperations(e.types,e.metadata).map(sr.fromJSON),e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}static create(e){return new dr(e.version,e.buffers,e.types,e.metadata,e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}}dr.DESCRIPTOR_NAME="CollaborativeEditingResponse",dr.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}}};const ur=dr;class lr extends a{constructor(e,t,n=[],r=[],s=0,o=[],i=null,a="",c="",d=null){super(),this.channel=e,this.version=t,this.buffers=n,this.types=r,this.offset=s,this.metadata=o,this.initData=i,this.sessionId=a,this.lastOperationId=c,this.sessionCreatedAt=d}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.version-this.types.length,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt}}get wereChangesApplied(){var e;return!(null===(e=this.types)||void 0===e?void 0:e.length)&&null===this.initData}toJSON(){var e;return{channel:this.channel,version:this.version,sessionId:this.sessionId,buffers:this.buffers,types:this.types,offset:this.offset,metadata:nr.removeUnnecessaryMetadata(this.types,this.metadata).map(sr.toJSON),initData:null!==(e=this.initData)&&void 0!==e?e:"",isInitialized:"string"==typeof this.initData,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt?this.sessionCreatedAt.toISOString():null}}static create(e){return new lr(e.channel,e.version,e.buffers,e.types,e.offset,e.metadata,e.initData,e.sessionId,e.lastOperationId,e.sessionCreatedAt)}static fromJSON(e){var t;let n=null;return!0===e.isInitialized?n=null!==(t=e.initData)&&void 0!==t?t:"":"boolean"!=typeof e.isInitialized&&e.initData&&(n=e.initData),lr.create({channel:e.channel,version:e.version,buffers:e.buffers,types:e.types,offset:e.offset,metadata:nr.prepareMetadataForOperations(e.types,e.metadata).map(sr.fromJSON),initData:n,sessionId:e.sessionId,lastOperationId:e.lastOperationId,sessionCreatedAt:e.sessionCreatedAt?new Date(e.sessionCreatedAt):null})}}lr.DESCRIPTOR_NAME="CollaborativeEditingConnectResponse",lr.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:sr.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}}};const pr=lr;class hr extends a{constructor(e,t){super(),this.lastDocumentSession=e,this.currentDocumentSession=t}get data(){var e,t,n,r,s;return{lastDocumentSessionId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.id,lastDocumentSessionOperationId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(s=this.currentDocumentSession)||void 0===s?void 0:s.lastOperationId}}toJSON(){var e,t,n,r,s;return{lastDocumentSessionId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.id,lastDocumentSessionOperationId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(s=this.currentDocumentSession)||void 0===s?void 0:s.lastOperationId}}static fromJSON(e){const t=e.lastDocumentSessionId?{id:e.lastDocumentSessionId,lastOperationId:e.lastDocumentSessionOperationId}:void 0,n=e.currentDocumentSessionId?{lastOperationId:e.currentDocumentSessionOperationId,version:e.currentDocumentSessionVersion,id:e.currentDocumentSessionId}:void 0;return new hr(t,n)}}hr.DESCRIPTOR_NAME="GetDocumentDetailsResponse",hr.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}}};const fr=hr;class mr extends a{constructor(e){super(),this.documentId=e}get data(){return{documentId:this.documentId}}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new mr(e.documentId)}}mr.TYPE="14",mr.READABLE_TYPE_NAME="getDocumentDetails",mr.DESCRIPTOR_NAME="GetDocumentDetailsMessage",mr.DESCRIPTOR={fields:{documentId:{type:"string",id:1},environmentId:{type:"string",id:2}}};const yr=mr;class gr extends((0,n.EmitterMixin)()){constructor(e,t){if(super(),!e)throw new TypeError('Param "bundleVersion" must be provided.');this._id=null!=t?t:Gn(),this._isConnected=!1,this._bundleVersion=e}getId(){return this._id}isConnected(){return this._isConnected}connect(e,t={buffers:[],types:[]},n){const r=new tr(this.getId(),t.buffers,t.types,this._bundleVersion,n);return this._connect(e,r)}reconnect(e,t){if(this.isConnected())throw new We("Cannot reconnect to already connected service.",e);return this._connect(e,new cr(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 yr(this.getId());if(!this._wsGateway)throw new dn("Collaborative Editing",this);const t=await this._wsGateway._sendRequest(1,yr.TYPE,f.encode(e));return f.decode(t,fr)}async sendOperations(e,t,n){if(!e||!e.types||!e.types.length)throw new We("Cannot send empty update.",this._wsGateway);const r="number"==typeof t?t:parseInt(t);if(!Number.isInteger(r)||r<0)throw new We("Base version not provided.",this._wsGateway);const s=new ir(this.getId(),e.buffers,e.types,r,[],n);if(!this._wsGateway||!this._isConnected)throw new dn("Collaborative Editing",this);const o=await this._wsGateway._sendRequest(1,ir.TYPE,f.encode(s));return f.decode(o,ur)}async getConnectedSessions(){if(!this._isConnected)throw new dn("Collaborative Editing",this);return this._connectedSessions||(this._connectedSessions=await Xn.getConnectedSessions(this._wsGateway,this._id,1)),this._connectedSessions}static getConnectedSessions(e,t){return Xn.getConnectedSessions(e,t,1)}async _connect(e,t){if(this.isConnected())return;if(e.state!==Ut.STATE_CONNECTED)throw new We("WebSocket Gateway is not connected.",e);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(1,t.constructor.TYPE,f.encode(t)),r=f.decode(n,pr);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Ut._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(ir.TYPE),((e,t)=>{const n=f.decode(t,ir);this.fire("operationsReceived",n.baseVersion,n.data,n.metadata)}))}_onWsGatewayStateChange(e){e===Ut.STATE_DISCONNECTED&&this.disconnect()}}gr._SERVICE=1;const br=gr;class Or extends o{static toJSON(e){var t;return{...e,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null}}static fromJSON(e){return{...e,createdAt:new Date(e.createdAt),attributes:e.attributes?JSON.parse(e.attributes):null}}}Or.DESCRIPTOR_NAME="CommentDescriptor",Or.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"}}};const wr=Or;class vr extends o{static toJSON(e){var t,n,r,s,o;return{...e,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),deletedAt:null===(n=e.deletedAt)||void 0===n?void 0:n.toISOString(),resolvedAt:null===(r=e.resolvedAt)||void 0===r?void 0:r.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null,context:e.context?JSON.stringify(e.context):e.context,comments:null===(s=e.comments)||void 0===s?void 0:s.map(wr.toJSON),unlinkedAt:null===(o=e.unlinkedAt)||void 0===o?void 0:o.toISOString()}}static fromJSON(e){var t;return{...e,createdAt:e.createdAt?new Date(e.createdAt):void 0,deletedAt:e.deletedAt?new Date(e.deletedAt):void 0,resolvedAt:e.resolvedAt?new Date(e.resolvedAt):void 0,attributes:e.attributes?JSON.parse(e.attributes):null,context:e.context?JSON.parse(e.context):void 0,comments:null===(t=e.comments)||void 0===t?void 0:t.map(wr.fromJSON),unlinkedAt:e.unlinkedAt?new Date(e.unlinkedAt):void 0}}}vr.DESCRIPTOR_NAME="CommentsThreadDescriptor",vr.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}}};const Ir=vr;class Sr extends a{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?Ir.toJSON(this.commentThread):void 0}}static fromJSON(e){return new Sr(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?Ir.fromJSON(e.commentThread):void 0)}}Sr.TYPE="91",Sr.READABLE_TYPE_NAME="addComment",Sr.DESCRIPTOR_NAME="CommentsV2AddCommentMessage",Sr.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}}};const Pr=Sr;class kr extends a{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 kr(e.commentThreadId,e.commentId,e.createdAt)}}kr.DESCRIPTOR_NAME="CommentsV2AddCommentResponse",kr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},createdAt:{type:"string",id:3}}};const Ar=kr;class _r extends a{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new _r(e.documentId)}}_r.TYPE="92",_r.READABLE_TYPE_NAME="connectToComment",_r.DESCRIPTOR_NAME="CommentsV2ConnectMessage",_r.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};const Tr=_r;class Cr extends a{constructor(e,t,n){super(),this.channel=e,this._threads=t,this._threadsV2=n,this.threads=(null==n?void 0:n.length)?n:t}toJSON(){var e,t;return{channel:this.channel,threads:null===(e=this._threads)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),threadsV2:null===(t=this._threadsV2)||void 0===t?void 0:t.map(Ir.toJSON)}}static fromJSON(e){var t,n;return new Cr(e.channel,null===(t=e.threads)||void 0===t?void 0:t.map((e=>JSON.parse(e))),null===(n=e.threadsV2)||void 0===n?void 0:n.map(Ir.fromJSON))}}Cr.DESCRIPTOR_NAME="CommentsV2ConnectResponse",Cr.DESCRIPTOR={fields:{channel:{type:"string",id:1},threads:{type:"string",rule:"repeated",id:2},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:3}}};const jr=Cr;class Er extends a{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 Er(e.documentId,e.commentThreadId,e.commentId)}}Er.TYPE="95",Er.READABLE_TYPE_NAME="removeComment",Er.DESCRIPTOR_NAME="CommentsV2RemoveCommentMessage",Er.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},documentId:{type:"string",id:3}}};const Dr=Er;class xr extends a{constructor(e,t){super(),this.documentId=e,this.commentThreadId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new xr(e.documentId,e.commentThreadId)}}xr.TYPE="97",xr.READABLE_TYPE_NAME="removeCommentThread",xr.DESCRIPTOR_NAME="CommentsV2RemoveCommentThreadMessage",xr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};const Rr=xr;class Nr extends a{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?Ir.toJSON(this.commentThread):void 0}}static fromJSON(e){return new Nr(e.documentId,e.commentThreadId,e.commentId,e.content,e.attributes?JSON.parse(e.attributes):null,e.isAttributesUpdated,e.commentThread?Ir.fromJSON(e.commentThread):void 0)}}Nr.TYPE="96",Nr.READABLE_TYPE_NAME="updateComment",Nr.DESCRIPTOR_NAME="CommentsV2UpdateCommentMessage",Nr.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}}};const Vr=Nr;class Mr extends a{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId}}static fromJSON(e){return new Mr(e.commentThreadId,e.documentId)}}Mr.TYPE="93",Mr.READABLE_TYPE_NAME="getComment",Mr.DESCRIPTOR_NAME="CommentsV2GetCommentThreadMessage",Mr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};const Br=Mr;class Ur extends a{constructor(e,t,n,r,s,o,i,a,c,d){super(),this.commentThreadId=e,this._comments=t,this._commentsV2=n,this.resolvedBy=s,this.comments=(null==n?void 0:n.length)?n:t,this.createdAt=i?new Date(i):void 0,this.deletedAt="string"==typeof a?new Date(a):a,this.resolvedAt="string"==typeof c?new Date(c):c,this.unlinkedAt="string"==typeof d?new Date(d):d,this.attributes="string"==typeof r?JSON.parse(r):r,this.context="string"==typeof o?JSON.parse(o):o}toJSON(){var e,t,n,r,s,o;return{commentThreadId:this.commentThreadId,comments:null===(e=this._comments)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),commentsV2:null===(t=this._commentsV2)||void 0===t?void 0:t.map(wr.toJSON),attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,context:this.context?JSON.stringify(this.context):this.context,resolvedBy:this.resolvedBy,createdAt:null===(n=this.createdAt)||void 0===n?void 0:n.toISOString(),deletedAt:null===(r=this.deletedAt)||void 0===r?void 0:r.toISOString(),resolvedAt:null===(s=this.resolvedAt)||void 0===s?void 0:s.toISOString(),unlinkedAt:null===(o=this.unlinkedAt)||void 0===o?void 0:o.toISOString()}}static fromJSON(e){var t,n;return new Ur(e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((e=>function(e){const t=JSON.parse(e);return{...t,createdAt:new Date(t.createdAt)}}(e))),null===(n=e.commentsV2)||void 0===n?void 0:n.map(wr.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)}}Ur.DESCRIPTOR_NAME="CommentsV2GetCommentThreadResponse",Ur.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}}};const Jr=Ur;class qr extends a{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new qr(e.documentId)}}qr.TYPE="94",qr.READABLE_TYPE_NAME="getDocumentThreads",qr.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsMessage",qr.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};const Lr=qr;class Gr extends a{constructor(e,t){super(),this._threads=e,this._threadsV2=t,this.threads=(null==t?void 0:t.length)?t:e}toJSON(){var e,t;return{threads:null===(e=this._threads)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),threadsV2:null===(t=this._threadsV2)||void 0===t?void 0:t.map(Ir.toJSON)}}static fromJSON(e){var t,n;return new Gr(null===(t=e.threads)||void 0===t?void 0:t.map((e=>function(e){var t;const n=JSON.parse(e),r={...n};return n.comments&&(r.comments=null===(t=n.comments)||void 0===t?void 0:t.map((e=>({...e,createdAt:new Date(e.createdAt)})))),r}(e))),null===(n=e.threadsV2)||void 0===n?void 0:n.map(Ir.fromJSON))}}Gr.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsResponse",Gr.DESCRIPTOR={fields:{threads:{type:"string",rule:"repeated",id:1},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:2}}};const Hr=Gr;class Yr extends o{static toJSON(e){var t;return{commentId:e.commentId,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(e){return{commentId:e.commentId,createdAt:new Date(e.createdAt)}}}Yr.DESCRIPTOR_NAME="CommentThreadAddedCommentDescriptor",Yr.DESCRIPTOR={fields:{commentId:{id:1,type:"string"},createdAt:{id:2,type:"string"}}};const zr=Yr;class Fr extends a{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=>zr.toJSON(e)))}}static fromJSON(e){return new Fr(e.commentThreadId,e.createdAt,e.comments.map((e=>zr.fromJSON(e))))}}Fr.DESCRIPTOR_NAME="CommentsV2AddCommentThreadResponse",Fr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},createdAt:{type:"string",id:2},comments:{type:"CommentThreadAddedCommentDescriptor",rule:"repeated",id:3}}};const Kr=Fr;class Wr extends a{constructor(e,t,n=[],r,s=null,o=null,i=null,a=null,c=null){super(),this.documentId=e,this.commentThreadId=t,this.comments=n,this.context=r,this.resolvedBy=s,this.attributes=c,this.createdAt=o?new Date(o):"",this.resolvedAt=i?new Date(i):"",this.deletedAt=a?new Date(a):""}toJSON(){var e;return{commentThreadId:this.commentThreadId,context:this.context?JSON.stringify(this.context):this.context,documentId:this.documentId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt instanceof Date?this.resolvedAt.toISOString():this.resolvedAt,deletedAt:this.deletedAt instanceof Date?this.deletedAt.toISOString():this.deletedAt,createdAt:this.createdAt instanceof Date?this.createdAt.toISOString():this.createdAt,attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,comments:null===(e=this.comments)||void 0===e?void 0:e.map((e=>wr.toJSON(e)))}}static fromJSON(e){var t;return new Wr(e.documentId,e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((t=>wr.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)}}Wr.TYPE="140",Wr.READABLE_TYPE_NAME="addCommentThread",Wr.DESCRIPTOR_NAME="CommentsV2AddCommentThreadMessage",Wr.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}}};const Qr=Wr;class $r extends a{constructor(e,t,n,r){super(),this.commentThreadId=e,this.documentId=t,this.resolvedBy=n,this.resolvedAt=r?new Date(r):void 0}toJSON(){var e;return{documentId:this.documentId,commentThreadId:this.commentThreadId,resolvedBy:this.resolvedBy,resolvedAt:null===(e=this.resolvedAt)||void 0===e?void 0:e.toISOString()}}static fromJSON(e){return new $r(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}$r.TYPE="142",$r.READABLE_TYPE_NAME="resolveCommentThread",$r.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadMessage",$r.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedBy:{type:"string",id:3},resolvedAt:{type:"string",id:4}}};const Zr=$r;class Xr extends a{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new Xr(e.commentThreadId,e.documentId)}}Xr.TYPE="141",Xr.READABLE_TYPE_NAME="reopenCommentThread",Xr.DESCRIPTOR_NAME="CommentsV2ReopenCommentThreadMessage",Xr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};const es=Xr;class ts extends a{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 ts(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)}}ts.TYPE="143",ts.READABLE_TYPE_NAME="updateCommentThread",ts.DESCRIPTOR_NAME="CommentsV2UpdateCommentThreadMessage",ts.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}}};const ns=ts;class rs extends a{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 rs(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}rs.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadResponse",rs.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4}}};const ss=rs;class os extends((0,n.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==Mt.CONNECTED)throw new We("WebSocket Gateway is not connected.",e);const t=new Tr(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(9,Tr.TYPE,f.encode(t)),{channel:r,threads:s}=f.decode(n,jr);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Ut._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 Pr(this._documentId,e,n,t,void 0,void 0,r),o=await this._sendRequest(Pr.TYPE,s);return f.decode(o,Ar)}async updateComment(e,t,n,r){const s=void 0!==r,o=new Vr(this._documentId,e,t,n,r,s);await this._sendRequest(Vr.TYPE,o)}async removeComment(e,t){const n=new Dr(this._documentId,e,t);await this._sendRequest(Dr.TYPE,n)}async removeCommentThread(e){const t=new Rr(this._documentId,e);await this._sendRequest(Rr.TYPE,t)}async addCommentThread(e){var t;const n=new Qr(this._documentId,e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((t=>({...t,documentId:this._documentId,commentThreadId:e.commentThreadId}))),e.context,e.resolvedBy,e.createdAt,e.resolvedAt,e.deletedAt,e.attributes),r=await this._sendRequest(Qr.TYPE,n);return f.decode(r,Kr)}async resolveCommentThread(e){const t=new Zr(e,this._documentId),n=await this._sendRequest(Zr.TYPE,t);return f.decode(n,ss)}async reopenCommentThread(e){const t=new es(e,this._documentId);await this._sendRequest(es.TYPE,t)}async updateCommentThread(e){const t=new ns(e.commentThreadId,this._documentId,e.context,e.attributes,e.unlinkedAt);await this._sendRequest(ns.TYPE,t)}async getCommentThread(e,t=1){const n=new Br(e,this._documentId);try{const e=await this._sendRequest(Br.TYPE,n),t=f.decode(e,Jr);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 Qe.fromPublicError(n)}var r}async getDocumentThreads(){const e=new Lr(this._documentId),t=await this._sendRequest(Lr.TYPE,e),{threads:n}=f.decode(t,Hr);return{threads:n}}async getConnectedSessions(){if(!this._isConnected)throw new dn("Comments",this);return this._connectedSessions||(this._connectedSessions=await Xn.getConnectedSessions(this._wsGateway,this._documentId,9)),this._connectedSessions}_connectToChannel(e,t){this._channel=e._getChannel(os._SERVICE,t),this._channel&&(this.listenTo(this._channel,this._channel.getEventName(Pr.TYPE),((e,t)=>{const n=f.decode(t,Pr);this.fire("commentAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(Dr.TYPE),((e,t)=>{const n=f.decode(t,Dr);this.fire("commentRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(Vr.TYPE),((e,t)=>{const n=f.decode(t,Vr);this.fire("commentUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(Rr.TYPE),((e,t)=>{const n=f.decode(t,Rr);this.fire("commentThreadRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(Qr.TYPE),((e,t)=>{const n=f.decode(t,Qr);this.fire("commentThreadAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(ns.TYPE),((e,t)=>{const n=f.decode(t,ns);this.fire("commentThreadUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(Zr.TYPE),((e,t)=>{const n=f.decode(t,Zr);this.fire("commentThreadResolved",n)})),this.listenTo(this._channel,this._channel.getEventName(es.TYPE),((e,t)=>{const n=f.decode(t,es);this.fire("commentThreadReopened",n)})))}_onWsGatewayStateChange(e){e===Mt.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new dn("Comments",this);return this._wsGateway._sendRequest(9,e,f.encode(t))}}os._SERVICE=9;const is=os,as=ds;function cs(){const e=["websocketgateway-missing-token","4757650vnhjkx","CONNECTING","4239396smRBVp","create","CloudServices","Connected users limit exceeded","bind","cloudServices.connectionTimeout","context","stopListening","real-time-collaboration","catch","webSocketUrl","state","get","cloudServices.requestTimeout","_reconnectionStack","code","cloudservices-reconnection-error","define","isPremiumPlugin","from","token","_shouldPluginsReconnect","initialReconnectionInterval","function","connection","plugins","showWarning","delete","connected","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.","reconnect","WebSocketGateway","set","websocketgateway-missing-websocket-url","change:me","has","removeFromReconnectionStack","CONNECTED","listenTo","error","_isBrowserOffline","websocketgateway-invalid-plugin-interface","pluginName","addToReconnectionStack","6345955ioZeHv","591891JQpqqE","DISCONNECTED","websocketgateway-plugin-already-registered","1744323iatKia","cloudservices-init","config","all","requires","init","_domEmitter","connect","isOfficialPlugin","online","disconnect","constructor","7951512akLqAU","add","then","destroy","limitExceeded","_reconnect","offline","2244786ZBsSRS","isInReconnectionStack"];return(cs=function(){return e})()}function ds(e,t){const n=cs();return(ds=function(e,t){return n[e-=417]})(e,t)}!function(e){const t=ds,n=e();for(;;)try{if(891505===-parseInt(t(424))/1+parseInt(t(446))/2+parseInt(t(427))/3+parseInt(t(451))/4+parseInt(t(449))/5+-parseInt(t(439))/6+-parseInt(t(423))/7)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(cs);class us extends t.ContextPlugin{static get[as(431)](){return[as(453),r.Notification]}static get[as(421)](){return as(482)}static get[as(435)](){return!0}static get[as(469)](){return!0}constructor(e){const t=as;super(e),this[t(483)](t(462),Mt[t(488)]),this[t(483)](t(419),!1),this[t(465)]=new Set,this[t(472)]=!1,this[t(433)]=Object[t(452)](n.DomEmitterMixin)}[as(432)](){const e=as,t=this[e(457)],s=t[e(476)][e(463)](e(453)),o=t[e(476)][e(463)](r.Notification);if(!s[e(471)])throw new n.CKEditorError(e(448),this);if(!s[e(461)])throw new n.CKEditorError(e(484),this);return this[e(433)][e(417)](window,e(445),(()=>this[e(419)]=!0)),this[e(433)][e(417)](window,e(436),(()=>this[e(419)]=!1)),this[e(457)][e(429)][e(468)](e(456),10),this[e(457)][e(429)][e(468)](e(464),20),us[e(482)][e(434)](s[e(471)],s[e(461)],{timeout:1e3*this[e(457)][e(429)][e(463)](e(456)),requestTimeout:1e3*this[e(457)][e(429)][e(463)](e(464))})[e(441)]((t=>{const r=e;if(this[r(475)]=t,this[r(455)](r(462)).to(t,r(462),this,r(419),((e,t)=>(r(479)!==e&&(this[r(472)]=!0),t||e!==Mt[r(488)]?Mt[r(425)]:this[r(462)]==Mt[r(425)]&&this[r(472)]?(this[r(472)]=!1,this[r(444)](),Mt[r(450)]):Mt[r(488)]))),this[r(475)].on(r(418),((e,t)=>{const s=r;if(s(443)!==t[s(466)])throw console[s(418)](t),new n.CKEditorError(s(428),null,{originalError:t});o[s(477)](s(480),{title:s(454),namespace:s(459)})})),!t.me)return new Promise((e=>t.on(r(485),e)))}))[e(460)]((t=>{const r=e;throw console[r(418)](t),new n.CKEditorError(r(428),null,{originalError:t})}))}[as(422)](e){const t=as;if(t(474)!=typeof e[t(481)])throw new n.CKEditorError(t(420),this);if(this[t(447)](e))throw new n.CKEditorError(t(426),this,{name:e[t(438)][t(421)]});this[t(465)][t(440)](e)}[as(487)](e){const t=as;this[t(465)][t(478)](e)}[as(447)](e){const t=as;return this[t(465)][t(486)](e)}[as(444)](){const e=as;return this[e(475)][e(481)]()[e(441)]((()=>Promise[e(430)](Array[e(470)](this[e(465)],(t=>t[e(481)]())))))[e(441)]((()=>this[e(462)]=Mt[e(488)]))[e(460)]((t=>{const r=e;throw console[r(418)](t),new n.CKEditorError(r(467),this[r(457)])}))}[as(437)](){const e=as;this[e(475)]&&this[e(475)][e(437)](),this[e(462)]=Mt[e(425)],this[e(433)][e(458)]()}[as(442)](){const e=as;this[e(437)](),super[e(442)]()}}us[as(482)]=Ut,us[as(473)]=1e3;const ls=us;var ps=__webpack_require__(211);function hs(e,t){const n=fs();return(hs=function(e,t){return n[e-=201]})(e,t)}function fs(){const e=["user","84JgYglH","_handleSessionAdd","23219417NSsfGZ","get","_uniqueUsersCount","context","values","mySessionId","fire","1471128libsBi","getUserRole","sessionAdd:","plugins","addUser","getUserBySessionId","channelSessions","isPremiumPlugin","init","sessionId","isOfficialPlugin","165678UheKJk","has","assign","4247244ByOQsg","unregister","remove","getUserSessions","11704tBqCTf","sessions-unregister-not-exist","pluginName","allConnectedUsers","getUser","_users","register","38nVVNMo","connection","1393nWmzFi","add","state","sessions-register-already-registered","size","connected","stopListening","listenTo","12mECNbu","5fLSRoQ","Sessions","channelConnectedUsers","role","_createUser","_registeredSessions","set","17009jWJnUK","change:state","orderNumber","30MZBimT","isMe","forEach","delete","_handleSessionRemove","clear","defineMe","requires","11819170MfZtAz"];return(fs=function(){return e})()}const ms=hs;!function(e){const t=hs,n=e();for(;;)try{if(824757===-parseInt(t(215))/1*(-parseInt(t(262))/2)+parseInt(t(248))/3*(parseInt(t(228))/4)+-parseInt(t(208))/5*(parseInt(t(237))/6)+-parseInt(t(264))/7*(-parseInt(t(255))/8)+-parseInt(t(251))/9*(parseInt(t(218))/10)+-parseInt(t(226))/11+parseInt(t(207))/12*(parseInt(t(230))/13))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(fs);class ys extends t.ContextPlugin{static get[ms(257)](){return ms(209)}static get[ms(247)](){return!0}static get[ms(244)](){return!0}static get[ms(225)](){return[ls,ps.Users]}constructor(e){const t=ms;super(e),this[t(243)]=new Map,this[t(210)]=new Map,this[t(258)]=new n.Collection,this[t(213)]=new Map,this[t(232)]=0,this[t(260)]=this[t(233)][t(240)][t(231)](ps.Users)}[ms(245)](){const e=ms,t=this[e(233)][e(240)][e(231)](ls);this[e(206)](t,e(216),((t,n,r)=>{const s=e;if(s(204)!==r)this[s(243)][s(220)]((e=>e[s(223)]())),this[s(210)][s(220)]((e=>e[s(223)]())),this[s(258)][s(223)]();else for(const[e,t]of this[s(213)])for(const n of t)this[s(229)](e,n)})),this[e(212)](t[e(263)].me,!0)}[ms(261)](e,t){const r=ms;if(this[r(213)][r(249)](e))throw new n.CKEditorError(r(202),null,{channelId:e});this[r(213)][r(214)](e,t),this[r(243)][r(214)](e,new n.Collection),this[r(210)][r(214)](e,new n.Collection),this[r(206)](t,r(265),((t,n)=>this[r(229)](e,n))),this[r(206)](t,r(253),((t,n)=>this[r(222)](e,n)));for(const n of t)this[r(229)](e,n)}[ms(252)](e){const t=ms;if(!this[t(213)][t(249)](e))throw new n.CKEditorError(t(256),null,{channelId:e});const r=this[t(213)][t(231)](e);this[t(205)](r);for(const n of r)t(204)===this[t(233)][t(240)][t(231)](ls)[t(201)]&&this[t(222)](e,n);this[t(213)][t(221)](e),this[t(243)][t(221)](e),this[t(210)][t(221)](e)}get[ms(235)](){const e=ms;return this[e(233)][e(240)][e(231)](ls)[e(263)][e(246)]}[ms(242)](e){const t=ms;for(const n of this[t(243)][t(234)]())for(const r of n)if(r.id===e)return r[t(227)]}[ms(254)](e,t){const n=ms,r=t?[this[n(243)][n(231)](t)]:this[n(243)][n(234)](),s=new Set;for(const t of r)for(const r of t)r[n(227)].id===e.id&&s[n(265)](r.id);return s}[ms(238)](e){const t=ms;for(const n of this[t(243)][t(234)]())for(const r of n)if(r[t(227)]===e)return r[t(211)]}[ms(229)](e,t){const n=ms;if(n(204)!==this[n(233)][n(240)][n(231)](ls)[n(201)])return;const r=t[n(227)],s=this[n(260)][n(259)](r.id)||this[n(212)](r),o=Object[n(250)]({},t,{user:s});this[n(243)][n(231)](e)[n(265)](o);const i=this[n(210)][n(231)](e);i[n(249)](s.id)||i[n(265)](s),this[n(258)][n(249)](s.id)||this[n(258)][n(265)](s,s[n(219)]?0:void 0),this[n(236)](n(239)+e,{channelId:e,session:o})}[ms(222)](e,t){const n=ms;if(n(204)!==this[n(233)][n(240)][n(231)](ls)[n(201)])return;const r=this[n(210)][n(231)](e),s=t[n(227)];s.id&&(this[n(243)][n(231)](e)[n(253)](t.id),r[n(249)](s.id)&&!this[n(254)](s,e)[n(203)]&&r[n(253)](s.id),this[n(258)][n(231)](s.id)&&!this[n(254)](s)[n(203)]&&this[n(258)][n(253)](s.id))}[ms(212)](e,t){const n=ms,r=this[n(260)][n(241)](e);return t&&this[n(260)][n(224)](e.id),r[n(217)]=this[n(232)]++,r}}var gs=__webpack_require__(673),bs=__webpack_require__.n(gs),Os=__webpack_require__(545),ws=__webpack_require__.n(Os),vs=__webpack_require__(262),Is=__webpack_require__.n(vs),Ss=__webpack_require__(667),Ps=__webpack_require__.n(Ss),ks=__webpack_require__(357),As=__webpack_require__.n(ks),_s=__webpack_require__(535),Ts={attributes:{"data-cke":!0}};Ts.setAttributes=Ps(),Ts.insert=Is().bind(null,"head"),Ts.domAPI=ws(),Ts.insertStyleElement=As();bs()(_s.A,Ts);_s.A&&_s.A.locals&&_s.A.locals;function Cs(){const e=["rootName","markerToHighlight","textContent","init","deletionPosition","user:position","document","getMarkerClass","385YPABmE","mapper","createUIElement","UserMarkers","conversion","applyOperation","outerHTML","getCustomProperty","pluginName","isOfficialPlugin","has","isCollapsed","requires","add","markerToElement","false","contenteditable","render","fromRange","getStart","mouseleave","element","for","get","name","checkChild","innerHTML","toDomElement","editingDowncast","newRange","getSelectionClass","marker","1OQoDPL","oldRange","size","root","24ZcFfgv","afterInit","521290iojyGP","user:","user:range","addEventListener","clear","removeMarker","view","stopListening","ck-user__marker-tooltip","ck-user__selection","plugins","schema","addMarker","removeClass","listenTo","keydown","update:user:range","undo","markers","type","1319130YTOnsK",'<span class="ck-user__marker-line" contenteditable="false"><span class="ck-user__marker-dot"></span></span>',"selection","getContainedElement","classList","2734588WfmkoW","model","8481907timeAo","setAttribute","highest","createUserMarkerOperations","setCustomProperty","markerNameToElements","2143778wLyXqL","enqueueChange","ck-user__marker ","span","change","editor","nodeAfter","createElement","batch","_domEmitter","set","getUserBySessionId","delete","user:range:","getRange","ck-user__marker_hovered","360MefnNd","destroy","isInline","getAttribute","$graveyard","detach","getPositions","isSimilar","mySessionId","spellcheck","startsWith","user:position:","21069TwTnQG","getNearestSelectionRange","toRange","hasContent","hasDomSelection","start","isLimit","Escape","data-session-id","color","isDocumentOperation","createRange","isPremiumPlugin","userPositionMarker","split","getFirstRange","orderNumber","reconvertMarker","markerRange","1324595gYLSmV","parent","$text","editing","isObject","updateMarker","end","change:range","commands","markerName","tableCell","remove","mouseenter","_createdBatches"];return(Cs=function(){return e})()}const js=Es;function Es(e,t){const n=Cs();return(Es=function(e,t){return n[e-=139]})(e,t)}!function(e){const t=Es,n=e();for(;;)try{if(628101===-parseInt(t(174))/1*(-parseInt(t(213))/2)+parseInt(t(200))/3+parseInt(t(205))/4+parseInt(t(260))/5*(-parseInt(t(178))/6)+parseInt(t(207))/7+-parseInt(t(229))/8*(-parseInt(t(241))/9)+parseInt(t(180))/10*(-parseInt(t(142))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Cs);class Ds extends t.Plugin{constructor(){const e=Es;super(...arguments),this[e(222)]=new((0,n.DomEmitterMixin)())}static get[js(154)](){return[ys]}static get[js(150)](){return js(145)}static get[js(151)](){return!0}static get[js(253)](){return!0}[js(277)](){const e=js,t=this[e(218)],r=t[e(190)][e(165)](ys);t[e(146)][e(164)](e(170))[e(156)]({model:e(139),view:(n,{writer:s})=>function(t,n,r,s){const o=e,i=t[o(269)][o(255)](":")[2],a=r[o(224)](i);if(!a||i===r[o(237)])return;if(!s[o(206)][o(191)][o(167)](t[o(259)][o(246)],o(262)))return;const c={class:o(215)+a[o(250)][o(141)](),"data-name":a[o(166)],"data-session-id":i},d=s[o(206)][o(198)][o(165)](t[o(269)])[o(161)](),u=d[o(219)],l=s[o(206)][o(191)];if(u&&l[o(264)](u)&&l[o(231)](u)&&!s[o(206)][o(198)][o(165)](o(226)+i)[o(227)]()[o(153)])return;const p=d[o(261)];return s[o(206)][o(191)][o(247)](p)&&!s[o(206)][o(244)](p)&&(c[o(158)]=!1),function(e,t,n){const r=o,s=e[r(144)](r(216),t);return e[r(211)](r(254),!0,s),s[r(159)]=function(e){const t=r,s=this[t(169)](e),o=document[t(220)](t(216));return o[t(204)][t(155)](t(188)),o[t(208)](t(158),t(157)),o[t(208)](t(238),t(157)),o[t(276)]=n[t(166)],s[t(168)]=t(201)+o[t(148)]+"",s[t(183)](t(272),(()=>{const e=t;s[e(204)][e(155)](e(228))})),s[t(183)](t(162),(()=>{const e=t;s[e(204)][e(271)](e(228))})),s},s[r(236)]=function(e){const t=r;return!(!this[t(149)](t(254))||!e[t(149)](t(254))||this[t(232)](t(249))!=e[t(232)](t(249)))},s}(n,c,a)}(n,s,r,t)}),t[e(146)][e(164)](e(170))[e(275)]({model:e(182),view:t=>function(t,n){const r=e,s=t[r(269)][r(255)](":")[2];if(s===n[r(237)])return null;const o=n[r(224)](s);return o?{id:s,classes:[r(189),o[r(250)][r(172)]()],attributes:{"data-session-id":s},priority:2e3+o[r(257)]}:{id:s,classes:[]}}(t,r)}),function(t){const n=e,r=t[n(206)],o=new Map,i=t[n(190)][n(165)](ys);r[n(198)].on(n(196),((e,a,c,d)=>{const u=n;if(!d&&o[u(165)](a[u(166)]))return o[u(165)](a[u(166)])[u(234)](),void o[u(225)](a[u(166)]);const l=a[u(166)][u(255)](":")[2];if(l===i[u(237)])return;const p=u(240)+l;r[u(198)][u(152)](p)&&t[u(263)][u(258)](p),a.on(u(267),((e,t,n)=>{const i=u;if(i(233)!=t[i(177)][i(274)]&&i(233)==a[i(227)]()[i(177)][i(274)]&&!o[i(152)](a[i(166)])){const e=r[i(191)][i(242)](n[i(278)]);if(e){const t=s.LiveRange[i(160)](e);o[i(223)](a[i(166)],t),t.on(i(267),((e,n,s)=>{const c=i;if(c(233)==t[c(177)][c(274)]){const e=r[c(191)][c(242)](s[c(278)]);e?(t[c(246)]=e[c(246)],t[c(266)]=e[c(266)]):(o[c(225)](a[c(166)]),t[c(234)]())}}))}}}))})),r[n(140)].on(n(217),(()=>{const e=n;o[e(176)]>0&&r[e(214)]({isUndoable:!1},(t=>{const n=e;for(const[e,s]of o)n(233)==r[n(198)][n(165)](e)[n(227)]()[n(177)][n(274)]&&(xs(e[n(255)](":")[2],s[n(243)](),r,t),s[n(234)]());o[n(184)]()}))}))}(t),this[e(222)][e(194)](n.global[e(140)],e(195),((n,{key:r})=>{const s=e;s(248)===r&&function(e){const t=s;e[t(263)][t(186)][t(217)]((n=>{const r=t;for(const t of e[r(206)][r(198)]){if(!t[r(166)][r(239)](r(139)))continue;const s=e[r(263)][r(143)][r(212)](t[r(166)]);if(s)for(const e of s)n[r(193)](r(228),e)}}))}(t)}),{useCapture:!0})}[js(179)](){const e=js,t=this[e(218)],n=t[e(268)][e(165)](e(197));n&&t[e(206)].on(e(147),((r,s)=>{const o=e,i=s[0];if(!i[o(251)])return;if(o(173)!=i[o(199)]||!i[o(166)][o(239)](o(181)))return;const a=i[o(221)];n[o(273)][o(152)](a)&&(i[o(171)]=i[o(175)]?t[o(206)][o(252)](i[o(175)][o(246)],i[o(175)][o(266)]):null)}),{priority:e(209)})}[js(230)](){const e=js;return this[e(222)][e(187)](),super[e(230)]()}[js(210)](){const e=js,t=this[e(218)],n=t[e(206)][e(140)],r=t[e(190)][e(165)](ys);t[e(206)][e(214)]({isUndoable:!1},(s=>{const o=e,i=o(226)+r[o(237)],a=o(240)+r[o(237)],c=t[o(206)][o(198)][o(152)](i);t[o(263)][o(186)][o(245)]?xs(r[o(237)],n[o(202)][o(256)](),t[o(206)],s):c&&(s[o(185)](i),s[o(185)](a))}))}}function xs(e,t,n,r){const s=js,o=s(226)+e,i=s(240)+e,a=t[s(203)]();let c=t[s(246)];a&&a.is(s(163),s(270))&&(c=function(e,t){const n=s;for(const r of e[n(235)]())if(t[n(191)][n(167)](r,n(262)))return r}(t,n),t=r[s(252)](c));const d=r[s(252)](c);n[s(198)][s(152)](o)?(r[s(265)](o,{range:t}),r[s(265)](i,{range:d})):(r[s(192)](o,{range:t,usingOperation:!0}),r[s(192)](i,{range:d,usingOperation:!0}))}function Rs(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 Ns=(()=>{var e=p.Reader,t=p.Writer,n=p.util,r=p.roots.default||(p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Element"},s}(),r})();class Vs{constructor(){this._protobufRoot=Ns}getDescriptor(e){return new Ms(this._protobufRoot[e])}}class Ms{constructor(e){this._protobuf=e}compress(e){const t=this._protobuf.verify(e);if(t)throw Error(t);return this._protobuf.encode(this._protobuf.create(e)).finish()}decompress(e){return this._protobuf.toObject(this._protobuf.decode(e),{oneofs:!0})}}const Bs=function(){this.__data__=[],this.size=0};const Us=function(e,t){return e===t||e!=e&&t!=t};const Js=function(e,t){for(var n=e.length;n--;)if(Us(e[n][0],t))return n;return-1};var qs=Array.prototype.splice;const Ls=function(e){var t=this.__data__,n=Js(t,e);return!(n<0)&&(n==t.length-1?t.pop():qs.call(t,n,1),--this.size,!0)};const Gs=function(e){var t=this.__data__,n=Js(t,e);return n<0?void 0:t[n][1]};const Hs=function(e){return Js(this.__data__,e)>-1};const Ys=function(e,t){var n=this.__data__,r=Js(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function zs(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}zs.prototype.clear=Bs,zs.prototype.delete=Ls,zs.prototype.get=Gs,zs.prototype.has=Hs,zs.prototype.set=Ys;const Fs=zs;const Ks=function(){this.__data__=new Fs,this.size=0};const Ws=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};const Qs=function(e){return this.__data__.get(e)};const $s=function(e){return this.__data__.has(e)};const Zs="object"==typeof global&&global&&global.Object===Object&&global;var Xs="object"==typeof self&&self&&self.Object===Object&&self;const eo=Zs||Xs||Function("return this")();const to=eo.Symbol;var no=Object.prototype,ro=no.hasOwnProperty,so=no.toString,oo=to?to.toStringTag:void 0;const io=function(e){var t=ro.call(e,oo),n=e[oo];try{e[oo]=void 0;var r=!0}catch(e){}var s=so.call(e);return r&&(t?e[oo]=n:delete e[oo]),s};var ao=Object.prototype.toString;const co=function(e){return ao.call(e)};var uo=to?to.toStringTag:void 0;const lo=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":uo&&uo in Object(e)?io(e):co(e)};const po=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const ho=function(e){if(!po(e))return!1;var t=lo(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const fo=eo["__core-js_shared__"];var mo,yo=(mo=/[^.]+$/.exec(fo&&fo.keys&&fo.keys.IE_PROTO||""))?"Symbol(src)_1."+mo:"";const go=function(e){return!!yo&&yo in e};var bo=Function.prototype.toString;const Oo=function(e){if(null!=e){try{return bo.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var wo=/^\[object .+?Constructor\]$/,vo=Function.prototype,Io=Object.prototype,So=vo.toString,Po=Io.hasOwnProperty,ko=RegExp("^"+So.call(Po).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Ao=function(e){return!(!po(e)||go(e))&&(ho(e)?ko:wo).test(Oo(e))};const _o=function(e,t){return null==e?void 0:e[t]};const To=function(e,t){var n=_o(e,t);return Ao(n)?n:void 0};const Co=To(eo,"Map");const jo=To(Object,"create");const Eo=function(){this.__data__=jo?jo(null):{},this.size=0};const Do=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var xo=Object.prototype.hasOwnProperty;const Ro=function(e){var t=this.__data__;if(jo){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return xo.call(t,e)?t[e]:void 0};var No=Object.prototype.hasOwnProperty;const Vo=function(e){var t=this.__data__;return jo?void 0!==t[e]:No.call(t,e)};const Mo=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=jo&&void 0===t?"__lodash_hash_undefined__":t,this};function Bo(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Bo.prototype.clear=Eo,Bo.prototype.delete=Do,Bo.prototype.get=Ro,Bo.prototype.has=Vo,Bo.prototype.set=Mo;const Uo=Bo;const Jo=function(){this.size=0,this.__data__={hash:new Uo,map:new(Co||Fs),string:new Uo}};const qo=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const Lo=function(e,t){var n=e.__data__;return qo(t)?n["string"==typeof t?"string":"hash"]:n.map};const Go=function(e){var t=Lo(this,e).delete(e);return this.size-=t?1:0,t};const Ho=function(e){return Lo(this,e).get(e)};const Yo=function(e){return Lo(this,e).has(e)};const zo=function(e,t){var n=Lo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Fo(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Fo.prototype.clear=Jo,Fo.prototype.delete=Go,Fo.prototype.get=Ho,Fo.prototype.has=Yo,Fo.prototype.set=zo;const Ko=Fo;const Wo=function(e,t){var n=this.__data__;if(n instanceof Fs){var r=n.__data__;if(!Co||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ko(r)}return n.set(e,t),this.size=n.size,this};function Qo(e){var t=this.__data__=new Fs(e);this.size=t.size}Qo.prototype.clear=Ks,Qo.prototype.delete=Ws,Qo.prototype.get=Qs,Qo.prototype.has=$s,Qo.prototype.set=Wo;const $o=Qo;const Zo=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e};const Xo=function(){try{var e=To(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const ei=function(e,t,n){"__proto__"==t&&Xo?Xo(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var ti=Object.prototype.hasOwnProperty;const ni=function(e,t,n){var r=e[t];ti.call(e,t)&&Us(r,n)&&(void 0!==n||t in e)||ei(e,t,n)};const ri=function(e,t,n,r){var s=!n;n||(n={});for(var o=-1,i=t.length;++o<i;){var a=t[o],c=r?r(n[a],e[a],a,n,e):void 0;void 0===c&&(c=e[a]),s?ei(n,a,c):ni(n,a,c)}return n};const si=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};const oi=function(e){return null!=e&&"object"==typeof e};const ii=function(e){return oi(e)&&"[object Arguments]"==lo(e)};var ai=Object.prototype,ci=ai.hasOwnProperty,di=ai.propertyIsEnumerable,ui=ii(function(){return arguments}())?ii:function(e){return oi(e)&&ci.call(e,"callee")&&!di.call(e,"callee")};const li=ui;const pi=Array.isArray;const hi=function(){return!1};var fi="object"==typeof exports&&exports&&!exports.nodeType&&exports,mi=fi&&"object"==typeof module&&module&&!module.nodeType&&module,yi=mi&&mi.exports===fi?eo.Buffer:void 0;const gi=(yi?yi.isBuffer:void 0)||hi;var bi=/^(?:0|[1-9]\d*)$/;const Oi=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&bi.test(e))&&e>-1&&e%1==0&&e<t};const wi=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var vi={};vi["[object Float32Array]"]=vi["[object Float64Array]"]=vi["[object Int8Array]"]=vi["[object Int16Array]"]=vi["[object Int32Array]"]=vi["[object Uint8Array]"]=vi["[object Uint8ClampedArray]"]=vi["[object Uint16Array]"]=vi["[object Uint32Array]"]=!0,vi["[object Arguments]"]=vi["[object Array]"]=vi["[object ArrayBuffer]"]=vi["[object Boolean]"]=vi["[object DataView]"]=vi["[object Date]"]=vi["[object Error]"]=vi["[object Function]"]=vi["[object Map]"]=vi["[object Number]"]=vi["[object Object]"]=vi["[object RegExp]"]=vi["[object Set]"]=vi["[object String]"]=vi["[object WeakMap]"]=!1;const Ii=function(e){return oi(e)&&wi(e.length)&&!!vi[lo(e)]};const Si=function(e){return function(t){return e(t)}};var Pi="object"==typeof exports&&exports&&!exports.nodeType&&exports,ki=Pi&&"object"==typeof module&&module&&!module.nodeType&&module,Ai=ki&&ki.exports===Pi&&Zs.process;const _i=function(){try{var e=ki&&ki.require&&ki.require("util").types;return e||Ai&&Ai.binding&&Ai.binding("util")}catch(e){}}();var Ti=_i&&_i.isTypedArray;const Ci=Ti?Si(Ti):Ii;var ji=Object.prototype.hasOwnProperty;const Ei=function(e,t){var n=pi(e),r=!n&&li(e),s=!n&&!r&&gi(e),o=!n&&!r&&!s&&Ci(e),i=n||r||s||o,a=i?si(e.length,String):[],c=a.length;for(var d in e)!t&&!ji.call(e,d)||i&&("length"==d||s&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||Oi(d,c))||a.push(d);return a};var Di=Object.prototype;const xi=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Di)};const Ri=function(e,t){return function(n){return e(t(n))}};const Ni=Ri(Object.keys,Object);var Vi=Object.prototype.hasOwnProperty;const Mi=function(e){if(!xi(e))return Ni(e);var t=[];for(var n in Object(e))Vi.call(e,n)&&"constructor"!=n&&t.push(n);return t};const Bi=function(e){return null!=e&&wi(e.length)&&!ho(e)};const Ui=function(e){return Bi(e)?Ei(e):Mi(e)};const Ji=function(e,t){return e&&ri(t,Ui(t),e)};const qi=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var Li=Object.prototype.hasOwnProperty;const Gi=function(e){if(!po(e))return qi(e);var t=xi(e),n=[];for(var r in e)("constructor"!=r||!t&&Li.call(e,r))&&n.push(r);return n};const Hi=function(e){return Bi(e)?Ei(e,!0):Gi(e)};const Yi=function(e,t){return e&&ri(t,Hi(t),e)};var zi="object"==typeof exports&&exports&&!exports.nodeType&&exports,Fi=zi&&"object"==typeof module&&module&&!module.nodeType&&module,Ki=Fi&&Fi.exports===zi?eo.Buffer:void 0,Wi=Ki?Ki.allocUnsafe:void 0;const Qi=function(e,t){if(t)return e.slice();var n=e.length,r=Wi?Wi(n):new e.constructor(n);return e.copy(r),r};const $i=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};const Zi=function(e,t){for(var n=-1,r=null==e?0:e.length,s=0,o=[];++n<r;){var i=e[n];t(i,n,e)&&(o[s++]=i)}return o};const Xi=function(){return[]};var ea=Object.prototype.propertyIsEnumerable,ta=Object.getOwnPropertySymbols;const na=ta?function(e){return null==e?[]:(e=Object(e),Zi(ta(e),(function(t){return ea.call(e,t)})))}:Xi;const ra=function(e,t){return ri(e,na(e),t)};const sa=function(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e};const oa=Ri(Object.getPrototypeOf,Object);const ia=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)sa(t,na(e)),e=oa(e);return t}:Xi;const aa=function(e,t){return ri(e,ia(e),t)};const ca=function(e,t,n){var r=t(e);return pi(e)?r:sa(r,n(e))};const da=function(e){return ca(e,Ui,na)};const ua=function(e){return ca(e,Hi,ia)};const la=To(eo,"DataView");const pa=To(eo,"Promise");const ha=To(eo,"Set");const fa=To(eo,"WeakMap");var ma="[object Map]",ya="[object Promise]",ga="[object Set]",ba="[object WeakMap]",Oa="[object DataView]",wa=Oo(la),va=Oo(Co),Ia=Oo(pa),Sa=Oo(ha),Pa=Oo(fa),ka=lo;(la&&ka(new la(new ArrayBuffer(1)))!=Oa||Co&&ka(new Co)!=ma||pa&&ka(pa.resolve())!=ya||ha&&ka(new ha)!=ga||fa&&ka(new fa)!=ba)&&(ka=function(e){var t=lo(e),n="[object Object]"==t?e.constructor:void 0,r=n?Oo(n):"";if(r)switch(r){case wa:return Oa;case va:return ma;case Ia:return ya;case Sa:return ga;case Pa:return ba}return t});const Aa=ka;var _a=Object.prototype.hasOwnProperty;const Ta=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&_a.call(e,"index")&&(n.index=e.index,n.input=e.input),n};const Ca=eo.Uint8Array;const ja=function(e){var t=new e.constructor(e.byteLength);return new Ca(t).set(new Ca(e)),t};const Ea=function(e,t){var n=t?ja(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)};var Da=/\w*$/;const xa=function(e){var t=new e.constructor(e.source,Da.exec(e));return t.lastIndex=e.lastIndex,t};var Ra=to?to.prototype:void 0,Na=Ra?Ra.valueOf:void 0;const Va=function(e){return Na?Object(Na.call(e)):{}};const Ma=function(e,t){var n=t?ja(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};const Ba=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return ja(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return Ea(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Ma(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return xa(e);case"[object Symbol]":return Va(e)}};var Ua=Object.create;const Ja=function(){function e(){}return function(t){if(!po(t))return{};if(Ua)return Ua(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const qa=function(e){return"function"!=typeof e.constructor||xi(e)?{}:Ja(oa(e))};const La=function(e){return oi(e)&&"[object Map]"==Aa(e)};var Ga=_i&&_i.isMap;const Ha=Ga?Si(Ga):La;const Ya=function(e){return oi(e)&&"[object Set]"==Aa(e)};var za=_i&&_i.isSet;const Fa=za?Si(za):Ya;var Ka="[object Arguments]",Wa="[object Function]",Qa="[object Object]",$a={};$a[Ka]=$a["[object Array]"]=$a["[object ArrayBuffer]"]=$a["[object DataView]"]=$a["[object Boolean]"]=$a["[object Date]"]=$a["[object Float32Array]"]=$a["[object Float64Array]"]=$a["[object Int8Array]"]=$a["[object Int16Array]"]=$a["[object Int32Array]"]=$a["[object Map]"]=$a["[object Number]"]=$a[Qa]=$a["[object RegExp]"]=$a["[object Set]"]=$a["[object String]"]=$a["[object Symbol]"]=$a["[object Uint8Array]"]=$a["[object Uint8ClampedArray]"]=$a["[object Uint16Array]"]=$a["[object Uint32Array]"]=!0,$a["[object Error]"]=$a[Wa]=$a["[object WeakMap]"]=!1;const Za=function e(t,n,r,s,o,i){var a,c=1&n,d=2&n,u=4&n;if(r&&(a=o?r(t,s,o,i):r(t)),void 0!==a)return a;if(!po(t))return t;var l=pi(t);if(l){if(a=Ta(t),!c)return $i(t,a)}else{var p=Aa(t),h=p==Wa||"[object GeneratorFunction]"==p;if(gi(t))return Qi(t,c);if(p==Qa||p==Ka||h&&!o){if(a=d||h?{}:qa(t),!c)return d?aa(t,Yi(a,t)):ra(t,Ji(a,t))}else{if(!$a[p])return o?t:{};a=Ba(t,p,c)}}i||(i=new $o);var f=i.get(t);if(f)return f;i.set(t,a),Fa(t)?t.forEach((function(s){a.add(e(s,n,r,s,t,i))})):Ha(t)&&t.forEach((function(s,o){a.set(o,e(s,n,r,o,t,i))}));var m=l?void 0:(u?d?ua:da:d?Hi:Ui)(t);return Zo(m||t,(function(s,o){m&&(s=t[o=s]),ni(a,o,e(s,n,r,o,t,i))})),a};const Xa=function(e){return Za(e,5)};const ec=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const tc=function(e){return this.__data__.has(e)};function nc(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Ko;++t<n;)this.add(e[t])}nc.prototype.add=nc.prototype.push=ec,nc.prototype.has=tc;const rc=nc;const sc=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};const oc=function(e,t){return e.has(t)};const ic=function(e,t,n,r,s,o){var i=1&n,a=e.length,c=t.length;if(a!=c&&!(i&&c>a))return!1;var d=o.get(e),u=o.get(t);if(d&&u)return d==t&&u==e;var l=-1,p=!0,h=2&n?new rc:void 0;for(o.set(e,t),o.set(t,e);++l<a;){var f=e[l],m=t[l];if(r)var y=i?r(m,f,l,t,e,o):r(f,m,l,e,t,o);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!sc(t,(function(e,t){if(!oc(h,t)&&(f===e||s(f,e,n,r,o)))return h.push(t)}))){p=!1;break}}else if(f!==m&&!s(f,m,n,r,o)){p=!1;break}}return o.delete(e),o.delete(t),p};const ac=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n};const cc=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var dc=to?to.prototype:void 0,uc=dc?dc.valueOf:void 0;const lc=function(e,t,n,r,s,o,i){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new Ca(e),new Ca(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Us(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=ac;case"[object Set]":var c=1&r;if(a||(a=cc),e.size!=t.size&&!c)return!1;var d=i.get(e);if(d)return d==t;r|=2,i.set(e,t);var u=ic(a(e),a(t),r,s,o,i);return i.delete(e),u;case"[object Symbol]":if(uc)return uc.call(e)==uc.call(t)}return!1};var pc=Object.prototype.hasOwnProperty;const hc=function(e,t,n,r,s,o){var i=1&n,a=da(e),c=a.length;if(c!=da(t).length&&!i)return!1;for(var d=c;d--;){var u=a[d];if(!(i?u in t:pc.call(t,u)))return!1}var l=o.get(e),p=o.get(t);if(l&&p)return l==t&&p==e;var h=!0;o.set(e,t),o.set(t,e);for(var f=i;++d<c;){var m=e[u=a[d]],y=t[u];if(r)var g=i?r(y,m,u,t,e,o):r(m,y,u,e,t,o);if(!(void 0===g?m===y||s(m,y,n,r,o):g)){h=!1;break}f||(f="constructor"==u)}if(h&&!f){var b=e.constructor,O=t.constructor;b==O||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof O&&O instanceof O||(h=!1)}return o.delete(e),o.delete(t),h};var fc="[object Arguments]",mc="[object Array]",yc="[object Object]",gc=Object.prototype.hasOwnProperty;const bc=function(e,t,n,r,s,o){var i=pi(e),a=pi(t),c=i?mc:Aa(e),d=a?mc:Aa(t),u=(c=c==fc?yc:c)==yc,l=(d=d==fc?yc:d)==yc,p=c==d;if(p&&gi(e)){if(!gi(t))return!1;i=!0,u=!1}if(p&&!u)return o||(o=new $o),i||Ci(e)?ic(e,t,n,r,s,o):lc(e,t,c,n,r,s,o);if(!(1&n)){var h=u&&gc.call(e,"__wrapped__"),f=l&&gc.call(t,"__wrapped__");if(h||f){var m=h?e.value():e,y=f?t.value():t;return o||(o=new $o),s(m,y,n,r,o)}}return!!p&&(o||(o=new $o),hc(e,t,n,r,s,o))};const Oc=function e(t,n,r,s,o){return t===n||(null==t||null==n||!oi(t)&&!oi(n)?t!=t&&n!=n:bc(t,n,r,s,e,o))};const wc=function(e,t){return Oc(e,t)};function vc(e,t){const n=Xa(e);return n.path[n.path.length-1]+=t,n}function Ic(e,t){return e.root===t.root&&wc(e.path,t.path)}function Sc(e){kc(e,(e=>("main"==e.root?(e.rootMain=!0,delete e.root):"$graveyard"==e.root&&(e.rootGraveyard=!0,delete e.root),e)))}function Pc(e){kc(e,(e=>(e.rootMain?(e.root="main",delete e.rootMain):e.rootGraveyard&&(e.root="$graveyard",delete e.rootGraveyard),e)))}function kc(e,t){for(const n in e){const r=e[n];"nodes"!==n&&po(r)&&(r.path&&(r.root||r.rootMain||r.rootGraveyard)?e[n]=t(r):kc(r,t))}return e}class Ac{constructor(e,t,n){this._id=e,this._operationName=t,this._protobufDescriptor=n}compress(e,t){const n=t.shift();return Sc(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());Pc(n),n.__className=this._operationName,e.push(n)}}class _c extends Ac{compress(e,t){const n=t.shift();return this._serializeOneOf("oldValue",n),this._serializeOneOf("newValue",n),Sc(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),Pc(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 Tc extends Ac{compress(e,t){const n=t.shift();return this._serializeNodesAttributes(n.nodes),Sc(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),Pc(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 Cc extends Ac{decompress(e,t){super.decompress(e,t);const n=e[e.length-1];n.oldRange||(n.oldRange=null),n.newRange||(n.newRange=null)}}class jc extends Ac{compress(e,t){return t.shift(),e.types.push(this._id),!0}decompress(e,t){t.types.shift(),e.push({__className:this._operationName})}}class Ec extends Cc{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 Dc{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=Xa(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 xc extends Dc{_combineNext(e,t){return t.nodes[0].data+=e.nodes[0].data,t}_splitCurrent(e){const t=Xa(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=vc(e.position,o),t}_compareOperations(e,t){if(this._checkOperation(e)&&this._checkOperation(t)){const n=e.nodes[0].data.length,r=Ic(vc(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 Rc extends Dc{_combineNext(e,t){return t.howMany++,t.sourcePosition=Xa(e.sourcePosition),t}_splitCurrent(e){const t=Xa(e);return e.howMany--,t.howMany=1,t.sourcePosition=vc(t.sourcePosition,e.howMany),t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(Ic(vc(e.sourcePosition,-1),t.sourcePosition)&&Ic(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 Nc extends Dc{_combineNext(e,t){return t.howMany++,t}_splitCurrent(e){const t=Xa(e);return t.howMany=1,e.howMany--,t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(Ic(e.sourcePosition,t.sourcePosition)&&Ic(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 Vc extends Dc{compress(e,t){if(!this._compareOperations(t[0],t[1]))return!1;const n=t.shift();return n.oldRange=null,n.newRange&&Ic(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=Xa(n.newRange.start));const r=Xa(n);r.newRange&&(r.newRange.start.stickiness="toNone",r.newRange.end=Xa(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 Mc{constructor(){this._compressorById=new Map,this._compressorByName=new Map,this._protobufFactory=new Vs;const e=this._protobufFactory.getDescriptor("MarkerOperation");this._registerCompressor(1,"NoOperation",new jc(1,"NoOperation",void 0)),this._registerOperationCompressor(10,"AttributeOperation",_c),this._registerOperationCompressor(11,"InsertOperation",Tc),this._registerOperationCompressor(12,"MarkerOperation",Cc),this._registerOperationCompressor(13,"MergeOperation",Ac),this._registerOperationCompressor(14,"MoveOperation",Ac),this._registerOperationCompressor(15,"RenameOperation",Ac),this._registerOperationCompressor(16,"RootAttributeOperation",_c),this._registerOperationCompressor(17,"SplitOperation",Ac),this._registerCompressor(18,"CommentMarkerOperation",new Ec(18,"MarkerOperation",e,"comment")),this._registerCompressor(19,"SuggestionMarkerOperation",new Ec(19,"MarkerOperation",e,"suggestion")),this._registerOperationCompressor(20,"RootOperation",Ac),this._registerActionCompressor(100,"TypingAction",xc),this._registerActionCompressor(101,"DeletingAction",Rc),this._registerActionCompressor(102,"ForwardDeletingAction",Nc),this._registerActionCompressor(103,"UserSelectionAction",Vc)}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)}}function Bc(e,t){const n=Jc();return(Bc=function(e,t){return n[e-=227]})(e,t)}const Uc=Bc;function Jc(){const e=["realtimecollaborationclient-init-service-incorrect-server-operation","batch","_handleReconnectionResponse","2019904sXYvNh","forEach","_updateServerHistory","disconnect","channelSessions","lastOperationAcceptedAt","config","getRoot","createRoot","root","affectsData","attributes","_getOperationsFromInitData","cloud-services-internal-error: Not connected.","isReadOnly","404","push","off","multi-root-editor-root-attributes-no-root","setPermissions","entries","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.","cs:removeUser","finally","CommentsOnly","destroy","collaboration.channelId","_handleReconnectionError","The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.","CollaborativeEditingService","_operationToId","The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.","_waitUntilSynced","removeFromReconnectionStack","unregister","sessionAdd:","_isPendingUpdate","4627776vDkmSV","_handleReceivedOperations","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.","document","_sendBufferedOperationsDelayId","showWarning","round","high","_shouldSendSelectionUpdate","offset","change:range","getOperations","rootsAttributes","PENDING_ACTION_SENDING_DATA","createPositionAt","getOperationAuthor","_initSessionsHandling","decompress","get","roots","createRange","realtimecollaborationclient-init-session-connection-error","_setUpDataInit","sessionId","suppressErrorInCollaboration","editing","_isInit","getIdOfTheLastOperation","view","reconnect","addToReconnectionStack","sessionCreatedAt","Notification","rtc-destroyed","78fYSLOy","sendOperations","_knownOperations","pluginName","change:_isEditingAllowed","keys","markers","cloudDocumentVersion","_channelId","lastOperationId","addOperation","ready","__className","_disconnectionOperations","realtimecollaborationclient-handleserverresponse","_loadRoot","236838HZgtCB","state","size","reconnection: flushed session","getUser","cloudServices.bundleVersion","isUndoneOperation","init","getMany","_initThrowingOnDataSet","addUser","editor","selection","isEnabled","newRange","connect","RealTimeCollaborationClient","523zZWPIc","409","Permissions","realtimecollaborationclient-init-service-internal-error","createdAt","error","_sendBufferedOperations","_connectAfterSessionHasBeenFlushed","slice","_isLoaded","_currentBufferDelay","_disconnectService","then","message","version","lastDocumentSession","connected","collaboration","has","define","operationsReceived","_compressor","affectedSelectable","path","getDocumentDetails","_saveOperationInBuffer","isDocumentOperation","disableReadOnlyMode","createPositionFromPath","type","2550960ysZVqu","mySessionId","startsWith","_compressOperations","start","_lastServerVersion","_hasSelectionChanged","525042IHfqAe","directChange","position","_fetchMissingUsers","metadata","addRoot","remove","collaboration-missing-channelid","includes","reset","initData","connection","realtimecollaborationclient-init-non-existent-root","fire","_ignoredOperations","string","_isAttached","_bufferRootLoad","parse","serverHistory","_knownRootNames","realtimecollaborationclient-sendbufferedoperations","toJSON","_handleInitialConnectionData","_crash","_handleServerResponse","_addKnownRoot","enableReadOnlyMode","locale","rtc-offline","stop","_setPendingAction","filter","_document","realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration","loadRoot","_bufferedOperations","_handleExternalOperations","userId","apply","_clearPendingAction","history","_isDisconnection","data","_getAffectedRoot","getConnectedSessions","wereChangesApplied","_decompressOperations","_pendingAction","applyOperation","rootName","_hasSynchronizationProblem","fromJSON","isPremiumPlugin","_operationIdentifier","38qqMpWT","lastSyncVersion","addRootAttribute","18HtJKTe","realtimecollaborationclient-init-document-already-initialized","catch","_baseBufferDelay","change:hasDomSelection","plugins","move","Synchronization issue","22090920VrCQzS","cloud-services-internal-error: Request timeout.","from","wasUndone","_lastSyncedOperationId","set","model","map","register","real-time-collaboration","_isConnected","targetPosition","$root","setIdForTheLastOperation","isOfficialPlugin","enqueueChange","change:_isPendingUpdate","_service","insert","marker","realtimecollaborationclient-init-connection-failed","clone","compress","requires","disconnected","end","return","currentDocumentSession","listenTo","_refreshUserSelectionMarkers","_connectService","add","length","_handleSendingSelectionMarkers","permissions","createUserMarkerOperations","_applyOperationsSet","document:write","_authorId","code","differ","cloud-services-internal-error: Collaborative Editing Service is not connected.","stopListening","realtimecollaborationclient","_offset","realtimecollaborationclient-error","baseVersion","InsertOperation","bind","_sendBufferedOperationsDelayed","_shouldSendUpdate","_isEditingAllowed"];return(Jc=function(){return e})()}!function(e){const t=Bc,n=e();for(;;)try{if(587813===parseInt(t(445))/1*(parseInt(t(275))/2)+parseInt(t(482))/3+parseInt(t(341))/4+parseInt(t(475))/5+parseInt(t(412))/6*(parseInt(t(428))/7)+parseInt(t(378))/8*(parseInt(t(278))/9)+-parseInt(t(286))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Jc);let qc=1;class Lc extends t.Plugin{static get[Uc(309)](){return[ls,ys,Ds,t.PendingActions,ps.Users,r.Notification]}static get[Uc(415)](){return Uc(444)}static get[Uc(300)](){return!0}static get[Uc(273)](){return!0}get[Uc(419)](){const e=Uc;return this[e(480)]+this[e(330)]}get[Uc(480)](){const e=Uc;return this[e(239)][e(459)]-this[e(330)]}get[Uc(276)](){const e=Uc,t=this[e(239)][e(389)]();for(let n=t[e(318)]-1;n>=0;n--){const r=t[n];if(!this[e(425)][e(463)](r))return r[e(332)]+1-this[e(330)]}return 0}constructor(e){const t=Uc;if(super(e),this[t(330)]=0,this[t(401)]=null,this[t(239)]=new s.History,this[t(439)][t(347)][t(464)](t(462),{}),this[t(420)]=this[t(439)][t(347)][t(396)](t(367)),!this[t(420)])throw new n.CKEditorError(t(227),this);const r=e[t(347)][t(396)](t(433))||n.version;this[t(303)]=new(Lc[t(370)])(r,this[t(420)]),this[t(253)]=this[t(439)][t(292)][t(381)],this[t(466)]=new Mc,this[t(256)]=[],this[t(414)]=new WeakSet,this[t(240)]=new Set,this[t(291)](t(377),!1),this[t(291)](t(271),!1),this[t(268)]=null,this[t(481)]=!1,this[t(382)]=null,this[t(281)]=300,this[t(455)]=this[t(281)],this[t(290)]=null,this[t(425)]=new WeakSet,this[t(274)]=new zc(this[t(425)])}[Uc(435)](){const e=Uc,t=this[e(439)],n=t[e(283)][e(396)](ps.Users),r=t[e(283)][e(396)](ls);this[e(314)](n,e(393),((t,r)=>{const s=e,o=r[0];o[s(324)]&&(t[s(312)]=n[s(432)](o[s(324)]),t[s(250)]()),null===o[s(324)]&&(t[s(312)]=null,t[s(250)]())}),{priority:e(385)}),this[e(314)](t[e(292)][e(381)][e(440)],e(388),((t,n)=>{const r=e;n[r(483)]&&this[r(315)]()})),this[e(314)](t[e(403)][e(406)],e(282),(()=>{this[e(315)]()})),this[e(437)](),t[e(292)].on(e(269),((t,n)=>{const r=e,s=n[0];s[r(471)]&&(this[r(470)](s),this[r(336)]()&&this[r(335)]())})),this[e(400)](),this[e(334)](e(337)).to(r,e(429),this,e(271),((t,n)=>e(461)===t&&!n)),this.on(e(416),(()=>{const n=e;this[n(337)]?t[n(472)](n(249)):t[n(247)](n(249))})),this[e(337)]?t[e(472)](e(249)):t[e(247)](e(249)),this[e(291)](e(296),!1)}async[Uc(407)](){const e=Uc,t=this[e(439)][e(283)][e(396)](ys),n=this[e(439)][e(283)][e(396)](ls);try{this[e(377)]=!0,t[e(375)](this[e(420)]);const r=await this[e(303)][e(407)](n[e(231)],this[e(276)]);await this[e(340)](r)&&(this[e(377)]=!1,this[e(260)]());const s=await this[e(303)][e(265)]();t[e(294)](this[e(420)],s),this[e(319)](),this[e(296)]=!0}catch(t){if(function(t){const n=e;return n(356)===t[n(325)]}(t)&&this[e(401)])await this[e(452)]();else if(function(t){const n=e;return n(446)===t[n(325)]}(t)){const t=Rs(this[e(439)][e(248)],e(372));this[e(368)](t)}else{if(!(t instanceof Hc))throw t;this[e(368)]()}}}[Uc(366)](){const e=Uc,t=this[e(439)][e(283)][e(396)](ls),n=this[e(439)][e(283)][e(396)](ys);this[e(439)][e(247)](e(411)),n[e(345)][e(463)](this[e(420)])&&n[e(375)](this[e(420)]),t[e(374)](this),this[e(456)](),super[e(366)]()}async[Uc(340)](e){const t=Uc;if(this[t(401)]!==e[t(401)]&&this[t(290)]!==e[t(421)])throw new Hc;return this[t(401)]=e[t(401)],this[t(245)]([],{...e,wereChangesApplied:!1,data:e[t(263)]},t(407))}async[Uc(316)](e,t=!1){const n=Uc,{connection:r}=this[n(439)][n(283)][n(396)](ls);Lc[n(370)][n(265)](r,this[n(420)])[n(457)]((e=>this[n(394)](e)))[n(280)]((e=>{const t=n;this[t(244)](t(399),e)})),this[n(314)](this[n(303)],n(465),this[n(379)][n(334)](this)),this[n(314)](this[n(303)],n(450),((e,t)=>{const r=n;this[r(244)](r(448),t)})),this[n(314)](this[n(303)],n(310),(()=>{this[n(296)]=!1}));const s=this[n(274)][n(405)](e);this[n(377)]=!0;const o=await this[n(303)][n(443)](r,this[n(478)](e),s);if(this[n(401)]=o[n(401)],t){if(!o[n(266)])return void this[n(368)]();this[n(377)]=!1,this[n(260)](),this[n(239)][n(229)](),this[n(330)]=o[n(387)],this[n(239)][n(459)]=this[n(330)],await this[n(245)](e,o,n(431))}else await this[n(243)](o,e);this[n(319)](),this[n(296)]=!0}[Uc(319)](){const e=Uc,t=this[e(439)][e(283)][e(396)](ys),n=this[e(439)][e(283)][e(396)](Ds),r=t[e(345)][e(396)](this[e(420)]);r&&r[e(318)]>1?n[e(321)]():this[e(314)](t,e(376)+this[e(420)],(()=>{const r=e;2===t[r(345)][r(396)](this[r(420)])[r(318)]&&n[r(321)]()}))}async[Uc(379)](e,t,n,r){const s=Uc;if(!this[s(377)]&&this[s(253)][s(459)]==t){const e=this[s(267)](n,r);await this[s(485)](e),this[s(257)](e,t,n[s(421)])||this[s(244)](s(338))}}async[Uc(452)](){const e=Uc;this[e(456)]();const{locale:t}=this[e(439)];let n;try{n=await this[e(303)][e(469)]()}catch(n){const r=Rs(t,e(369));return void this[e(368)](r)}const r=n[e(313)]||n[e(460)];if(this[e(290)]===r[e(421)])await this[e(316)](this[e(439)][e(292)][e(381)][e(261)][e(389)](),!0);else{const n=Rs(t,e(380));this[e(368)](n)}}[Uc(456)](){const e=Uc;this[e(303)][e(344)](),this[e(256)]=[],clearTimeout(this[e(382)]),this[e(328)](this[e(303)])}[Uc(394)](e){const t=Uc,n=this[t(439)][t(283)][t(396)](ys);this[t(314)](n,t(376)+this[t(420)],((e,{session:r})=>{const s=t;if(r.id===n[s(476)]){e[s(358)]();const t=this[s(439)][s(283)][s(463)](s(365))&&this[s(439)][s(283)][s(396)](s(365));let n=r[s(320)];t&&t[s(441)]&&(n=n[s(252)]((e=>s(323)!==e))),this[s(439)][s(283)][s(396)](s(447))[s(360)](n,this[s(420)])}})),n[t(294)](this[t(420)],e)}[Uc(437)](){const e=Uc,t=this[e(439)][e(263)][e(291)];this[e(439)][e(263)][e(291)]=(...r)=>{const s=e;if(!r[r[s(318)]-1][s(402)])throw new n.CKEditorError(s(254),this);t[s(259)](this[s(439)][s(263)],r)}}[Uc(400)](){const e=Uc;this[e(439)][e(263)].on(e(435),((t,[r])=>{const o=e;if(this[o(253)][o(459)])throw new n.CKEditorError(o(279),this);t[o(250)](),this[o(251)]();const i=this[o(439)][o(347)][o(396)](o(390)),a=this[o(353)](r,i);0==a[o(318)]&&a[o(357)](new s.NoOperation(0)),t[o(312)]=this[o(316)](a)[o(457)]((()=>{const e=o;this[e(439)][e(283)][e(396)](ls)[e(408)](this),this[e(439)][e(263)][e(233)](e(423))}))[o(280)]((e=>this[o(244)](o(306),e)))[o(364)]((()=>this[o(260)]()))}),{priority:e(385)}),this[e(439)].on(e(255),(async(t,[n,r])=>{const s=e;t[s(250)]();const o=this[s(439)][s(292)][s(381)][s(348)](n);if(!this[s(240)][s(463)](n)){const e=r&&r[s(263)]?r[s(263)]:"",t=r&&r[s(352)]?r[s(352)]:{};await this[s(427)](n,e,t)}this[s(439)][s(292)][s(301)]({isUndoable:!1},(()=>{const e=s;o[e(454)]=!0,this[e(439)][e(292)][e(381)][e(326)][e(237)](o)}))}),{priority:e(385)})}async[Uc(485)](e){const t=Uc,n=this[t(439)][t(283)][t(396)](ps.Users),{connection:r}=this[t(439)][t(283)][t(396)](ls),s=new Set;for(const r of e){const e=r[t(324)];e&&!n[t(432)](e)&&s[t(317)](e)}if(0===s[t(430)])return;const o=await S[t(436)](r,Array[t(288)](s));for(const e of o)n[t(432)](e.id)||n[t(438)](e)}[Uc(353)](e,t={}){const r=Uc,o=this[r(439)][r(292)],i=[];let a=0;const c=r(235)==typeof e?{main:e}:e;for(const e of Object[r(417)](c)){if(!this[r(253)][r(397)][r(463)](e))throw new n.CKEditorError(r(232),this);const t=this[r(439)][r(263)][r(238)](c[e]),d=this[r(253)][r(348)](e),u=new s.InsertOperation(o[r(392)](d,0),t,a++);i[r(357)](u);for(const[e,n]of t[r(418)]){const t=o[r(398)](o[r(473)](d,n[r(479)][r(468)][r(453)]()),o[r(473)](d,n[r(311)][r(468)][r(453)]())),c=new s.MarkerOperation(e,null,t,o[r(418)],!0,a++);i[r(357)](c)}}if(t)for(const[e,c]of Object[r(361)](t)){const t=o[r(381)][r(348)](e);if(!t)throw new n.CKEditorError(r(359),null);for(const[e,n]of Object[r(361)](c))if(null!==n){const o=new s.RootAttributeOperation(t,e,null,n,a++);i[r(357)](o)}}return i}async[Uc(427)](e,t,n){const r=Uc;this[r(353)]({[e]:t},{[e]:n})[r(342)](((e,t)=>{const n=r;e[n(332)]=this[n(253)][n(459)]+t,e[n(404)]=!0,this[n(470)](e)})),this[r(335)](),await this[r(373)]()}async[Uc(243)](e,t){const n=Uc;let r;this[n(330)]=e[n(387)];const s=e[n(266)]&&!e[n(230)],o=s?0:e[n(263)][n(332)];if(t[n(342)]((t=>{const r=n;t[r(404)]=!0,t[r(449)]=e[r(409)],t[r(324)]=null})),s)r=t,this[n(322)](r,s);else{if(e[n(230)]){const t=this[n(353)](e[n(230)]);this[n(253)][n(261)][n(459)]=-t[n(318)],t[n(342)]((r=>{const s=n;r[s(332)]-=t[s(318)],r[s(449)]=e[s(409)],r[s(404)]=!0,r[s(324)]=null})),this[n(322)](t,!0),this[n(239)][n(459)]=-t[n(318)]+this[n(330)],this[n(343)](t)}this[n(253)][n(261)][n(459)]=o,r=this[n(267)](e[n(263)],e[n(486)]),await this[n(485)](r),this[n(322)](r,s)}e[n(421)]&&(this[n(274)][n(299)](r,e[n(421)]),this[n(290)]=e[n(421)]),this[n(239)][n(459)]=o+this[n(330)],this[n(343)](r),t[n(252)]((e=>{const t=n,r=this[t(264)](e);return r&&!this[t(240)][t(463)](r)}))[n(342)](((e,t)=>{const r=n;e[r(332)]=this[r(253)][r(459)]+t,this[r(470)](e)})),this[n(336)]()?(this[n(455)]=0,this[n(335)](!0),await this[n(373)]()):(this[n(377)]=!1,this[n(260)]())}[Uc(244)](e,t){const r=Uc,s=t&&t[r(458)];if(s&&s[r(477)](r(329)))throw t;const o=this[r(439)][r(283)][r(396)](ls);throw this[r(377)]=!0,o[r(344)](),this[r(439)][r(247)](r(331)),new n.CKEditorError(e,this[r(439)],s?{originalError:s}:void 0)}[Uc(470)](e){const t=Uc;this[t(414)][t(463)](e)||(this[t(414)][t(317)](e),this[t(256)][t(357)](e),this[t(268)]||t(305)==e[t(474)]&&!e[t(351)]||this[t(251)]())}[Uc(335)](e=!1){const t=Uc;!e&&this[t(377)]||(this[t(377)]=!0,clearTimeout(this[t(382)]),this[t(382)]=setTimeout((()=>{const e=t;this[e(451)]()[e(457)]((t=>{const n=e;t&&(this[n(260)](),this[n(377)]=!1)}))[e(280)]((t=>{const n=e;this[n(260)](),this[n(377)]=!1,function(e){const t=n;return e[t(458)][t(477)](t(354))||e[t(458)][t(477)](t(327))||e[t(458)][t(477)](t(287))}(t)||this[n(244)](t[n(458)],t)}))}),this[t(455)]))}[Uc(373)](){return new Promise((e=>{const t=Bc;this.on(t(302),(()=>{e()}))}))}async[Uc(451)](){const e=Uc,t=this[e(439)][e(283)][e(396)](Ds);if(this[e(386)]()&&(t[e(321)](),this[e(481)]=!1),!this[e(336)]())return!0;const n=[...this[e(256)]];for(const t of n)t[e(289)]=this[e(253)][e(261)][e(434)](t);const r=this[e(274)][e(405)](n),s=qc++,o=this[e(478)](n),i=await this[e(303)][e(413)](o,o[e(332)],r);try{return await this[e(245)](n,i,s)}catch(t){return this[e(244)](e(241),t)}}async[Uc(245)](e,t,n){const r=Uc;if(r(450)in t)throw t[r(450)];let s=!1;if(t[r(266)]){t[r(421)]&&(this[r(290)]=t[r(421)]),this[r(256)]=this[r(256)][r(252)]((t=>!e[r(228)](t)));for(const n of e)n[r(449)]=r(346)in t&&t[r(346)]||void 0;Yc(e,t[r(459)]-e[r(318)]),this[r(343)](e);const n=e[r(252)]((e=>{const t=r;if(!e[t(404)])return!1;const n=this[t(264)](e);return n&&!this[t(240)][t(463)](n)}));Yc(n,this[r(253)][r(459)]),this[r(322)](n),s=!0,this[r(455)]=this[r(281)]}else{const e=this[r(267)](t[r(263)],t[r(486)])[r(252)]((e=>e[r(332)]>=this[r(480)]));e[r(342)]((e=>this[r(246)](e))),this[r(256)]=this[r(256)][r(252)]((e=>!e[r(404)]||!this[r(240)][r(463)](this[r(264)](e)))),this[r(256)][r(318)]&&Yc(this[r(256)],this[r(256)][0][r(332)]),await this[r(485)](e),s=this[r(257)](e,t[r(459)],t[r(421)]),this[r(455)]=Math[r(384)](this[r(455)]/2)}return s?!this[r(336)]()||(this[r(335)](!0),!1):this[r(244)](r(426))}[Uc(257)](e,t,n){const r=Uc;try{const o={document:this[r(253)],useRelations:!1,padWithNoOps:!0},{operationsA:i,operationsB:a,originalOperations:c}=(0,s.transformSets)(e,this[r(256)],o);Yc(i,this[r(253)][r(459)]),Yc(a,t);for(const e of i){const t=c[r(396)](e);e[r(324)]=t?t[r(324)]:null}n&&(this[r(274)][r(299)](e,n),this[r(290)]=n),this[r(256)]=[...a],this[r(322)](i),this[r(343)](e)}catch(e){return console[r(450)](e),!1}return!0}[Uc(322)](e,t=!1){const n=Uc;this[n(439)][n(292)][n(301)]({isUndoable:!1,isLocal:!1},(t=>{const r=n;for(const n of e)this[r(414)][r(317)](n),this[r(246)](n),t[r(339)][r(422)](n),this[r(439)][r(292)][r(269)](n)}))}[Uc(246)](e){const t=Uc,n=this[t(264)](e);n&&this[t(240)][t(317)](n)}[Uc(264)](e){const t=Uc;let n,r;switch(e[t(474)]){case t(304):n=e[t(484)][t(350)];break;case t(305):if(r=e[t(442)],!r)return null;n=r[t(350)];break;case t(277):n=e[t(350)];break;case t(487):n=e[t(467)];break;case t(284):n=e[t(297)][t(350)];break;default:return null}return n[t(270)]}[Uc(343)](e){const t=Uc;e[t(342)]((e=>{const n=t,r=e[n(307)]();r[n(324)]=e[n(324)],r[n(404)]=!!e[n(404)],r[n(449)]=e[n(449)],r[n(332)]+=this[n(330)],e[n(262)]&&this[n(425)][n(317)](r),this[n(239)][n(422)](r)}))}[Uc(368)](e){const t=Uc,n=this[t(439)][t(283)][t(396)](t(410)),r=this[t(439)][t(248)];e||(e=Rs(r,t(362))),n[t(383)](e,{title:Rs(r,t(285)),namespace:t(295)}),this[t(271)]=!0,clearTimeout(this[t(382)]),this[t(256)]=[],this[t(439)][t(283)][t(396)](ls)[t(344)]()}[Uc(251)](){const e=Uc;this[e(268)]||(this[e(268)]=this[e(439)][e(283)][e(396)](t.PendingActions)[e(317)](Rs(this[e(439)][e(248)],e(391))))}[Uc(260)](){const e=Uc;this[e(268)]&&(this[e(439)][e(283)][e(396)](t.PendingActions)[e(488)](this[e(268)]),this[e(268)]=null)}[Uc(478)](e){const t=Uc,n=e[t(293)]((e=>e[t(242)]()));return this[t(466)][t(308)](n)}[Uc(267)](e,t){const n=Uc;return this[n(466)][n(395)](e)[n(293)](((e,r)=>{const o=n,i=o(435)==t[r][o(474)];if(o(333)==e[o(424)]){const t=e[o(484)][o(350)];!this[o(253)][o(348)](t)&&(this[o(253)][o(349)](o(298),t)[o(236)]=!1)}const a=s.OperationFactory[o(272)](e,this[o(253)]);return a[o(289)]=e[o(289)],a[o(404)]=i,a[o(324)]=i?null:t[r][o(258)],a[o(262)]=o(363)===t[r][o(474)],a[o(449)]=t[r][o(449)],a}))}[Uc(315)](){const e=Uc;this[e(481)]=!0,this[e(386)]()?this[e(335)]():this[e(481)]=!1}[Uc(386)](){const e=Uc,t=this[e(439)][e(283)][e(396)](ys)[e(345)][e(396)](this[e(420)]);return!this[e(439)][e(355)]&&!!t&&t[e(318)]>1&&this[e(481)]}[Uc(336)](){const e=Uc;return this[e(256)][e(318)]>0||this[e(386)]()}}Lc[Uc(370)]=br;const Gc=Lc;class Hc extends Error{}function Yc(e,t){const n=Uc;for(const r of e)r[n(332)]=t++}class zc{constructor(e){const t=Uc;this[t(234)]=e,this[t(371)]=new WeakMap}[Uc(405)](e){const t=Uc;let r=e[t(318)];for(;r--;){const s=e[r];if(!this[t(234)][t(463)](s)){if(!this[t(371)][t(463)](s)){const e=(0,n.uid)()[t(453)](1,18);this[t(371)][t(291)](s,e)}return this[t(371)][t(396)](s)}}}[Uc(299)](e,t){const n=Uc;if(!t)return;let r=e[n(318)];for(;r--;){const s=e[r];this[n(234)][n(463)](s)||this[n(371)][n(291)](s,t)}}}function Fc(e,t){var n=Wc();return(Fc=function(e,t){return n[e-=118]})(e,t)}var Kc=Fc;function Wc(){var e=["RealTimeCollaborativeEditing","isPremiumPlugin","6001300fwObJX","pluginName","1003290HJKMDt","30676352xbsLew","8758878TbktiZ","isOfficialPlugin","requires","4968246bvaaaM","1568221QilTnE","8646885OsAaGE"];return(Wc=function(){return e})()}!function(e){for(var t=Fc,n=e();;)try{if(896685===-parseInt(t(124))/1+parseInt(t(118))/2+parseInt(t(123))/3+parseInt(t(128))/4+parseInt(t(125))/5+parseInt(t(120))/6+-parseInt(t(119))/7)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Wc);class Qc extends t.Plugin{static get[Kc(122)](){return[Gc]}static get[Kc(129)](){return Kc(126)}static get[Kc(121)](){return!0}static get[Kc(127)](){return!0}}const $c=Zc;function Zc(e,t){const n=Xc();return(Zc=function(e,t){return n[e-=383]})(e,t)}function Xc(){const e=["_terminateService","attributes","addUser","userId","set","commentThreadReopened","plugins","createdAt","commentThreadRemoved","config","reconnect","from","getCommentThreads","has","pluginName","Permissions","reopenCommentThread","CommentsRepository","catch","getComment","cloudservicescommentsadapter-disconnect-not-exist","removeCommentThread","162984xfkpId","register","listenTo","commentThreadUpdated","404","580054UmHMZw","init","assign","map","getConnectedSessions","reopen","destroy","add","_connectService","62266sgWNkY","off","get","_fetchMissingUsersForThreads","getMany","_getService","commentId","commentAdded","delete","addCommentThread","startsWith","keys","cloudservicescommentsadapter-service-not-exist","collaboration.channelId","adapter","resolvedBy","comments","isOfficialPlugin","disconnect","CloudServicesCommentsAdapter","updateComment","commentThreadAdded","cloud-services-internal-error: Request timeout.","connect","content","update","updateCommentThread","isPremiumPlugin","1792075QGJJJm","getCommentThread","sessionAdd:","permissions","unregister","1905748HlvpWI","commentUpdated","_setUpService","commentThreadId","requires","addToReconnectionStack","setPermissions","deletedAt","_services","removeComment","getUser","message","size","cloud-services-internal-error: Not connected.","addComment","authorId","context","310650FHlmip","cloudservicescommentsadapter-connect-already-connected","commentRemoved","3423448yrmPvp","code","remove","resolve","commentThreadResolved","mySessionId","cloud-services-internal-error: Comments Service is not connected.","CommentsService","resolvedAt","resolveCommentThread"];return(Xc=function(){return e})()}!function(e){const t=Zc,n=e();for(;;)try{if(273222===parseInt(t(430))/1+-parseInt(t(421))/2+-parseInt(t(416))/3+parseInt(t(463))/4+-parseInt(t(458))/5+-parseInt(t(480))/6+parseInt(t(384))/7)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Xc);class ed extends t.ContextPlugin{static get[$c(467)](){return[ls,$c(411),ys,ps.Users]}static get[$c(408)](){return $c(449)}static get[$c(447)](){return!0}static get[$c(457)](){return!0}constructor(e){const t=$c;super(e),this[t(471)]=new Map}async[$c(422)](){const e=$c,n=this[e(479)],r=n[e(400)][e(432)](e(411));if(n[e(400)][e(432)](ls)[e(468)](this),r[e(444)]={addCommentThread:async({channelId:t,threadId:n,comments:r,resolvedAt:s,resolvedBy:o,context:i,attributes:a})=>{const c=e,d=await this[c(435)](t)[c(439)]({commentThreadId:n,comments:r[c(424)]((e=>function(e,t,n){const r=c;return{commentThreadId:n,commentId:e[r(436)],userId:e[r(478)],content:e[r(454)],documentId:t,createdAt:e[r(401)],attributes:e[r(395)]||{}}}(e,t,n))),resolvedAt:s,resolvedBy:o,context:i,attributes:a})[c(412)](rd);return{threadId:d[c(466)],comments:d[c(446)]}},getCommentThread:async({channelId:t,threadId:n})=>{const r=e,s=await this[r(435)](t)[r(459)](n)[r(412)](rd);return s[r(470)]?null:(await this[r(433)]([s]),{threadId:s[r(466)],comments:s[r(446)][r(424)](sd),context:s[r(479)],resolvedAt:s[r(392)],resolvedBy:s[r(445)],attributes:s[r(395)]||{}})},updateCommentThread:async({channelId:t,threadId:n,context:r,unlinkedAt:s,attributes:o})=>this[e(435)](t)[e(456)]({commentThreadId:n,context:r,attributes:o,unlinkedAt:s})[e(412)](nd)[e(412)](rd),resolveCommentThread:async({channelId:t,threadId:n})=>{const r=e,s=await this[r(435)](t)[r(393)](n)[r(412)](nd)[r(412)](rd);return{threadId:s[r(466)],resolvedAt:s[r(392)],resolvedBy:s[r(445)]}},reopenCommentThread:async({channelId:t,threadId:n})=>this[e(435)](t)[e(410)](n)[e(412)](nd)[e(412)](rd),removeCommentThread:({channelId:t,threadId:n})=>this[e(435)](t)[e(415)](n)[e(412)](nd)[e(412)](rd),addComment:({channelId:t,threadId:n,commentId:r,content:s,attributes:o})=>this[e(435)](t)[e(477)](n,r,s,o)[e(412)](rd),updateComment:({channelId:t,threadId:n,commentId:r,content:s,attributes:o})=>this[e(435)](t)[e(450)](n,r,s,o)[e(412)](nd)[e(412)](rd),removeComment:({channelId:t,threadId:n,commentId:r})=>this[e(435)](t)[e(472)](n,r)[e(412)](nd)[e(412)](rd)},n instanceof t.Context){const t=n[e(403)][e(432)](e(443)),r=n[e(400)][e(432)](ys);await this[e(465)](t);const s=await this[e(471)][e(432)](t)[e(425)]();this[e(418)](r,e(460)+t,((n,{session:s})=>{const o=e;s.id===r[o(389)]&&(n[o(431)](),this[o(479)][o(400)][o(432)](o(409))[o(469)](s[o(461)],t))})),r[e(417)](t,s)}}async[$c(465)](e){const t=$c;if(this[t(471)][t(407)](e))throw new n.CKEditorError(t(481),null,{channelId:e});const r=this[t(479)][t(400)][t(432)](t(411)),s=new(ed[t(391)])(e);this[t(471)][t(398)](e,s),this[t(418)](s,t(451),((e,n)=>{const s=t,{commentThreadId:o,documentId:i,context:a,attributes:c,resolvedAt:d,resolvedBy:u,comments:l}=n;r[s(459)](o)||r[s(439)]({threadId:o,channelId:i,comments:l?l[s(424)](sd):[],context:a,attributes:c,resolvedAt:d,resolvedBy:u,isFromAdapter:!0})})),this[t(418)](s,t(419),((e,{commentThreadId:n,documentId:s,context:o,unlinkedAt:i,attributes:a})=>{const c=t;r[c(459)](n)&&r[c(456)]({threadId:n,channelId:s,context:o,unlinkedAt:i,attributes:a,isFromAdapter:!0})})),this[t(418)](s,t(388),((e,{commentThreadId:n,resolvedBy:s,resolvedAt:o})=>{const i=t,a=r[i(459)](n);a&&a[i(387)]({resolvedBy:s,resolvedAt:o,isFromAdapter:!0})})),this[t(418)](s,t(399),((e,{commentThreadId:n})=>{const s=t,o=r[s(459)](n);o&&o[s(426)]({isFromAdapter:!0})})),this[t(418)](s,t(402),((e,{commentThreadId:n})=>{const s=t,o=r[s(459)](n);o&&o[s(386)]({isFromAdapter:!0})})),this[t(418)](s,t(437),((e,n)=>{const s=t,o=n[s(466)],i=r[s(459)](o);i&&i[s(477)]({...sd(n),isFromAdapter:!0})})),this[t(418)](s,t(464),((e,{commentThreadId:n,commentId:s,content:o,attributes:i})=>{const a=t,c=r[a(459)](n);if(c){const e=c[a(413)](s);e&&e[a(455)]({content:o,attributes:i,isFromAdapter:!0})}})),this[t(418)](s,t(383),((e,{commentThreadId:n,commentId:s})=>{const o=t,i=r[o(459)](n);if(i){const e=i[o(413)](s);e&&e[o(386)]({isFromAdapter:!0})}})),await this[t(429)](e)}[$c(427)](){const e=$c;if(this[e(479)]instanceof t.Context){const t=this[e(479)][e(403)][e(432)](e(443));this[e(394)](t)}}[$c(394)](e){const t=$c;if(!this[t(471)][t(407)](e))throw new n.CKEditorError(t(414),null,{channelId:e});this[t(435)](e)[t(448)](),this[t(471)][t(438)](e)}async[$c(404)](){const e=$c;for(const t of this[e(471)][e(441)]())await this[e(429)](t);if(this[e(479)]instanceof t.Context){const t=this[e(479)][e(403)][e(432)](e(443)),n=this[e(479)][e(400)][e(432)](ys);n[e(462)](t);const r=await this[e(471)][e(432)](t)[e(425)]();n[e(417)](t,r)}}async[$c(429)](e){const t=$c,{connection:n}=this[t(479)][t(400)][t(432)](ls),r=this[t(479)][t(400)][t(432)](t(411)),s=this[t(471)][t(432)](e),o=await s[t(453)](n);await this[t(433)](o);const i=new Set(Array[t(405)](r[t(406)]({channelId:e}),(e=>e.id)));for(const e of o)e[t(470)]||i[t(438)](e[t(466)]);for(const e of i)r[t(459)](e)[t(386)]({isFromAdapter:!0});for(const n of o){let s=r[t(459)](n[t(466)]);const{commentThreadId:o,context:i,attributes:a,resolvedBy:c,resolvedAt:d,unlinkedAt:u,deletedAt:l}=n;if(l)continue;s||(s=r[t(439)]({channelId:e,threadId:o,context:i,attributes:a||{},resolvedBy:c,resolvedAt:d,unlinkedAt:u,isFromAdapter:!0}));const p=new Set(Array[t(405)](s[t(446)],(e=>e.id)));for(const e of n[t(446)])p[t(438)](e[t(436)]);for(const e of p)s[t(413)](e)[t(386)]({isFromAdapter:!0});for(const e of n[t(446)]){const n=s[t(413)](e[t(436)]);n?n[t(454)]!==e[t(454)]&&n[t(455)]({content:e[t(454)],isFromAdapter:!0}):s[t(477)](Object[t(423)](sd(e),{isFromAdapter:!0}))}}}[$c(435)](e){const t=$c;if(!this[t(471)][t(407)](e))throw new n.CKEditorError(t(442),null,{channelId:e});return this[t(471)][t(432)](e)}async[$c(433)](e){const t=$c,n=this[t(479)][t(400)][t(432)](ps.Users),{connection:r}=this[t(479)][t(400)][t(432)](ls),s=new Set;for(const{resolvedBy:r,comments:o}of e){r&&!n[t(473)](r)&&s[t(428)](r);for(const{userId:e}of o)n[t(473)](e)||s[t(428)](e)}if(0===s[t(475)])return;const o=await S[t(434)](r,Array[t(405)](s));for(const e of o)n[t(473)](e.id)||n[t(396)](e)}}ed[$c(391)]=is;const td=ed;async function nd(e){const t=$c;if(t(420)!==e[t(385)])throw e}function rd(e){const t=$c;if((n=e)[t(474)][t(440)](t(390))||n[t(474)][t(440)](t(476))||n[t(474)][t(440)](t(452)))return new Promise((()=>{}));var n;throw e}function sd(e){const t=$c;return{threadId:e[t(466)],commentId:e[t(436)],content:e[t(454)],createdAt:e[t(401)],authorId:e[t(397)],attributes:e[t(395)]||{}}}const od=ad;!function(e){const t=ad,n=e();for(;;)try{if(861199===-parseInt(t(462))/1*(-parseInt(t(423))/2)+parseInt(t(454))/3+parseInt(t(408))/4*(-parseInt(t(440))/5)+-parseInt(t(461))/6*(-parseInt(t(427))/7)+parseInt(t(426))/8*(-parseInt(t(416))/9)+-parseInt(t(422))/10+parseInt(t(456))/11*(parseInt(t(452))/12))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(cd);class id extends t.Plugin{static get[od(413)](){return[td,od(448),ls]}static get[od(457)](){return od(421)}static get[od(465)](){return!0}static get[od(424)](){return!0}constructor(e){const t=od;super(e);const n=this[t(415)][t(468)][t(450)](t(467));this[t(453)]=new Map,this[t(434)]=new(id[t(445)])(n)}[od(439)](){const e=od,t=this[e(415)][e(429)][e(450)](ls),n=this[e(415)][e(429)][e(450)](e(448));return n[e(412)]={getSuggestion:async t=>{const n=e;await this[n(458)]();const r=await this[n(434)][n(450)](t)[n(433)](ud);return await this[n(431)]([r]),r},addSuggestion:async({id:t,type:n,data:r,originalSuggestionId:s,attributes:o})=>{const i=e;await this[i(458)]();const a={id:t,type:n,data:r,originalSuggestionId:s,attributes:o},c=await this[i(434)][i(409)](t,n,r,s,o)[i(433)]((e=>{if(ld(e))return new Promise((e=>{const n=ad;this[n(453)][n(406)](t,{resolve:e,suggestionData:a})}));throw e}));return this[i(453)][i(420)](t),c},updateSuggestion:async(t,n)=>{const r=e;if(await this[r(458)](),r(442)!==n[r(449)])return this[r(434)][r(455)](t,n)[r(433)](ud)}},this[e(428)](this[e(434)],e(466),((t,r)=>{const s=e;n[s(419)](r.id)&&(n[s(469)](r.id)[s(407)]=r[s(407)])})),this[e(434)][e(425)](t[e(404)])[e(447)]((r=>(t[e(446)](this),this[e(431)](r)[e(447)]((()=>{const t=e;for(const e of r)n[t(443)](e)[t(463)]=!0})))))}async[od(436)](){const e=od,t=this[e(415)][e(429)][e(450)](e(448)),{connection:n}=this[e(415)][e(429)][e(450)](ls),r=await this[e(434)][e(425)](n);await this[e(431)](r);for(const{suggestionData:t,resolve:n}of this[e(453)][e(441)]()){let s=r[e(405)]((e=>e.id===t.id));s||(s=await this[e(434)][e(409)](t.id,t[e(459)],t[e(432)],t[e(418)])),n(s)}for(const n of r)t[e(419)](n.id)||t[e(443)](n)}async[od(458)](){const e=od;this[e(434)][e(464)]||await new Promise((t=>{const n=e;this[n(428)](this[n(434)],n(438),(e=>{e[n(460)](),t()}))}))}async[od(431)](e){const t=od,n=this[t(415)][t(429)][t(450)](ps.Users),{connection:r}=this[t(415)][t(429)][t(450)](ls),s=new Set;for(const{authorId:r}of e)n[t(435)](r)||s[t(409)](r);if(0===s[t(417)])return;const o=await S[t(414)](r,Array[t(410)](s));for(const e of o)n[t(435)](e.id)||n[t(411)](e)}}function ad(e,t){const n=cd();return(ad=function(e,t){return n[e-=404]})(e,t)}function cd(){const e=["10944997uqiBhI","listenTo","plugins","startsWith","_fetchMissingUsersForThreads","data","catch","_trackChangesService","getUser","reconnect","cloud-services-internal-error: Request timeout.","connected","init","5245235mRqlOy","values","open","addSuggestionData","cloud-services-internal-error: Not connected.","TrackChangesService","addToReconnectionStack","then","TrackChangesEditing","state","get","message","24YiFBUV","_bufferedRequests","2941854DMWEcV","update","3137629Nbqllx","pluginName","_waitForServiceReady","type","off","6EzRTRb","54944VtTYdJ","_saved","isConnected","isOfficialPlugin","suggestionUpdated","collaboration.channelId","config","getSuggestion","connection","find","set","attributes","4GBFNzT","add","from","addUser","adapter","requires","getMany","editor","9YEMojj","size","originalSuggestionId","hasSuggestion","delete","CloudServicesTrackChangesAdapter","6332860SGsjNw","22FkHCtE","isPremiumPlugin","connect","9404152eNWlLd"];return(cd=function(){return e})()}id[od(445)]=Vn;const dd=id;function ud(e){if(ld(e))return new Promise((()=>{}));throw e}function ld(e){const t=od;return e[t(451)][t(430)](t(444))||e[t(451)][t(430)](t(437))}const pd=fd;function hd(){const e=["983627CTMXKW","4hswBmB","_setUpService","init","18216iIHhnd","isOfficialPlugin","collaboration.channelId","9661920jKtCHF","data","CommentsEditing","once","RealTimeCollaborativeComments","32496772efFNsw","ready","editor","config","3891759hQTjzp","36450bBXAHj","switchReadOnly","3080250WskMDO","isPremiumPlugin","listenTo","change:state","Comments","4480mllryd","1326qqGKab","_terminateService","pluginName","CommentsRepository","requires","plugins","connected","get","destroy","isThreadsLoadingPaused","7IIgOxy"];return(hd=function(){return e})()}function fd(e,t){const n=hd();return(fd=function(e,t){return n[e-=411]})(e,t)}!function(e){const t=fd,n=e();for(;;)try{if(811577===-parseInt(t(422))/1+parseInt(t(441))/2+parseInt(t(438))/3*(parseInt(t(423))/4)+-parseInt(t(439))/5*(-parseInt(t(411))/6)+-parseInt(t(421))/7*(-parseInt(t(429))/8)+parseInt(t(426))/9*(-parseInt(t(446))/10)+-parseInt(t(434))/11)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(hd);class md extends t.Plugin{static get[pd(415)](){return[pd(445),td,Qc,ls]}static get[pd(413)](){return pd(433)}static get[pd(427)](){return!0}static get[pd(442)](){return!0}[pd(425)](){const e=pd,t=this[e(436)][e(416)][e(418)](ls),n=this[e(436)][e(416)][e(418)](e(431)),r=this[e(436)][e(416)][e(418)](td);return this[e(436)][e(430)][e(432)](e(435),(()=>{const r=e;this[r(443)](t,r(444),((e,t,s)=>{const o=r;n[o(420)]=o(417)!==s}))})),this[e(443)](t,e(444),((t,n,r)=>{const s=e;this[s(436)][s(416)][s(418)](s(414))[s(440)](s(417)!==r)})),r[e(424)](this[e(436)][e(437)][e(418)](e(428)))}[pd(419)](){const e=pd;this[e(436)][e(416)][e(418)](td)[e(412)](this[e(436)][e(437)][e(418)](e(428))),super[e(419)]()}}var yd=bd;function gd(){var e=["106603FqOROI","126OZZKom","2323940CWsaIz","isPremiumPlugin","4666710gyeuBh","requires","99282xNHsLw","RealTimeCollaborativeTrackChanges","1750260FxVIlN","9oBTBYP","isOfficialPlugin","4zMHXrA","TrackChanges","543144bqBedm","pluginName","910168vAlMJN"];return(gd=function(){return e})()}function bd(e,t){var n=gd();return(bd=function(e,t){return n[e-=402]})(e,t)}!function(e){for(var t=bd,n=e();;)try{if(294072===-parseInt(t(409))/1+parseInt(t(402))/2+parseInt(t(404))/3+parseInt(t(407))/4*(parseInt(t(414))/5)+-parseInt(t(413))/6*(-parseInt(t(412))/7)+-parseInt(t(411))/8*(parseInt(t(405))/9)+-parseInt(t(416))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(gd);class Od extends t.Plugin{static get[yd(417)](){return[md,dd,yd(408)]}static get[yd(410)](){return yd(403)}static get[yd(406)](){return!0}static get[yd(415)](){return!0}}const wd=vd;function vd(e,t){const n=Id();return(vd=function(e,t){return n[e-=202]})(e,t)}function Id(){const e=["connect","listenTo","_createCurrentRevision","type","keys","_update","1156215XzdzTw","get","CONNECTED","once","creatorId","_revisionTracker","size","data","5089905TVaopd","reInit","add","cloud-services-internal-error: Request timeout.","_getLatestVersion","map","diffData","length","message","destroy","_startingVersion","createdAt","buildRevisionData","isOfficialPlugin","isEmptyCurrent","getRevisions","wrongRequestId","catch","authors","_revisionDataBuilder","has","startsWith","isConnected","isBundleUploaded","_bufferedUpdates","connection","connected","state","_isConnected","revisionsUpdated","change:_isPendingUpdate","then","214152BPXixe","plugins","CloudServicesRevisionHistoryAdapter","affectsData","setRevisionData","RevisionHistoryService","off","change:_isConnected","_fixRevision","27382aoBcgf","baseVersion","_handleReconnectionError","_offset","cloudServices.bundleVersion","RevisionTracker","authorsIds","39LfMQZM","isPremiumPlugin","addRevisionData","_revisions","1737784vDrUet","repository","pluginName","remove","_lastRequestId","_handleRevisionsUpdate","adapter","_oldOffset","code","requires","addToReconnectionStack","161244nnrDqW","toVersion","addUser","collaboration.channelId","currentRevision","_waitForServiceReady","updateRevisions","from","_getLatestVersionFromServerOperations","getOperations","reverse","_preventResendingRevisionData","3939588fzNEtR","_bufferUpdate","getMany","sendBufferedUpdates","400","cloud-services-internal-error: Not connected.","serverHistory","_revisionHistoryService","config","getRevision","_isPendingUpdate","sessionId","isEnabled","max","getUser","_fetchMissingUsers","marker","setSource","bind","fromVersion","init","reconnect","cloud-services-internal-error: Revision History Service is not connected.","editor","14GTMUgG"];return(Id=function(){return e})()}!function(e){const t=vd,n=e();for(;;)try{if(377705===parseInt(t(239))/1*(-parseInt(t(232))/2)+-parseInt(t(254))/3+-parseInt(t(223))/4+parseInt(t(297))/5+parseInt(t(266))/6+-parseInt(t(290))/7*(parseInt(t(243))/8)+parseInt(t(305))/9)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Id);class Sd extends t.Plugin{static get[wd(252)](){return[ls,Gc,wd(237),ys,ps.Users]}static get[wd(245)](){return wd(225)}static get[wd(204)](){return!0}static get[wd(240)](){return!0}constructor(e){const t=wd;super(e);const n=this[t(289)][t(274)][t(298)](t(257));this[t(247)]=null,this[t(302)]=this[t(289)][t(224)][t(298)](t(237)),this[t(273)]=new(Sd[t(228)])(n)}async[wd(286)](){const e=wd,t=this[e(289)][e(224)][e(298)](Gc),r=t[e(272)],s=this[e(289)][e(224)][e(298)](ls);this[e(302)][e(283)]({history:r,getLatestVersion:()=>this[e(309)](),getCurrentRevisionId:()=>t[e(277)]});const o=this[e(289)][e(274)][e(298)](e(236))||n.version,i=await Yt[e(214)](s[e(216)],o);this[e(302)][e(249)]={getRevision:async({revisionId:t})=>(await this[e(259)](),await this[e(273)][e(275)](t)),updateRevisions:async t=>{const n=e;await this[n(259)]();const r=this[n(302)][n(258)];if(i&&1===t[n(312)]&&t[0].id===r.id)return t;for(const e of t)e.id===r.id&&(e[n(205)]=e[n(285)]===e[n(255)]);return this[n(273)][n(260)](t,this[n(247)])[n(222)]((e=>(this[n(247)]=e,t)))[n(208)]((e=>{const r=n;if(kd(e)||r(270)===e[r(251)]&&void 0!==e[r(304)][r(207)]){for(const e of t)!this[r(302)][r(244)][r(275)](e.id)||this[r(302)][r(267)](e.id,e,!1);if(kd(e))throw e;return t}throw e}))}},this[e(292)](this[e(273)],e(220),((t,{revisionsData:n,requestId:r})=>{const s=e;Math[s(279)](...n[s(310)]((e=>e[s(255)])))>this[s(262)]()-1?this[s(309)]()[s(222)]((()=>{this[s(248)](n,r)})):this[s(248)](n,r)}));const{revisions:a,requestId:c}=await this[e(273)][e(291)](s[e(216)]);s[e(253)](this),this[e(247)]=c,await this[e(281)](a);for(const t of a)this[e(302)][e(241)](t);this[e(292)](t,e(230),((n,r,s)=>{const o=e;s&&(this[o(250)]=t[o(235)],n[o(229)]())})),this[e(302)][e(284)](e(278)).to(s,e(218),(t=>t===Mt[e(299)]))}async[wd(287)](){const e=wd,t=this[e(289)][e(224)][e(298)](ls),n=this[e(289)][e(224)][e(298)](Gc),r=async()=>{const r=e,s=this[r(302)][r(258)],o=s.id,i=o!==n[r(277)];if(i){const e=n[r(235)]-this[r(250)],t=this[r(262)]();if(this[r(302)][r(210)][r(306)](),s[r(255)]+e!==t){const n=s[r(285)]+e,o=this[r(289)][r(224)][r(298)](ps.Users),i=this[r(302)][r(203)]({revision:s,from:n,to:t});i.id=s.id;const a=i[r(238)][r(310)]((e=>o[r(280)](e)));s[r(296)]({...i,authors:a},!0),this[r(302)][r(267)](s.id,i,!0)}this[r(302)][r(315)]=t,s[r(255)]===s[r(285)]&&!this[r(302)][r(215)][r(211)](o)&&this[r(302)][r(244)][r(242)][r(246)](o),this[r(302)][r(293)](t)}const{revisions:a,requestId:c}=await this[r(273)][r(287)](t[r(216)],this[r(247)]);i&&a[r(312)]>0?n[r(234)]():(await this[r(281)](a),this[r(248)](a,c),this[r(302)][r(269)]())};return n[e(219)]?r():new Promise(((t,s)=>{const o=e;n[o(300)](o(230),(()=>{const e=o;r()[e(222)](t)[e(208)](s)}))}))}[wd(314)](){super[wd(314)]()}async[wd(259)](){const e=wd;this[e(273)][e(213)]||await new Promise((t=>{const n=e;this[n(292)](this[n(273)],n(217),(e=>{e[n(229)](),t()}))}))}[wd(262)](){const e=wd,t=this[e(289)][e(224)][e(298)](Gc)[e(272)][e(263)]()[e(264)]();for(const n of t)if(e(282)!==n[e(294)]||n[e(226)])return n[e(233)]+1}[wd(309)](){const e=wd,t=this[e(289)][e(224)][e(298)](Gc);return new Promise((n=>{const r=e;t[r(276)]?t[r(300)](r(221),(()=>{n(this[r(262)]())})):n(this[r(262)]())}))}[wd(248)](e,t){const n=wd,r=this[n(302)][n(244)];this[n(247)]=t;for(const t of e){const e=r[n(275)](t.id);if(e){if((t[n(285)]||t[n(255)])&&(t[n(311)]=null),e===this[n(302)][n(258)]){const r=Math[n(279)](e[n(255)],t[n(255)]),s=Math[n(279)](e[n(285)],t[n(285)]);let o;e[n(255)]===t[n(255)]&&e[n(285)]===t[n(285)]?(o=!0,this[n(265)](t)):t[n(255)]===r&&t[n(285)]===s?o=!1:(e[n(255)]===r&&e[n(285)]===s||this[n(231)]({revision:e,from:s,to:r}),o=!0),o&&(delete t[n(285)],delete t[n(255)],delete t[n(311)],delete t[n(202)],delete t[n(238)])}this[n(302)][n(227)](t),this[n(265)](t)}else this[n(302)][n(241)](t)}const s=r[n(206)]();s[n(264)]();for(let e=0;e<s[n(312)]-1;e++){const t=s[e],r=s[e+1];if(t[n(285)]<r[n(255)]){const e=r[n(255)],s=Math[n(279)](e,t[n(255)]);this[n(231)]({revision:t,from:e,to:s})}}}[wd(231)]({revision:e,from:t,to:n}={}){const r=wd,s=this[r(289)][r(224)][r(298)](ps.Users),o=this[r(302)][r(203)]({revision:e,from:t,to:n});o[r(209)]=o[r(238)][r(310)]((e=>s[r(280)](e))),e[r(296)](o)}[wd(265)](e){const t=wd,n={};n.id=e.id;for(const r of Object[t(295)](e))"id"!==r&&(n[r]=void 0);this[t(302)][t(267)](n.id,n,!0)}async[wd(281)](e){const t=wd,n=this[t(289)][t(224)][t(298)](ps.Users),{connection:r}=this[t(289)][t(224)][t(298)](ls),s=new Set;for(const n of e){for(const e of n[t(238)])i(e);n[t(301)]&&i(n[t(301)])}if(0===s[t(303)])return;const o=await S[t(268)](r,Array[t(261)](s));for(const e of o)n[t(280)](e.id)||n[t(256)](e);function i(e){const r=t;n[r(280)](e)||s[r(307)](e)}}}Sd[wd(228)]=ln;const Pd=Sd;function kd(e){const t=wd;return e[t(313)][t(212)](t(288))||e[t(313)][t(212)](t(271))||e[t(313)][t(212)](t(308))}var Ad=Td;function _d(){var e=["10BwNlLs","4683290JRyujP","requires","78383107Ekjtxn","isOfficialPlugin","12103542plXKQw","isPremiumPlugin","pluginName","218545AOJTAe","13233320wyFjPe","4TvqzxC","48WQitFo","6HVzogy","RealTimeCollaborativeRevisionHistory","RevisionHistory","3346329xHCtld","207658OuNtGB"];return(_d=function(){return e})()}function Td(e,t){var n=_d();return(Td=function(e,t){return n[e-=234]})(e,t)}!function(e){for(var t=Td,n=e();;)try{if(832220===-parseInt(t(236))/1+-parseInt(t(244))/2*(parseInt(t(239))/3)+-parseInt(t(238))/4*(parseInt(t(246))/5)+-parseInt(t(240))/6*(parseInt(t(243))/7)+-parseInt(t(237))/8+-parseInt(t(250))/9+parseInt(t(245))/10*(parseInt(t(248))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(_d);class Cd extends t.Plugin{static get[Ad(247)](){return[Ad(242),Pd,Qc]}static get[Ad(235)](){return Ad(241)}static get[Ad(249)](){return!0}static get[Ad(234)](){return!0}}var jd=Function.prototype,Ed=Object.prototype,Dd=jd.toString,xd=Ed.hasOwnProperty,Rd=Dd.call(Object);const Nd=function(e){if(!oi(e)||"[object Object]"!=lo(e))return!1;var t=oa(e);if(null===t)return!0;var n=xd.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Dd.call(n)==Rd};const Vd=function(e){return oi(e)&&1===e.nodeType&&!Nd(e)};function Md(e,t){const n=Bd();return(Md=function(e,t){return n[e-=484]})(e,t)}function Bd(){const e=["isHidden","8WYzkAq","setTemplate","11oZhBIS","bindTemplate","ck-presence-list__counter","2130884arXAXH","ck-presence-list__counter--hidden","10162630JwtsJx","set","6628LxKXmz","div","71265eJUfeo","13352928bHJFyZ","4572720ZIYJMR","1672196oqtVHL","330qiJRMJ","CONNECTED_USERS","usersCount","134Mnmtue","3gtIznL"];return(Bd=function(){return e})()}!function(e){const t=Md,n=e();for(;;)try{if(509793===-parseInt(t(492))/1*(-parseInt(t(504))/2)+parseInt(t(493))/3*(-parseInt(t(488))/4)+-parseInt(t(485))/5*(-parseInt(t(489))/6)+parseInt(t(500))/7*(parseInt(t(495))/8)+-parseInt(t(487))/9+parseInt(t(502))/10*(parseInt(t(497))/11)+-parseInt(t(486))/12)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Bd);class Ud extends r.View{constructor(e){const t=Md;super(e);const n=this[t(498)];this[t(503)](t(491),0),this[t(503)](t(494),!0),this[t(496)]({tag:t(484),attributes:{class:["ck",t(499),n.if(t(494),t(501))]},children:[{text:n.to(t(491),(n=>Rs(e,t(490),n)))}]})}}function Jd(e,t){const n=Gd();return(Jd=function(e,t){return n[e-=329]})(e,t)}const qd=Jd;!function(e){const t=Jd,n=e();for(;;)try{if(185687===-parseInt(t(356))/1+parseInt(t(358))/2+parseInt(t(329))/3*(parseInt(t(330))/4)+-parseInt(t(360))/5*(-parseInt(t(357))/6)+parseInt(t(338))/7+-parseInt(t(333))/8+parseInt(t(331))/9*(-parseInt(t(342))/10))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Gd);class Ld extends r.View{constructor(e){const t=Jd;super(e);const r=this[t(348)];this[t(335)]=this[t(351)](),this[t(344)]=new n.KeystrokeHandler,this[t(337)]({hasPopup:!1,isExpanded:!1}),this[t(359)]({tag:t(345),attributes:{"aria-haspopup":r.if(t(341)),"aria-expanded":r.to(t(350),(e=>this[t(341)]&&String(e))),"aria-label":r.to(t(341),(n=>Rs(e,t(n?361:339)))),role:t(354),tabindex:r.to(t(341),(e=>!!e&&0)),class:["ck",t(340)]},children:this[t(335)],on:{click:r.to((()=>this[t(355)](t(346))))}}),this.on(t(347),((e,n,r)=>{const s=t;this[s(334)]&&(r?this[s(334)][s(353)](s(343),String(this[s(350)])):this[s(334)][s(349)](s(343)))}))}[qd(352)](){const e=qd;this[e(334)][e(352)]()}[qd(332)](){const e=qd;super[e(332)](),this[e(344)][e(336)](this[e(334)])}}function Gd(){const e=["22170qnzeeA","609372kOeXcO","setTemplate","425omCJsb","Collapsed connected users list (press ENTER to open it)","21tQvXns","98284WgFdAp","2315772sCnJKK","render","692704QAuoii","element","items","listenTo","set","1870078mjmNOy","Connected users list","ck-presence-list__list","hasPopup","30NJRWEI","aria-expanded","keystrokes","div","execute","change:hasPopup","bindTemplate","removeAttribute","isExpanded","createCollection","focus","setAttribute","list","fire","13713rFDlxk"];return(Gd=function(){return e})()}var Hd=__webpack_require__(106),Yd={attributes:{"data-cke":!0}};Yd.setAttributes=Ps(),Yd.insert=Is().bind(null,"head"),Yd.domAPI=ws(),Yd.insertStyleElement=As();bs()(Hd.A,Yd);Hd.A&&Hd.A.locals&&Hd.A.locals;function zd(){const e=["items","first","div","listenTo","set","5255zccjWH","2284768NkHibn","counterView","locale","5950881GNpKnf","bindTemplate","5MGPbDL","966156tpeZsy","ck-reset","isCollapsed","ck-rounded-corners","setTemplate","186pkguwx","ck-presence-list","ck-presence-list--collapsed","5081424URfNnO","tooltipPosition","bind","1180209jKUvVb","5770114wInrey","inlineListView","change","hasPopup"];return(zd=function(){return e})()}function Fd(e,t){const n=zd();return(Fd=function(e,t){return n[e-=249]})(e,t)}!function(e){const t=Fd,n=e();for(;;)try{if(535479===parseInt(t(276))/1*(parseInt(t(260))/2)+-parseInt(t(266))/3+-parseInt(t(249))/4+parseInt(t(254))/5*(parseInt(t(255))/6)+parseInt(t(267))/7+-parseInt(t(263))/8+parseInt(t(252))/9)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(zd);class Kd extends r.View{constructor(e){const t=Fd;super(e);const n=this[t(253)];this[t(275)](t(257),!0),this[t(250)]=new Ud(this[t(251)]),this[t(268)]=new Ld(e),this[t(268)][t(265)](t(270)).to(this,t(257)),this[t(274)](this[t(268)][t(271)],t(269),(()=>{const e=t;for(const t of this[e(268)][e(271)])t[e(264)]="s";this[e(268)][e(271)][e(272)]&&(this[e(268)][e(271)][e(272)][e(264)]="se")})),this[t(259)]({tag:t(273),attributes:{class:["ck",t(261),t(256),t(258),n.if(t(257),t(262))]},children:[this[t(250)],this[t(268)]]})}}const Wd=Zd;function Qd(){const e=["ariaLabelledBy","render","Connected users list dropdown menu","listWrapperView","480316kTbgqL","ariaLabel","ck-reset","5ZIOmRW","560890TPeKbn","max","18nHIGHS","clientHeight","_isScrollable","resize","ck-presence-list__dropdown-list","checkIfScrollable","ck-presence-list__dropdown-list-wrapper","bindTemplate","set","588038SsFLlj","element","div","44471QNsEXX","setTemplate","role","197649ZiFhQM","ck-list","ck-presence-list__dropdown-list-wrapper_scrollable","application","407IrPWDa","scrollHeight","items","2285352jsIkLK","4966904SUoZHi","426UuNheh","change","listenTo","innerHeight","window"];return(Qd=function(){return e})()}!function(e){const t=Zd,n=e();for(;;)try{if(350501===-parseInt(t(453))/1+parseInt(t(444))/2*(-parseInt(t(459))/3)+-parseInt(t(438))/4*(parseInt(t(441))/5)+parseInt(t(468))/6*(parseInt(t(456))/7)+-parseInt(t(467))/8+-parseInt(t(466))/9+parseInt(t(442))/10*(parseInt(t(463))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(Qd);class $d extends r.View{constructor(e,t){const n=Zd;super(e),this[n(476)]=new Xd(e,t),this[n(457)]({tag:n(455),attributes:{tabindex:-1,role:n(462),class:["ck",n(448)],"aria-label":Rs(e,n(475))},children:[this[n(476)]]})}}function Zd(e,t){const n=Qd();return(Zd=function(e,t){return n[e-=438]})(e,t)}class Xd extends r.ListView{constructor(e,t){const r=Zd;super(e);const s=this[r(451)];this[r(452)](r(446),!1),this[r(457)]({tag:t?r(455):"ul",attributes:{class:["ck",r(440),r(460),r(450),s.if(r(446),r(461))],role:s.to(r(458)),"aria-label":s.to(r(439)),"aria-labelledby":s.to(r(473))},children:this[r(465)]}),this[r(470)](n.global[r(472)],r(447),(()=>this[r(449)]())),this[r(465)].on(r(469),(()=>this[r(449)]()))}[Wd(474)](){const e=Wd;super[e(474)](),this[e(449)]()}[Wd(449)](){const e=Wd,t=this[e(454)];t&&(this[e(446)]=Math[e(443)](t[e(464)],t[e(445)])>.8*window[e(471)])}}const eu=tu;function tu(e,t){const n=nu();return(tu=function(e,t){return n[e-=431]})(e,t)}function nu(){const e=["getBackgroundColorClass","ck-user__full-name","ck-presence-list__marker","15604670enstvX","1003068pwQMpL","bindTemplate","90DgVSNX","10uCWFHz","focus","color","true","element","fire","userView","name","34586ZBNvYC","tag","button","7508060nqYNwL","execute","setTemplate","2703741HymAGh","presentation","span","1129928VrhoBK","512244HjzuRe","ck-presence-list__dropdown-list-item","14CJWyTa"];return(nu=function(){return e})()}!function(e){const t=tu,n=e();for(;;)try{if(859505===parseInt(t(450))/1*(-parseInt(t(442))/2)+-parseInt(t(456))/3+parseInt(t(432))/4+-parseInt(t(453))/5+-parseInt(t(439))/6*(-parseInt(t(434))/7)+-parseInt(t(431))/8*(-parseInt(t(441))/9)+parseInt(t(438))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(nu);class ru extends r.ListItemView{constructor(e,t,n){const r=tu;super(e);const s=this[r(440)];this[r(448)]=new ps.UserView(e,t);const o={tag:"li",attributes:{class:["ck",r(433)],tabindex:-1,role:r(457),"aria-label":t[r(449)]},children:[this[r(448)],{tag:r(458),attributes:{class:["ck",r(436)]},children:[{text:t[r(449)]}]},{tag:r(458),attributes:{class:["ck",r(437),t[r(444)][r(435)]()],"aria-hidden":r(445)}}]};n&&(o[r(451)]=r(452),o.on={click:s.to((()=>this[r(447)](r(454))))}),this[r(455)](o)}[eu(443)](){const e=eu;this[e(446)][e(443)]()}}function su(e,t){const n=au();return(su=function(e,t){return n[e-=354]})(e,t)}!function(e){const t=su,n=e();for(;;)try{if(663562===parseInt(t(355))/1+-parseInt(t(381))/2*(parseInt(t(364))/3)+-parseInt(t(374))/4*(parseInt(t(377))/5)+parseInt(t(376))/6+-parseInt(t(367))/7*(parseInt(t(380))/8)+parseInt(t(384))/9*(-parseInt(t(383))/10)+parseInt(t(371))/11)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(au);class ou extends r.View{constructor(e,t,n){const s=su;super(e);const o=this[s(385)];this[s(356)](s(358),!1),this[s(356)](s(362),!0),this[s(356)](s(375),""),this[s(361)]=new ps.UserView(e,t),this[s(369)]=new iu(e,t);const i=new r.LabelView(e);i[s(382)][s(370)]=s(372),i[s(360)]=t[s(359)];const a={tag:s(357),attributes:{class:["ck",s(386)],role:s(368),tabindex:o.to(s(358),(e=>!!e&&0)),"aria-labelledby":i.id,"data-cke-tooltip-text":this[s(361)][s(359)],"data-cke-tooltip-position":o.to(s(375)),"data-cke-tooltip-disabled":o.to(s(362),(e=>!e)),"data-cke-tooltip-class":s(363)},children:[this[s(361)],this[s(369)],i]};n&&(a[s(370)]=s(378),a.on={click:o.to((()=>this[s(365)](s(387))))}),this[s(379)](a)}}class iu extends r.View{constructor(e,t){const n=su;super(e),this[n(379)]({tag:n(372),attributes:{class:["ck",n(373),t[n(354)][n(388)]()],"aria-hidden":n(366)}})}}function au(){const e=["set","div","isFocusable","name","text","userView","hasTooltip","ck-presence-list__list-item__tooltip","48RMqpsS","fire","true","343YEqUEW","listitem","markerView","tag","45236455uBfGnh","span","ck-presence-list__marker","12FjjmMB","tooltipPosition","1575942aIsiuD","955545mWgEyt","button","setTemplate","187608UsUZQY","120728iJWxFp","template","380rHkQNn","286650qqiAoZ","bindTemplate","ck-presence-list__list-item","execute","getBackgroundColorClass","color","187050IAzRqH"];return(au=function(){return e})()}const cu=du;function du(e,t){const n=lu();return(du=function(e,t){return n[e-=132]})(e,t)}!function(e){const t=du,n=e();for(;;)try{if(530185===-parseInt(t(144))/1+parseInt(t(151))/2+parseInt(t(134))/3+parseInt(t(216))/4*(-parseInt(t(193))/5)+parseInt(t(162))/6+-parseInt(t(220))/7+parseInt(t(147))/8*(parseInt(t(207))/9))break;n.push(n.shift())}catch(e){n.push(n.shift())}}(lu);const uu={collapseAt:6,displayMe:!0};function lu(){const e=["2572101DkXoWN","Enter","set","focus","indexOf","tabIndex","destroy","hideDropdown","bindTo","isCollapsed",':not([disabled]):not([tabindex="-1"])',"onClick","presenceList.container","_handleUserRemove","686064jEself","plugins","content","input","textarea","presenceDropdownView","listenTo","add","offsetWidth","Esc","1002642AZqtHX","button","requires","8cGxkyI","filter","isFocusable","presenceList.collapseAt","1639596wUMtae","view","length","execute","get","init","activeElement","Shift+Tab","counterView","offsetHeight","bind","51720fgyxoM","[contenteditable]","allConnectedUsers","context","_handleUserAdd","body","isRendered","reverse","presenceList.displayMe","remove","sort","unpin","isExpanded","showDropdown","from","min","balloonPanelView","map","isHidden","items","isMe","render","element","presenceList","usersCount","inlineListView","isVisible","using","number","_bodyCollection","config","4647865QKFSTC","displayMe","select","_createView","pin","ck ck-presence-list__balloon","attachToDom","focusTracker","appendChild","hasTooltip","class","_allConnectedUsers","join","detachFromDom","15954633raZzFj","locale","Tab","keystrokes","presencelist-collapseat-invalid-format","change:isFocused","[tabindex]","define","presencelist-missing-container","4lcHLSU","currentDisplayedUsers","querySelectorAll","checkIfScrollable"];return(lu=function(){return e})()}class pu extends t.ContextPlugin{constructor(e){const t=du;super(e),this[t(191)]=null,this[t(165)][t(192)][t(214)](t(185),uu);const s=e[t(192)][t(155)](t(150));if(t(190)!=typeof s)throw new n.CKEditorError(t(211),this);if(s<1)throw new n.CKEditorError(t(211),this);this[t(204)]=this[t(165)][t(135)][t(155)](ys)[t(164)],this[t(222)](t(186),0),this[t(217)]=new n.Collection,this[t(178)]=new r.BalloonPanelView,this[t(178)][t(203)]=t(198),this[t(152)]=this[t(196)](),this[t(139)]=void 0}static get[cu(146)](){return[ys]}[cu(156)](){const e=cu;for(const t of this[e(204)])this[e(166)](t);this[e(140)](this[e(204)],e(141),((t,n)=>{this[e(166)](n)})),this[e(140)](this[e(204)],e(171),((t,n)=>{this[e(133)](n)}))}[cu(196)](){const e=cu,t=this[e(165)],s=new Kd(this[e(165)][e(208)]),o=this[e(178)];if(!Vd(t[e(192)][e(155)](e(132))))throw new n.CKEditorError(e(215),this);return s[e(159)][e(161)](e(186)).to(this),s[e(161)](e(229)).to(this,e(186),(n=>{const r=e,{collapseAt:o,displayMe:i}=t[r(192)][r(155)](r(185)),a=n>=o;return s[r(159)][r(180)]=!(1==n&&i||a),a||this[r(227)](),a})),s[e(187)][e(181)][e(228)](this[e(217)])[e(189)]((n=>{const r=e,o=t[r(192)][r(155)](r(185)),i=new ou(t[r(208)],n,!!o[r(231)]);return i[r(161)](r(202)).to(s,r(229),(e=>!e)),i[r(161)](r(149)).to(s,r(229),(e=>!e)),o[r(231)]&&this[r(140)](i,r(154),(()=>{const e=r;this[e(152)][e(229)]||o[e(231)](n,i[e(184)])})),i})),this[e(140)](s[e(187)],e(154),(()=>{const t=e;this[t(139)]?this[t(227)]():this[t(152)][t(229)]&&this[t(175)]()})),s[e(187)][e(210)][e(222)](e(221),((t,n)=>{const r=e;this[r(152)][r(229)]&&(this[r(175)](),n())})),s[e(183)](),o[e(183)](),(0,r.clickOutsideHandler)({emitter:s,activator:()=>o[e(188)],contextElements:[o[e(184)],s[e(187)][e(184)]],callback:()=>this[e(227)]()}),t[e(192)][e(155)](e(132))[e(201)](s[e(184)]),this[e(191)]=new r.BodyCollection(this[e(165)][e(208)]),this[e(191)][e(199)](),this[e(191)][e(141)](this[e(178)]),s}[cu(166)](e){const t=cu;if(!this[t(165)][t(192)][t(155)](t(170))&&e[t(182)])return;const n=this[t(165)][t(192)][t(155)](t(150))-1;this[t(186)]++,this[t(217)][t(153)]==n&&this[t(217)][t(153)]>1&&this[t(217)][t(171)](1);const r=e[t(182)]?0:this[t(217)][t(153)];this[t(217)][t(141)](e,r)}[cu(133)](e){const t=cu;if(this[t(186)]--,this[t(217)][t(155)](e.id)&&(this[t(217)][t(171)](e.id),this[t(217)][t(153)]<this[t(186)]))for(const e of Array[t(176)](this[t(204)])[t(169)]())if(!this[t(217)][t(155)](e.id))return void this[t(217)][t(141)](e,Math[t(177)](this[t(217)][t(153)],1))}[cu(175)](){const e=cu;if(this[e(139)])return;const t=this[e(165)][e(192)][e(155)](e(185));this[e(139)]=new $d(this[e(165)][e(208)],!!t[e(231)]),this[e(152)][e(187)][e(174)]=!0;const{listWrapperView:n}=this[e(139)];n[e(181)][e(228)](this[e(204)])[e(189)]((n=>{const r=e;if(!t[r(194)]&&n[r(182)])return null;const s=new ru(this[r(165)][r(208)],n,!!t[r(231)]);return t[r(231)]&&this[r(140)](s,r(154),(()=>{const e=r;t[e(231)](n,s[e(184)])})),s})),this[e(178)][e(136)][e(141)](this[e(139)]),this[e(178)][e(197)]({target:this[e(152)][e(187)][e(184)]}),n[e(223)](),n[e(219)]();const r=(t,n)=>{const r=e;this[r(227)](),this[r(152)][r(187)][r(223)](),n()};n[e(210)][e(222)](e(143),r),n[e(210)][e(222)](e(158),r),n[e(210)][e(222)](e(209),((t,n)=>{const r=e;!function(e){const t=du,n=["a",t(145),t(137),t(195),t(138),t(213),t(163)][t(179)]((e=>e+t(230)))[t(205)](","),r=[...document[t(167)][t(218)](n)][t(148)]((e=>e===document[t(157)]||e[t(142)]+e[t(160)]>0))[t(172)](((e,n)=>(e[t(225)]||0)-(n[t(225)]||0))),s=r[t(224)](e),o=r[(s+1)%r[t(153)]];o&&o[t(223)]()}(this[r(152)][r(184)]),this[r(227)](),n()})),n[e(200)][e(141)](this[e(152)][e(184)]),n[e(200)].on(e(212),((t,n,r)=>{r||this[e(227)]()}))}[cu(227)](){const e=cu;this[e(139)]&&(this[e(152)][e(187)][e(174)]=!1,this[e(178)][e(173)](),this[e(178)][e(136)][e(171)](this[e(139)]),this[e(139)][e(226)](),this[e(139)]=void 0)}[cu(226)](){const e=cu;super[e(226)](),this[e(152)]&&this[e(152)][e(168)]&&this[e(152)][e(226)](),this[e(191)]&&(this[e(191)][e(206)](),this[e(191)][e(226)](),this[e(191)]=null)}}var hu=fu;function fu(e,t){var n=mu();return(fu=function(e,t){return n[e-=220]})(e,t)}function mu(){var e=["isOfficialPlugin","requires","isPremiumPlugin","823116DJuywK","PresenceList","197740hjYOGo","16kisIdO","398118AZPloT","pluginName","29496TnPlxE","575886qjOpgd","941418QgVZcr","8SZAPaR","200425YFFbor"];return(mu=function(){return e})()}!function(e){for(var t=fu,n=e();;)try{if(198333===parseInt(t(220))/1+-parseInt(t(230))/2+parseInt(t(228))/3+-parseInt(t(223))/4*(-parseInt(t(224))/5)+-parseInt(t(221))/6+-parseInt(t(232))/7*(-parseInt(t(231))/8)+-parseInt(t(222))/9)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(mu);class yu extends t.ContextPlugin{static get[hu(226)](){return[ys,pu]}static get[hu(233)](){return hu(229)}static get[hu(225)](){return!0}static get[hu(227)](){return!0}}function gu(){var e=["10683018iYksla","1773686DJhnPz","1523840dBAsCP","3070020NQUIfm","3Fbcvjd","6ycnsYc","679BnqCLp","2351968LchGHR","96664ifmOCg","1207631xOTpbM"];return(gu=function(){return e})()}function bu(e,t){var n=gu();return(bu=function(e,t){return n[e-=231]})(e,t)}!function(e){for(var t=bu,n=e();;)try{if(713873===-parseInt(t(231))/1+-parseInt(t(233))/2*(-parseInt(t(236))/3)+parseInt(t(239))/4+-parseInt(t(235))/5*(-parseInt(t(237))/6)+-parseInt(t(238))/7*(-parseInt(t(240))/8)+-parseInt(t(232))/9+-parseInt(t(234))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(gu)})(),(window.CKEditor5=window.CKEditor5||{}).realTimeCollaboration=__webpack_exports__})();
|