package mapped;

import net.runelite.api.HeadIcon;
import net.runelite.api.IterableHashTable;
import net.runelite.api.ParamHolder;
import net.runelite.api.events.NpcActionChanged;
import net.runelite.mapping.ObfuscatedGetter;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
import net.runelite.rs.api.RSIntegerNode;
import net.runelite.rs.api.RSIterableNodeHashTable;
import net.runelite.rs.api.RSNPCComposition;
import net.runelite.rs.api.RSNode;
import net.runelite.rs.api.RSObjectNode;
import net.runelite.rs.api.RSParamComposition;

@ObfuscatedName("hw")
public class NPCComposition extends DualNode implements RSNPCComposition, ParamHolder {
   @ObfuscatedName("ah")
   @ObfuscatedSignature(
      descriptor = "Lol;"
   )
   static AbstractArchive NpcDefinition_archive;
   @ObfuscatedName("ao")
   @ObfuscatedSignature(
      descriptor = "Llk;"
   )
   static EvictingDualNodeHashTable NpcDefinition_cached;
   @ObfuscatedName("ab")
   @ObfuscatedSignature(
      descriptor = "Llk;"
   )
   static EvictingDualNodeHashTable NpcDefinition_cachedModels;
   @ObfuscatedName("cu")
   @ObfuscatedGetter(
      intValue = -148925263
   )
   static int field1966;
   @ObfuscatedName("au")
   @ObfuscatedGetter(
      intValue = 1732339779
   )
   public int id;
   @ObfuscatedName("aa")
   public String name;
   @ObfuscatedName("ac")
   @ObfuscatedGetter(
      intValue = -982873463
   )
   public int size;
   @ObfuscatedName("al")
   int[] models;
   @ObfuscatedName("az")
   int[] field1928;
   @ObfuscatedName("ap")
   @ObfuscatedGetter(
      intValue = 929101693
   )
   public int idleSequence;
   @ObfuscatedName("av")
   @ObfuscatedGetter(
      intValue = 2124045029
   )
   public int turnLeftSequence;
   @ObfuscatedName("ax")
   @ObfuscatedGetter(
      intValue = -810894845
   )
   public int turnRightSequence;
   @ObfuscatedName("as")
   @ObfuscatedGetter(
      intValue = 380025451
   )
   public int walkSequence;
   @ObfuscatedName("ay")
   @ObfuscatedGetter(
      intValue = -347828473
   )
   public int walkBackSequence;
   @ObfuscatedName("ak")
   @ObfuscatedGetter(
      intValue = -914310317
   )
   public int walkLeftSequence;
   @ObfuscatedName("aj")
   @ObfuscatedGetter(
      intValue = 832299041
   )
   public int walkRightSequence;
   @ObfuscatedName("am")
   @ObfuscatedGetter(
      intValue = -1490443197
   )
   public int field1931;
   @ObfuscatedName("aq")
   @ObfuscatedGetter(
      intValue = 1622952669
   )
   public int field1937;
   @ObfuscatedName("ai")
   @ObfuscatedGetter(
      intValue = 168358035
   )
   public int field1954;
   @ObfuscatedName("aw")
   @ObfuscatedGetter(
      intValue = 1800293817
   )
   public int field1962;
   @ObfuscatedName("ae")
   @ObfuscatedGetter(
      intValue = -400554641
   )
   public int field1961;
   @ObfuscatedName("an")
   @ObfuscatedGetter(
      intValue = -280377849
   )
   public int field1941;
   @ObfuscatedName("ag")
   @ObfuscatedGetter(
      intValue = -2053163507
   )
   public int field1958;
   @ObfuscatedName("ad")
   @ObfuscatedGetter(
      intValue = 694176283
   )
   public int field1945;
   @ObfuscatedName("af")
   short[] recolorFrom;
   @ObfuscatedName("be")
   public short[] recolorTo;
   @ObfuscatedName("bd")
   short[] retextureFrom;
   @ObfuscatedName("bl")
   public short[] retextureTo;
   @ObfuscatedName("bi")
   public String[] actions;
   @ObfuscatedName("bv")
   public boolean drawMapDot;
   @ObfuscatedName("bf")
   @ObfuscatedGetter(
      intValue = -1916672885
   )
   public int combatLevel;
   @ObfuscatedName("bg")
   @ObfuscatedGetter(
      intValue = 680688231
   )
   int widthScale;
   @ObfuscatedName("ba")
   @ObfuscatedGetter(
      intValue = 1444272247
   )
   int heightScale;
   @ObfuscatedName("bm")
   public boolean isVisible;
   @ObfuscatedName("bp")
   @ObfuscatedGetter(
      intValue = 51170379
   )
   int ambient;
   @ObfuscatedName("bw")
   @ObfuscatedGetter(
      intValue = 544550039
   )
   int contrast;
   @ObfuscatedName("bj")
   @ObfuscatedGetter(
      intValue = -1395954963
   )
   public int rotation;
   @ObfuscatedName("bn")
   public int[] transforms;
   @ObfuscatedName("bo")
   @ObfuscatedGetter(
      intValue = -1401908107
   )
   int transformVarbit;
   @ObfuscatedName("bt")
   @ObfuscatedGetter(
      intValue = 1298306557
   )
   int transformVarp;
   @ObfuscatedName("bu")
   public boolean isInteractable;
   @ObfuscatedName("by")
   public boolean isClipped;
   @ObfuscatedName("bh")
   public boolean isFollower;
   @ObfuscatedName("bz")
   int[] headIconArchiveIds;
   @ObfuscatedName("bc")
   short[] headIconSpriteIndex;
   @ObfuscatedName("bs")
   @ObfuscatedSignature(
      descriptor = "Ltz;"
   )
   IterableNodeHashTable params;

