package mapped;

import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;

import net.runelite.api.Point;
import net.runelite.api.WidgetNode;
import net.runelite.api.events.WidgetHiddenChanged;
import net.runelite.api.events.WidgetPositioned;
import net.runelite.api.widgets.WidgetItem;
import net.runelite.api.widgets.WidgetUtil;
import net.runelite.mapping.ObfuscatedGetter;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
import net.runelite.rs.api.RSFillMode;
import net.runelite.rs.api.RSFont;
import net.runelite.rs.api.RSNode;
import net.runelite.rs.api.RSNodeHashTable;
import net.runelite.rs.api.RSSpritePixels;
import net.runelite.rs.api.RSUrlRequester;
import net.runelite.rs.api.RSWidget;
import net.runelite.rs.api.RSWidgetDefinition;

@ObfuscatedName("nn")
public class Widget extends Node implements RSWidget {
   @ObfuscatedName("af")
   public static boolean field3656;
   public static final boolean $assertionsDisabled;
   public static int rl$widgetLastPosChanged;
   @ObfuscatedName("be")
   public boolean isIf3;
   @ObfuscatedName("bd")
   @ObfuscatedGetter(
      intValue = 898987495
   )
   public int id;
   @ObfuscatedName("bl")
   @ObfuscatedGetter(
      intValue = 355251343
   )
   public int childIndex;
   @ObfuscatedName("bi")
   String field3660;
   @ObfuscatedName("bv")
   @ObfuscatedGetter(
      intValue = -1298751483
   )
   public int type;
   @ObfuscatedName("bf")
   @ObfuscatedGetter(
      intValue = -2064124347
   )
   public int buttonType;
   @ObfuscatedName("bg")
   @ObfuscatedGetter(
      intValue = 1851395507
   )
   public int contentType;
   @ObfuscatedName("ba")
   @ObfuscatedGetter(
      intValue = 1934194921
   )
   public int xAlignment;
   @ObfuscatedName("bm")
   @ObfuscatedGetter(
      intValue = 899689359
   )
   public int yAlignment;
   @ObfuscatedName("bp")
   @ObfuscatedGetter(
      intValue = 370805007
   )
   public int widthAlignment;
   @ObfuscatedName("bw")
   @ObfuscatedGetter(
      intValue = 1183031285
   )
   public int heightAlignment;
   @ObfuscatedName("bj")
   @ObfuscatedGetter(
      intValue = 1753351321
   )
   public int rawX;
   @ObfuscatedName("bn")
   @ObfuscatedGetter(
      intValue = 521192617
   )
   public int rawY;
   @ObfuscatedName("bo")
   @ObfuscatedGetter(
      intValue = 831337041
   )
   public int rawWidth;
   @ObfuscatedName("bt")
   @ObfuscatedGetter(
      intValue = -528779911
   )
   public int rawHeight;
   @ObfuscatedName("bu")
   @ObfuscatedGetter(
      intValue = 461131859
   )
   public int x;
   @ObfuscatedName("by")
   @ObfuscatedGetter(
      intValue = -83475937
   )
   public int y;
   @ObfuscatedName("bh")
   @ObfuscatedGetter(
      intValue = -1042121905
   )
   public int width;
   @ObfuscatedName("bz")
   @ObfuscatedGetter(
      intValue = 809475179
   )
   public int height;
   @ObfuscatedName("bc")
   @ObfuscatedGetter(
      intValue = -1694415347
   )
   public int field3770;
   @ObfuscatedName("bs")
   @ObfuscatedGetter(
      intValue = 1759456687
   )
   public int field3677;
   @ObfuscatedName("bx")
   @ObfuscatedGetter(
      intValue = 1196232189
   )
   public int parentId;
   @ObfuscatedName("bb")
   public boolean isHidden;
   @ObfuscatedName("bk")
   @ObfuscatedGetter(
      intValue = -560807423
   )
   public int scrollX;
   @ObfuscatedName("br")
   @ObfuscatedGetter(
      intValue = 1577224389
   )
   public int scrollY;
   @ObfuscatedName("bq")
   @ObfuscatedGetter(
      intValue = -1314049341
   )
   public int scrollWidth;
   @ObfuscatedName("cf")
   @ObfuscatedGetter(
      intValue = -306771027
   )
   public int scrollHeight;
   @ObfuscatedName("cg")
   @ObfuscatedGetter(
      intValue = -1059264411
   )
   public int color;
   @ObfuscatedName("cv")
   @ObfuscatedGetter(
      intValue = -1657416623
   )
   public int color2;
   @ObfuscatedName("cx")
   @ObfuscatedGetter(
      intValue = 1526854807
   )
   public int mouseOverColor;
   @ObfuscatedName("cp")
   @ObfuscatedGetter(
      intValue = -1045698937
   )
   public int mouseOverColor2;
   @ObfuscatedName("ce")
   public boolean fill;
   @ObfuscatedName("ci")
   @ObfuscatedSignature(
      descriptor = "Luk;"
   )
   public FillMode fillMode;
   @ObfuscatedName("ct")
   @ObfuscatedGetter(
      intValue = 1522209559
   )
   public int transparencyTop;
   @ObfuscatedName("cw")
   @ObfuscatedGetter(
      intValue = 307051135
   )
   public int transparencyBot;
   @ObfuscatedName("cq")
   @ObfuscatedGetter(
      intValue = 87841347
   )
   public int lineWid;
   @ObfuscatedName("cl")
   public boolean field3693;
   @ObfuscatedName("cs")
   @ObfuscatedGetter(
      intValue = -1780213167
   )
   public int spriteId2;
   @ObfuscatedName("co")
   @ObfuscatedGetter(
      intValue = -1029572693
   )
   public int spriteId;
   @ObfuscatedName("cm")
   public String field3696;
   @ObfuscatedName("cn")
   @ObfuscatedGetter(
      intValue = -1687935341
   )
   public int spriteAngle;
   @ObfuscatedName("cr")
   public boolean spriteTiling;
   @ObfuscatedName("cj")
   @ObfuscatedGetter(
      intValue = 1017653403
   )
   public int outline;
   @ObfuscatedName("ca")
   @ObfuscatedGetter(
      intValue = -1616413733
   )
   public int spriteShadow;
   @ObfuscatedName("cc")
   public boolean spriteFlipV;
   @ObfuscatedName("cu")
   public boolean spriteFlipH;
   @ObfuscatedName("ch")
   @ObfuscatedGetter(
      intValue = -893635797
   )
   public int modelType;
   @ObfuscatedName("cb")
   @ObfuscatedGetter(
      intValue = 428396117
   )
   public int modelId;
   @ObfuscatedName("cz")
   @ObfuscatedGetter(
      intValue = -1794426991
   )
   int modelType2;
   @ObfuscatedName("cy")
   @ObfuscatedGetter(
      intValue = -827309595
   )
   int modelId2;
   @ObfuscatedName("ck")
   @ObfuscatedGetter(
      intValue = 630720109
   )
   public int sequenceId;
   @ObfuscatedName("cd")
   @ObfuscatedGetter(
      intValue = -1869130737
   )
   public int sequenceId2;
   @ObfuscatedName("dt")
   @ObfuscatedGetter(
      intValue = 688173561
   )
   public int modelOffsetX;
   @ObfuscatedName("di")
   @ObfuscatedGetter(
      intValue = 1145081837
   )
   public int modelOffsetY;
   @ObfuscatedName("dk")
   @ObfuscatedGetter(
      intValue = 1017197481
   )
   public int modelAngleX;
   @ObfuscatedName("dd")
   @ObfuscatedGetter(
      intValue = -99225189
   )
   public int modelAngleY;
   @ObfuscatedName("dx")
   @ObfuscatedGetter(
      intValue = -1181837059
   )
   public int modelAngleZ;
   @ObfuscatedName("dh")
   @ObfuscatedGetter(
      intValue = -91805539
   )
   public int modelZoom;
   @ObfuscatedName("du")
   @ObfuscatedGetter(
      intValue = 335565589
   )
   public int field3684;
   @ObfuscatedName("dg")
   @ObfuscatedGetter(
      intValue = -1825252653
   )
   public int field3716;
   @ObfuscatedName("dc")
   @ObfuscatedSignature(
      descriptor = "Lnb;"
   )
   public PlayerComposition field3717;
   @ObfuscatedName("do")
   public boolean modelOrthog;
   @ObfuscatedName("db")
   public boolean modelTransparency;
   @ObfuscatedName("dm")
   @ObfuscatedGetter(
      intValue = -126179905
   )
   public int itemQuantityMode;
   @ObfuscatedName("dr")
   @ObfuscatedGetter(
      intValue = 670283109
   )
   public int fontId;
   @ObfuscatedName("ds")
   public String text;
   @ObfuscatedName("da")
   public String text2;
   @ObfuscatedName("dw")
   @ObfuscatedGetter(
      intValue = 1443424643
   )
   public int textLineHeight;
   @ObfuscatedName("dp")
   @ObfuscatedGetter(
      intValue = 498505029
   )
   public int textXAlignment;
   @ObfuscatedName("df")
   @ObfuscatedGetter(
      intValue = -1443148029
   )
   public int textYAlignment;
   @ObfuscatedName("dv")
   public boolean textShadowed;
   @ObfuscatedName("dz")
   @ObfuscatedSignature(
      descriptor = "Lic;"
   )
   class208 field3678;
   @ObfuscatedName("dl")
   @ObfuscatedGetter(
      intValue = -1977513085
   )
   int field3729;
   @ObfuscatedName("de")
   HashMap field3730;
   @ObfuscatedName("dn")
   HashMap field3661;
   @ObfuscatedName("dj")
   @ObfuscatedSignature(
      descriptor = "Lnq;"
   )
   class339 field3732;
   @ObfuscatedName("dy")
   @ObfuscatedGetter(
      intValue = 1749722981
   )
   public int flags;
   @ObfuscatedName("ec")
   public boolean field3734;
   @ObfuscatedName("ew")
   public byte[][] field3735;
   @ObfuscatedName("ex")
   public byte[][] field3704;
   @ObfuscatedName("ev")
   public int[] field3672;
   @ObfuscatedName("ek")
   public int[] field3756;
   @ObfuscatedName("es")
   public String dataText;
   @ObfuscatedName("ea")
   public String[] actions;
   @ObfuscatedName("en")
   @ObfuscatedSignature(
      descriptor = "Lnn;"
   )
   public Widget parent;
   @ObfuscatedName("eh")
   @ObfuscatedGetter(
      intValue = 1621194617
   )
   public int dragZoneSize;
   @ObfuscatedName("ei")
   @ObfuscatedGetter(
      intValue = -1891288423
   )
   public int dragThreshold;
   @ObfuscatedName("et")
   public boolean isScrollBar;
   @ObfuscatedName("er")
   public String spellActionName;
   @ObfuscatedName("ez")
   public boolean hasListener;
   @ObfuscatedName("eu")
   public Object[] onLoad;
   @ObfuscatedName("eg")
   public Object[] onClick;
   @ObfuscatedName("ey")
   public Object[] onClickRepeat;
   @ObfuscatedName("eb")
   public Object[] onRelease;
   @ObfuscatedName("ed")
   public Object[] onHold;
   @ObfuscatedName("eq")
   public Object[] onMouseOver;
   @ObfuscatedName("ee")
   public Object[] onMouseRepeat;
   @ObfuscatedName("ej")
   public Object[] onMouseLeave;
   @ObfuscatedName("ep")
   public Object[] onDrag;
   @ObfuscatedName("fd")
   public Object[] onDragComplete;
   @ObfuscatedName("fm")
   public Object[] onTargetEnter;
   @ObfuscatedName("fa")
   public Object[] onTargetLeave;
   @ObfuscatedName("fq")
   public Object[] onVarTransmit;
   @ObfuscatedName("fe")
   public int[] varTransmitTriggers;
   @ObfuscatedName("ff")
   public Object[] onInvTransmit;
   @ObfuscatedName("fb")
   public int[] invTransmitTriggers;
   @ObfuscatedName("fr")
   public Object[] onStatTransmit;
   @ObfuscatedName("fi")
   public int[] statTransmitTriggers;
   @ObfuscatedName("fo")
   public Object[] onTimer;
   @ObfuscatedName("fw")
   public Object[] onOp;
   @ObfuscatedName("fj")
   public Object[] field3648;
   @ObfuscatedName("fh")
   public Object[] onScroll;
   @ObfuscatedName("fg")
   public Object[] onChatTransmit;
   @ObfuscatedName("fl")
   public Object[] onKey;
   @ObfuscatedName("fs")
   public Object[] field3771;
   @ObfuscatedName("ft")
   public Object[] field3772;
   @ObfuscatedName("fv")
   public Object[] onFriendTransmit;
   @ObfuscatedName("fp")
   public Object[] onClanTransmit;
   @ObfuscatedName("fk")
   public Object[] field3676;
   @ObfuscatedName("fz")
   public Object[] field3776;
   @ObfuscatedName("fx")
   public Object[] onMiscTransmit;
   @ObfuscatedName("fu")
   public Object[] onDialogAbort;
   @ObfuscatedName("fy")
   public Object[] onSubChange;
   @ObfuscatedName("fn")
   public Object[] onResize;
   @ObfuscatedName("fc")
   public Object[] onStockTransmit;
   @ObfuscatedName("gm")
   public Object[] field3782;
   @ObfuscatedName("gw")
   public Object[] field3783;
   @ObfuscatedName("gl")
   public int[][] cs1Instructions;
   @ObfuscatedName("ge")
   public int[] cs1Comparisons;
   @ObfuscatedName("gs")
   public int[] cs1ComparisonValues;
   @ObfuscatedName("gi")
   @ObfuscatedGetter(
      intValue = -2125883859
   )
   public int mouseOverRedirect;
   @ObfuscatedName("gp")
   public String spellName;
   @ObfuscatedName("gq")
   public String buttonText;
   @ObfuscatedName("gn")
   public int[] itemIds;
   @ObfuscatedName("gb")
   public int[] itemQuantities;
   @ObfuscatedName("gu")
   @ObfuscatedGetter(
      intValue = 1760219883
   )
   public int itemId;
   @ObfuscatedName("ga")
   @ObfuscatedGetter(
      intValue = 756629683
   )
   public int itemQuantity;
   @ObfuscatedName("gf")
   @ObfuscatedGetter(
      intValue = 1041568375
   )
   public int modelFrame;
   @ObfuscatedName("gx")
   @ObfuscatedGetter(
      intValue = 1736395543
   )
   public int modelFrameCycle;
   @ObfuscatedName("gz")
   @ObfuscatedSignature(
      descriptor = "[Lnn;"
   )
   public Widget[] children;
   @ObfuscatedName("gt")
   public boolean containsMouse;
   @ObfuscatedName("gg")
   public boolean field3798;
   @ObfuscatedName("gj")
   @ObfuscatedGetter(
      intValue = -907772875
   )
   public int field3799;
   @ObfuscatedName("gy")
   @ObfuscatedGetter(
      intValue = -841827367
   )
   public int field3800;
   @ObfuscatedName("gv")
   @ObfuscatedGetter(
      intValue = 951832917
   )
   public int field3801;
   @ObfuscatedName("gc")
   @ObfuscatedGetter(
      intValue = 518710051
   )
   public int field3763;
   @ObfuscatedName("gr")
   @ObfuscatedGetter(
      intValue = -1856912927
   )
   public int rootIndex;
   @ObfuscatedName("gk")
   @ObfuscatedGetter(
      intValue = 960398105
   )
   public int cycle;
   @ObfuscatedName("go")
   public int[] field3805;
   @ObfuscatedName("gh")
   public boolean noClickThrough;
   @ObfuscatedName("gd")
   public boolean noScrollThrough;
   @ObfuscatedName("hb")
   public boolean prioritizeMenuEntry;
   public int rl$x;
   public int rl$y;
   public short forcedX;
   public short forcedY;
   public int rl$parentId;

