Decompiled source of YapYap Config v1.0.2

com.Omniscye.YapYapConfig.dll

Decompiled 3 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("com.Omniscye.YapYapConfig")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+174558dd641ee37bf40ded0d24866ac172d24388")]
[assembly: AssemblyProduct("com.Omniscye.YapYapConfig")]
[assembly: AssemblyTitle("EmpressYapYapConfig")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class BepInAutoPluginAttribute : Attribute
	{
		public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace BepInEx.Preloader.Core.Patching
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace YapYapModsMenu
{
	internal static class ConfigUtil
	{
		internal static IEnumerable<ConfigEntryBase> GetConfigEntries(ConfigFile cfg)
		{
			IEnumerable<ConfigEntryBase> enumerable = ((IDictionary<ConfigDefinition, ConfigEntryBase>)cfg)?.Values;
			return enumerable ?? Enumerable.Empty<ConfigEntryBase>();
		}

		internal static (float min, float max, bool hasRange) GetRange(ConfigEntryBase entry)
		{
			try
			{
				ConfigDescription description = entry.Description;
				AcceptableValueBase val = ((description != null) ? description.AcceptableValues : null);
				if (val == null)
				{
					return (0f, 1f, false);
				}
				Type type = ((object)val).GetType();
				if (type.IsGenericType && type.GetGenericTypeDefinition().Name.StartsWith("AcceptableValueRange"))
				{
					PropertyInfo property = type.GetProperty("MinValue", BindingFlags.Instance | BindingFlags.Public);
					PropertyInfo property2 = type.GetProperty("MaxValue", BindingFlags.Instance | BindingFlags.Public);
					if (property != null && property2 != null)
					{
						float item = Convert.ToSingle(property.GetValue(val));
						float item2 = Convert.ToSingle(property2.GetValue(val));
						return (item, item2, true);
					}
				}
			}
			catch
			{
			}
			return (0f, 1f, false);
		}
	}
	internal static class EntryRowBuilder
	{
		internal static void CreateEntryRow(Transform parent, ConfigEntryBase entry, Sprite uiSprite, TMP_FontAsset font, GameObject dropdownPrefab)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Expected O, but got Unknown
			//IL_0234: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0413: Unknown result type (might be due to invalid IL or missing references)
			//IL_0438: Unknown result type (might be due to invalid IL or missing references)
			//IL_0457: Unknown result type (might be due to invalid IL or missing references)
			//IL_046c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0481: Unknown result type (might be due to invalid IL or missing references)
			ConfigEntryBase entry2 = entry;
			GameObject val = new GameObject("Entry_" + entry2.Definition.Key);
			val.transform.SetParent(parent, false);
			((Object)val).hideFlags = (HideFlags)61;
			Image obj = val.AddComponent<Image>();
			obj.sprite = uiSprite;
			obj.type = (Type)(((Object)(object)uiSprite != (Object)null) ? 1 : 0);
			((Graphic)obj).color = new Color(0.12f, 0.13f, 0.17f, 0.9f);
			((Graphic)obj).raycastTarget = true;
			LayoutElement obj2 = val.AddComponent<LayoutElement>();
			obj2.minHeight = 86f;
			obj2.flexibleWidth = 1f;
			val.GetComponent<RectTransform>().sizeDelta = new Vector2(0f, 86f);
			TMP_Text obj3 = UiFactory.CreateText(val.transform, "Label", font, entry2.Definition.Key, 20, (TextAlignmentOptions)513, Color.white, raycastTarget: false);
			obj3.overflowMode = (TextOverflowModes)1;
			obj3.enableWordWrapping = false;
			UiFactory.Rect((Component)(object)obj3).anchorMin = new Vector2(0.04f, 0.55f);
			UiFactory.Rect((Component)(object)obj3).anchorMax = new Vector2(0.6f, 0.95f);
			UiFactory.Rect((Component)(object)obj3).offsetMin = Vector2.zero;
			UiFactory.Rect((Component)(object)obj3).offsetMax = Vector2.zero;
			Transform transform = val.transform;
			ConfigDescription description = entry2.Description;
			TMP_Text obj4 = UiFactory.CreateText(transform, "Desc", font, ((description != null) ? description.Description : null) ?? "", 14, (TextAlignmentOptions)513, new Color(1f, 1f, 1f, 0.65f), raycastTarget: false);
			obj4.enableWordWrapping = true;
			obj4.overflowMode = (TextOverflowModes)3;
			UiFactory.Rect((Component)(object)obj4).anchorMin = new Vector2(0.04f, 0.12f);
			UiFactory.Rect((Component)(object)obj4).anchorMax = new Vector2(0.6f, 0.55f);
			UiFactory.Rect((Component)(object)obj4).offsetMin = Vector2.zero;
			UiFactory.Rect((Component)(object)obj4).offsetMax = Vector2.zero;
			GameObject val2 = new GameObject("ValueHost");
			val2.transform.SetParent(val.transform, false);
			((Object)val2).hideFlags = (HideFlags)61;
			RectTransform obj5 = val2.AddComponent<RectTransform>();
			obj5.anchorMin = new Vector2(0.62f, 0.14f);
			obj5.anchorMax = new Vector2(0.96f, 0.88f);
			obj5.offsetMin = Vector2.zero;
			obj5.offsetMax = Vector2.zero;
			Type t = entry2.SettingType;
			if (t == typeof(bool))
			{
				((UnityEvent<bool>)(object)UiFactory.CreateToggle(val2.transform, uiSprite, font, (bool)entry2.BoxedValue).onValueChanged).AddListener((UnityAction<bool>)delegate(bool v)
				{
					entry2.BoxedValue = v;
				});
				return;
			}
			float min;
			float max;
			TMP_Text valueText;
			if (t == typeof(float) || t == typeof(int))
			{
				(float, float, bool) range = ConfigUtil.GetRange(entry2);
				(min, max, _) = range;
				if (!range.Item3)
				{
					if (t == typeof(float))
					{
						min = 0f;
						max = 1f;
					}
					else
					{
						min = 0f;
						max = 100f;
					}
				}
				Slider val3 = UiFactory.CreateSlider(val2.transform, uiSprite);
				val3.minValue = min;
				val3.maxValue = max;
				val3.wholeNumbers = t == typeof(int);
				val3.value = Convert.ToSingle(entry2.BoxedValue);
				valueText = UiFactory.CreateText(val2.transform, "Value", font, "", 16, (TextAlignmentOptions)516, new Color(1f, 1f, 1f, 0.85f), raycastTarget: false);
				UiFactory.Rect((Component)(object)valueText).anchorMin = new Vector2(0f, 0.65f);
				UiFactory.Rect((Component)(object)valueText).anchorMax = new Vector2(1f, 1f);
				UiFactory.Rect((Component)(object)valueText).offsetMin = Vector2.zero;
				UiFactory.Rect((Component)(object)valueText).offsetMax = Vector2.zero;
				((UnityEvent<float>)(object)val3.onValueChanged).AddListener((UnityAction<float>)Refresh);
				Refresh(val3.value);
				return;
			}
			if (t.IsEnum)
			{
				List<string> options = Enum.GetNames(t).ToList();
				TMP_Dropdown dd = UiFactory.CreateDropdown(val2.transform, uiSprite, font, dropdownPrefab, options);
				dd.value = Array.IndexOf<string>(Enum.GetNames(t), entry2.BoxedValue.ToString());
				((UnityEvent<int>)(object)dd.onValueChanged).AddListener((UnityAction<int>)delegate(int i)
				{
					string text = dd.options[i].text;
					entry2.BoxedValue = Enum.Parse(t, text);
				});
				return;
			}
			((UnityEvent<string>)(object)UiFactory.CreateInput(val2.transform, uiSprite, font, entry2.BoxedValue?.ToString() ?? "").onEndEdit).AddListener((UnityAction<string>)delegate(string v)
			{
				try
				{
					if (t == typeof(string))
					{
						entry2.BoxedValue = v;
					}
					else
					{
						entry2.BoxedValue = Convert.ChangeType(v, t);
					}
				}
				catch
				{
				}
			});
			void Refresh(float v)
			{
				if (t == typeof(int))
				{
					entry2.BoxedValue = Mathf.RoundToInt(v);
				}
				else
				{
					entry2.BoxedValue = v;
				}
				float num = Convert.ToSingle(entry2.BoxedValue);
				if (Mathf.Approximately(max - min, 1f) || (min == 0f && max == 1f))
				{
					valueText.text = Mathf.RoundToInt(num * 100f) + "%";
				}
				else if (min == 0f && max == 100f)
				{
					valueText.text = Mathf.RoundToInt(num) + "%";
				}
				else
				{
					valueText.text = ((t == typeof(int)) ? ((int)num).ToString() : num.ToString("0.###"));
				}
			}
		}
	}
	internal static class MenuInjector
	{
		[CompilerGenerated]
		private sealed class <TryInjectCoroutine>d__0 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public ModsMenuUI ui;

			private int <i>5__2;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <TryInjectCoroutine>d__0(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<i>5__2 = 0;
					break;
				case 1:
					<>1__state = -1;
					<i>5__2++;
					break;
				}
				if (<i>5__2 < 120)
				{
					Component val = FindMenuController();
					if ((Object)(object)val != (Object)null && (Object)(object)ui != (Object)null && ui.TryInject(val))
					{
						return false;
					}
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[IteratorStateMachine(typeof(<TryInjectCoroutine>d__0))]
		internal static IEnumerator TryInjectCoroutine(ModsMenuUI ui)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <TryInjectCoroutine>d__0(0)
			{
				ui = ui
			};
		}

		private static Component FindMenuController()
		{
			Type type = ReflectionUtil.FindType("YAPYAP.MenuController");
			if (type == null)
			{
				return null;
			}
			Object obj = Object.FindObjectOfType(type);
			return (Component)(object)((obj is Component) ? obj : null);
		}
	}
	[BepInPlugin("yapyap.modsmenu", "YapYap Mods Menu", "1.0.0")]
	public class ModsMenuPlugin : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(GraphicRaycaster), "Raycast", new Type[]
		{
			typeof(PointerEventData),
			typeof(List<RaycastResult>)
		})]
		public static class GraphicRaycasterBlockingPatch
		{
			[HarmonyPrefix]
			public static bool Prefix(GraphicRaycaster __instance)
			{
				if (IsUIShown)
				{
					GameObject val = Instance?._ui?.CanvasRoot;
					if ((Object)(object)val == (Object)null)
					{
						return true;
					}
					if (!((Component)__instance).transform.IsChildOf(val.transform))
					{
						return false;
					}
				}
				return true;
			}
		}

		[HarmonyPatch(typeof(PhysicsRaycaster), "Raycast", new Type[]
		{
			typeof(PointerEventData),
			typeof(List<RaycastResult>)
		})]
		public static class PhysicsRaycasterBlockingPatch
		{
			[HarmonyPrefix]
			public static bool Prefix()
			{
				if (IsUIShown)
				{
					return false;
				}
				return true;
			}
		}

		private GameObject _root;

		private ModsMenuUI _ui;

		private string _lastScene;

		private Harmony _harmony;

		public static bool IsUIShown
		{
			get
			{
				if ((Object)(object)Instance?._ui != (Object)null)
				{
					return Instance._ui.IsVisible;
				}
				return false;
			}
		}

		public static ModsMenuPlugin Instance { get; private set; }

		private void Awake()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			Instance = this;
			_harmony = new Harmony("yapyap.modsmenu");
			_harmony.PatchAll();
			_root = new GameObject("YapYap_ModsMenu_Root");
			((Object)_root).hideFlags = (HideFlags)61;
			Object.DontDestroyOnLoad((Object)(object)_root);
			_ui = _root.AddComponent<ModsMenuUI>();
			((Object)_ui).hideFlags = (HideFlags)61;
			SceneManager.sceneLoaded += OnSceneLoaded;
		}

		private void OnDestroy()
		{
			SceneManager.sceneLoaded -= OnSceneLoaded;
			Harmony harmony = _harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
		}

		private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
		{
			if (!(_lastScene == ((Scene)(ref scene)).name))
			{
				_lastScene = ((Scene)(ref scene)).name;
				((MonoBehaviour)this).StartCoroutine(MenuInjector.TryInjectCoroutine(_ui));
			}
		}
	}
	public class ModsMenuUI : MonoBehaviour
	{
		private Component _menu;

		private Transform _buttonContainer;

		private GameObject _modsButton;

		private GameObject _canvasRoot;

		private CanvasGroup _cg;

		private TMP_FontAsset _font;

		private Sprite _uiSprite;

		private GameObject _dropdownPrefab;

		private bool _built;

		private string _selectedGuid;

		private Vector3 _originalPos;

		private bool _hasOriginalPos;

		private const int TargetSiblingIndex = 4;

		private static readonly Vector3 TargetLocalPos = new Vector3(0f, -1.45f, 0f);

		public bool IsVisible
		{
			get
			{
				if ((Object)(object)_canvasRoot != (Object)null)
				{
					return _canvasRoot.activeSelf;
				}
				return false;
			}
		}

		public GameObject CanvasRoot => _canvasRoot;

		public bool TryInject(Component menu)
		{
			_menu = menu;
			if ((Object)(object)_menu == (Object)null)
			{
				return false;
			}
			if ((Object)(object)_modsButton != (Object)null)
			{
				return true;
			}
			_buttonContainer = ReflectionUtil.GetField<Transform>(_menu, "_buttonContainer");
			if ((Object)(object)_buttonContainer == (Object)null)
			{
				return false;
			}
			_hasOriginalPos = false;
			Component field = ReflectionUtil.GetField<Component>(_menu, "_optionsUIButton3D");
			if ((Object)(object)field == (Object)null)
			{
				field = ReflectionUtil.GetField<Component>(_menu, "_playUIButton3D");
			}
			if ((Object)(object)field == (Object)null)
			{
				return false;
			}
			TMP_Dropdown componentInChildren = _menu.GetComponentInChildren<TMP_Dropdown>(true);
			if ((Object)(object)componentInChildren != (Object)null)
			{
				_dropdownPrefab = ((Component)componentInChildren).gameObject;
			}
			GameObject val = Object.Instantiate<GameObject>(field.gameObject, _buttonContainer);
			((Object)val).name = "ModsButton";
			((Object)val).hideFlags = (HideFlags)61;
			TMP_Text componentInChildren2 = val.GetComponentInChildren<TMP_Text>(true);
			if ((Object)(object)componentInChildren2 != (Object)null)
			{
				componentInChildren2.text = "Mods";
				_font = componentInChildren2.font;
			}
			Image componentInChildren3 = val.GetComponentInChildren<Image>(true);
			if ((Object)(object)componentInChildren3 != (Object)null && (Object)(object)componentInChildren3.sprite != (Object)null)
			{
				_uiSprite = componentInChildren3.sprite;
			}
			UiEvents.ClearUnityEvents(val);
			UiEvents.HookUnityEvent(val, delegate
			{
				Toggle(show: true);
			});
			_modsButton = val;
			ApplyButtonPlacement(_modsButton.transform);
			return true;
		}

		private void ApplyButtonPlacement(Transform tr)
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)tr == (Object)null))
			{
				if ((Object)(object)tr.parent != (Object)null)
				{
					int num = tr.parent.childCount - 1;
					int siblingIndex = Mathf.Clamp(4, 0, num);
					tr.SetSiblingIndex(siblingIndex);
				}
				tr.localPosition = TargetLocalPos;
			}
		}

		private void Toggle(bool show)
		{
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			if (!_built)
			{
				BuildUI();
			}
			if ((Object)(object)_canvasRoot == (Object)null)
			{
				return;
			}
			if ((Object)(object)_buttonContainer != (Object)null)
			{
				if (show)
				{
					if (!_hasOriginalPos)
					{
						_originalPos = _buttonContainer.localPosition;
						_hasOriginalPos = true;
					}
					_buttonContainer.localPosition = new Vector3(0f, -100000f, 0f);
				}
				else if (_hasOriginalPos)
				{
					_buttonContainer.localPosition = _originalPos;
				}
			}
			_canvasRoot.SetActive(show);
			_cg.alpha = (show ? 1f : 0f);
			_cg.blocksRaycasts = show;
			_cg.interactable = show;
		}

		private void BuildUI()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0307: Unknown result type (might be due to invalid IL or missing references)
			//IL_0344: Unknown result type (might be due to invalid IL or missing references)
			//IL_035e: Unknown result type (might be due to invalid IL or missing references)
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_037e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0394: Unknown result type (might be due to invalid IL or missing references)
			//IL_039e: Expected O, but got Unknown
			//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a9: Expected O, but got Unknown
			//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_040d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0412: Unknown result type (might be due to invalid IL or missing references)
			//IL_0424: Unknown result type (might be due to invalid IL or missing references)
			//IL_042c: Unknown result type (might be due to invalid IL or missing references)
			//IL_043d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0452: Unknown result type (might be due to invalid IL or missing references)
			//IL_045d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0467: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0531: Unknown result type (might be due to invalid IL or missing references)
			//IL_054d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0567: Unknown result type (might be due to invalid IL or missing references)
			//IL_0577: Unknown result type (might be due to invalid IL or missing references)
			//IL_0587: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0606: Unknown result type (might be due to invalid IL or missing references)
			//IL_0610: Unknown result type (might be due to invalid IL or missing references)
			_built = true;
			_canvasRoot = new GameObject("ModsMenuCanvas");
			_canvasRoot.transform.SetParent(((Component)this).transform, false);
			((Object)_canvasRoot).hideFlags = (HideFlags)61;
			Canvas obj = _canvasRoot.AddComponent<Canvas>();
			obj.renderMode = (RenderMode)0;
			obj.sortingOrder = 5000;
			_canvasRoot.AddComponent<GraphicRaycaster>().blockingObjects = (BlockingObjects)0;
			_cg = _canvasRoot.AddComponent<CanvasGroup>();
			_cg.alpha = 0f;
			_cg.blocksRaycasts = false;
			_cg.interactable = false;
			CanvasScaler obj2 = _canvasRoot.AddComponent<CanvasScaler>();
			obj2.uiScaleMode = (ScaleMode)1;
			obj2.referenceResolution = new Vector2(1920f, 1080f);
			Image obj3 = UiFactory.CreateImage(_canvasRoot.transform, "Dim", _uiSprite, new Color(0f, 0f, 0f, 0.65f));
			UiFactory.Rect((Component)(object)obj3).anchorMin = Vector2.zero;
			UiFactory.Rect((Component)(object)obj3).anchorMax = Vector2.one;
			UiFactory.Rect((Component)(object)obj3).offsetMin = Vector2.zero;
			UiFactory.Rect((Component)(object)obj3).offsetMax = Vector2.zero;
			((Graphic)obj3).raycastTarget = true;
			UiEvents.HookPointerDown(((Component)obj3).gameObject, delegate
			{
				Toggle(show: false);
			});
			Image val = UiFactory.CreateImage(_canvasRoot.transform, "Panel", _uiSprite, new Color(0.08f, 0.08f, 0.1f, 0.96f));
			UiFactory.Rect((Component)(object)val).anchorMin = new Vector2(0.08f, 0.08f);
			UiFactory.Rect((Component)(object)val).anchorMax = new Vector2(0.92f, 0.92f);
			UiFactory.Rect((Component)(object)val).offsetMin = Vector2.zero;
			UiFactory.Rect((Component)(object)val).offsetMax = Vector2.zero;
			((Graphic)val).raycastTarget = true;
			((Component)val).gameObject.AddComponent<Shadow>().effectDistance = new Vector2(8f, -8f);
			TMP_Text c = UiFactory.CreateText(((Component)val).transform, "Header", _font, "Mods", 44, (TextAlignmentOptions)513, Color.white, raycastTarget: false);
			UiFactory.Rect((Component)(object)c).anchorMin = new Vector2(0.03f, 0.87f);
			UiFactory.Rect((Component)(object)c).anchorMax = new Vector2(0.6f, 0.98f);
			UiFactory.Rect((Component)(object)c).offsetMin = Vector2.zero;
			UiFactory.Rect((Component)(object)c).offsetMax = Vector2.zero;
			TMP_Text c2 = UiFactory.CreateText(((Component)val).transform, "Sub", _font, "Edit mod configs", 22, (TextAlignmentOptions)513, new Color(1f, 1f, 1f, 0.75f), raycastTarget: false);
			UiFactory.Rect((Component)(object)c2).anchorMin = new Vector2(0.03f, 0.82f);
			UiFactory.Rect((Component)(object)c2).anchorMax = new Vector2(0.6f, 0.9f);
			UiFactory.Rect((Component)(object)c2).offsetMin = Vector2.zero;
			UiFactory.Rect((Component)(object)c2).offsetMax = Vector2.zero;
			Button obj4 = UiFactory.CreateButton(((Component)val).transform, "Close", _uiSprite, _font, "X", 28);
			UiFactory.Rect((Component)(object)obj4).anchorMin = new Vector2(0.94f, 0.91f);
			UiFactory.Rect((Component)(object)obj4).anchorMax = new Vector2(0.985f, 0.975f);
			UiFactory.Rect((Component)(object)obj4).offsetMin = Vector2.zero;
			UiFactory.Rect((Component)(object)obj4).offsetMax = Vector2.zero;
			((UnityEvent)obj4.onClick).AddListener((UnityAction)delegate
			{
				Toggle(show: false);
			});
			GameObject val2 = new GameObject("Left");
			val2.transform.SetParent(((Component)val).transform, false);
			((Object)val2).hideFlags = (HideFlags)61;
			RectTransform obj5 = val2.AddComponent<RectTransform>();
			obj5.anchorMin = new Vector2(0.03f, 0.05f);
			obj5.anchorMax = new Vector2(0.32f, 0.8f);
			obj5.offsetMin = Vector2.zero;
			obj5.offsetMax = Vector2.zero;
			GameObject val3 = new GameObject("Right");
			val3.transform.SetParent(((Component)val).transform, false);
			((Object)val3).hideFlags = (HideFlags)61;
			RectTransform obj6 = val3.AddComponent<RectTransform>();
			obj6.anchorMin = new Vector2(0.35f, 0.05f);
			obj6.anchorMax = new Vector2(0.97f, 0.8f);
			obj6.offsetMin = Vector2.zero;
			obj6.offsetMax = Vector2.zero;
			TMP_Text c3 = UiFactory.CreateText(((Component)val).transform, "ModsTitle", _font, "Mods", 22, (TextAlignmentOptions)513, new Color(1f, 1f, 1f, 0.85f), raycastTarget: false);
			UiFactory.Rect((Component)(object)c3).anchorMin = new Vector2(0.03f, 0.79f);
			UiFactory.Rect((Component)(object)c3).anchorMax = new Vector2(0.32f, 0.84f);
			UiFactory.Rect((Component)(object)c3).offsetMin = Vector2.zero;
			UiFactory.Rect((Component)(object)c3).offsetMax = Vector2.zero;
			TMP_Text val4 = UiFactory.CreateText(((Component)val).transform, "ConfigTitle", _font, "Config", 22, (TextAlignmentOptions)513, new Color(1f, 1f, 1f, 0.85f), raycastTarget: false);
			UiFactory.Rect((Component)(object)val4).anchorMin = new Vector2(0.35f, 0.79f);
			UiFactory.Rect((Component)(object)val4).anchorMax = new Vector2(0.97f, 0.84f);
			UiFactory.Rect((Component)(object)val4).offsetMin = Vector2.zero;
			UiFactory.Rect((Component)(object)val4).offsetMax = Vector2.zero;
			RectTransform content;
			RectTransform viewport;
			RectTransform component = UiFactory.CreateScroll(val2.transform, _uiSprite, out content, out viewport).GetComponent<RectTransform>();
			component.anchorMin = Vector2.zero;
			component.anchorMax = Vector2.one;
			component.offsetMin = Vector2.zero;
			component.offsetMax = Vector2.zero;
			RectTransform content2;
			RectTransform component2 = UiFactory.CreateScroll(val3.transform, _uiSprite, out content2, out viewport).GetComponent<RectTransform>();
			component2.anchorMin = Vector2.zero;
			component2.anchorMax = Vector2.one;
			component2.offsetMin = Vector2.zero;
			component2.offsetMax = Vector2.zero;
			PopulateMods(((Component)content).transform, ((Component)content2).transform, val4);
			Toggle(show: false);
		}

		private void PopulateMods(Transform modsContent, Transform entriesContent, TMP_Text rightTitle)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Expected O, but got Unknown
			Transform modsContent2 = modsContent;
			Transform entriesContent2 = entriesContent;
			TMP_Text rightTitle2 = rightTitle;
			foreach (Transform item in modsContent2)
			{
				Object.Destroy((Object)(object)((Component)item).gameObject);
			}
			var plugins = (from p in Chainloader.PluginInfos.Values
				select new
				{
					GUID = p.Metadata.GUID,
					Name = p.Metadata.Name,
					Version = p.Metadata.Version.ToString(),
					Instance = p.Instance
				} into p
				where (Object)(object)p.Instance != (Object)null && ConfigUtil.GetConfigEntries(p.Instance.Config).Any()
				orderby p.Name
				select p).ToList();
			if (plugins.Count == 0)
			{
				TMP_Text c = UiFactory.CreateText(modsContent2, "NoMods", _font, "No mod configs found", 20, (TextAlignmentOptions)514, new Color(1f, 1f, 1f, 0.7f), raycastTarget: false);
				UiFactory.Rect((Component)(object)c).anchorMin = new Vector2(0f, 0f);
				UiFactory.Rect((Component)(object)c).anchorMax = new Vector2(1f, 1f);
				UiFactory.Rect((Component)(object)c).offsetMin = Vector2.zero;
				UiFactory.Rect((Component)(object)c).offsetMax = Vector2.zero;
				return;
			}
			if (string.IsNullOrEmpty(_selectedGuid) || !plugins.Any(x => x.GUID == _selectedGuid))
			{
				_selectedGuid = plugins[0].GUID;
			}
			foreach (var item2 in plugins)
			{
				Button obj = CreateModRow(modsContent2, item2.Name, item2.Version, item2.GUID == _selectedGuid);
				string guid = item2.GUID;
				((UnityEvent)obj.onClick).AddListener((UnityAction)delegate
				{
					_selectedGuid = guid;
					PopulateMods(modsContent2, entriesContent2, rightTitle2);
					PopulateEntries(entriesContent2, rightTitle2, plugins.First(x => x.GUID == guid).Instance);
				});
			}
			var anon = plugins.FirstOrDefault(x => x.GUID == _selectedGuid) ?? plugins[0];
			PopulateEntries(entriesContent2, rightTitle2, anon.Instance);
		}

		private Button CreateModRow(Transform parent, string name, string version, bool selected)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("ModRow");
			val.transform.SetParent(parent, false);
			((Object)val).hideFlags = (HideFlags)61;
			val.AddComponent<RectTransform>().sizeDelta = new Vector2(0f, 74f);
			Image val2 = val.AddComponent<Image>();
			val2.sprite = _uiSprite;
			val2.type = (Type)(((Object)(object)_uiSprite != (Object)null) ? 1 : 0);
			((Graphic)val2).color = (selected ? new Color(0.23f, 0.26f, 0.35f, 0.95f) : new Color(0.14f, 0.15f, 0.2f, 0.9f));
			((Graphic)val2).raycastTarget = true;
			Button val3 = val.AddComponent<Button>();
			ColorBlock colors = ((Selectable)val3).colors;
			((ColorBlock)(ref colors)).fadeDuration = 0.08f;
			((ColorBlock)(ref colors)).highlightedColor = new Color(0.28f, 0.3f, 0.4f, 1f);
			((ColorBlock)(ref colors)).pressedColor = new Color(0.18f, 0.2f, 0.28f, 1f);
			((ColorBlock)(ref colors)).normalColor = ((Graphic)val2).color;
			((Selectable)val3).colors = colors;
			TMP_Text c = UiFactory.CreateText(val.transform, "Name", _font, name, 22, (TextAlignmentOptions)513, Color.white, raycastTarget: false);
			UiFactory.Rect((Component)(object)c).anchorMin = new Vector2(0.06f, 0.38f);
			UiFactory.Rect((Component)(object)c).anchorMax = new Vector2(0.94f, 0.92f);
			UiFactory.Rect((Component)(object)c).offsetMin = Vector2.zero;
			UiFactory.Rect((Component)(object)c).offsetMax = Vector2.zero;
			TMP_Text c2 = UiFactory.CreateText(val.transform, "Version", _font, version, 16, (TextAlignmentOptions)513, new Color(1f, 1f, 1f, 0.65f), raycastTarget: false);
			UiFactory.Rect((Component)(object)c2).anchorMin = new Vector2(0.06f, 0.1f);
			UiFactory.Rect((Component)(object)c2).anchorMax = new Vector2(0.94f, 0.42f);
			UiFactory.Rect((Component)(object)c2).offsetMin = Vector2.zero;
			UiFactory.Rect((Component)(object)c2).offsetMax = Vector2.zero;
			LayoutElement obj = val.AddComponent<LayoutElement>();
			obj.minHeight = 74f;
			obj.flexibleWidth = 1f;
			return val3;
		}

		private void PopulateEntries(Transform entriesContent, TMP_Text rightTitle, BaseUnityPlugin plugin)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			foreach (Transform item in entriesContent)
			{
				Object.Destroy((Object)(object)((Component)item).gameObject);
			}
			rightTitle.text = plugin.Info.Metadata.Name + " Config";
			List<ConfigEntryBase> list = ConfigUtil.GetConfigEntries(plugin.Config).OrderBy<ConfigEntryBase, string>((ConfigEntryBase e) => e.Definition.Section, StringComparer.OrdinalIgnoreCase).ThenBy<ConfigEntryBase, string>((ConfigEntryBase e) => e.Definition.Key, StringComparer.OrdinalIgnoreCase)
				.ToList();
			if (list.Count == 0)
			{
				TMP_Text c = UiFactory.CreateText(entriesContent, "NoEntries", _font, "No config entries", 20, (TextAlignmentOptions)514, new Color(1f, 1f, 1f, 0.7f), raycastTarget: false);
				UiFactory.Rect((Component)(object)c).anchorMin = new Vector2(0f, 0f);
				UiFactory.Rect((Component)(object)c).anchorMax = new Vector2(1f, 1f);
				UiFactory.Rect((Component)(object)c).offsetMin = Vector2.zero;
				UiFactory.Rect((Component)(object)c).offsetMax = Vector2.zero;
				return;
			}
			string text = null;
			foreach (ConfigEntryBase item2 in list)
			{
				if (text != item2.Definition.Section)
				{
					text = item2.Definition.Section;
					TMP_Text obj = UiFactory.CreateText(entriesContent, "Section_" + text, _font, text, 22, (TextAlignmentOptions)513, new Color(1f, 1f, 1f, 0.9f), raycastTarget: false);
					obj.margin = new Vector4(0f, 10f, 0f, 6f);
					((Component)obj).gameObject.AddComponent<LayoutElement>().minHeight = 40f;
				}
				EntryRowBuilder.CreateEntryRow(entriesContent, item2, _uiSprite, _font, _dropdownPrefab);
			}
		}
	}
	internal static class ReflectionUtil
	{
		internal static Type FindType(string fullName)
		{
			Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
			foreach (Assembly assembly in assemblies)
			{
				try
				{
					Type type = assembly.GetType(fullName, throwOnError: false);
					if (type != null)
					{
						return type;
					}
				}
				catch
				{
				}
			}
			return null;
		}

		internal static T GetField<T>(object obj, string name) where T : class
		{
			if (obj == null)
			{
				return null;
			}
			FieldInfo field = obj.GetType().GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			if (!(field != null))
			{
				return null;
			}
			return field.GetValue(obj) as T;
		}
	}
	internal static class UiEvents
	{
		internal static void ClearUnityEvents(GameObject go)
		{
			MonoBehaviour[] componentsInChildren = go.GetComponentsInChildren<MonoBehaviour>(true);
			foreach (MonoBehaviour val in componentsInChildren)
			{
				Type type = ((object)val).GetType();
				PropertyInfo[] properties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
				foreach (PropertyInfo propertyInfo in properties)
				{
					if (propertyInfo.PropertyType == typeof(UnityEvent) && propertyInfo.CanRead)
					{
						object? value = propertyInfo.GetValue(val);
						object? obj = ((value is UnityEvent) ? value : null);
						if (obj != null)
						{
							((UnityEventBase)obj).RemoveAllListeners();
						}
					}
				}
				FieldInfo[] fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
				foreach (FieldInfo fieldInfo in fields)
				{
					if (typeof(UnityEventBase).IsAssignableFrom(fieldInfo.FieldType))
					{
						object? value2 = fieldInfo.GetValue(val);
						object? obj2 = ((value2 is UnityEventBase) ? value2 : null);
						UnityEvent val2 = (UnityEvent)((obj2 is UnityEvent) ? obj2 : null);
						if (val2 != null)
						{
							((UnityEventBase)val2).RemoveAllListeners();
						}
					}
				}
			}
			Button[] componentsInChildren2 = go.GetComponentsInChildren<Button>(true);
			for (int i = 0; i < componentsInChildren2.Length; i++)
			{
				((UnityEventBase)componentsInChildren2[i].onClick).RemoveAllListeners();
			}
		}

		internal static void HookUnityEvent(GameObject go, Action action)
		{
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			//IL_004a: Expected O, but got Unknown
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Expected O, but got Unknown
			//IL_00e0: Expected O, but got Unknown
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Expected O, but got Unknown
			//IL_0168: Expected O, but got Unknown
			Action action2 = action;
			Button[] componentsInChildren = go.GetComponentsInChildren<Button>(true);
			int num = 0;
			if (num < componentsInChildren.Length)
			{
				Button obj = componentsInChildren[num];
				((UnityEventBase)obj.onClick).RemoveAllListeners();
				ButtonClickedEvent onClick = obj.onClick;
				UnityAction val = default(UnityAction);
				UnityAction obj2 = val;
				if (obj2 == null)
				{
					UnityAction val2 = delegate
					{
						action2();
					};
					UnityAction val3 = val2;
					val = val2;
					obj2 = val3;
				}
				((UnityEvent)onClick).AddListener(obj2);
				return;
			}
			MonoBehaviour[] componentsInChildren2 = go.GetComponentsInChildren<MonoBehaviour>(true);
			UnityAction val6 = default(UnityAction);
			UnityAction val9 = default(UnityAction);
			foreach (MonoBehaviour val4 in componentsInChildren2)
			{
				Type type = ((object)val4).GetType();
				FieldInfo[] fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
				foreach (FieldInfo fieldInfo in fields)
				{
					if (!typeof(UnityEvent).IsAssignableFrom(fieldInfo.FieldType))
					{
						continue;
					}
					object? value = fieldInfo.GetValue(val4);
					UnityEvent val5 = (UnityEvent)((value is UnityEvent) ? value : null);
					if (val5 == null)
					{
						continue;
					}
					((UnityEventBase)val5).RemoveAllListeners();
					UnityAction obj3 = val6;
					if (obj3 == null)
					{
						UnityAction val7 = delegate
						{
							action2();
						};
						UnityAction val3 = val7;
						val6 = val7;
						obj3 = val3;
					}
					val5.AddListener(obj3);
					return;
				}
				PropertyInfo[] properties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
				foreach (PropertyInfo propertyInfo in properties)
				{
					if (!(propertyInfo.PropertyType == typeof(UnityEvent)) || !propertyInfo.CanRead)
					{
						continue;
					}
					object? value2 = propertyInfo.GetValue(val4);
					UnityEvent val8 = (UnityEvent)((value2 is UnityEvent) ? value2 : null);
					if (val8 == null)
					{
						continue;
					}
					((UnityEventBase)val8).RemoveAllListeners();
					UnityAction obj4 = val9;
					if (obj4 == null)
					{
						UnityAction val10 = delegate
						{
							action2();
						};
						UnityAction val3 = val10;
						val9 = val10;
						obj4 = val3;
					}
					val8.AddListener(obj4);
					return;
				}
			}
		}

		internal static void HookPointerDown(GameObject go, Action action)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			Action action2 = action;
			EventTrigger val = go.GetComponent<EventTrigger>();
			if ((Object)(object)val == (Object)null)
			{
				val = go.AddComponent<EventTrigger>();
			}
			Entry val2 = new Entry
			{
				eventID = (EventTriggerType)2
			};
			((UnityEvent<BaseEventData>)(object)val2.callback).AddListener((UnityAction<BaseEventData>)delegate
			{
				action2();
			});
			val.triggers.Add(val2);
		}
	}
	internal static class UiFactory
	{
		internal static RectTransform Rect(Component c)
		{
			return c.GetComponent<RectTransform>();
		}

		internal static Image CreateImage(Transform parent, string name, Sprite sprite, Color col)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject(name);
			val.transform.SetParent(parent, false);
			((Object)val).hideFlags = (HideFlags)61;
			Image obj = val.AddComponent<Image>();
			obj.sprite = sprite;
			obj.type = (Type)(((Object)(object)sprite != (Object)null) ? 1 : 0);
			((Graphic)obj).color = col;
			return obj;
		}

		internal static TMP_Text CreateText(Transform parent, string name, TMP_FontAsset font, string text, int size, TextAlignmentOptions align, Color col, bool raycastTarget)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject(name);
			val.transform.SetParent(parent, false);
			((Object)val).hideFlags = (HideFlags)61;
			TextMeshProUGUI val2 = val.AddComponent<TextMeshProUGUI>();
			((TMP_Text)val2).text = text;
			((TMP_Text)val2).fontSize = size;
			((TMP_Text)val2).alignment = align;
			((Graphic)val2).color = col;
			if ((Object)(object)font != (Object)null)
			{
				((TMP_Text)val2).font = font;
			}
			((Graphic)val2).raycastTarget = raycastTarget;
			((TMP_Text)val2).overflowMode = (TextOverflowModes)0;
			((TMP_Text)val2).enableWordWrapping = false;
			return (TMP_Text)(object)val2;
		}

		internal static Button CreateButton(Transform parent, string name, Sprite sprite, TMP_FontAsset font, string label, int fontSize)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject(name);
			val.transform.SetParent(parent, false);
			((Object)val).hideFlags = (HideFlags)61;
			Image val2 = val.AddComponent<Image>();
			val2.sprite = sprite;
			val2.type = (Type)(((Object)(object)sprite != (Object)null) ? 1 : 0);
			((Graphic)val2).color = new Color(0.16f, 0.17f, 0.23f, 0.95f);
			Button val3 = val.AddComponent<Button>();
			ColorBlock colors = ((Selectable)val3).colors;
			((ColorBlock)(ref colors)).fadeDuration = 0.08f;
			((ColorBlock)(ref colors)).highlightedColor = new Color(0.25f, 0.26f, 0.35f, 1f);
			((ColorBlock)(ref colors)).pressedColor = new Color(0.13f, 0.14f, 0.2f, 1f);
			((ColorBlock)(ref colors)).normalColor = ((Graphic)val2).color;
			((Selectable)val3).colors = colors;
			TMP_Text c = CreateText(val.transform, "Text", font, label, fontSize, (TextAlignmentOptions)514, Color.white, raycastTarget: false);
			Rect((Component)(object)c).anchorMin = Vector2.zero;
			Rect((Component)(object)c).anchorMax = Vector2.one;
			Rect((Component)(object)c).offsetMin = Vector2.zero;
			Rect((Component)(object)c).offsetMax = Vector2.zero;
			return val3;
		}

		internal static GameObject CreateScroll(Transform parent, Sprite sprite, out RectTransform content, out RectTransform viewport)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Expected O, but got Unknown
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Expected O, but got Unknown
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Expected O, but got Unknown
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0293: Expected O, but got Unknown
			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0306: Unknown result type (might be due to invalid IL or missing references)
			//IL_0340: Unknown result type (might be due to invalid IL or missing references)
			//IL_035d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0373: Unknown result type (might be due to invalid IL or missing references)
			//IL_0389: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("Scroll");
			val.transform.SetParent(parent, false);
			((Object)val).hideFlags = (HideFlags)61;
			Image obj = val.AddComponent<Image>();
			obj.sprite = sprite;
			obj.type = (Type)(((Object)(object)sprite != (Object)null) ? 1 : 0);
			((Graphic)obj).color = new Color(0.1f, 0.1f, 0.12f, 0.85f);
			val.AddComponent<Mask>().showMaskGraphic = false;
			viewport = val.GetComponent<RectTransform>();
			viewport.anchorMin = Vector2.zero;
			viewport.anchorMax = Vector2.one;
			viewport.offsetMin = Vector2.zero;
			viewport.offsetMax = Vector2.zero;
			GameObject val2 = new GameObject("Content");
			val2.transform.SetParent(val.transform, false);
			((Object)val2).hideFlags = (HideFlags)61;
			content = val2.AddComponent<RectTransform>();
			content.anchorMin = new Vector2(0f, 1f);
			content.anchorMax = new Vector2(1f, 1f);
			content.pivot = new Vector2(0.5f, 1f);
			content.anchoredPosition = Vector2.zero;
			content.sizeDelta = new Vector2(0f, 0f);
			VerticalLayoutGroup obj2 = val2.AddComponent<VerticalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)obj2).childControlWidth = true;
			((HorizontalOrVerticalLayoutGroup)obj2).childForceExpandWidth = true;
			((HorizontalOrVerticalLayoutGroup)obj2).childControlHeight = true;
			((HorizontalOrVerticalLayoutGroup)obj2).childForceExpandHeight = false;
			((HorizontalOrVerticalLayoutGroup)obj2).spacing = 8f;
			((LayoutGroup)obj2).padding = new RectOffset(10, 10, 10, 10);
			val2.AddComponent<ContentSizeFitter>().verticalFit = (FitMode)2;
			ScrollRect obj3 = val.AddComponent<ScrollRect>();
			obj3.viewport = viewport;
			obj3.content = content;
			obj3.horizontal = false;
			obj3.movementType = (MovementType)2;
			obj3.inertia = true;
			obj3.scrollSensitivity = 28f;
			GameObject val3 = new GameObject("Scrollbar");
			val3.transform.SetParent(parent, false);
			((Object)val3).hideFlags = (HideFlags)61;
			Scrollbar val4 = val3.AddComponent<Scrollbar>();
			RectTransform component = val3.GetComponent<RectTransform>();
			component.anchorMin = new Vector2(1f, 0f);
			component.anchorMax = new Vector2(1f, 1f);
			component.pivot = new Vector2(1f, 0.5f);
			component.sizeDelta = new Vector2(12f, 0f);
			component.anchoredPosition = new Vector2(-4f, 0f);
			Image obj4 = val3.AddComponent<Image>();
			obj4.sprite = sprite;
			obj4.type = (Type)(((Object)(object)sprite != (Object)null) ? 1 : 0);
			((Graphic)obj4).color = new Color(0f, 0f, 0f, 0f);
			GameObject val5 = new GameObject("SlidingArea");
			val5.transform.SetParent(val3.transform, false);
			((Object)val5).hideFlags = (HideFlags)61;
			RectTransform obj5 = val5.AddComponent<RectTransform>();
			obj5.anchorMin = Vector2.zero;
			obj5.anchorMax = Vector2.one;
			obj5.offsetMin = Vector2.zero;
			obj5.offsetMax = Vector2.zero;
			GameObject val6 = new GameObject("Handle");
			val6.transform.SetParent(val5.transform, false);
			((Object)val6).hideFlags = (HideFlags)61;
			Image val7 = val6.AddComponent<Image>();
			val7.sprite = sprite;
			val7.type = (Type)(((Object)(object)sprite != (Object)null) ? 1 : 0);
			((Graphic)val7).color = new Color(1f, 1f, 1f, 0.55f);
			RectTransform component2 = val6.GetComponent<RectTransform>();
			component2.anchorMin = new Vector2(0f, 0f);
			component2.anchorMax = new Vector2(1f, 1f);
			component2.sizeDelta = new Vector2(0f, 60f);
			val4.handleRect = component2;
			((Selectable)val4).targetGraphic = (Graphic)(object)val7;
			val4.direction = (Direction)2;
			val4.size = 0.3f;
			obj3.verticalScrollbar = val4;
			obj3.verticalScrollbarVisibility = (ScrollbarVisibility)2;
			obj3.verticalScrollbarSpacing = -16f;
			return val;
		}

		internal static Toggle CreateToggle(Transform parent, Sprite sprite, TMP_FontAsset font, bool value)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Expected O, but got Unknown
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_030f: Unknown result type (might be due to invalid IL or missing references)
			//IL_031e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0360: Unknown result type (might be due to invalid IL or missing references)
			//IL_0359: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0373: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("Toggle");
			val.transform.SetParent(parent, false);
			((Object)val).hideFlags = (HideFlags)61;
			RectTransform obj = val.AddComponent<RectTransform>();
			obj.anchorMin = new Vector2(0f, 0.2f);
			obj.anchorMax = new Vector2(1f, 0.8f);
			obj.offsetMin = Vector2.zero;
			obj.offsetMax = Vector2.zero;
			GameObject val2 = new GameObject("Bg");
			val2.transform.SetParent(val.transform, false);
			((Object)val2).hideFlags = (HideFlags)61;
			Image val3 = val2.AddComponent<Image>();
			val3.sprite = sprite;
			val3.type = (Type)(((Object)(object)sprite != (Object)null) ? 1 : 0);
			((Graphic)val3).color = new Color(0.1f, 0.1f, 0.12f, 0.95f);
			RectTransform component = val2.GetComponent<RectTransform>();
			component.anchorMin = Vector2.zero;
			component.anchorMax = new Vector2(0.38f, 1f);
			component.offsetMin = Vector2.zero;
			component.offsetMax = Vector2.zero;
			GameObject val4 = new GameObject("CheckArea");
			val4.transform.SetParent(val2.transform, false);
			((Object)val4).hideFlags = (HideFlags)61;
			Image val5 = val4.AddComponent<Image>();
			val5.sprite = sprite;
			val5.type = (Type)(((Object)(object)sprite != (Object)null) ? 1 : 0);
			((Graphic)val5).color = new Color(0.3f, 0.6f, 0.9f, 1f);
			RectTransform component2 = val4.GetComponent<RectTransform>();
			component2.anchorMin = new Vector2(0.1f, 0.1f);
			component2.anchorMax = new Vector2(0.9f, 0.9f);
			component2.offsetMin = Vector2.zero;
			component2.offsetMax = Vector2.zero;
			TMP_Text onLabel = CreateText(val.transform, "OnLabel", font, "ON", 16, (TextAlignmentOptions)514, Color.white, raycastTarget: false);
			Rect((Component)(object)onLabel).anchorMin = new Vector2(0.4f, 0f);
			Rect((Component)(object)onLabel).anchorMax = new Vector2(0.7f, 1f);
			Rect((Component)(object)onLabel).offsetMin = Vector2.zero;
			Rect((Component)(object)onLabel).offsetMax = Vector2.zero;
			TMP_Text offLabel = CreateText(val.transform, "OffLabel", font, "OFF", 16, (TextAlignmentOptions)514, new Color(1f, 1f, 1f, 0.5f), raycastTarget: false);
			Rect((Component)(object)offLabel).anchorMin = new Vector2(0.7f, 0f);
			Rect((Component)(object)offLabel).anchorMax = new Vector2(1f, 1f);
			Rect((Component)(object)offLabel).offsetMin = Vector2.zero;
			Rect((Component)(object)offLabel).offsetMax = Vector2.zero;
			Toggle obj2 = val.AddComponent<Toggle>();
			((Selectable)obj2).targetGraphic = (Graphic)(object)val3;
			obj2.graphic = (Graphic)(object)val5;
			obj2.isOn = value;
			ColorBlock colors = ((Selectable)obj2).colors;
			((ColorBlock)(ref colors)).fadeDuration = 0.1f;
			((Selectable)obj2).colors = colors;
			((UnityEvent<bool>)(object)obj2.onValueChanged).AddListener((UnityAction<bool>)delegate(bool v)
			{
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0052: Unknown result type (might be due to invalid IL or missing references)
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				((Graphic)onLabel).color = (Color)(v ? Color.white : new Color(1f, 1f, 1f, 0.5f));
				((Graphic)offLabel).color = (Color)(v ? new Color(1f, 1f, 1f, 0.5f) : Color.white);
			});
			((Graphic)onLabel).color = (Color)(value ? Color.white : new Color(1f, 1f, 1f, 0.5f));
			((Graphic)offLabel).color = (Color)(value ? new Color(1f, 1f, 1f, 0.5f) : Color.white);
			return obj2;
		}

		internal static Slider CreateSlider(Transform parent, Sprite sprite)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Expected O, but got Unknown
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("Slider");
			val.transform.SetParent(parent, false);
			((Object)val).hideFlags = (HideFlags)61;
			RectTransform obj = val.AddComponent<RectTransform>();
			obj.anchorMin = new Vector2(0f, 0.1f);
			obj.anchorMax = new Vector2(1f, 0.6f);
			obj.offsetMin = Vector2.zero;
			obj.offsetMax = Vector2.zero;
			GameObject val2 = new GameObject("Bg");
			val2.transform.SetParent(val.transform, false);
			((Object)val2).hideFlags = (HideFlags)61;
			Image obj2 = val2.AddComponent<Image>();
			obj2.sprite = sprite;
			obj2.type = (Type)(((Object)(object)sprite != (Object)null) ? 1 : 0);
			((Graphic)obj2).color = new Color(0.1f, 0.1f, 0.12f, 0.95f);
			RectTransform component = val2.GetComponent<RectTransform>();
			component.anchorMin = Vector2.zero;
			component.anchorMax = Vector2.one;
			component.offsetMin = Vector2.zero;
			component.offsetMax = Vector2.zero;
			GameObject val3 = new GameObject("Fill");
			val3.transform.SetParent(val2.transform, false);
			((Object)val3).hideFlags = (HideFlags)61;
			Image obj3 = val3.AddComponent<Image>();
			obj3.sprite = sprite;
			obj3.type = (Type)(((Object)(object)sprite != (Object)null) ? 1 : 0);
			((Graphic)obj3).color = new Color(0.3f, 0.6f, 0.9f, 1f);
			RectTransform component2 = val3.GetComponent<RectTransform>();
			component2.anchorMin = Vector2.zero;
			component2.anchorMax = Vector2.one;
			component2.offsetMin = Vector2.zero;
			component2.offsetMax = Vector2.zero;
			GameObject val4 = new GameObject("Handle");
			val4.transform.SetParent(val.transform, false);
			((Object)val4).hideFlags = (HideFlags)61;
			Image val5 = val4.AddComponent<Image>();
			val5.sprite = sprite;
			val5.type = (Type)(((Object)(object)sprite != (Object)null) ? 1 : 0);
			((Graphic)val5).color = new Color(1f, 1f, 1f, 1f);
			RectTransform component3 = val4.GetComponent<RectTransform>();
			component3.anchorMin = new Vector2(0f, 0.5f);
			component3.anchorMax = new Vector2(0f, 0.5f);
			component3.pivot = new Vector2(0.5f, 0.5f);
			component3.sizeDelta = new Vector2(24f, 40f);
			Slider obj4 = val.AddComponent<Slider>();
			((Selectable)obj4).targetGraphic = (Graphic)(object)val5;
			obj4.fillRect = component2;
			obj4.handleRect = component3;
			obj4.direction = (Direction)0;
			return obj4;
		}

		internal static TMP_InputField CreateInput(Transform parent, Sprite sprite, TMP_FontAsset font, string text)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("Input");
			val.transform.SetParent(parent, false);
			((Object)val).hideFlags = (HideFlags)61;
			Image val2 = val.AddComponent<Image>();
			val2.sprite = sprite;
			val2.type = (Type)(((Object)(object)sprite != (Object)null) ? 1 : 0);
			((Graphic)val2).color = new Color(0.1f, 0.1f, 0.12f, 0.95f);
			RectTransform component = val.GetComponent<RectTransform>();
			component.anchorMin = new Vector2(0f, 0.2f);
			component.anchorMax = new Vector2(1f, 0.8f);
			component.offsetMin = Vector2.zero;
			component.offsetMax = Vector2.zero;
			GameObject val3 = new GameObject("TextArea");
			val3.transform.SetParent(val.transform, false);
			((Object)val3).hideFlags = (HideFlags)61;
			val3.AddComponent<RectMask2D>();
			RectTransform component2 = val3.GetComponent<RectTransform>();
			component2.anchorMin = Vector2.zero;
			component2.anchorMax = Vector2.one;
			component2.offsetMin = new Vector2(10f, 6f);
			component2.offsetMax = new Vector2(-10f, -6f);
			TMP_Text obj = CreateText(val3.transform, "Text", font, text, 18, (TextAlignmentOptions)513, Color.white, raycastTarget: false);
			TextMeshProUGUI val4 = (TextMeshProUGUI)(object)((obj is TextMeshProUGUI) ? obj : null);
			Rect((Component)(object)val4).anchorMin = Vector2.zero;
			Rect((Component)(object)val4).anchorMax = Vector2.one;
			Rect((Component)(object)val4).offsetMin = Vector2.zero;
			Rect((Component)(object)val4).offsetMax = Vector2.zero;
			TMP_Text val5 = CreateText(val3.transform, "Placeholder", font, "", 18, (TextAlignmentOptions)513, new Color(1f, 1f, 1f, 0.3f), raycastTarget: false);
			Rect((Component)(object)val5).anchorMin = Vector2.zero;
			Rect((Component)(object)val5).anchorMax = Vector2.one;
			Rect((Component)(object)val5).offsetMin = Vector2.zero;
			Rect((Component)(object)val5).offsetMax = Vector2.zero;
			TMP_InputField obj2 = val.AddComponent<TMP_InputField>();
			obj2.textViewport = component2;
			obj2.textComponent = (TMP_Text)(object)val4;
			obj2.placeholder = (Graphic)(object)val5;
			((Selectable)obj2).targetGraphic = (Graphic)(object)val2;
			ColorBlock colors = ((Selectable)obj2).colors;
			((ColorBlock)(ref colors)).fadeDuration = 0.1f;
			((Selectable)obj2).colors = colors;
			obj2.text = text;
			return obj2;
		}

		internal static TMP_Dropdown CreateDropdown(Transform parent, Sprite sprite, TMP_FontAsset font, GameObject prefab, List<string> options)
		{
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Expected O, but got Unknown
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_027a: Unknown result type (might be due to invalid IL or missing references)
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Expected O, but got Unknown
			//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0318: Unknown result type (might be due to invalid IL or missing references)
			//IL_032d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0342: Unknown result type (might be due to invalid IL or missing references)
			//IL_0357: Unknown result type (might be due to invalid IL or missing references)
			//IL_036c: Unknown result type (might be due to invalid IL or missing references)
			//IL_037b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0382: Expected O, but got Unknown
			//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03eb: Expected O, but got Unknown
			//IL_041d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0433: Unknown result type (might be due to invalid IL or missing references)
			//IL_0449: Unknown result type (might be due to invalid IL or missing references)
			//IL_0455: Unknown result type (might be due to invalid IL or missing references)
			//IL_046b: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b1: Expected O, but got Unknown
			//IL_04e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ed: Expected O, but got Unknown
			//IL_051b: Unknown result type (might be due to invalid IL or missing references)
			//IL_056e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0581: Unknown result type (might be due to invalid IL or missing references)
			//IL_0586: Unknown result type (might be due to invalid IL or missing references)
			//IL_059e: Unknown result type (might be due to invalid IL or missing references)
			//IL_05be: Unknown result type (might be due to invalid IL or missing references)
			//IL_05de: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_061e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0641: Unknown result type (might be due to invalid IL or missing references)
			//IL_064d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0652: Unknown result type (might be due to invalid IL or missing references)
			//IL_0665: Unknown result type (might be due to invalid IL or missing references)
			//IL_066d: Unknown result type (might be due to invalid IL or missing references)
			//IL_068b: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0711: Unknown result type (might be due to invalid IL or missing references)
			//IL_0719: Unknown result type (might be due to invalid IL or missing references)
			//IL_075f: Unknown result type (might be due to invalid IL or missing references)
			//IL_078b: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_07bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d4: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)prefab != (Object)null)
			{
				GameObject obj = Object.Instantiate<GameObject>(prefab, parent);
				((Object)obj).name = "Dropdown";
				((Object)obj).hideFlags = (HideFlags)61;
				UiEvents.ClearUnityEvents(obj);
				TMP_Dropdown component = obj.GetComponent<TMP_Dropdown>();
				component.ClearOptions();
				RectTransform component2 = obj.GetComponent<RectTransform>();
				component2.anchorMin = new Vector2(0f, 0.2f);
				component2.anchorMax = new Vector2(1f, 0.8f);
				component2.offsetMin = Vector2.zero;
				component2.offsetMax = Vector2.zero;
				if ((Object)(object)font != (Object)null && (Object)(object)component.captionText != (Object)null)
				{
					component.captionText.font = font;
				}
				if ((Object)(object)font != (Object)null && (Object)(object)component.itemText != (Object)null)
				{
					component.itemText.font = font;
				}
				component.AddOptions(options);
				if (options.Count > 0)
				{
					component.value = 0;
					component.RefreshShownValue();
				}
				return component;
			}
			GameObject val = new GameObject("Dropdown");
			val.transform.SetParent(parent, false);
			((Object)val).hideFlags = (HideFlags)61;
			Image obj2 = val.AddComponent<Image>();
			obj2.sprite = sprite;
			obj2.type = (Type)(((Object)(object)sprite != (Object)null) ? 1 : 0);
			((Graphic)obj2).color = new Color(0.1f, 0.1f, 0.12f, 0.95f);
			RectTransform component3 = val.GetComponent<RectTransform>();
			component3.anchorMin = new Vector2(0f, 0.2f);
			component3.anchorMax = new Vector2(1f, 0.8f);
			component3.offsetMin = Vector2.zero;
			component3.offsetMax = Vector2.zero;
			TMP_Text obj3 = CreateText(val.transform, "Label", font, "", 18, (TextAlignmentOptions)513, Color.white, raycastTarget: false);
			TextMeshProUGUI val2 = (TextMeshProUGUI)(object)((obj3 is TextMeshProUGUI) ? obj3 : null);
			((TMP_Text)val2).margin = new Vector4(10f, 6f, 40f, 6f);
			Rect((Component)(object)val2).anchorMin = Vector2.zero;
			Rect((Component)(object)val2).anchorMax = Vector2.one;
			Rect((Component)(object)val2).offsetMin = Vector2.zero;
			Rect((Component)(object)val2).offsetMax = Vector2.zero;
			TMP_Text c = CreateText(val.transform, "Arrow", font, "v", 18, (TextAlignmentOptions)514, new Color(1f, 1f, 1f, 0.75f), raycastTarget: false);
			Rect((Component)(object)c).anchorMin = new Vector2(0.86f, 0f);
			Rect((Component)(object)c).anchorMax = new Vector2(1f, 1f);
			Rect((Component)(object)c).offsetMin = Vector2.zero;
			Rect((Component)(object)c).offsetMax = Vector2.zero;
			GameObject val3 = new GameObject("Template");
			val3.transform.SetParent(val.transform, false);
			((Object)val3).hideFlags = (HideFlags)61;
			Image obj4 = val3.AddComponent<Image>();
			obj4.sprite = sprite;
			obj4.type = (Type)(((Object)(object)sprite != (Object)null) ? 1 : 0);
			((Graphic)obj4).color = new Color(0.08f, 0.08f, 0.1f, 0.98f);
			RectTransform component4 = val3.GetComponent<RectTransform>();
			component4.anchorMin = new Vector2(0f, 0f);
			component4.anchorMax = new Vector2(1f, 0f);
			component4.pivot = new Vector2(0.5f, 1f);
			component4.anchoredPosition = new Vector2(0f, -8f);
			component4.sizeDelta = new Vector2(0f, 260f);
			GameObject val4 = new GameObject("Viewport");
			val4.transform.SetParent(val3.transform, false);
			((Object)val4).hideFlags = (HideFlags)61;
			val4.AddComponent<RectMask2D>();
			RectTransform component5 = val4.GetComponent<RectTransform>();
			component5.anchorMin = Vector2.zero;
			component5.anchorMax = Vector2.one;
			component5.offsetMin = Vector2.zero;
			component5.offsetMax = Vector2.zero;
			GameObject val5 = new GameObject("Content");
			val5.transform.SetParent(val4.transform, false);
			((Object)val5).hideFlags = (HideFlags)61;
			RectTransform val6 = val5.AddComponent<RectTransform>();
			val6.anchorMin = new Vector2(0f, 1f);
			val6.anchorMax = new Vector2(1f, 1f);
			val6.pivot = new Vector2(0.5f, 1f);
			val6.anchoredPosition = Vector2.zero;
			val6.sizeDelta = new Vector2(0f, 0f);
			VerticalLayoutGroup obj5 = val5.AddComponent<VerticalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)obj5).childControlHeight = true;
			((HorizontalOrVerticalLayoutGroup)obj5).childForceExpandHeight = false;
			((HorizontalOrVerticalLayoutGroup)obj5).childControlWidth = true;
			((HorizontalOrVerticalLayoutGroup)obj5).childForceExpandWidth = true;
			((HorizontalOrVerticalLayoutGroup)obj5).spacing = 4f;
			((LayoutGroup)obj5).padding = new RectOffset(6, 6, 6, 6);
			val5.AddComponent<ContentSizeFitter>().verticalFit = (FitMode)2;
			ScrollRect obj6 = val3.AddComponent<ScrollRect>();
			obj6.viewport = component5;
			obj6.content = val6;
			obj6.horizontal = false;
			obj6.movementType = (MovementType)2;
			GameObject val7 = new GameObject("Item");
			val7.transform.SetParent(val5.transform, false);
			((Object)val7).hideFlags = (HideFlags)61;
			val7.AddComponent<RectTransform>().sizeDelta = new Vector2(0f, 34f);
			Toggle obj7 = val7.AddComponent<Toggle>();
			obj7.isOn = false;
			Image val8 = val7.AddComponent<Image>();
			val8.sprite = sprite;
			val8.type = (Type)(((Object)(object)sprite != (Object)null) ? 1 : 0);
			((Graphic)val8).color = new Color(0.14f, 0.15f, 0.2f, 0.95f);
			((Selectable)obj7).targetGraphic = (Graphic)(object)val8;
			ColorBlock colors = ((Selectable)obj7).colors;
			((ColorBlock)(ref colors)).normalColor = new Color(1f, 1f, 1f, 1f);
			((ColorBlock)(ref colors)).highlightedColor = new Color(0.96f, 0.96f, 0.96f, 1f);
			((ColorBlock)(ref colors)).pressedColor = new Color(0.78f, 0.78f, 0.78f, 1f);
			((ColorBlock)(ref colors)).selectedColor = new Color(0.96f, 0.96f, 0.96f, 1f);
			((ColorBlock)(ref colors)).disabledColor = new Color(0.78f, 0.78f, 0.78f, 0.5f);
			((ColorBlock)(ref colors)).colorMultiplier = 1f;
			((ColorBlock)(ref colors)).fadeDuration = 0.1f;
			((Selectable)obj7).colors = colors;
			GameObject val9 = new GameObject("Item Checkmark");
			val9.transform.SetParent(val7.transform, false);
			((Object)val9).hideFlags = (HideFlags)61;
			Image val10 = val9.AddComponent<Image>();
			((Graphic)val10).color = new Color(0f, 0f, 0f, 0f);
			RectTransform component6 = val9.GetComponent<RectTransform>();
			component6.anchorMin = new Vector2(0f, 0.5f);
			component6.anchorMax = new Vector2(0f, 0.5f);
			component6.sizeDelta = new Vector2(20f, 20f);
			component6.anchoredPosition = new Vector2(10f, 0f);
			obj7.graphic = (Graphic)(object)val10;
			GameObject val11 = new GameObject("Item Label");
			val11.transform.SetParent(val7.transform, false);
			((Object)val11).hideFlags = (HideFlags)61;
			TextMeshProUGUI val12 = val11.AddComponent<TextMeshProUGUI>();
			if ((Object)(object)font != (Object)null)
			{
				((TMP_Text)val12).font = font;
			}
			else
			{
				((TMP_Text)val12).font = Resources.Load<TMP_FontAsset>("Fonts & Materials/LiberationSans SDF");
			}
			((TMP_Text)val12).text = "Option";
			((TMP_Text)val12).fontSize = 18f;
			((Graphic)val12).color = Color.white;
			((TMP_Text)val12).alignment = (TextAlignmentOptions)513;
			((TMP_Text)val12).margin = new Vector4(25f, 0f, 10f, 0f);
			((TMP_Text)val12).overflowMode = (TextOverflowModes)0;
			((TMP_Text)val12).enableWordWrapping = false;
			((Graphic)val12).raycastTarget = false;
			RectTransform component7 = val11.GetComponent<RectTransform>();
			component7.anchorMin = Vector2.zero;
			component7.anchorMax = Vector2.one;
			component7.offsetMin = Vector2.zero;
			component7.offsetMax = Vector2.zero;
			val11.transform.SetAsLastSibling();
			LayoutElement obj8 = val7.AddComponent<LayoutElement>();
			obj8.minHeight = 34f;
			obj8.flexibleWidth = 1f;
			TMP_Dropdown val13 = val.AddComponent<TMP_Dropdown>();
			val13.template = component4;
			val13.captionText = (TMP_Text)(object)val2;
			val13.itemText = (TMP_Text)(object)val12;
			val13.ClearOptions();
			val13.AddOptions(options);
			if (options.Count > 0)
			{
				val13.value = 0;
				val13.RefreshShownValue();
			}
			val3.SetActive(false);
			return val13;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class ConstantExpectedAttribute : Attribute
	{
		public object? Min { get; set; }

		public object? Max { get; set; }
	}
	[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class ExperimentalAttribute : Attribute
	{
		public string DiagnosticId { get; }

		public string? UrlFormat { get; set; }

		public ExperimentalAttribute(string diagnosticId)
		{
			DiagnosticId = diagnosticId;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	[ExcludeFromCodeCoverage]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	[ExcludeFromCodeCoverage]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class SetsRequiredMembersAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class StringSyntaxAttribute : Attribute
	{
		public const string CompositeFormat = "CompositeFormat";

		public const string DateOnlyFormat = "DateOnlyFormat";

		public const string DateTimeFormat = "DateTimeFormat";

		public const string EnumFormat = "EnumFormat";

		public const string GuidFormat = "GuidFormat";

		public const string Json = "Json";

		public const string NumericFormat = "NumericFormat";

		public const string Regex = "Regex";

		public const string TimeOnlyFormat = "TimeOnlyFormat";

		public const string TimeSpanFormat = "TimeSpanFormat";

		public const string Uri = "Uri";

		public const string Xml = "Xml";

		public string Syntax { get; }

		public object?[] Arguments { get; }

		public StringSyntaxAttribute(string syntax)
		{
			Syntax = syntax;
			Arguments = new object[0];
		}

		public StringSyntaxAttribute(string syntax, params object?[] arguments)
		{
			Syntax = syntax;
			Arguments = arguments;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class UnscopedRefAttribute : Attribute
	{
	}
}
namespace System.Runtime.Versioning
{
	[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class RequiresPreviewFeaturesAttribute : Attribute
	{
		public string? Message { get; }

		public string? Url { get; set; }

		public RequiresPreviewFeaturesAttribute()
		{
		}

		public RequiresPreviewFeaturesAttribute(string? message)
		{
			Message = message;
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class CallerArgumentExpressionAttribute : Attribute
	{
		public string ParameterName { get; }

		public CallerArgumentExpressionAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class CollectionBuilderAttribute : Attribute
	{
		public Type BuilderType { get; }

		public string MethodName { get; }

		public CollectionBuilderAttribute(Type builderType, string methodName)
		{
			BuilderType = builderType;
			MethodName = methodName;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class CompilerFeatureRequiredAttribute : Attribute
	{
		public const string RefStructs = "RefStructs";

		public const string RequiredMembers = "RequiredMembers";

		public string FeatureName { get; }

		public bool IsOptional { get; set; }

		public CompilerFeatureRequiredAttribute(string featureName)
		{
			FeatureName = featureName;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class InterpolatedStringHandlerArgumentAttribute : Attribute
	{
		public string[] Arguments { get; }

		public InterpolatedStringHandlerArgumentAttribute(string argument)
		{
			Arguments = new string[1] { argument };
		}

		public InterpolatedStringHandlerArgumentAttribute(params string[] arguments)
		{
			Arguments = arguments;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class InterpolatedStringHandlerAttribute : Attribute
	{
	}
	[EditorBrowsable(EditorBrowsableState.Never)]
	[ExcludeFromCodeCoverage]
	internal static class IsExternalInit
	{
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class ModuleInitializerAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class OverloadResolutionPriorityAttribute : Attribute
	{
		public int Priority { get; }

		public OverloadResolutionPriorityAttribute(int priority)
		{
			Priority = priority;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class ParamCollectionAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class RequiredMemberAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	[EditorBrowsable(EditorBrowsableState.Never)]
	[ExcludeFromCodeCoverage]
	internal sealed class RequiresLocationAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event | AttributeTargets.Interface, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class SkipLocalsInitAttribute : Attribute
	{
	}
}