   static {
      NpcDefinition_cached = new EvictingDualNodeHashTable(64);
      NpcDefinition_cachedModels = new EvictingDualNodeHashTable(50);
   }

   NPCComposition() {
      this.name = "null";
      this.size = 1;
      this.idleSequence = -1;
      this.turnLeftSequence = -1;
      this.turnRightSequence = -1;
      this.walkSequence = -1;
      this.walkBackSequence = -1;
      this.walkLeftSequence = -1;
      this.walkRightSequence = -1;
      this.field1931 = -1;
      this.field1937 = -1;
      this.field1954 = -1;
      this.field1962 = -1;
      this.field1961 = -1;
      this.field1941 = -1;
      this.field1958 = -1;
      this.field1945 = -1;
      this.actions = new String[5];
      this.actionsHook(-1);
      this.drawMapDot = true;
      this.combatLevel = -1;
      this.widthScale = 128;
      this.heightScale = 128;
      this.isVisible = false;
      this.ambient = 0;
      this.contrast = 0;
      this.rotation = 32;
      this.transformVarbit = -1;
      this.transformVarp = -1;
      this.isInteractable = true;
      this.isClipped = true;
      this.isFollower = false;
      this.headIconArchiveIds = null;
      this.headIconSpriteIndex = null;
   }

   @ObfuscatedName("ar")
   @ObfuscatedSignature(
      descriptor = "(B)V",
      garbageValue = "3"
   )
   void postDecode_base() {
   }

   @ObfuscatedName("ao")
   @ObfuscatedSignature(
      descriptor = "(Luj;B)V",
      garbageValue = "-39"
   )
   void method3693(Buffer var1) {
      while(true) {
         int var2 = var1.readUnsignedByte_base();
         if(var2 == 0) {
            return;
         }

         this.method3743(var1, var2);
      }
   }