   static {
      field3656 = false;
      $assertionsDisabled = !Widget.class.desiredAssertionStatus();
   }

   public Widget() {
      this.isIf3 = false;
      this.id = -1;
      this.childIndex = -1;
      this.buttonType = 0;
      this.contentType = 0;
      this.xAlignment = 0;
      this.yAlignment = 0;
      this.widthAlignment = 0;
      this.heightAlignment = 0;
      this.rawX = 0;
      this.rawY = 0;
      this.rawWidth = 0;
      this.rawHeight = 0;
      this.x = 0;
      this.y = 0;
      this.onPositionChanged(-1);
      this.width = 0;
      this.height = 0;
      this.field3770 = 1;
      this.field3677 = 1;
      this.parentId = -1;
      this.isHidden = false;
      this.scrollX = 0;
      this.scrollY = 0;
      this.scrollWidth = 0;
      this.scrollHeight = 0;
      this.color = 0;
      this.color2 = 0;
      this.mouseOverColor = 0;
      this.mouseOverColor2 = 0;
      this.fill = false;
      this.fillMode = FillMode.SOLID;
      this.transparencyTop = 0;
      this.transparencyBot = 0;
      this.lineWid = 1;
      this.field3693 = false;
      this.spriteId2 = -1;
      this.spriteId = -1;
      this.spriteAngle = 0;
      this.spriteTiling = false;
      this.outline = 0;
      this.spriteShadow = 0;
      this.modelType = 1;
      this.modelId = -1;
      this.modelType2 = 1;
      this.modelId2 = -1;
      this.sequenceId = -1;
      this.sequenceId2 = -1;
      this.modelOffsetX = 0;
      this.modelOffsetY = 0;
      this.modelAngleX = 0;
      this.modelAngleY = 0;
      this.modelAngleZ = 0;
      this.modelZoom = 100;
      this.field3684 = 0;
      this.field3716 = 0;
      this.modelOrthog = false;
      this.modelTransparency = false;
      this.itemQuantityMode = 2;
      this.fontId = -1;
      this.text = "";
      this.text2 = "";
      this.textLineHeight = 0;
      this.textXAlignment = 0;
      this.textYAlignment = 0;
      this.textShadowed = false;
      this.field3729 = -1;
      this.flags = 0;
      this.field3734 = false;
      this.dataText = "";
      this.parent = null;
      this.dragZoneSize = 0;
      this.dragThreshold = 0;
      this.isScrollBar = false;
      this.spellActionName = "";
      this.hasListener = false;
      this.mouseOverRedirect = -1;
      this.spellName = "";
      this.buttonText = "Ok";
      this.itemId = -1;
      this.itemQuantity = 0;
      this.modelFrame = 0;
      this.modelFrameCycle = 0;
      this.containsMouse = false;
      this.field3798 = false;
      this.field3799 = -1;
      this.field3800 = 0;
      this.field3801 = 0;
      this.field3763 = 0;
      this.rootIndex = -1;
      this.cycle = -1;
      this.onCycle(-1);
      this.noClickThrough = false;
      this.noScrollThrough = false;
      this.prioritizeMenuEntry = false;
      this.rl$$init();
   }

   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "(Luj;I)V",
      garbageValue = "1076912273"
   )
   void method6658(Buffer var1) {
      this.isIf3 = false;
      this.type = var1.readUnsignedByte_base();
      this.buttonType = var1.readUnsignedByte_base();
      this.contentType = var1.readUnsignedShort_base();
      this.rawX = var1.readShort_base();
      this.rawY = var1.readShort_base();
      this.rawWidth = var1.readUnsignedShort_base();
      this.rawHeight = var1.readUnsignedShort_base();
      this.transparencyTop = var1.readUnsignedByte_base();
      this.parentId = var1.readUnsignedShort_base();
      if(this.parentId == 65535) {
         this.parentId = -1;
      } else {
         this.parentId += this.id & -65536;
      }

      this.mouseOverRedirect = var1.readUnsignedShort_base();
      if(this.mouseOverRedirect == 65535) {
         this.mouseOverRedirect = -1;
      }

      int var2 = var1.readUnsignedByte_base();
      int var3;
      if(var2 > 0) {
         this.cs1Comparisons = new int[var2];
         this.cs1ComparisonValues = new int[var2];

         for(var3 = 0; var3 < var2; ++var3) {
            this.cs1Comparisons[var3] = var1.readUnsignedByte_base();
            this.cs1ComparisonValues[var3] = var1.readUnsignedShort_base();
         }
      }

      var3 = var1.readUnsignedByte_base();
      int var4;
      if(var3 > 0) {
         this.cs1Instructions = new int[var3][];

         for(var4 = 0; var4 < var3; ++var4) {
            int var5 = var1.readUnsignedShort_base();
            this.cs1Instructions[var4] = new int[var5];

            for(int var6 = 0; var6 < var5; ++var6) {
               this.cs1Instructions[var4][var6] = var1.readUnsignedShort_base();
               if(this.cs1Instructions[var4][var6] == 65535) {
                  this.cs1Instructions[var4][var6] = -1;
               }
            }
         }
      }

      if(this.type == 0) {
         this.scrollHeight = var1.readUnsignedShort_base();
         this.isHidden = var1.readUnsignedByte_base() == 1;
      }

      if(this.type == 1) {
         var1.readUnsignedShort_base();
         var1.readUnsignedByte_base();
      }

      if(this.type == 3) {
         this.fill = var1.readUnsignedByte_base() == 1;
      }

      if(this.type == 4 || this.type == 1) {
         this.textXAlignment = var1.readUnsignedByte_base();
         this.textYAlignment = var1.readUnsignedByte_base();
         this.textLineHeight = var1.readUnsignedByte_base();
         this.fontId = var1.readUnsignedShort_base();
         if(this.fontId == 65535) {
            this.fontId = -1;
         }

         this.textShadowed = var1.readUnsignedByte_base() == 1;
      }

      if(this.type == 4) {
         this.text = var1.readStringCp1252NullTerminated_base();
         this.text2 = var1.readStringCp1252NullTerminated_base();
      }

      if(this.type == 1 || this.type == 3 || this.type == 4) {
         this.color = var1.readInt_base();
      }

      if(this.type == 3 || this.type == 4) {
         this.color2 = var1.readInt_base();
         this.mouseOverColor = var1.readInt_base();
         this.mouseOverColor2 = var1.readInt_base();
      }

      if(this.type == 5) {
         this.spriteId2 = var1.readInt_base();
         this.spriteId = var1.readInt_base();
      }

      if(this.type == 6) {
         this.modelType = 1;
         this.modelId = var1.readUnsignedShort_base();
         if(this.modelId == 65535) {
            this.modelId = -1;
         }

         this.modelType2 = 1;
         this.modelId2 = var1.readUnsignedShort_base();
         if(this.modelId2 == 65535) {
            this.modelId2 = -1;
         }

         this.sequenceId = var1.readUnsignedShort_base();
         if(this.sequenceId == 65535) {
            this.sequenceId = -1;
         }

         this.sequenceId2 = var1.readUnsignedShort_base();
         if(this.sequenceId2 == 65535) {
            this.sequenceId2 = -1;
         }

         this.modelZoom = var1.readUnsignedShort_base();
         this.modelAngleX = var1.readUnsignedShort_base();
         this.modelAngleY = var1.readUnsignedShort_base();
      }

      if(this.type == 8) {
         this.text = var1.readStringCp1252NullTerminated_base();
      }

      if(this.buttonType == 2) {
         this.spellActionName = var1.readStringCp1252NullTerminated_base();
         this.spellName = var1.readStringCp1252NullTerminated_base();
         var4 = var1.readUnsignedShort_base() & 63;
         this.flags |= var4 << 11;
      }

      if(this.buttonType == 1 || this.buttonType == 4 || this.buttonType == 5 || this.buttonType == 6) {
         this.buttonText = var1.readStringCp1252NullTerminated_base();
         if(this.buttonText.length() == 0) {
            if(this.buttonType == 1) {
               this.buttonText = "Ok";
            }

            if(this.buttonType == 4) {
               this.buttonText = "Select";
            }

            if(this.buttonType == 5) {
               this.buttonText = "Select";
            }

            if(this.buttonType == 6) {
               this.buttonText = "Continue";
            }
         }
      }

      if(this.buttonType == 1 || this.buttonType == 4 || this.buttonType == 5) {
         this.flags |= 4194304;
      }

      if(this.buttonType == 6) {
         this.flags |= 1;
      }

   }

   @ObfuscatedName("ah")
   @ObfuscatedSignature(
      descriptor = "(Luj;I)V",
      garbageValue = "167197032"
   )
   void method6659(Buffer var1) {
      var1.readUnsignedByte_base();
      this.isIf3 = true;
      this.type = var1.readUnsignedByte_base();
      this.contentType = var1.readUnsignedShort_base();
      this.rawX = var1.readShort_base();
      this.rawY = var1.readShort_base();
      this.rawWidth = var1.readUnsignedShort_base();
      if(this.type == 9) {
         this.rawHeight = var1.readShort_base();
      } else {
         this.rawHeight = var1.readUnsignedShort_base();
      }

      this.widthAlignment = var1.readByte_base();
      this.heightAlignment = var1.readByte_base();
      this.xAlignment = var1.readByte_base();
      this.yAlignment = var1.readByte_base();
      this.parentId = var1.readUnsignedShort_base();
      if(this.parentId == 65535) {
         this.parentId = -1;
      } else {
         this.parentId += this.id & -65536;
      }

      this.isHidden = var1.readUnsignedByte_base() == 1;
      if(this.type == 0) {
         this.scrollWidth = var1.readUnsignedShort_base();
         this.scrollHeight = var1.readUnsignedShort_base();
         this.noClickThrough = var1.readUnsignedByte_base() == 1;
      }

      if(this.type == 5) {
         this.spriteId2 = var1.readInt_base();
         this.spriteAngle = var1.readUnsignedShort_base();
         this.spriteTiling = var1.readUnsignedByte_base() == 1;
         this.transparencyTop = var1.readUnsignedByte_base();
         this.outline = var1.readUnsignedByte_base();
         this.spriteShadow = var1.readInt_base();
         this.spriteFlipV = var1.readUnsignedByte_base() == 1;
         this.spriteFlipH = var1.readUnsignedByte_base() == 1;
      }

      if(this.type == 6) {
         this.modelType = 1;
         this.modelId = var1.readUnsignedShort_base();
         if(this.modelId == 65535) {
            this.modelId = -1;
         }

         this.modelOffsetX = var1.readShort_base();
         this.modelOffsetY = var1.readShort_base();
         this.modelAngleX = var1.readUnsignedShort_base();
         this.modelAngleY = var1.readUnsignedShort_base();
         this.modelAngleZ = var1.readUnsignedShort_base();
         this.modelZoom = var1.readUnsignedShort_base();
         this.sequenceId = var1.readUnsignedShort_base();
         if(this.sequenceId == 65535) {
            this.sequenceId = -1;
         }

         this.modelOrthog = var1.readUnsignedByte_base() == 1;
         var1.readUnsignedShort_base();
         if(this.widthAlignment != 0) {
            this.field3684 = var1.readUnsignedShort_base();
         }

         if(this.heightAlignment != 0) {
            var1.readUnsignedShort_base();
         }
      }

      if(this.type == 4) {
         this.fontId = var1.readUnsignedShort_base();
         if(this.fontId == 65535) {
            this.fontId = -1;
         }

         this.text = var1.readStringCp1252NullTerminated_base();
         this.textLineHeight = var1.readUnsignedByte_base();
         this.textXAlignment = var1.readUnsignedByte_base();
         this.textYAlignment = var1.readUnsignedByte_base();
         this.textShadowed = var1.readUnsignedByte_base() == 1;
         this.color = var1.readInt_base();
      }

      if(this.type == 3) {
         this.color = var1.readInt_base();
         this.fill = var1.readUnsignedByte_base() == 1;
         this.transparencyTop = var1.readUnsignedByte_base();
      }

      if(this.type == 9) {
         this.lineWid = var1.readUnsignedByte_base();
         this.color = var1.readInt_base();
         this.field3693 = var1.readUnsignedByte_base() == 1;
      }

      this.flags = var1.readUnsignedMedium_base();
      this.dataText = var1.readStringCp1252NullTerminated_base();
      int var2 = var1.readUnsignedByte_base();
      if(var2 > 0) {
         this.actions = new String[var2];

         for(int var3 = 0; var3 < var2; ++var3) {
            this.actions[var3] = var1.readStringCp1252NullTerminated_base();
         }
      }

      this.dragZoneSize = var1.readUnsignedByte_base();
      this.dragThreshold = var1.readUnsignedByte_base();
      this.isScrollBar = var1.readUnsignedByte_base() == 1;
      this.spellActionName = var1.readStringCp1252NullTerminated_base();
      this.onLoad = this.method6785(var1);
      this.onMouseOver = this.method6785(var1);
      this.onMouseLeave = this.method6785(var1);
      this.onTargetLeave = this.method6785(var1);
      this.onTargetEnter = this.method6785(var1);
      this.onVarTransmit = this.method6785(var1);
      this.onInvTransmit = this.method6785(var1);
      this.onStatTransmit = this.method6785(var1);
      this.onTimer = this.method6785(var1);
      this.onOp = this.method6785(var1);
      this.onMouseRepeat = this.method6785(var1);
      this.onClick = this.method6785(var1);
      this.onClickRepeat = this.method6785(var1);
      this.onRelease = this.method6785(var1);
      this.onHold = this.method6785(var1);
      this.onDrag = this.method6785(var1);
      this.onDragComplete = this.method6785(var1);
      this.onScroll = this.method6785(var1);
      this.varTransmitTriggers = this.method6662(var1);
      this.invTransmitTriggers = this.method6662(var1);
      this.statTransmitTriggers = this.method6662(var1);
   }

   @ObfuscatedName("ar")
   @ObfuscatedSignature(
      descriptor = "(Luj;I)V",
      garbageValue = "361710485"
   )
   void method6768(Buffer var1) {
      this.field3660 = var1.readStringCp1252NullTerminated_base();
   }

   @ObfuscatedName("ao")
   @ObfuscatedSignature(
      descriptor = "(Luj;I)[Ljava/lang/Object;",
      garbageValue = "-1864963770"
   )
   Object[] method6785(Buffer var1) {
      int var2 = var1.readUnsignedByte_base();
      if(var2 == 0) {
         return null;
      } else {
         Object[] var3 = new Object[var2];

         for(int var4 = 0; var4 < var2; ++var4) {
            int var5 = var1.readUnsignedByte_base();
            if(var5 == 0) {
               var3[var4] = new Integer(var1.readInt_base());
            } else if(var5 == 1) {
               var3[var4] = var1.readStringCp1252NullTerminated_base();
            }
         }

         this.hasListener = true;
         return var3;
      }
   }

   @ObfuscatedName("ab")
   @ObfuscatedSignature(
      descriptor = "(Luj;I)[I",
      garbageValue = "1916026116"
   )
   int[] method6662(Buffer var1) {
      int var2 = var1.readUnsignedByte_base();
      if(var2 == 0) {
         return null;
      } else {
         int[] var3 = new int[var2];

         for(int var4 = 0; var4 < var2; ++var4) {
            var3[var4] = var1.readInt_base();
         }

         return var3;
      }
   }

   @ObfuscatedName("au")
   @ObfuscatedSignature(
      descriptor = "(Lmr;ZLel;I)Luz;",
      garbageValue = "-1408001366"
   )
   public SpritePixels method6663(WidgetDefinition var1, boolean var2, UrlRequester var3) {
      if(this.getSpriteId() != -1) {
         net.runelite.api.SpritePixels var4 = (net.runelite.api.SpritePixels)Client.widgetSpriteOverrides.get(Integer.valueOf(this.getId()));
         if(var4 != null) {
            return (SpritePixels)((RSSpritePixels)var4);
         }
      }

      return (SpritePixels)this.copy$getSprite(var1, var2, var3, -1408001366);
   }

   @ObfuscatedName("aa")
   @ObfuscatedSignature(
      descriptor = "(Lmr;Lel;I)Luz;",
      garbageValue = "243499919"
   )
   SpritePixels method6664(WidgetDefinition var1, UrlRequester var2) {
      if(!this.method6664_base()) {
         return this.method6665(var1, var2);
      } else {
         String var3 = this.field3696 + (this.spriteFlipV?1:0) + (this.spriteFlipH?1:0) + this.outline + this.spriteShadow;
         SpritePixels var4 = (SpritePixels)var1.field3576.method8022_base(var3);
         if(var4 == null) {
            SpritePixels var5 = this.method6665(var1, var2);
            if(var5 != null) {
               var4 = var5.method9743();
               this.method6667(var4);
               var1.field3576.method8037_base(var3, var4);
            }
         }

         return var4;
      }
   }

   @ObfuscatedName("ac")
   @ObfuscatedSignature(
      descriptor = "(Lmr;Lel;I)Luz;",
      garbageValue = "769156512"
   )
   SpritePixels method6665(WidgetDefinition var1, UrlRequester var2) {
      if(this.field3696 != null && var2 != null) {
         class338 var3 = (class338)var1.field3567.method8022_base(this.field3696);
         if(var3 == null) {
            var3 = new class338(this.field3696, var2);
            var1.field3567.method8037_base(this.field3696, var3);
         }

         return var3.method6309();
      } else {
         return null;
      }
   }

   @ObfuscatedName("al")
   @ObfuscatedSignature(
      descriptor = "(I)Z",
      garbageValue = "623493870"
   )
   boolean method6664_base() {
      return this.spriteFlipV || this.spriteFlipH || this.outline != 0 || this.spriteShadow != 0;
   }

   @ObfuscatedName("az")
   @ObfuscatedSignature(
      descriptor = "(Luz;I)V",
      garbageValue = "-891883391"
   )
   void method6667(SpritePixels var1) {
      if(this.spriteFlipV) {
         var1.flipVertically_base();
      }

      if(this.spriteFlipH) {
         var1.flipHorizontally_base();
      }

      if(this.outline > 0) {
         var1.pad_base(this.outline);
      }

      if(this.outline >= 1) {
         var1.outline_base(1);
      }

      if(this.outline >= 2) {
         var1.outline_base(16777215);
      }

      if(this.spriteShadow != 0) {
         var1.shadow_base(this.spriteShadow);
      }

   }

   @ObfuscatedName("ap")
   @ObfuscatedSignature(
      descriptor = "(Lmr;I)Lpf;",
      garbageValue = "1649883355"
   )
   public Font method6668(WidgetDefinition var1) {
      field3656 = false;
      if(this.fontId == -1) {
         return null;
      } else {
         Font var2 = (Font)var1.Widget_cachedFonts.get((long)this.fontId);
         if(var2 != null) {
            return var2;
         } else {
            AbstractArchive var4 = var1.field3575;
            AbstractArchive var5 = var1.field3563;
            int var6 = this.fontId;
            byte[] var8 = var4.takeFile_base(var6, 0);
            boolean var7;
            if(var8 == null) {
               var7 = false;
            } else {
               class162.SpriteBuffer_decode_base(var8);
               var7 = true;
            }

            Font var3;
            if(!var7) {
               var3 = null;
            } else {
               var3 = WorldMapArea.method4590(var5.takeFile_base(var6, 0));
            }

            if(var3 != null) {
               var1.Widget_cachedFonts.put(var3, (long)this.fontId);
            } else {
               field3656 = true;
            }

            return var3;
         }
      }
   }

   @ObfuscatedName("av")
   @ObfuscatedSignature(
      descriptor = "(Lmr;Lhx;IZLnb;Lhw;Lhf;B)Lka;",
      garbageValue = "52"
   )
   public Model method6669(WidgetDefinition var1, SequenceDefinition var2, int var3, boolean var4, PlayerComposition var5, NPCComposition var6, NpcOverrides var7) {
      if(var3 != -1 && SpriteMask.client.isInterpolateWidgetAnimations()) {
         var3 = var3 | this.getModelFrameCycle() << 16 | Integer.MIN_VALUE;
      }

      return (Model)this.copy$getModel(var1, var2, var3, var4, var5, var6, var7, (byte)52);
   }

   @ObfuscatedName("ax")
   @ObfuscatedSignature(
      descriptor = "(Lmr;ZB)Lme;",
      garbageValue = "4"
   )
   public SpriteMask method6670(WidgetDefinition var1, boolean var2) {
      if(this.spriteId == -1) {
         var2 = false;
      }

      int var3 = var2?this.spriteId:this.spriteId2;
      if(var3 == -1) {
         return null;
      } else {
         long var4 = ((this.spriteFlipH?1L:0L) << 39) + ((this.spriteFlipV?1L:0L) << 38) + (long)var3 + ((long)this.outline << 36) + ((long)this.spriteShadow << 40);
         SpriteMask var6 = (SpriteMask)var1.Widget_cachedSpriteMasks.get(var4);
         if(var6 != null) {
            return var6;
         } else {
            SpritePixels var7 = this.method6663(var1, var2, (UrlRequester)null);
            if(var7 == null) {
               return null;
            } else {
               SpritePixels var8 = var7.method9744();
               int[] var9 = new int[var8.subHeight];
               int[] var10 = new int[var8.subHeight];

               for(int var11 = 0; var11 < var8.subHeight; ++var11) {
                  int var12 = 0;
                  int var13 = var8.subWidth;

                  int var14;
                  for(var14 = 0; var14 < var8.subWidth; ++var14) {
                     if(var8.pixels[var14 + var11 * var8.subWidth] == 0) {
                        var12 = var14;
                        break;
                     }
                  }

                  for(var14 = var8.subWidth - 1; var14 >= var12; --var14) {
                     if(var8.pixels[var14 + var11 * var8.subWidth] == 0) {
                        var13 = var14 + 1;
                        break;
                     }
                  }

                  var9[var11] = var12;
                  var10[var11] = var13 - var12;
               }

               var6 = new SpriteMask(var8.subWidth, var8.subHeight, var10, var9, var3);
               var1.Widget_cachedSpriteMasks.put(var6, var4);
               return var6;
            }
         }
      }
   }

   @ObfuscatedName("as")
   @ObfuscatedSignature(
      descriptor = "(ILjava/lang/String;B)V",
      garbageValue = "-73"
   )
   public void setAction_base(int var1, String var2) {
      if(this.actions == null || this.actions.length <= var1) {
         String[] var3 = new String[var1 + 1];
         if(this.actions != null) {
            for(int var4 = 0; var4 < this.actions.length; ++var4) {
               var3[var4] = this.actions[var4];
            }
         }

         this.actions = var3;
      }

      this.actions[var1] = var2;
   }

   @ObfuscatedName("ay")
   @ObfuscatedSignature(
      descriptor = "(I)Z",
      garbageValue = "101495939"
   )
   public boolean method6708_base() {
      return !this.isIf3 || this.type == 0 || this.type == 11 || this.hasListener || this.contentType == 1338 || this.type == 12;
   }

   @ObfuscatedName("ak")
   @ObfuscatedSignature(
      descriptor = "(B)Z",
      garbageValue = "54"
   )
   public boolean method6771_base() {
      return this.type == 11 || this.type == 12;
   }

   @ObfuscatedName("aj")
   @ObfuscatedSignature(
      descriptor = "(Ljava/lang/String;Lel;J)V"
   )
   public void method6674(String var1, UrlRequester var2, long var3) {
      if(this.type == 11 && -1L != var3) {
         var1 = var1.replaceAll("%userid%", Long.toString(var3));
         this.field3678 = new class208();
         if(!this.field3678.method4161(var1, var2)) {
            this.field3678 = null;
         } else {
            if(this.field3730 == null || this.field3661 == null) {
               this.method6676_base();
            }

         }
      }
   }

   @ObfuscatedName("am")
   @ObfuscatedSignature(
      descriptor = "(Ljava/lang/String;Lel;I)V",
      garbageValue = "-1255401092"
   )
   public void method6675(String var1, UrlRequester var2) {
      if(this.type == 11 && var1 != null) {
         this.field3678 = new class208();
         this.field3678.method4132(var1, var2);
      }
   }

   @ObfuscatedName("aq")
   @ObfuscatedSignature(
      descriptor = "(I)V",
      garbageValue = "1944060082"
   )
   void method6676_base() {
      this.field3730 = new HashMap();
      this.field3661 = new HashMap();
   }

   @ObfuscatedName("ai")
   @ObfuscatedSignature(
      descriptor = "(IIB)V",
      garbageValue = "105"
   )
   public void method6695_base(int var1, int var2) {
      if(this.type == 11) {
         if(this.field3730 == null) {
            this.method6676_base();
         }

         this.field3730.put(Integer.valueOf(var1), Integer.valueOf(var2));
      }
   }

   @ObfuscatedName("aw")
   @ObfuscatedSignature(
      descriptor = "(Ljava/lang/String;IB)V",
      garbageValue = "40"
   )
   public void method6781_base(String var1, int var2) {
      if(this.type == 11) {
         if(this.field3661 == null) {
            this.method6676_base();
         }

         this.field3661.put(var1, Integer.valueOf(var2));
      }
   }

   @ObfuscatedName("ae")
   @ObfuscatedSignature(
      descriptor = "(IIIII)Z",
      garbageValue = "-1885191377"
   )
   public boolean method6723_base(int var1, int var2, int var3, int var4) {
      if(this.type == 11 && this.field3678 != null && this.method6682_base()) {
         var1 -= var3;
         var2 -= var4;
         int var5 = (int)(this.field3678.method4183_base()[0] * (float)this.width);
         int var6 = (int)(this.field3678.method4183_base()[1] * (float)this.height);
         int var7 = var5 + (int)(this.field3678.method4183_base()[2] * (float)this.width);
         int var8 = var6 + (int)(this.field3678.method4183_base()[3] * (float)this.height);
         return var1 >= var5 && var2 >= var6 && var1 < var7 && var2 < var8;
      } else {
         return false;
      }
   }

   @ObfuscatedName("an")
   @ObfuscatedSignature(
      descriptor = "(B)Z",
      garbageValue = "45"
   )
   public boolean method6682_base() {
      return this.field3729 == 2;
   }

   @ObfuscatedName("ag")
   @ObfuscatedSignature(
      descriptor = "(Ljava/lang/String;I)I",
      garbageValue = "-720840753"
   )
   public int method6677_base(String var1) {
      return this.type == 11 && this.field3678 != null && this.method6682_base()?this.field3678.method4114_base(var1):-1;
   }

   @ObfuscatedName("ad")
   @ObfuscatedSignature(
      descriptor = "(Ljava/lang/String;I)Ljava/lang/String;",
      garbageValue = "1149651075"
   )
   public String method6765_base(String var1) {
      return this.type == 11 && this.field3678 != null && this.method6682_base()?this.field3678.method4118_base(var1):null;
   }

   @ObfuscatedName("af")
   @ObfuscatedSignature(
      descriptor = "(I)I",
      garbageValue = "2095276271"
   )
   public int method6681_base() {
      return this.field3661 != null && this.field3661.size() > 0?1:0;
   }

   @ObfuscatedName("be")
   @ObfuscatedSignature(
      descriptor = "(I)I",
      garbageValue = "1126201283"
   )
   public int method6689_base() {
      if(this.type == 11 && this.field3678 != null && this.field3661 != null && !this.field3661.isEmpty()) {
         String var1 = this.field3678.method4121_base();
         return var1 != null && this.field3661.containsKey(this.field3678.method4121_base())?((Integer)this.field3661.get(var1)).intValue():-1;
      } else {
         return -1;
      }
   }

   @ObfuscatedName("bd")
   @ObfuscatedSignature(
      descriptor = "(B)Ljava/lang/String;",
      garbageValue = "81"
   )
   public String method6683_base() {
      if(this.type == 11 && this.field3678 != null) {
         String var1 = this.field3678.method4121_base();
         Iterator var2 = this.field3678.method4123_base().iterator();

         while(var2.hasNext()) {
            class219 var3 = (class219)var2.next();
            String var4 = String.format("%%%S%%", new Object[]{var3.method4251_base()});
            if(var3.vmethod4266_base() == 0) {
               var1.replaceAll(var4, Integer.toString(var3.vmethod4255_base()));
            } else {
               var1.replaceAll(var4, var3.vmethod4250_base());
            }
         }

         return var1;
      } else {
         return null;
      }
   }

   @ObfuscatedName("bl")
   @ObfuscatedSignature(
      descriptor = "(B)[I",
      garbageValue = "-61"
   )
   public int[] method6684_base() {
      if(this.type == 11 && this.field3678 != null) {
         int[] var1 = new int[3];
         int var2 = 0;
         Iterator var3 = this.field3678.method4123_base().iterator();

         while(var3.hasNext()) {
            class219 var4 = (class219)var3.next();
            if(!var4.method4251_base().equals("user_id")) {
               if(var4.vmethod4266_base() != 0) {
                  return null;
               }

               var1[var2++] = var4.vmethod4255_base();
               if(var2 > 3) {
                  return null;
               }
            }
         }

         return var1;
      } else {
         return null;
      }
   }

   @ObfuscatedName("bi")
   @ObfuscatedSignature(
      descriptor = "(Lmr;Lel;I)Z",
      garbageValue = "1588534614"
   )
   public boolean method6677(WidgetDefinition var1, UrlRequester var2) {
      if(this.type == 11 && this.field3678 != null) {
         this.field3678.method4115(var2);
         if(this.field3678.method4124_base() != this.field3729) {
            this.field3729 = this.field3678.method4124_base();
            if(this.field3729 >= 100) {
               return true;
            }

            if(this.field3729 == 2) {
               this.method6688(var1);
               return true;
            }
         }

         return false;
      } else {
         return false;
      }
   }

   @ObfuscatedName("bf")
   @ObfuscatedSignature(
      descriptor = "(Lmr;I)V",
      garbageValue = "1425941595"
   )
   void method6688(WidgetDefinition var1) {
      this.noClickThrough = true;
      ArrayList var2 = this.field3678.method4119_base();
      ArrayList var3 = this.field3678.method4120_base();
      int var4 = var2.size() + var3.size();
      this.children = new Widget[var4];
      int var5 = 0;

      Iterator var6;
      Widget var8;
      for(var6 = var2.iterator(); var6.hasNext(); this.children[var5++] = var8) {
         class214 var7 = (class214)var6.next();
         var8 = class160.method3433(5, this, var5, 0, 0, 0, 0, var7.field2300);
         var8.field3696 = var7.field2303.method2928_base();
         class338 var9 = new class338(var7.field2303);
         var1.field3567.method8037_base(var8.field3696, var9);
      }

      for(var6 = var3.iterator(); var6.hasNext(); this.children[var5++] = var8) {
         class215 var10 = (class215)var6.next();
         var8 = class160.method3433(4, this, var5, 0, 0, 0, 0, var10.field2306);
         var8.text = var10.field2312;
         var8.fontId = ((Integer)this.field3730.get(Integer.valueOf(var10.field2310))).intValue();
         var8.textXAlignment = var10.field2308;
         var8.textYAlignment = var10.field2309;
      }

   }

   @ObfuscatedName("bg")
   @ObfuscatedSignature(
      descriptor = "(I)V",
      garbageValue = "-1475013178"
   )
   public void method6687_base() {
      this.field3732 = new class339();

      for(int var1 = 1; var1 <= 12; ++var1) {
         this.field3732.field3594.method404_base(var1, 0);
      }

      for(char var2 = 0; var2 < ' '; ++var2) {
         this.field3732.field3594.method406_base(var2, 0);
      }

      this.field3732.field3594.method406_base('\u0080', 0);
      this.field3732.field3594.method404_base(82, 2);
      this.field3732.field3594.method404_base(81, 2);
      this.field3732.field3594.method404_base(86, 2);
   }

   @ObfuscatedName("ba")
   @ObfuscatedSignature(
      descriptor = "(I)Lni;",
      garbageValue = "-2105376256"
   )
   public class341 method6688_base() {
      return this.field3732 != null?this.field3732.field3593:null;
   }

   @ObfuscatedName("bm")
   @ObfuscatedSignature(
      descriptor = "(B)Lmp;",
      garbageValue = "-45"
   )
   public class336 method6724_base() {
      return this.field3732 != null?this.field3732.field3589:null;
   }

   @ObfuscatedName("bp")
   @ObfuscatedSignature(
      descriptor = "(I)Lbd;",
      garbageValue = "-210196743"
   )
   public class27 method6690_base() {
      return this.field3732 != null?this.field3732.field3594:null;
   }

   @ObfuscatedName("bw")
   @ObfuscatedSignature(
      descriptor = "(I)Lnq;",
      garbageValue = "1933652600"
   )
   public class339 method6767_base() {
      return this.field3732;
   }

   @ObfuscatedName("bj")
   @ObfuscatedSignature(
      descriptor = "(Lni;I)Z",
      garbageValue = "588474161"
   )
   boolean method6692_base(class341 var1) {
      boolean var2 = false;
      String var5;
      String var6;
      StringBuilder var7;
      int var8;
      int var9;
      int var10;
      char var11;
      String var12;
      if(this.text != null && !this.text.isEmpty()) {
         var6 = this.text;
         var7 = new StringBuilder(var6.length());
         var8 = 0;
         var9 = -1;

         for(var10 = 0; var10 < var6.length(); ++var10) {
            var11 = var6.charAt(var10);
            if(var11 == '<') {
               var7.append(var6.substring(var8, var10));
               var9 = var10;
            } else if(var11 == '>' && var9 != -1) {
               var12 = var6.substring(var9 + 1, var10);
               var9 = -1;
               if(var12.equals("lt")) {
                  var7.append("<");
               } else if(var12.equals("gt")) {
                  var7.append(">");
               } else if(var12.equals("br")) {
                  var7.append("\n");
               }

               var8 = var10 + 1;
            }
         }

         if(var8 < var6.length()) {
            var7.append(var6.substring(var8, var6.length()));
         }

         var5 = var7.toString();
         var2 |= var1.method6363_base(var5);
         this.text = "";
      }

      if(this.text2 != null && !this.text2.isEmpty()) {
         var6 = this.text2;
         var7 = new StringBuilder(var6.length());
         var8 = 0;
         var9 = -1;

         for(var10 = 0; var10 < var6.length(); ++var10) {
            var11 = var6.charAt(var10);
            if(var11 == '<') {
               var7.append(var6.substring(var8, var10));
               var9 = var10;
            } else if(var11 == '>' && var9 != -1) {
               var12 = var6.substring(var9 + 1, var10);
               var9 = -1;
               if(var12.equals("lt")) {
                  var7.append("<");
               } else if(var12.equals("gt")) {
                  var7.append(">");
               } else if(var12.equals("br")) {
                  var7.append("\n");
               }

               var8 = var10 + 1;
            }
         }

         if(var8 < var6.length()) {
            var7.append(var6.substring(var8, var6.length()));
         }

         var5 = var7.toString();
         var2 |= var1.method6364_base(var5);
         this.text2 = "";
      }

      return var2;
   }

   @ObfuscatedName("bn")
   @ObfuscatedSignature(
      descriptor = "(Lmr;B)Z",
      garbageValue = "16"
   )
   public boolean method6695(WidgetDefinition var1) {
      class341 var2 = this.method6688_base();
      if(var2 == null) {
         return false;
      } else {
         boolean var3 = false;
         if(!var2.method6394_base() && this.fontId != -1) {
            int var4 = var2.method6418_base();
            int var5 = var2.method6419_base();
            int var6 = var2.method6416_base();
            int var7 = var2.method6415_base();
            Font var8 = this.method6668(var1);
            if(var8 != null) {
               var3 |= var2.method6433(var8);
               var3 |= this.method6692_base(var2);
               var3 |= var2.method6370_base(var4, var5);
               var3 |= var2.method6385_base(var6, var7);
            }
         } else if(var2.method6394_base()) {
            var3 |= this.method6692_base(var2);
         }

         var2.method6360_base();
         return var3;
      }
   }

   public Rectangle getBounds() {
      Point var1 = this.getCanvasLocation();
      return new Rectangle(var1.getX(), var1.getY(), this.getWidth(), this.getHeight());
   }

   public List getWidgetItems() {
      int[] var1 = this.getItemIds();
      if(var1 == null) {
         return null;
      } else {
         ArrayList var2 = new ArrayList(var1.length);

         for(int var3 = 0; var3 < var1.length; ++var3) {
            if(var1[var3] > 0 && var1[var3] != 6512) {
               WidgetItem var4 = this.getWidgetItem(var3);
               if(var4 != null) {
                  var2.add(var4);
               }
            }
         }

         return var2;
      }
   }

   public RSFont getFont() {
      return this.getRSFont(SpriteMask.client.getWidgetDefinition());
   }

   public String getRSText() {
      return this.text;
   }

   public String getRSName() {
      return this.dataText;
   }

   public String getRSButtonText() {
      return this.buttonText;
   }

   public RSSpritePixels getSprite(RSWidgetDefinition var1, boolean var2, RSUrlRequester var3) {
      return this.method6663((WidgetDefinition)var1, var2, (UrlRequester)var3);
   }

   public int getParentId() {
      if(!$assertionsDisabled && !SpriteMask.client.isClientThread()) {
         throw new AssertionError("getParentId must be called on client thread");
      } else {
         int var1 = this.getRSParentId();
         if(var1 != -1) {
            return var1;
         } else {
            int var2 = this.getId();
            if(WidgetUtil.componentToInterface(var2) == SpriteMask.client.getTopLevelInterfaceId()) {
               return -1;
            } else {
               int var3 = this.rl$parentId;
               if(var3 != -1) {
                  RSNodeHashTable var4 = SpriteMask.client.getComponentTable();
                  WidgetNode var5 = (WidgetNode)var4.get((long)var3);
                  if(var5 != null && var5.getId() == WidgetUtil.componentToInterface(var2)) {
                     return var3;
                  }

                  this.rl$parentId = -1;
               }

               int var13 = WidgetUtil.componentToInterface(this.getId());
               RSNodeHashTable var14 = SpriteMask.client.getComponentTable();
               RSNode[] var6 = var14.getBuckets();
               RSNode[] var7 = var6;
               int var8 = var6.length;

               for(int var9 = 0; var9 < var8; ++var9) {
                  RSNode var10 = var7[var9];

                  for(Object var11 = var10.getNext(); var11 != var10; var11 = ((net.runelite.api.Node)var11).getNext()) {
                     WidgetNode var12 = (WidgetNode)var11;
                     if(var13 == var12.getId()) {
                        return (int)var12.getHash();
                     }
                  }
               }

               return -1;
            }
         }
      }
   }

   public Point getCanvasLocation() {
      return new Point(this.rl$x, this.rl$y);
   }

   public RSWidget setOriginalX(int var1) {
      this.rawX = var1;
      return this;
   }

   public RSWidget setOriginalWidth(int var1) {
      this.rawWidth = var1;
      return this;
   }

   public int[] getItemIds() {
      return this.itemIds;
   }

   public net.runelite.api.widgets.Widget[] getDynamicChildren() {
      RSWidget[] var1 = this.getChildren();
      if(var1 == null) {
         return new net.runelite.api.widgets.Widget[0];
      } else {
         ArrayList var2 = new ArrayList();
         RSWidget[] var3 = var1;
         int var4 = var1.length;

         for(int var5 = 0; var5 < var4; ++var5) {
            RSWidget var6 = var3[var5];
            if(var6 != null && var6.getRSParentId() == this.getId()) {
               var2.add(var6);
            }
         }

         return (net.runelite.api.widgets.Widget[])var2.toArray(new net.runelite.api.widgets.Widget[var2.size()]);
      }
   }

   public int getSpriteId() {
      return this.spriteId2;
   }

   public RSWidget[] getChildren() {
      return this.children;
   }

   public int getRSParentId() {
      return this.parentId;
   }

   public int getId() {
      return this.id;
   }

   public void setRSName(String var1) {
      this.dataText = var1;
   }

   @ObfuscatedSignature(
      descriptor = "(Lmr;Lhx;IZLnb;Lhw;Lhf;B)Lka;",
      garbageValue = "52"
   )
   public Model copy$getModel(WidgetDefinition var1, SequenceDefinition var2, int var3, boolean var4, PlayerComposition var5, NPCComposition var6, NpcOverrides var7, byte var8) {
      field3656 = false;
      int var9;
      int var10;
      if(var4) {
         var9 = this.modelType2;
         var10 = this.modelId2;
      } else {
         var9 = this.modelType;
         var10 = this.modelId;
      }

      if(var9 == 6) {
         if(var6 == null) {
            return null;
         }

         var10 = var6.id;
      }

      if(var9 == 0) {
         return null;
      } else if(var9 == 1 && var10 == -1) {
         return null;
      } else {
         if(var7 != null && var7.useLocalPlayer && var9 == 6) {
            var9 = 3;
         }

         long var11 = (long)(var10 + (var9 << 16));
         if(var7 != null) {
            var11 |= var7.field1917 << 20;
         }

         Model var13 = (Model)var1.Widget_cachedModels.get(var11);
         if(var13 == null) {
            ModelData var14 = null;
            int var15 = 64;
            int var16 = 768;
            switch(var9) {
            case 1:
               var14 = ModelData.method5100(var1.field3565, var10, 0);
               break;
            case 2:
               var14 = VerticalAlignment.method3757(var10).method3696((NpcOverrides)null);
               break;
            case 3:
               var14 = var5 != null?var5.method6347():null;
               break;
            case 4:
               ItemComposition var17 = class214.method4226(var10);
               var14 = var17.method3955(10);
               var15 += var17.ambient;
               var16 += var17.contrast;
            case 5:
            default:
               break;
            case 6:
               var14 = VerticalAlignment.method3757(var10).method3696(var7);
            }

            if(var14 == null) {
               field3656 = true;
               return null;
            }

            var13 = var14.method5122(var15, var16, -50, -10, -50);
            var1.Widget_cachedModels.put(var13, var11);
         }

         if(var2 != null) {
            var13 = var2.method4041(var13, var3);
         }

         return var13;
      }
   }

   public RSWidget setOriginalY(int var1) {
      this.rawY = var1;
      return this;
   }

   public RSWidget setOriginalHeight(int var1) {
      this.rawHeight = var1;
      return this;
   }

   public boolean isSelfHidden() {
      return this.isHidden;
   }

   public RSFont getRSFont(RSWidgetDefinition var1) {
      return this.method6668((WidgetDefinition)var1);
   }

   public void setRelativeX(int var1) {
      this.x = var1;
   }

   public void setRelativeY(int var1) {
      this.y = var1;
   }

   @ObfuscatedSignature(
      descriptor = "(Lmr;ZLel;I)Luz;",
      garbageValue = "-1408001366"
   )
   public SpritePixels copy$getSprite(WidgetDefinition var1, boolean var2, UrlRequester var3, int var4) {
      field3656 = false;
      if(this.field3696 != null) {
         SpritePixels var5 = this.method6664(var1, var3);
         if(var5 != null) {
            return var5;
         }
      }

      int var9;
      if(var2) {
         var9 = this.spriteId;
      } else {
         var9 = this.spriteId2;
      }

      if(var9 == -1) {
         return null;
      } else {
         long var6 = ((long)this.spriteShadow << 40) + ((this.spriteFlipH?1L:0L) << 39) + ((this.spriteFlipV?1L:0L) << 38) + ((long)this.outline << 36) + (long)var9;
         SpritePixels var8 = (SpritePixels)var1.Widget_cachedSprites.get(var6);
         if(var8 != null) {
            return var8;
         } else {
            var8 = IgnoreList.method8066(var1.field3575, var9, 0);
            if(var8 == null) {
               field3656 = true;
               return null;
            } else {
               this.method6667(var8);
               var1.Widget_cachedSprites.put(var8, var6);
               return var8;
            }
         }
      }
   }

   public RSWidget setXPositionMode(int var1) {
      this.xAlignment = var1;
      return this;
   }

   public RSWidget setWidthMode(int var1) {
      this.widthAlignment = var1;
      return this;
   }

   public int getWidth() {
      return this.width;
   }

   public int getModelFrameCycle() {
      return this.modelFrameCycle;
   }

   public void setItemIds(int[] var1) {
      this.itemIds = var1;
   }

   public net.runelite.api.widgets.Widget getParent() {
      int var1 = this.getParentId();
      return var1 == -1?null:SpriteMask.client.getWidget(var1);
   }

   public RSWidget setYPositionMode(int var1) {
      this.yAlignment = var1;
      return this;
   }

   public RSWidget setHeightMode(int var1) {
      this.heightAlignment = var1;
      return this;
   }

   public int getHeight() {
      return this.height;
   }

   public WidgetItem getWidgetItem(int var1) {
      net.runelite.api.widgets.Widget var2 = this.getDynamicChildren()[var1];
      boolean var3 = var2.isWidgetItemDragged(var1);
      int var4 = 0;
      int var5 = 0;
      if(var3) {
         Point var6 = var2.getWidgetItemDragOffsets();
         var4 = var6.getX();
         var5 = var6.getY();
      }

      Rectangle var8 = var2.getBounds();
      var8.setBounds(var8.x - 1, var8.y - 1, 32, 32);
      Rectangle var7 = var2.getBounds();
      var7.setBounds(var4 + var8.x, var5 + var8.y, 32, 32);
      return new WidgetItem(var2.getItemId(), var2.getItemQuantity(), var1, var8, var2, var7);
   }

   public net.runelite.api.widgets.Widget[] getNestedChildren() {
      if(!$assertionsDisabled && !SpriteMask.client.isClientThread()) {
         throw new AssertionError("getNestedChildren must be called on client thread");
      } else if(this.getRSParentId() == this.getId()) {
         return new net.runelite.api.widgets.Widget[0];
      } else {
         RSNodeHashTable var1 = SpriteMask.client.getComponentTable();
         WidgetNode var2 = (WidgetNode)var1.get((long)this.getId());
         if(var2 == null) {
            return new Widget[0];
         } else {
            int var3 = var2.getId();
            ArrayList var4 = new ArrayList();
            RSWidget[] var5 = SpriteMask.client.getGroup(var3);
            int var6 = var5.length;

            for(int var7 = 0; var7 < var6; ++var7) {
               RSWidget var8 = var5[var7];
               if(var8 != null && var8.getRSParentId() == -1) {
                  var4.add(var8);
               }
            }

            return (net.runelite.api.widgets.Widget[])var4.toArray(new Widget[var4.size()]);
         }
      }
   }

   @ObfuscatedSignature(
      descriptor = "(I)V",
      garbageValue = "-1"
   )
   public void onPositionChanged(int var1) {
      int var2 = this.getId();
      if(var2 != -1) {
         int var3 = SpriteMask.client.getGameCycle();
         if(var3 != rl$widgetLastPosChanged) {
            rl$widgetLastPosChanged = var3;
            SpriteMask.client.getLogger().trace("Posting widget position changed");
            WidgetPositioned var4 = WidgetPositioned.INSTANCE;
            SpriteMask.client.getCallbacks().postDeferred(var4);
         }
      }
   }

   public void setChildren(net.runelite.api.widgets.Widget[] var1) {
      this.children = (Widget[])var1;
   }

   @ObfuscatedSignature(
      descriptor = "(I)V",
      garbageValue = "-1"
   )
   public void onCycle(int var1) {
      net.runelite.api.widgets.Widget[] var2 = this.getDynamicChildren();
      int[] var3 = new int[var2.length];

      for(int var4 = 0; var4 < var2.length; ++var4) {
         net.runelite.api.widgets.Widget var5 = var2[var4];
         int var6 = var5.getItemId();
         if(var6 != -1) {
            var3[var4] = var6;
         }
      }

      if(var3 != null) {
         this.setItemIds(var3);
      }
   }

   private void rl$$init() {
      this.rl$parentId = -1;
      this.rl$x = -1;
      this.rl$y = -1;
      this.forcedX = -1;
      this.forcedY = -1;
   }

   public void broadcastHidden(boolean var1) {
      WidgetHiddenChanged var2 = new WidgetHiddenChanged();
      var2.setWidget(this);
      var2.setHidden(var1);
      SpriteMask.client.getCallbacks().post(var2);
      RSWidget[] var3 = this.getChildren();
      int var6;
      if(var3 != null) {
         RSWidget[] var4 = var3;
         int var5 = var3.length;

         for(var6 = 0; var6 < var5; ++var6) {
            RSWidget var7 = var4[var6];
            if(var7 != null && !var7.isSelfHidden()) {
               var7.broadcastHidden(var1);
            }
         }
      }

      net.runelite.api.widgets.Widget[] var11 = this.getNestedChildren();
      net.runelite.api.widgets.Widget[] var9 = var11;
      var6 = var11.length;

      for(int var10 = 0; var10 < var6; ++var10) {
         net.runelite.api.widgets.Widget var8 = var9[var10];
         if(var8 != null && !var8.isSelfHidden()) {
            ((RSWidget)var8).broadcastHidden(var1);
         }
      }

   }

   public void setRenderParentId(int var1) {
      this.rl$parentId = var1;
   }

   public void setRenderX(int var1) {
      this.rl$x = var1;
   }

   public void setRenderY(int var1) {
      this.rl$y = var1;
   }

   public String getButtonText() {
      return this.getRSButtonText().replace(' ', ' ');
   }

   public String getText() {
      return this.getRSText().replace(' ', ' ');
   }

   public String getName() {
      return this.getRSName().replace(' ', ' ');
   }

   public net.runelite.api.widgets.Widget setName(String var1) {
      this.setRSName(var1.replace(' ', ' '));
      return this;
   }

   public boolean isHidden() {
      if(!$assertionsDisabled && !SpriteMask.client.isClientThread()) {
         throw new AssertionError("isHidden must be called on client thread");
      } else if(this.isSelfHidden()) {
         return true;
      } else {
         net.runelite.api.widgets.Widget var1 = this.getParent();
         return var1 == null?WidgetUtil.componentToInterface(this.getId()) != SpriteMask.client.getTopLevelInterfaceId():var1.isHidden();
      }
   }

   public net.runelite.api.widgets.Widget getChild(int var1) {
      if(var1 == -1) {
         return this;
      } else {
         RSWidget[] var2 = this.getChildren();
         return var2 != null && var2[var1] != null?var2[var1]:null;
      }
   }

   public net.runelite.api.widgets.Widget[] getStaticChildren() {
      if(this.getRSParentId() == this.getId()) {
         return new net.runelite.api.widgets.Widget[0];
      } else {
         ArrayList var1 = new ArrayList();
         RSWidget[] var2 = SpriteMask.client.getGroup(WidgetUtil.componentToInterface(this.getId()));
         if(var2 == null) {
            return new net.runelite.api.widgets.Widget[0];
         } else {
            RSWidget[] var3 = var2;
            int var4 = var2.length;

            for(int var5 = 0; var5 < var4; ++var5) {
               RSWidget var6 = var3[var5];
               if(var6 != null && var6.getRSParentId() == this.getId()) {
                  var1.add(var6);
               }
            }

            return (net.runelite.api.widgets.Widget[])var1.toArray(new Widget[var1.size()]);
         }
      }
   }

   public boolean contains(Point var1) {
      Rectangle var2 = this.getBounds();
      return var2 != null && var2.contains(new java.awt.Point(var1.getX(), var1.getY()));
   }

   public net.runelite.api.widgets.Widget setPos(int var1, int var2) {
      this.setOriginalX(var1);
      this.setOriginalY(var2);
      return this;
   }

   public net.runelite.api.widgets.Widget setPos(int var1, int var2, int var3, int var4) {
      this.setOriginalX(var1);
      this.setOriginalY(var2);
      this.setXPositionMode(var3);
      this.setYPositionMode(var4);
      return this;
   }

   public net.runelite.api.widgets.Widget setSize(int var1, int var2) {
      this.setOriginalWidth(var1);
      this.setOriginalHeight(var2);
      return this;
   }

   public net.runelite.api.widgets.Widget setSize(int var1, int var2, int var3, int var4) {
      this.setOriginalWidth(var1);
      this.setOriginalHeight(var2);
      this.setWidthMode(var3);
      this.setHeightMode(var4);
      return this;
   }

   public net.runelite.api.widgets.Widget createChild(int var1, int var2) {
      if(!$assertionsDisabled && !SpriteMask.client.isClientThread()) {
         throw new AssertionError("createChild must be called on client thread");
      } else {
         RSWidget var3 = SpriteMask.client.createWidget();
         var3.setType(var2);
         var3.setParentId(this.getId());
         var3.setId(this.getId());
         var3.setIsIf3(true);
         Object var4 = this.getChildren();
         if(var1 < 0) {
            if(var4 == null) {
               var1 = 0;
            } else {
               var1 = 0;

               for(int var6 = ((Object[])var4).length - 1; var6 >= 0; --var6) {
                  if(((Object[])var4)[var6] != null) {
                     var1 = var6 + 1;
                     break;
                  }
               }
            }
         }

         if(var4 == null) {
            var4 = new Widget[var1 + 1];
            this.setChildren((net.runelite.api.widgets.Widget[])var4);
         } else if(((Object[])var4).length <= var1) {
            Widget[] var5 = new Widget[var1 + 1];
            System.arraycopy(var4, 0, var5, 0, ((Object[])var4).length);
            var4 = var5;
            this.setChildren(var5);
         }

         ((Object[])var4)[var1] = var3;
         var3.setIndex(var1);
         return var3;
      }
   }

   public void revalidate() {
      if(!$assertionsDisabled && !SpriteMask.client.isClientThread()) {
         throw new AssertionError("revalidate must be called on client thread");
      } else {
         SpriteMask.client.revalidateWidget(this);
      }
   }

   public void revalidateScroll() {
      if(!$assertionsDisabled && !SpriteMask.client.isClientThread()) {
         throw new AssertionError("revalidateScroll must be called on client thread");
      } else {
         SpriteMask.client.revalidateWidget(this);
         SpriteMask.client.revalidateWidgetScroll(SpriteMask.client.getWidgetDefinition().getWidgets()[WidgetUtil.componentToInterface(this.getId())], this, false);
      }
   }

   public void deleteAllChildren() {
      if(this.getChildren() != null) {
         Arrays.fill(this.getChildren(), (Object)null);
      }

   }

   public boolean isWidgetItemDragged(int var1) {
      return SpriteMask.client.getDraggedWidget() == this && SpriteMask.client.getDragTime() >= 5 && SpriteMask.client.getDraggedWidget().getIndex() == var1;
   }

   public Point getWidgetItemDragOffsets() {
      int var1 = SpriteMask.client.getMouseX() - SpriteMask.client.getWidgetClickX();
      int var2 = SpriteMask.client.getMouseY() - SpriteMask.client.getWidgetClickY();
      if(var1 < 5 && var1 > -5) {
         var1 = 0;
      }

      if(var2 < 5 && var2 > -5) {
         var2 = 0;
      }

      return new Point(var1, var2);
   }

   public void setForcedX() {
      if(this.forcedX > -1) {
         this.setRelativeX(this.forcedX);
      }

   }

   public void setForcedY() {
      if(this.forcedY > -1) {
         this.setRelativeY(this.forcedY);
      }

   }

   public void setForcedPosition(int var1, int var2) {
      this.forcedX = (short)var1;
      this.forcedY = (short)var2;
      this.setRelativeX(var1);
      this.setRelativeY(var2);
   }

   public net.runelite.api.SpritePixels getSprite() {
      return this.getSprite((RSWidgetDefinition)null, false, (RSUrlRequester)null);
   }

   public boolean isIf3() {
      return this.isIf3;
   }

   public void setIsIf3(boolean var1) {
      this.isIf3 = var1;
   }

   public void setId(int var1) {
      this.id = var1;
   }

   public int getIndex() {
      return this.childIndex;
   }

   public void setIndex(int var1) {
      this.childIndex = var1;
   }

   public int getType() {
      return this.type;
   }

   public void setType(int var1) {
      this.type = var1;
   }

   public int getButtonType() {
      return this.buttonType;
   }

   public int getContentType() {
      return this.contentType;
   }

   public RSWidget setContentType(int var1) {
      this.contentType = var1;
      return this;
   }

   public int getXPositionMode() {
      return this.xAlignment;
   }

   public int getYPositionMode() {
      return this.yAlignment;
   }

   public int getWidthMode() {
      return this.widthAlignment;
   }

   public int getHeightMode() {
      return this.heightAlignment;
   }

   public int getOriginalX() {
      return this.rawX;
   }

   public int getOriginalY() {
      return this.rawY;
   }

   public int getOriginalWidth() {
      return this.rawWidth;
   }

   public int getOriginalHeight() {
      return this.rawHeight;
   }

   public int getRelativeX() {
      return this.x;
   }

   public int getRelativeY() {
      return this.y;
   }

   public void setWidth(int var1) {
      this.width = var1;
   }

   public void setHeight(int var1) {
      this.height = var1;
   }

   public void setParentId(int var1) {
      this.parentId = var1;
   }

   public RSWidget setHidden(boolean var1) {
      this.isHidden = var1;
      return this;
   }

   public int getScrollX() {
      return this.scrollX;
   }

   public RSWidget setScrollX(int var1) {
      this.scrollX = var1;
      return this;
   }

   public int getScrollY() {
      return this.scrollY;
   }

   public RSWidget setScrollY(int var1) {
      this.scrollY = var1;
      return this;
   }

   public int getScrollWidth() {
      return this.scrollWidth;
   }

   public RSWidget setScrollWidth(int var1) {
      this.scrollWidth = var1;
      return this;
   }

   public int getScrollHeight() {
      return this.scrollHeight;
   }

   public RSWidget setScrollHeight(int var1) {
      this.scrollHeight = var1;
      return this;
   }

   public int getTextColor() {
      return this.color;
   }

   public RSWidget setTextColor(int var1) {
      this.color = var1;
      return this;
   }

   public boolean isFilled() {
      return this.fill;
   }

   public RSWidget setFilled(boolean var1) {
      this.fill = var1;
      return this;
   }

   public RSFillMode getFillMode() {
      return this.fillMode;
   }

   public int getOpacity() {
      return this.transparencyTop;
   }

   public RSWidget setOpacity(int var1) {
      this.transparencyTop = var1;
      return this;
   }

   public RSWidget setSpriteId(int var1) {
      this.spriteId2 = var1;
      return this;
   }

   public boolean getSpriteTiling() {
      return this.spriteTiling;
   }

   public RSWidget setSpriteTiling(boolean var1) {
      this.spriteTiling = var1;
      return this;
   }

   public int getBorderType() {
      return this.outline;
   }

   public void setBorderType(int var1) {
      this.outline = var1;
   }

   public int getModelType() {
      return this.modelType;
   }

   public RSWidget setModelType(int var1) {
      this.modelType = var1;
      return this;
   }

   public int getModelId() {
      return this.modelId;
   }

   public RSWidget setModelId(int var1) {
      this.modelId = var1;
      return this;
   }

   public int getAnimationId() {
      return this.sequenceId;
   }

   public RSWidget setAnimationId(int var1) {
      this.sequenceId = var1;
      return this;
   }

   public int getRotationX() {
      return this.modelAngleX;
   }

   public RSWidget setRotationX(int var1) {
      this.modelAngleX = var1;
      return this;
   }

   public int getRotationZ() {
      return this.modelAngleY;
   }

   public RSWidget setRotationZ(int var1) {
      this.modelAngleY = var1;
      return this;
   }

   public int getRotationY() {
      return this.modelAngleZ;
   }

   public RSWidget setRotationY(int var1) {
      this.modelAngleZ = var1;
      return this;
   }

   public int getModelZoom() {
      return this.modelZoom;
   }

   public RSWidget setModelZoom(int var1) {
      this.modelZoom = var1;
      return this;
   }

   public int getItemQuantityMode() {
      return this.itemQuantityMode;
   }

   public RSWidget setItemQuantityMode(int var1) {
      this.itemQuantityMode = var1;
      return this;
   }

   public int getFontId() {
      return this.fontId;
   }

   public RSWidget setFontId(int var1) {
      this.fontId = var1;
      return this;
   }

   public RSWidget setText(String var1) {
      this.text = var1;
      return this;
   }

   public int getLineHeight() {
      return this.textLineHeight;
   }

   public RSWidget setLineHeight(int var1) {
      this.textLineHeight = var1;
      return this;
   }

   public int getXTextAlignment() {
      return this.textXAlignment;
   }

   public RSWidget setXTextAlignment(int var1) {
      this.textXAlignment = var1;
      return this;
   }

   public int getYTextAlignment() {
      return this.textYAlignment;
   }

   public RSWidget setYTextAlignment(int var1) {
      this.textYAlignment = var1;
      return this;
   }

   public boolean getTextShadowed() {
      return this.textShadowed;
   }

   public RSWidget setTextShadowed(boolean var1) {
      this.textShadowed = var1;
      return this;
   }

   public int getClickMask() {
      return this.flags;
   }

   public RSWidget setClickMask(int var1) {
      this.flags = var1;
      return this;
   }

   public String[] getActions() {
      return this.actions;
   }

   public RSWidget getDragParent() {
      return this.parent;
   }

   public RSWidget setDragParent(net.runelite.api.widgets.Widget var1) {
      this.parent = (Widget)var1;
      return this;
   }

   public int getDragDeadZone() {
      return this.dragZoneSize;
   }

   public void setDragDeadZone(int var1) {
      this.dragZoneSize = var1;
   }

   public int getDragDeadTime() {
      return this.dragThreshold;
   }

   public void setDragDeadTime(int var1) {
      this.dragThreshold = var1;
   }

   public String getTargetVerb() {
      return this.spellActionName;
   }

   public void setTargetVerb(String var1) {
      this.spellActionName = var1;
   }

   public boolean hasListener() {
      return this.hasListener;
   }

   public RSWidget setHasListener(boolean var1) {
      this.hasListener = var1;
      return this;
   }

   public Object[] getOnLoadListener() {
      return this.onLoad;
   }

   public void setOnClickListener(Object[] var1) {
      this.onClick = var1;
   }

   public void setOnReleaseListener(Object[] var1) {
      this.onRelease = var1;
   }

   public void setOnHoldListener(Object[] var1) {
      this.onHold = var1;
   }

   public void setOnMouseOverListener(Object[] var1) {
      this.onMouseOver = var1;
   }

   public void setOnMouseRepeatListener(Object[] var1) {
      this.onMouseRepeat = var1;
   }

   public void setOnMouseLeaveListener(Object[] var1) {
      this.onMouseLeave = var1;
   }

   public void setOnDragListener(Object[] var1) {
      this.onDrag = var1;
   }

   public void setOnDragCompleteListener(Object[] var1) {
      this.onDragComplete = var1;
   }

   public void setOnTargetEnterListener(Object[] var1) {
      this.onTargetEnter = var1;
   }

   public void setOnTargetLeaveListener(Object[] var1) {
      this.onTargetLeave = var1;
   }

   public Object[] getOnVarTransmitListener() {
      return this.onVarTransmit;
   }

   public void setOnVarTransmitListener(Object[] var1) {
      this.onVarTransmit = var1;
   }

   public void setVarTransmitTrigger(int[] var1) {
      this.varTransmitTriggers = var1;
   }

   public Object[] getOnInvTransmitListener() {
      return this.onInvTransmit;
   }

   public void setOnTimerListener(Object[] var1) {
      this.onTimer = var1;
   }

   public void setOnOpListener(Object[] var1) {
      this.onOp = var1;
   }

   public Object[] getOnOpListener() {
      return this.onOp;
   }

   public Object[] getOnKeyListener() {
      return this.onKey;
   }

   public void setOnKeyListener(Object[] var1) {
      this.onKey = var1;
   }

   public void setOnDialogAbortListener(Object[] var1) {
      this.onDialogAbort = var1;
   }

   public int getItemId() {
      return this.itemId;
   }

   public RSWidget setItemId(int var1) {
      this.itemId = var1;
      return this;
   }

   public int getItemQuantity() {
      return this.itemQuantity;
   }

   public RSWidget setItemQuantity(int var1) {
      this.itemQuantity = var1;
      return this;
   }

   public int getModelFrame() {
      return this.modelFrame;
   }

   public boolean getNoClickThrough() {
      return this.noClickThrough;
   }

   public void setNoClickThrough(boolean var1) {
      this.noClickThrough = var1;
   }

   public boolean getNoScrollThrough() {
      return this.noScrollThrough;
   }

   public void setNoScrollThrough(boolean var1) {
      this.noScrollThrough = var1;
   }

   public void setAction(int var1, String var2) {
      this.setAction_base(var1, var2);
   }

   @ObfuscatedSignature(
      descriptor = "(Lnn;IIB)V"
   )
   public static void copy$alignWidgetPosition(Widget var0, int var1, int var2, byte var3) {
      if(var0.xAlignment == 0) {
         var0.x = var0.rawX;
      } else if(var0.xAlignment == 1) {
         var0.x = var0.rawX + (var1 - var0.width) / 2;
      } else if(var0.xAlignment == 2) {
         var0.x = var1 - var0.width - var0.rawX;
      } else if(var0.xAlignment == 3) {
         var0.x = var0.rawX * var1 >> 14;
      } else if(var0.xAlignment == 4) {
         if(var3 == 6) {
            return;
         }

         var0.x = (var1 - var0.width) / 2 + (var0.rawX * var1 >> 14);
      } else {
         var0.x = var1 - var0.width - (var0.rawX * var1 >> 14);
      }

      if(var0.yAlignment == 0) {
         var0.y = var0.rawY;
         var0.onPositionChanged(-1);
      } else if(var0.yAlignment == 1) {
         var0.y = (var2 - var0.height) / 2 + var0.rawY;
         var0.onPositionChanged(-1);
      } else if(var0.yAlignment == 2) {
         var0.y = var2 - var0.height - var0.rawY;
         var0.onPositionChanged(-1);
      } else if(var0.yAlignment == 3) {
         var0.y = var2 * var0.rawY >> 14;
         var0.onPositionChanged(-1);
      } else if(var0.yAlignment == 4) {
         var0.y = (var2 - var0.height) / 2 + (var2 * var0.rawY >> 14);
         var0.onPositionChanged(-1);
      } else {
         var0.y = var2 - var0.height - (var2 * var0.rawY >> 14);
         var0.onPositionChanged(-1);
      }

   }

   public boolean containsMouse() {
      return this.containsMouse;
   }

   private final String[] itemActions = new String[5];

   public String[] getItemActions() {
      return this.itemActions;
   }

   public String getSpellName() {
      return this.spellName;
   }
}
