Files
ONE-OS/axhub-make/admin/assets/chunks/index2.js
王冕 a27e3b8e43 feat: sync full workspace including web modules, docs, and configurations to Gitea
Optimized the root .gitignore to exclude virtual environments, node modules,
and temp folders to ensure clean and lightweight version tracking.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 18:12:25 +08:00

3 lines
312 KiB
JavaScript

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chunks/index4.js","assets/chunks/fills-generator.js","assets/chunks/preload-helper.js","assets/chunks/html-to-axure.js"])))=>i.map(i=>d[i]);
import{dg as v}from"./vendor-common.js?v=1775123024591";import{_ as f}from"./preload-helper.js?v=1775123024591";const s=()=>typeof window<"u"&&typeof document<"u",y=()=>typeof navigator<"u"&&!!navigator.clipboard&&typeof navigator.clipboard.write=="function"&&typeof ClipboardItem<"u",S=()=>{var r;return typeof globalThis<"u"&&typeof globalThis.chrome<"u"&&!!((r=globalThis.chrome)!=null&&r.runtime)},l={};l.ByteBuffer=v;l.MessageType={0:"JOIN_START",1:"NODE_CHANGES",2:"USER_CHANGES",3:"JOIN_END",4:"SIGNAL",5:"STYLE",6:"STYLE_SET",7:"JOIN_START_SKIP_RELOAD",8:"NOTIFY_SHOULD_UPGRADE",9:"UPGRADE_DONE",10:"UPGRADE_REFRESH",11:"SCENE_GRAPH_QUERY",12:"SCENE_GRAPH_REPLY",13:"DIFF",14:"CLIENT_BROADCAST",15:"JOIN_START_JOURNALED",16:"STREAM_START",17:"STREAM_END",18:"INTERACTIVE_SLIDE_CHANGE",19:"RECONNECT_SCENE_GRAPH_QUERY",20:"RECONNECT_SCENE_GRAPH_REPLY",21:"JOIN_END_INCREMENTAL_RECONNECT",22:"NODE_STATUS_CHANGE",JOIN_START:0,NODE_CHANGES:1,USER_CHANGES:2,JOIN_END:3,SIGNAL:4,STYLE:5,STYLE_SET:6,JOIN_START_SKIP_RELOAD:7,NOTIFY_SHOULD_UPGRADE:8,UPGRADE_DONE:9,UPGRADE_REFRESH:10,SCENE_GRAPH_QUERY:11,SCENE_GRAPH_REPLY:12,DIFF:13,CLIENT_BROADCAST:14,JOIN_START_JOURNALED:15,STREAM_START:16,STREAM_END:17,INTERACTIVE_SLIDE_CHANGE:18,RECONNECT_SCENE_GRAPH_QUERY:19,RECONNECT_SCENE_GRAPH_REPLY:20,JOIN_END_INCREMENTAL_RECONNECT:21,NODE_STATUS_CHANGE:22};l.Axis={0:"X",1:"Y",X:0,Y:1};l.Access={0:"READ_ONLY",1:"READ_WRITE",READ_ONLY:0,READ_WRITE:1};l.NodePhase={0:"CREATED",1:"REMOVED",CREATED:0,REMOVED:1};l.WindingRule={0:"NONZERO",1:"ODD",NONZERO:0,ODD:1};l.NodeType={0:"NONE",1:"DOCUMENT",2:"CANVAS",3:"GROUP",4:"FRAME",5:"BOOLEAN_OPERATION",6:"VECTOR",7:"STAR",8:"LINE",9:"ELLIPSE",10:"RECTANGLE",11:"REGULAR_POLYGON",12:"ROUNDED_RECTANGLE",13:"TEXT",14:"SLICE",15:"SYMBOL",16:"INSTANCE",17:"STICKY",18:"SHAPE_WITH_TEXT",19:"CONNECTOR",20:"CODE_BLOCK",21:"WIDGET",22:"STAMP",23:"MEDIA",24:"HIGHLIGHT",25:"SECTION",26:"SECTION_OVERLAY",27:"WASHI_TAPE",28:"VARIABLE",29:"TABLE",30:"TABLE_CELL",31:"VARIABLE_SET",32:"SLIDE",33:"ASSISTED_LAYOUT",34:"INTERACTIVE_SLIDE_ELEMENT",35:"VARIABLE_OVERRIDE",36:"MODULE",37:"SLIDE_GRID",38:"SLIDE_ROW",39:"RESPONSIVE_SET",40:"CODE_COMPONENT",41:"TEXT_PATH",NONE:0,DOCUMENT:1,CANVAS:2,GROUP:3,FRAME:4,BOOLEAN_OPERATION:5,VECTOR:6,STAR:7,LINE:8,ELLIPSE:9,RECTANGLE:10,REGULAR_POLYGON:11,ROUNDED_RECTANGLE:12,TEXT:13,SLICE:14,SYMBOL:15,INSTANCE:16,STICKY:17,SHAPE_WITH_TEXT:18,CONNECTOR:19,CODE_BLOCK:20,WIDGET:21,STAMP:22,MEDIA:23,HIGHLIGHT:24,SECTION:25,SECTION_OVERLAY:26,WASHI_TAPE:27,VARIABLE:28,TABLE:29,TABLE_CELL:30,VARIABLE_SET:31,SLIDE:32,ASSISTED_LAYOUT:33,INTERACTIVE_SLIDE_ELEMENT:34,VARIABLE_OVERRIDE:35,MODULE:36,SLIDE_GRID:37,SLIDE_ROW:38,RESPONSIVE_SET:39,CODE_COMPONENT:40,TEXT_PATH:41};l.ShapeWithTextType={0:"SQUARE",1:"ELLIPSE",2:"DIAMOND",3:"TRIANGLE_UP",4:"TRIANGLE_DOWN",5:"ROUNDED_RECTANGLE",6:"PARALLELOGRAM_RIGHT",7:"PARALLELOGRAM_LEFT",8:"ENG_DATABASE",9:"ENG_QUEUE",10:"ENG_FILE",11:"ENG_FOLDER",12:"TRAPEZOID",13:"PREDEFINED_PROCESS",14:"SHIELD",15:"DOCUMENT_SINGLE",16:"DOCUMENT_MULTIPLE",17:"MANUAL_INPUT",18:"HEXAGON",19:"CHEVRON",20:"PENTAGON",21:"OCTAGON",22:"STAR",23:"PLUS",24:"ARROW_LEFT",25:"ARROW_RIGHT",26:"SUMMING_JUNCTION",27:"OR",28:"SPEECH_BUBBLE",29:"INTERNAL_STORAGE",SQUARE:0,ELLIPSE:1,DIAMOND:2,TRIANGLE_UP:3,TRIANGLE_DOWN:4,ROUNDED_RECTANGLE:5,PARALLELOGRAM_RIGHT:6,PARALLELOGRAM_LEFT:7,ENG_DATABASE:8,ENG_QUEUE:9,ENG_FILE:10,ENG_FOLDER:11,TRAPEZOID:12,PREDEFINED_PROCESS:13,SHIELD:14,DOCUMENT_SINGLE:15,DOCUMENT_MULTIPLE:16,MANUAL_INPUT:17,HEXAGON:18,CHEVRON:19,PENTAGON:20,OCTAGON:21,STAR:22,PLUS:23,ARROW_LEFT:24,ARROW_RIGHT:25,SUMMING_JUNCTION:26,OR:27,SPEECH_BUBBLE:28,INTERNAL_STORAGE:29};l.BlendMode={0:"PASS_THROUGH",1:"NORMAL",2:"DARKEN",3:"MULTIPLY",4:"LINEAR_BURN",5:"COLOR_BURN",6:"LIGHTEN",7:"SCREEN",8:"LINEAR_DODGE",9:"COLOR_DODGE",10:"OVERLAY",11:"SOFT_LIGHT",12:"HARD_LIGHT",13:"DIFFERENCE",14:"EXCLUSION",15:"HUE",16:"SATURATION",17:"COLOR",18:"LUMINOSITY",PASS_THROUGH:0,NORMAL:1,DARKEN:2,MULTIPLY:3,LINEAR_BURN:4,COLOR_BURN:5,LIGHTEN:6,SCREEN:7,LINEAR_DODGE:8,COLOR_DODGE:9,OVERLAY:10,SOFT_LIGHT:11,HARD_LIGHT:12,DIFFERENCE:13,EXCLUSION:14,HUE:15,SATURATION:16,COLOR:17,LUMINOSITY:18};l.PaintType={0:"SOLID",1:"GRADIENT_LINEAR",2:"GRADIENT_RADIAL",3:"GRADIENT_ANGULAR",4:"GRADIENT_DIAMOND",5:"IMAGE",6:"EMOJI",7:"VIDEO",SOLID:0,GRADIENT_LINEAR:1,GRADIENT_RADIAL:2,GRADIENT_ANGULAR:3,GRADIENT_DIAMOND:4,IMAGE:5,EMOJI:6,VIDEO:7};l.ImageScaleMode={0:"STRETCH",1:"FIT",2:"FILL",3:"TILE",STRETCH:0,FIT:1,FILL:2,TILE:3};l.EffectType={0:"INNER_SHADOW",1:"DROP_SHADOW",2:"FOREGROUND_BLUR",3:"BACKGROUND_BLUR",INNER_SHADOW:0,DROP_SHADOW:1,FOREGROUND_BLUR:2,BACKGROUND_BLUR:3};l.TextCase={0:"ORIGINAL",1:"UPPER",2:"LOWER",3:"TITLE",4:"SMALL_CAPS",5:"SMALL_CAPS_FORCED",ORIGINAL:0,UPPER:1,LOWER:2,TITLE:3,SMALL_CAPS:4,SMALL_CAPS_FORCED:5};l.TextDecoration={0:"NONE",1:"UNDERLINE",2:"STRIKETHROUGH",NONE:0,UNDERLINE:1,STRIKETHROUGH:2};l.TextDecorationStyle={0:"SOLID",1:"DOTTED",2:"WAVY",SOLID:0,DOTTED:1,WAVY:2};l.LeadingTrim={0:"NONE",1:"CAP_HEIGHT",NONE:0,CAP_HEIGHT:1};l.NumberUnits={0:"RAW",1:"PIXELS",2:"PERCENT",RAW:0,PIXELS:1,PERCENT:2};l.ConstraintType={0:"MIN",1:"CENTER",2:"MAX",3:"STRETCH",4:"SCALE",5:"FIXED_MIN",6:"FIXED_MAX",MIN:0,CENTER:1,MAX:2,STRETCH:3,SCALE:4,FIXED_MIN:5,FIXED_MAX:6};l.StrokeAlign={0:"CENTER",1:"INSIDE",2:"OUTSIDE",CENTER:0,INSIDE:1,OUTSIDE:2};l.StrokeCap={0:"NONE",1:"ROUND",2:"SQUARE",3:"ARROW_LINES",4:"ARROW_EQUILATERAL",5:"DIAMOND_FILLED",6:"TRIANGLE_FILLED",7:"HIGHLIGHT",8:"WASHI_TAPE_1",9:"WASHI_TAPE_2",10:"WASHI_TAPE_3",11:"WASHI_TAPE_4",12:"WASHI_TAPE_5",13:"WASHI_TAPE_6",14:"CIRCLE_FILLED",NONE:0,ROUND:1,SQUARE:2,ARROW_LINES:3,ARROW_EQUILATERAL:4,DIAMOND_FILLED:5,TRIANGLE_FILLED:6,HIGHLIGHT:7,WASHI_TAPE_1:8,WASHI_TAPE_2:9,WASHI_TAPE_3:10,WASHI_TAPE_4:11,WASHI_TAPE_5:12,WASHI_TAPE_6:13,CIRCLE_FILLED:14};l.StrokeJoin={0:"MITER",1:"BEVEL",2:"ROUND",MITER:0,BEVEL:1,ROUND:2};l.BooleanOperation={0:"UNION",1:"INTERSECT",2:"SUBTRACT",3:"XOR",UNION:0,INTERSECT:1,SUBTRACT:2,XOR:3};l.TextAlignHorizontal={0:"LEFT",1:"CENTER",2:"RIGHT",3:"JUSTIFIED",LEFT:0,CENTER:1,RIGHT:2,JUSTIFIED:3};l.TextAlignVertical={0:"TOP",1:"CENTER",2:"BOTTOM",TOP:0,CENTER:1,BOTTOM:2};l.MouseCursor={0:"DEFAULT",1:"CROSSHAIR",2:"EYEDROPPER",3:"HAND",4:"PAINT_BUCKET",5:"PEN",6:"PENCIL",7:"MARKER",8:"ERASER",9:"HIGHLIGHTER",10:"LASSO",DEFAULT:0,CROSSHAIR:1,EYEDROPPER:2,HAND:3,PAINT_BUCKET:4,PEN:5,PENCIL:6,MARKER:7,ERASER:8,HIGHLIGHTER:9,LASSO:10};l.VectorMirror={0:"NONE",1:"ANGLE",2:"ANGLE_AND_LENGTH",NONE:0,ANGLE:1,ANGLE_AND_LENGTH:2};l.DashMode={0:"CLIP",1:"STRETCH",CLIP:0,STRETCH:1};l.ImageType={0:"PNG",1:"JPEG",2:"SVG",3:"PDF",PNG:0,JPEG:1,SVG:2,PDF:3};l.ExportConstraintType={0:"CONTENT_SCALE",1:"CONTENT_WIDTH",2:"CONTENT_HEIGHT",CONTENT_SCALE:0,CONTENT_WIDTH:1,CONTENT_HEIGHT:2};l.LayoutGridType={0:"MIN",1:"CENTER",2:"STRETCH",3:"MAX",MIN:0,CENTER:1,STRETCH:2,MAX:3};l.LayoutGridPattern={0:"STRIPES",1:"GRID",STRIPES:0,GRID:1};l.TextAutoResize={0:"NONE",1:"WIDTH_AND_HEIGHT",2:"HEIGHT",NONE:0,WIDTH_AND_HEIGHT:1,HEIGHT:2};l.TextTruncation={0:"DISABLED",1:"ENDING",DISABLED:0,ENDING:1};l.StyleSetType={0:"PERSONAL",1:"TEAM",2:"CUSTOM",3:"FREQUENCY",4:"TEMPORARY",PERSONAL:0,TEAM:1,CUSTOM:2,FREQUENCY:3,TEMPORARY:4};l.StyleSetContentType={0:"SOLID",1:"GRADIENT",2:"IMAGE",SOLID:0,GRADIENT:1,IMAGE:2};l.StackMode={0:"NONE",1:"HORIZONTAL",2:"VERTICAL",NONE:0,HORIZONTAL:1,VERTICAL:2};l.StackAlign={0:"MIN",1:"CENTER",2:"MAX",3:"BASELINE",MIN:0,CENTER:1,MAX:2,BASELINE:3};l.StackCounterAlign={0:"MIN",1:"CENTER",2:"MAX",3:"STRETCH",4:"AUTO",5:"BASELINE",MIN:0,CENTER:1,MAX:2,STRETCH:3,AUTO:4,BASELINE:5};l.StackJustify={0:"MIN",1:"CENTER",2:"MAX",3:"SPACE_EVENLY",4:"SPACE_BETWEEN",MIN:0,CENTER:1,MAX:2,SPACE_EVENLY:3,SPACE_BETWEEN:4};l.StackSize={0:"FIXED",1:"RESIZE_TO_FIT",2:"RESIZE_TO_FIT_WITH_IMPLICIT_SIZE",FIXED:0,RESIZE_TO_FIT:1,RESIZE_TO_FIT_WITH_IMPLICIT_SIZE:2};l.StackPositioning={0:"AUTO",1:"ABSOLUTE",AUTO:0,ABSOLUTE:1};l.StackWrap={0:"NO_WRAP",1:"WRAP",NO_WRAP:0,WRAP:1};l.StackCounterAlignContent={0:"AUTO",1:"SPACE_BETWEEN",AUTO:0,SPACE_BETWEEN:1};l.ConnectionType={0:"NONE",1:"INTERNAL_NODE",2:"URL",3:"BACK",4:"CLOSE",5:"SET_VARIABLE",6:"UPDATE_MEDIA_RUNTIME",7:"CONDITIONAL",8:"SET_VARIABLE_MODE",NONE:0,INTERNAL_NODE:1,URL:2,BACK:3,CLOSE:4,SET_VARIABLE:5,UPDATE_MEDIA_RUNTIME:6,CONDITIONAL:7,SET_VARIABLE_MODE:8};l.InteractionType={0:"ON_CLICK",1:"AFTER_TIMEOUT",2:"MOUSE_IN",3:"MOUSE_OUT",4:"ON_HOVER",5:"MOUSE_DOWN",6:"MOUSE_UP",7:"ON_PRESS",8:"NONE",9:"DRAG",10:"ON_KEY_DOWN",11:"ON_VOICE",12:"ON_MEDIA_HIT",13:"ON_MEDIA_END",14:"MOUSE_ENTER",15:"MOUSE_LEAVE",ON_CLICK:0,AFTER_TIMEOUT:1,MOUSE_IN:2,MOUSE_OUT:3,ON_HOVER:4,MOUSE_DOWN:5,MOUSE_UP:6,ON_PRESS:7,NONE:8,DRAG:9,ON_KEY_DOWN:10,ON_VOICE:11,ON_MEDIA_HIT:12,ON_MEDIA_END:13,MOUSE_ENTER:14,MOUSE_LEAVE:15};l.TransitionType={0:"INSTANT_TRANSITION",1:"DISSOLVE",2:"FADE",3:"SLIDE_FROM_LEFT",4:"SLIDE_FROM_RIGHT",5:"SLIDE_FROM_TOP",6:"SLIDE_FROM_BOTTOM",7:"PUSH_FROM_LEFT",8:"PUSH_FROM_RIGHT",9:"PUSH_FROM_TOP",10:"PUSH_FROM_BOTTOM",11:"MOVE_FROM_LEFT",12:"MOVE_FROM_RIGHT",13:"MOVE_FROM_TOP",14:"MOVE_FROM_BOTTOM",15:"SLIDE_OUT_TO_LEFT",16:"SLIDE_OUT_TO_RIGHT",17:"SLIDE_OUT_TO_TOP",18:"SLIDE_OUT_TO_BOTTOM",19:"MOVE_OUT_TO_LEFT",20:"MOVE_OUT_TO_RIGHT",21:"MOVE_OUT_TO_TOP",22:"MOVE_OUT_TO_BOTTOM",23:"MAGIC_MOVE",24:"SMART_ANIMATE",25:"SCROLL_ANIMATE",INSTANT_TRANSITION:0,DISSOLVE:1,FADE:2,SLIDE_FROM_LEFT:3,SLIDE_FROM_RIGHT:4,SLIDE_FROM_TOP:5,SLIDE_FROM_BOTTOM:6,PUSH_FROM_LEFT:7,PUSH_FROM_RIGHT:8,PUSH_FROM_TOP:9,PUSH_FROM_BOTTOM:10,MOVE_FROM_LEFT:11,MOVE_FROM_RIGHT:12,MOVE_FROM_TOP:13,MOVE_FROM_BOTTOM:14,SLIDE_OUT_TO_LEFT:15,SLIDE_OUT_TO_RIGHT:16,SLIDE_OUT_TO_TOP:17,SLIDE_OUT_TO_BOTTOM:18,MOVE_OUT_TO_LEFT:19,MOVE_OUT_TO_RIGHT:20,MOVE_OUT_TO_TOP:21,MOVE_OUT_TO_BOTTOM:22,MAGIC_MOVE:23,SMART_ANIMATE:24,SCROLL_ANIMATE:25};l.EasingType={0:"IN_CUBIC",1:"OUT_CUBIC",2:"INOUT_CUBIC",3:"LINEAR",4:"IN_BACK_CUBIC",5:"OUT_BACK_CUBIC",6:"INOUT_BACK_CUBIC",7:"CUSTOM_CUBIC",8:"SPRING",9:"GENTLE_SPRING",10:"CUSTOM_SPRING",11:"SPRING_PRESET_ONE",12:"SPRING_PRESET_TWO",13:"SPRING_PRESET_THREE",IN_CUBIC:0,OUT_CUBIC:1,INOUT_CUBIC:2,LINEAR:3,IN_BACK_CUBIC:4,OUT_BACK_CUBIC:5,INOUT_BACK_CUBIC:6,CUSTOM_CUBIC:7,SPRING:8,GENTLE_SPRING:9,CUSTOM_SPRING:10,SPRING_PRESET_ONE:11,SPRING_PRESET_TWO:12,SPRING_PRESET_THREE:13};l.ScrollDirection={0:"NONE",1:"HORIZONTAL",2:"VERTICAL",3:"BOTH",NONE:0,HORIZONTAL:1,VERTICAL:2,BOTH:3};l.ScrollContractedState={0:"EXPANDED",1:"CONTRACTED",EXPANDED:0,CONTRACTED:1};l.decodeGUID=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.sessionID=r.readVarUint(),e.localID=r.readVarUint(),e};l.encodeGUID=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.sessionID;if(t!=null)e.writeVarUint(t);else throw new Error('Missing required field "sessionID"');var t=r.localID;if(t!=null)e.writeVarUint(t);else throw new Error('Missing required field "localID"');if(n)return e.toUint8Array()};l.decodeColor=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.r=r.readVarFloat(),e.g=r.readVarFloat(),e.b=r.readVarFloat(),e.a=r.readVarFloat(),e};l.encodeColor=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.r;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "r"');var t=r.g;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "g"');var t=r.b;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "b"');var t=r.a;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "a"');if(n)return e.toUint8Array()};l.decodeVector=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.x=r.readVarFloat(),e.y=r.readVarFloat(),e};l.encodeVector=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.x;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "x"');var t=r.y;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "y"');if(n)return e.toUint8Array()};l.decodeRect=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.x=r.readVarFloat(),e.y=r.readVarFloat(),e.w=r.readVarFloat(),e.h=r.readVarFloat(),e};l.encodeRect=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.x;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "x"');var t=r.y;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "y"');var t=r.w;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "w"');var t=r.h;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "h"');if(n)return e.toUint8Array()};l.decodeColorStop=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.color=this.decodeColor(r),e.position=r.readVarFloat(),e};l.encodeColorStop=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.color;if(t!=null)this.encodeColor(t,e);else throw new Error('Missing required field "color"');var t=r.position;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "position"');if(n)return e.toUint8Array()};l.decodeColorStopVar=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.color=this.decodeColor(r);break;case 2:e.colorVar=this.decodeVariableData(r);break;case 3:e.position=r.readVarFloat();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeColorStopVar=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.color;t!=null&&(e.writeVarUint(1),this.encodeColor(t,e));var t=r.colorVar;t!=null&&(e.writeVarUint(2),this.encodeVariableData(t,e));var t=r.position;if(t!=null&&(e.writeVarUint(3),e.writeVarFloat(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeMatrix=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.m00=r.readVarFloat(),e.m01=r.readVarFloat(),e.m02=r.readVarFloat(),e.m10=r.readVarFloat(),e.m11=r.readVarFloat(),e.m12=r.readVarFloat(),e};l.encodeMatrix=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.m00;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "m00"');var t=r.m01;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "m01"');var t=r.m02;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "m02"');var t=r.m10;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "m10"');var t=r.m11;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "m11"');var t=r.m12;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "m12"');if(n)return e.toUint8Array()};l.decodeParentIndex=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.guid=this.decodeGUID(r),e.position=r.readString(),e};l.encodeParentIndex=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.guid;if(t!=null)this.encodeGUID(t,e);else throw new Error('Missing required field "guid"');var t=r.position;if(t!=null)e.writeString(t);else throw new Error('Missing required field "position"');if(n)return e.toUint8Array()};l.decodeNumber=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.value=r.readVarFloat(),e.units=this.NumberUnits[r.readVarUint()],e};l.encodeNumber=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.value;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "value"');var t=r.units;if(t!=null){var i=this.NumberUnits[t];if(i===void 0)throw new Error("Invalid value "+JSON.stringify(t)+' for enum "NumberUnits"');e.writeVarUint(i)}else throw new Error('Missing required field "units"');if(n)return e.toUint8Array()};l.decodeFontName=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.family=r.readString(),e.style=r.readString(),e.postscript=r.readString(),e};l.encodeFontName=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.family;if(t!=null)e.writeString(t);else throw new Error('Missing required field "family"');var t=r.style;if(t!=null)e.writeString(t);else throw new Error('Missing required field "style"');var t=r.postscript;if(t!=null)e.writeString(t);else throw new Error('Missing required field "postscript"');if(n)return e.toUint8Array()};l.FontVariantNumericFigure={0:"NORMAL",1:"LINING",2:"OLDSTYLE",NORMAL:0,LINING:1,OLDSTYLE:2};l.FontVariantNumericSpacing={0:"NORMAL",1:"PROPORTIONAL",2:"TABULAR",NORMAL:0,PROPORTIONAL:1,TABULAR:2};l.FontVariantNumericFraction={0:"NORMAL",1:"DIAGONAL",2:"STACKED",NORMAL:0,DIAGONAL:1,STACKED:2};l.FontVariantCaps={0:"NORMAL",1:"SMALL",2:"ALL_SMALL",3:"PETITE",4:"ALL_PETITE",5:"UNICASE",6:"TITLING",NORMAL:0,SMALL:1,ALL_SMALL:2,PETITE:3,ALL_PETITE:4,UNICASE:5,TITLING:6};l.FontVariantPosition={0:"NORMAL",1:"SUB",2:"SUPER",NORMAL:0,SUB:1,SUPER:2};l.FontStyle={0:"NORMAL",1:"ITALIC",NORMAL:0,ITALIC:1};l.SemanticWeight={0:"NORMAL",1:"BOLD",NORMAL:0,BOLD:1};l.SemanticItalic={0:"NORMAL",1:"ITALIC",NORMAL:0,ITALIC:1};l.OpenTypeFeature={0:"PCAP",1:"C2PC",2:"CASE",3:"CPSP",4:"TITL",5:"UNIC",6:"ZERO",7:"SINF",8:"ORDN",9:"AFRC",10:"DNOM",11:"NUMR",12:"LIGA",13:"CLIG",14:"DLIG",15:"HLIG",16:"RLIG",17:"AALT",18:"CALT",19:"RCLT",20:"SALT",21:"RVRN",22:"VERT",23:"SWSH",24:"CSWH",25:"NALT",26:"CCMP",27:"STCH",28:"HIST",29:"SIZE",30:"ORNM",31:"ITAL",32:"RAND",33:"DTLS",34:"FLAC",35:"MGRK",36:"SSTY",37:"KERN",38:"FWID",39:"HWID",40:"HALT",41:"TWID",42:"QWID",43:"PWID",44:"JUST",45:"LFBD",46:"OPBD",47:"RTBD",48:"PALT",49:"PKNA",50:"LTRA",51:"LTRM",52:"RTLA",53:"RTLM",54:"ABRV",55:"ABVM",56:"ABVS",57:"VALT",58:"VHAL",59:"BLWF",60:"BLWM",61:"BLWS",62:"AKHN",63:"CJCT",64:"CFAR",65:"CPCT",66:"CURS",67:"DIST",68:"EXPT",69:"FALT",70:"FINA",71:"FIN2",72:"FIN3",73:"HALF",74:"HALN",75:"HKNA",76:"HNGL",77:"HOJO",78:"INIT",79:"ISOL",80:"JP78",81:"JP83",82:"JP90",83:"JP04",84:"LJMO",85:"LOCL",86:"MARK",87:"MEDI",88:"MED2",89:"MKMK",90:"NLCK",91:"NUKT",92:"PREF",93:"PRES",94:"VPAL",95:"PSTF",96:"PSTS",97:"RKRF",98:"RPHF",99:"RUBY",100:"SMPL",101:"TJMO",102:"TNAM",103:"TRAD",104:"VATU",105:"VJMO",106:"VKNA",107:"VKRN",108:"VRTR",109:"VRT2",110:"SS01",111:"SS02",112:"SS03",113:"SS04",114:"SS05",115:"SS06",116:"SS07",117:"SS08",118:"SS09",119:"SS10",120:"SS11",121:"SS12",122:"SS13",123:"SS14",124:"SS15",125:"SS16",126:"SS17",127:"SS18",128:"SS19",129:"SS20",130:"CV01",131:"CV02",132:"CV03",133:"CV04",134:"CV05",135:"CV06",136:"CV07",137:"CV08",138:"CV09",139:"CV10",140:"CV11",141:"CV12",142:"CV13",143:"CV14",144:"CV15",145:"CV16",146:"CV17",147:"CV18",148:"CV19",149:"CV20",150:"CV21",151:"CV22",152:"CV23",153:"CV24",154:"CV25",155:"CV26",156:"CV27",157:"CV28",158:"CV29",159:"CV30",160:"CV31",161:"CV32",162:"CV33",163:"CV34",164:"CV35",165:"CV36",166:"CV37",167:"CV38",168:"CV39",169:"CV40",170:"CV41",171:"CV42",172:"CV43",173:"CV44",174:"CV45",175:"CV46",176:"CV47",177:"CV48",178:"CV49",179:"CV50",180:"CV51",181:"CV52",182:"CV53",183:"CV54",184:"CV55",185:"CV56",186:"CV57",187:"CV58",188:"CV59",189:"CV60",190:"CV61",191:"CV62",192:"CV63",193:"CV64",194:"CV65",195:"CV66",196:"CV67",197:"CV68",198:"CV69",199:"CV70",200:"CV71",201:"CV72",202:"CV73",203:"CV74",204:"CV75",205:"CV76",206:"CV77",207:"CV78",208:"CV79",209:"CV80",210:"CV81",211:"CV82",212:"CV83",213:"CV84",214:"CV85",215:"CV86",216:"CV87",217:"CV88",218:"CV89",219:"CV90",220:"CV91",221:"CV92",222:"CV93",223:"CV94",224:"CV95",225:"CV96",226:"CV97",227:"CV98",228:"CV99",PCAP:0,C2PC:1,CASE:2,CPSP:3,TITL:4,UNIC:5,ZERO:6,SINF:7,ORDN:8,AFRC:9,DNOM:10,NUMR:11,LIGA:12,CLIG:13,DLIG:14,HLIG:15,RLIG:16,AALT:17,CALT:18,RCLT:19,SALT:20,RVRN:21,VERT:22,SWSH:23,CSWH:24,NALT:25,CCMP:26,STCH:27,HIST:28,SIZE:29,ORNM:30,ITAL:31,RAND:32,DTLS:33,FLAC:34,MGRK:35,SSTY:36,KERN:37,FWID:38,HWID:39,HALT:40,TWID:41,QWID:42,PWID:43,JUST:44,LFBD:45,OPBD:46,RTBD:47,PALT:48,PKNA:49,LTRA:50,LTRM:51,RTLA:52,RTLM:53,ABRV:54,ABVM:55,ABVS:56,VALT:57,VHAL:58,BLWF:59,BLWM:60,BLWS:61,AKHN:62,CJCT:63,CFAR:64,CPCT:65,CURS:66,DIST:67,EXPT:68,FALT:69,FINA:70,FIN2:71,FIN3:72,HALF:73,HALN:74,HKNA:75,HNGL:76,HOJO:77,INIT:78,ISOL:79,JP78:80,JP83:81,JP90:82,JP04:83,LJMO:84,LOCL:85,MARK:86,MEDI:87,MED2:88,MKMK:89,NLCK:90,NUKT:91,PREF:92,PRES:93,VPAL:94,PSTF:95,PSTS:96,RKRF:97,RPHF:98,RUBY:99,SMPL:100,TJMO:101,TNAM:102,TRAD:103,VATU:104,VJMO:105,VKNA:106,VKRN:107,VRTR:108,VRT2:109,SS01:110,SS02:111,SS03:112,SS04:113,SS05:114,SS06:115,SS07:116,SS08:117,SS09:118,SS10:119,SS11:120,SS12:121,SS13:122,SS14:123,SS15:124,SS16:125,SS17:126,SS18:127,SS19:128,SS20:129,CV01:130,CV02:131,CV03:132,CV04:133,CV05:134,CV06:135,CV07:136,CV08:137,CV09:138,CV10:139,CV11:140,CV12:141,CV13:142,CV14:143,CV15:144,CV16:145,CV17:146,CV18:147,CV19:148,CV20:149,CV21:150,CV22:151,CV23:152,CV24:153,CV25:154,CV26:155,CV27:156,CV28:157,CV29:158,CV30:159,CV31:160,CV32:161,CV33:162,CV34:163,CV35:164,CV36:165,CV37:166,CV38:167,CV39:168,CV40:169,CV41:170,CV42:171,CV43:172,CV44:173,CV45:174,CV46:175,CV47:176,CV48:177,CV49:178,CV50:179,CV51:180,CV52:181,CV53:182,CV54:183,CV55:184,CV56:185,CV57:186,CV58:187,CV59:188,CV60:189,CV61:190,CV62:191,CV63:192,CV64:193,CV65:194,CV66:195,CV67:196,CV68:197,CV69:198,CV70:199,CV71:200,CV72:201,CV73:202,CV74:203,CV75:204,CV76:205,CV77:206,CV78:207,CV79:208,CV80:209,CV81:210,CV82:211,CV83:212,CV84:213,CV85:214,CV86:215,CV87:216,CV88:217,CV89:218,CV90:219,CV91:220,CV92:221,CV93:222,CV94:223,CV95:224,CV96:225,CV97:226,CV98:227,CV99:228};l.decodeExportConstraint=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.type=this.ExportConstraintType[r.readVarUint()],e.value=r.readVarFloat(),e};l.encodeExportConstraint=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.type;if(i!=null){var t=this.ExportConstraintType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "ExportConstraintType"');e.writeVarUint(t)}else throw new Error('Missing required field "type"');var i=r.value;if(i!=null)e.writeVarFloat(i);else throw new Error('Missing required field "value"');if(n)return e.toUint8Array()};l.decodeGUIDMapping=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.from=this.decodeGUID(r),e.to=this.decodeGUID(r),e};l.encodeGUIDMapping=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.from;if(t!=null)this.encodeGUID(t,e);else throw new Error('Missing required field "from"');var t=r.to;if(t!=null)this.encodeGUID(t,e);else throw new Error('Missing required field "to"');if(n)return e.toUint8Array()};l.decodeBlob=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.bytes=r.readByteArray(),e};l.encodeBlob=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.bytes;if(t!=null)e.writeByteArray(t);else throw new Error('Missing required field "bytes"');if(n)return e.toUint8Array()};l.decodeImage=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.hash=r.readByteArray();break;case 2:e.name=r.readString();break;case 3:e.dataBlob=r.readVarUint();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeImage=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.hash;t!=null&&(e.writeVarUint(1),e.writeByteArray(t));var t=r.name;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.dataBlob;if(t!=null&&(e.writeVarUint(3),e.writeVarUint(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeVideo=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.hash=r.readByteArray();break;case 2:e.s3Url=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVideo=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.hash;t!=null&&(e.writeVarUint(1),e.writeByteArray(t));var t=r.s3Url;if(t!=null&&(e.writeVarUint(2),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodePasteSource=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.srcFile=r.readString();break;case 2:e.srcNode=this.decodeGUID(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodePasteSource=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.srcFile;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.srcNode;if(t!=null&&(e.writeVarUint(2),this.encodeGUID(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeFilterColorAdjust=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.tint=r.readVarFloat(),e.shadows=r.readVarFloat(),e.highlights=r.readVarFloat(),e.detail=r.readVarFloat(),e.exposure=r.readVarFloat(),e.vignette=r.readVarFloat(),e.temperature=r.readVarFloat(),e.vibrance=r.readVarFloat(),e};l.encodeFilterColorAdjust=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.tint;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "tint"');var t=r.shadows;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "shadows"');var t=r.highlights;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "highlights"');var t=r.detail;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "detail"');var t=r.exposure;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "exposure"');var t=r.vignette;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "vignette"');var t=r.temperature;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "temperature"');var t=r.vibrance;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "vibrance"');if(n)return e.toUint8Array()};l.decodePaintFilterMessage=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.tint=r.readVarFloat();break;case 2:e.shadows=r.readVarFloat();break;case 3:e.highlights=r.readVarFloat();break;case 4:e.detail=r.readVarFloat();break;case 5:e.exposure=r.readVarFloat();break;case 6:e.vignette=r.readVarFloat();break;case 7:e.temperature=r.readVarFloat();break;case 8:e.vibrance=r.readVarFloat();break;case 9:e.contrast=r.readVarFloat();break;case 10:e.brightness=r.readVarFloat();break;default:throw new Error("Attempted to parse invalid message")}};l.encodePaintFilterMessage=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.tint;t!=null&&(e.writeVarUint(1),e.writeVarFloat(t));var t=r.shadows;t!=null&&(e.writeVarUint(2),e.writeVarFloat(t));var t=r.highlights;t!=null&&(e.writeVarUint(3),e.writeVarFloat(t));var t=r.detail;t!=null&&(e.writeVarUint(4),e.writeVarFloat(t));var t=r.exposure;t!=null&&(e.writeVarUint(5),e.writeVarFloat(t));var t=r.vignette;t!=null&&(e.writeVarUint(6),e.writeVarFloat(t));var t=r.temperature;t!=null&&(e.writeVarUint(7),e.writeVarFloat(t));var t=r.vibrance;t!=null&&(e.writeVarUint(8),e.writeVarFloat(t));var t=r.contrast;t!=null&&(e.writeVarUint(9),e.writeVarFloat(t));var t=r.brightness;if(t!=null&&(e.writeVarUint(10),e.writeVarFloat(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodePaint=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.type=this.PaintType[r.readVarUint()];break;case 2:e.color=this.decodeColor(r);break;case 3:e.opacity=r.readVarFloat();break;case 4:e.visible=!!r.readByte();break;case 5:e.blendMode=this.BlendMode[r.readVarUint()];break;case 6:for(var t=r.readVarUint(),i=e.stops=Array(t),n=0;n<t;n++)i[n]=this.decodeColorStop(r);break;case 7:e.transform=this.decodeMatrix(r);break;case 8:e.image=this.decodeImage(r);break;case 9:e.imageThumbnail=this.decodeImage(r);break;case 16:e.animatedImage=this.decodeImage(r);break;case 17:e.animationFrame=r.readVarUint();break;case 10:e.imageScaleMode=this.ImageScaleMode[r.readVarUint()];break;case 22:e.imageShouldColorManage=!!r.readByte();break;case 11:e.rotation=r.readVarFloat();break;case 12:e.scale=r.readVarFloat();break;case 13:e.filterColorAdjust=this.decodeFilterColorAdjust(r);break;case 14:e.paintFilter=this.decodePaintFilterMessage(r);break;case 15:for(var t=r.readVarUint(),i=e.emojiCodePoints=Array(t),n=0;n<t;n++)i[n]=r.readVarUint();break;case 18:e.video=this.decodeVideo(r);break;case 19:e.originalImageWidth=r.readVarUint();break;case 20:e.originalImageHeight=r.readVarUint();break;case 21:e.colorVar=this.decodeVariableData(r);break;case 23:for(var t=r.readVarUint(),i=e.stopsVar=Array(t),n=0;n<t;n++)i[n]=this.decodeColorStopVar(r);break;case 24:e.thumbHashBase64=r.readString();break;case 25:e.thumbHash=r.readByteArray();break;default:throw new Error("Attempted to parse invalid message")}};l.encodePaint=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var a=r.type;if(a!=null){e.writeVarUint(1);var t=this.PaintType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "PaintType"');e.writeVarUint(t)}var a=r.color;a!=null&&(e.writeVarUint(2),this.encodeColor(a,e));var a=r.opacity;a!=null&&(e.writeVarUint(3),e.writeVarFloat(a));var a=r.visible;a!=null&&(e.writeVarUint(4),e.writeByte(a));var a=r.blendMode;if(a!=null){e.writeVarUint(5);var t=this.BlendMode[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "BlendMode"');e.writeVarUint(t)}var a=r.stops;if(a!=null){e.writeVarUint(6);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeColorStop(a,e)}var a=r.transform;a!=null&&(e.writeVarUint(7),this.encodeMatrix(a,e));var a=r.image;a!=null&&(e.writeVarUint(8),this.encodeImage(a,e));var a=r.imageThumbnail;a!=null&&(e.writeVarUint(9),this.encodeImage(a,e));var a=r.animatedImage;a!=null&&(e.writeVarUint(16),this.encodeImage(a,e));var a=r.animationFrame;a!=null&&(e.writeVarUint(17),e.writeVarUint(a));var a=r.imageScaleMode;if(a!=null){e.writeVarUint(10);var t=this.ImageScaleMode[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "ImageScaleMode"');e.writeVarUint(t)}var a=r.imageShouldColorManage;a!=null&&(e.writeVarUint(22),e.writeByte(a));var a=r.rotation;a!=null&&(e.writeVarUint(11),e.writeVarFloat(a));var a=r.scale;a!=null&&(e.writeVarUint(12),e.writeVarFloat(a));var a=r.filterColorAdjust;a!=null&&(e.writeVarUint(13),this.encodeFilterColorAdjust(a,e));var a=r.paintFilter;a!=null&&(e.writeVarUint(14),this.encodePaintFilterMessage(a,e));var a=r.emojiCodePoints;if(a!=null){e.writeVarUint(15);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],e.writeVarUint(a)}var a=r.video;a!=null&&(e.writeVarUint(18),this.encodeVideo(a,e));var a=r.originalImageWidth;a!=null&&(e.writeVarUint(19),e.writeVarUint(a));var a=r.originalImageHeight;a!=null&&(e.writeVarUint(20),e.writeVarUint(a));var a=r.colorVar;a!=null&&(e.writeVarUint(21),this.encodeVariableData(a,e));var a=r.stopsVar;if(a!=null){e.writeVarUint(23);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeColorStopVar(a,e)}var a=r.thumbHashBase64;a!=null&&(e.writeVarUint(24),e.writeString(a));var a=r.thumbHash;if(a!=null&&(e.writeVarUint(25),e.writeByteArray(a)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeFontMetaData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.key=this.decodeFontName(r);break;case 2:e.fontLineHeight=r.readVarFloat();break;case 3:e.fontDigest=r.readByteArray();break;case 4:e.fontStyle=this.FontStyle[r.readVarUint()];break;case 5:e.fontWeight=r.readVarInt();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeFontMetaData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.key;i!=null&&(e.writeVarUint(1),this.encodeFontName(i,e));var i=r.fontLineHeight;i!=null&&(e.writeVarUint(2),e.writeVarFloat(i));var i=r.fontDigest;i!=null&&(e.writeVarUint(3),e.writeByteArray(i));var i=r.fontStyle;if(i!=null){e.writeVarUint(4);var t=this.FontStyle[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "FontStyle"');e.writeVarUint(t)}var i=r.fontWeight;if(i!=null&&(e.writeVarUint(5),e.writeVarInt(i)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeFontVariation=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.axisTag=r.readVarUint();break;case 2:e.axisName=r.readString();break;case 3:e.value=r.readVarFloat();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeFontVariation=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.axisTag;t!=null&&(e.writeVarUint(1),e.writeVarUint(t));var t=r.axisName;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.value;if(t!=null&&(e.writeVarUint(3),e.writeVarFloat(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeTextData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.characters=r.readString();break;case 2:for(var t=r.readVarUint(),i=e.characterStyleIDs=Array(t),n=0;n<t;n++)i[n]=r.readVarUint();break;case 3:for(var t=r.readVarUint(),i=e.styleOverrideTable=Array(t),n=0;n<t;n++)i[n]=this.decodeNodeChange(r);break;case 12:for(var t=r.readVarUint(),i=e.lines=Array(t),n=0;n<t;n++)i[n]=this.decodeTextLineData(r);break;case 8:e.layoutVersion=r.readVarUint();break;case 10:for(var t=r.readVarUint(),i=e.fallbackFonts=Array(t),n=0;n<t;n++)i[n]=this.decodeFontName(r);break;case 17:e.minContentHeight=r.readVarFloat();break;case 4:e.layoutSize=this.decodeVector(r);break;case 5:for(var t=r.readVarUint(),i=e.baselines=Array(t),n=0;n<t;n++)i[n]=this.decodeBaseline(r);break;case 6:for(var t=r.readVarUint(),i=e.glyphs=Array(t),n=0;n<t;n++)i[n]=this.decodeGlyph(r);break;case 7:for(var t=r.readVarUint(),i=e.decorations=Array(t),n=0;n<t;n++)i[n]=this.decodeDecoration(r);break;case 16:for(var t=r.readVarUint(),i=e.blockquotes=Array(t),n=0;n<t;n++)i[n]=this.decodeBlockquote(r);break;case 9:for(var t=r.readVarUint(),i=e.fontMetaData=Array(t),n=0;n<t;n++)i[n]=this.decodeFontMetaData(r);break;case 11:for(var t=r.readVarUint(),i=e.hyperlinkBoxes=Array(t),n=0;n<t;n++)i[n]=this.decodeHyperlinkBox(r);break;case 13:e.truncationStartIndex=r.readVarInt();break;case 14:e.truncatedHeight=r.readVarFloat();break;case 15:for(var t=r.readVarUint(),i=e.logicalIndexToCharacterOffsetMap=Array(t),n=0;n<t;n++)i[n]=r.readVarFloat();break;case 18:for(var t=r.readVarUint(),i=e.mentionBoxes=Array(t),n=0;n<t;n++)i[n]=this.decodeMentionBox(r);break;case 19:for(var t=r.readVarUint(),i=e.derivedLines=Array(t),n=0;n<t;n++)i[n]=this.decodeDerivedTextLineData(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeTextData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.characters;o!=null&&(e.writeVarUint(1),e.writeString(o));var o=r.characterStyleIDs;if(o!=null){e.writeVarUint(2);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],e.writeVarUint(o)}var o=r.styleOverrideTable;if(o!=null){e.writeVarUint(3);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeNodeChange(o,e)}var o=r.lines;if(o!=null){e.writeVarUint(12);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeTextLineData(o,e)}var o=r.layoutVersion;o!=null&&(e.writeVarUint(8),e.writeVarUint(o));var o=r.fallbackFonts;if(o!=null){e.writeVarUint(10);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeFontName(o,e)}var o=r.minContentHeight;o!=null&&(e.writeVarUint(17),e.writeVarFloat(o));var o=r.layoutSize;o!=null&&(e.writeVarUint(4),this.encodeVector(o,e));var o=r.baselines;if(o!=null){e.writeVarUint(5);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeBaseline(o,e)}var o=r.glyphs;if(o!=null){e.writeVarUint(6);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeGlyph(o,e)}var o=r.decorations;if(o!=null){e.writeVarUint(7);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeDecoration(o,e)}var o=r.blockquotes;if(o!=null){e.writeVarUint(16);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeBlockquote(o,e)}var o=r.fontMetaData;if(o!=null){e.writeVarUint(9);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeFontMetaData(o,e)}var o=r.hyperlinkBoxes;if(o!=null){e.writeVarUint(11);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeHyperlinkBox(o,e)}var o=r.truncationStartIndex;o!=null&&(e.writeVarUint(13),e.writeVarInt(o));var o=r.truncatedHeight;o!=null&&(e.writeVarUint(14),e.writeVarFloat(o));var o=r.logicalIndexToCharacterOffsetMap;if(o!=null){e.writeVarUint(15);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],e.writeVarFloat(o)}var o=r.mentionBoxes;if(o!=null){e.writeVarUint(18);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeMentionBox(o,e)}var o=r.derivedLines;if(o!=null){e.writeVarUint(19);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeDerivedTextLineData(o,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeDerivedTextData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.layoutSize=this.decodeVector(r);break;case 2:for(var t=r.readVarUint(),i=e.baselines=Array(t),n=0;n<t;n++)i[n]=this.decodeBaseline(r);break;case 3:for(var t=r.readVarUint(),i=e.glyphs=Array(t),n=0;n<t;n++)i[n]=this.decodeGlyph(r);break;case 4:for(var t=r.readVarUint(),i=e.decorations=Array(t),n=0;n<t;n++)i[n]=this.decodeDecoration(r);break;case 5:for(var t=r.readVarUint(),i=e.blockquotes=Array(t),n=0;n<t;n++)i[n]=this.decodeBlockquote(r);break;case 6:for(var t=r.readVarUint(),i=e.fontMetaData=Array(t),n=0;n<t;n++)i[n]=this.decodeFontMetaData(r);break;case 7:for(var t=r.readVarUint(),i=e.hyperlinkBoxes=Array(t),n=0;n<t;n++)i[n]=this.decodeHyperlinkBox(r);break;case 8:e.truncationStartIndex=r.readVarInt();break;case 9:e.truncatedHeight=r.readVarFloat();break;case 10:for(var t=r.readVarUint(),i=e.logicalIndexToCharacterOffsetMap=Array(t),n=0;n<t;n++)i[n]=r.readVarFloat();break;case 11:for(var t=r.readVarUint(),i=e.mentionBoxes=Array(t),n=0;n<t;n++)i[n]=this.decodeMentionBox(r);break;case 12:for(var t=r.readVarUint(),i=e.derivedLines=Array(t),n=0;n<t;n++)i[n]=this.decodeDerivedTextLineData(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeDerivedTextData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.layoutSize;o!=null&&(e.writeVarUint(1),this.encodeVector(o,e));var o=r.baselines;if(o!=null){e.writeVarUint(2);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeBaseline(o,e)}var o=r.glyphs;if(o!=null){e.writeVarUint(3);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeGlyph(o,e)}var o=r.decorations;if(o!=null){e.writeVarUint(4);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeDecoration(o,e)}var o=r.blockquotes;if(o!=null){e.writeVarUint(5);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeBlockquote(o,e)}var o=r.fontMetaData;if(o!=null){e.writeVarUint(6);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeFontMetaData(o,e)}var o=r.hyperlinkBoxes;if(o!=null){e.writeVarUint(7);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeHyperlinkBox(o,e)}var o=r.truncationStartIndex;o!=null&&(e.writeVarUint(8),e.writeVarInt(o));var o=r.truncatedHeight;o!=null&&(e.writeVarUint(9),e.writeVarFloat(o));var o=r.logicalIndexToCharacterOffsetMap;if(o!=null){e.writeVarUint(10);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],e.writeVarFloat(o)}var o=r.mentionBoxes;if(o!=null){e.writeVarUint(11);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeMentionBox(o,e)}var o=r.derivedLines;if(o!=null){e.writeVarUint(12);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeDerivedTextLineData(o,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeHyperlinkBox=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.bounds=this.decodeRect(r);break;case 2:e.url=r.readString();break;case 3:e.guid=this.decodeGUID(r);break;case 4:e.hyperlinkID=r.readVarInt();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeHyperlinkBox=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.bounds;t!=null&&(e.writeVarUint(1),this.encodeRect(t,e));var t=r.url;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.guid;t!=null&&(e.writeVarUint(3),this.encodeGUID(t,e));var t=r.hyperlinkID;if(t!=null&&(e.writeVarUint(4),e.writeVarInt(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeMentionBox=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.bounds=this.decodeRect(r);break;case 2:e.startIndex=r.readVarUint();break;case 3:e.endIndex=r.readVarUint();break;case 4:e.isValid=!!r.readByte();break;case 5:e.mentionKey=r.readVarUint();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeMentionBox=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.bounds;t!=null&&(e.writeVarUint(1),this.encodeRect(t,e));var t=r.startIndex;t!=null&&(e.writeVarUint(2),e.writeVarUint(t));var t=r.endIndex;t!=null&&(e.writeVarUint(3),e.writeVarUint(t));var t=r.isValid;t!=null&&(e.writeVarUint(4),e.writeByte(t));var t=r.mentionKey;if(t!=null&&(e.writeVarUint(5),e.writeVarUint(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeBaseline=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.position=this.decodeVector(r);break;case 2:e.width=r.readVarFloat();break;case 3:e.lineY=r.readVarFloat();break;case 4:e.lineHeight=r.readVarFloat();break;case 7:e.lineAscent=r.readVarFloat();break;case 8:e.ignoreLeadingTrim=r.readVarFloat();break;case 5:e.firstCharacter=r.readVarUint();break;case 6:e.endCharacter=r.readVarUint();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeBaseline=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.position;t!=null&&(e.writeVarUint(1),this.encodeVector(t,e));var t=r.width;t!=null&&(e.writeVarUint(2),e.writeVarFloat(t));var t=r.lineY;t!=null&&(e.writeVarUint(3),e.writeVarFloat(t));var t=r.lineHeight;t!=null&&(e.writeVarUint(4),e.writeVarFloat(t));var t=r.lineAscent;t!=null&&(e.writeVarUint(7),e.writeVarFloat(t));var t=r.ignoreLeadingTrim;t!=null&&(e.writeVarUint(8),e.writeVarFloat(t));var t=r.firstCharacter;t!=null&&(e.writeVarUint(5),e.writeVarUint(t));var t=r.endCharacter;if(t!=null&&(e.writeVarUint(6),e.writeVarUint(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeGlyph=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.commandsBlob=r.readVarUint();break;case 2:e.position=this.decodeVector(r);break;case 3:e.styleID=r.readVarUint();break;case 4:e.fontSize=r.readVarFloat();break;case 5:e.firstCharacter=r.readVarUint();break;case 6:e.advance=r.readVarFloat();break;case 7:for(var n=r.readVarUint(),t=e.emojiCodePoints=Array(n),i=0;i<n;i++)t[i]=r.readVarUint();break;case 8:e.emojiImageSet=this.EmojiImageSet[r.readVarUint()];break;case 9:e.rotation=r.readVarFloat();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeGlyph=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var a=r.commandsBlob;a!=null&&(e.writeVarUint(1),e.writeVarUint(a));var a=r.position;a!=null&&(e.writeVarUint(2),this.encodeVector(a,e));var a=r.styleID;a!=null&&(e.writeVarUint(3),e.writeVarUint(a));var a=r.fontSize;a!=null&&(e.writeVarUint(4),e.writeVarFloat(a));var a=r.firstCharacter;a!=null&&(e.writeVarUint(5),e.writeVarUint(a));var a=r.advance;a!=null&&(e.writeVarUint(6),e.writeVarFloat(a));var a=r.emojiCodePoints;if(a!=null){e.writeVarUint(7);var t=a,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)a=t[d],e.writeVarUint(a)}var a=r.emojiImageSet;if(a!=null){e.writeVarUint(8);var o=this.EmojiImageSet[a];if(o===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "EmojiImageSet"');e.writeVarUint(o)}var a=r.rotation;if(a!=null&&(e.writeVarUint(9),e.writeVarFloat(a)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeDecoration=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.rects=Array(n),i=0;i<n;i++)t[i]=this.decodeRect(r);break;case 2:e.styleID=r.readVarUint();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeDecoration=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.rects;if(o!=null){e.writeVarUint(1);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeRect(o,e)}var o=r.styleID;if(o!=null&&(e.writeVarUint(2),e.writeVarUint(o)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeBlockquote=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.verticalBar=this.decodeRect(r);break;case 2:e.quoteMarkBounds=this.decodeRect(r);break;case 3:e.styleID=r.readVarUint();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeBlockquote=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.verticalBar;t!=null&&(e.writeVarUint(1),this.encodeRect(t,e));var t=r.quoteMarkBounds;t!=null&&(e.writeVarUint(2),this.encodeRect(t,e));var t=r.styleID;if(t!=null&&(e.writeVarUint(3),e.writeVarUint(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeVectorData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.vectorNetworkBlob=r.readVarUint();break;case 2:e.normalizedSize=this.decodeVector(r);break;case 3:for(var n=r.readVarUint(),t=e.styleOverrideTable=Array(n),i=0;i<n;i++)t[i]=this.decodeNodeChange(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVectorData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.vectorNetworkBlob;t!=null&&(e.writeVarUint(1),e.writeVarUint(t));var t=r.normalizedSize;t!=null&&(e.writeVarUint(2),this.encodeVector(t,e));var t=r.styleOverrideTable;if(t!=null){e.writeVarUint(3);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeNodeChange(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeGUIDPath=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.guids=Array(n),i=0;i<n;i++)t[i]=this.decodeGUID(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeGUIDPath=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.guids;if(t!=null){e.writeVarUint(1);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeGUID(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeSymbolData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.symbolID=this.decodeGUID(r);break;case 2:for(var n=r.readVarUint(),t=e.symbolOverrides=Array(n),i=0;i<n;i++)t[i]=this.decodeNodeChange(r);break;case 3:e.uniformScaleFactor=r.readVarFloat();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeSymbolData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.symbolID;o!=null&&(e.writeVarUint(1),this.encodeGUID(o,e));var o=r.symbolOverrides;if(o!=null){e.writeVarUint(2);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeNodeChange(o,e)}var o=r.uniformScaleFactor;if(o!=null&&(e.writeVarUint(3),e.writeVarFloat(o)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeGUIDPathMapping=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.id=this.decodeGUID(r);break;case 2:e.path=this.decodeGUIDPath(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeGUIDPathMapping=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.id;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.path;if(t!=null&&(e.writeVarUint(2),this.encodeGUIDPath(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeNodeGenerationData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var t=r.readVarUint(),i=e.overrides=Array(t),n=0;n<t;n++)i[n]=this.decodeNodeChange(r);break;case 2:e.useFineGrainedSyncing=!!r.readByte();break;case 3:for(var t=r.readVarUint(),i=e.diffOnlyRemovals=Array(t),n=0;n<t;n++)i[n]=this.decodeNodeChange(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeNodeGenerationData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.overrides;if(o!=null){e.writeVarUint(1);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeNodeChange(o,e)}var o=r.useFineGrainedSyncing;o!=null&&(e.writeVarUint(2),e.writeByte(o));var o=r.diffOnlyRemovals;if(o!=null){e.writeVarUint(3);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeNodeChange(o,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeDerivedImmutableFrameData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.overrides=Array(n),i=0;i<n;i++)t[i]=this.decodeNodeChange(r);break;case 2:e.version=r.readVarUint();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeDerivedImmutableFrameData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.overrides;if(o!=null){e.writeVarUint(1);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeNodeChange(o,e)}var o=r.version;if(o!=null&&(e.writeVarUint(2),e.writeVarUint(o)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeAssetIdMap=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.entries=Array(n),i=0;i<n;i++)t[i]=this.decodeAssetIdEntry(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeAssetIdMap=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.entries;if(t!=null){e.writeVarUint(1);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeAssetIdEntry(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeAssetIdEntry=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.assetKey=r.readString();break;case 2:e.assetId=this.decodeAssetId(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeAssetIdEntry=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.assetKey;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.assetId;if(t!=null&&(e.writeVarUint(2),this.encodeAssetId(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeAssetRef=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.key=r.readString();break;case 2:e.version=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeAssetRef=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.key;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.version;if(t!=null&&(e.writeVarUint(2),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeAssetId=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.guid=this.decodeGUID(r);break;case 2:e.assetRef=this.decodeAssetRef(r);break;case 3:e.stateGroupId=this.decodeStateGroupId(r);break;case 4:e.styleId=this.decodeStyleId(r);break;case 5:e.symbolId=this.decodeSymbolId(r);break;case 6:e.variableId=this.decodeVariableID(r);break;case 7:e.variableSetId=this.decodeVariableSetID(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeAssetId=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.guid;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.assetRef;t!=null&&(e.writeVarUint(2),this.encodeAssetRef(t,e));var t=r.stateGroupId;t!=null&&(e.writeVarUint(3),this.encodeStateGroupId(t,e));var t=r.styleId;t!=null&&(e.writeVarUint(4),this.encodeStyleId(t,e));var t=r.symbolId;t!=null&&(e.writeVarUint(5),this.encodeSymbolId(t,e));var t=r.variableId;t!=null&&(e.writeVarUint(6),this.encodeVariableID(t,e));var t=r.variableSetId;if(t!=null&&(e.writeVarUint(7),this.encodeVariableSetID(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeStateGroupId=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.guid=this.decodeGUID(r);break;case 2:e.assetRef=this.decodeAssetRef(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeStateGroupId=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.guid;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.assetRef;if(t!=null&&(e.writeVarUint(2),this.encodeAssetRef(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeStyleId=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.guid=this.decodeGUID(r);break;case 2:e.assetRef=this.decodeAssetRef(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeStyleId=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.guid;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.assetRef;if(t!=null&&(e.writeVarUint(2),this.encodeAssetRef(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeSymbolId=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.guid=this.decodeGUID(r);break;case 2:e.assetRef=this.decodeAssetRef(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeSymbolId=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.guid;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.assetRef;if(t!=null&&(e.writeVarUint(2),this.encodeAssetRef(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeVariableID=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.guid=this.decodeGUID(r);break;case 2:e.assetRef=this.decodeAssetRef(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVariableID=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.guid;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.assetRef;if(t!=null&&(e.writeVarUint(2),this.encodeAssetRef(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeVariableOverrideId=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.guid=this.decodeGUID(r);break;case 2:e.assetRef=this.decodeAssetRef(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVariableOverrideId=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.guid;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.assetRef;if(t!=null&&(e.writeVarUint(2),this.encodeAssetRef(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeVariableSetID=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.guid=this.decodeGUID(r);break;case 2:e.assetRef=this.decodeAssetRef(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVariableSetID=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.guid;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.assetRef;if(t!=null&&(e.writeVarUint(2),this.encodeAssetRef(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeModuleId=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.guid=this.decodeGUID(r);break;case 2:e.assetRef=this.decodeAssetRef(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeModuleId=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.guid;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.assetRef;if(t!=null&&(e.writeVarUint(2),this.encodeAssetRef(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeResponsiveSetId=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.guid=this.decodeGUID(r);break;case 2:e.assetRef=this.decodeAssetRef(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeResponsiveSetId=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.guid;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.assetRef;if(t!=null&&(e.writeVarUint(2),this.encodeAssetRef(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeThemeID=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.guid=this.decodeGUID(r);break;case 2:e.assetRef=this.decodeAssetRef(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeThemeID=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.guid;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.assetRef;if(t!=null&&(e.writeVarUint(2),this.encodeAssetRef(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeResponsiveTextStyleVariant=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.minWidth=r.readVarFloat();break;case 2:e.fields=this.decodeNodeChange(r);break;case 3:e.variableFontSize=this.decodeVariableData(r);break;case 4:e.variableLineHeight=this.decodeVariableData(r);break;case 5:e.variableLetterSpacing=this.decodeVariableData(r);break;case 6:e.variableParagraphSpacing=this.decodeVariableData(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeResponsiveTextStyleVariant=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.minWidth;t!=null&&(e.writeVarUint(1),e.writeVarFloat(t));var t=r.fields;t!=null&&(e.writeVarUint(2),this.encodeNodeChange(t,e));var t=r.variableFontSize;t!=null&&(e.writeVarUint(3),this.encodeVariableData(t,e));var t=r.variableLineHeight;t!=null&&(e.writeVarUint(4),this.encodeVariableData(t,e));var t=r.variableLetterSpacing;t!=null&&(e.writeVarUint(5),this.encodeVariableData(t,e));var t=r.variableParagraphSpacing;if(t!=null&&(e.writeVarUint(6),this.encodeVariableData(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.FlappType={0:"POLL",1:"EMBED",2:"FACEPILE",3:"ALIGNMENT",4:"YOUTUBE",POLL:0,EMBED:1,FACEPILE:2,ALIGNMENT:3,YOUTUBE:4};l.decodeSlideThemeProps=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.themeVersion=r.readString();break;case 2:e.variableSetId=this.decodeVariableSetID(r);break;case 3:for(var n=r.readVarUint(),t=e.textStyleIds=Array(n),i=0;i<n;i++)t[i]=this.decodeStyleId(r);break;case 4:e.isTextColorManuallySelected=!!r.readByte();break;case 5:e.isBorderColorManuallySelected=!!r.readByte();break;case 6:e.subscribedThemeRef=this.decodeAssetRef(r);break;case 7:e.schemaVersion=r.readVarUint();break;case 8:e.isGeneratedFromDesign=!!r.readByte();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeSlideThemeProps=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.themeVersion;o!=null&&(e.writeVarUint(1),e.writeString(o));var o=r.variableSetId;o!=null&&(e.writeVarUint(2),this.encodeVariableSetID(o,e));var o=r.textStyleIds;if(o!=null){e.writeVarUint(3);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeStyleId(o,e)}var o=r.isTextColorManuallySelected;o!=null&&(e.writeVarUint(4),e.writeByte(o));var o=r.isBorderColorManuallySelected;o!=null&&(e.writeVarUint(5),e.writeByte(o));var o=r.subscribedThemeRef;o!=null&&(e.writeVarUint(6),this.encodeAssetRef(o,e));var o=r.schemaVersion;o!=null&&(e.writeVarUint(7),e.writeVarUint(o));var o=r.isGeneratedFromDesign;if(o!=null&&(e.writeVarUint(8),e.writeByte(o)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeSlideThemeMap=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.entries=Array(n),i=0;i<n;i++)t[i]=this.decodeSlideThemeMapEntry(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeSlideThemeMap=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.entries;if(t!=null){e.writeVarUint(1);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeSlideThemeMapEntry(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeSlideThemeMapEntry=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.themeId=this.decodeThemeID(r);break;case 2:e.themeProps=this.decodeSlideThemeProps(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeSlideThemeMapEntry=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.themeId;t!=null&&(e.writeVarUint(1),this.encodeThemeID(t,e));var t=r.themeProps;if(t!=null&&(e.writeVarUint(2),this.encodeSlideThemeProps(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeSharedSymbolReference=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.fileKey=r.readString();break;case 2:e.symbolID=this.decodeGUID(r);break;case 3:e.versionHash=r.readString();break;case 4:for(var t=r.readVarUint(),i=e.guidPathMappings=Array(t),n=0;n<t;n++)i[n]=this.decodeGUIDPathMapping(r);break;case 5:e.bytes=r.readByteArray();break;case 6:for(var t=r.readVarUint(),i=e.libraryGUIDToSubscribingGUID=Array(t),n=0;n<t;n++)i[n]=this.decodeGUIDMapping(r);break;case 7:e.componentKey=r.readString();break;case 8:for(var t=r.readVarUint(),i=e.unflatteningMappings=Array(t),n=0;n<t;n++)i[n]=this.decodeGUIDPathMapping(r);break;case 9:e.isUnflattened=!!r.readByte();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeSharedSymbolReference=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.fileKey;o!=null&&(e.writeVarUint(1),e.writeString(o));var o=r.symbolID;o!=null&&(e.writeVarUint(2),this.encodeGUID(o,e));var o=r.versionHash;o!=null&&(e.writeVarUint(3),e.writeString(o));var o=r.guidPathMappings;if(o!=null){e.writeVarUint(4);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeGUIDPathMapping(o,e)}var o=r.bytes;o!=null&&(e.writeVarUint(5),e.writeByteArray(o));var o=r.libraryGUIDToSubscribingGUID;if(o!=null){e.writeVarUint(6);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeGUIDMapping(o,e)}var o=r.componentKey;o!=null&&(e.writeVarUint(7),e.writeString(o));var o=r.unflatteningMappings;if(o!=null){e.writeVarUint(8);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeGUIDPathMapping(o,e)}var o=r.isUnflattened;if(o!=null&&(e.writeVarUint(9),e.writeByte(o)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeSharedComponentMasterData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.componentKey=r.readString();break;case 2:for(var n=r.readVarUint(),t=e.publishingGUIDPathToTeamLibraryGUID=Array(n),i=0;i<n;i++)t[i]=this.decodeGUIDPathMapping(r);break;case 3:e.isUnflattened=!!r.readByte();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeSharedComponentMasterData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.componentKey;o!=null&&(e.writeVarUint(1),e.writeString(o));var o=r.publishingGUIDPathToTeamLibraryGUID;if(o!=null){e.writeVarUint(2);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeGUIDPathMapping(o,e)}var o=r.isUnflattened;if(o!=null&&(e.writeVarUint(3),e.writeByte(o)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeInstanceOverrideStash=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.overridePathOfSwappedInstance=this.decodeGUIDPath(r);break;case 2:e.componentKey=r.readString();break;case 3:for(var n=r.readVarUint(),t=e.overrides=Array(n),i=0;i<n;i++)t[i]=this.decodeNodeChange(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeInstanceOverrideStash=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.overridePathOfSwappedInstance;t!=null&&(e.writeVarUint(1),this.encodeGUIDPath(t,e));var t=r.componentKey;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.overrides;if(t!=null){e.writeVarUint(3);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeNodeChange(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeInstanceOverrideStashV2=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.overridePathOfSwappedInstance=this.decodeGUIDPath(r);break;case 2:e.localSymbolID=this.decodeGUID(r);break;case 3:for(var n=r.readVarUint(),t=e.overrides=Array(n),i=0;i<n;i++)t[i]=this.decodeNodeChange(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeInstanceOverrideStashV2=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.overridePathOfSwappedInstance;t!=null&&(e.writeVarUint(1),this.encodeGUIDPath(t,e));var t=r.localSymbolID;t!=null&&(e.writeVarUint(2),this.encodeGUID(t,e));var t=r.overrides;if(t!=null){e.writeVarUint(3);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeNodeChange(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeEffect=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.type=this.EffectType[r.readVarUint()];break;case 2:e.color=this.decodeColor(r);break;case 3:e.offset=this.decodeVector(r);break;case 4:e.radius=r.readVarFloat();break;case 5:e.visible=!!r.readByte();break;case 6:e.blendMode=this.BlendMode[r.readVarUint()];break;case 7:e.spread=r.readVarFloat();break;case 8:e.showShadowBehindNode=!!r.readByte();break;case 9:e.radiusVar=this.decodeVariableData(r);break;case 10:e.colorVar=this.decodeVariableData(r);break;case 11:e.spreadVar=this.decodeVariableData(r);break;case 12:e.xVar=this.decodeVariableData(r);break;case 13:e.yVar=this.decodeVariableData(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeEffect=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.type;if(i!=null){e.writeVarUint(1);var t=this.EffectType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "EffectType"');e.writeVarUint(t)}var i=r.color;i!=null&&(e.writeVarUint(2),this.encodeColor(i,e));var i=r.offset;i!=null&&(e.writeVarUint(3),this.encodeVector(i,e));var i=r.radius;i!=null&&(e.writeVarUint(4),e.writeVarFloat(i));var i=r.visible;i!=null&&(e.writeVarUint(5),e.writeByte(i));var i=r.blendMode;if(i!=null){e.writeVarUint(6);var t=this.BlendMode[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "BlendMode"');e.writeVarUint(t)}var i=r.spread;i!=null&&(e.writeVarUint(7),e.writeVarFloat(i));var i=r.showShadowBehindNode;i!=null&&(e.writeVarUint(8),e.writeByte(i));var i=r.radiusVar;i!=null&&(e.writeVarUint(9),this.encodeVariableData(i,e));var i=r.colorVar;i!=null&&(e.writeVarUint(10),this.encodeVariableData(i,e));var i=r.spreadVar;i!=null&&(e.writeVarUint(11),this.encodeVariableData(i,e));var i=r.xVar;i!=null&&(e.writeVarUint(12),this.encodeVariableData(i,e));var i=r.yVar;if(i!=null&&(e.writeVarUint(13),this.encodeVariableData(i,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeTransitionInfo=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.type=this.TransitionType[r.readVarUint()];break;case 2:e.duration=r.readVarFloat();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeTransitionInfo=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.type;if(i!=null){e.writeVarUint(1);var t=this.TransitionType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "TransitionType"');e.writeVarUint(t)}var i=r.duration;if(i!=null&&(e.writeVarUint(2),e.writeVarFloat(i)),e.writeVarUint(0),n)return e.toUint8Array()};l.PrototypeDeviceType={0:"NONE",1:"PRESET",2:"CUSTOM",3:"PRESENTATION",NONE:0,PRESET:1,CUSTOM:2,PRESENTATION:3};l.DeviceRotation={0:"NONE",1:"CCW_90",NONE:0,CCW_90:1};l.decodePrototypeDevice=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.type=this.PrototypeDeviceType[r.readVarUint()];break;case 2:e.size=this.decodeVector(r);break;case 3:e.presetIdentifier=r.readString();break;case 4:e.rotation=this.DeviceRotation[r.readVarUint()];break;default:throw new Error("Attempted to parse invalid message")}};l.encodePrototypeDevice=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.type;if(i!=null){e.writeVarUint(1);var t=this.PrototypeDeviceType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "PrototypeDeviceType"');e.writeVarUint(t)}var i=r.size;i!=null&&(e.writeVarUint(2),this.encodeVector(i,e));var i=r.presetIdentifier;i!=null&&(e.writeVarUint(3),e.writeString(i));var i=r.rotation;if(i!=null){e.writeVarUint(4);var t=this.DeviceRotation[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "DeviceRotation"');e.writeVarUint(t)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.OverlayPositionType={0:"CENTER",1:"TOP_LEFT",2:"TOP_CENTER",3:"TOP_RIGHT",4:"BOTTOM_LEFT",5:"BOTTOM_CENTER",6:"BOTTOM_RIGHT",7:"MANUAL",CENTER:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,BOTTOM_LEFT:4,BOTTOM_CENTER:5,BOTTOM_RIGHT:6,MANUAL:7};l.OverlayBackgroundInteraction={0:"NONE",1:"CLOSE_ON_CLICK_OUTSIDE",NONE:0,CLOSE_ON_CLICK_OUTSIDE:1};l.OverlayBackgroundType={0:"NONE",1:"SOLID_COLOR",NONE:0,SOLID_COLOR:1};l.decodeOverlayBackgroundAppearance=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.backgroundType=this.OverlayBackgroundType[r.readVarUint()];break;case 2:e.backgroundColor=this.decodeColor(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeOverlayBackgroundAppearance=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.backgroundType;if(i!=null){e.writeVarUint(1);var t=this.OverlayBackgroundType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "OverlayBackgroundType"');e.writeVarUint(t)}var i=r.backgroundColor;if(i!=null&&(e.writeVarUint(2),this.encodeColor(i,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.NavigationType={0:"NAVIGATE",1:"OVERLAY",2:"SWAP",3:"SWAP_STATE",4:"SCROLL_TO",NAVIGATE:0,OVERLAY:1,SWAP:2,SWAP_STATE:3,SCROLL_TO:4};l.ExportColorProfile={0:"DOCUMENT",1:"SRGB",2:"DISPLAY_P3_V4",DOCUMENT:0,SRGB:1,DISPLAY_P3_V4:2};l.decodeExportSettings=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.suffix=r.readString();break;case 2:e.imageType=this.ImageType[r.readVarUint()];break;case 3:e.constraint=this.decodeExportConstraint(r);break;case 4:e.svgDataName=!!r.readByte();break;case 5:e.svgIDMode=this.ExportSVGIDMode[r.readVarUint()];break;case 6:e.svgOutlineText=!!r.readByte();break;case 7:e.contentsOnly=!!r.readByte();break;case 8:e.svgForceStrokeMasks=!!r.readByte();break;case 9:e.useAbsoluteBounds=!!r.readByte();break;case 10:e.colorProfile=this.ExportColorProfile[r.readVarUint()];break;case 11:e.quality=r.readVarFloat();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeExportSettings=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.suffix;i!=null&&(e.writeVarUint(1),e.writeString(i));var i=r.imageType;if(i!=null){e.writeVarUint(2);var t=this.ImageType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "ImageType"');e.writeVarUint(t)}var i=r.constraint;i!=null&&(e.writeVarUint(3),this.encodeExportConstraint(i,e));var i=r.svgDataName;i!=null&&(e.writeVarUint(4),e.writeByte(i));var i=r.svgIDMode;if(i!=null){e.writeVarUint(5);var t=this.ExportSVGIDMode[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "ExportSVGIDMode"');e.writeVarUint(t)}var i=r.svgOutlineText;i!=null&&(e.writeVarUint(6),e.writeByte(i));var i=r.contentsOnly;i!=null&&(e.writeVarUint(7),e.writeByte(i));var i=r.svgForceStrokeMasks;i!=null&&(e.writeVarUint(8),e.writeByte(i));var i=r.useAbsoluteBounds;i!=null&&(e.writeVarUint(9),e.writeByte(i));var i=r.colorProfile;if(i!=null){e.writeVarUint(10);var t=this.ExportColorProfile[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "ExportColorProfile"');e.writeVarUint(t)}var i=r.quality;if(i!=null&&(e.writeVarUint(11),e.writeVarFloat(i)),e.writeVarUint(0),n)return e.toUint8Array()};l.ExportSVGIDMode={0:"IF_NEEDED",1:"ALWAYS",IF_NEEDED:0,ALWAYS:1};l.decodeLayoutGrid=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.type=this.LayoutGridType[r.readVarUint()];break;case 2:e.axis=this.Axis[r.readVarUint()];break;case 3:e.visible=!!r.readByte();break;case 4:e.numSections=r.readVarInt();break;case 5:e.offset=r.readVarFloat();break;case 6:e.sectionSize=r.readVarFloat();break;case 7:e.gutterSize=r.readVarFloat();break;case 8:e.color=this.decodeColor(r);break;case 9:e.pattern=this.LayoutGridPattern[r.readVarUint()];break;case 10:e.numSectionsVar=this.decodeVariableData(r);break;case 11:e.offsetVar=this.decodeVariableData(r);break;case 12:e.sectionSizeVar=this.decodeVariableData(r);break;case 13:e.gutterSizeVar=this.decodeVariableData(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeLayoutGrid=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.type;if(i!=null){e.writeVarUint(1);var t=this.LayoutGridType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "LayoutGridType"');e.writeVarUint(t)}var i=r.axis;if(i!=null){e.writeVarUint(2);var t=this.Axis[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "Axis"');e.writeVarUint(t)}var i=r.visible;i!=null&&(e.writeVarUint(3),e.writeByte(i));var i=r.numSections;i!=null&&(e.writeVarUint(4),e.writeVarInt(i));var i=r.offset;i!=null&&(e.writeVarUint(5),e.writeVarFloat(i));var i=r.sectionSize;i!=null&&(e.writeVarUint(6),e.writeVarFloat(i));var i=r.gutterSize;i!=null&&(e.writeVarUint(7),e.writeVarFloat(i));var i=r.color;i!=null&&(e.writeVarUint(8),this.encodeColor(i,e));var i=r.pattern;if(i!=null){e.writeVarUint(9);var t=this.LayoutGridPattern[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "LayoutGridPattern"');e.writeVarUint(t)}var i=r.numSectionsVar;i!=null&&(e.writeVarUint(10),this.encodeVariableData(i,e));var i=r.offsetVar;i!=null&&(e.writeVarUint(11),this.encodeVariableData(i,e));var i=r.sectionSizeVar;i!=null&&(e.writeVarUint(12),this.encodeVariableData(i,e));var i=r.gutterSizeVar;if(i!=null&&(e.writeVarUint(13),this.encodeVariableData(i,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeGuide=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.axis=this.Axis[r.readVarUint()];break;case 2:e.offset=r.readVarFloat();break;case 3:e.guid=this.decodeGUID(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeGuide=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.axis;if(i!=null){e.writeVarUint(1);var t=this.Axis[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "Axis"');e.writeVarUint(t)}var i=r.offset;i!=null&&(e.writeVarUint(2),e.writeVarFloat(i));var i=r.guid;if(i!=null&&(e.writeVarUint(3),this.encodeGUID(i,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodePath=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.windingRule=this.WindingRule[r.readVarUint()];break;case 2:e.commandsBlob=r.readVarUint();break;case 3:e.styleID=r.readVarUint();break;default:throw new Error("Attempted to parse invalid message")}};l.encodePath=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.windingRule;if(i!=null){e.writeVarUint(1);var t=this.WindingRule[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "WindingRule"');e.writeVarUint(t)}var i=r.commandsBlob;i!=null&&(e.writeVarUint(2),e.writeVarUint(i));var i=r.styleID;if(i!=null&&(e.writeVarUint(3),e.writeVarUint(i)),e.writeVarUint(0),n)return e.toUint8Array()};l.StyleType={0:"NONE",1:"FILL",2:"STROKE",3:"TEXT",4:"EFFECT",5:"EXPORT",6:"GRID",NONE:0,FILL:1,STROKE:2,TEXT:3,EFFECT:4,EXPORT:5,GRID:6};l.decodeSharedStyleReference=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.styleKey=r.readString();break;case 2:e.versionHash=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeSharedStyleReference=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.styleKey;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.versionHash;if(t!=null&&(e.writeVarUint(2),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeSharedStyleMasterData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.styleKey=r.readString();break;case 2:e.sortPosition=r.readString();break;case 3:e.fileKey=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeSharedStyleMasterData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.styleKey;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.sortPosition;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.fileKey;if(t!=null&&(e.writeVarUint(3),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.ScrollBehavior={0:"SCROLLS",1:"FIXED_WHEN_CHILD_OF_SCROLLING_FRAME",2:"STICKY_SCROLLS",SCROLLS:0,FIXED_WHEN_CHILD_OF_SCROLLING_FRAME:1,STICKY_SCROLLS:2};l.decodeArcData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.startingAngle=r.readVarFloat();break;case 2:e.endingAngle=r.readVarFloat();break;case 3:e.innerRadius=r.readVarFloat();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeArcData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.startingAngle;t!=null&&(e.writeVarUint(1),e.writeVarFloat(t));var t=r.endingAngle;t!=null&&(e.writeVarUint(2),e.writeVarFloat(t));var t=r.innerRadius;if(t!=null&&(e.writeVarUint(3),e.writeVarFloat(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeSymbolLink=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.uri=r.readString();break;case 2:e.displayName=r.readString();break;case 3:e.displayText=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeSymbolLink=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.uri;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.displayName;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.displayText;if(t!=null&&(e.writeVarUint(3),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodePluginData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.pluginID=r.readString();break;case 2:e.value=r.readString();break;case 3:e.key=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodePluginData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.pluginID;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.value;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.key;if(t!=null&&(e.writeVarUint(3),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodePluginRelaunchData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.pluginID=r.readString();break;case 2:e.message=r.readString();break;case 3:e.command=r.readString();break;case 4:e.isDeleted=!!r.readByte();break;default:throw new Error("Attempted to parse invalid message")}};l.encodePluginRelaunchData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.pluginID;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.message;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.command;t!=null&&(e.writeVarUint(3),e.writeString(t));var t=r.isDeleted;if(t!=null&&(e.writeVarUint(4),e.writeByte(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeMultiplayerFieldVersion=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.counter=r.readVarUint();break;case 2:e.sessionID=r.readVarUint();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeMultiplayerFieldVersion=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.counter;t!=null&&(e.writeVarUint(1),e.writeVarUint(t));var t=r.sessionID;if(t!=null&&(e.writeVarUint(2),e.writeVarUint(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.ConnectorMagnet={0:"NONE",1:"AUTO",2:"TOP",3:"LEFT",4:"BOTTOM",5:"RIGHT",6:"CENTER",7:"AUTO_HORIZONTAL",8:"EDGE",9:"ABSOLUTE",NONE:0,AUTO:1,TOP:2,LEFT:3,BOTTOM:4,RIGHT:5,CENTER:6,AUTO_HORIZONTAL:7,EDGE:8,ABSOLUTE:9};l.decodeConnectorEndpoint=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.endpointNodeID=this.decodeGUID(r);break;case 2:e.position=this.decodeVector(r);break;case 3:e.magnet=this.ConnectorMagnet[r.readVarUint()];break;default:throw new Error("Attempted to parse invalid message")}};l.encodeConnectorEndpoint=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.endpointNodeID;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.position;t!=null&&(e.writeVarUint(2),this.encodeVector(t,e));var t=r.magnet;if(t!=null){e.writeVarUint(3);var i=this.ConnectorMagnet[t];if(i===void 0)throw new Error("Invalid value "+JSON.stringify(t)+' for enum "ConnectorMagnet"');e.writeVarUint(i)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeConnectorControlPoint=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.position=this.decodeVector(r);break;case 2:e.axis=this.decodeVector(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeConnectorControlPoint=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.position;t!=null&&(e.writeVarUint(1),this.encodeVector(t,e));var t=r.axis;if(t!=null&&(e.writeVarUint(2),this.encodeVector(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.ConnectorTextSection={0:"MIDDLE_TO_START",1:"MIDDLE_TO_END",MIDDLE_TO_START:0,MIDDLE_TO_END:1};l.ConnectorOffAxisOffset={0:"NONE",1:"ABOVE",2:"BELOW",NONE:0,ABOVE:1,BELOW:2};l.decodeConnectorTextMidpoint=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.section=this.ConnectorTextSection[r.readVarUint()];break;case 2:e.offset=r.readVarFloat();break;case 3:e.offAxisOffset=this.ConnectorOffAxisOffset[r.readVarUint()];break;default:throw new Error("Attempted to parse invalid message")}};l.encodeConnectorTextMidpoint=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.section;if(i!=null){e.writeVarUint(1);var t=this.ConnectorTextSection[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "ConnectorTextSection"');e.writeVarUint(t)}var i=r.offset;i!=null&&(e.writeVarUint(2),e.writeVarFloat(i));var i=r.offAxisOffset;if(i!=null){e.writeVarUint(3);var t=this.ConnectorOffAxisOffset[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "ConnectorOffAxisOffset"');e.writeVarUint(t)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.ConnectorLineStyle={0:"ELBOWED",1:"STRAIGHT",2:"CURVED",ELBOWED:0,STRAIGHT:1,CURVED:2};l.ConnectorType={0:"MANUAL",1:"DIAGRAM",MANUAL:0,DIAGRAM:1};l.AnnotationPropertyType={0:"FILL",1:"STROKE",2:"WIDTH",3:"HEIGHT",4:"MIN_WIDTH",5:"MIN_HEIGHT",6:"MAX_WIDTH",7:"MAX_HEIGHT",8:"STROKE_WIDTH",9:"CORNER_RADIUS",10:"EFFECT",11:"TEXT_STYLE",12:"TEXT_ALIGN_HORIZONTAL",13:"FONT_FAMILY",14:"FONT_SIZE",15:"FONT_WEIGHT",16:"LINE_HEIGHT",17:"LETTER_SPACING",18:"STACK_SPACING",19:"STACK_PADDING",20:"STACK_MODE",21:"STACK_ALIGNMENT",22:"OPACITY",23:"COMPONENT",24:"FONT_STYLE",FILL:0,STROKE:1,WIDTH:2,HEIGHT:3,MIN_WIDTH:4,MIN_HEIGHT:5,MAX_WIDTH:6,MAX_HEIGHT:7,STROKE_WIDTH:8,CORNER_RADIUS:9,EFFECT:10,TEXT_STYLE:11,TEXT_ALIGN_HORIZONTAL:12,FONT_FAMILY:13,FONT_SIZE:14,FONT_WEIGHT:15,LINE_HEIGHT:16,LETTER_SPACING:17,STACK_SPACING:18,STACK_PADDING:19,STACK_MODE:20,STACK_ALIGNMENT:21,OPACITY:22,COMPONENT:23,FONT_STYLE:24};l.decodeAnnotationProperty=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.type=this.AnnotationPropertyType[r.readVarUint()];break;default:throw new Error("Attempted to parse invalid message")}};l.encodeAnnotationProperty=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.type;if(t!=null){e.writeVarUint(1);var i=this.AnnotationPropertyType[t];if(i===void 0)throw new Error("Invalid value "+JSON.stringify(t)+' for enum "AnnotationPropertyType"');e.writeVarUint(i)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeAnnotation=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.label=r.readString();break;case 2:for(var n=r.readVarUint(),t=e.properties=Array(n),i=0;i<n;i++)t[i]=this.decodeAnnotationProperty(r);break;case 3:e.labelV2=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeAnnotation=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.label;o!=null&&(e.writeVarUint(1),e.writeString(o));var o=r.properties;if(o!=null){e.writeVarUint(2);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeAnnotationProperty(o,e)}var o=r.labelV2;if(o!=null&&(e.writeVarUint(3),e.writeString(o)),e.writeVarUint(0),n)return e.toUint8Array()};l.AnnotationMeasurementNodeSide={0:"TOP",1:"BOTTOM",2:"LEFT",3:"RIGHT",TOP:0,BOTTOM:1,LEFT:2,RIGHT:3};l.decodeAnnotationMeasurement=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.id=this.decodeGUID(r);break;case 2:e.fromNode=this.decodeGUID(r);break;case 3:e.toNode=this.decodeGUID(r);break;case 4:e.fromNodeSide=this.AnnotationMeasurementNodeSide[r.readVarUint()];break;case 5:e.toSameSide=!!r.readByte();break;case 6:e.innerOffsetRelative=r.readVarFloat();break;case 7:e.outerOffsetFixed=r.readVarFloat();break;case 8:e.toNodeStablePath=this.decodeGUIDPath(r);break;case 9:e.freeText=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeAnnotationMeasurement=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.id;i!=null&&(e.writeVarUint(1),this.encodeGUID(i,e));var i=r.fromNode;i!=null&&(e.writeVarUint(2),this.encodeGUID(i,e));var i=r.toNode;i!=null&&(e.writeVarUint(3),this.encodeGUID(i,e));var i=r.fromNodeSide;if(i!=null){e.writeVarUint(4);var t=this.AnnotationMeasurementNodeSide[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "AnnotationMeasurementNodeSide"');e.writeVarUint(t)}var i=r.toSameSide;i!=null&&(e.writeVarUint(5),e.writeByte(i));var i=r.innerOffsetRelative;i!=null&&(e.writeVarUint(6),e.writeVarFloat(i));var i=r.outerOffsetFixed;i!=null&&(e.writeVarUint(7),e.writeVarFloat(i));var i=r.toNodeStablePath;i!=null&&(e.writeVarUint(8),this.encodeGUIDPath(i,e));var i=r.freeText;if(i!=null&&(e.writeVarUint(9),e.writeString(i)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeLibraryMoveInfo=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.oldKey=r.readString();break;case 2:e.pasteFileKey=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeLibraryMoveInfo=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.oldKey;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.pasteFileKey;if(t!=null&&(e.writeVarUint(2),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeLibraryMoveHistoryItem=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.sourceNodeId=this.decodeGUID(r);break;case 2:e.sourceComponentKey=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeLibraryMoveHistoryItem=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.sourceNodeId;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.sourceComponentKey;if(t!=null&&(e.writeVarUint(2),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeDeveloperRelatedLink=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.nodeId=r.readString();break;case 2:e.fileKey=r.readString();break;case 3:e.linkName=r.readString();break;case 4:e.linkUrl=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeDeveloperRelatedLink=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.nodeId;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.fileKey;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.linkName;t!=null&&(e.writeVarUint(3),e.writeString(t));var t=r.linkUrl;if(t!=null&&(e.writeVarUint(4),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeWidgetPointer=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.nodeId=this.decodeGUID(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeWidgetPointer=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.nodeId;if(t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeEditInfo=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.timestampIso8601=r.readString();break;case 2:e.userId=r.readString();break;case 3:e.lastEditedAt=r.readVarUint();break;case 4:e.createdAt=r.readVarUint();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeEditInfo=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.timestampIso8601;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.userId;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.lastEditedAt;t!=null&&(e.writeVarUint(3),e.writeVarUint(t));var t=r.createdAt;if(t!=null&&(e.writeVarUint(4),e.writeVarUint(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.EditorType={0:"DESIGN",1:"WHITEBOARD",2:"SLIDES",3:"DEV_HANDOFF",4:"SITES",5:"COOPER",DESIGN:0,WHITEBOARD:1,SLIDES:2,DEV_HANDOFF:3,SITES:4,COOPER:5};l.MaskType={0:"ALPHA",1:"OUTLINE",2:"LUMINANCE",ALPHA:0,OUTLINE:1,LUMINANCE:2};l.ModuleType={0:"NONE",1:"SINGLE_NODE",2:"MULTI_NODE",NONE:0,SINGLE_NODE:1,MULTI_NODE:2};l.SectionStatus={0:"NONE",1:"BUILD",2:"COMPLETED",NONE:0,BUILD:1,COMPLETED:2};l.decodeSectionStatusInfo=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.status=this.SectionStatus[r.readVarUint()];break;case 2:e.lastUpdateUnixTimestamp=r.readVarUint();break;case 3:e.description=r.readString();break;case 4:e.userId=r.readString();break;case 5:e.prevStatus=this.SectionStatus[r.readVarUint()];break;default:throw new Error("Attempted to parse invalid message")}};l.encodeSectionStatusInfo=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.status;if(i!=null){e.writeVarUint(1);var t=this.SectionStatus[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "SectionStatus"');e.writeVarUint(t)}var i=r.lastUpdateUnixTimestamp;i!=null&&(e.writeVarUint(2),e.writeVarUint(i));var i=r.description;i!=null&&(e.writeVarUint(3),e.writeString(i));var i=r.userId;i!=null&&(e.writeVarUint(4),e.writeString(i));var i=r.prevStatus;if(i!=null){e.writeVarUint(5);var t=this.SectionStatus[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "SectionStatus"');e.writeVarUint(t)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeNodeChange=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.guid=this.decodeGUID(r);break;case 53:e.guidTag=r.readVarUint();break;case 2:e.phase=this.NodePhase[r.readVarUint()];break;case 54:e.phaseTag=r.readVarUint();break;case 3:e.parentIndex=this.decodeParentIndex(r);break;case 55:e.parentIndexTag=r.readVarUint();break;case 4:e.type=this.NodeType[r.readVarUint()];break;case 56:e.typeTag=r.readVarUint();break;case 5:e.name=r.readString();break;case 57:e.nameTag=r.readVarUint();break;case 174:e.isPublishable=!!r.readByte();break;case 318:e.description=r.readString();break;case 256:e.libraryMoveInfo=this.decodeLibraryMoveInfo(r);break;case 281:for(var t=r.readVarUint(),i=e.libraryMoveHistory=Array(t),n=0;n<t;n++)i[n]=this.decodeLibraryMoveHistoryItem(r);break;case 319:e.key=r.readString();break;case 383:e.fileAssetIds=this.decodeAssetIdMap(r);break;case 49:e.styleID=r.readVarUint();break;case 101:e.styleIDTag=r.readVarUint();break;case 176:e.isSoftDeletedStyle=!!r.readByte();break;case 177:e.isNonUpdateable=!!r.readByte();break;case 157:e.isFillStyle=!!r.readByte();break;case 161:e.isStrokeStyle=!!r.readByte();break;case 376:e.isOverrideOverTextStyle=!!r.readByte();break;case 163:e.styleType=this.StyleType[r.readVarUint()];break;case 191:e.styleDescription=r.readString();break;case 171:e.version=r.readString();break;case 172:e.sharedStyleMasterData=this.decodeSharedStyleMasterData(r);break;case 173:e.sharedStyleReference=this.decodeSharedStyleReference(r);break;case 399:e.userFacingVersion=r.readString();break;case 320:e.sortPosition=r.readString();break;case 345:e.ojansSuperSecretNodeField=this.decodeSharedStyleMasterData(r);break;case 348:e.sevMoonlitLilyData=this.decodeSharedStyleMasterData(r);break;case 158:e.inheritFillStyleID=this.decodeGUID(r);break;case 162:e.inheritStrokeStyleID=this.decodeGUID(r);break;case 167:e.inheritTextStyleID=this.decodeGUID(r);break;case 168:e.inheritExportStyleID=this.decodeGUID(r);break;case 169:e.inheritEffectStyleID=this.decodeGUID(r);break;case 170:e.inheritGridStyleID=this.decodeGUID(r);break;case 185:e.inheritFillStyleIDForStroke=this.decodeGUID(r);break;case 332:e.styleIdForFill=this.decodeStyleId(r);break;case 333:e.styleIdForStrokeFill=this.decodeStyleId(r);break;case 334:e.styleIdForText=this.decodeStyleId(r);break;case 335:e.styleIdForEffect=this.decodeStyleId(r);break;case 336:e.styleIdForGrid=this.decodeStyleId(r);break;case 193:for(var t=r.readVarUint(),i=e.backgroundPaints=Array(t),n=0;n<t;n++)i[n]=this.decodePaint(r);break;case 194:e.inheritFillStyleIDForBackground=this.decodeGUID(r);break;case 225:e.isStateGroup=!!r.readByte();break;case 238:for(var t=r.readVarUint(),i=e.stateGroupPropertyValueOrders=Array(t),n=0;n<t;n++)i[n]=this.decodeStateGroupPropertyValueOrder(r);break;case 122:e.sharedSymbolReference=this.decodeSharedSymbolReference(r);break;case 123:e.isSymbolPublishable=!!r.readByte();break;case 124:for(var t=r.readVarUint(),i=e.sharedSymbolMappings=Array(t),n=0;n<t;n++)i[n]=this.decodeGUIDPathMapping(r);break;case 126:e.sharedSymbolVersion=r.readString();break;case 152:e.sharedComponentMasterData=this.decodeSharedComponentMasterData(r);break;case 144:e.symbolDescription=r.readString();break;case 164:for(var t=r.readVarUint(),i=e.unflatteningMappings=Array(t),n=0;n<t;n++)i[n]=this.decodeGUIDPathMapping(r);break;case 228:for(var t=r.readVarUint(),i=e.forceUnflatteningMappings=Array(t),n=0;n<t;n++)i[n]=this.decodeGUIDPathMapping(r);break;case 214:e.publishFile=r.readString();break;case 395:e.sourceLibraryKey=r.readString();break;case 215:e.publishID=this.decodeGUID(r);break;case 216:e.componentKey=r.readString();break;case 217:e.isC2=!!r.readByte();break;case 218:e.publishedVersion=r.readString();break;case 252:e.originComponentKey=r.readString();break;case 266:for(var t=r.readVarUint(),i=e.componentPropDefs=Array(t),n=0;n<t;n++)i[n]=this.decodeComponentPropDef(r);break;case 267:for(var t=r.readVarUint(),i=e.componentPropRefs=Array(t),n=0;n<t;n++)i[n]=this.decodeComponentPropRef(r);break;case 113:e.symbolData=this.decodeSymbolData(r);break;case 114:e.symbolDataTag=r.readVarUint();break;case 125:for(var t=r.readVarUint(),i=e.derivedSymbolData=Array(t),n=0;n<t;n++)i[n]=this.decodeNodeChange(r);break;case 394:e.nestedInstanceResizeEnabled=!!r.readByte();break;case 143:e.overriddenSymbolID=this.decodeGUID(r);break;case 268:for(var t=r.readVarUint(),i=e.componentPropAssignments=Array(t),n=0;n<t;n++)i[n]=this.decodeComponentPropAssignment(r);break;case 305:e.propsAreBubbled=!!r.readByte();break;case 248:for(var t=r.readVarUint(),i=e.overrideStash=Array(t),n=0;n<t;n++)i[n]=this.decodeInstanceOverrideStash(r);break;case 250:for(var t=r.readVarUint(),i=e.overrideStashV2=Array(t),n=0;n<t;n++)i[n]=this.decodeInstanceOverrideStashV2(r);break;case 111:e.guidPath=this.decodeGUIDPath(r);break;case 112:e.guidPathTag=r.readVarUint();break;case 321:e.overrideLevel=r.readVarInt();break;case 382:e.moduleType=this.ModuleType[r.readVarUint()];break;case 21:e.fontSize=r.readVarFloat();break;case 73:e.fontSizeTag=r.readVarUint();break;case 22:e.paragraphIndent=r.readVarFloat();break;case 74:e.paragraphIndentTag=r.readVarUint();break;case 23:e.paragraphSpacing=r.readVarFloat();break;case 75:e.paragraphSpacingTag=r.readVarUint();break;case 32:e.textAlignHorizontal=this.TextAlignHorizontal[r.readVarUint()];break;case 84:e.textAlignHorizontalTag=r.readVarUint();break;case 33:e.textAlignVertical=this.TextAlignVertical[r.readVarUint()];break;case 85:e.textAlignVerticalTag=r.readVarUint();break;case 34:e.textCase=this.TextCase[r.readVarUint()];break;case 86:e.textCaseTag=r.readVarUint();break;case 35:e.textDecoration=this.TextDecoration[r.readVarUint()];break;case 87:e.textDecorationTag=r.readVarUint();break;case 40:e.lineHeight=this.decodeNumber(r);break;case 92:e.lineHeightTag=r.readVarUint();break;case 41:e.fontName=this.decodeFontName(r);break;case 93:e.fontNameTag=r.readVarUint();break;case 42:e.textData=this.decodeTextData(r);break;case 94:e.textDataTag=r.readVarUint();break;case 359:e.derivedTextData=this.decodeDerivedTextData(r);break;case 127:e.fontVariantCommonLigatures=!!r.readByte();break;case 128:e.fontVariantContextualLigatures=!!r.readByte();break;case 129:e.fontVariantDiscretionaryLigatures=!!r.readByte();break;case 130:e.fontVariantHistoricalLigatures=!!r.readByte();break;case 131:e.fontVariantOrdinal=!!r.readByte();break;case 132:e.fontVariantSlashedZero=!!r.readByte();break;case 133:e.fontVariantNumericFigure=this.FontVariantNumericFigure[r.readVarUint()];break;case 134:e.fontVariantNumericSpacing=this.FontVariantNumericSpacing[r.readVarUint()];break;case 135:e.fontVariantNumericFraction=this.FontVariantNumericFraction[r.readVarUint()];break;case 136:e.fontVariantCaps=this.FontVariantCaps[r.readVarUint()];break;case 137:e.fontVariantPosition=this.FontVariantPosition[r.readVarUint()];break;case 165:e.letterSpacing=this.decodeNumber(r);break;case 202:e.fontVersion=r.readString();break;case 322:e.leadingTrim=this.LeadingTrim[r.readVarUint()];break;case 337:e.hangingPunctuation=!!r.readByte();break;case 339:e.hangingList=!!r.readByte();break;case 351:e.maxLines=r.readVarInt();break;case 417:for(var t=r.readVarUint(),i=e.responsiveTextStyleVariants=Array(t),n=0;n<t;n++)i[n]=this.decodeResponsiveTextStyleVariant(r);break;case 352:e.sectionStatus=this.SectionStatus[r.readVarUint()];break;case 355:e.sectionStatusInfo=this.decodeSectionStatusInfo(r);break;case 203:e.textUserLayoutVersion=r.readVarUint();break;case 396:e.textExplicitLayoutVersion=r.readVarUint();break;case 205:for(var t=r.readVarUint(),i=e.toggledOnOTFeatures=Array(t),n=0;n<t;n++)i[n]=this.OpenTypeFeature[r.readVarUint()];break;case 206:for(var t=r.readVarUint(),i=e.toggledOffOTFeatures=Array(t),n=0;n<t;n++)i[n]=this.OpenTypeFeature[r.readVarUint()];break;case 223:e.hyperlink=this.decodeHyperlink(r);break;case 340:e.mention=this.decodeMention(r);break;case 260:for(var t=r.readVarUint(),i=e.fontVariations=Array(t),n=0;n<t;n++)i[n]=this.decodeFontVariation(r);break;case 279:e.textBidiVersion=r.readVarUint();break;case 280:e.textTruncation=this.TextTruncation[r.readVarUint()];break;case 292:e.hasHadRTLText=!!r.readByte();break;case 391:e.emojiImageSet=this.EmojiImageSet[r.readVarUint()];break;case 392:e.slideThumbnailHash=r.readString();break;case 6:e.visible=!!r.readByte();break;case 58:e.visibleTag=r.readVarUint();break;case 7:e.locked=!!r.readByte();break;case 59:e.lockedTag=r.readVarUint();break;case 8:e.opacity=r.readVarFloat();break;case 60:e.opacityTag=r.readVarUint();break;case 9:e.blendMode=this.BlendMode[r.readVarUint()];break;case 61:e.blendModeTag=r.readVarUint();break;case 11:e.size=this.decodeVector(r);break;case 63:e.sizeTag=r.readVarUint();break;case 12:e.transform=this.decodeMatrix(r);break;case 64:e.transformTag=r.readVarUint();break;case 13:for(var t=r.readVarUint(),i=e.dashPattern=Array(t),n=0;n<t;n++)i[n]=r.readVarFloat();break;case 65:e.dashPatternTag=r.readVarUint();break;case 16:e.mask=!!r.readByte();break;case 68:e.maskTag=r.readVarUint();break;case 18:e.maskIsOutline=!!r.readByte();break;case 70:e.maskIsOutlineTag=r.readVarUint();break;case 317:e.maskType=this.MaskType[r.readVarUint()];break;case 19:e.backgroundOpacity=r.readVarFloat();break;case 71:e.backgroundOpacityTag=r.readVarUint();break;case 20:e.cornerRadius=r.readVarFloat();break;case 72:e.cornerRadiusTag=r.readVarUint();break;case 26:e.strokeWeight=r.readVarFloat();break;case 78:e.strokeWeightTag=r.readVarUint();break;case 29:e.strokeAlign=this.StrokeAlign[r.readVarUint()];break;case 81:e.strokeAlignTag=r.readVarUint();break;case 30:e.strokeCap=this.StrokeCap[r.readVarUint()];break;case 82:e.strokeCapTag=r.readVarUint();break;case 31:e.strokeJoin=this.StrokeJoin[r.readVarUint()];break;case 83:e.strokeJoinTag=r.readVarUint();break;case 38:for(var t=r.readVarUint(),i=e.fillPaints=Array(t),n=0;n<t;n++)i[n]=this.decodePaint(r);break;case 90:e.fillPaintsTag=r.readVarUint();break;case 39:for(var t=r.readVarUint(),i=e.strokePaints=Array(t),n=0;n<t;n++)i[n]=this.decodePaint(r);break;case 91:e.strokePaintsTag=r.readVarUint();break;case 43:for(var t=r.readVarUint(),i=e.effects=Array(t),n=0;n<t;n++)i[n]=this.decodeEffect(r);break;case 95:e.effectsTag=r.readVarUint();break;case 50:e.backgroundColor=this.decodeColor(r);break;case 102:e.backgroundColorTag=r.readVarUint();break;case 51:for(var t=r.readVarUint(),i=e.fillGeometry=Array(t),n=0;n<t;n++)i[n]=this.decodePath(r);break;case 103:e.fillGeometryTag=r.readVarUint();break;case 52:for(var t=r.readVarUint(),i=e.strokeGeometry=Array(t),n=0;n<t;n++)i[n]=this.decodePath(r);break;case 104:e.strokeGeometryTag=r.readVarUint();break;case 411:for(var t=r.readVarUint(),i=e.textDecorationFillPaints=Array(t),n=0;n<t;n++)i[n]=this.decodePaint(r);break;case 412:e.textDecorationSkipInk=!!r.readByte();break;case 413:e.textUnderlineOffset=this.decodeNumber(r);break;case 415:e.textDecorationThickness=this.decodeNumber(r);break;case 416:e.textDecorationStyle=this.TextDecorationStyle[r.readVarUint()];break;case 145:e.rectangleTopLeftCornerRadius=r.readVarFloat();break;case 146:e.rectangleTopRightCornerRadius=r.readVarFloat();break;case 147:e.rectangleBottomLeftCornerRadius=r.readVarFloat();break;case 148:e.rectangleBottomRightCornerRadius=r.readVarFloat();break;case 149:e.rectangleCornerRadiiIndependent=!!r.readByte();break;case 150:e.rectangleCornerToolIndependent=!!r.readByte();break;case 151:e.proportionsConstrained=!!r.readByte();break;case 423:e.targetAspectRatio=this.decodeOptionalVector(r);break;case 258:e.useAbsoluteBounds=!!r.readByte();break;case 287:e.borderTopHidden=!!r.readByte();break;case 288:e.borderBottomHidden=!!r.readByte();break;case 289:e.borderLeftHidden=!!r.readByte();break;case 290:e.borderRightHidden=!!r.readByte();break;case 294:e.bordersTakeSpace=!!r.readByte();break;case 295:e.borderTopWeight=r.readVarFloat();break;case 296:e.borderBottomWeight=r.readVarFloat();break;case 297:e.borderLeftWeight=r.readVarFloat();break;case 298:e.borderRightWeight=r.readVarFloat();break;case 299:e.borderStrokeWeightsIndependent=!!r.readByte();break;case 28:e.horizontalConstraint=this.ConstraintType[r.readVarUint()];break;case 80:e.horizontalConstraintTag=r.readVarUint();break;case 105:e.stackMode=this.StackMode[r.readVarUint()];break;case 106:e.stackModeTag=r.readVarUint();break;case 107:e.stackSpacing=r.readVarFloat();break;case 108:e.stackSpacingTag=r.readVarUint();break;case 109:e.stackPadding=r.readVarFloat();break;case 110:e.stackPaddingTag=r.readVarUint();break;case 120:e.stackCounterAlign=this.StackCounterAlign[r.readVarUint()];break;case 121:e.stackJustify=this.StackJustify[r.readVarUint()];break;case 208:e.stackAlign=this.StackAlign[r.readVarUint()];break;case 209:e.stackHorizontalPadding=r.readVarFloat();break;case 210:e.stackVerticalPadding=r.readVarFloat();break;case 211:e.stackWidth=this.StackSize[r.readVarUint()];break;case 212:e.stackHeight=this.StackSize[r.readVarUint()];break;case 229:e.stackPrimarySizing=this.StackSize[r.readVarUint()];break;case 230:e.stackPrimaryAlignItems=this.StackJustify[r.readVarUint()];break;case 231:e.stackCounterAlignItems=this.StackAlign[r.readVarUint()];break;case 232:e.stackChildPrimaryGrow=r.readVarFloat();break;case 233:e.stackPaddingRight=r.readVarFloat();break;case 234:e.stackPaddingBottom=r.readVarFloat();break;case 236:e.stackChildAlignSelf=this.StackCounterAlign[r.readVarUint()];break;case 269:e.stackPositioning=this.StackPositioning[r.readVarUint()];break;case 271:e.stackReverseZIndex=!!r.readByte();break;case 323:e.stackWrap=this.StackWrap[r.readVarUint()];break;case 324:e.stackCounterSpacing=r.readVarFloat();break;case 325:e.minSize=this.decodeOptionalVector(r);break;case 326:e.maxSize=this.decodeOptionalVector(r);break;case 343:e.stackCounterAlignContent=this.StackCounterAlignContent[r.readVarUint()];break;case 406:for(var t=r.readVarUint(),i=e.sortedMovingChildIndices=Array(t),n=0;n<t;n++)i[n]=r.readVarInt();break;case 344:e.isSnakeGameBoard=!!r.readByte();break;case 139:e.transitionNodeID=this.decodeGUID(r);break;case 140:e.prototypeStartNodeID=this.decodeGUID(r);break;case 141:e.prototypeBackgroundColor=this.decodeColor(r);break;case 153:e.transitionInfo=this.decodeTransitionInfo(r);break;case 154:e.transitionType=this.TransitionType[r.readVarUint()];break;case 155:e.transitionDuration=r.readVarFloat();break;case 156:e.easingType=this.EasingType[r.readVarUint()];break;case 181:e.transitionPreserveScroll=!!r.readByte();break;case 182:e.connectionType=this.ConnectionType[r.readVarUint()];break;case 183:e.connectionURL=r.readString();break;case 184:e.prototypeDevice=this.decodePrototypeDevice(r);break;case 187:e.interactionType=this.InteractionType[r.readVarUint()];break;case 188:e.transitionTimeout=r.readVarFloat();break;case 189:e.interactionMaintained=!!r.readByte();break;case 190:e.interactionDuration=r.readVarFloat();break;case 192:e.destinationIsOverlay=!!r.readByte();break;case 207:e.transitionShouldSmartAnimate=!!r.readByte();break;case 226:for(var t=r.readVarUint(),i=e.prototypeInteractions=Array(t),n=0;n<t;n++)i[n]=this.decodePrototypeInteraction(r);break;case 249:e.prototypeStartingPoint=this.decodePrototypeStartingPoint(r);break;case 204:for(var t=r.readVarUint(),i=e.pluginData=Array(t),n=0;n<t;n++)i[n]=this.decodePluginData(r);break;case 219:for(var t=r.readVarUint(),i=e.pluginRelaunchData=Array(t),n=0;n<t;n++)i[n]=this.decodePluginRelaunchData(r);break;case 242:e.connectorStart=this.decodeConnectorEndpoint(r);break;case 243:e.connectorEnd=this.decodeConnectorEndpoint(r);break;case 244:e.connectorLineStyle=this.ConnectorLineStyle[r.readVarUint()];break;case 245:e.connectorStartCap=this.StrokeCap[r.readVarUint()];break;case 246:e.connectorEndCap=this.StrokeCap[r.readVarUint()];break;case 253:for(var t=r.readVarUint(),i=e.connectorControlPoints=Array(t),n=0;n<t;n++)i[n]=this.decodeConnectorControlPoint(r);break;case 255:e.connectorTextMidpoint=this.decodeConnectorTextMidpoint(r);break;case 373:e.connectorType=this.ConnectorType[r.readVarUint()];break;case 369:for(var t=r.readVarUint(),i=e.annotations=Array(t),n=0;n<t;n++)i[n]=this.decodeAnnotation(r);break;case 384:for(var t=r.readVarUint(),i=e.measurements=Array(t),n=0;n<t;n++)i[n]=this.decodeAnnotationMeasurement(r);break;case 241:e.shapeWithTextType=this.ShapeWithTextType[r.readVarUint()];break;case 247:e.shapeUserHeight=r.readVarFloat();break;case 254:e.derivedImmutableFrameData=this.decodeDerivedImmutableFrameData(r);break;case 338:e.derivedImmutableFrameDataVersion=this.decodeMultiplayerFieldVersion(r);break;case 240:e.nodeGenerationData=this.decodeNodeGenerationData(r);break;case 259:e.codeBlockLanguage=this.CodeBlockLanguage[r.readVarUint()];break;case 278:e.linkPreviewData=this.decodeLinkPreviewData(r);break;case 282:e.shapeTruncates=!!r.readByte();break;case 283:e.sectionContentsHidden=!!r.readByte();break;case 300:e.videoPlayback=this.decodeVideoPlayback(r);break;case 301:e.stampData=this.decodeStampData(r);break;case 370:e.sectionPresetInfo=this.decodeSectionPresetInfo(r);break;case 409:e.platformShapeDefinition=this.decodePlatformShapeDefinition(r);break;case 273:e.widgetSyncedState=this.decodeMultiplayerMap(r);break;case 274:e.widgetSyncCursor=r.readVarUint();break;case 275:e.widgetDerivedSubtreeCursor=this.decodeWidgetDerivedSubtreeCursor(r);break;case 276:e.widgetCachedAncestor=this.decodeWidgetPointer(r);break;case 285:e.widgetInputBehavior=this.WidgetInputBehavior[r.readVarUint()];break;case 286:e.widgetTooltip=r.readString();break;case 291:e.widgetHoverStyle=this.decodeWidgetHoverStyle(r);break;case 293:e.isWidgetStickable=!!r.readByte();break;case 360:e.shouldHideCursorsOnWidgetHover=!!r.readByte();break;case 262:e.widgetMetadata=this.decodeWidgetMetadata(r);break;case 263:for(var t=r.readVarUint(),i=e.widgetEvents=Array(t),n=0;n<t;n++)i[n]=this.WidgetEvent[r.readVarUint()];break;case 265:for(var t=r.readVarUint(),i=e.widgetPropertyMenuItems=Array(t),n=0;n<t;n++)i[n]=this.decodeWidgetPropertyMenuItem(r);break;case 401:e.widgetInputTextNodeType=this.WidgetInputTextNodeType[r.readVarUint()];break;case 308:e.tableRowPositions=this.decodeTableRowColumnPositionMap(r);break;case 309:e.tableColumnPositions=this.decodeTableRowColumnPositionMap(r);break;case 310:e.tableRowHeights=this.decodeTableRowColumnSizeMap(r);break;case 311:e.tableColumnWidths=this.decodeTableRowColumnSizeMap(r);break;case 371:e.interactiveSlideConfigData=this.decodeMultiplayerMap(r);break;case 372:e.interactiveSlideParticipantData=this.decodeMultiplayerMap(r);break;case 402:e.flappType=this.FlappType[r.readVarUint()];break;case 389:e.slideSpeakerNotes=r.readString();break;case 410:e.isSkippedSlide=!!r.readByte();break;case 379:e.themeID=this.decodeThemeID(r);break;case 381:e.slideThemeData=this.decodeSlideThemeData(r);break;case 390:e.slideThemeMap=this.decodeSlideThemeMap(r);break;case 393:e.slideTemplateFileKey=r.readString();break;case 363:e.diagramParentId=this.decodeGUID(r);break;case 362:e.layoutRoot=this.decodeGUID(r);break;case 364:e.layoutPosition=r.readString();break;case 366:e.diagramLayoutRuleType=this.DiagramLayoutRuleType[r.readVarUint()];break;case 367:e.diagramParentIndex=this.decodeDiagramParentIndex(r);break;case 368:e.diagramLayoutPaused=this.DiagramLayoutPaused[r.readVarUint()];break;case 380:e.isPageDivider=!!r.readByte();break;case 251:e.internalEnumForTest=this.InternalEnumForTest[r.readVarUint()];break;case 257:e.internalDataForTest=this.decodeInternalDataForTest(r);break;case 10:e.count=r.readVarUint();break;case 62:e.countTag=r.readVarUint();break;case 14:e.autoRename=!!r.readByte();break;case 66:e.autoRenameTag=r.readVarUint();break;case 15:e.backgroundEnabled=!!r.readByte();break;case 67:e.backgroundEnabledTag=r.readVarUint();break;case 17:e.exportContentsOnly=!!r.readByte();break;case 69:e.exportContentsOnlyTag=r.readVarUint();break;case 24:e.starInnerScale=r.readVarFloat();break;case 76:e.starInnerScaleTag=r.readVarUint();break;case 25:e.miterLimit=r.readVarFloat();break;case 77:e.miterLimitTag=r.readVarUint();break;case 27:e.textTracking=r.readVarFloat();break;case 79:e.textTrackingTag=r.readVarUint();break;case 36:e.booleanOperation=this.BooleanOperation[r.readVarUint()];break;case 88:e.booleanOperationTag=r.readVarUint();break;case 37:e.verticalConstraint=this.ConstraintType[r.readVarUint()];break;case 89:e.verticalConstraintTag=r.readVarUint();break;case 44:e.handleMirroring=this.VectorMirror[r.readVarUint()];break;case 96:e.handleMirroringTag=r.readVarUint();break;case 45:for(var t=r.readVarUint(),i=e.exportSettings=Array(t),n=0;n<t;n++)i[n]=this.decodeExportSettings(r);break;case 97:e.exportSettingsTag=r.readVarUint();break;case 46:e.textAutoResize=this.TextAutoResize[r.readVarUint()];break;case 98:e.textAutoResizeTag=r.readVarUint();break;case 47:for(var t=r.readVarUint(),i=e.layoutGrids=Array(t),n=0;n<t;n++)i[n]=this.decodeLayoutGrid(r);break;case 99:e.layoutGridsTag=r.readVarUint();break;case 48:e.vectorData=this.decodeVectorData(r);break;case 100:e.vectorDataTag=r.readVarUint();break;case 115:e.frameMaskDisabled=!!r.readByte();break;case 116:e.frameMaskDisabledTag=r.readVarUint();break;case 117:e.resizeToFit=!!r.readByte();break;case 118:e.resizeToFitTag=r.readVarUint();break;case 119:e.exportBackgroundDisabled=!!r.readByte();break;case 138:for(var t=r.readVarUint(),i=e.guides=Array(t),n=0;n<t;n++)i[n]=this.decodeGuide(r);break;case 142:e.internalOnly=!!r.readByte();break;case 159:e.scrollDirection=this.ScrollDirection[r.readVarUint()];break;case 160:e.cornerSmoothing=r.readVarFloat();break;case 166:e.scrollOffset=this.decodeVector(r);break;case 175:e.exportTextAsSVGText=!!r.readByte();break;case 178:e.scrollContractedState=this.ScrollContractedState[r.readVarUint()];break;case 179:e.contractedSize=this.decodeVector(r);break;case 180:e.fixedChildrenDivider=r.readString();break;case 186:e.scrollBehavior=this.ScrollBehavior[r.readVarUint()];break;case 195:e.arcData=this.decodeArcData(r);break;case 196:e.derivedSymbolDataLayoutVersion=r.readVarInt();break;case 197:e.navigationType=this.NavigationType[r.readVarUint()];break;case 198:e.overlayPositionType=this.OverlayPositionType[r.readVarUint()];break;case 199:e.overlayRelativePosition=this.decodeVector(r);break;case 200:e.overlayBackgroundInteraction=this.OverlayBackgroundInteraction[r.readVarUint()];break;case 201:e.overlayBackgroundAppearance=this.decodeOverlayBackgroundAppearance(r);break;case 213:e.overrideKey=this.decodeGUID(r);break;case 220:e.containerSupportsFillStrokeAndCorners=!!r.readByte();break;case 221:e.stackCounterSizing=this.StackSize[r.readVarUint()];break;case 222:e.containersSupportFillStrokeAndCorners=!!r.readByte();break;case 224:e.keyTrigger=this.decodeKeyTrigger(r);break;case 227:e.voiceEventPhrase=r.readString();break;case 235:for(var t=r.readVarUint(),i=e.ancestorPathBeforeDeletion=Array(t),n=0;n<t;n++)i[n]=this.decodeGUID(r);break;case 237:for(var t=r.readVarUint(),i=e.symbolLinks=Array(t),n=0;n<t;n++)i[n]=this.decodeSymbolLink(r);break;case 239:e.textListData=this.decodeTextListData(r);break;case 261:e.detachOpticalSizeFromFontSize=!!r.readByte();break;case 264:e.listSpacing=r.readVarFloat();break;case 270:e.embedData=this.decodeEmbedData(r);break;case 272:e.richMediaData=this.decodeRichMediaData(r);break;case 277:e.renderedSyncedState=this.decodeMultiplayerMap(r);break;case 284:e.simplifyInstancePanels=!!r.readByte();break;case 302:e.accessibleHTMLTag=this.HTMLTag[r.readVarUint()];break;case 303:e.ariaRole=this.ARIARole[r.readVarUint()];break;case 304:e.accessibleLabel=r.readString();break;case 306:e.variableData=this.decodeVariableData(r);break;case 307:e.variableConsumptionMap=this.decodeVariableDataMap(r);break;case 316:e.variableModeBySetMap=this.decodeVariableModeBySetMap(r);break;case 312:for(var t=r.readVarUint(),i=e.variableSetModes=Array(t),n=0;n<t;n++)i[n]=this.decodeVariableSetMode(r);break;case 313:e.variableSetID=this.decodeVariableSetID(r);break;case 314:e.variableResolvedType=this.VariableResolvedDataType[r.readVarUint()];break;case 315:e.variableDataValues=this.decodeVariableDataValues(r);break;case 350:e.variableTokenName=r.readString();break;case 353:for(var t=r.readVarUint(),i=e.variableScopes=Array(t),n=0;n<t;n++)i[n]=this.VariableScope[r.readVarUint()];break;case 358:e.codeSyntax=this.decodeCodeSyntaxMap(r);break;case 388:e.pasteSource=this.decodePasteSource(r);break;case 397:e.pageType=this.EditorType[r.readVarUint()];break;case 377:e.backingVariableSetId=this.decodeVariableSetID(r);break;case 378:e.backingVariableId=this.decodeVariableIdOrVariableOverrideId(r);break;case 385:e.isCollectionExtendable=!!r.readByte();break;case 386:e.rootVariableKey=r.readString();break;case 361:e.handoffStatusMap=this.decodeHandoffStatusMap(r);break;case 327:e.agendaPositionMap=this.decodeAgendaPositionMap(r);break;case 328:e.agendaMetadataMap=this.decodeAgendaMetadataMap(r);break;case 329:e.migrationStatus=this.decodeMigrationStatus(r);break;case 330:e.isSoftDeleted=!!r.readByte();break;case 331:e.editInfo=this.decodeEditInfo(r);break;case 341:e.colorProfile=this.ColorProfile[r.readVarUint()];break;case 342:e.detachedSymbolId=this.decodeSymbolId(r);break;case 346:e.childReadingDirection=this.ChildReadingDirection[r.readVarUint()];break;case 347:e.readingIndex=r.readString();break;case 349:e.documentColorProfile=this.DocumentColorProfile[r.readVarUint()];break;case 354:for(var t=r.readVarUint(),i=e.developerRelatedLinks=Array(t),n=0;n<t;n++)i[n]=this.decodeDeveloperRelatedLink(r);break;case 356:e.slideActiveThemeLibKey=r.readString();break;case 357:e.ariaAttributes=this.decodeARIAAttributesMap(r);break;case 365:e.editScopeInfo=this.decodeEditScopeInfo(r);break;case 374:e.semanticWeight=this.SemanticWeight[r.readVarUint()];break;case 375:e.semanticItalic=this.SemanticItalic[r.readVarUint()];break;case 387:e.isResponsiveSet=!!r.readByte();break;case 398:e.defaultResponsiveSetId=this.decodeGUID(r);break;case 400:e.responsiveSetSettings=this.decodeResponsiveSetSettings(r);break;case 403:e.areSlidesManuallyIndented=!!r.readByte();break;case 404:e.behaviors=this.decodeNodeBehaviors(r);break;case 414:e.sourceCode=r.readString();break;case 419:e.cmsSelector=this.decodeCMSSelector(r);break;case 420:e.cmsConsumptionMap=this.decodeCMSConsumptionMap(r);break;case 405:for(var t=r.readVarUint(),i=e.aiEditedNodeChangeFieldNumbers=Array(t),n=0;n<t;n++)i[n]=r.readVarUint();break;case 408:e.aiEditScopeLabel=r.readString();break;case 407:e.firstDraftData=this.decodeFirstDraftData(r);break;case 418:e.firstDraftKitElementData=this.decodeFirstDraftKitElementData(r);break;case 421:e.cooperRevertData=this.decodeCooperRevertData(r);break;case 422:e.hubFileAttribution=this.decodeHubFileAttribution(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeNodeChange=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var a=r.guid;a!=null&&(e.writeVarUint(1),this.encodeGUID(a,e));var a=r.guidTag;a!=null&&(e.writeVarUint(53),e.writeVarUint(a));var a=r.phase;if(a!=null){e.writeVarUint(2);var t=this.NodePhase[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "NodePhase"');e.writeVarUint(t)}var a=r.phaseTag;a!=null&&(e.writeVarUint(54),e.writeVarUint(a));var a=r.parentIndex;a!=null&&(e.writeVarUint(3),this.encodeParentIndex(a,e));var a=r.parentIndexTag;a!=null&&(e.writeVarUint(55),e.writeVarUint(a));var a=r.type;if(a!=null){e.writeVarUint(4);var t=this.NodeType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "NodeType"');e.writeVarUint(t)}var a=r.typeTag;a!=null&&(e.writeVarUint(56),e.writeVarUint(a));var a=r.name;a!=null&&(e.writeVarUint(5),e.writeString(a));var a=r.nameTag;a!=null&&(e.writeVarUint(57),e.writeVarUint(a));var a=r.isPublishable;a!=null&&(e.writeVarUint(174),e.writeByte(a));var a=r.description;a!=null&&(e.writeVarUint(318),e.writeString(a));var a=r.libraryMoveInfo;a!=null&&(e.writeVarUint(256),this.encodeLibraryMoveInfo(a,e));var a=r.libraryMoveHistory;if(a!=null){e.writeVarUint(281);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeLibraryMoveHistoryItem(a,e)}var a=r.key;a!=null&&(e.writeVarUint(319),e.writeString(a));var a=r.fileAssetIds;a!=null&&(e.writeVarUint(383),this.encodeAssetIdMap(a,e));var a=r.styleID;a!=null&&(e.writeVarUint(49),e.writeVarUint(a));var a=r.styleIDTag;a!=null&&(e.writeVarUint(101),e.writeVarUint(a));var a=r.isSoftDeletedStyle;a!=null&&(e.writeVarUint(176),e.writeByte(a));var a=r.isNonUpdateable;a!=null&&(e.writeVarUint(177),e.writeByte(a));var a=r.isFillStyle;a!=null&&(e.writeVarUint(157),e.writeByte(a));var a=r.isStrokeStyle;a!=null&&(e.writeVarUint(161),e.writeByte(a));var a=r.isOverrideOverTextStyle;a!=null&&(e.writeVarUint(376),e.writeByte(a));var a=r.styleType;if(a!=null){e.writeVarUint(163);var t=this.StyleType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StyleType"');e.writeVarUint(t)}var a=r.styleDescription;a!=null&&(e.writeVarUint(191),e.writeString(a));var a=r.version;a!=null&&(e.writeVarUint(171),e.writeString(a));var a=r.sharedStyleMasterData;a!=null&&(e.writeVarUint(172),this.encodeSharedStyleMasterData(a,e));var a=r.sharedStyleReference;a!=null&&(e.writeVarUint(173),this.encodeSharedStyleReference(a,e));var a=r.userFacingVersion;a!=null&&(e.writeVarUint(399),e.writeString(a));var a=r.sortPosition;a!=null&&(e.writeVarUint(320),e.writeString(a));var a=r.ojansSuperSecretNodeField;a!=null&&(e.writeVarUint(345),this.encodeSharedStyleMasterData(a,e));var a=r.sevMoonlitLilyData;a!=null&&(e.writeVarUint(348),this.encodeSharedStyleMasterData(a,e));var a=r.inheritFillStyleID;a!=null&&(e.writeVarUint(158),this.encodeGUID(a,e));var a=r.inheritStrokeStyleID;a!=null&&(e.writeVarUint(162),this.encodeGUID(a,e));var a=r.inheritTextStyleID;a!=null&&(e.writeVarUint(167),this.encodeGUID(a,e));var a=r.inheritExportStyleID;a!=null&&(e.writeVarUint(168),this.encodeGUID(a,e));var a=r.inheritEffectStyleID;a!=null&&(e.writeVarUint(169),this.encodeGUID(a,e));var a=r.inheritGridStyleID;a!=null&&(e.writeVarUint(170),this.encodeGUID(a,e));var a=r.inheritFillStyleIDForStroke;a!=null&&(e.writeVarUint(185),this.encodeGUID(a,e));var a=r.styleIdForFill;a!=null&&(e.writeVarUint(332),this.encodeStyleId(a,e));var a=r.styleIdForStrokeFill;a!=null&&(e.writeVarUint(333),this.encodeStyleId(a,e));var a=r.styleIdForText;a!=null&&(e.writeVarUint(334),this.encodeStyleId(a,e));var a=r.styleIdForEffect;a!=null&&(e.writeVarUint(335),this.encodeStyleId(a,e));var a=r.styleIdForGrid;a!=null&&(e.writeVarUint(336),this.encodeStyleId(a,e));var a=r.backgroundPaints;if(a!=null){e.writeVarUint(193);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodePaint(a,e)}var a=r.inheritFillStyleIDForBackground;a!=null&&(e.writeVarUint(194),this.encodeGUID(a,e));var a=r.isStateGroup;a!=null&&(e.writeVarUint(225),e.writeByte(a));var a=r.stateGroupPropertyValueOrders;if(a!=null){e.writeVarUint(238);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeStateGroupPropertyValueOrder(a,e)}var a=r.sharedSymbolReference;a!=null&&(e.writeVarUint(122),this.encodeSharedSymbolReference(a,e));var a=r.isSymbolPublishable;a!=null&&(e.writeVarUint(123),e.writeByte(a));var a=r.sharedSymbolMappings;if(a!=null){e.writeVarUint(124);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeGUIDPathMapping(a,e)}var a=r.sharedSymbolVersion;a!=null&&(e.writeVarUint(126),e.writeString(a));var a=r.sharedComponentMasterData;a!=null&&(e.writeVarUint(152),this.encodeSharedComponentMasterData(a,e));var a=r.symbolDescription;a!=null&&(e.writeVarUint(144),e.writeString(a));var a=r.unflatteningMappings;if(a!=null){e.writeVarUint(164);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeGUIDPathMapping(a,e)}var a=r.forceUnflatteningMappings;if(a!=null){e.writeVarUint(228);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeGUIDPathMapping(a,e)}var a=r.publishFile;a!=null&&(e.writeVarUint(214),e.writeString(a));var a=r.sourceLibraryKey;a!=null&&(e.writeVarUint(395),e.writeString(a));var a=r.publishID;a!=null&&(e.writeVarUint(215),this.encodeGUID(a,e));var a=r.componentKey;a!=null&&(e.writeVarUint(216),e.writeString(a));var a=r.isC2;a!=null&&(e.writeVarUint(217),e.writeByte(a));var a=r.publishedVersion;a!=null&&(e.writeVarUint(218),e.writeString(a));var a=r.originComponentKey;a!=null&&(e.writeVarUint(252),e.writeString(a));var a=r.componentPropDefs;if(a!=null){e.writeVarUint(266);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeComponentPropDef(a,e)}var a=r.componentPropRefs;if(a!=null){e.writeVarUint(267);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeComponentPropRef(a,e)}var a=r.symbolData;a!=null&&(e.writeVarUint(113),this.encodeSymbolData(a,e));var a=r.symbolDataTag;a!=null&&(e.writeVarUint(114),e.writeVarUint(a));var a=r.derivedSymbolData;if(a!=null){e.writeVarUint(125);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeNodeChange(a,e)}var a=r.nestedInstanceResizeEnabled;a!=null&&(e.writeVarUint(394),e.writeByte(a));var a=r.overriddenSymbolID;a!=null&&(e.writeVarUint(143),this.encodeGUID(a,e));var a=r.componentPropAssignments;if(a!=null){e.writeVarUint(268);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeComponentPropAssignment(a,e)}var a=r.propsAreBubbled;a!=null&&(e.writeVarUint(305),e.writeByte(a));var a=r.overrideStash;if(a!=null){e.writeVarUint(248);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeInstanceOverrideStash(a,e)}var a=r.overrideStashV2;if(a!=null){e.writeVarUint(250);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeInstanceOverrideStashV2(a,e)}var a=r.guidPath;a!=null&&(e.writeVarUint(111),this.encodeGUIDPath(a,e));var a=r.guidPathTag;a!=null&&(e.writeVarUint(112),e.writeVarUint(a));var a=r.overrideLevel;a!=null&&(e.writeVarUint(321),e.writeVarInt(a));var a=r.moduleType;if(a!=null){e.writeVarUint(382);var t=this.ModuleType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "ModuleType"');e.writeVarUint(t)}var a=r.fontSize;a!=null&&(e.writeVarUint(21),e.writeVarFloat(a));var a=r.fontSizeTag;a!=null&&(e.writeVarUint(73),e.writeVarUint(a));var a=r.paragraphIndent;a!=null&&(e.writeVarUint(22),e.writeVarFloat(a));var a=r.paragraphIndentTag;a!=null&&(e.writeVarUint(74),e.writeVarUint(a));var a=r.paragraphSpacing;a!=null&&(e.writeVarUint(23),e.writeVarFloat(a));var a=r.paragraphSpacingTag;a!=null&&(e.writeVarUint(75),e.writeVarUint(a));var a=r.textAlignHorizontal;if(a!=null){e.writeVarUint(32);var t=this.TextAlignHorizontal[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "TextAlignHorizontal"');e.writeVarUint(t)}var a=r.textAlignHorizontalTag;a!=null&&(e.writeVarUint(84),e.writeVarUint(a));var a=r.textAlignVertical;if(a!=null){e.writeVarUint(33);var t=this.TextAlignVertical[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "TextAlignVertical"');e.writeVarUint(t)}var a=r.textAlignVerticalTag;a!=null&&(e.writeVarUint(85),e.writeVarUint(a));var a=r.textCase;if(a!=null){e.writeVarUint(34);var t=this.TextCase[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "TextCase"');e.writeVarUint(t)}var a=r.textCaseTag;a!=null&&(e.writeVarUint(86),e.writeVarUint(a));var a=r.textDecoration;if(a!=null){e.writeVarUint(35);var t=this.TextDecoration[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "TextDecoration"');e.writeVarUint(t)}var a=r.textDecorationTag;a!=null&&(e.writeVarUint(87),e.writeVarUint(a));var a=r.lineHeight;a!=null&&(e.writeVarUint(40),this.encodeNumber(a,e));var a=r.lineHeightTag;a!=null&&(e.writeVarUint(92),e.writeVarUint(a));var a=r.fontName;a!=null&&(e.writeVarUint(41),this.encodeFontName(a,e));var a=r.fontNameTag;a!=null&&(e.writeVarUint(93),e.writeVarUint(a));var a=r.textData;a!=null&&(e.writeVarUint(42),this.encodeTextData(a,e));var a=r.textDataTag;a!=null&&(e.writeVarUint(94),e.writeVarUint(a));var a=r.derivedTextData;a!=null&&(e.writeVarUint(359),this.encodeDerivedTextData(a,e));var a=r.fontVariantCommonLigatures;a!=null&&(e.writeVarUint(127),e.writeByte(a));var a=r.fontVariantContextualLigatures;a!=null&&(e.writeVarUint(128),e.writeByte(a));var a=r.fontVariantDiscretionaryLigatures;a!=null&&(e.writeVarUint(129),e.writeByte(a));var a=r.fontVariantHistoricalLigatures;a!=null&&(e.writeVarUint(130),e.writeByte(a));var a=r.fontVariantOrdinal;a!=null&&(e.writeVarUint(131),e.writeByte(a));var a=r.fontVariantSlashedZero;a!=null&&(e.writeVarUint(132),e.writeByte(a));var a=r.fontVariantNumericFigure;if(a!=null){e.writeVarUint(133);var t=this.FontVariantNumericFigure[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "FontVariantNumericFigure"');e.writeVarUint(t)}var a=r.fontVariantNumericSpacing;if(a!=null){e.writeVarUint(134);var t=this.FontVariantNumericSpacing[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "FontVariantNumericSpacing"');e.writeVarUint(t)}var a=r.fontVariantNumericFraction;if(a!=null){e.writeVarUint(135);var t=this.FontVariantNumericFraction[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "FontVariantNumericFraction"');e.writeVarUint(t)}var a=r.fontVariantCaps;if(a!=null){e.writeVarUint(136);var t=this.FontVariantCaps[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "FontVariantCaps"');e.writeVarUint(t)}var a=r.fontVariantPosition;if(a!=null){e.writeVarUint(137);var t=this.FontVariantPosition[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "FontVariantPosition"');e.writeVarUint(t)}var a=r.letterSpacing;a!=null&&(e.writeVarUint(165),this.encodeNumber(a,e));var a=r.fontVersion;a!=null&&(e.writeVarUint(202),e.writeString(a));var a=r.leadingTrim;if(a!=null){e.writeVarUint(322);var t=this.LeadingTrim[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "LeadingTrim"');e.writeVarUint(t)}var a=r.hangingPunctuation;a!=null&&(e.writeVarUint(337),e.writeByte(a));var a=r.hangingList;a!=null&&(e.writeVarUint(339),e.writeByte(a));var a=r.maxLines;a!=null&&(e.writeVarUint(351),e.writeVarInt(a));var a=r.responsiveTextStyleVariants;if(a!=null){e.writeVarUint(417);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeResponsiveTextStyleVariant(a,e)}var a=r.sectionStatus;if(a!=null){e.writeVarUint(352);var t=this.SectionStatus[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "SectionStatus"');e.writeVarUint(t)}var a=r.sectionStatusInfo;a!=null&&(e.writeVarUint(355),this.encodeSectionStatusInfo(a,e));var a=r.textUserLayoutVersion;a!=null&&(e.writeVarUint(203),e.writeVarUint(a));var a=r.textExplicitLayoutVersion;a!=null&&(e.writeVarUint(396),e.writeVarUint(a));var a=r.toggledOnOTFeatures;if(a!=null){e.writeVarUint(205);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++){a=i[o];var t=this.OpenTypeFeature[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "OpenTypeFeature"');e.writeVarUint(t)}}var a=r.toggledOffOTFeatures;if(a!=null){e.writeVarUint(206);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++){a=i[o];var t=this.OpenTypeFeature[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "OpenTypeFeature"');e.writeVarUint(t)}}var a=r.hyperlink;a!=null&&(e.writeVarUint(223),this.encodeHyperlink(a,e));var a=r.mention;a!=null&&(e.writeVarUint(340),this.encodeMention(a,e));var a=r.fontVariations;if(a!=null){e.writeVarUint(260);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeFontVariation(a,e)}var a=r.textBidiVersion;a!=null&&(e.writeVarUint(279),e.writeVarUint(a));var a=r.textTruncation;if(a!=null){e.writeVarUint(280);var t=this.TextTruncation[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "TextTruncation"');e.writeVarUint(t)}var a=r.hasHadRTLText;a!=null&&(e.writeVarUint(292),e.writeByte(a));var a=r.emojiImageSet;if(a!=null){e.writeVarUint(391);var t=this.EmojiImageSet[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "EmojiImageSet"');e.writeVarUint(t)}var a=r.slideThumbnailHash;a!=null&&(e.writeVarUint(392),e.writeString(a));var a=r.visible;a!=null&&(e.writeVarUint(6),e.writeByte(a));var a=r.visibleTag;a!=null&&(e.writeVarUint(58),e.writeVarUint(a));var a=r.locked;a!=null&&(e.writeVarUint(7),e.writeByte(a));var a=r.lockedTag;a!=null&&(e.writeVarUint(59),e.writeVarUint(a));var a=r.opacity;a!=null&&(e.writeVarUint(8),e.writeVarFloat(a));var a=r.opacityTag;a!=null&&(e.writeVarUint(60),e.writeVarUint(a));var a=r.blendMode;if(a!=null){e.writeVarUint(9);var t=this.BlendMode[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "BlendMode"');e.writeVarUint(t)}var a=r.blendModeTag;a!=null&&(e.writeVarUint(61),e.writeVarUint(a));var a=r.size;a!=null&&(e.writeVarUint(11),this.encodeVector(a,e));var a=r.sizeTag;a!=null&&(e.writeVarUint(63),e.writeVarUint(a));var a=r.transform;a!=null&&(e.writeVarUint(12),this.encodeMatrix(a,e));var a=r.transformTag;a!=null&&(e.writeVarUint(64),e.writeVarUint(a));var a=r.dashPattern;if(a!=null){e.writeVarUint(13);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],e.writeVarFloat(a)}var a=r.dashPatternTag;a!=null&&(e.writeVarUint(65),e.writeVarUint(a));var a=r.mask;a!=null&&(e.writeVarUint(16),e.writeByte(a));var a=r.maskTag;a!=null&&(e.writeVarUint(68),e.writeVarUint(a));var a=r.maskIsOutline;a!=null&&(e.writeVarUint(18),e.writeByte(a));var a=r.maskIsOutlineTag;a!=null&&(e.writeVarUint(70),e.writeVarUint(a));var a=r.maskType;if(a!=null){e.writeVarUint(317);var t=this.MaskType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "MaskType"');e.writeVarUint(t)}var a=r.backgroundOpacity;a!=null&&(e.writeVarUint(19),e.writeVarFloat(a));var a=r.backgroundOpacityTag;a!=null&&(e.writeVarUint(71),e.writeVarUint(a));var a=r.cornerRadius;a!=null&&(e.writeVarUint(20),e.writeVarFloat(a));var a=r.cornerRadiusTag;a!=null&&(e.writeVarUint(72),e.writeVarUint(a));var a=r.strokeWeight;a!=null&&(e.writeVarUint(26),e.writeVarFloat(a));var a=r.strokeWeightTag;a!=null&&(e.writeVarUint(78),e.writeVarUint(a));var a=r.strokeAlign;if(a!=null){e.writeVarUint(29);var t=this.StrokeAlign[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StrokeAlign"');e.writeVarUint(t)}var a=r.strokeAlignTag;a!=null&&(e.writeVarUint(81),e.writeVarUint(a));var a=r.strokeCap;if(a!=null){e.writeVarUint(30);var t=this.StrokeCap[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StrokeCap"');e.writeVarUint(t)}var a=r.strokeCapTag;a!=null&&(e.writeVarUint(82),e.writeVarUint(a));var a=r.strokeJoin;if(a!=null){e.writeVarUint(31);var t=this.StrokeJoin[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StrokeJoin"');e.writeVarUint(t)}var a=r.strokeJoinTag;a!=null&&(e.writeVarUint(83),e.writeVarUint(a));var a=r.fillPaints;if(a!=null){e.writeVarUint(38);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodePaint(a,e)}var a=r.fillPaintsTag;a!=null&&(e.writeVarUint(90),e.writeVarUint(a));var a=r.strokePaints;if(a!=null){e.writeVarUint(39);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodePaint(a,e)}var a=r.strokePaintsTag;a!=null&&(e.writeVarUint(91),e.writeVarUint(a));var a=r.effects;if(a!=null){e.writeVarUint(43);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeEffect(a,e)}var a=r.effectsTag;a!=null&&(e.writeVarUint(95),e.writeVarUint(a));var a=r.backgroundColor;a!=null&&(e.writeVarUint(50),this.encodeColor(a,e));var a=r.backgroundColorTag;a!=null&&(e.writeVarUint(102),e.writeVarUint(a));var a=r.fillGeometry;if(a!=null){e.writeVarUint(51);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodePath(a,e)}var a=r.fillGeometryTag;a!=null&&(e.writeVarUint(103),e.writeVarUint(a));var a=r.strokeGeometry;if(a!=null){e.writeVarUint(52);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodePath(a,e)}var a=r.strokeGeometryTag;a!=null&&(e.writeVarUint(104),e.writeVarUint(a));var a=r.textDecorationFillPaints;if(a!=null){e.writeVarUint(411);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodePaint(a,e)}var a=r.textDecorationSkipInk;a!=null&&(e.writeVarUint(412),e.writeByte(a));var a=r.textUnderlineOffset;a!=null&&(e.writeVarUint(413),this.encodeNumber(a,e));var a=r.textDecorationThickness;a!=null&&(e.writeVarUint(415),this.encodeNumber(a,e));var a=r.textDecorationStyle;if(a!=null){e.writeVarUint(416);var t=this.TextDecorationStyle[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "TextDecorationStyle"');e.writeVarUint(t)}var a=r.rectangleTopLeftCornerRadius;a!=null&&(e.writeVarUint(145),e.writeVarFloat(a));var a=r.rectangleTopRightCornerRadius;a!=null&&(e.writeVarUint(146),e.writeVarFloat(a));var a=r.rectangleBottomLeftCornerRadius;a!=null&&(e.writeVarUint(147),e.writeVarFloat(a));var a=r.rectangleBottomRightCornerRadius;a!=null&&(e.writeVarUint(148),e.writeVarFloat(a));var a=r.rectangleCornerRadiiIndependent;a!=null&&(e.writeVarUint(149),e.writeByte(a));var a=r.rectangleCornerToolIndependent;a!=null&&(e.writeVarUint(150),e.writeByte(a));var a=r.proportionsConstrained;a!=null&&(e.writeVarUint(151),e.writeByte(a));var a=r.targetAspectRatio;a!=null&&(e.writeVarUint(423),this.encodeOptionalVector(a,e));var a=r.useAbsoluteBounds;a!=null&&(e.writeVarUint(258),e.writeByte(a));var a=r.borderTopHidden;a!=null&&(e.writeVarUint(287),e.writeByte(a));var a=r.borderBottomHidden;a!=null&&(e.writeVarUint(288),e.writeByte(a));var a=r.borderLeftHidden;a!=null&&(e.writeVarUint(289),e.writeByte(a));var a=r.borderRightHidden;a!=null&&(e.writeVarUint(290),e.writeByte(a));var a=r.bordersTakeSpace;a!=null&&(e.writeVarUint(294),e.writeByte(a));var a=r.borderTopWeight;a!=null&&(e.writeVarUint(295),e.writeVarFloat(a));var a=r.borderBottomWeight;a!=null&&(e.writeVarUint(296),e.writeVarFloat(a));var a=r.borderLeftWeight;a!=null&&(e.writeVarUint(297),e.writeVarFloat(a));var a=r.borderRightWeight;a!=null&&(e.writeVarUint(298),e.writeVarFloat(a));var a=r.borderStrokeWeightsIndependent;a!=null&&(e.writeVarUint(299),e.writeByte(a));var a=r.horizontalConstraint;if(a!=null){e.writeVarUint(28);var t=this.ConstraintType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "ConstraintType"');e.writeVarUint(t)}var a=r.horizontalConstraintTag;a!=null&&(e.writeVarUint(80),e.writeVarUint(a));var a=r.stackMode;if(a!=null){e.writeVarUint(105);var t=this.StackMode[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StackMode"');e.writeVarUint(t)}var a=r.stackModeTag;a!=null&&(e.writeVarUint(106),e.writeVarUint(a));var a=r.stackSpacing;a!=null&&(e.writeVarUint(107),e.writeVarFloat(a));var a=r.stackSpacingTag;a!=null&&(e.writeVarUint(108),e.writeVarUint(a));var a=r.stackPadding;a!=null&&(e.writeVarUint(109),e.writeVarFloat(a));var a=r.stackPaddingTag;a!=null&&(e.writeVarUint(110),e.writeVarUint(a));var a=r.stackCounterAlign;if(a!=null){e.writeVarUint(120);var t=this.StackCounterAlign[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StackCounterAlign"');e.writeVarUint(t)}var a=r.stackJustify;if(a!=null){e.writeVarUint(121);var t=this.StackJustify[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StackJustify"');e.writeVarUint(t)}var a=r.stackAlign;if(a!=null){e.writeVarUint(208);var t=this.StackAlign[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StackAlign"');e.writeVarUint(t)}var a=r.stackHorizontalPadding;a!=null&&(e.writeVarUint(209),e.writeVarFloat(a));var a=r.stackVerticalPadding;a!=null&&(e.writeVarUint(210),e.writeVarFloat(a));var a=r.stackWidth;if(a!=null){e.writeVarUint(211);var t=this.StackSize[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StackSize"');e.writeVarUint(t)}var a=r.stackHeight;if(a!=null){e.writeVarUint(212);var t=this.StackSize[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StackSize"');e.writeVarUint(t)}var a=r.stackPrimarySizing;if(a!=null){e.writeVarUint(229);var t=this.StackSize[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StackSize"');e.writeVarUint(t)}var a=r.stackPrimaryAlignItems;if(a!=null){e.writeVarUint(230);var t=this.StackJustify[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StackJustify"');e.writeVarUint(t)}var a=r.stackCounterAlignItems;if(a!=null){e.writeVarUint(231);var t=this.StackAlign[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StackAlign"');e.writeVarUint(t)}var a=r.stackChildPrimaryGrow;a!=null&&(e.writeVarUint(232),e.writeVarFloat(a));var a=r.stackPaddingRight;a!=null&&(e.writeVarUint(233),e.writeVarFloat(a));var a=r.stackPaddingBottom;a!=null&&(e.writeVarUint(234),e.writeVarFloat(a));var a=r.stackChildAlignSelf;if(a!=null){e.writeVarUint(236);var t=this.StackCounterAlign[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StackCounterAlign"');e.writeVarUint(t)}var a=r.stackPositioning;if(a!=null){e.writeVarUint(269);var t=this.StackPositioning[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StackPositioning"');e.writeVarUint(t)}var a=r.stackReverseZIndex;a!=null&&(e.writeVarUint(271),e.writeByte(a));var a=r.stackWrap;if(a!=null){e.writeVarUint(323);var t=this.StackWrap[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StackWrap"');e.writeVarUint(t)}var a=r.stackCounterSpacing;a!=null&&(e.writeVarUint(324),e.writeVarFloat(a));var a=r.minSize;a!=null&&(e.writeVarUint(325),this.encodeOptionalVector(a,e));var a=r.maxSize;a!=null&&(e.writeVarUint(326),this.encodeOptionalVector(a,e));var a=r.stackCounterAlignContent;if(a!=null){e.writeVarUint(343);var t=this.StackCounterAlignContent[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StackCounterAlignContent"');e.writeVarUint(t)}var a=r.sortedMovingChildIndices;if(a!=null){e.writeVarUint(406);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],e.writeVarInt(a)}var a=r.isSnakeGameBoard;a!=null&&(e.writeVarUint(344),e.writeByte(a));var a=r.transitionNodeID;a!=null&&(e.writeVarUint(139),this.encodeGUID(a,e));var a=r.prototypeStartNodeID;a!=null&&(e.writeVarUint(140),this.encodeGUID(a,e));var a=r.prototypeBackgroundColor;a!=null&&(e.writeVarUint(141),this.encodeColor(a,e));var a=r.transitionInfo;a!=null&&(e.writeVarUint(153),this.encodeTransitionInfo(a,e));var a=r.transitionType;if(a!=null){e.writeVarUint(154);var t=this.TransitionType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "TransitionType"');e.writeVarUint(t)}var a=r.transitionDuration;a!=null&&(e.writeVarUint(155),e.writeVarFloat(a));var a=r.easingType;if(a!=null){e.writeVarUint(156);var t=this.EasingType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "EasingType"');e.writeVarUint(t)}var a=r.transitionPreserveScroll;a!=null&&(e.writeVarUint(181),e.writeByte(a));var a=r.connectionType;if(a!=null){e.writeVarUint(182);var t=this.ConnectionType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "ConnectionType"');e.writeVarUint(t)}var a=r.connectionURL;a!=null&&(e.writeVarUint(183),e.writeString(a));var a=r.prototypeDevice;a!=null&&(e.writeVarUint(184),this.encodePrototypeDevice(a,e));var a=r.interactionType;if(a!=null){e.writeVarUint(187);var t=this.InteractionType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "InteractionType"');e.writeVarUint(t)}var a=r.transitionTimeout;a!=null&&(e.writeVarUint(188),e.writeVarFloat(a));var a=r.interactionMaintained;a!=null&&(e.writeVarUint(189),e.writeByte(a));var a=r.interactionDuration;a!=null&&(e.writeVarUint(190),e.writeVarFloat(a));var a=r.destinationIsOverlay;a!=null&&(e.writeVarUint(192),e.writeByte(a));var a=r.transitionShouldSmartAnimate;a!=null&&(e.writeVarUint(207),e.writeByte(a));var a=r.prototypeInteractions;if(a!=null){e.writeVarUint(226);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodePrototypeInteraction(a,e)}var a=r.prototypeStartingPoint;a!=null&&(e.writeVarUint(249),this.encodePrototypeStartingPoint(a,e));var a=r.pluginData;if(a!=null){e.writeVarUint(204);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodePluginData(a,e)}var a=r.pluginRelaunchData;if(a!=null){e.writeVarUint(219);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodePluginRelaunchData(a,e)}var a=r.connectorStart;a!=null&&(e.writeVarUint(242),this.encodeConnectorEndpoint(a,e));var a=r.connectorEnd;a!=null&&(e.writeVarUint(243),this.encodeConnectorEndpoint(a,e));var a=r.connectorLineStyle;if(a!=null){e.writeVarUint(244);var t=this.ConnectorLineStyle[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "ConnectorLineStyle"');e.writeVarUint(t)}var a=r.connectorStartCap;if(a!=null){e.writeVarUint(245);var t=this.StrokeCap[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StrokeCap"');e.writeVarUint(t)}var a=r.connectorEndCap;if(a!=null){e.writeVarUint(246);var t=this.StrokeCap[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StrokeCap"');e.writeVarUint(t)}var a=r.connectorControlPoints;if(a!=null){e.writeVarUint(253);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeConnectorControlPoint(a,e)}var a=r.connectorTextMidpoint;a!=null&&(e.writeVarUint(255),this.encodeConnectorTextMidpoint(a,e));var a=r.connectorType;if(a!=null){e.writeVarUint(373);var t=this.ConnectorType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "ConnectorType"');e.writeVarUint(t)}var a=r.annotations;if(a!=null){e.writeVarUint(369);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeAnnotation(a,e)}var a=r.measurements;if(a!=null){e.writeVarUint(384);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeAnnotationMeasurement(a,e)}var a=r.shapeWithTextType;if(a!=null){e.writeVarUint(241);var t=this.ShapeWithTextType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "ShapeWithTextType"');e.writeVarUint(t)}var a=r.shapeUserHeight;a!=null&&(e.writeVarUint(247),e.writeVarFloat(a));var a=r.derivedImmutableFrameData;a!=null&&(e.writeVarUint(254),this.encodeDerivedImmutableFrameData(a,e));var a=r.derivedImmutableFrameDataVersion;a!=null&&(e.writeVarUint(338),this.encodeMultiplayerFieldVersion(a,e));var a=r.nodeGenerationData;a!=null&&(e.writeVarUint(240),this.encodeNodeGenerationData(a,e));var a=r.codeBlockLanguage;if(a!=null){e.writeVarUint(259);var t=this.CodeBlockLanguage[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "CodeBlockLanguage"');e.writeVarUint(t)}var a=r.linkPreviewData;a!=null&&(e.writeVarUint(278),this.encodeLinkPreviewData(a,e));var a=r.shapeTruncates;a!=null&&(e.writeVarUint(282),e.writeByte(a));var a=r.sectionContentsHidden;a!=null&&(e.writeVarUint(283),e.writeByte(a));var a=r.videoPlayback;a!=null&&(e.writeVarUint(300),this.encodeVideoPlayback(a,e));var a=r.stampData;a!=null&&(e.writeVarUint(301),this.encodeStampData(a,e));var a=r.sectionPresetInfo;a!=null&&(e.writeVarUint(370),this.encodeSectionPresetInfo(a,e));var a=r.platformShapeDefinition;a!=null&&(e.writeVarUint(409),this.encodePlatformShapeDefinition(a,e));var a=r.widgetSyncedState;a!=null&&(e.writeVarUint(273),this.encodeMultiplayerMap(a,e));var a=r.widgetSyncCursor;a!=null&&(e.writeVarUint(274),e.writeVarUint(a));var a=r.widgetDerivedSubtreeCursor;a!=null&&(e.writeVarUint(275),this.encodeWidgetDerivedSubtreeCursor(a,e));var a=r.widgetCachedAncestor;a!=null&&(e.writeVarUint(276),this.encodeWidgetPointer(a,e));var a=r.widgetInputBehavior;if(a!=null){e.writeVarUint(285);var t=this.WidgetInputBehavior[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "WidgetInputBehavior"');e.writeVarUint(t)}var a=r.widgetTooltip;a!=null&&(e.writeVarUint(286),e.writeString(a));var a=r.widgetHoverStyle;a!=null&&(e.writeVarUint(291),this.encodeWidgetHoverStyle(a,e));var a=r.isWidgetStickable;a!=null&&(e.writeVarUint(293),e.writeByte(a));var a=r.shouldHideCursorsOnWidgetHover;a!=null&&(e.writeVarUint(360),e.writeByte(a));var a=r.widgetMetadata;a!=null&&(e.writeVarUint(262),this.encodeWidgetMetadata(a,e));var a=r.widgetEvents;if(a!=null){e.writeVarUint(263);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++){a=i[o];var t=this.WidgetEvent[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "WidgetEvent"');e.writeVarUint(t)}}var a=r.widgetPropertyMenuItems;if(a!=null){e.writeVarUint(265);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeWidgetPropertyMenuItem(a,e)}var a=r.widgetInputTextNodeType;if(a!=null){e.writeVarUint(401);var t=this.WidgetInputTextNodeType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "WidgetInputTextNodeType"');e.writeVarUint(t)}var a=r.tableRowPositions;a!=null&&(e.writeVarUint(308),this.encodeTableRowColumnPositionMap(a,e));var a=r.tableColumnPositions;a!=null&&(e.writeVarUint(309),this.encodeTableRowColumnPositionMap(a,e));var a=r.tableRowHeights;a!=null&&(e.writeVarUint(310),this.encodeTableRowColumnSizeMap(a,e));var a=r.tableColumnWidths;a!=null&&(e.writeVarUint(311),this.encodeTableRowColumnSizeMap(a,e));var a=r.interactiveSlideConfigData;a!=null&&(e.writeVarUint(371),this.encodeMultiplayerMap(a,e));var a=r.interactiveSlideParticipantData;a!=null&&(e.writeVarUint(372),this.encodeMultiplayerMap(a,e));var a=r.flappType;if(a!=null){e.writeVarUint(402);var t=this.FlappType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "FlappType"');e.writeVarUint(t)}var a=r.slideSpeakerNotes;a!=null&&(e.writeVarUint(389),e.writeString(a));var a=r.isSkippedSlide;a!=null&&(e.writeVarUint(410),e.writeByte(a));var a=r.themeID;a!=null&&(e.writeVarUint(379),this.encodeThemeID(a,e));var a=r.slideThemeData;a!=null&&(e.writeVarUint(381),this.encodeSlideThemeData(a,e));var a=r.slideThemeMap;a!=null&&(e.writeVarUint(390),this.encodeSlideThemeMap(a,e));var a=r.slideTemplateFileKey;a!=null&&(e.writeVarUint(393),e.writeString(a));var a=r.diagramParentId;a!=null&&(e.writeVarUint(363),this.encodeGUID(a,e));var a=r.layoutRoot;a!=null&&(e.writeVarUint(362),this.encodeGUID(a,e));var a=r.layoutPosition;a!=null&&(e.writeVarUint(364),e.writeString(a));var a=r.diagramLayoutRuleType;if(a!=null){e.writeVarUint(366);var t=this.DiagramLayoutRuleType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "DiagramLayoutRuleType"');e.writeVarUint(t)}var a=r.diagramParentIndex;a!=null&&(e.writeVarUint(367),this.encodeDiagramParentIndex(a,e));var a=r.diagramLayoutPaused;if(a!=null){e.writeVarUint(368);var t=this.DiagramLayoutPaused[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "DiagramLayoutPaused"');e.writeVarUint(t)}var a=r.isPageDivider;a!=null&&(e.writeVarUint(380),e.writeByte(a));var a=r.internalEnumForTest;if(a!=null){e.writeVarUint(251);var t=this.InternalEnumForTest[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "InternalEnumForTest"');e.writeVarUint(t)}var a=r.internalDataForTest;a!=null&&(e.writeVarUint(257),this.encodeInternalDataForTest(a,e));var a=r.count;a!=null&&(e.writeVarUint(10),e.writeVarUint(a));var a=r.countTag;a!=null&&(e.writeVarUint(62),e.writeVarUint(a));var a=r.autoRename;a!=null&&(e.writeVarUint(14),e.writeByte(a));var a=r.autoRenameTag;a!=null&&(e.writeVarUint(66),e.writeVarUint(a));var a=r.backgroundEnabled;a!=null&&(e.writeVarUint(15),e.writeByte(a));var a=r.backgroundEnabledTag;a!=null&&(e.writeVarUint(67),e.writeVarUint(a));var a=r.exportContentsOnly;a!=null&&(e.writeVarUint(17),e.writeByte(a));var a=r.exportContentsOnlyTag;a!=null&&(e.writeVarUint(69),e.writeVarUint(a));var a=r.starInnerScale;a!=null&&(e.writeVarUint(24),e.writeVarFloat(a));var a=r.starInnerScaleTag;a!=null&&(e.writeVarUint(76),e.writeVarUint(a));var a=r.miterLimit;a!=null&&(e.writeVarUint(25),e.writeVarFloat(a));var a=r.miterLimitTag;a!=null&&(e.writeVarUint(77),e.writeVarUint(a));var a=r.textTracking;a!=null&&(e.writeVarUint(27),e.writeVarFloat(a));var a=r.textTrackingTag;a!=null&&(e.writeVarUint(79),e.writeVarUint(a));var a=r.booleanOperation;if(a!=null){e.writeVarUint(36);var t=this.BooleanOperation[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "BooleanOperation"');e.writeVarUint(t)}var a=r.booleanOperationTag;a!=null&&(e.writeVarUint(88),e.writeVarUint(a));var a=r.verticalConstraint;if(a!=null){e.writeVarUint(37);var t=this.ConstraintType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "ConstraintType"');e.writeVarUint(t)}var a=r.verticalConstraintTag;a!=null&&(e.writeVarUint(89),e.writeVarUint(a));var a=r.handleMirroring;if(a!=null){e.writeVarUint(44);var t=this.VectorMirror[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "VectorMirror"');e.writeVarUint(t)}var a=r.handleMirroringTag;a!=null&&(e.writeVarUint(96),e.writeVarUint(a));var a=r.exportSettings;if(a!=null){e.writeVarUint(45);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeExportSettings(a,e)}var a=r.exportSettingsTag;a!=null&&(e.writeVarUint(97),e.writeVarUint(a));var a=r.textAutoResize;if(a!=null){e.writeVarUint(46);var t=this.TextAutoResize[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "TextAutoResize"');e.writeVarUint(t)}var a=r.textAutoResizeTag;a!=null&&(e.writeVarUint(98),e.writeVarUint(a));var a=r.layoutGrids;if(a!=null){e.writeVarUint(47);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeLayoutGrid(a,e)}var a=r.layoutGridsTag;a!=null&&(e.writeVarUint(99),e.writeVarUint(a));var a=r.vectorData;a!=null&&(e.writeVarUint(48),this.encodeVectorData(a,e));var a=r.vectorDataTag;a!=null&&(e.writeVarUint(100),e.writeVarUint(a));var a=r.frameMaskDisabled;a!=null&&(e.writeVarUint(115),e.writeByte(a));var a=r.frameMaskDisabledTag;a!=null&&(e.writeVarUint(116),e.writeVarUint(a));var a=r.resizeToFit;a!=null&&(e.writeVarUint(117),e.writeByte(a));var a=r.resizeToFitTag;a!=null&&(e.writeVarUint(118),e.writeVarUint(a));var a=r.exportBackgroundDisabled;a!=null&&(e.writeVarUint(119),e.writeByte(a));var a=r.guides;if(a!=null){e.writeVarUint(138);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeGuide(a,e)}var a=r.internalOnly;a!=null&&(e.writeVarUint(142),e.writeByte(a));var a=r.scrollDirection;if(a!=null){e.writeVarUint(159);var t=this.ScrollDirection[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "ScrollDirection"');e.writeVarUint(t)}var a=r.cornerSmoothing;a!=null&&(e.writeVarUint(160),e.writeVarFloat(a));var a=r.scrollOffset;a!=null&&(e.writeVarUint(166),this.encodeVector(a,e));var a=r.exportTextAsSVGText;a!=null&&(e.writeVarUint(175),e.writeByte(a));var a=r.scrollContractedState;if(a!=null){e.writeVarUint(178);var t=this.ScrollContractedState[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "ScrollContractedState"');e.writeVarUint(t)}var a=r.contractedSize;a!=null&&(e.writeVarUint(179),this.encodeVector(a,e));var a=r.fixedChildrenDivider;a!=null&&(e.writeVarUint(180),e.writeString(a));var a=r.scrollBehavior;if(a!=null){e.writeVarUint(186);var t=this.ScrollBehavior[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "ScrollBehavior"');e.writeVarUint(t)}var a=r.arcData;a!=null&&(e.writeVarUint(195),this.encodeArcData(a,e));var a=r.derivedSymbolDataLayoutVersion;a!=null&&(e.writeVarUint(196),e.writeVarInt(a));var a=r.navigationType;if(a!=null){e.writeVarUint(197);var t=this.NavigationType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "NavigationType"');e.writeVarUint(t)}var a=r.overlayPositionType;if(a!=null){e.writeVarUint(198);var t=this.OverlayPositionType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "OverlayPositionType"');e.writeVarUint(t)}var a=r.overlayRelativePosition;a!=null&&(e.writeVarUint(199),this.encodeVector(a,e));var a=r.overlayBackgroundInteraction;if(a!=null){e.writeVarUint(200);var t=this.OverlayBackgroundInteraction[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "OverlayBackgroundInteraction"');e.writeVarUint(t)}var a=r.overlayBackgroundAppearance;a!=null&&(e.writeVarUint(201),this.encodeOverlayBackgroundAppearance(a,e));var a=r.overrideKey;a!=null&&(e.writeVarUint(213),this.encodeGUID(a,e));var a=r.containerSupportsFillStrokeAndCorners;a!=null&&(e.writeVarUint(220),e.writeByte(a));var a=r.stackCounterSizing;if(a!=null){e.writeVarUint(221);var t=this.StackSize[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StackSize"');e.writeVarUint(t)}var a=r.containersSupportFillStrokeAndCorners;a!=null&&(e.writeVarUint(222),e.writeByte(a));var a=r.keyTrigger;a!=null&&(e.writeVarUint(224),this.encodeKeyTrigger(a,e));var a=r.voiceEventPhrase;a!=null&&(e.writeVarUint(227),e.writeString(a));var a=r.ancestorPathBeforeDeletion;if(a!=null){e.writeVarUint(235);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeGUID(a,e)}var a=r.symbolLinks;if(a!=null){e.writeVarUint(237);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeSymbolLink(a,e)}var a=r.textListData;a!=null&&(e.writeVarUint(239),this.encodeTextListData(a,e));var a=r.detachOpticalSizeFromFontSize;a!=null&&(e.writeVarUint(261),e.writeByte(a));var a=r.listSpacing;a!=null&&(e.writeVarUint(264),e.writeVarFloat(a));var a=r.embedData;a!=null&&(e.writeVarUint(270),this.encodeEmbedData(a,e));var a=r.richMediaData;a!=null&&(e.writeVarUint(272),this.encodeRichMediaData(a,e));var a=r.renderedSyncedState;a!=null&&(e.writeVarUint(277),this.encodeMultiplayerMap(a,e));var a=r.simplifyInstancePanels;a!=null&&(e.writeVarUint(284),e.writeByte(a));var a=r.accessibleHTMLTag;if(a!=null){e.writeVarUint(302);var t=this.HTMLTag[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "HTMLTag"');e.writeVarUint(t)}var a=r.ariaRole;if(a!=null){e.writeVarUint(303);var t=this.ARIARole[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "ARIARole"');e.writeVarUint(t)}var a=r.accessibleLabel;a!=null&&(e.writeVarUint(304),e.writeString(a));var a=r.variableData;a!=null&&(e.writeVarUint(306),this.encodeVariableData(a,e));var a=r.variableConsumptionMap;a!=null&&(e.writeVarUint(307),this.encodeVariableDataMap(a,e));var a=r.variableModeBySetMap;a!=null&&(e.writeVarUint(316),this.encodeVariableModeBySetMap(a,e));var a=r.variableSetModes;if(a!=null){e.writeVarUint(312);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeVariableSetMode(a,e)}var a=r.variableSetID;a!=null&&(e.writeVarUint(313),this.encodeVariableSetID(a,e));var a=r.variableResolvedType;if(a!=null){e.writeVarUint(314);var t=this.VariableResolvedDataType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "VariableResolvedDataType"');e.writeVarUint(t)}var a=r.variableDataValues;a!=null&&(e.writeVarUint(315),this.encodeVariableDataValues(a,e));var a=r.variableTokenName;a!=null&&(e.writeVarUint(350),e.writeString(a));var a=r.variableScopes;if(a!=null){e.writeVarUint(353);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++){a=i[o];var t=this.VariableScope[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "VariableScope"');e.writeVarUint(t)}}var a=r.codeSyntax;a!=null&&(e.writeVarUint(358),this.encodeCodeSyntaxMap(a,e));var a=r.pasteSource;a!=null&&(e.writeVarUint(388),this.encodePasteSource(a,e));var a=r.pageType;if(a!=null){e.writeVarUint(397);var t=this.EditorType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "EditorType"');e.writeVarUint(t)}var a=r.backingVariableSetId;a!=null&&(e.writeVarUint(377),this.encodeVariableSetID(a,e));var a=r.backingVariableId;a!=null&&(e.writeVarUint(378),this.encodeVariableIdOrVariableOverrideId(a,e));var a=r.isCollectionExtendable;a!=null&&(e.writeVarUint(385),e.writeByte(a));var a=r.rootVariableKey;a!=null&&(e.writeVarUint(386),e.writeString(a));var a=r.handoffStatusMap;a!=null&&(e.writeVarUint(361),this.encodeHandoffStatusMap(a,e));var a=r.agendaPositionMap;a!=null&&(e.writeVarUint(327),this.encodeAgendaPositionMap(a,e));var a=r.agendaMetadataMap;a!=null&&(e.writeVarUint(328),this.encodeAgendaMetadataMap(a,e));var a=r.migrationStatus;a!=null&&(e.writeVarUint(329),this.encodeMigrationStatus(a,e));var a=r.isSoftDeleted;a!=null&&(e.writeVarUint(330),e.writeByte(a));var a=r.editInfo;a!=null&&(e.writeVarUint(331),this.encodeEditInfo(a,e));var a=r.colorProfile;if(a!=null){e.writeVarUint(341);var t=this.ColorProfile[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "ColorProfile"');e.writeVarUint(t)}var a=r.detachedSymbolId;a!=null&&(e.writeVarUint(342),this.encodeSymbolId(a,e));var a=r.childReadingDirection;if(a!=null){e.writeVarUint(346);var t=this.ChildReadingDirection[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "ChildReadingDirection"');e.writeVarUint(t)}var a=r.readingIndex;a!=null&&(e.writeVarUint(347),e.writeString(a));var a=r.documentColorProfile;if(a!=null){e.writeVarUint(349);var t=this.DocumentColorProfile[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "DocumentColorProfile"');e.writeVarUint(t)}var a=r.developerRelatedLinks;if(a!=null){e.writeVarUint(354);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeDeveloperRelatedLink(a,e)}var a=r.slideActiveThemeLibKey;a!=null&&(e.writeVarUint(356),e.writeString(a));var a=r.ariaAttributes;a!=null&&(e.writeVarUint(357),this.encodeARIAAttributesMap(a,e));var a=r.editScopeInfo;a!=null&&(e.writeVarUint(365),this.encodeEditScopeInfo(a,e));var a=r.semanticWeight;if(a!=null){e.writeVarUint(374);var t=this.SemanticWeight[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "SemanticWeight"');e.writeVarUint(t)}var a=r.semanticItalic;if(a!=null){e.writeVarUint(375);var t=this.SemanticItalic[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "SemanticItalic"');e.writeVarUint(t)}var a=r.isResponsiveSet;a!=null&&(e.writeVarUint(387),e.writeByte(a));var a=r.defaultResponsiveSetId;a!=null&&(e.writeVarUint(398),this.encodeGUID(a,e));var a=r.responsiveSetSettings;a!=null&&(e.writeVarUint(400),this.encodeResponsiveSetSettings(a,e));var a=r.areSlidesManuallyIndented;a!=null&&(e.writeVarUint(403),e.writeByte(a));var a=r.behaviors;a!=null&&(e.writeVarUint(404),this.encodeNodeBehaviors(a,e));var a=r.sourceCode;a!=null&&(e.writeVarUint(414),e.writeString(a));var a=r.cmsSelector;a!=null&&(e.writeVarUint(419),this.encodeCMSSelector(a,e));var a=r.cmsConsumptionMap;a!=null&&(e.writeVarUint(420),this.encodeCMSConsumptionMap(a,e));var a=r.aiEditedNodeChangeFieldNumbers;if(a!=null){e.writeVarUint(405);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],e.writeVarUint(a)}var a=r.aiEditScopeLabel;a!=null&&(e.writeVarUint(408),e.writeString(a));var a=r.firstDraftData;a!=null&&(e.writeVarUint(407),this.encodeFirstDraftData(a,e));var a=r.firstDraftKitElementData;a!=null&&(e.writeVarUint(418),this.encodeFirstDraftKitElementData(a,e));var a=r.cooperRevertData;a!=null&&(e.writeVarUint(421),this.encodeCooperRevertData(a,e));var a=r.hubFileAttribution;if(a!=null&&(e.writeVarUint(422),this.encodeHubFileAttribution(a,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeResponsiveSetSettings=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.title=r.readString();break;case 2:e.description=r.readString();break;case 3:e.scalingMode=this.ResponsiveScalingMode[r.readVarUint()];break;case 4:e.scalingMinFontSize=r.readVarFloat();break;case 5:e.scalingMaxFontSize=r.readVarFloat();break;case 6:e.scalingMinLayoutWidth=r.readVarFloat();break;case 7:e.scalingMaxLayoutWidth=r.readVarFloat();break;case 8:e.lang=r.readString();break;case 9:e.faviconHash=r.readString();break;case 10:e.socialImageHash=r.readString();break;case 11:e.googleAnalyticsID=r.readString();break;case 12:e.blockSearchIndexing=!!r.readByte();break;case 13:e.customCodeHeadStart=r.readString();break;case 14:e.customCodeHeadEnd=r.readString();break;case 15:e.customCodeBodyStart=r.readString();break;case 16:e.customCodeBodyEnd=r.readString();break;case 17:e.faviconID=this.decodeGUID(r);break;case 18:e.socialImageID=this.decodeGUID(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeResponsiveSetSettings=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.title;i!=null&&(e.writeVarUint(1),e.writeString(i));var i=r.description;i!=null&&(e.writeVarUint(2),e.writeString(i));var i=r.scalingMode;if(i!=null){e.writeVarUint(3);var t=this.ResponsiveScalingMode[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "ResponsiveScalingMode"');e.writeVarUint(t)}var i=r.scalingMinFontSize;i!=null&&(e.writeVarUint(4),e.writeVarFloat(i));var i=r.scalingMaxFontSize;i!=null&&(e.writeVarUint(5),e.writeVarFloat(i));var i=r.scalingMinLayoutWidth;i!=null&&(e.writeVarUint(6),e.writeVarFloat(i));var i=r.scalingMaxLayoutWidth;i!=null&&(e.writeVarUint(7),e.writeVarFloat(i));var i=r.lang;i!=null&&(e.writeVarUint(8),e.writeString(i));var i=r.faviconHash;i!=null&&(e.writeVarUint(9),e.writeString(i));var i=r.socialImageHash;i!=null&&(e.writeVarUint(10),e.writeString(i));var i=r.googleAnalyticsID;i!=null&&(e.writeVarUint(11),e.writeString(i));var i=r.blockSearchIndexing;i!=null&&(e.writeVarUint(12),e.writeByte(i));var i=r.customCodeHeadStart;i!=null&&(e.writeVarUint(13),e.writeString(i));var i=r.customCodeHeadEnd;i!=null&&(e.writeVarUint(14),e.writeString(i));var i=r.customCodeBodyStart;i!=null&&(e.writeVarUint(15),e.writeString(i));var i=r.customCodeBodyEnd;i!=null&&(e.writeVarUint(16),e.writeString(i));var i=r.faviconID;i!=null&&(e.writeVarUint(17),this.encodeGUID(i,e));var i=r.socialImageID;if(i!=null&&(e.writeVarUint(18),this.encodeGUID(i,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.ResponsiveScalingMode={0:"REFLOW",1:"SCALE",REFLOW:0,SCALE:1};l.decodeCMSSelector=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.cmsCollectionId=r.readString();break;case 2:e.filterCriteria=this.decodeCMSFilterCritera(r);break;case 3:for(var n=r.readVarUint(),t=e.sorts=Array(n),i=0;i<n;i++)t[i]=this.decodeCMSSelectorSort(r);break;case 4:e.limit=r.readVarUint();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeCMSSelector=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.cmsCollectionId;o!=null&&(e.writeVarUint(1),e.writeString(o));var o=r.filterCriteria;o!=null&&(e.writeVarUint(2),this.encodeCMSFilterCritera(o,e));var o=r.sorts;if(o!=null){e.writeVarUint(3);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeCMSSelectorSort(o,e)}var o=r.limit;if(o!=null&&(e.writeVarUint(4),e.writeVarUint(o)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeCMSFilterCritera=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.matchType=this.CMSFilterCriteriaMatchType[r.readVarUint()];break;case 2:for(var n=r.readVarUint(),t=e.filters=Array(n),i=0;i<n;i++)t[i]=this.decodeCMSSelectorFilter(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeCMSFilterCritera=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.matchType;if(i!=null){e.writeVarUint(1);var t=this.CMSFilterCriteriaMatchType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "CMSFilterCriteriaMatchType"');e.writeVarUint(t)}var i=r.filters;if(i!=null){e.writeVarUint(2);var d=i,o=d.length;e.writeVarUint(o);for(var a=0;a<o;a++)i=d[a],this.encodeCMSSelectorFilter(i,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.CMSFilterCriteriaMatchType={0:"MATCH_ALL",1:"MATCH_ANY",MATCH_ALL:0,MATCH_ANY:1};l.decodeCMSSelectorFilter=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.cmsFieldId=r.readString();break;case 2:e.op=this.CMSSelectorFilterOperator[r.readVarUint()];break;case 3:e.comparisonValue=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeCMSSelectorFilter=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.cmsFieldId;i!=null&&(e.writeVarUint(1),e.writeString(i));var i=r.op;if(i!=null){e.writeVarUint(2);var t=this.CMSSelectorFilterOperator[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "CMSSelectorFilterOperator"');e.writeVarUint(t)}var i=r.comparisonValue;if(i!=null&&(e.writeVarUint(3),e.writeString(i)),e.writeVarUint(0),n)return e.toUint8Array()};l.CMSSelectorFilterOperator={0:"EQUALS",EQUALS:0};l.decodeCMSSelectorSort=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.cmsFieldId=r.readString();break;case 2:e.orderBy=this.CMSFieldOrderBy[r.readVarUint()];break;default:throw new Error("Attempted to parse invalid message")}};l.encodeCMSSelectorSort=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.cmsFieldId;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.orderBy;if(t!=null){e.writeVarUint(2);var i=this.CMSFieldOrderBy[t];if(i===void 0)throw new Error("Invalid value "+JSON.stringify(t)+' for enum "CMSFieldOrderBy"');e.writeVarUint(i)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.CMSFieldOrderBy={0:"ASCENDING",1:"DESCENDING",ASCENDING:0,DESCENDING:1};l.decodeCMSConsumptionMap=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.entries=Array(n),i=0;i<n;i++)t[i]=this.decodeCMSConsumptionMapEntry(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeCMSConsumptionMap=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.entries;if(t!=null){e.writeVarUint(1);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeCMSConsumptionMapEntry(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeCMSConsumptionMapEntry=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.consumptionField=this.CMSConsumptionField[r.readVarUint()];break;case 2:e.cmsFieldId=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeCMSConsumptionMapEntry=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.consumptionField;if(i!=null){e.writeVarUint(1);var t=this.CMSConsumptionField[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "CMSConsumptionField"');e.writeVarUint(t)}var i=r.cmsFieldId;if(i!=null&&(e.writeVarUint(2),e.writeString(i)),e.writeVarUint(0),n)return e.toUint8Array()};l.CMSConsumptionField={0:"MISSING",1:"TEXT_DATA",MISSING:0,TEXT_DATA:1};l.decodeHubFileAttribution=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.hubFileId=r.readString();break;case 2:e.hubFileName=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeHubFileAttribution=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.hubFileId;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.hubFileName;if(t!=null&&(e.writeVarUint(2),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeCooperRevertData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.originalValues=this.decodeNodeChange(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeCooperRevertData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.originalValues;if(t!=null&&(e.writeVarUint(1),this.encodeNodeChange(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeVideoPlayback=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.autoplay=!!r.readByte();break;case 2:e.mediaLoop=!!r.readByte();break;case 3:e.muted=!!r.readByte();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVideoPlayback=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.autoplay;t!=null&&(e.writeVarUint(1),e.writeByte(t));var t=r.mediaLoop;t!=null&&(e.writeVarUint(2),e.writeByte(t));var t=r.muted;if(t!=null&&(e.writeVarUint(3),e.writeByte(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.MediaAction={0:"PLAY",1:"PAUSE",2:"TOGGLE_PLAY_PAUSE",3:"MUTE",4:"UNMUTE",5:"TOGGLE_MUTE_UNMUTE",6:"SKIP_FORWARD",7:"SKIP_BACKWARD",8:"SKIP_TO",PLAY:0,PAUSE:1,TOGGLE_PLAY_PAUSE:2,MUTE:3,UNMUTE:4,TOGGLE_MUTE_UNMUTE:5,SKIP_FORWARD:6,SKIP_BACKWARD:7,SKIP_TO:8};l.decodeWidgetHoverStyle=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var t=r.readVarUint(),i=e.fillPaints=Array(t),n=0;n<t;n++)i[n]=this.decodePaint(r);break;case 2:for(var t=r.readVarUint(),i=e.strokePaints=Array(t),n=0;n<t;n++)i[n]=this.decodePaint(r);break;case 3:e.opacity=r.readVarFloat();break;case 4:e.areFillPaintsSet=!!r.readByte();break;case 5:e.areStrokePaintsSet=!!r.readByte();break;case 6:e.isOpacitySet=!!r.readByte();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeWidgetHoverStyle=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.fillPaints;if(o!=null){e.writeVarUint(1);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodePaint(o,e)}var o=r.strokePaints;if(o!=null){e.writeVarUint(2);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodePaint(o,e)}var o=r.opacity;o!=null&&(e.writeVarUint(3),e.writeVarFloat(o));var o=r.areFillPaintsSet;o!=null&&(e.writeVarUint(4),e.writeByte(o));var o=r.areStrokePaintsSet;o!=null&&(e.writeVarUint(5),e.writeByte(o));var o=r.isOpacitySet;if(o!=null&&(e.writeVarUint(6),e.writeByte(o)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeWidgetDerivedSubtreeCursor=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.sessionID=r.readVarUint();break;case 2:e.counter=r.readVarUint();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeWidgetDerivedSubtreeCursor=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.sessionID;t!=null&&(e.writeVarUint(1),e.writeVarUint(t));var t=r.counter;if(t!=null&&(e.writeVarUint(2),e.writeVarUint(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeMultiplayerMap=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.entries=Array(n),i=0;i<n;i++)t[i]=this.decodeMultiplayerMapEntry(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeMultiplayerMap=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.entries;if(t!=null){e.writeVarUint(1);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeMultiplayerMapEntry(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeMultiplayerMapEntry=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.key=r.readString();break;case 2:e.value=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeMultiplayerMapEntry=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.key;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.value;if(t!=null&&(e.writeVarUint(2),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeVariableDataMap=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.entries=Array(n),i=0;i<n;i++)t[i]=this.decodeVariableDataMapEntry(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVariableDataMap=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.entries;if(t!=null){e.writeVarUint(1);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeVariableDataMapEntry(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeVariableDataMapEntry=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.nodeField=r.readVarUint();break;case 2:e.variableData=this.decodeVariableData(r);break;case 3:e.variableField=this.VariableField[r.readVarUint()];break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVariableDataMapEntry=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.nodeField;t!=null&&(e.writeVarUint(1),e.writeVarUint(t));var t=r.variableData;t!=null&&(e.writeVarUint(2),this.encodeVariableData(t,e));var t=r.variableField;if(t!=null){e.writeVarUint(3);var i=this.VariableField[t];if(i===void 0)throw new Error("Invalid value "+JSON.stringify(t)+' for enum "VariableField"');e.writeVarUint(i)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.VariableField={0:"MISSING",1:"CORNER_RADIUS",2:"PARAGRAPH_SPACING",3:"PARAGRAPH_INDENT",4:"STROKE_WEIGHT",5:"STACK_SPACING",6:"STACK_PADDING_LEFT",7:"STACK_PADDING_TOP",8:"STACK_PADDING_RIGHT",9:"STACK_PADDING_BOTTOM",10:"VISIBLE",11:"TEXT_DATA",12:"WIDTH",13:"HEIGHT",14:"RECTANGLE_TOP_LEFT_CORNER_RADIUS",15:"RECTANGLE_TOP_RIGHT_CORNER_RADIUS",16:"RECTANGLE_BOTTOM_LEFT_CORNER_RADIUS",17:"RECTANGLE_BOTTOM_RIGHT_CORNER_RADIUS",18:"BORDER_TOP_WEIGHT",19:"BORDER_BOTTOM_WEIGHT",20:"BORDER_LEFT_WEIGHT",21:"BORDER_RIGHT_WEIGHT",22:"VARIANT_PROPERTIES",23:"STACK_COUNTER_SPACING",24:"MIN_WIDTH",25:"MAX_WIDTH",26:"MIN_HEIGHT",27:"MAX_HEIGHT",28:"FONT_FAMILY",29:"FONT_STYLE",30:"FONT_VARIATIONS",31:"OPACITY",32:"FONT_SIZE",34:"LETTER_SPACING",36:"LINE_HEIGHT",MISSING:0,CORNER_RADIUS:1,PARAGRAPH_SPACING:2,PARAGRAPH_INDENT:3,STROKE_WEIGHT:4,STACK_SPACING:5,STACK_PADDING_LEFT:6,STACK_PADDING_TOP:7,STACK_PADDING_RIGHT:8,STACK_PADDING_BOTTOM:9,VISIBLE:10,TEXT_DATA:11,WIDTH:12,HEIGHT:13,RECTANGLE_TOP_LEFT_CORNER_RADIUS:14,RECTANGLE_TOP_RIGHT_CORNER_RADIUS:15,RECTANGLE_BOTTOM_LEFT_CORNER_RADIUS:16,RECTANGLE_BOTTOM_RIGHT_CORNER_RADIUS:17,BORDER_TOP_WEIGHT:18,BORDER_BOTTOM_WEIGHT:19,BORDER_LEFT_WEIGHT:20,BORDER_RIGHT_WEIGHT:21,VARIANT_PROPERTIES:22,STACK_COUNTER_SPACING:23,MIN_WIDTH:24,MAX_WIDTH:25,MIN_HEIGHT:26,MAX_HEIGHT:27,FONT_FAMILY:28,FONT_STYLE:29,FONT_VARIATIONS:30,OPACITY:31,FONT_SIZE:32,LETTER_SPACING:34,LINE_HEIGHT:36};l.decodeVariableModeBySetMap=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.entries=Array(n),i=0;i<n;i++)t[i]=this.decodeVariableModeBySetMapEntry(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVariableModeBySetMap=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.entries;if(t!=null){e.writeVarUint(1);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeVariableModeBySetMapEntry(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeVariableModeBySetMapEntry=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.variableSetID=this.decodeVariableSetID(r);break;case 2:e.variableModeID=this.decodeGUID(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVariableModeBySetMapEntry=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.variableSetID;t!=null&&(e.writeVarUint(1),this.encodeVariableSetID(t,e));var t=r.variableModeID;if(t!=null&&(e.writeVarUint(2),this.encodeGUID(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeCodeSyntaxMap=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.entries=Array(n),i=0;i<n;i++)t[i]=this.decodeCodeSyntaxMapEntry(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeCodeSyntaxMap=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.entries;if(t!=null){e.writeVarUint(1);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeCodeSyntaxMapEntry(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeCodeSyntaxMapEntry=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.platform=this.CodeSyntaxPlatform[r.readVarUint()];break;case 2:e.value=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeCodeSyntaxMapEntry=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.platform;if(i!=null){e.writeVarUint(1);var t=this.CodeSyntaxPlatform[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "CodeSyntaxPlatform"');e.writeVarUint(t)}var i=r.value;if(i!=null&&(e.writeVarUint(2),e.writeString(i)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeTableRowColumnPositionMap=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.entries=Array(n),i=0;i<n;i++)t[i]=this.decodeTableRowColumnPositionMapEntry(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeTableRowColumnPositionMap=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.entries;if(t!=null){e.writeVarUint(1);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeTableRowColumnPositionMapEntry(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeTableRowColumnPositionMapEntry=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.id=this.decodeGUID(r);break;case 2:e.position=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeTableRowColumnPositionMapEntry=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.id;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.position;if(t!=null&&(e.writeVarUint(2),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeTableRowColumnSizeMap=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.entries=Array(n),i=0;i<n;i++)t[i]=this.decodeTableRowColumnSizeMapEntry(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeTableRowColumnSizeMap=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.entries;if(t!=null){e.writeVarUint(1);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeTableRowColumnSizeMapEntry(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeTableRowColumnSizeMapEntry=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.id=this.decodeGUID(r);break;case 2:e.size=r.readVarFloat();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeTableRowColumnSizeMapEntry=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.id;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.size;if(t!=null&&(e.writeVarUint(2),e.writeVarFloat(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeAgendaPositionMap=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.entries=Array(n),i=0;i<n;i++)t[i]=this.decodeAgendaPositionMapEntry(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeAgendaPositionMap=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.entries;if(t!=null){e.writeVarUint(1);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeAgendaPositionMapEntry(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeAgendaPositionMapEntry=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.id=this.decodeGUID(r);break;case 2:e.position=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeAgendaPositionMapEntry=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.id;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.position;if(t!=null&&(e.writeVarUint(2),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.AgendaItemType={0:"NODE",1:"BLOCK",NODE:0,BLOCK:1};l.decodeAgendaMetadataMap=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.entries=Array(n),i=0;i<n;i++)t[i]=this.decodeAgendaMetadataMapEntry(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeAgendaMetadataMap=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.entries;if(t!=null){e.writeVarUint(1);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeAgendaMetadataMapEntry(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeAgendaMetadataMapEntry=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.id=this.decodeGUID(r);break;case 2:e.data=this.decodeAgendaMetadata(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeAgendaMetadataMapEntry=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.id;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.data;if(t!=null&&(e.writeVarUint(2),this.encodeAgendaMetadata(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeAgendaMetadata=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.name=r.readString();break;case 2:e.type=this.AgendaItemType[r.readVarUint()];break;case 3:e.targetNodeID=this.decodeGUID(r);break;case 4:e.timerInfo=this.decodeAgendaTimerInfo(r);break;case 5:e.voteInfo=this.decodeAgendaVoteInfo(r);break;case 6:e.musicInfo=this.decodeAgendaMusicInfo(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeAgendaMetadata=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.name;i!=null&&(e.writeVarUint(1),e.writeString(i));var i=r.type;if(i!=null){e.writeVarUint(2);var t=this.AgendaItemType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "AgendaItemType"');e.writeVarUint(t)}var i=r.targetNodeID;i!=null&&(e.writeVarUint(3),this.encodeGUID(i,e));var i=r.timerInfo;i!=null&&(e.writeVarUint(4),this.encodeAgendaTimerInfo(i,e));var i=r.voteInfo;i!=null&&(e.writeVarUint(5),this.encodeAgendaVoteInfo(i,e));var i=r.musicInfo;if(i!=null&&(e.writeVarUint(6),this.encodeAgendaMusicInfo(i,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeAgendaTimerInfo=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.timerLength=r.readVarUint();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeAgendaTimerInfo=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.timerLength;if(t!=null&&(e.writeVarUint(1),e.writeVarUint(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeAgendaVoteInfo=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.voteCount=r.readVarUint();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeAgendaVoteInfo=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.voteCount;if(t!=null&&(e.writeVarUint(1),e.writeVarUint(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeAgendaMusicInfo=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.songID=r.readString();break;case 2:e.startTimeMs=r.readVarUint();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeAgendaMusicInfo=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.songID;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.startTimeMs;if(t!=null&&(e.writeVarUint(2),e.writeVarUint(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.DiagramLayoutRuleType={0:"NONE",1:"TREE",NONE:0,TREE:1};l.decodeDiagramParentIndex=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.guid=this.decodeGUID(r),e.position=r.readString(),e};l.encodeDiagramParentIndex=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.guid;if(t!=null)this.encodeGUID(t,e);else throw new Error('Missing required field "guid"');var t=r.position;if(t!=null)e.writeString(t);else throw new Error('Missing required field "position"');if(n)return e.toUint8Array()};l.DiagramLayoutPaused={0:"NO",1:"YES",NO:0,YES:1};l.decodeComponentPropRef=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.nodeField=r.readVarUint();break;case 2:e.defID=this.decodeGUID(r);break;case 3:e.zombieFallbackName=r.readString();break;case 4:e.componentPropNodeField=this.ComponentPropNodeField[r.readVarUint()];break;case 5:e.isDeleted=!!r.readByte();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeComponentPropRef=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.nodeField;i!=null&&(e.writeVarUint(1),e.writeVarUint(i));var i=r.defID;i!=null&&(e.writeVarUint(2),this.encodeGUID(i,e));var i=r.zombieFallbackName;i!=null&&(e.writeVarUint(3),e.writeString(i));var i=r.componentPropNodeField;if(i!=null){e.writeVarUint(4);var t=this.ComponentPropNodeField[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "ComponentPropNodeField"');e.writeVarUint(t)}var i=r.isDeleted;if(i!=null&&(e.writeVarUint(5),e.writeByte(i)),e.writeVarUint(0),n)return e.toUint8Array()};l.ComponentPropNodeField={0:"VISIBLE",1:"TEXT_DATA",2:"OVERRIDDEN_SYMBOL_ID",3:"INHERIT_FILL_STYLE_ID",VISIBLE:0,TEXT_DATA:1,OVERRIDDEN_SYMBOL_ID:2,INHERIT_FILL_STYLE_ID:3};l.decodeComponentPropAssignment=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.defID=this.decodeGUID(r);break;case 2:e.value=this.decodeComponentPropValue(r);break;case 3:e.varValue=this.decodeVariableData(r);break;case 4:e.legacyDerivedTextData=this.decodeDerivedTextData(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeComponentPropAssignment=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.defID;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.value;t!=null&&(e.writeVarUint(2),this.encodeComponentPropValue(t,e));var t=r.varValue;t!=null&&(e.writeVarUint(3),this.encodeVariableData(t,e));var t=r.legacyDerivedTextData;if(t!=null&&(e.writeVarUint(4),this.encodeDerivedTextData(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeComponentPropDef=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.id=this.decodeGUID(r);break;case 2:e.name=r.readString();break;case 3:e.initialValue=this.decodeComponentPropValue(r);break;case 4:e.sortPosition=r.readString();break;case 5:e.parentPropDefId=this.decodeGUID(r);break;case 6:e.type=this.ComponentPropType[r.readVarUint()];break;case 7:e.isDeleted=!!r.readByte();break;case 8:e.preferredValues=this.decodeComponentPropPreferredValues(r);break;case 9:e.varValue=this.decodeVariableData(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeComponentPropDef=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.id;i!=null&&(e.writeVarUint(1),this.encodeGUID(i,e));var i=r.name;i!=null&&(e.writeVarUint(2),e.writeString(i));var i=r.initialValue;i!=null&&(e.writeVarUint(3),this.encodeComponentPropValue(i,e));var i=r.sortPosition;i!=null&&(e.writeVarUint(4),e.writeString(i));var i=r.parentPropDefId;i!=null&&(e.writeVarUint(5),this.encodeGUID(i,e));var i=r.type;if(i!=null){e.writeVarUint(6);var t=this.ComponentPropType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "ComponentPropType"');e.writeVarUint(t)}var i=r.isDeleted;i!=null&&(e.writeVarUint(7),e.writeByte(i));var i=r.preferredValues;i!=null&&(e.writeVarUint(8),this.encodeComponentPropPreferredValues(i,e));var i=r.varValue;if(i!=null&&(e.writeVarUint(9),this.encodeVariableData(i,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeComponentPropValue=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.boolValue=!!r.readByte();break;case 2:e.textValue=this.decodeTextData(r);break;case 3:e.guidValue=this.decodeGUID(r);break;case 4:e.floatValue=r.readVarFloat();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeComponentPropValue=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.boolValue;t!=null&&(e.writeVarUint(1),e.writeByte(t));var t=r.textValue;t!=null&&(e.writeVarUint(2),this.encodeTextData(t,e));var t=r.guidValue;t!=null&&(e.writeVarUint(3),this.encodeGUID(t,e));var t=r.floatValue;if(t!=null&&(e.writeVarUint(4),e.writeVarFloat(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.ComponentPropType={0:"BOOL",1:"TEXT",2:"COLOR",3:"INSTANCE_SWAP",5:"NUMBER",BOOL:0,TEXT:1,COLOR:2,INSTANCE_SWAP:3,NUMBER:5};l.decodeComponentPropPreferredValues=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var t=r.readVarUint(),i=e.stringValues=Array(t),n=0;n<t;n++)i[n]=r.readString();break;case 2:for(var t=r.readVarUint(),i=e.instanceSwapValues=Array(t),n=0;n<t;n++)i[n]=this.decodeInstanceSwapPreferredValue(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeComponentPropPreferredValues=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.stringValues;if(o!=null){e.writeVarUint(1);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],e.writeString(o)}var o=r.instanceSwapValues;if(o!=null){e.writeVarUint(2);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeInstanceSwapPreferredValue(o,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeInstanceSwapPreferredValue=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.type=this.InstanceSwapPreferredValueType[r.readVarUint()];break;case 2:e.key=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeInstanceSwapPreferredValue=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.type;if(i!=null){e.writeVarUint(1);var t=this.InstanceSwapPreferredValueType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "InstanceSwapPreferredValueType"');e.writeVarUint(t)}var i=r.key;if(i!=null&&(e.writeVarUint(2),e.writeString(i)),e.writeVarUint(0),n)return e.toUint8Array()};l.InstanceSwapPreferredValueType={0:"COMPONENT",1:"STATE_GROUP",COMPONENT:0,STATE_GROUP:1};l.WidgetEvent={0:"MOUSE_DOWN",1:"CLICK",2:"TEXT_EDIT_END",3:"ATTACHED_STICKABLES_CHANGED",4:"STUCK_STATUS_CHANGED",MOUSE_DOWN:0,CLICK:1,TEXT_EDIT_END:2,ATTACHED_STICKABLES_CHANGED:3,STUCK_STATUS_CHANGED:4};l.WidgetInputBehavior={0:"WRAP",1:"TRUNCATE",2:"MULTILINE",WRAP:0,TRUNCATE:1,MULTILINE:2};l.decodeWidgetMetadata=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.pluginID=r.readString();break;case 2:e.pluginVersionID=r.readString();break;case 3:e.widgetName=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeWidgetMetadata=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.pluginID;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.pluginVersionID;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.widgetName;if(t!=null&&(e.writeVarUint(3),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.WidgetPropertyMenuItemType={0:"ACTION",1:"SEPARATOR",2:"COLOR",3:"DROPDOWN",4:"COLOR_SELECTOR",5:"TOGGLE",6:"LINK",ACTION:0,SEPARATOR:1,COLOR:2,DROPDOWN:3,COLOR_SELECTOR:4,TOGGLE:5,LINK:6};l.decodeWidgetPropertyMenuSelectorOption=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.option=r.readString();break;case 2:e.tooltip=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeWidgetPropertyMenuSelectorOption=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.option;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.tooltip;if(t!=null&&(e.writeVarUint(2),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.WidgetInputTextNodeType={0:"WIDGET_CONTROLLED",1:"RICH_TEXT",WIDGET_CONTROLLED:0,RICH_TEXT:1};l.decodeWidgetPropertyMenuItem=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.propertyName=r.readString();break;case 2:e.tooltip=r.readString();break;case 3:e.itemType=this.WidgetPropertyMenuItemType[r.readVarUint()];break;case 4:e.icon=r.readString();break;case 5:for(var n=r.readVarUint(),t=e.options=Array(n),i=0;i<n;i++)t[i]=this.decodeWidgetPropertyMenuSelectorOption(r);break;case 6:e.selectedOption=r.readString();break;case 7:e.isToggled=!!r.readByte();break;case 8:e.href=r.readString();break;case 9:e.allowCustomColor=!!r.readByte();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeWidgetPropertyMenuItem=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var a=r.propertyName;a!=null&&(e.writeVarUint(1),e.writeString(a));var a=r.tooltip;a!=null&&(e.writeVarUint(2),e.writeString(a));var a=r.itemType;if(a!=null){e.writeVarUint(3);var t=this.WidgetPropertyMenuItemType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "WidgetPropertyMenuItemType"');e.writeVarUint(t)}var a=r.icon;a!=null&&(e.writeVarUint(4),e.writeString(a));var a=r.options;if(a!=null){e.writeVarUint(5);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeWidgetPropertyMenuSelectorOption(a,e)}var a=r.selectedOption;a!=null&&(e.writeVarUint(6),e.writeString(a));var a=r.isToggled;a!=null&&(e.writeVarUint(7),e.writeByte(a));var a=r.href;a!=null&&(e.writeVarUint(8),e.writeString(a));var a=r.allowCustomColor;if(a!=null&&(e.writeVarUint(9),e.writeByte(a)),e.writeVarUint(0),n)return e.toUint8Array()};l.CodeBlockLanguage={0:"TYPESCRIPT",1:"CPP",2:"RUBY",3:"CSS",4:"JAVASCRIPT",5:"HTML",6:"JSON",7:"GRAPHQL",8:"PYTHON",9:"GO",10:"SQL",11:"SWIFT",12:"KOTLIN",13:"RUST",14:"BASH",15:"PLAINTEXT",TYPESCRIPT:0,CPP:1,RUBY:2,CSS:3,JAVASCRIPT:4,HTML:5,JSON:6,GRAPHQL:7,PYTHON:8,GO:9,SQL:10,SWIFT:11,KOTLIN:12,RUST:13,BASH:14,PLAINTEXT:15};l.InternalEnumForTest={1:"OLD",OLD:1};l.decodeInternalDataForTest=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.testFieldA=r.readVarInt();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeInternalDataForTest=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.testFieldA;if(t!=null&&(e.writeVarUint(1),e.writeVarInt(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeStateGroupPropertyValueOrder=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.property=r.readString();break;case 2:for(var n=r.readVarUint(),t=e.values=Array(n),i=0;i<n;i++)t[i]=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeStateGroupPropertyValueOrder=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.property;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.values;if(t!=null){e.writeVarUint(2);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],e.writeString(t)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeTextListData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.listID=r.readVarInt();break;case 2:e.bulletType=this.BulletType[r.readVarUint()];break;case 3:e.indentationLevel=r.readVarInt();break;case 4:e.lineNumber=r.readVarInt();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeTextListData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.listID;i!=null&&(e.writeVarUint(1),e.writeVarInt(i));var i=r.bulletType;if(i!=null){e.writeVarUint(2);var t=this.BulletType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "BulletType"');e.writeVarUint(t)}var i=r.indentationLevel;i!=null&&(e.writeVarUint(3),e.writeVarInt(i));var i=r.lineNumber;if(i!=null&&(e.writeVarUint(4),e.writeVarInt(i)),e.writeVarUint(0),n)return e.toUint8Array()};l.BulletType={0:"ORDERED",1:"UNORDERED",2:"INDENT",3:"NO_LIST",ORDERED:0,UNORDERED:1,INDENT:2,NO_LIST:3};l.decodeTextLineData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.lineType=this.LineType[r.readVarUint()];break;case 10:e.styleId=r.readVarInt();break;case 2:e.indentationLevel=r.readVarInt();break;case 9:e.sourceDirectionality=this.SourceDirectionality[r.readVarUint()];break;case 3:e.directionality=this.Directionality[r.readVarUint()];break;case 4:e.directionalityIntent=this.DirectionalityIntent[r.readVarUint()];break;case 5:e.downgradeStyleId=r.readVarInt();break;case 6:e.consistencyStyleId=r.readVarInt();break;case 7:e.listStartOffset=r.readVarInt();break;case 8:e.isFirstLineOfList=!!r.readByte();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeTextLineData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.lineType;if(i!=null){e.writeVarUint(1);var t=this.LineType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "LineType"');e.writeVarUint(t)}var i=r.styleId;i!=null&&(e.writeVarUint(10),e.writeVarInt(i));var i=r.indentationLevel;i!=null&&(e.writeVarUint(2),e.writeVarInt(i));var i=r.sourceDirectionality;if(i!=null){e.writeVarUint(9);var t=this.SourceDirectionality[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "SourceDirectionality"');e.writeVarUint(t)}var i=r.directionality;if(i!=null){e.writeVarUint(3);var t=this.Directionality[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "Directionality"');e.writeVarUint(t)}var i=r.directionalityIntent;if(i!=null){e.writeVarUint(4);var t=this.DirectionalityIntent[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "DirectionalityIntent"');e.writeVarUint(t)}var i=r.downgradeStyleId;i!=null&&(e.writeVarUint(5),e.writeVarInt(i));var i=r.consistencyStyleId;i!=null&&(e.writeVarUint(6),e.writeVarInt(i));var i=r.listStartOffset;i!=null&&(e.writeVarUint(7),e.writeVarInt(i));var i=r.isFirstLineOfList;if(i!=null&&(e.writeVarUint(8),e.writeByte(i)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeDerivedTextLineData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.directionality=this.Directionality[r.readVarUint()];break;default:throw new Error("Attempted to parse invalid message")}};l.encodeDerivedTextLineData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.directionality;if(t!=null){e.writeVarUint(1);var i=this.Directionality[t];if(i===void 0)throw new Error("Invalid value "+JSON.stringify(t)+' for enum "Directionality"');e.writeVarUint(i)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.LineType={0:"PLAIN",1:"ORDERED_LIST",2:"UNORDERED_LIST",3:"BLOCKQUOTE",4:"HEADER",PLAIN:0,ORDERED_LIST:1,UNORDERED_LIST:2,BLOCKQUOTE:3,HEADER:4};l.SourceDirectionality={0:"AUTO",1:"LTR",2:"RTL",AUTO:0,LTR:1,RTL:2};l.Directionality={0:"LTR",1:"RTL",LTR:0,RTL:1};l.DirectionalityIntent={0:"IMPLICIT",1:"EXPLICIT",IMPLICIT:0,EXPLICIT:1};l.decodePrototypeInteraction=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.id=this.decodeGUID(r);break;case 2:e.event=this.decodePrototypeEvent(r);break;case 3:for(var n=r.readVarUint(),t=e.actions=Array(n),i=0;i<n;i++)t[i]=this.decodePrototypeAction(r);break;case 4:e.isDeleted=!!r.readByte();break;case 5:e.stateManagementVersion=r.readVarInt();break;default:throw new Error("Attempted to parse invalid message")}};l.encodePrototypeInteraction=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.id;o!=null&&(e.writeVarUint(1),this.encodeGUID(o,e));var o=r.event;o!=null&&(e.writeVarUint(2),this.encodePrototypeEvent(o,e));var o=r.actions;if(o!=null){e.writeVarUint(3);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodePrototypeAction(o,e)}var o=r.isDeleted;o!=null&&(e.writeVarUint(4),e.writeByte(o));var o=r.stateManagementVersion;if(o!=null&&(e.writeVarUint(5),e.writeVarInt(o)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodePrototypeEvent=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.interactionType=this.InteractionType[r.readVarUint()];break;case 2:e.interactionMaintained=!!r.readByte();break;case 3:e.interactionDuration=r.readVarFloat();break;case 4:e.keyTrigger=this.decodeKeyTrigger(r);break;case 5:e.voiceEventPhrase=r.readString();break;case 6:e.transitionTimeout=r.readVarFloat();break;case 7:e.mediaHitTime=r.readVarFloat();break;default:throw new Error("Attempted to parse invalid message")}};l.encodePrototypeEvent=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.interactionType;if(i!=null){e.writeVarUint(1);var t=this.InteractionType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "InteractionType"');e.writeVarUint(t)}var i=r.interactionMaintained;i!=null&&(e.writeVarUint(2),e.writeByte(i));var i=r.interactionDuration;i!=null&&(e.writeVarUint(3),e.writeVarFloat(i));var i=r.keyTrigger;i!=null&&(e.writeVarUint(4),this.encodeKeyTrigger(i,e));var i=r.voiceEventPhrase;i!=null&&(e.writeVarUint(5),e.writeString(i));var i=r.transitionTimeout;i!=null&&(e.writeVarUint(6),e.writeVarFloat(i));var i=r.mediaHitTime;if(i!=null&&(e.writeVarUint(7),e.writeVarFloat(i)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodePrototypeVariableTarget=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.id=this.decodeVariableID(r);break;case 2:e.nodeFieldAlias=this.decodeNodeFieldAlias(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodePrototypeVariableTarget=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.id;t!=null&&(e.writeVarUint(1),this.encodeVariableID(t,e));var t=r.nodeFieldAlias;if(t!=null&&(e.writeVarUint(2),this.encodeNodeFieldAlias(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeConditionalActions=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.actions=Array(n),i=0;i<n;i++)t[i]=this.decodePrototypeAction(r);break;case 2:e.condition=this.decodeVariableData(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeConditionalActions=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.actions;if(o!=null){e.writeVarUint(1);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodePrototypeAction(o,e)}var o=r.condition;if(o!=null&&(e.writeVarUint(2),this.encodeVariableData(o,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodePrototypeAction=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.transitionNodeID=this.decodeGUID(r);break;case 2:e.transitionType=this.TransitionType[r.readVarUint()];break;case 3:e.transitionDuration=r.readVarFloat();break;case 4:e.easingType=this.EasingType[r.readVarUint()];break;case 5:e.transitionTimeout=r.readVarFloat();break;case 6:e.transitionShouldSmartAnimate=!!r.readByte();break;case 7:e.connectionType=this.ConnectionType[r.readVarUint()];break;case 8:e.connectionURL=r.readString();break;case 9:e.overlayRelativePosition=this.decodeVector(r);break;case 10:e.navigationType=this.NavigationType[r.readVarUint()];break;case 11:e.transitionPreserveScroll=!!r.readByte();break;case 12:for(var t=r.readVarUint(),i=e.easingFunction=Array(t),n=0;n<t;n++)i[n]=r.readVarFloat();break;case 13:e.extraScrollOffset=this.decodeVector(r);break;case 14:e.targetVariableID=this.decodeGUID(r);break;case 15:e.targetVariableValue=this.decodeVariableAnyValue(r);break;case 16:e.mediaAction=this.MediaAction[r.readVarUint()];break;case 17:e.transitionResetVideoPosition=!!r.readByte();break;case 18:e.openUrlInNewTab=!!r.readByte();break;case 19:e.targetVariable=this.decodePrototypeVariableTarget(r);break;case 20:e.targetVariableData=this.decodeVariableData(r);break;case 21:e.mediaSkipToTime=r.readVarFloat();break;case 22:e.mediaSkipByAmount=r.readVarFloat();break;case 23:for(var t=r.readVarUint(),i=e.conditions=Array(t),n=0;n<t;n++)i[n]=this.decodeVariableData(r);break;case 24:for(var t=r.readVarUint(),i=e.conditionalActions=Array(t),n=0;n<t;n++)i[n]=this.decodeConditionalActions(r);break;case 25:e.transitionResetScrollPosition=!!r.readByte();break;case 26:e.transitionResetInteractiveComponents=!!r.readByte();break;case 27:e.targetVariableSetID=this.decodeVariableSetID(r);break;case 28:e.targetVariableModeID=this.decodeGUID(r);break;case 29:e.targetVariableSetKey=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodePrototypeAction=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var a=r.transitionNodeID;a!=null&&(e.writeVarUint(1),this.encodeGUID(a,e));var a=r.transitionType;if(a!=null){e.writeVarUint(2);var t=this.TransitionType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "TransitionType"');e.writeVarUint(t)}var a=r.transitionDuration;a!=null&&(e.writeVarUint(3),e.writeVarFloat(a));var a=r.easingType;if(a!=null){e.writeVarUint(4);var t=this.EasingType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "EasingType"');e.writeVarUint(t)}var a=r.transitionTimeout;a!=null&&(e.writeVarUint(5),e.writeVarFloat(a));var a=r.transitionShouldSmartAnimate;a!=null&&(e.writeVarUint(6),e.writeByte(a));var a=r.connectionType;if(a!=null){e.writeVarUint(7);var t=this.ConnectionType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "ConnectionType"');e.writeVarUint(t)}var a=r.connectionURL;a!=null&&(e.writeVarUint(8),e.writeString(a));var a=r.overlayRelativePosition;a!=null&&(e.writeVarUint(9),this.encodeVector(a,e));var a=r.navigationType;if(a!=null){e.writeVarUint(10);var t=this.NavigationType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "NavigationType"');e.writeVarUint(t)}var a=r.transitionPreserveScroll;a!=null&&(e.writeVarUint(11),e.writeByte(a));var a=r.easingFunction;if(a!=null){e.writeVarUint(12);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],e.writeVarFloat(a)}var a=r.extraScrollOffset;a!=null&&(e.writeVarUint(13),this.encodeVector(a,e));var a=r.targetVariableID;a!=null&&(e.writeVarUint(14),this.encodeGUID(a,e));var a=r.targetVariableValue;a!=null&&(e.writeVarUint(15),this.encodeVariableAnyValue(a,e));var a=r.mediaAction;if(a!=null){e.writeVarUint(16);var t=this.MediaAction[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "MediaAction"');e.writeVarUint(t)}var a=r.transitionResetVideoPosition;a!=null&&(e.writeVarUint(17),e.writeByte(a));var a=r.openUrlInNewTab;a!=null&&(e.writeVarUint(18),e.writeByte(a));var a=r.targetVariable;a!=null&&(e.writeVarUint(19),this.encodePrototypeVariableTarget(a,e));var a=r.targetVariableData;a!=null&&(e.writeVarUint(20),this.encodeVariableData(a,e));var a=r.mediaSkipToTime;a!=null&&(e.writeVarUint(21),e.writeVarFloat(a));var a=r.mediaSkipByAmount;a!=null&&(e.writeVarUint(22),e.writeVarFloat(a));var a=r.conditions;if(a!=null){e.writeVarUint(23);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeVariableData(a,e)}var a=r.conditionalActions;if(a!=null){e.writeVarUint(24);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeConditionalActions(a,e)}var a=r.transitionResetScrollPosition;a!=null&&(e.writeVarUint(25),e.writeByte(a));var a=r.transitionResetInteractiveComponents;a!=null&&(e.writeVarUint(26),e.writeByte(a));var a=r.targetVariableSetID;a!=null&&(e.writeVarUint(27),this.encodeVariableSetID(a,e));var a=r.targetVariableModeID;a!=null&&(e.writeVarUint(28),this.encodeGUID(a,e));var a=r.targetVariableSetKey;if(a!=null&&(e.writeVarUint(29),e.writeString(a)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodePrototypeStartingPoint=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.name=r.readString();break;case 2:e.description=r.readString();break;case 3:e.position=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodePrototypeStartingPoint=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.name;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.description;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.position;if(t!=null&&(e.writeVarUint(3),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.TriggerDevice={0:"KEYBOARD",1:"UNKNOWN_CONTROLLER",2:"XBOX_ONE",3:"PS4",4:"SWITCH_PRO",KEYBOARD:0,UNKNOWN_CONTROLLER:1,XBOX_ONE:2,PS4:3,SWITCH_PRO:4};l.decodeKeyTrigger=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.keyCodes=Array(n),i=0;i<n;i++)t[i]=r.readVarInt();break;case 2:e.triggerDevice=this.TriggerDevice[r.readVarUint()];break;default:throw new Error("Attempted to parse invalid message")}};l.encodeKeyTrigger=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.keyCodes;if(o!=null){e.writeVarUint(1);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],e.writeVarInt(o)}var o=r.triggerDevice;if(o!=null){e.writeVarUint(2);var a=this.TriggerDevice[o];if(a===void 0)throw new Error("Invalid value "+JSON.stringify(o)+' for enum "TriggerDevice"');e.writeVarUint(a)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeHyperlink=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.url=r.readString();break;case 2:e.guid=this.decodeGUID(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeHyperlink=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.url;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.guid;if(t!=null&&(e.writeVarUint(2),this.encodeGUID(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.MentionSource={0:"DEFAULT",1:"COPY_DUPLICATE",DEFAULT:0,COPY_DUPLICATE:1};l.decodeMention=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.id=this.decodeGUID(r);break;case 2:e.mentionedUserId=r.readString();break;case 3:e.mentionedByUserId=r.readString();break;case 4:e.fileKey=r.readString();break;case 5:e.source=this.MentionSource[r.readVarUint()];break;case 6:e.mentionedUserIdInt=r.readVarUint64();break;case 7:e.mentionedByUserIdInt=r.readVarUint64();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeMention=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.id;i!=null&&(e.writeVarUint(1),this.encodeGUID(i,e));var i=r.mentionedUserId;i!=null&&(e.writeVarUint(2),e.writeString(i));var i=r.mentionedByUserId;i!=null&&(e.writeVarUint(3),e.writeString(i));var i=r.fileKey;i!=null&&(e.writeVarUint(4),e.writeString(i));var i=r.source;if(i!=null){e.writeVarUint(5);var t=this.MentionSource[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "MentionSource"');e.writeVarUint(t)}var i=r.mentionedUserIdInt;i!=null&&(e.writeVarUint(6),e.writeVarUint64(i));var i=r.mentionedByUserIdInt;if(i!=null&&(e.writeVarUint(7),e.writeVarUint64(i)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeEmbedData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.url=r.readString();break;case 2:e.srcUrl=r.readString();break;case 3:e.title=r.readString();break;case 4:e.thumbnailUrl=r.readString();break;case 5:e.width=r.readVarFloat();break;case 6:e.height=r.readVarFloat();break;case 7:e.embedType=r.readString();break;case 8:e.thumbnailImageHash=r.readString();break;case 9:e.faviconImageHash=r.readString();break;case 10:e.provider=r.readString();break;case 11:e.originalText=r.readString();break;case 12:e.description=r.readString();break;case 13:e.embedVersionId=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeEmbedData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.url;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.srcUrl;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.title;t!=null&&(e.writeVarUint(3),e.writeString(t));var t=r.thumbnailUrl;t!=null&&(e.writeVarUint(4),e.writeString(t));var t=r.width;t!=null&&(e.writeVarUint(5),e.writeVarFloat(t));var t=r.height;t!=null&&(e.writeVarUint(6),e.writeVarFloat(t));var t=r.embedType;t!=null&&(e.writeVarUint(7),e.writeString(t));var t=r.thumbnailImageHash;t!=null&&(e.writeVarUint(8),e.writeString(t));var t=r.faviconImageHash;t!=null&&(e.writeVarUint(9),e.writeString(t));var t=r.provider;t!=null&&(e.writeVarUint(10),e.writeString(t));var t=r.originalText;t!=null&&(e.writeVarUint(11),e.writeString(t));var t=r.description;t!=null&&(e.writeVarUint(12),e.writeString(t));var t=r.embedVersionId;if(t!=null&&(e.writeVarUint(13),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeStampData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.userId=r.readString();break;case 2:e.votingSessionId=r.readString();break;case 3:e.stampedByUserId=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeStampData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.userId;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.votingSessionId;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.stampedByUserId;if(t!=null&&(e.writeVarUint(3),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeLinkPreviewData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.url=r.readString();break;case 2:e.title=r.readString();break;case 3:e.provider=r.readString();break;case 4:e.description=r.readString();break;case 5:e.thumbnailImageHash=r.readString();break;case 6:e.faviconImageHash=r.readString();break;case 7:e.thumbnailImageWidth=r.readVarFloat();break;case 8:e.thumbnailImageHeight=r.readVarFloat();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeLinkPreviewData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.url;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.title;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.provider;t!=null&&(e.writeVarUint(3),e.writeString(t));var t=r.description;t!=null&&(e.writeVarUint(4),e.writeString(t));var t=r.thumbnailImageHash;t!=null&&(e.writeVarUint(5),e.writeString(t));var t=r.faviconImageHash;t!=null&&(e.writeVarUint(6),e.writeString(t));var t=r.thumbnailImageWidth;t!=null&&(e.writeVarUint(7),e.writeVarFloat(t));var t=r.thumbnailImageHeight;if(t!=null&&(e.writeVarUint(8),e.writeVarFloat(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeViewport=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.canvasSpaceBounds=this.decodeRect(r);break;case 2:e.pixelPreview=!!r.readByte();break;case 3:e.pixelDensity=r.readVarFloat();break;case 4:e.canvasGuid=this.decodeGUID(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeViewport=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.canvasSpaceBounds;t!=null&&(e.writeVarUint(1),this.encodeRect(t,e));var t=r.pixelPreview;t!=null&&(e.writeVarUint(2),e.writeByte(t));var t=r.pixelDensity;t!=null&&(e.writeVarUint(3),e.writeVarFloat(t));var t=r.canvasGuid;if(t!=null&&(e.writeVarUint(4),this.encodeGUID(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeMouse=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.cursor=this.MouseCursor[r.readVarUint()];break;case 2:e.canvasSpaceLocation=this.decodeVector(r);break;case 3:e.canvasSpaceSelectionBox=this.decodeRect(r);break;case 4:e.canvasGuid=this.decodeGUID(r);break;case 5:e.cursorHiddenReason=r.readVarUint();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeMouse=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.cursor;if(i!=null){e.writeVarUint(1);var t=this.MouseCursor[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "MouseCursor"');e.writeVarUint(t)}var i=r.canvasSpaceLocation;i!=null&&(e.writeVarUint(2),this.encodeVector(i,e));var i=r.canvasSpaceSelectionBox;i!=null&&(e.writeVarUint(3),this.encodeRect(i,e));var i=r.canvasGuid;i!=null&&(e.writeVarUint(4),this.encodeGUID(i,e));var i=r.cursorHiddenReason;if(i!=null&&(e.writeVarUint(5),e.writeVarUint(i)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeClick=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.id=r.readVarUint(),e.point=this.decodeVector(r),e};l.encodeClick=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.id;if(t!=null)e.writeVarUint(t);else throw new Error('Missing required field "id"');var t=r.point;if(t!=null)this.encodeVector(t,e);else throw new Error('Missing required field "point"');if(n)return e.toUint8Array()};l.decodeScrollPosition=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.node=this.decodeGUID(r),e.scrollOffset=this.decodeVector(r),e};l.encodeScrollPosition=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.node;if(t!=null)this.encodeGUID(t,e);else throw new Error('Missing required field "node"');var t=r.scrollOffset;if(t!=null)this.encodeVector(t,e);else throw new Error('Missing required field "scrollOffset"');if(n)return e.toUint8Array()};l.decodeTriggeredOverlay=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.overlayGuid=this.decodeGUID(r),e.hotspotGuid=this.decodeGUID(r),e.swapGuid=this.decodeGUID(r),e};l.encodeTriggeredOverlay=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.overlayGuid;if(t!=null)this.encodeGUID(t,e);else throw new Error('Missing required field "overlayGuid"');var t=r.hotspotGuid;if(t!=null)this.encodeGUID(t,e);else throw new Error('Missing required field "hotspotGuid"');var t=r.swapGuid;if(t!=null)this.encodeGUID(t,e);else throw new Error('Missing required field "swapGuid"');if(n)return e.toUint8Array()};l.decodeTriggeredOverlayData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.overlayGuid=this.decodeGUID(r);break;case 2:e.hotspotGuid=this.decodeGUID(r);break;case 3:e.swapGuid=this.decodeGUID(r);break;case 4:e.prototypeInteractionGuid=this.decodeGUID(r);break;case 5:e.hotspotBlueprintId=this.decodeGUIDPath(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeTriggeredOverlayData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.overlayGuid;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.hotspotGuid;t!=null&&(e.writeVarUint(2),this.encodeGUID(t,e));var t=r.swapGuid;t!=null&&(e.writeVarUint(3),this.encodeGUID(t,e));var t=r.prototypeInteractionGuid;t!=null&&(e.writeVarUint(4),this.encodeGUID(t,e));var t=r.hotspotBlueprintId;if(t!=null&&(e.writeVarUint(5),this.encodeGUIDPath(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeTriggeredSetVariableActionData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.nodeForFindingTopmostScreenId=this.decodeGUID(r);break;case 2:e.targetVariableId=r.readString();break;case 3:e.targetVariableData=r.readString();break;case 4:e.resolvedVariableModes=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeTriggeredSetVariableActionData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.nodeForFindingTopmostScreenId;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.targetVariableId;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.targetVariableData;t!=null&&(e.writeVarUint(3),e.writeString(t));var t=r.resolvedVariableModes;if(t!=null&&(e.writeVarUint(4),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeTriggeredSetVariableModeActionData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.nodeForFindingTopmostScreenId=this.decodeGUID(r);break;case 2:e.targetVariableSetKey=r.readString();break;case 3:e.targetVariableModeId=r.readString();break;case 4:e.targetVariableSetId=this.decodeVariableSetID(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeTriggeredSetVariableModeActionData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.nodeForFindingTopmostScreenId;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.targetVariableSetKey;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.targetVariableModeId;t!=null&&(e.writeVarUint(3),e.writeString(t));var t=r.targetVariableSetId;if(t!=null&&(e.writeVarUint(4),this.encodeVariableSetID(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeVideoStateChangeData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.targetNodeId=this.decodeGUID(r);break;case 2:e.isPlaying=!!r.readByte();break;case 3:e.isPlayingSound=!!r.readByte();break;case 4:for(var n=r.readVarUint(),t=e.currentTimes=Array(n),i=0;i<n;i++)t[i]=r.readVarUint();break;case 5:e.actionTakenTimestamp=r.readVarUint();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVideoStateChangeData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.targetNodeId;o!=null&&(e.writeVarUint(1),this.encodeGUID(o,e));var o=r.isPlaying;o!=null&&(e.writeVarUint(2),e.writeByte(o));var o=r.isPlayingSound;o!=null&&(e.writeVarUint(3),e.writeByte(o));var o=r.currentTimes;if(o!=null){e.writeVarUint(4);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],e.writeVarUint(o)}var o=r.actionTakenTimestamp;if(o!=null&&(e.writeVarUint(5),e.writeVarUint(o)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeEmbeddedPrototypeData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.nodeId=this.decodeGUID(r);break;case 2:e.sessionId=r.readVarUint();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeEmbeddedPrototypeData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.nodeId;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.sessionId;if(t!=null&&(e.writeVarUint(2),e.writeVarUint(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodePresentedState=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.baseScreenID=this.decodeGUID(r);break;case 2:for(var n=r.readVarUint(),t=e.overlays=Array(n),i=0;i<n;i++)t[i]=this.decodeTriggeredOverlayData(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodePresentedState=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.baseScreenID;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.overlays;if(t!=null){e.writeVarUint(2);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeTriggeredOverlayData(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.TransitionDirection={0:"FORWARD",1:"REVERSE",FORWARD:0,REVERSE:1};l.decodeTopLevelPlaybackChange=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.oldState=this.decodePresentedState(r);break;case 2:e.newState=this.decodePresentedState(r);break;case 3:e.hotspotBlueprintID=this.decodeGUIDPath(r);break;case 4:e.interactionID=this.decodeGUID(r);break;case 5:e.isHotspotInNewPresentedState=!!r.readByte();break;case 6:e.direction=this.TransitionDirection[r.readVarUint()];break;case 7:e.instanceStablePath=this.decodeGUIDPath(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeTopLevelPlaybackChange=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.oldState;i!=null&&(e.writeVarUint(1),this.encodePresentedState(i,e));var i=r.newState;i!=null&&(e.writeVarUint(2),this.encodePresentedState(i,e));var i=r.hotspotBlueprintID;i!=null&&(e.writeVarUint(3),this.encodeGUIDPath(i,e));var i=r.interactionID;i!=null&&(e.writeVarUint(4),this.encodeGUID(i,e));var i=r.isHotspotInNewPresentedState;i!=null&&(e.writeVarUint(5),e.writeByte(i));var i=r.direction;if(i!=null){e.writeVarUint(6);var t=this.TransitionDirection[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "TransitionDirection"');e.writeVarUint(t)}var i=r.instanceStablePath;if(i!=null&&(e.writeVarUint(7),this.encodeGUIDPath(i,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeInstanceStateChange=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.stateID=this.decodeGUID(r);break;case 2:e.interactionID=this.decodeGUID(r);break;case 3:e.hotspotStablePath=this.decodeGUIDPath(r);break;case 4:e.instanceStablePath=this.decodeGUIDPath(r);break;case 5:e.phase=this.PlaybackChangePhase[r.readVarUint()];break;default:throw new Error("Attempted to parse invalid message")}};l.encodeInstanceStateChange=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.stateID;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.interactionID;t!=null&&(e.writeVarUint(2),this.encodeGUID(t,e));var t=r.hotspotStablePath;t!=null&&(e.writeVarUint(3),this.encodeGUIDPath(t,e));var t=r.instanceStablePath;t!=null&&(e.writeVarUint(4),this.encodeGUIDPath(t,e));var t=r.phase;if(t!=null){e.writeVarUint(5);var i=this.PlaybackChangePhase[t];if(i===void 0)throw new Error("Invalid value "+JSON.stringify(t)+' for enum "PlaybackChangePhase"');e.writeVarUint(i)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeTextCursor=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.selectionBox=this.decodeRect(r);break;case 2:e.canvasGuid=this.decodeGUID(r);break;case 3:e.textNodeGuid=this.decodeGUID(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeTextCursor=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.selectionBox;t!=null&&(e.writeVarUint(1),this.encodeRect(t,e));var t=r.canvasGuid;t!=null&&(e.writeVarUint(2),this.encodeGUID(t,e));var t=r.textNodeGuid;if(t!=null&&(e.writeVarUint(3),this.encodeGUID(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeTextSelection=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.selectionBoxes=Array(n),i=0;i<n;i++)t[i]=this.decodeRect(r);break;case 2:e.canvasGuid=this.decodeGUID(r);break;case 3:e.textNodeGuid=this.decodeGUID(r);break;case 4:e.textSelectionRange=this.decodeVector(r);break;case 5:e.textNodeOrContainingIfGuid=this.decodeGUID(r);break;case 6:e.tableCellRowId=this.decodeGUID(r);break;case 7:e.tableCellColId=this.decodeGUID(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeTextSelection=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.selectionBoxes;if(o!=null){e.writeVarUint(1);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeRect(o,e)}var o=r.canvasGuid;o!=null&&(e.writeVarUint(2),this.encodeGUID(o,e));var o=r.textNodeGuid;o!=null&&(e.writeVarUint(3),this.encodeGUID(o,e));var o=r.textSelectionRange;o!=null&&(e.writeVarUint(4),this.encodeVector(o,e));var o=r.textNodeOrContainingIfGuid;o!=null&&(e.writeVarUint(5),this.encodeGUID(o,e));var o=r.tableCellRowId;o!=null&&(e.writeVarUint(6),this.encodeGUID(o,e));var o=r.tableCellColId;if(o!=null&&(e.writeVarUint(7),this.encodeGUID(o,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.PlaybackChangePhase={0:"INITIATED",1:"ABORTED",2:"COMMITTED",INITIATED:0,ABORTED:1,COMMITTED:2};l.decodePlaybackChangeKeyframe=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.phase=this.PlaybackChangePhase[r.readVarUint()];break;case 2:e.progress=r.readVarFloat();break;case 3:e.timestamp=r.readVarFloat();break;default:throw new Error("Attempted to parse invalid message")}};l.encodePlaybackChangeKeyframe=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.phase;if(i!=null){e.writeVarUint(1);var t=this.PlaybackChangePhase[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "PlaybackChangePhase"');e.writeVarUint(t)}var i=r.progress;i!=null&&(e.writeVarUint(2),e.writeVarFloat(i));var i=r.timestamp;if(i!=null&&(e.writeVarUint(3),e.writeVarFloat(i)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeStateMapping=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.stablePath=this.decodeGUIDPath(r);break;case 2:e.lastTopLevelChange=this.decodeTopLevelPlaybackChange(r);break;case 3:e.lastTopLevelChangeStatus=this.decodePlaybackChangeKeyframe(r);break;case 4:e.timestamp=r.readVarFloat();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeStateMapping=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.stablePath;t!=null&&(e.writeVarUint(1),this.encodeGUIDPath(t,e));var t=r.lastTopLevelChange;t!=null&&(e.writeVarUint(2),this.encodeTopLevelPlaybackChange(t,e));var t=r.lastTopLevelChangeStatus;t!=null&&(e.writeVarUint(3),this.encodePlaybackChangeKeyframe(t,e));var t=r.timestamp;if(t!=null&&(e.writeVarUint(4),e.writeVarFloat(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeScrollMapping=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.blueprintID=this.decodeGUIDPath(r);break;case 2:e.overlayIndex=r.readVarUint();break;case 3:e.scrollOffset=this.decodeVector(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeScrollMapping=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.blueprintID;t!=null&&(e.writeVarUint(1),this.encodeGUIDPath(t,e));var t=r.overlayIndex;t!=null&&(e.writeVarUint(2),e.writeVarUint(t));var t=r.scrollOffset;if(t!=null&&(e.writeVarUint(3),this.encodeVector(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodePlaybackUpdate=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.lastTopLevelChange=this.decodeTopLevelPlaybackChange(r);break;case 2:e.lastTopLevelChangeStatus=this.decodePlaybackChangeKeyframe(r);break;case 3:for(var t=r.readVarUint(),i=e.scrollMappings=Array(t),n=0;n<t;n++)i[n]=this.decodeScrollMapping(r);break;case 4:e.timestamp=r.readVarFloat();break;case 5:e.pointerLocation=this.decodeVector(r);break;case 6:e.isTopLevelFrameChange=!!r.readByte();break;case 7:for(var t=r.readVarUint(),i=e.stateMappings=Array(t),n=0;n<t;n++)i[n]=this.decodeStateMapping(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodePlaybackUpdate=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.lastTopLevelChange;o!=null&&(e.writeVarUint(1),this.encodeTopLevelPlaybackChange(o,e));var o=r.lastTopLevelChangeStatus;o!=null&&(e.writeVarUint(2),this.encodePlaybackChangeKeyframe(o,e));var o=r.scrollMappings;if(o!=null){e.writeVarUint(3);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeScrollMapping(o,e)}var o=r.timestamp;o!=null&&(e.writeVarUint(4),e.writeVarFloat(o));var o=r.pointerLocation;o!=null&&(e.writeVarUint(5),this.encodeVector(o,e));var o=r.isTopLevelFrameChange;o!=null&&(e.writeVarUint(6),e.writeByte(o));var o=r.stateMappings;if(o!=null){e.writeVarUint(7);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeStateMapping(o,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeChatMessage=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.text=r.readString();break;case 2:e.previousText=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeChatMessage=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.text;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.previousText;if(t!=null&&(e.writeVarUint(2),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeVoiceMetadata=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.connectedCallId=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVoiceMetadata=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.connectedCallId;if(t!=null&&(e.writeVarUint(1),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeAprilFunCursor=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.id=r.readString();break;case 2:e.trailEnabled=!!r.readByte();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeAprilFunCursor=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.id;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.trailEnabled;if(t!=null&&(e.writeVarUint(2),e.writeByte(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.Heartbeat={0:"FOREGROUND",1:"BACKGROUND",FOREGROUND:0,BACKGROUND:1};l.decodeUserChange=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.sessionID=r.readVarUint();break;case 2:e.connected=!!r.readByte();break;case 3:e.name=r.readString();break;case 4:e.color=this.decodeColor(r);break;case 5:e.imageURL=r.readString();break;case 6:e.viewport=this.decodeViewport(r);break;case 7:e.mouse=this.decodeMouse(r);break;case 8:for(var t=r.readVarUint(),i=e.selection=Array(t),n=0;n<t;n++)i[n]=this.decodeGUID(r);break;case 9:for(var t=r.readVarUint(),i=e.observing=Array(t),n=0;n<t;n++)i[n]=r.readVarUint();break;case 10:e.deviceName=r.readString();break;case 11:for(var t=r.readVarUint(),i=e.recentClicks=Array(t),n=0;n<t;n++)i[n]=this.decodeClick(r);break;case 12:for(var t=r.readVarUint(),i=e.scrollPositions=Array(t),n=0;n<t;n++)i[n]=this.decodeScrollPosition(r);break;case 13:for(var t=r.readVarUint(),i=e.triggeredOverlays=Array(t),n=0;n<t;n++)i[n]=this.decodeTriggeredOverlay(r);break;case 14:e.userID=r.readString();break;case 15:e.lastTriggeredHotspot=this.decodeGUID(r);break;case 16:e.lastTriggeredPrototypeInteractionID=this.decodeGUID(r);break;case 17:for(var t=r.readVarUint(),i=e.triggeredOverlaysData=Array(t),n=0;n<t;n++)i[n]=this.decodeTriggeredOverlayData(r);break;case 18:for(var t=r.readVarUint(),i=e.playbackUpdates=Array(t),n=0;n<t;n++)i[n]=this.decodePlaybackUpdate(r);break;case 19:e.chatMessage=this.decodeChatMessage(r);break;case 20:e.voiceMetadata=this.decodeVoiceMetadata(r);break;case 21:e.canWrite=!!r.readByte();break;case 22:e.highFiveStatus=!!r.readByte();break;case 23:for(var t=r.readVarUint(),i=e.instanceStateChanges=Array(t),n=0;n<t;n++)i[n]=this.decodeInstanceStateChange(r);break;case 24:e.textCursor=this.decodeTextCursor(r);break;case 25:e.textSelection=this.decodeTextSelection(r);break;case 26:e.connectedAtTimeS=r.readVarUint();break;case 27:e.focusOnTextCursor=!!r.readByte();break;case 28:e.heartbeat=this.Heartbeat[r.readVarUint()];break;case 29:for(var t=r.readVarUint(),i=e.triggeredSetVariableActionData=Array(t),n=0;n<t;n++)i[n]=this.decodeTriggeredSetVariableActionData(r);break;case 30:for(var t=r.readVarUint(),i=e.videoStateChangeData=Array(t),n=0;n<t;n++)i[n]=this.decodeVideoStateChangeData(r);break;case 31:e.clientID=r.readString();break;case 32:e.focusedSlideId=this.decodeGUID(r);break;case 33:for(var t=r.readVarUint(),i=e.triggeredSetVariableModeActionData=Array(t),n=0;n<t;n++)i[n]=this.decodeTriggeredSetVariableModeActionData(r);break;case 34:e.aprilFunCursor=this.decodeAprilFunCursor(r);break;case 35:for(var t=r.readVarUint(),i=e.embeddedPrototypeData=Array(t),n=0;n<t;n++)i[n]=this.decodeEmbeddedPrototypeData(r);break;case 36:e.activeSlidesEmbeddablePrototype=this.decodeGUID(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeUserChange=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var a=r.sessionID;a!=null&&(e.writeVarUint(1),e.writeVarUint(a));var a=r.connected;a!=null&&(e.writeVarUint(2),e.writeByte(a));var a=r.name;a!=null&&(e.writeVarUint(3),e.writeString(a));var a=r.color;a!=null&&(e.writeVarUint(4),this.encodeColor(a,e));var a=r.imageURL;a!=null&&(e.writeVarUint(5),e.writeString(a));var a=r.viewport;a!=null&&(e.writeVarUint(6),this.encodeViewport(a,e));var a=r.mouse;a!=null&&(e.writeVarUint(7),this.encodeMouse(a,e));var a=r.selection;if(a!=null){e.writeVarUint(8);var t=a,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)a=t[d],this.encodeGUID(a,e)}var a=r.observing;if(a!=null){e.writeVarUint(9);var t=a,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)a=t[d],e.writeVarUint(a)}var a=r.deviceName;a!=null&&(e.writeVarUint(10),e.writeString(a));var a=r.recentClicks;if(a!=null){e.writeVarUint(11);var t=a,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)a=t[d],this.encodeClick(a,e)}var a=r.scrollPositions;if(a!=null){e.writeVarUint(12);var t=a,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)a=t[d],this.encodeScrollPosition(a,e)}var a=r.triggeredOverlays;if(a!=null){e.writeVarUint(13);var t=a,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)a=t[d],this.encodeTriggeredOverlay(a,e)}var a=r.userID;a!=null&&(e.writeVarUint(14),e.writeString(a));var a=r.lastTriggeredHotspot;a!=null&&(e.writeVarUint(15),this.encodeGUID(a,e));var a=r.lastTriggeredPrototypeInteractionID;a!=null&&(e.writeVarUint(16),this.encodeGUID(a,e));var a=r.triggeredOverlaysData;if(a!=null){e.writeVarUint(17);var t=a,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)a=t[d],this.encodeTriggeredOverlayData(a,e)}var a=r.playbackUpdates;if(a!=null){e.writeVarUint(18);var t=a,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)a=t[d],this.encodePlaybackUpdate(a,e)}var a=r.chatMessage;a!=null&&(e.writeVarUint(19),this.encodeChatMessage(a,e));var a=r.voiceMetadata;a!=null&&(e.writeVarUint(20),this.encodeVoiceMetadata(a,e));var a=r.canWrite;a!=null&&(e.writeVarUint(21),e.writeByte(a));var a=r.highFiveStatus;a!=null&&(e.writeVarUint(22),e.writeByte(a));var a=r.instanceStateChanges;if(a!=null){e.writeVarUint(23);var t=a,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)a=t[d],this.encodeInstanceStateChange(a,e)}var a=r.textCursor;a!=null&&(e.writeVarUint(24),this.encodeTextCursor(a,e));var a=r.textSelection;a!=null&&(e.writeVarUint(25),this.encodeTextSelection(a,e));var a=r.connectedAtTimeS;a!=null&&(e.writeVarUint(26),e.writeVarUint(a));var a=r.focusOnTextCursor;a!=null&&(e.writeVarUint(27),e.writeByte(a));var a=r.heartbeat;if(a!=null){e.writeVarUint(28);var o=this.Heartbeat[a];if(o===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "Heartbeat"');e.writeVarUint(o)}var a=r.triggeredSetVariableActionData;if(a!=null){e.writeVarUint(29);var t=a,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)a=t[d],this.encodeTriggeredSetVariableActionData(a,e)}var a=r.videoStateChangeData;if(a!=null){e.writeVarUint(30);var t=a,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)a=t[d],this.encodeVideoStateChangeData(a,e)}var a=r.clientID;a!=null&&(e.writeVarUint(31),e.writeString(a));var a=r.focusedSlideId;a!=null&&(e.writeVarUint(32),this.encodeGUID(a,e));var a=r.triggeredSetVariableModeActionData;if(a!=null){e.writeVarUint(33);var t=a,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)a=t[d],this.encodeTriggeredSetVariableModeActionData(a,e)}var a=r.aprilFunCursor;a!=null&&(e.writeVarUint(34),this.encodeAprilFunCursor(a,e));var a=r.embeddedPrototypeData;if(a!=null){e.writeVarUint(35);var t=a,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)a=t[d],this.encodeEmbeddedPrototypeData(a,e)}var a=r.activeSlidesEmbeddablePrototype;if(a!=null&&(e.writeVarUint(36),this.encodeGUID(a,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeInteractiveSlideElementChange=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.userID=r.readString();break;case 2:e.anonymousUserID=r.readString();break;case 3:e.nodeID=this.decodeGUID(r);break;case 4:e.responseData=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeInteractiveSlideElementChange=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.userID;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.anonymousUserID;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.nodeID;t!=null&&(e.writeVarUint(3),this.encodeGUID(t,e));var t=r.responseData;if(t!=null&&(e.writeVarUint(4),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeNodeStatusChange=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.nodeIds=Array(n),i=0;i<n;i++)t[i]=this.decodeGUID(r);break;case 2:e.statusInfo=this.decodeSectionStatusInfo(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeNodeStatusChange=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.nodeIds;if(o!=null){e.writeVarUint(1);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeGUID(o,e)}var o=r.statusInfo;if(o!=null&&(e.writeVarUint(2),this.encodeSectionStatusInfo(o,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.SceneGraphQueryBehavior={0:"DEFAULT",1:"CONTAINING_PAGE",2:"PLUGIN",DEFAULT:0,CONTAINING_PAGE:1,PLUGIN:2};l.decodeSceneGraphQuery=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.startingNode=this.decodeGUID(r);break;case 2:e.depth=r.readVarUint();break;case 3:e.behavior=this.SceneGraphQueryBehavior[r.readVarUint()];break;default:throw new Error("Attempted to parse invalid message")}};l.encodeSceneGraphQuery=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.startingNode;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.depth;t!=null&&(e.writeVarUint(2),e.writeVarUint(t));var t=r.behavior;if(t!=null){e.writeVarUint(3);var i=this.SceneGraphQueryBehavior[t];if(i===void 0)throw new Error("Invalid value "+JSON.stringify(t)+' for enum "SceneGraphQueryBehavior"');e.writeVarUint(i)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeNodeChangesMetadata=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.blobsFieldOffset=r.readVarUint();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeNodeChangesMetadata=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.blobsFieldOffset;if(t!=null&&(e.writeVarUint(1),e.writeVarUint(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeCursorReaction=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.imageUrl=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeCursorReaction=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.imageUrl;if(t!=null&&(e.writeVarUint(1),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeTimerInfo=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.isPaused=!!r.readByte();break;case 2:e.timeRemainingMs=r.readVarUint();break;case 3:e.totalTimeMs=r.readVarUint();break;case 4:e.timerID=r.readVarUint();break;case 5:e.setBy=r.readString();break;case 6:e.songID=r.readVarUint();break;case 7:e.lastReceivedSongTimestampMs=r.readVarUint();break;case 8:e.songUUID=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeTimerInfo=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.isPaused;t!=null&&(e.writeVarUint(1),e.writeByte(t));var t=r.timeRemainingMs;t!=null&&(e.writeVarUint(2),e.writeVarUint(t));var t=r.totalTimeMs;t!=null&&(e.writeVarUint(3),e.writeVarUint(t));var t=r.timerID;t!=null&&(e.writeVarUint(4),e.writeVarUint(t));var t=r.setBy;t!=null&&(e.writeVarUint(5),e.writeString(t));var t=r.songID;t!=null&&(e.writeVarUint(6),e.writeVarUint(t));var t=r.lastReceivedSongTimestampMs;t!=null&&(e.writeVarUint(7),e.writeVarUint(t));var t=r.songUUID;if(t!=null&&(e.writeVarUint(8),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeMusicInfo=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.isPaused=!!r.readByte();break;case 2:e.messageID=r.readVarUint();break;case 3:e.songID=r.readString();break;case 4:e.lastReceivedSongTimestampMs=r.readVarUint();break;case 5:e.isStopped=!!r.readByte();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeMusicInfo=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.isPaused;t!=null&&(e.writeVarUint(1),e.writeByte(t));var t=r.messageID;t!=null&&(e.writeVarUint(2),e.writeVarUint(t));var t=r.songID;t!=null&&(e.writeVarUint(3),e.writeString(t));var t=r.lastReceivedSongTimestampMs;t!=null&&(e.writeVarUint(4),e.writeVarUint(t));var t=r.isStopped;if(t!=null&&(e.writeVarUint(5),e.writeByte(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodePresenterNomination=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.sessionID=r.readVarUint();break;case 2:e.isCancelled=!!r.readByte();break;default:throw new Error("Attempted to parse invalid message")}};l.encodePresenterNomination=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.sessionID;t!=null&&(e.writeVarUint(1),e.writeVarUint(t));var t=r.isCancelled;if(t!=null&&(e.writeVarUint(2),e.writeByte(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodePresenterInfo=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.sessionID=r.readVarUint();break;case 2:e.nomination=this.decodePresenterNomination(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodePresenterInfo=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.sessionID;t!=null&&(e.writeVarUint(1),e.writeVarUint(t));var t=r.nomination;if(t!=null&&(e.writeVarUint(2),this.encodePresenterNomination(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeClientBroadcast=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.sessionID=r.readVarUint();break;case 2:e.cursorReaction=this.decodeCursorReaction(r);break;case 3:e.timer=this.decodeTimerInfo(r);break;case 4:e.presenter=this.decodePresenterInfo(r);break;case 5:e.prototypePresenter=this.decodePresenterInfo(r);break;case 6:e.music=this.decodeMusicInfo(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeClientBroadcast=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.sessionID;t!=null&&(e.writeVarUint(1),e.writeVarUint(t));var t=r.cursorReaction;t!=null&&(e.writeVarUint(2),this.encodeCursorReaction(t,e));var t=r.timer;t!=null&&(e.writeVarUint(3),this.encodeTimerInfo(t,e));var t=r.presenter;t!=null&&(e.writeVarUint(4),this.encodePresenterInfo(t,e));var t=r.prototypePresenter;t!=null&&(e.writeVarUint(5),this.encodePresenterInfo(t,e));var t=r.music;if(t!=null&&(e.writeVarUint(6),this.encodeMusicInfo(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeMessage=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.type=this.MessageType[r.readVarUint()];break;case 2:e.sessionID=r.readVarUint();break;case 3:e.ackID=r.readVarUint();break;case 4:for(var t=r.readVarUint(),i=e.nodeChanges=Array(t),n=0;n<t;n++)i[n]=this.decodeNodeChange(r);break;case 5:for(var t=r.readVarUint(),i=e.userChanges=Array(t),n=0;n<t;n++)i[n]=this.decodeUserChange(r);break;case 32:e.interactiveSlideElementChange=this.decodeInteractiveSlideElementChange(r);break;case 36:e.nodeStatusChange=this.decodeNodeStatusChange(r);break;case 6:for(var t=r.readVarUint(),i=e.blobs=Array(t),n=0;n<t;n++)i[n]=this.decodeBlob(r);break;case 30:e.blobBaseIndex=r.readVarUint();break;case 7:e.signalName=r.readString();break;case 8:e.access=this.Access[r.readVarUint()];break;case 9:e.styleSetName=r.readString();break;case 10:e.styleSetType=this.StyleSetType[r.readVarUint()];break;case 11:e.styleSetContentType=this.StyleSetContentType[r.readVarUint()];break;case 12:e.pasteID=r.readVarInt();break;case 13:e.pasteOffset=this.decodeVector(r);break;case 14:e.pasteFileKey=r.readString();break;case 15:e.signalPayload=r.readString();break;case 16:for(var t=r.readVarUint(),i=e.sceneGraphQueries=Array(t),n=0;n<t;n++)i[n]=this.decodeSceneGraphQuery(r);break;case 17:e.nodeChangesMetadata=this.decodeNodeChangesMetadata(r);break;case 18:e.fileVersion=r.readVarUint();break;case 19:e.pasteIsPartiallyOutsideEnclosingFrame=!!r.readByte();break;case 20:e.pastePageId=this.decodeGUID(r);break;case 21:e.isCut=!!r.readByte();break;case 22:for(var t=r.readVarUint(),i=e.localUndoStack=Array(t),n=0;n<t;n++)i[n]=this.decodeMessage(r);break;case 23:for(var t=r.readVarUint(),i=e.localRedoStack=Array(t),n=0;n<t;n++)i[n]=this.decodeMessage(r);break;case 24:for(var t=r.readVarUint(),i=e.broadcasts=Array(t),n=0;n<t;n++)i[n]=this.decodeClientBroadcast(r);break;case 25:e.reconnectSequenceNumber=r.readVarUint();break;case 26:e.pasteBranchSourceFileKey=r.readString();break;case 27:e.pasteEditorType=this.EditorType[r.readVarUint()];break;case 28:e.postSyncActions=r.readString();break;case 29:for(var t=r.readVarUint(),i=e.publishedAssetGuids=Array(t),n=0;n<t;n++)i[n]=this.decodeGUID(r);break;case 31:e.dirtyFromInitialLoad=!!r.readByte();break;case 33:for(var t=r.readVarUint(),i=e.clipboardSelectionRegions=Array(t),n=0;n<t;n++)i[n]=this.decodeClipboardSelectionRegion(r);break;case 34:e.encodedOffsetsIndex=this.decodeEncodedOffsetsIndex(r);break;case 35:e.hasRepeatingContent=!!r.readByte();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeMessage=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var a=r.type;if(a!=null){e.writeVarUint(1);var t=this.MessageType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "MessageType"');e.writeVarUint(t)}var a=r.sessionID;a!=null&&(e.writeVarUint(2),e.writeVarUint(a));var a=r.ackID;a!=null&&(e.writeVarUint(3),e.writeVarUint(a));var a=r.nodeChanges;if(a!=null){e.writeVarUint(4);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeNodeChange(a,e)}var a=r.userChanges;if(a!=null){e.writeVarUint(5);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeUserChange(a,e)}var a=r.interactiveSlideElementChange;a!=null&&(e.writeVarUint(32),this.encodeInteractiveSlideElementChange(a,e));var a=r.nodeStatusChange;a!=null&&(e.writeVarUint(36),this.encodeNodeStatusChange(a,e));var a=r.blobs;if(a!=null){e.writeVarUint(6);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeBlob(a,e)}var a=r.blobBaseIndex;a!=null&&(e.writeVarUint(30),e.writeVarUint(a));var a=r.signalName;a!=null&&(e.writeVarUint(7),e.writeString(a));var a=r.access;if(a!=null){e.writeVarUint(8);var t=this.Access[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "Access"');e.writeVarUint(t)}var a=r.styleSetName;a!=null&&(e.writeVarUint(9),e.writeString(a));var a=r.styleSetType;if(a!=null){e.writeVarUint(10);var t=this.StyleSetType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StyleSetType"');e.writeVarUint(t)}var a=r.styleSetContentType;if(a!=null){e.writeVarUint(11);var t=this.StyleSetContentType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "StyleSetContentType"');e.writeVarUint(t)}var a=r.pasteID;a!=null&&(e.writeVarUint(12),e.writeVarInt(a));var a=r.pasteOffset;a!=null&&(e.writeVarUint(13),this.encodeVector(a,e));var a=r.pasteFileKey;a!=null&&(e.writeVarUint(14),e.writeString(a));var a=r.signalPayload;a!=null&&(e.writeVarUint(15),e.writeString(a));var a=r.sceneGraphQueries;if(a!=null){e.writeVarUint(16);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeSceneGraphQuery(a,e)}var a=r.nodeChangesMetadata;a!=null&&(e.writeVarUint(17),this.encodeNodeChangesMetadata(a,e));var a=r.fileVersion;a!=null&&(e.writeVarUint(18),e.writeVarUint(a));var a=r.pasteIsPartiallyOutsideEnclosingFrame;a!=null&&(e.writeVarUint(19),e.writeByte(a));var a=r.pastePageId;a!=null&&(e.writeVarUint(20),this.encodeGUID(a,e));var a=r.isCut;a!=null&&(e.writeVarUint(21),e.writeByte(a));var a=r.localUndoStack;if(a!=null){e.writeVarUint(22);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeMessage(a,e)}var a=r.localRedoStack;if(a!=null){e.writeVarUint(23);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeMessage(a,e)}var a=r.broadcasts;if(a!=null){e.writeVarUint(24);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeClientBroadcast(a,e)}var a=r.reconnectSequenceNumber;a!=null&&(e.writeVarUint(25),e.writeVarUint(a));var a=r.pasteBranchSourceFileKey;a!=null&&(e.writeVarUint(26),e.writeString(a));var a=r.pasteEditorType;if(a!=null){e.writeVarUint(27);var t=this.EditorType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "EditorType"');e.writeVarUint(t)}var a=r.postSyncActions;a!=null&&(e.writeVarUint(28),e.writeString(a));var a=r.publishedAssetGuids;if(a!=null){e.writeVarUint(29);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeGUID(a,e)}var a=r.dirtyFromInitialLoad;a!=null&&(e.writeVarUint(31),e.writeByte(a));var a=r.clipboardSelectionRegions;if(a!=null){e.writeVarUint(33);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],this.encodeClipboardSelectionRegion(a,e)}var a=r.encodedOffsetsIndex;a!=null&&(e.writeVarUint(34),this.encodeEncodedOffsetsIndex(a,e));var a=r.hasRepeatingContent;if(a!=null&&(e.writeVarUint(35),e.writeByte(a)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeEncodedOffsetsIndex=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.nodeChangesFieldOffset=r.readVarUint();break;case 2:e.nodeChangesFieldLength=r.readVarUint();break;case 3:e.blobsFieldOffset=r.readVarUint();break;case 4:for(var n=r.readVarUint(),t=e.nodeChangeOffsets=Array(n),i=0;i<n;i++)t[i]=this.decodeGUIDAndEncodedOffset(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeEncodedOffsetsIndex=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.nodeChangesFieldOffset;t!=null&&(e.writeVarUint(1),e.writeVarUint(t));var t=r.nodeChangesFieldLength;t!=null&&(e.writeVarUint(2),e.writeVarUint(t));var t=r.blobsFieldOffset;t!=null&&(e.writeVarUint(3),e.writeVarUint(t));var t=r.nodeChangeOffsets;if(t!=null){e.writeVarUint(4);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeGUIDAndEncodedOffset(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeGUIDAndEncodedOffset=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.guid=this.decodeGUID(r),e.offset=r.readVarUint(),e};l.encodeGUIDAndEncodedOffset=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.guid;if(t!=null)this.encodeGUID(t,e);else throw new Error('Missing required field "guid"');var t=r.offset;if(t!=null)e.writeVarUint(t);else throw new Error('Missing required field "offset"');if(n)return e.toUint8Array()};l.decodeDiffChunk=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var t=r.readVarUint(),i=e.nodeChanges=Array(t),n=0;n<t;n++)i[n]=r.readVarUint();break;case 2:e.phase=this.NodePhase[r.readVarUint()];break;case 3:e.displayNode=this.decodeNodeChange(r);break;case 4:e.canvasId=this.decodeGUID(r);break;case 5:e.canvasName=r.readString();break;case 6:e.canvasIsInternal=!!r.readByte();break;case 7:for(var t=r.readVarUint(),i=e.chunksAffectingThisChunk=Array(t),n=0;n<t;n++)i[n]=r.readVarUint();break;case 8:for(var t=r.readVarUint(),i=e.basisParentHierarchy=Array(t),n=0;n<t;n++)i[n]=this.decodeNodeChange(r);break;case 9:for(var t=r.readVarUint(),i=e.parentHierarchy=Array(t),n=0;n<t;n++)i[n]=this.decodeNodeChange(r);break;case 10:for(var t=r.readVarUint(),i=e.basisParentHierarchyGuids=Array(t),n=0;n<t;n++)i[n]=this.decodeGUID(r);break;case 11:for(var t=r.readVarUint(),i=e.parentHierarchyGuids=Array(t),n=0;n<t;n++)i[n]=this.decodeGUID(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeDiffChunk=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var a=r.nodeChanges;if(a!=null){e.writeVarUint(1);var t=a,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)a=t[d],e.writeVarUint(a)}var a=r.phase;if(a!=null){e.writeVarUint(2);var o=this.NodePhase[a];if(o===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "NodePhase"');e.writeVarUint(o)}var a=r.displayNode;a!=null&&(e.writeVarUint(3),this.encodeNodeChange(a,e));var a=r.canvasId;a!=null&&(e.writeVarUint(4),this.encodeGUID(a,e));var a=r.canvasName;a!=null&&(e.writeVarUint(5),e.writeString(a));var a=r.canvasIsInternal;a!=null&&(e.writeVarUint(6),e.writeByte(a));var a=r.chunksAffectingThisChunk;if(a!=null){e.writeVarUint(7);var t=a,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)a=t[d],e.writeVarUint(a)}var a=r.basisParentHierarchy;if(a!=null){e.writeVarUint(8);var t=a,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)a=t[d],this.encodeNodeChange(a,e)}var a=r.parentHierarchy;if(a!=null){e.writeVarUint(9);var t=a,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)a=t[d],this.encodeNodeChange(a,e)}var a=r.basisParentHierarchyGuids;if(a!=null){e.writeVarUint(10);var t=a,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)a=t[d],this.encodeGUID(a,e)}var a=r.parentHierarchyGuids;if(a!=null){e.writeVarUint(11);var t=a,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)a=t[d],this.encodeGUID(a,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.DiffType={0:"BRANCHING",1:"NODE_CHANGES_ONLY",BRANCHING:0,NODE_CHANGES_ONLY:1};l.decodeDiffPayload=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var t=r.readVarUint(),i=e.nodeChanges=Array(t),n=0;n<t;n++)i[n]=this.decodeNodeChange(r);break;case 2:for(var t=r.readVarUint(),i=e.blobs=Array(t),n=0;n<t;n++)i[n]=this.decodeBlob(r);break;case 3:for(var t=r.readVarUint(),i=e.diffChunks=Array(t),n=0;n<t;n++)i[n]=this.decodeDiffChunk(r);break;case 4:for(var t=r.readVarUint(),i=e.diffBasis=Array(t),n=0;n<t;n++)i[n]=this.decodeNodeChange(r);break;case 5:for(var t=r.readVarUint(),i=e.basisParentNodeChanges=Array(t),n=0;n<t;n++)i[n]=this.decodeNodeChange(r);break;case 6:for(var t=r.readVarUint(),i=e.parentNodeChanges=Array(t),n=0;n<t;n++)i[n]=this.decodeNodeChange(r);break;case 7:e.diffType=this.DiffType[r.readVarUint()];break;default:throw new Error("Attempted to parse invalid message")}};l.encodeDiffPayload=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.nodeChanges;if(o!=null){e.writeVarUint(1);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeNodeChange(o,e)}var o=r.blobs;if(o!=null){e.writeVarUint(2);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeBlob(o,e)}var o=r.diffChunks;if(o!=null){e.writeVarUint(3);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeDiffChunk(o,e)}var o=r.diffBasis;if(o!=null){e.writeVarUint(4);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeNodeChange(o,e)}var o=r.basisParentNodeChanges;if(o!=null){e.writeVarUint(5);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeNodeChange(o,e)}var o=r.parentNodeChanges;if(o!=null){e.writeVarUint(6);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeNodeChange(o,e)}var o=r.diffType;if(o!=null){e.writeVarUint(7);var a=this.DiffType[o];if(a===void 0)throw new Error("Invalid value "+JSON.stringify(o)+' for enum "DiffType"');e.writeVarUint(a)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.RichMediaType={0:"ANIMATED_IMAGE",1:"VIDEO",ANIMATED_IMAGE:0,VIDEO:1};l.decodeRichMediaData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.mediaHash=r.readString();break;case 2:e.richMediaType=this.RichMediaType[r.readVarUint()];break;default:throw new Error("Attempted to parse invalid message")}};l.encodeRichMediaData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.mediaHash;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.richMediaType;if(t!=null){e.writeVarUint(2);var i=this.RichMediaType[t];if(i===void 0)throw new Error("Invalid value "+JSON.stringify(t)+' for enum "RichMediaType"');e.writeVarUint(i)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.VariableDataType={0:"BOOLEAN",1:"FLOAT",2:"STRING",3:"ALIAS",4:"COLOR",5:"EXPRESSION",6:"MAP",7:"SYMBOL_ID",8:"FONT_STYLE",9:"TEXT_DATA",10:"INVALID",11:"NODE_FIELD_ALIAS",BOOLEAN:0,FLOAT:1,STRING:2,ALIAS:3,COLOR:4,EXPRESSION:5,MAP:6,SYMBOL_ID:7,FONT_STYLE:8,TEXT_DATA:9,INVALID:10,NODE_FIELD_ALIAS:11};l.VariableResolvedDataType={0:"BOOLEAN",1:"FLOAT",2:"STRING",4:"COLOR",5:"MAP",6:"SYMBOL_ID",7:"FONT_STYLE",8:"TEXT_DATA",BOOLEAN:0,FLOAT:1,STRING:2,COLOR:4,MAP:5,SYMBOL_ID:6,FONT_STYLE:7,TEXT_DATA:8};l.decodeVariableAnyValue=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.boolValue=!!r.readByte();break;case 2:e.textValue=r.readString();break;case 3:e.floatValue=r.readVarFloat();break;case 4:e.alias=this.decodeVariableID(r);break;case 5:e.colorValue=this.decodeColor(r);break;case 6:e.expressionValue=this.decodeExpression(r);break;case 7:e.mapValue=this.decodeVariableMap(r);break;case 8:e.symbolIdValue=this.decodeSymbolId(r);break;case 9:e.fontStyleValue=this.decodeVariableFontStyle(r);break;case 10:e.textDataValue=this.decodeTextData(r);break;case 11:e.nodeFieldAliasValue=this.decodeNodeFieldAlias(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVariableAnyValue=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.boolValue;t!=null&&(e.writeVarUint(1),e.writeByte(t));var t=r.textValue;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.floatValue;t!=null&&(e.writeVarUint(3),e.writeVarFloat(t));var t=r.alias;t!=null&&(e.writeVarUint(4),this.encodeVariableID(t,e));var t=r.colorValue;t!=null&&(e.writeVarUint(5),this.encodeColor(t,e));var t=r.expressionValue;t!=null&&(e.writeVarUint(6),this.encodeExpression(t,e));var t=r.mapValue;t!=null&&(e.writeVarUint(7),this.encodeVariableMap(t,e));var t=r.symbolIdValue;t!=null&&(e.writeVarUint(8),this.encodeSymbolId(t,e));var t=r.fontStyleValue;t!=null&&(e.writeVarUint(9),this.encodeVariableFontStyle(t,e));var t=r.textDataValue;t!=null&&(e.writeVarUint(10),this.encodeTextData(t,e));var t=r.nodeFieldAliasValue;if(t!=null&&(e.writeVarUint(11),this.encodeNodeFieldAlias(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.ExpressionFunction={0:"ADDITION",1:"SUBTRACTION",2:"RESOLVE_VARIANT",3:"MULTIPLY",4:"DIVIDE",5:"EQUALS",6:"NOT_EQUAL",7:"LESS_THAN",8:"LESS_THAN_OR_EQUAL",9:"GREATER_THAN",10:"GREATER_THAN_OR_EQUAL",11:"AND",12:"OR",13:"NOT",14:"STRINGIFY",15:"TERNARY",16:"VAR_MODE_LOOKUP",17:"NEGATE",18:"IS_TRUTHY",ADDITION:0,SUBTRACTION:1,RESOLVE_VARIANT:2,MULTIPLY:3,DIVIDE:4,EQUALS:5,NOT_EQUAL:6,LESS_THAN:7,LESS_THAN_OR_EQUAL:8,GREATER_THAN:9,GREATER_THAN_OR_EQUAL:10,AND:11,OR:12,NOT:13,STRINGIFY:14,TERNARY:15,VAR_MODE_LOOKUP:16,NEGATE:17,IS_TRUTHY:18};l.decodeExpression=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.expressionFunction=this.ExpressionFunction[r.readVarUint()];break;case 2:for(var n=r.readVarUint(),t=e.expressionArguments=Array(n),i=0;i<n;i++)t[i]=this.decodeVariableData(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeExpression=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.expressionFunction;if(i!=null){e.writeVarUint(1);var t=this.ExpressionFunction[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "ExpressionFunction"');e.writeVarUint(t)}var i=r.expressionArguments;if(i!=null){e.writeVarUint(2);var d=i,o=d.length;e.writeVarUint(o);for(var a=0;a<o;a++)i=d[a],this.encodeVariableData(i,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeVariableMapValue=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.key=r.readString();break;case 2:e.value=this.decodeVariableData(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVariableMapValue=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.key;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.value;if(t!=null&&(e.writeVarUint(2),this.encodeVariableData(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeVariableMap=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.values=Array(n),i=0;i<n;i++)t[i]=this.decodeVariableMapValue(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVariableMap=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.values;if(t!=null){e.writeVarUint(1);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeVariableMapValue(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeVariableFontStyle=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.asString=this.decodeVariableData(r);break;case 2:e.asFloat=this.decodeVariableData(r);break;case 3:e.asVariations=this.decodeVariableData(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVariableFontStyle=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.asString;t!=null&&(e.writeVarUint(1),this.encodeVariableData(t,e));var t=r.asFloat;t!=null&&(e.writeVarUint(2),this.encodeVariableData(t,e));var t=r.asVariations;if(t!=null&&(e.writeVarUint(3),this.encodeVariableData(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeNodeFieldAlias=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.stablePathToNode=this.decodeGUIDPath(r);break;case 2:e.nodeField=this.NodeFieldAliasType[r.readVarUint()];break;case 3:e.indexOrKey=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeNodeFieldAlias=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.stablePathToNode;i!=null&&(e.writeVarUint(1),this.encodeGUIDPath(i,e));var i=r.nodeField;if(i!=null){e.writeVarUint(2);var t=this.NodeFieldAliasType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "NodeFieldAliasType"');e.writeVarUint(t)}var i=r.indexOrKey;if(i!=null&&(e.writeVarUint(3),e.writeString(i)),e.writeVarUint(0),n)return e.toUint8Array()};l.NodeFieldAliasType={0:"MISSING",1:"COMPONENT_PROP_ASSIGNMENTS",MISSING:0,COMPONENT_PROP_ASSIGNMENTS:1};l.decodeVariableData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.value=this.decodeVariableAnyValue(r);break;case 2:e.dataType=this.VariableDataType[r.readVarUint()];break;case 3:e.resolvedDataType=this.VariableResolvedDataType[r.readVarUint()];break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVariableData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.value;i!=null&&(e.writeVarUint(1),this.encodeVariableAnyValue(i,e));var i=r.dataType;if(i!=null){e.writeVarUint(2);var t=this.VariableDataType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "VariableDataType"');e.writeVarUint(t)}var i=r.resolvedDataType;if(i!=null){e.writeVarUint(3);var t=this.VariableResolvedDataType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "VariableResolvedDataType"');e.writeVarUint(t)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeVariableSetMode=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.id=this.decodeGUID(r);break;case 2:e.name=r.readString();break;case 3:e.sortPosition=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVariableSetMode=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.id;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.name;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.sortPosition;if(t!=null&&(e.writeVarUint(3),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeVariableDataValues=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.entries=Array(n),i=0;i<n;i++)t[i]=this.decodeVariableDataValuesEntry(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVariableDataValues=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.entries;if(t!=null){e.writeVarUint(1);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeVariableDataValuesEntry(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeVariableDataValuesEntry=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.modeID=this.decodeGUID(r);break;case 2:e.variableData=this.decodeVariableData(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVariableDataValuesEntry=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.modeID;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.variableData;if(t!=null&&(e.writeVarUint(2),this.encodeVariableData(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.VariableScope={0:"ALL_SCOPES",1:"TEXT_CONTENT",2:"CORNER_RADIUS",3:"WIDTH_HEIGHT",4:"GAP",5:"ALL_FILLS",6:"FRAME_FILL",7:"SHAPE_FILL",8:"TEXT_FILL",9:"STROKE",10:"STROKE_FLOAT",11:"EFFECT_FLOAT",12:"EFFECT_COLOR",13:"OPACITY",14:"FONT_STYLE",15:"FONT_FAMILY",16:"FONT_SIZE",17:"LINE_HEIGHT",18:"LETTER_SPACING",19:"PARAGRAPH_SPACING",20:"PARAGRAPH_INDENT",21:"FONT_VARIATIONS",ALL_SCOPES:0,TEXT_CONTENT:1,CORNER_RADIUS:2,WIDTH_HEIGHT:3,GAP:4,ALL_FILLS:5,FRAME_FILL:6,SHAPE_FILL:7,TEXT_FILL:8,STROKE:9,STROKE_FLOAT:10,EFFECT_FLOAT:11,EFFECT_COLOR:12,OPACITY:13,FONT_STYLE:14,FONT_FAMILY:15,FONT_SIZE:16,LINE_HEIGHT:17,LETTER_SPACING:18,PARAGRAPH_SPACING:19,PARAGRAPH_INDENT:20,FONT_VARIATIONS:21};l.CodeSyntaxPlatform={0:"WEB",1:"ANDROID",2:"iOS",WEB:0,ANDROID:1,iOS:2};l.decodeOptionalVector=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.value=this.decodeVector(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeOptionalVector=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.value;if(t!=null&&(e.writeVarUint(1),this.encodeVector(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.HTMLTag={0:"AUTO",1:"ARTICLE",2:"SECTION",3:"NAV",4:"ASIDE",5:"H1",6:"H2",7:"H3",8:"H4",9:"H5",10:"H6",11:"HGROUP",12:"HEADER",13:"FOOTER",14:"ADDRESS",15:"P",16:"HR",17:"PRE",18:"BLOCKQUOTE",19:"OL",20:"UL",21:"MENU",22:"LI",23:"DL",24:"DT",25:"DD",26:"FIGURE",27:"FIGCAPTION",28:"MAIN",29:"DIV",30:"A",31:"EM",32:"STRONG",33:"SMALL",34:"S",35:"CITE",36:"Q",37:"DFN",38:"ABBR",39:"RUBY",40:"RT",41:"RP",42:"DATA",43:"TIME",44:"CODE",45:"VAR",46:"SAMP",47:"KBD",48:"SUB",49:"SUP",50:"I",51:"B",52:"U",53:"MARK",54:"BDI",55:"BDO",56:"SPAN",57:"BR",58:"WBR",59:"PICTURE",60:"SOURCE",61:"IMG",62:"FORM",63:"LABEL",64:"INPUT",65:"BUTTON",66:"SELECT",67:"DATALIST",68:"OPTGROUP",69:"OPTION",70:"TEXTAREA",71:"OUTPUT",72:"PROGRESS",73:"METER",74:"FIELDSET",75:"LEGEND",76:"VIDEO",AUTO:0,ARTICLE:1,SECTION:2,NAV:3,ASIDE:4,H1:5,H2:6,H3:7,H4:8,H5:9,H6:10,HGROUP:11,HEADER:12,FOOTER:13,ADDRESS:14,P:15,HR:16,PRE:17,BLOCKQUOTE:18,OL:19,UL:20,MENU:21,LI:22,DL:23,DT:24,DD:25,FIGURE:26,FIGCAPTION:27,MAIN:28,DIV:29,A:30,EM:31,STRONG:32,SMALL:33,S:34,CITE:35,Q:36,DFN:37,ABBR:38,RUBY:39,RT:40,RP:41,DATA:42,TIME:43,CODE:44,VAR:45,SAMP:46,KBD:47,SUB:48,SUP:49,I:50,B:51,U:52,MARK:53,BDI:54,BDO:55,SPAN:56,BR:57,WBR:58,PICTURE:59,SOURCE:60,IMG:61,FORM:62,LABEL:63,INPUT:64,BUTTON:65,SELECT:66,DATALIST:67,OPTGROUP:68,OPTION:69,TEXTAREA:70,OUTPUT:71,PROGRESS:72,METER:73,FIELDSET:74,LEGEND:75,VIDEO:76};l.ARIARole={0:"AUTO",1:"BUTTON",2:"CHECKBOX",3:"GRIDCELL",4:"LINK",5:"MENUITEM",6:"MENUITEMCHECKBOX",7:"MENUITEMRADIO",8:"OPTION",9:"PROGRESSBAR",10:"RADIO",11:"SCROLLBAR",12:"SEARCHBOX",13:"SEPARATOR",14:"SLIDER",15:"SPINBUTTON",16:"SWITCH",17:"TAB",18:"TABPANEL",19:"TEXTBOX",20:"TREEITEM",21:"COMBOBOX",22:"GRID",23:"LISTBOX",24:"MENU",25:"MENUBAR",26:"RADIOGROUP",27:"TABLIST",28:"TREE",29:"TREEGRID",30:"APPLICATION",31:"ARTICLE",32:"BLOCKQUOTE",33:"CAPTION",34:"CELL",35:"COLUMNHEADER",36:"DEFINITION",37:"DELETION",38:"DIRECTORY",39:"DOCUMENT",40:"EMPHASIS",41:"FEED",42:"FIGURE",43:"GENERIC",44:"GROUP",45:"HEADING",46:"IMG",47:"INSERTION",48:"LIST",49:"LISTITEM",50:"MATH",51:"METER",52:"NONE",53:"NOTE",54:"PARAGRAPH",55:"PRESENTATION",56:"ROW",57:"ROWGROUP",58:"ROWHEADER",59:"STRONG",60:"SUBSCRIPT",61:"SUPERSCRIPT",62:"TABLE",63:"TERM",64:"TIME",65:"TOOLBAR",66:"TOOLTIP",67:"BANNER",68:"COMPLEMENTARY",69:"CONTENTINFO",70:"FORM",71:"MAIN",72:"NAVIGATION",73:"REGION",74:"SEARCH",75:"ALERT",76:"LOG",77:"MARQUEE",78:"STATUS",79:"TIMER",80:"ALERTDIALOG",81:"DIALOG",82:"IMAGE",83:"HEADING_1",84:"HEADING_2",85:"HEADING_3",86:"HEADING_4",87:"HEADING_5",88:"HEADING_6",89:"HEADER",90:"FOOTER",91:"SIDEBAR",92:"SECTION",93:"MAINCONTENT",94:"TABLE_CELL",95:"WIDGET",AUTO:0,NONE:52,APPLICATION:30,BANNER:67,COMPLEMENTARY:68,CONTENTINFO:69,FORM:70,MAIN:71,NAVIGATION:72,REGION:73,SEARCH:74,SEPARATOR:13,ARTICLE:31,COLUMNHEADER:35,DEFINITION:36,DIRECTORY:38,DOCUMENT:39,GROUP:44,HEADING:45,IMG:46,LIST:48,LISTITEM:49,MATH:50,NOTE:53,PRESENTATION:55,ROW:56,ROWGROUP:57,ROWHEADER:58,TABLE:62,TOOLBAR:65,BUTTON:1,CHECKBOX:2,GRIDCELL:3,LINK:4,MENUITEM:5,MENUITEMCHECKBOX:6,MENUITEMRADIO:7,OPTION:8,PROGRESSBAR:9,RADIO:10,SCROLLBAR:11,SLIDER:14,SPINBUTTON:15,TAB:17,TABPANEL:18,TEXTBOX:19,TREEITEM:20,COMBOBOX:21,GRID:22,LISTBOX:23,MENU:24,MENUBAR:25,RADIOGROUP:26,TABLIST:27,TREE:28,TREEGRID:29,TOOLTIP:66,ALERT:75,LOG:76,MARQUEE:77,STATUS:78,TIMER:79,ALERTDIALOG:80,DIALOG:81,SEARCHBOX:12,SWITCH:16,BLOCKQUOTE:32,CAPTION:33,CELL:34,DELETION:37,EMPHASIS:40,FEED:41,FIGURE:42,GENERIC:43,INSERTION:47,METER:51,PARAGRAPH:54,STRONG:59,SUBSCRIPT:60,SUPERSCRIPT:61,TERM:63,TIME:64,IMAGE:82,HEADING_1:83,HEADING_2:84,HEADING_3:85,HEADING_4:86,HEADING_5:87,HEADING_6:88,HEADER:89,FOOTER:90,SIDEBAR:91,SECTION:92,MAINCONTENT:93,TABLE_CELL:94,WIDGET:95};l.decodeMigrationStatus=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.dsdCleanup=!!r.readByte();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeMigrationStatus=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.dsdCleanup;if(t!=null&&(e.writeVarUint(1),e.writeByte(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeNodeFieldMap=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.entries=Array(n),i=0;i<n;i++)t[i]=this.decodeNodeFieldMapEntry(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeNodeFieldMap=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.entries;if(t!=null){e.writeVarUint(1);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeNodeFieldMapEntry(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeNodeFieldMapEntry=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.guid=this.decodeGUID(r);break;case 2:e.field=r.readVarUint();break;case 3:e.lastModifiedSequenceNumber=r.readVarUint();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeNodeFieldMapEntry=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.guid;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.field;t!=null&&(e.writeVarUint(2),e.writeVarUint(t));var t=r.lastModifiedSequenceNumber;if(t!=null&&(e.writeVarUint(3),e.writeVarUint(t)),e.writeVarUint(0),n)return e.toUint8Array()};l.ColorProfile={0:"SRGB",1:"DISPLAY_P3",SRGB:0,DISPLAY_P3:1};l.DocumentColorProfile={0:"LEGACY",1:"SRGB",2:"DISPLAY_P3",LEGACY:0,SRGB:1,DISPLAY_P3:2};l.ChildReadingDirection={0:"NONE",1:"LEFT_TO_RIGHT",2:"RIGHT_TO_LEFT",NONE:0,LEFT_TO_RIGHT:1,RIGHT_TO_LEFT:2};l.decodeARIAAttributeAnyValue=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.boolValue=!!r.readByte();break;case 2:e.stringValue=r.readString();break;case 3:e.floatValue=r.readVarFloat();break;case 4:e.intValue=r.readVarInt();break;case 5:for(var n=r.readVarUint(),t=e.stringArrayValue=Array(n),i=0;i<n;i++)t[i]=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeARIAAttributeAnyValue=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.boolValue;t!=null&&(e.writeVarUint(1),e.writeByte(t));var t=r.stringValue;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.floatValue;t!=null&&(e.writeVarUint(3),e.writeVarFloat(t));var t=r.intValue;t!=null&&(e.writeVarUint(4),e.writeVarInt(t));var t=r.stringArrayValue;if(t!=null){e.writeVarUint(5);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],e.writeString(t)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.ARIAAttributeDataType={0:"BOOLEAN",1:"STRING",2:"FLOAT",3:"INT",4:"STRING_LIST",BOOLEAN:0,STRING:1,FLOAT:2,INT:3,STRING_LIST:4};l.decodeARIAAttributeData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.type=this.ARIAAttributeDataType[r.readVarUint()];break;case 2:e.value=this.decodeARIAAttributeAnyValue(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeARIAAttributeData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.type;if(i!=null){e.writeVarUint(1);var t=this.ARIAAttributeDataType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "ARIAAttributeDataType"');e.writeVarUint(t)}var i=r.value;if(i!=null&&(e.writeVarUint(2),this.encodeARIAAttributeAnyValue(i,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeARIAAttributesMap=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.entries=Array(n),i=0;i<n;i++)t[i]=this.decodeARIAAttributesMapEntry(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeARIAAttributesMap=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.entries;if(t!=null){e.writeVarUint(1);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeARIAAttributesMapEntry(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeARIAAttributesMapEntry=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.attribute=r.readString();break;case 2:e.value=this.decodeARIAAttributeData(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeARIAAttributesMapEntry=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.attribute;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.value;if(t!=null&&(e.writeVarUint(2),this.encodeARIAAttributeData(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeHandoffStatusMapEntry=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.guid=this.decodeGUID(r);break;case 2:e.handoffStatus=this.decodeSectionStatusInfo(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeHandoffStatusMapEntry=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.guid;t!=null&&(e.writeVarUint(1),this.encodeGUID(t,e));var t=r.handoffStatus;if(t!=null&&(e.writeVarUint(2),this.encodeSectionStatusInfo(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeHandoffStatusMap=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.entries=Array(n),i=0;i<n;i++)t[i]=this.decodeHandoffStatusMapEntry(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeHandoffStatusMap=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.entries;if(t!=null){e.writeVarUint(1);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeHandoffStatusMapEntry(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeEditScopeInfo=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var t=r.readVarUint(),i=e.editScopeStacks=Array(t),n=0;n<t;n++)i[n]=this.decodeEditScopeStack(r);break;case 2:for(var t=r.readVarUint(),i=e.snapshots=Array(t),n=0;n<t;n++)i[n]=this.decodeEditScopeSnapshot(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeEditScopeInfo=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.editScopeStacks;if(o!=null){e.writeVarUint(1);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeEditScopeStack(o,e)}var o=r.snapshots;if(o!=null){e.writeVarUint(2);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeEditScopeSnapshot(o,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeEditScopeSnapshot=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var t=r.readVarUint(),i=e.frames=Array(t),n=0;n<t;n++)i[n]=this.decodeEditScopeStack(r);break;case 2:for(var t=r.readVarUint(),i=e.nodeChangeFieldNumbers=Array(t),n=0;n<t;n++)i[n]=r.readVarUint();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeEditScopeSnapshot=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.frames;if(o!=null){e.writeVarUint(1);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeEditScopeStack(o,e)}var o=r.nodeChangeFieldNumbers;if(o!=null){e.writeVarUint(2);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],e.writeVarUint(o)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeEditScopeStack=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.stack=Array(n),i=0;i<n;i++)t[i]=this.decodeEditScope(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeEditScopeStack=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.stack;if(t!=null){e.writeVarUint(1);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeEditScope(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeEditScope=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.type=this.EditScopeType[r.readVarUint()];break;case 2:e.label=r.readString();break;case 3:e.editorType=this.EditorType[r.readVarUint()];break;default:throw new Error("Attempted to parse invalid message")}};l.encodeEditScope=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.type;if(i!=null){e.writeVarUint(1);var t=this.EditScopeType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "EditScopeType"');e.writeVarUint(t)}var i=r.label;i!=null&&(e.writeVarUint(2),e.writeString(i));var i=r.editorType;if(i!=null){e.writeVarUint(3);var t=this.EditorType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "EditorType"');e.writeVarUint(t)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.EditScopeType={0:"INVALID",1:"TEST_SETUP",2:"USER",3:"PLUGIN",4:"SYSTEM",5:"REST_API",6:"ONBOARDING",7:"AUTOSAVE",8:"AI",INVALID:0,TEST_SETUP:1,USER:2,PLUGIN:3,SYSTEM:4,REST_API:5,ONBOARDING:6,AUTOSAVE:7,AI:8};l.SectionPresetState={0:"INSERTED",1:"USER_EDITED",INSERTED:0,USER_EDITED:1};l.EmojiImageSet={0:"APPLE",1:"NOTO",APPLE:0,NOTO:1};l.SelectionRegionFocusType={0:"NONE",1:"PRIMARY",2:"SECONDARY",NONE:0,PRIMARY:1,SECONDARY:2};l.decodeSectionPresetInfo=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.shelfId=r.readVarUint64();break;case 2:e.templateId=r.readVarUint64();break;case 3:e.templateName=r.readString();break;case 4:e.state=this.SectionPresetState[r.readVarUint()];break;default:throw new Error("Attempted to parse invalid message")}};l.encodeSectionPresetInfo=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.shelfId;t!=null&&(e.writeVarUint(1),e.writeVarUint64(t));var t=r.templateId;t!=null&&(e.writeVarUint(2),e.writeVarUint64(t));var t=r.templateName;t!=null&&(e.writeVarUint(3),e.writeString(t));var t=r.state;if(t!=null){e.writeVarUint(4);var i=this.SectionPresetState[t];if(i===void 0)throw new Error("Invalid value "+JSON.stringify(t)+' for enum "SectionPresetState"');e.writeVarUint(i)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeClipboardSelectionRegion=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.parent=this.decodeGUID(r);break;case 2:for(var n=r.readVarUint(),t=e.nodes=Array(n),i=0;i<n;i++)t[i]=this.decodeGUID(r);break;case 3:e.enclosingFrameOffset=this.decodeVector(r);break;case 4:e.pasteIsPartiallyOutsideEnclosingFrame=!!r.readByte();break;case 5:e.focusType=this.SelectionRegionFocusType[r.readVarUint()];break;default:throw new Error("Attempted to parse invalid message")}};l.encodeClipboardSelectionRegion=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.parent;o!=null&&(e.writeVarUint(1),this.encodeGUID(o,e));var o=r.nodes;if(o!=null){e.writeVarUint(2);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeGUID(o,e)}var o=r.enclosingFrameOffset;o!=null&&(e.writeVarUint(3),this.encodeVector(o,e));var o=r.pasteIsPartiallyOutsideEnclosingFrame;o!=null&&(e.writeVarUint(4),e.writeByte(o));var o=r.focusType;if(o!=null){e.writeVarUint(5);var a=this.SelectionRegionFocusType[o];if(a===void 0)throw new Error("Invalid value "+JSON.stringify(o)+' for enum "SelectionRegionFocusType"');e.writeVarUint(a)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.FirstDraftKitType={0:"LOCAL",1:"LIBRARY",2:"NONE",LOCAL:0,LIBRARY:1,NONE:2};l.decodeFirstDraftKit=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.key=r.readString();break;case 2:e.type=this.FirstDraftKitType[r.readVarUint()];break;default:throw new Error("Attempted to parse invalid message")}};l.encodeFirstDraftKit=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.key;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.type;if(t!=null){e.writeVarUint(2);var i=this.FirstDraftKitType[t];if(i===void 0)throw new Error("Invalid value "+JSON.stringify(t)+' for enum "FirstDraftKitType"');e.writeVarUint(i)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeFirstDraftData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.generationId=r.readString();break;case 2:e.kit=this.decodeFirstDraftKit(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeFirstDraftData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.generationId;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.kit;if(t!=null&&(e.writeVarUint(2),this.encodeFirstDraftKit(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.FirstDraftKitElementType={0:"NONE",1:"BUILDING_BLOCK",2:"GROUPED_COMPONENT",NONE:0,BUILDING_BLOCK:1,GROUPED_COMPONENT:2};l.decodeFirstDraftKitElementData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.type=this.FirstDraftKitElementType[r.readVarUint()];break;default:throw new Error("Attempted to parse invalid message")}};l.encodeFirstDraftKitElementData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.type;if(t!=null){e.writeVarUint(1);var i=this.FirstDraftKitElementType[t];if(i===void 0)throw new Error("Invalid value "+JSON.stringify(t)+' for enum "FirstDraftKitElementType"');e.writeVarUint(i)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.PlatformShapeProperty={0:"FILL",1:"STROKE",2:"TEXT",FILL:0,STROKE:1,TEXT:2};l.PlatformShapeBehaviorType={0:"SHAPE",1:"CONTAINER",SHAPE:0,CONTAINER:1};l.decodePlatformShapePropertyMapEntry=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.property=this.PlatformShapeProperty[r.readVarUint()];break;case 2:for(var n=r.readVarUint(),t=e.nodePaths=Array(n),i=0;i<n;i++)t[i]=this.decodeGUIDPath(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodePlatformShapePropertyMapEntry=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.property;if(i!=null){e.writeVarUint(1);var t=this.PlatformShapeProperty[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "PlatformShapeProperty"');e.writeVarUint(t)}var i=r.nodePaths;if(i!=null){e.writeVarUint(2);var d=i,o=d.length;e.writeVarUint(o);for(var a=0;a<o;a++)i=d[a],this.encodeGUIDPath(i,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodePlatformShapeDefinition=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:for(var n=r.readVarUint(),t=e.propertyMapEntries=Array(n),i=0;i<n;i++)t[i]=this.decodePlatformShapePropertyMapEntry(r);break;case 2:e.behaviorType=this.PlatformShapeBehaviorType[r.readVarUint()];break;default:throw new Error("Attempted to parse invalid message")}};l.encodePlatformShapeDefinition=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.propertyMapEntries;if(o!=null){e.writeVarUint(1);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodePlatformShapePropertyMapEntry(o,e)}var o=r.behaviorType;if(o!=null){e.writeVarUint(2);var a=this.PlatformShapeBehaviorType[o];if(a===void 0)throw new Error("Invalid value "+JSON.stringify(o)+' for enum "PlatformShapeBehaviorType"');e.writeVarUint(a)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeNodeBehaviors=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.link=this.decodeLinkBehavior(r);break;case 2:e.appear=this.decodeAppearBehavior(r);break;case 3:e.hover=this.decodeHoverBehavior(r);break;case 4:e.press=this.decodePressBehavior(r);break;case 5:e.focus=this.decodeFocusBehavior(r);break;case 6:e.scrollParallax=this.decodeScrollParallaxBehavior(r);break;case 7:e.scrollTransform=this.decodeScrollTransformBehavior(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeNodeBehaviors=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.link;t!=null&&(e.writeVarUint(1),this.encodeLinkBehavior(t,e));var t=r.appear;t!=null&&(e.writeVarUint(2),this.encodeAppearBehavior(t,e));var t=r.hover;t!=null&&(e.writeVarUint(3),this.encodeHoverBehavior(t,e));var t=r.press;t!=null&&(e.writeVarUint(4),this.encodePressBehavior(t,e));var t=r.focus;t!=null&&(e.writeVarUint(5),this.encodeFocusBehavior(t,e));var t=r.scrollParallax;t!=null&&(e.writeVarUint(6),this.encodeScrollParallaxBehavior(t,e));var t=r.scrollTransform;if(t!=null&&(e.writeVarUint(7),this.encodeScrollTransformBehavior(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeBehaviorTransition=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.easingType=this.EasingType[r.readVarUint()];break;case 2:for(var n=r.readVarUint(),t=e.easingFunction=Array(n),i=0;i<n;i++)t[i]=r.readVarFloat();break;case 3:e.transitionDuration=r.readVarFloat();break;case 4:e.delay=r.readVarFloat();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeBehaviorTransition=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var a=r.easingType;if(a!=null){e.writeVarUint(1);var t=this.EasingType[a];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(a)+' for enum "EasingType"');e.writeVarUint(t)}var a=r.easingFunction;if(a!=null){e.writeVarUint(2);var i=a,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)a=i[o],e.writeVarFloat(a)}var a=r.transitionDuration;a!=null&&(e.writeVarUint(3),e.writeVarFloat(a));var a=r.delay;if(a!=null&&(e.writeVarUint(4),e.writeVarFloat(a)),e.writeVarUint(0),n)return e.toUint8Array()};l.AppearBehaviorTrigger={1:"PAGE_LOAD",2:"THIS_LAYER_IN_VIEW",3:"OTHER_LAYER_IN_VIEW",4:"SCROLL_DIRECTION",PAGE_LOAD:1,THIS_LAYER_IN_VIEW:2,OTHER_LAYER_IN_VIEW:3,SCROLL_DIRECTION:4};l.RelativeDirection={1:"UP",2:"DOWN",3:"LEFT",4:"RIGHT",UP:1,DOWN:2,LEFT:3,RIGHT:4};l.LinkBehaviorType={1:"URL",2:"PAGE",URL:1,PAGE:2};l.decodeLinkBehavior=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.type=this.LinkBehaviorType[r.readVarUint()];break;case 2:e.url=r.readString();break;case 3:e.page=this.decodeGUID(r);break;case 4:e.openInNewWindow=!!r.readByte();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeLinkBehavior=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.type;if(i!=null){e.writeVarUint(1);var t=this.LinkBehaviorType[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "LinkBehaviorType"');e.writeVarUint(t)}var i=r.url;i!=null&&(e.writeVarUint(2),e.writeString(i));var i=r.page;i!=null&&(e.writeVarUint(3),this.encodeGUID(i,e));var i=r.openInNewWindow;if(i!=null&&(e.writeVarUint(4),e.writeByte(i)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeAppearBehavior=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.trigger=this.AppearBehaviorTrigger[r.readVarUint()];break;case 2:e.direction=this.RelativeDirection[r.readVarUint()];break;case 3:e.otherLayer=this.decodeGUID(r);break;case 4:e.enterTransition=this.decodeBehaviorTransition(r);break;case 5:e.enterState=this.decodeNodeChange(r);break;case 6:e.exitTransition=this.decodeBehaviorTransition(r);break;case 7:e.exitState=this.decodeNodeChange(r);break;case 8:e.playsOnce=!!r.readByte();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeAppearBehavior=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.trigger;if(i!=null){e.writeVarUint(1);var t=this.AppearBehaviorTrigger[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "AppearBehaviorTrigger"');e.writeVarUint(t)}var i=r.direction;if(i!=null){e.writeVarUint(2);var t=this.RelativeDirection[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "RelativeDirection"');e.writeVarUint(t)}var i=r.otherLayer;i!=null&&(e.writeVarUint(3),this.encodeGUID(i,e));var i=r.enterTransition;i!=null&&(e.writeVarUint(4),this.encodeBehaviorTransition(i,e));var i=r.enterState;i!=null&&(e.writeVarUint(5),this.encodeNodeChange(i,e));var i=r.exitTransition;i!=null&&(e.writeVarUint(6),this.encodeBehaviorTransition(i,e));var i=r.exitState;i!=null&&(e.writeVarUint(7),this.encodeNodeChange(i,e));var i=r.playsOnce;if(i!=null&&(e.writeVarUint(8),e.writeByte(i)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeHoverBehavior=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.transition=this.decodeBehaviorTransition(r);break;case 2:e.state=this.decodeNodeChange(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeHoverBehavior=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.transition;t!=null&&(e.writeVarUint(1),this.encodeBehaviorTransition(t,e));var t=r.state;if(t!=null&&(e.writeVarUint(2),this.encodeNodeChange(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodePressBehavior=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.transition=this.decodeBehaviorTransition(r);break;case 2:e.state=this.decodeNodeChange(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodePressBehavior=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.transition;t!=null&&(e.writeVarUint(1),this.encodeBehaviorTransition(t,e));var t=r.state;if(t!=null&&(e.writeVarUint(2),this.encodeNodeChange(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeFocusBehavior=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.transition=this.decodeBehaviorTransition(r);break;case 2:e.state=this.decodeNodeChange(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeFocusBehavior=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.transition;t!=null&&(e.writeVarUint(1),this.encodeBehaviorTransition(t,e));var t=r.state;if(t!=null&&(e.writeVarUint(2),this.encodeNodeChange(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeScrollParallaxBehavior=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.axis=this.ScrollDirection[r.readVarUint()];break;case 2:e.speed=r.readVarFloat();break;case 3:e.relativeToPage=!!r.readByte();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeScrollParallaxBehavior=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.axis;if(i!=null){e.writeVarUint(1);var t=this.ScrollDirection[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "ScrollDirection"');e.writeVarUint(t)}var i=r.speed;i!=null&&(e.writeVarUint(2),e.writeVarFloat(i));var i=r.relativeToPage;if(i!=null&&(e.writeVarUint(3),e.writeByte(i)),e.writeVarUint(0),n)return e.toUint8Array()};l.ScrollTransformBehaviorTrigger={1:"PAGE_HEIGHT",2:"THIS_LAYER_IN_VIEW",3:"OTHER_LAYER_IN_VIEW",PAGE_HEIGHT:1,THIS_LAYER_IN_VIEW:2,OTHER_LAYER_IN_VIEW:3};l.decodeScrollTransformBehavior=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.trigger=this.ScrollTransformBehaviorTrigger[r.readVarUint()];break;case 2:e.otherLayer=this.decodeGUID(r);break;case 3:e.transition=this.decodeBehaviorTransition(r);break;case 4:e.fromState=this.decodeNodeChange(r);break;case 5:e.toState=this.decodeNodeChange(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeScrollTransformBehavior=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var i=r.trigger;if(i!=null){e.writeVarUint(1);var t=this.ScrollTransformBehaviorTrigger[i];if(t===void 0)throw new Error("Invalid value "+JSON.stringify(i)+' for enum "ScrollTransformBehaviorTrigger"');e.writeVarUint(t)}var i=r.otherLayer;i!=null&&(e.writeVarUint(2),this.encodeGUID(i,e));var i=r.transition;i!=null&&(e.writeVarUint(3),this.encodeBehaviorTransition(i,e));var i=r.fromState;i!=null&&(e.writeVarUint(4),this.encodeNodeChange(i,e));var i=r.toState;if(i!=null&&(e.writeVarUint(5),this.encodeNodeChange(i,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeVariableIdOrVariableOverrideId=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.variableId=this.decodeVariableID(r);break;case 2:e.variableOverrideId=this.decodeVariableOverrideId(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeVariableIdOrVariableOverrideId=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.variableId;t!=null&&(e.writeVarUint(1),this.encodeVariableID(t,e));var t=r.variableOverrideId;if(t!=null&&(e.writeVarUint(2),this.encodeVariableOverrideId(t,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeIndexFontVariationAxis=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.tag=r.readString(),e.name=r.readString(),e.min=r.readVarFloat(),e.max=r.readVarFloat(),e.defaultValue=r.readVarFloat(),e};l.encodeIndexFontVariationAxis=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.tag;if(t!=null)e.writeString(t);else throw new Error('Missing required field "tag"');var t=r.name;if(t!=null)e.writeString(t);else throw new Error('Missing required field "name"');var t=r.min;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "min"');var t=r.max;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "max"');var t=r.defaultValue;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "defaultValue"');if(n)return e.toUint8Array()};l.decodeIndexFontVariationAxisValue=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.tag=r.readString(),e.value=r.readVarFloat(),e};l.encodeIndexFontVariationAxisValue=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.tag;if(t!=null)e.writeString(t);else throw new Error('Missing required field "tag"');var t=r.value;if(t!=null)e.writeVarFloat(t);else throw new Error('Missing required field "value"');if(n)return e.toUint8Array()};l.decodeIndexFontStyle=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.name=r.readString();break;case 2:e.postscript=r.readString();break;case 3:e.weight=r.readVarFloat();break;case 4:e.italic=!!r.readByte();break;case 5:e.stretch=r.readVarFloat();break;case 6:for(var n=r.readVarUint(),t=e.variationAxisValues=Array(n),i=0;i<n;i++)t[i]=this.decodeIndexFontVariationAxisValue(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeIndexFontStyle=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.name;t!=null&&(e.writeVarUint(1),e.writeString(t));var t=r.postscript;t!=null&&(e.writeVarUint(2),e.writeString(t));var t=r.weight;t!=null&&(e.writeVarUint(3),e.writeVarFloat(t));var t=r.italic;t!=null&&(e.writeVarUint(4),e.writeByte(t));var t=r.stretch;t!=null&&(e.writeVarUint(5),e.writeVarFloat(t));var t=r.variationAxisValues;if(t!=null){e.writeVarUint(6);var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeIndexFontVariationAxisValue(t,e)}if(e.writeVarUint(0),n)return e.toUint8Array()};l.decodeIndexFontFile=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.filename=r.readString();break;case 2:e.version=r.readVarUint();break;case 3:e.family=r.readString();break;case 4:for(var t=r.readVarUint(),i=e.styles=Array(t),n=0;n<t;n++)i[n]=this.decodeIndexFontStyle(r);break;case 5:for(var t=r.readVarUint(),i=e.variationAxes=Array(t),n=0;n<t;n++)i[n]=this.decodeIndexFontVariationAxis(r);break;case 6:e.useFontOpticalSize=!!r.readByte();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeIndexFontFile=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.filename;o!=null&&(e.writeVarUint(1),e.writeString(o));var o=r.version;o!=null&&(e.writeVarUint(2),e.writeVarUint(o));var o=r.family;o!=null&&(e.writeVarUint(3),e.writeString(o));var o=r.styles;if(o!=null){e.writeVarUint(4);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeIndexFontStyle(o,e)}var o=r.variationAxes;if(o!=null){e.writeVarUint(5);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeIndexFontVariationAxis(o,e)}var o=r.useFontOpticalSize;if(o!=null&&(e.writeVarUint(6),e.writeByte(o)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeIndexFamilyRename=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.oldFamily=r.readString(),e.newFamily=r.readString(),e};l.encodeIndexFamilyRename=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.oldFamily;if(t!=null)e.writeString(t);else throw new Error('Missing required field "oldFamily"');var t=r.newFamily;if(t!=null)e.writeString(t);else throw new Error('Missing required field "newFamily"');if(n)return e.toUint8Array()};l.decodeIndexStyleRename=function(r){var e={};return r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.oldStyle=r.readString(),e.newStyle=r.readString(),e};l.encodeIndexStyleRename=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.oldStyle;if(t!=null)e.writeString(t);else throw new Error('Missing required field "oldStyle"');var t=r.newStyle;if(t!=null)e.writeString(t);else throw new Error('Missing required field "newStyle"');if(n)return e.toUint8Array()};l.decodeIndexFamilyStylesRename=function(r){var e={};r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.familyName=r.readString();for(var n=r.readVarUint(),t=e.styleRenames=Array(n),i=0;i<n;i++)t[i]=this.decodeIndexStyleRename(r);return e};l.encodeIndexFamilyStylesRename=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.familyName;if(t!=null)e.writeString(t);else throw new Error('Missing required field "familyName"');var t=r.styleRenames;if(t!=null){var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],this.encodeIndexStyleRename(t,e)}else throw new Error('Missing required field "styleRenames"');if(n)return e.toUint8Array()};l.decodeIndexRenames=function(r){var e={};r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));for(var t=r.readVarUint(),i=e.family=Array(t),n=0;n<t;n++)i[n]=this.decodeIndexFamilyRename(r);for(var t=r.readVarUint(),i=e.style=Array(t),n=0;n<t;n++)i[n]=this.decodeIndexFamilyStylesRename(r);return e};l.encodeIndexRenames=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.family;if(o!=null){var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeIndexFamilyRename(o,e)}else throw new Error('Missing required field "family"');var o=r.style;if(o!=null){var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeIndexFamilyStylesRename(o,e)}else throw new Error('Missing required field "style"');if(n)return e.toUint8Array()};l.decodeIndexEmojiSequence=function(r){var e={};r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));for(var n=r.readVarUint(),t=e.codepoints=Array(n),i=0;i<n;i++)t[i]=r.readVarUint();return e};l.encodeIndexEmojiSequence=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.codepoints;if(t!=null){var i=t,d=i.length;e.writeVarUint(d);for(var o=0;o<d;o++)t=i[o],e.writeVarUint(t)}else throw new Error('Missing required field "codepoints"');if(n)return e.toUint8Array()};l.decodeIndexEmojis=function(r){var e={};r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r)),e.revision=r.readVarUint();for(var t=r.readVarUint(),i=e.sizes=Array(t),n=0;n<t;n++)i[n]=r.readVarUint();for(var t=r.readVarUint(),i=e.sequences=Array(t),n=0;n<t;n++)i[n]=this.decodeIndexEmojiSequence(r);return e};l.encodeIndexEmojis=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.revision;if(o!=null)e.writeVarUint(o);else throw new Error('Missing required field "revision"');var o=r.sizes;if(o!=null){var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],e.writeVarUint(o)}else throw new Error('Missing required field "sizes"');var o=r.sequences;if(o!=null){var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeIndexEmojiSequence(o,e)}else throw new Error('Missing required field "sequences"');if(n)return e.toUint8Array()};l.decodeFontIndex=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.schemaVersion=r.readVarUint();break;case 2:for(var n=r.readVarUint(),t=e.files=Array(n),i=0;i<n;i++)t[i]=this.decodeIndexFontFile(r);break;case 3:e.renames=this.decodeIndexRenames(r);break;case 4:e.emojis=this.decodeIndexEmojis(r);break;default:throw new Error("Attempted to parse invalid message")}};l.encodeFontIndex=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var o=r.schemaVersion;o!=null&&(e.writeVarUint(1),e.writeVarUint(o));var o=r.files;if(o!=null){e.writeVarUint(2);var t=o,i=t.length;e.writeVarUint(i);for(var d=0;d<i;d++)o=t[d],this.encodeIndexFontFile(o,e)}var o=r.renames;o!=null&&(e.writeVarUint(3),this.encodeIndexRenames(o,e));var o=r.emojis;if(o!=null&&(e.writeVarUint(4),this.encodeIndexEmojis(o,e)),e.writeVarUint(0),n)return e.toUint8Array()};l.decodeSlideThemeData=function(r){var e={};for(r instanceof this.ByteBuffer||(r=new this.ByteBuffer(r));;)switch(r.readVarUint()){case 0:return e;case 1:e.themeID=this.decodeThemeID(r);break;case 2:e.version=r.readString();break;default:throw new Error("Attempted to parse invalid message")}};l.encodeSlideThemeData=function(r,e){var n=!e;n&&(e=new this.ByteBuffer);var t=r.themeID;t!=null&&(e.writeVarUint(1),this.encodeThemeID(t,e));var t=r.version;if(t!=null&&(e.writeVarUint(2),e.writeString(t)),e.writeVarUint(0),n)return e.toUint8Array()};const u=async()=>await f(()=>import("./index4.js?v=1775123024591"),__vite__mapDeps([0,1,2])),c=async()=>await f(()=>import("./html-to-axure.js?v=1775123024591"),__vite__mapDeps([3,2,1])),w=async(r="body",e)=>(await u()).htmlToFigma(r,e),T=async(r,e)=>(await u()).processWithSnapDOMImplementation(r,e),I=async(r,e)=>(await u()).processWithOriginalLogic(r,e),V=async(r="body",e)=>(await c()).htmlToAxure(r,e),p=async(r="body",e)=>s()?{skipped:!1,data:await w(r,e)}:{skipped:!0,reason:"dom_unavailable"},E=async(r="body",e)=>s()?{skipped:!1,data:await V(r,e)}:{skipped:!0,reason:"dom_unavailable"};export{V as a,y as b,l as c,s as d,S as e,I as f,E as g,w as h,T as p,p as s};