   @ObfuscatedName("ab")
   @ObfuscatedSignature(
      descriptor = "(Luj;II)V",
      garbageValue = "221871708"
   )
   void method3743(Buffer var1, int var2) {
      int var3;
      int var4;
      if(var2 == 1) {
         var3 = var1.readUnsignedByte_base();
         this.models = new int[var3];

         for(var4 = 0; var4 < var3; ++var4) {
            this.models[var4] = var1.readUnsignedShort_base();
         }
      } else if(var2 == 2) {
         this.name = var1.readStringCp1252NullTerminated_base();
      } else if(var2 == 12) {
         this.size = var1.readUnsignedByte_base();
      } else if(var2 == 13) {
         this.idleSequence = var1.readUnsignedShort_base();
      } else if(var2 == 14) {
         this.walkSequence = var1.readUnsignedShort_base();
      } else if(var2 == 15) {
         this.turnLeftSequence = var1.readUnsignedShort_base();
      } else if(var2 == 16) {
         this.turnRightSequence = var1.readUnsignedShort_base();
      } else if(var2 == 17) {
         this.walkSequence = var1.readUnsignedShort_base();
         this.walkBackSequence = var1.readUnsignedShort_base();
         this.walkLeftSequence = var1.readUnsignedShort_base();
         this.walkRightSequence = var1.readUnsignedShort_base();
      } else if(var2 == 18) {
         var1.readUnsignedShort_base();
      } else if(var2 >= 30 && var2 < 35) {
         this.actions[var2 - 30] = var1.readStringCp1252NullTerminated_base();
         this.actionsHook(var2 - 30);
         if(this.actions[var2 - 30].equalsIgnoreCase("Hidden")) {
            this.actions[var2 - 30] = null;
            this.actionsHook(var2 - 30);
         }
      } else if(var2 == 40) {
         var3 = var1.readUnsignedByte_base();
         this.recolorFrom = new short[var3];
         this.recolorTo = new short[var3];

         for(var4 = 0; var4 < var3; ++var4) {
            this.recolorFrom[var4] = (short)var1.readUnsignedShort_base();
            this.recolorTo[var4] = (short)var1.readUnsignedShort_base();
         }
      } else if(var2 == 41) {
         var3 = var1.readUnsignedByte_base();
         this.retextureFrom = new short[var3];
         this.retextureTo = new short[var3];

         for(var4 = 0; var4 < var3; ++var4) {
            this.retextureFrom[var4] = (short)var1.readUnsignedShort_base();
            this.retextureTo[var4] = (short)var1.readUnsignedShort_base();
         }
      } else if(var2 == 60) {
         var3 = var1.readUnsignedByte_base();
         this.field1928 = new int[var3];

         for(var4 = 0; var4 < var3; ++var4) {
            this.field1928[var4] = var1.readUnsignedShort_base();
         }
      } else if(var2 == 93) {
         this.drawMapDot = false;
      } else if(var2 == 95) {
         this.combatLevel = var1.readUnsignedShort_base();
      } else if(var2 == 97) {
         this.widthScale = var1.readUnsignedShort_base();
      } else if(var2 == 98) {
         this.heightScale = var1.readUnsignedShort_base();
      } else if(var2 == 99) {
         this.isVisible = true;
      } else if(var2 == 100) {
         this.ambient = var1.readByte_base();
      } else if(var2 == 101) {
         this.contrast = var1.readByte_base() * 5;
      } else {
         int var5;
         if(var2 == 102) {
            var3 = var1.readUnsignedByte_base();
            var4 = 0;

            for(var5 = var3; var5 != 0; var5 >>= 1) {
               ++var4;
            }

            this.headIconArchiveIds = new int[var4];
            this.headIconSpriteIndex = new short[var4];

            for(int var6 = 0; var6 < var4; ++var6) {
               if((var3 & 1 << var6) == 0) {
                  this.headIconArchiveIds[var6] = -1;
                  this.headIconSpriteIndex[var6] = -1;
               } else {
                  this.headIconArchiveIds[var6] = var1.readNullableLargeSmart_base();
                  this.headIconSpriteIndex[var6] = (short)var1.readShortSmartSub_base();
               }
            }
         } else if(var2 == 103) {
            this.rotation = var1.readUnsignedShort_base();
         } else if(var2 != 106 && var2 != 118) {
            if(var2 == 107) {
               this.isInteractable = false;
            } else if(var2 == 109) {
               this.isClipped = false;
            } else if(var2 == 111) {
               this.isFollower = true;
            } else if(var2 == 114) {
               this.field1931 = var1.readUnsignedShort_base();
            } else if(var2 == 115) {
               this.field1931 = var1.readUnsignedShort_base();
               this.field1937 = var1.readUnsignedShort_base();
               this.field1954 = var1.readUnsignedShort_base();
               this.field1962 = var1.readUnsignedShort_base();
            } else if(var2 == 116) {
               this.field1961 = var1.readUnsignedShort_base();
            } else if(var2 == 117) {
               this.field1961 = var1.readUnsignedShort_base();
               this.field1941 = var1.readUnsignedShort_base();
               this.field1958 = var1.readUnsignedShort_base();
               this.field1945 = var1.readUnsignedShort_base();
            } else if(var2 == 249) {
               this.params = class144.method3229(var1, this.params);
            }
         } else {
            this.transformVarbit = var1.readUnsignedShort_base();
            if(this.transformVarbit == 65535) {
               this.transformVarbit = -1;
            }

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

            var3 = -1;
            if(var2 == 118) {
               var3 = var1.readUnsignedShort_base();
               if(var3 == 65535) {
                  var3 = -1;
               }
            }

            var4 = var1.readUnsignedByte_base();
            this.transforms = new int[var4 + 2];

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

            this.transforms[var4 + 1] = var3;
         }
      }

   }

   @ObfuscatedName("au")
   @ObfuscatedSignature(
      descriptor = "(Lhx;ILhx;ILhf;B)Lka;",
      garbageValue = "-68"
   )
   public final Model method3735(SequenceDefinition var1, int var2, SequenceDefinition var3, int var4, NpcOverrides var5) {
      if(this.transforms != null) {
         NPCComposition var6 = this.method3698();
         return var6 == null?null:var6.method3735(var1, var2, var3, var4, var5);
      } else {
         long var10 = (long)this.id;
         if(var5 != null) {
            var10 |= var5.field1917 << 16;
         }

         Model var8 = (Model)NpcDefinition_cachedModels.get(var10);
         if(var8 == null) {
            ModelData var9 = this.method3695(this.models, var5);
            if(var9 == null) {
               return null;
            }

            var8 = var9.method5122(this.ambient + 64, this.contrast + 850, -30, -50, -30);
            NpcDefinition_cachedModels.put(var8, var10);
         }

         Model var12;
         if(var1 != null && var3 != null) {
            var12 = var1.method4045(var8, var2, var3, var4);
         } else if(var1 != null) {
            var12 = var1.method4042(var8, var2);
         } else if(var3 != null) {
            var12 = var3.method4042(var8, var4);
         } else {
            var12 = var8.method5563(true);
         }

         if(this.widthScale != 128 || this.heightScale != 128) {
            var12.scale_base(this.widthScale, this.heightScale, this.widthScale);
         }

         return var12;
      }
   }

   @ObfuscatedName("aa")
   @ObfuscatedSignature(
      descriptor = "(Lhf;B)Lkq;",
      garbageValue = "40"
   )
   public final ModelData method3696(NpcOverrides var1) {
      if(this.transforms != null) {
         NPCComposition var2 = this.method3698();
         return var2 == null?null:var2.method3696(var1);
      } else {
         return this.method3695(this.field1928, var1);
      }
   }

   @ObfuscatedName("ac")
   @ObfuscatedSignature(
      descriptor = "([ILhf;I)Lkq;",
      garbageValue = "-578729183"
   )
   ModelData method3695(int[] var1, NpcOverrides var2) {
      int[] var3 = var1;
      if(var2 != null && var2.modelIds != null) {
         var3 = var2.modelIds;
      }

      if(var3 == null) {
         return null;
      } else {
         boolean var4 = false;

         for(int var5 = 0; var5 < var3.length; ++var5) {
            if(var3[var5] != -1 && !class191.field1977.tryLoadFile_base(var3[var5], 0)) {
               var4 = true;
            }
         }

         if(var4) {
            return null;
         } else {
            ModelData[] var9 = new ModelData[var3.length];

            for(int var6 = 0; var6 < var3.length; ++var6) {
               var9[var6] = ModelData.method5100(class191.field1977, var3[var6], 0);
            }

            ModelData var10;
            if(var9.length == 1) {
               var10 = var9[0];
               if(var10 == null) {
                  var10 = new ModelData(var9, var9.length);
               }
            } else {
               var10 = new ModelData(var9, var9.length);
            }

            short[] var7;
            int var8;
            if(this.recolorFrom != null) {
               var7 = this.recolorTo;
               if(var2 != null && var2.recolorTo != null) {
                  var7 = var2.recolorTo;
               }

               for(var8 = 0; var8 < this.recolorFrom.length; ++var8) {
                  var10.recolor_base(this.recolorFrom[var8], var7[var8]);
               }
            }

            if(this.retextureFrom != null) {
               var7 = this.retextureTo;
               if(var2 != null && var2.retextureTo != null) {
                  var7 = var2.retextureTo;
               }

               for(var8 = 0; var8 < this.retextureFrom.length; ++var8) {
                  var10.retexture_base(this.retextureFrom[var8], var7[var8]);
               }
            }

            return var10;
         }
      }
   }

   @ObfuscatedName("al")
   @ObfuscatedSignature(
      descriptor = "(I)Lhw;",
      garbageValue = "-454054205"
   )
   public final NPCComposition method3698() {
      int var1 = -1;
      if(this.transformVarbit != -1) {
         var1 = HealthBar.getVarbit_base(this.transformVarbit);
      } else if(this.transformVarp != -1) {
         var1 = Varps.Varps_main[this.transformVarp];
      }

      int var2;
      if(var1 >= 0 && var1 < this.transforms.length - 1) {
         var2 = this.transforms[var1];
      } else {
         var2 = this.transforms[this.transforms.length - 1];
      }

      return var2 != -1?VerticalAlignment.method3757(var2):null;
   }

   @ObfuscatedName("az")
   @ObfuscatedSignature(
      descriptor = "(B)Z",
      garbageValue = "10"
   )
   public boolean transformIsVisible_base() {
      if(this.transforms == null) {
         return true;
      } else {
         int var1 = -1;
         if(this.transformVarbit != -1) {
            var1 = HealthBar.getVarbit_base(this.transformVarbit);
         } else if(this.transformVarp != -1) {
            var1 = Varps.Varps_main[this.transformVarp];
         }

         return var1 >= 0 && var1 < this.transforms.length?this.transforms[var1] != -1:this.transforms[this.transforms.length - 1] != -1;
      }
   }

   @ObfuscatedName("ap")
   @ObfuscatedSignature(
      descriptor = "(III)I",
      garbageValue = "-1331214833"
   )
   public int getIntParam_base(int var1, int var2) {
      return Player.method2444(this.params, var1, var2);
   }

   @ObfuscatedName("av")
   @ObfuscatedSignature(
      descriptor = "(ILjava/lang/String;I)Ljava/lang/String;",
      garbageValue = "-2078724578"
   )
   public String getStringParam_base(int var1, String var2) {
      IterableNodeHashTable var4 = this.params;
      String var3;
      if(var4 == null) {
         var3 = var2;
      } else {
         ObjectNode var5 = (ObjectNode)var4.get((long)var1);
         if(var5 == null) {
            var3 = var2;
         } else {
            var3 = (String)var5.obj;
         }
      }

      return var3;
   }

   @ObfuscatedName("as")
   @ObfuscatedSignature(
      descriptor = "(I)Z",
      garbageValue = "1998191718"
   )
   public boolean method3702_base() {
      return this.headIconArchiveIds != null && this.headIconSpriteIndex != null;
   }

   @ObfuscatedName("ay")
   @ObfuscatedSignature(
      descriptor = "(I)[I",
      garbageValue = "-901085454"
   )
   public int[] method3733_base() {
      return this.headIconArchiveIds;
   }

   @ObfuscatedName("ak")
   @ObfuscatedSignature(
      descriptor = "(II)I",
      garbageValue = "1923898777"
   )
   public int method3704_base(int var1) {
      return this.headIconArchiveIds != null && var1 < this.headIconArchiveIds.length?this.headIconArchiveIds[var1]:-1;
   }

   @ObfuscatedName("aj")
   @ObfuscatedSignature(
      descriptor = "(I)[S",
      garbageValue = "-1335498252"
   )
   public short[] method3694_base() {
      return this.headIconSpriteIndex;
   }

   @ObfuscatedName("am")
   @ObfuscatedSignature(
      descriptor = "(IB)S",
      garbageValue = "-62"
   )
   public short method3706_base(int var1) {
      return this.headIconSpriteIndex != null && var1 < this.headIconSpriteIndex.length?this.headIconSpriteIndex[var1]:-1;
   }

   public short[] getHeadIconSpriteIndexes() {
      return this.headIconSpriteIndex;
   }

   public RSNode getParam(int var1) {
      return this.getParams() == null?null:(RSNode)this.getParams().get((long)var1);
   }

   public int[] getHeadIconArchiveIds() {
      return this.headIconArchiveIds;
   }

   public void setParam(int var1, RSNode var2) {
      RSParamComposition var3 = SpriteMask.client.getRSParamComposition(var1);
      if(var3.isString() != (var2 instanceof RSObjectNode)) {
         if(var3.isString()) {
            throw new IllegalArgumentException("trying to put int into string param");
         } else {
            throw new IllegalArgumentException("trying to put string into int param");
         }
      } else {
         if(this.getParams() == null) {
            this.setParams((IterableHashTable)SpriteMask.client.newIterableNodeHashTable(16));
         }

         this.getParams().put(var2, (long)var1);
      }
   }

   public void setParams(IterableHashTable var1) {
      this.params = (IterableNodeHashTable)var1;
   }

   public void actionsHook(int var1) {
      NpcActionChanged var2 = new NpcActionChanged();
      var2.setNpcComposition(this);
      var2.setIdx(var1);
      SpriteMask.client.getCallbacks().post(var2);
   }

   public int getIntValue(int var1) {
      RSNode var2 = this.getParam(var1);
      if(var2 != null) {
         RSIntegerNode var4 = (RSIntegerNode)var2;
         return var4.getValue();
      } else {
         RSParamComposition var3 = SpriteMask.client.getRSParamComposition(var1);
         if(var3.isString()) {
            throw new IllegalArgumentException("trying to get int from string param");
         } else {
            return var3.getDefaultInt();
         }
      }
   }

   public void setValue(int var1, int var2) {
      this.setParam(var1, SpriteMask.client.newIntegerNode(var2));
   }

   public String getStringValue(int var1) {
      RSNode var2 = this.getParam(var1);
      if(var2 != null) {
         RSObjectNode var4 = (RSObjectNode)var2;
         return (String)var4.getValue();
      } else {
         RSParamComposition var3 = SpriteMask.client.getRSParamComposition(var1);
         if(!var3.isString()) {
            throw new IllegalArgumentException("trying to get string from int param");
         } else {
            return var3.getDefaultStr();
         }
      }
   }

   public void setValue(int var1, String var2) {
      this.setParam(var1, SpriteMask.client.newObjectNode(var2));
   }

   public HeadIcon getOverheadIcon() {
      short[] var1 = this.getHeadIconSpriteIndexes();
      int[] var2 = this.getHeadIconArchiveIds();
      return var2 != null && var1 != null?HeadIcon.values()[var1[0]]:null;
   }

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

   public String getName() {
      return this.name;
   }

   public int getSize() {
      return this.size;
   }

   public int[] getModels() {
      return this.models;
   }

   public short[] getColorToReplace() {
      return this.recolorFrom;
   }

   public short[] getColorToReplaceWith() {
      return this.recolorTo;
   }

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

   public boolean isMinimapVisible() {
      return this.drawMapDot;
   }

   public int getCombatLevel() {
      return this.combatLevel;
   }

   public int getWidthScale() {
      return this.widthScale;
   }

   public int getHeightScale() {
      return this.heightScale;
   }

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

   public int[] getConfigs() {
      return this.transforms;
   }

   public boolean isInteractible() {
      return this.isInteractable;
   }

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

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

   public RSNPCComposition transform() {
      return this.method3698();
   }

   public RSIterableNodeHashTable getParams() {
      return this.params;
   }

   public void setParams(RSIterableNodeHashTable var1) {
      this.params = (IterableNodeHashTable)var1;
   }

   @ObfuscatedName("lq")
   @ObfuscatedSignature(
      descriptor = "(IIIZB)V",
      garbageValue = "-21"
   )
   static final void method3748_base(int var0, int var1, int var2, boolean var3) {
      if(HealthBarDefinition.widgetDefinition.loadInterface_base(var0)) {
         UrlRequest.method2923(HealthBarDefinition.widgetDefinition.Widget_interfaceComponents[var0], -1, var1, var2, var3);
      }
   }
}
