{"version":3,"sources":["webpack://typescriptlang-org/./src/lib/playgroundURLs.ts","webpack://typescriptlang-org/./src/templates/play.tsx","webpack://typescriptlang-org/../node_modules/gatsby/node_modules/babel-loader/lib/node_modules/reflect-metadata/Reflect.js"],"names":["getPlaygroundUrls","sandboxRoot","withPrefix","playgroundRoot","playgroundWorker","Play","props","i","createInternational","useIntl","useEffect","document","getElementById","childElementCount","console","log","leftPlayground","window","addEventListener","event","onPlayground","location","pathname","endsWith","reload","hasLocalStorage","playgroundHandbookTOC","pageContext","optionsSummary","react","React","reactDOM","ReactDOM","getLoaderScript","createElement","src","async","onload","params","URLSearchParams","search","tsVersionParam","get","fetch","cache","nightlyLookup","json","nightlyJSON","version","includes","replace","latestRelease","playgroundReleases","sort","pop","useLocalCompiler","tsVersion","find","d","urlForMonaco","method","ok","querySelectorAll","forEach","div","style","backgroundColor","animation","webkitAnimation","innerHTML","hash","re","global","require","config","paths","vs","ignoreDuplicateModules","catchError","onError","err","innerText","error","main","tsWorker","sandbox","playground","ts","typescript","parentNode","removeChild","container","display","height","Math","max","innerHeight","round","getClientRects","top","extension","workerPath","origin","undefined","createTypeScriptSandbox","text","localStorage","getItem","compilerOptions","domID","filetype","acquireTypes","supportTwoslashCompilerOptions","customTypeScriptWorkerPath","monacoSettings","fontFamily","fontLigatures","sandboxEnv","playgroundConfig","lang","prefix","supportCustomPlugins","setupPlayground","documentElement","classList","contains","monaco","editor","setTheme","focus","layout","body","appendChild","title","description","className","id","href","data-toggle","role","aria-haspopup","aria-expanded","aria-controls","aria-labelledby","aria-label","defaultSection","sections","examples","examplesTOC","locale","paddingTop","marginTop","marginBottom","paddingBottom","onClick","exporter","exportAsTweet","e","copyAsMarkdownIssue","copyForChat","copyForChatWithPreview","openInTSAST","openInBugWorkbench","openInVSCodeDev","openProjectInCodeSandbox","openProjectInStackBlitz","Intl","Reflect","factory","root","g","self","this","Function","makeExporter","target","previous","key","value","Object","defineProperty","configurable","writable","hasOwn","prototype","hasOwnProperty","supportsSymbol","Symbol","toPrimitiveSymbol","toPrimitive","iteratorSymbol","iterator","supportsCreate","create","supportsProto","__proto__","Array","downLevel","HashMap","MakeDictionary","has","map","call","functionPrototype","getPrototypeOf","usePolyfill","process","_Map","Map","entries","CreateMapPolyfill","_Set","Set","CreateSetPolyfill","Metadata","WeakMap","CreateWeakMapPolyfill","decorate","decorators","propertyKey","attributes","IsUndefined","IsArray","TypeError","IsConstructor","DecorateConstructor","IsObject","IsNull","DecorateProperty","ToPropertyKey","metadata","metadataKey","metadataValue","decorator","IsPropertyKey","OrdinaryDefineOwnMetadata","defineMetadata","hasMetadata","OrdinaryHasMetadata","hasOwnMetadata","OrdinaryHasOwnMetadata","getMetadata","OrdinaryGetMetadata","getOwnMetadata","OrdinaryGetOwnMetadata","getMetadataKeys","OrdinaryMetadataKeys","getOwnMetadataKeys","OrdinaryOwnMetadataKeys","deleteMetadata","metadataMap","GetOrCreateMetadataMap","delete","size","targetMetadata","length","decorated","descriptor","O","P","Create","set","MetadataKey","parent","OrdinaryGetPrototypeOf","ToBoolean","MetadataValue","ownKeys","parentKeys","keys","_i","ownKeys_1","add","push","_a","parentKeys_1","GetIterator","k","next","IteratorStep","nextValue","IteratorValue","IteratorClose","Type","x","IsSymbol","ToPrimitive","input","PreferredType","hint","exoticToPrim","GetMethod","result","OrdinaryToPrimitive","toString_1","toString","IsCallable","valueOf","toString_2","argument","ToString","isArray","V","func","obj","iterResult","done","f","proto","prototypeProto","constructor","cacheSentinel","arraySentinel","MapIterator","values","selector","_index","_keys","_values","_selector","index","throw","return","_cacheKey","_cacheIndex","enumerable","_find","clear","getKey","getValue","getEntry","insert","indexOf","_","_map","UUID_SIZE","rootKey","CreateUniqueKey","_key","table","GetOrCreateWeakMapTable","CreateUUID","FillRandomBytes","buffer","random","GenRandomBytes","Uint8Array","crypto","getRandomValues","msCrypto","data","offset","byte","toLowerCase","__"],"mappings":";2KAEaA,EAAoB,WAO/B,MAAO,CACLC,aAAaC,gBAAW,eACxBC,gB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P,IAAIS,EAAOL,EAAeV,GAE1Be,EAAK,GAAe,GAAVA,EAAK,GAAY,GAC3BA,EAAK,GAAe,IAAVA,EAAK,GAAY,IAG3B,IAFA,IAAI1D,EAAS,GAEJ2D,EAAS,EAAGA,EAAShB,IAAagB,EAAQ,CACjD,IAAIC,EAAOF,EAAKC,GACD,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,IAAc3D,GAAU,KACxD4D,EAAO,KAAI5D,GAAU,KACzBA,GAAU4D,EAAKzD,SAAS,IAAI0D,cAG9B,OAAO7D,GAKX,SAAS7F,GAAeyG,GAGtB,OAFAA,EAAIkD,QAAK3P,SACFyM,EAAIkD,GACJlD,EAvtCTrJ,EAAS,WAAY8D,GAsDrB9D,EAAS,WAAY2E,GA+CrB3E,EAAS,iBAAkBiF,GA0C3BjF,EAAS,cAAekF,GA0CxBlF,EAAS,iBAAkBoF,GA0C3BpF,EAAS,cAAesF,GA0CxBtF,EAAS,iBAAkBwF,GAyC3BxF,EAAS,kBAAmB0F,GAyC5B1F,EAAS,qBAAsB4F,GAoD/B5F,EAAS,iBAAkB8F,GAzgB3BjF,CAAQb,GAVV,GAHF,CA61CGY,IAAYA,EAAU","file":"component---src-templates-play-tsx-c4abfa90b636e6cdef33.js","sourcesContent":["import { withPrefix } from \"gatsby\"\n\nexport const getPlaygroundUrls = () => {\n // This will get switched out in CI by:\n // scripts/cacheBustPlayground.mjs\n\n // This should always be a single slash string in the codebase: \"/\"\n const commitPrefix = \"/\"\n\n return {\n sandboxRoot: withPrefix(`/js${commitPrefix}sandbox`),\n playgroundRoot: withPrefix(`/js${commitPrefix}playground`),\n playgroundWorker: withPrefix(`/js${commitPrefix}playground-worker/index.js`),\n }\n}\n","import React, { useEffect } from \"react\"\nimport ReactDOM from \"react-dom\"\nimport { Layout } from \"../components/layout\"\nimport { withPrefix, graphql } from \"gatsby\"\n\nimport \"./play.scss\"\nimport { RenderExamples } from \"../components/ShowExamples\"\n\nimport { useIntl } from \"react-intl\";\nimport { createInternational } from \"../lib/createInternational\"\nimport { hasLocalStorage } from \"../lib/hasLocalStorage\"\nimport { headCopy } from \"../copy/en/head-seo\"\nimport { playCopy } from \"../copy/en/playground\"\n\nimport { Intl } from \"../components/Intl\"\nimport \"reflect-metadata\"\n\nimport playgroundReleases from \"../../../sandbox/src/releases.json\"\nimport { getPlaygroundUrls } from \"../lib/playgroundURLs\"\n\n// This gets set by the playground\ndeclare const playground: ReturnType\n\ntype Props = {\n pageContext: {\n lang: string\n examplesTOC: typeof import(\"../../static/js/examples/en.json\")\n optionsSummary: any // this is just passed through to the playground JS library at this point\n playgroundHandbookTOC: { docs: any[] }\n }\n}\n\nconst Play: React.FC = (props) => {\n const i = createInternational(useIntl())\n\n useEffect(() => {\n if (!document.getElementById(\"monaco-editor-embed\")) return\n if (document.getElementById(\"monaco-editor-embed\")!.childElementCount > 0) {\n return console.log(\"Playground already loaded\")\n }\n\n // Detect if you've left the playground and come back via the back button, which will force\n // a page reload to ensure the playground is full set up\n let leftPlayground = false\n window.addEventListener('popstate', (event) => {\n const onPlayground = document.location.pathname.endsWith(\"/play/\") || document.location.pathname.endsWith(\"/play\")\n if (leftPlayground && onPlayground) {\n document.location.reload()\n } else if (!leftPlayground && !onPlayground) {\n leftPlayground = true\n }\n });\n\n if (!hasLocalStorage) {\n document.getElementById(\"loading-message\")!.innerText = \"Cannot load the Playground with storage disabled in your browser\"\n return\n }\n\n // @ts-ignore - so the playground handbook can grab this data\n window.playgroundHandbookTOC = props.pageContext.playgroundHandbookTOC\n // @ts-ignore - so the config options can use localized descriptions\n window.optionsSummary = props.pageContext.optionsSummary\n // @ts-ignore - for React-based plugins\n window.react = React\n // @ts-ignore - for React-based plugins\n window.reactDOM = ReactDOM\n // @ts-ignore - so that plugins etc can use i18n\n window.i = i\n\n const getLoaderScript = document.createElement('script');\n getLoaderScript.src = withPrefix(\"/js/vs.loader.js\");\n getLoaderScript.async = true;\n getLoaderScript.onload = async () => {\n const params = new URLSearchParams(location.search)\n\n let tsVersionParam = params.get(\"ts\")\n // handle the nightly lookup \n if (tsVersionParam && tsVersionParam === \"Nightly\" || tsVersionParam === \"next\") {\n // Avoids the CDN to doubly skip caching\n const nightlyLookup = await fetch(\"https://tswebinfra.blob.core.windows.net/indexes/next.json\", { cache: \"no-cache\" })\n const nightlyJSON = await nightlyLookup.json()\n tsVersionParam = nightlyJSON.version\n }\n\n // Somehow people keep trying -insiders urls instead of -dev - maybe some tooling I don't know?\n if (tsVersionParam && tsVersionParam.includes(\"-insiders.\")) {\n tsVersionParam = tsVersionParam.replace(\"-insiders.\", \"-dev.\")\n }\n\n const latestRelease = [...playgroundReleases.versions].sort().pop()!\n const tsVersion = tsVersionParam || latestRelease\n\n // Because we can reach to localhost ports from the site, it's possible for the locally built compiler to \n // be hosted and to power the editor with a bit of elbow grease.\n const useLocalCompiler = tsVersion === \"dev\"\n const devIsh = [\"pr\", \"dev\"]\n const version = devIsh.find(d => tsVersion.includes(d)) ? \"dev\" : \"min\"\n const urlForMonaco = useLocalCompiler ? \"http://localhost:5615/dev/vs\" : `https://typescript.azureedge.net/cdn/${tsVersion}/monaco/${version}/vs`\n\n // Make a quick HEAD call for the main monaco editor for this version of TS, if it\n // bails then give a useful error message and bail.\n const nightlyLookup = await fetch(urlForMonaco + \"/editor/editor.main.js\", { method: \"HEAD\" })\n if (!nightlyLookup.ok) {\n document.querySelectorAll(\".lds-grid div\").forEach(div => {\n div.style.backgroundColor = \"red\"\n div.style.animation = \"\"\n div.style.webkitAnimation = \"\"\n })\n\n document.getElementById(\"loading-message\")!.innerHTML = `This version of TypeScript (${tsVersion?.replace(\"<\", \"-\")})
has not been prepared for the Playground

Try ${latestRelease} or Nightly`\n return\n }\n\n // Allow prod/staging builds to set a custom commit prefix to bust caches\n const { sandboxRoot, playgroundRoot, playgroundWorker } = getPlaygroundUrls()\n\n // @ts-ignore\n const re: any = global.require\n re.config({\n paths: {\n vs: urlForMonaco,\n \"typescript-sandbox\": sandboxRoot,\n \"typescript-playground\": playgroundRoot,\n \"unpkg\": \"https://unpkg.com\",\n \"local\": \"http://localhost:5000\",\n },\n ignoreDuplicateModules: [\"vs/editor/editor.main\"],\n catchError: true,\n onError: function (err) {\n if (document.getElementById(\"loading-message\")) {\n document.getElementById(\"loading-message\")!.innerText = \"Cannot load the Playground in this browser\"\n console.error(\"Error setting up monaco/sandbox/playground from the JS, this is likely that you're using a browser which monaco doesn't support.\")\n } else {\n console.error(\"Caught an error which is likely happening during initializing a playground plugin:\")\n }\n console.error(err)\n }\n });\n\n re([\"vs/editor/editor.main\", \"vs/language/typescript/tsWorker\", \"typescript-sandbox/index\", \"typescript-playground/index\"], async (main: typeof import(\"monaco-editor\"), tsWorker: any, sandbox: typeof import(\"@typescript/sandbox\"), playground: typeof import(\"@typescript/playground\")) => {\n // Importing \"vs/language/typescript/tsWorker\" will set ts as a global\n const ts = (global as any).ts || tsWorker.typescript\n const isOK = main && ts && sandbox && playground\n if (isOK) {\n document.getElementById(\"loader\")!.parentNode?.removeChild(document.getElementById(\"loader\")!)\n } else {\n console.error(\"Error setting up all the 4 key dependencies\")\n console.error(\"main\", !!main, \"ts\", !!ts, \"sandbox\", !!sandbox, \"playground\", !!playground)\n document.getElementById(\"loading-message\")!.innerText = \"Cannot load the Playground in this browser, see logs in console.\"\n return\n }\n\n // Set the height of monaco to be either your window height or 600px - whichever is smallest\n const container = document.getElementById(\"playground-container\")!\n container.style.display = \"flex\"\n const height = Math.max(window.innerHeight, 600)\n container.style.height = `${height - Math.round(container.getClientRects()[0].top) - 18}px`\n\n const extension = (!!params.get(\"useJavaScript\") ? \"js\" : params.get(\"filetype\") || \"ts\") as any\n const workerPath = params.get(\"multiFile\") ? `${document.location.origin + playgroundWorker}?filetype=${extension}` : undefined\n\n // Create the sandbox\n const sandboxEnv = await sandbox.createTypeScriptSandbox({\n text: localStorage.getItem('sandbox-history') || i(\"play_default_code_sample\"),\n compilerOptions: {},\n domID: \"monaco-editor-embed\",\n filetype: extension,\n acquireTypes: !localStorage.getItem(\"disable-ata\"),\n supportTwoslashCompilerOptions: true,\n customTypeScriptWorkerPath: workerPath,\n monacoSettings: {\n fontFamily: \"var(--code-font)\",\n fontLigatures: true\n }\n }, main, ts)\n\n const playgroundConfig = {\n lang: props.pageContext.lang,\n prefix: withPrefix(\"/\"),\n supportCustomPlugins: true\n }\n\n playground.setupPlayground(sandboxEnv, main, playgroundConfig, i as any, React)\n\n // Dark mode faff\n const darkModeEnabled = document.documentElement.classList.contains(\"dark-theme\")\n if (darkModeEnabled) {\n sandboxEnv.monaco.editor.setTheme(\"sandbox-dark\");\n }\n\n sandboxEnv.editor.focus()\n sandboxEnv.editor.layout()\n });\n }\n\n document.body.appendChild(getLoaderScript);\n }, [])\n\n\n return (\n \n {/** This is the top nav, which is outside of the editor */}\n \n\n
\n
\n
\n

{i(\"play_downloading_typescript\")}

\n
\n \n \n )\n}\n\n\nexport default (props: Props) => \n","/*! *****************************************************************************\nCopyright (C) Microsoft. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\nvar Reflect;\n\n(function (Reflect) {\n // Metadata Proposal\n // https://rbuckton.github.io/reflect-metadata/\n (function (factory) {\n var root = typeof global === \"object\" ? global : typeof self === \"object\" ? self : typeof this === \"object\" ? this : Function(\"return this;\")();\n var exporter = makeExporter(Reflect);\n\n if (typeof root.Reflect === \"undefined\") {\n root.Reflect = Reflect;\n } else {\n exporter = makeExporter(root.Reflect, exporter);\n }\n\n factory(exporter);\n\n function makeExporter(target, previous) {\n return function (key, value) {\n if (typeof target[key] !== \"function\") {\n Object.defineProperty(target, key, {\n configurable: true,\n writable: true,\n value: value\n });\n }\n\n if (previous) previous(key, value);\n };\n }\n })(function (exporter) {\n var hasOwn = Object.prototype.hasOwnProperty; // feature test for Symbol support\n\n var supportsSymbol = typeof Symbol === \"function\";\n var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== \"undefined\" ? Symbol.toPrimitive : \"@@toPrimitive\";\n var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== \"undefined\" ? Symbol.iterator : \"@@iterator\";\n var supportsCreate = typeof Object.create === \"function\"; // feature test for Object.create support\n\n var supportsProto = {\n __proto__: []\n } instanceof Array; // feature test for __proto__ support\n\n var downLevel = !supportsCreate && !supportsProto;\n var HashMap = {\n // create an object in dictionary mode (a.k.a. \"slow\" mode in v8)\n create: supportsCreate ? function () {\n return MakeDictionary(Object.create(null));\n } : supportsProto ? function () {\n return MakeDictionary({\n __proto__: null\n });\n } : function () {\n return MakeDictionary({});\n },\n has: downLevel ? function (map, key) {\n return hasOwn.call(map, key);\n } : function (map, key) {\n return key in map;\n },\n get: downLevel ? function (map, key) {\n return hasOwn.call(map, key) ? map[key] : undefined;\n } : function (map, key) {\n return map[key];\n }\n }; // Load global or shim versions of Map, Set, and WeakMap\n\n var functionPrototype = Object.getPrototypeOf(Function);\n var usePolyfill = typeof process === \"object\" && process.env && process.env[\"REFLECT_METADATA_USE_MAP_POLYFILL\"] === \"true\";\n\n var _Map = !usePolyfill && typeof Map === \"function\" && typeof Map.prototype.entries === \"function\" ? Map : CreateMapPolyfill();\n\n var _Set = !usePolyfill && typeof Set === \"function\" && typeof Set.prototype.entries === \"function\" ? Set : CreateSetPolyfill();\n\n var _WeakMap = !usePolyfill && typeof WeakMap === \"function\" ? WeakMap : CreateWeakMapPolyfill(); // [[Metadata]] internal slot\n // https://rbuckton.github.io/reflect-metadata/#ordinary-object-internal-methods-and-internal-slots\n\n\n var Metadata = new _WeakMap();\n /**\n * Applies a set of decorators to a property of a target object.\n * @param decorators An array of decorators.\n * @param target The target object.\n * @param propertyKey (Optional) The property key to decorate.\n * @param attributes (Optional) The property descriptor for the target key.\n * @remarks Decorators are applied in reverse order.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * Example = Reflect.decorate(decoratorsArray, Example);\n *\n * // property (on constructor)\n * Reflect.decorate(decoratorsArray, Example, \"staticProperty\");\n *\n * // property (on prototype)\n * Reflect.decorate(decoratorsArray, Example.prototype, \"property\");\n *\n * // method (on constructor)\n * Object.defineProperty(Example, \"staticMethod\",\n * Reflect.decorate(decoratorsArray, Example, \"staticMethod\",\n * Object.getOwnPropertyDescriptor(Example, \"staticMethod\")));\n *\n * // method (on prototype)\n * Object.defineProperty(Example.prototype, \"method\",\n * Reflect.decorate(decoratorsArray, Example.prototype, \"method\",\n * Object.getOwnPropertyDescriptor(Example.prototype, \"method\")));\n *\n */\n\n function decorate(decorators, target, propertyKey, attributes) {\n if (!IsUndefined(propertyKey)) {\n if (!IsArray(decorators)) throw new TypeError();\n if (!IsObject(target)) throw new TypeError();\n if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes)) throw new TypeError();\n if (IsNull(attributes)) attributes = undefined;\n propertyKey = ToPropertyKey(propertyKey);\n return DecorateProperty(decorators, target, propertyKey, attributes);\n } else {\n if (!IsArray(decorators)) throw new TypeError();\n if (!IsConstructor(target)) throw new TypeError();\n return DecorateConstructor(decorators, target);\n }\n }\n\n exporter(\"decorate\", decorate); // 4.1.2 Reflect.metadata(metadataKey, metadataValue)\n // https://rbuckton.github.io/reflect-metadata/#reflect.metadata\n\n /**\n * A default metadata decorator factory that can be used on a class, class member, or parameter.\n * @param metadataKey The key for the metadata entry.\n * @param metadataValue The value for the metadata entry.\n * @returns A decorator function.\n * @remarks\n * If `metadataKey` is already defined for the target and target key, the\n * metadataValue for that key will be overwritten.\n * @example\n *\n * // constructor\n * @Reflect.metadata(key, value)\n * class Example {\n * }\n *\n * // property (on constructor, TypeScript only)\n * class Example {\n * @Reflect.metadata(key, value)\n * static staticProperty;\n * }\n *\n * // property (on prototype, TypeScript only)\n * class Example {\n * @Reflect.metadata(key, value)\n * property;\n * }\n *\n * // method (on constructor)\n * class Example {\n * @Reflect.metadata(key, value)\n * static staticMethod() { }\n * }\n *\n * // method (on prototype)\n * class Example {\n * @Reflect.metadata(key, value)\n * method() { }\n * }\n *\n */\n\n function metadata(metadataKey, metadataValue) {\n function decorator(target, propertyKey) {\n if (!IsObject(target)) throw new TypeError();\n if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey)) throw new TypeError();\n OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);\n }\n\n return decorator;\n }\n\n exporter(\"metadata\", metadata);\n /**\n * Define a unique metadata entry on the target.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param metadataValue A value that contains attached metadata.\n * @param target The target object on which to define metadata.\n * @param propertyKey (Optional) The property key for the target.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * Reflect.defineMetadata(\"custom:annotation\", options, Example);\n *\n * // property (on constructor)\n * Reflect.defineMetadata(\"custom:annotation\", options, Example, \"staticProperty\");\n *\n * // property (on prototype)\n * Reflect.defineMetadata(\"custom:annotation\", options, Example.prototype, \"property\");\n *\n * // method (on constructor)\n * Reflect.defineMetadata(\"custom:annotation\", options, Example, \"staticMethod\");\n *\n * // method (on prototype)\n * Reflect.defineMetadata(\"custom:annotation\", options, Example.prototype, \"method\");\n *\n * // decorator factory as metadata-producing annotation.\n * function MyAnnotation(options): Decorator {\n * return (target, key?) => Reflect.defineMetadata(\"custom:annotation\", options, target, key);\n * }\n *\n */\n\n function defineMetadata(metadataKey, metadataValue, target, propertyKey) {\n if (!IsObject(target)) throw new TypeError();\n if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);\n }\n\n exporter(\"defineMetadata\", defineMetadata);\n /**\n * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.hasMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.hasMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.hasMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.hasMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.hasMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n\n function hasMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target)) throw new TypeError();\n if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryHasMetadata(metadataKey, target, propertyKey);\n }\n\n exporter(\"hasMetadata\", hasMetadata);\n /**\n * Gets a value indicating whether the target object has the provided metadata key defined.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns `true` if the metadata key was defined on the target object; otherwise, `false`.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n\n function hasOwnMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target)) throw new TypeError();\n if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);\n }\n\n exporter(\"hasOwnMetadata\", hasOwnMetadata);\n /**\n * Gets the metadata value for the provided metadata key on the target object or its prototype chain.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.getMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.getMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.getMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.getMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.getMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n\n function getMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target)) throw new TypeError();\n if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryGetMetadata(metadataKey, target, propertyKey);\n }\n\n exporter(\"getMetadata\", getMetadata);\n /**\n * Gets the metadata value for the provided metadata key on the target object.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n\n function getOwnMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target)) throw new TypeError();\n if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);\n }\n\n exporter(\"getOwnMetadata\", getOwnMetadata);\n /**\n * Gets the metadata keys defined on the target object or its prototype chain.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns An array of unique metadata keys.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.getMetadataKeys(Example);\n *\n * // property (on constructor)\n * result = Reflect.getMetadataKeys(Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.getMetadataKeys(Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.getMetadataKeys(Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.getMetadataKeys(Example.prototype, \"method\");\n *\n */\n\n function getMetadataKeys(target, propertyKey) {\n if (!IsObject(target)) throw new TypeError();\n if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryMetadataKeys(target, propertyKey);\n }\n\n exporter(\"getMetadataKeys\", getMetadataKeys);\n /**\n * Gets the unique metadata keys defined on the target object.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns An array of unique metadata keys.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.getOwnMetadataKeys(Example);\n *\n * // property (on constructor)\n * result = Reflect.getOwnMetadataKeys(Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.getOwnMetadataKeys(Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.getOwnMetadataKeys(Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.getOwnMetadataKeys(Example.prototype, \"method\");\n *\n */\n\n function getOwnMetadataKeys(target, propertyKey) {\n if (!IsObject(target)) throw new TypeError();\n if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryOwnMetadataKeys(target, propertyKey);\n }\n\n exporter(\"getOwnMetadataKeys\", getOwnMetadataKeys);\n /**\n * Deletes the metadata entry from the target object with the provided key.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns `true` if the metadata entry was found and deleted; otherwise, false.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n\n function deleteMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target)) throw new TypeError();\n if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey);\n var metadataMap = GetOrCreateMetadataMap(target, propertyKey,\n /*Create*/\n false);\n if (IsUndefined(metadataMap)) return false;\n if (!metadataMap.delete(metadataKey)) return false;\n if (metadataMap.size > 0) return true;\n var targetMetadata = Metadata.get(target);\n targetMetadata.delete(propertyKey);\n if (targetMetadata.size > 0) return true;\n Metadata.delete(target);\n return true;\n }\n\n exporter(\"deleteMetadata\", deleteMetadata);\n\n function DecorateConstructor(decorators, target) {\n for (var i = decorators.length - 1; i >= 0; --i) {\n var decorator = decorators[i];\n var decorated = decorator(target);\n\n if (!IsUndefined(decorated) && !IsNull(decorated)) {\n if (!IsConstructor(decorated)) throw new TypeError();\n target = decorated;\n }\n }\n\n return target;\n }\n\n function DecorateProperty(decorators, target, propertyKey, descriptor) {\n for (var i = decorators.length - 1; i >= 0; --i) {\n var decorator = decorators[i];\n var decorated = decorator(target, propertyKey, descriptor);\n\n if (!IsUndefined(decorated) && !IsNull(decorated)) {\n if (!IsObject(decorated)) throw new TypeError();\n descriptor = decorated;\n }\n }\n\n return descriptor;\n }\n\n function GetOrCreateMetadataMap(O, P, Create) {\n var targetMetadata = Metadata.get(O);\n\n if (IsUndefined(targetMetadata)) {\n if (!Create) return undefined;\n targetMetadata = new _Map();\n Metadata.set(O, targetMetadata);\n }\n\n var metadataMap = targetMetadata.get(P);\n\n if (IsUndefined(metadataMap)) {\n if (!Create) return undefined;\n metadataMap = new _Map();\n targetMetadata.set(P, metadataMap);\n }\n\n return metadataMap;\n } // 3.1.1.1 OrdinaryHasMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinaryhasmetadata\n\n\n function OrdinaryHasMetadata(MetadataKey, O, P) {\n var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn) return true;\n var parent = OrdinaryGetPrototypeOf(O);\n if (!IsNull(parent)) return OrdinaryHasMetadata(MetadataKey, parent, P);\n return false;\n } // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata\n\n\n function OrdinaryHasOwnMetadata(MetadataKey, O, P) {\n var metadataMap = GetOrCreateMetadataMap(O, P,\n /*Create*/\n false);\n if (IsUndefined(metadataMap)) return false;\n return ToBoolean(metadataMap.has(MetadataKey));\n } // 3.1.3.1 OrdinaryGetMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarygetmetadata\n\n\n function OrdinaryGetMetadata(MetadataKey, O, P) {\n var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn) return OrdinaryGetOwnMetadata(MetadataKey, O, P);\n var parent = OrdinaryGetPrototypeOf(O);\n if (!IsNull(parent)) return OrdinaryGetMetadata(MetadataKey, parent, P);\n return undefined;\n } // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata\n\n\n function OrdinaryGetOwnMetadata(MetadataKey, O, P) {\n var metadataMap = GetOrCreateMetadataMap(O, P,\n /*Create*/\n false);\n if (IsUndefined(metadataMap)) return undefined;\n return metadataMap.get(MetadataKey);\n } // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata\n\n\n function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {\n var metadataMap = GetOrCreateMetadataMap(O, P,\n /*Create*/\n true);\n metadataMap.set(MetadataKey, MetadataValue);\n } // 3.1.6.1 OrdinaryMetadataKeys(O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarymetadatakeys\n\n\n function OrdinaryMetadataKeys(O, P) {\n var ownKeys = OrdinaryOwnMetadataKeys(O, P);\n var parent = OrdinaryGetPrototypeOf(O);\n if (parent === null) return ownKeys;\n var parentKeys = OrdinaryMetadataKeys(parent, P);\n if (parentKeys.length <= 0) return ownKeys;\n if (ownKeys.length <= 0) return parentKeys;\n var set = new _Set();\n var keys = [];\n\n for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) {\n var key = ownKeys_1[_i];\n var hasKey = set.has(key);\n\n if (!hasKey) {\n set.add(key);\n keys.push(key);\n }\n }\n\n for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) {\n var key = parentKeys_1[_a];\n var hasKey = set.has(key);\n\n if (!hasKey) {\n set.add(key);\n keys.push(key);\n }\n }\n\n return keys;\n } // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys\n\n\n function OrdinaryOwnMetadataKeys(O, P) {\n var keys = [];\n var metadataMap = GetOrCreateMetadataMap(O, P,\n /*Create*/\n false);\n if (IsUndefined(metadataMap)) return keys;\n var keysObj = metadataMap.keys();\n var iterator = GetIterator(keysObj);\n var k = 0;\n\n while (true) {\n var next = IteratorStep(iterator);\n\n if (!next) {\n keys.length = k;\n return keys;\n }\n\n var nextValue = IteratorValue(next);\n\n try {\n keys[k] = nextValue;\n } catch (e) {\n try {\n IteratorClose(iterator);\n } finally {\n throw e;\n }\n }\n\n k++;\n }\n } // 6 ECMAScript Data Typ0es and Values\n // https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values\n\n\n function Type(x) {\n if (x === null) return 1\n /* Null */\n ;\n\n switch (typeof x) {\n case \"undefined\":\n return 0\n /* Undefined */\n ;\n\n case \"boolean\":\n return 2\n /* Boolean */\n ;\n\n case \"string\":\n return 3\n /* String */\n ;\n\n case \"symbol\":\n return 4\n /* Symbol */\n ;\n\n case \"number\":\n return 5\n /* Number */\n ;\n\n case \"object\":\n return x === null ? 1\n /* Null */\n : 6\n /* Object */\n ;\n\n default:\n return 6\n /* Object */\n ;\n }\n } // 6.1.1 The Undefined Type\n // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-undefined-type\n\n\n function IsUndefined(x) {\n return x === undefined;\n } // 6.1.2 The Null Type\n // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-null-type\n\n\n function IsNull(x) {\n return x === null;\n } // 6.1.5 The Symbol Type\n // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-symbol-type\n\n\n function IsSymbol(x) {\n return typeof x === \"symbol\";\n } // 6.1.7 The Object Type\n // https://tc39.github.io/ecma262/#sec-object-type\n\n\n function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n } // 7.1 Type Conversion\n // https://tc39.github.io/ecma262/#sec-type-conversion\n // 7.1.1 ToPrimitive(input [, PreferredType])\n // https://tc39.github.io/ecma262/#sec-toprimitive\n\n\n function ToPrimitive(input, PreferredType) {\n switch (Type(input)) {\n case 0\n /* Undefined */\n :\n return input;\n\n case 1\n /* Null */\n :\n return input;\n\n case 2\n /* Boolean */\n :\n return input;\n\n case 3\n /* String */\n :\n return input;\n\n case 4\n /* Symbol */\n :\n return input;\n\n case 5\n /* Number */\n :\n return input;\n }\n\n var hint = PreferredType === 3\n /* String */\n ? \"string\" : PreferredType === 5\n /* Number */\n ? \"number\" : \"default\";\n var exoticToPrim = GetMethod(input, toPrimitiveSymbol);\n\n if (exoticToPrim !== undefined) {\n var result = exoticToPrim.call(input, hint);\n if (IsObject(result)) throw new TypeError();\n return result;\n }\n\n return OrdinaryToPrimitive(input, hint === \"default\" ? \"number\" : hint);\n } // 7.1.1.1 OrdinaryToPrimitive(O, hint)\n // https://tc39.github.io/ecma262/#sec-ordinarytoprimitive\n\n\n function OrdinaryToPrimitive(O, hint) {\n if (hint === \"string\") {\n var toString_1 = O.toString;\n\n if (IsCallable(toString_1)) {\n var result = toString_1.call(O);\n if (!IsObject(result)) return result;\n }\n\n var valueOf = O.valueOf;\n\n if (IsCallable(valueOf)) {\n var result = valueOf.call(O);\n if (!IsObject(result)) return result;\n }\n } else {\n var valueOf = O.valueOf;\n\n if (IsCallable(valueOf)) {\n var result = valueOf.call(O);\n if (!IsObject(result)) return result;\n }\n\n var toString_2 = O.toString;\n\n if (IsCallable(toString_2)) {\n var result = toString_2.call(O);\n if (!IsObject(result)) return result;\n }\n }\n\n throw new TypeError();\n } // 7.1.2 ToBoolean(argument)\n // https://tc39.github.io/ecma262/2016/#sec-toboolean\n\n\n function ToBoolean(argument) {\n return !!argument;\n } // 7.1.12 ToString(argument)\n // https://tc39.github.io/ecma262/#sec-tostring\n\n\n function ToString(argument) {\n return \"\" + argument;\n } // 7.1.14 ToPropertyKey(argument)\n // https://tc39.github.io/ecma262/#sec-topropertykey\n\n\n function ToPropertyKey(argument) {\n var key = ToPrimitive(argument, 3\n /* String */\n );\n if (IsSymbol(key)) return key;\n return ToString(key);\n } // 7.2 Testing and Comparison Operations\n // https://tc39.github.io/ecma262/#sec-testing-and-comparison-operations\n // 7.2.2 IsArray(argument)\n // https://tc39.github.io/ecma262/#sec-isarray\n\n\n function IsArray(argument) {\n return Array.isArray ? Array.isArray(argument) : argument instanceof Object ? argument instanceof Array : Object.prototype.toString.call(argument) === \"[object Array]\";\n } // 7.2.3 IsCallable(argument)\n // https://tc39.github.io/ecma262/#sec-iscallable\n\n\n function IsCallable(argument) {\n // NOTE: This is an approximation as we cannot check for [[Call]] internal method.\n return typeof argument === \"function\";\n } // 7.2.4 IsConstructor(argument)\n // https://tc39.github.io/ecma262/#sec-isconstructor\n\n\n function IsConstructor(argument) {\n // NOTE: This is an approximation as we cannot check for [[Construct]] internal method.\n return typeof argument === \"function\";\n } // 7.2.7 IsPropertyKey(argument)\n // https://tc39.github.io/ecma262/#sec-ispropertykey\n\n\n function IsPropertyKey(argument) {\n switch (Type(argument)) {\n case 3\n /* String */\n :\n return true;\n\n case 4\n /* Symbol */\n :\n return true;\n\n default:\n return false;\n }\n } // 7.3 Operations on Objects\n // https://tc39.github.io/ecma262/#sec-operations-on-objects\n // 7.3.9 GetMethod(V, P)\n // https://tc39.github.io/ecma262/#sec-getmethod\n\n\n function GetMethod(V, P) {\n var func = V[P];\n if (func === undefined || func === null) return undefined;\n if (!IsCallable(func)) throw new TypeError();\n return func;\n } // 7.4 Operations on Iterator Objects\n // https://tc39.github.io/ecma262/#sec-operations-on-iterator-objects\n\n\n function GetIterator(obj) {\n var method = GetMethod(obj, iteratorSymbol);\n if (!IsCallable(method)) throw new TypeError(); // from Call\n\n var iterator = method.call(obj);\n if (!IsObject(iterator)) throw new TypeError();\n return iterator;\n } // 7.4.4 IteratorValue(iterResult)\n // https://tc39.github.io/ecma262/2016/#sec-iteratorvalue\n\n\n function IteratorValue(iterResult) {\n return iterResult.value;\n } // 7.4.5 IteratorStep(iterator)\n // https://tc39.github.io/ecma262/#sec-iteratorstep\n\n\n function IteratorStep(iterator) {\n var result = iterator.next();\n return result.done ? false : result;\n } // 7.4.6 IteratorClose(iterator, completion)\n // https://tc39.github.io/ecma262/#sec-iteratorclose\n\n\n function IteratorClose(iterator) {\n var f = iterator[\"return\"];\n if (f) f.call(iterator);\n } // 9.1 Ordinary Object Internal Methods and Internal Slots\n // https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots\n // 9.1.1.1 OrdinaryGetPrototypeOf(O)\n // https://tc39.github.io/ecma262/#sec-ordinarygetprototypeof\n\n\n function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype) return proto; // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n\n if (proto !== functionPrototype) return proto; // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype) return proto; // If the constructor was not a function, then we cannot determine the heritage.\n\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\") return proto; // If we have some kind of self-reference, then we cannot determine the heritage.\n\n if (constructor === O) return proto; // we have a pretty good guess at the heritage.\n\n return constructor;\n } // naive Map shim\n\n\n function CreateMapPolyfill() {\n var cacheSentinel = {};\n var arraySentinel = [];\n\n var MapIterator =\n /** @class */\n function () {\n function MapIterator(keys, values, selector) {\n this._index = 0;\n this._keys = keys;\n this._values = values;\n this._selector = selector;\n }\n\n MapIterator.prototype[\"@@iterator\"] = function () {\n return this;\n };\n\n MapIterator.prototype[iteratorSymbol] = function () {\n return this;\n };\n\n MapIterator.prototype.next = function () {\n var index = this._index;\n\n if (index >= 0 && index < this._keys.length) {\n var result = this._selector(this._keys[index], this._values[index]);\n\n if (index + 1 >= this._keys.length) {\n this._index = -1;\n this._keys = arraySentinel;\n this._values = arraySentinel;\n } else {\n this._index++;\n }\n\n return {\n value: result,\n done: false\n };\n }\n\n return {\n value: undefined,\n done: true\n };\n };\n\n MapIterator.prototype.throw = function (error) {\n if (this._index >= 0) {\n this._index = -1;\n this._keys = arraySentinel;\n this._values = arraySentinel;\n }\n\n throw error;\n };\n\n MapIterator.prototype.return = function (value) {\n if (this._index >= 0) {\n this._index = -1;\n this._keys = arraySentinel;\n this._values = arraySentinel;\n }\n\n return {\n value: value,\n done: true\n };\n };\n\n return MapIterator;\n }();\n\n return (\n /** @class */\n function () {\n function Map() {\n this._keys = [];\n this._values = [];\n this._cacheKey = cacheSentinel;\n this._cacheIndex = -2;\n }\n\n Object.defineProperty(Map.prototype, \"size\", {\n get: function get() {\n return this._keys.length;\n },\n enumerable: true,\n configurable: true\n });\n\n Map.prototype.has = function (key) {\n return this._find(key,\n /*insert*/\n false) >= 0;\n };\n\n Map.prototype.get = function (key) {\n var index = this._find(key,\n /*insert*/\n false);\n\n return index >= 0 ? this._values[index] : undefined;\n };\n\n Map.prototype.set = function (key, value) {\n var index = this._find(key,\n /*insert*/\n true);\n\n this._values[index] = value;\n return this;\n };\n\n Map.prototype.delete = function (key) {\n var index = this._find(key,\n /*insert*/\n false);\n\n if (index >= 0) {\n var size = this._keys.length;\n\n for (var i = index + 1; i < size; i++) {\n this._keys[i - 1] = this._keys[i];\n this._values[i - 1] = this._values[i];\n }\n\n this._keys.length--;\n this._values.length--;\n\n if (key === this._cacheKey) {\n this._cacheKey = cacheSentinel;\n this._cacheIndex = -2;\n }\n\n return true;\n }\n\n return false;\n };\n\n Map.prototype.clear = function () {\n this._keys.length = 0;\n this._values.length = 0;\n this._cacheKey = cacheSentinel;\n this._cacheIndex = -2;\n };\n\n Map.prototype.keys = function () {\n return new MapIterator(this._keys, this._values, getKey);\n };\n\n Map.prototype.values = function () {\n return new MapIterator(this._keys, this._values, getValue);\n };\n\n Map.prototype.entries = function () {\n return new MapIterator(this._keys, this._values, getEntry);\n };\n\n Map.prototype[\"@@iterator\"] = function () {\n return this.entries();\n };\n\n Map.prototype[iteratorSymbol] = function () {\n return this.entries();\n };\n\n Map.prototype._find = function (key, insert) {\n if (this._cacheKey !== key) {\n this._cacheIndex = this._keys.indexOf(this._cacheKey = key);\n }\n\n if (this._cacheIndex < 0 && insert) {\n this._cacheIndex = this._keys.length;\n\n this._keys.push(key);\n\n this._values.push(undefined);\n }\n\n return this._cacheIndex;\n };\n\n return Map;\n }()\n );\n\n function getKey(key, _) {\n return key;\n }\n\n function getValue(_, value) {\n return value;\n }\n\n function getEntry(key, value) {\n return [key, value];\n }\n } // naive Set shim\n\n\n function CreateSetPolyfill() {\n return (\n /** @class */\n function () {\n function Set() {\n this._map = new _Map();\n }\n\n Object.defineProperty(Set.prototype, \"size\", {\n get: function get() {\n return this._map.size;\n },\n enumerable: true,\n configurable: true\n });\n\n Set.prototype.has = function (value) {\n return this._map.has(value);\n };\n\n Set.prototype.add = function (value) {\n return this._map.set(value, value), this;\n };\n\n Set.prototype.delete = function (value) {\n return this._map.delete(value);\n };\n\n Set.prototype.clear = function () {\n this._map.clear();\n };\n\n Set.prototype.keys = function () {\n return this._map.keys();\n };\n\n Set.prototype.values = function () {\n return this._map.values();\n };\n\n Set.prototype.entries = function () {\n return this._map.entries();\n };\n\n Set.prototype[\"@@iterator\"] = function () {\n return this.keys();\n };\n\n Set.prototype[iteratorSymbol] = function () {\n return this.keys();\n };\n\n return Set;\n }()\n );\n } // naive WeakMap shim\n\n\n function CreateWeakMapPolyfill() {\n var UUID_SIZE = 16;\n var keys = HashMap.create();\n var rootKey = CreateUniqueKey();\n return (\n /** @class */\n function () {\n function WeakMap() {\n this._key = CreateUniqueKey();\n }\n\n WeakMap.prototype.has = function (target) {\n var table = GetOrCreateWeakMapTable(target,\n /*create*/\n false);\n return table !== undefined ? HashMap.has(table, this._key) : false;\n };\n\n WeakMap.prototype.get = function (target) {\n var table = GetOrCreateWeakMapTable(target,\n /*create*/\n false);\n return table !== undefined ? HashMap.get(table, this._key) : undefined;\n };\n\n WeakMap.prototype.set = function (target, value) {\n var table = GetOrCreateWeakMapTable(target,\n /*create*/\n true);\n table[this._key] = value;\n return this;\n };\n\n WeakMap.prototype.delete = function (target) {\n var table = GetOrCreateWeakMapTable(target,\n /*create*/\n false);\n return table !== undefined ? delete table[this._key] : false;\n };\n\n WeakMap.prototype.clear = function () {\n // NOTE: not a real clear, just makes the previous data unreachable\n this._key = CreateUniqueKey();\n };\n\n return WeakMap;\n }()\n );\n\n function CreateUniqueKey() {\n var key;\n\n do {\n key = \"@@WeakMap@@\" + CreateUUID();\n } while (HashMap.has(keys, key));\n\n keys[key] = true;\n return key;\n }\n\n function GetOrCreateWeakMapTable(target, create) {\n if (!hasOwn.call(target, rootKey)) {\n if (!create) return undefined;\n Object.defineProperty(target, rootKey, {\n value: HashMap.create()\n });\n }\n\n return target[rootKey];\n }\n\n function FillRandomBytes(buffer, size) {\n for (var i = 0; i < size; ++i) {\n buffer[i] = Math.random() * 0xff | 0;\n }\n\n return buffer;\n }\n\n function GenRandomBytes(size) {\n if (typeof Uint8Array === \"function\") {\n if (typeof crypto !== \"undefined\") return crypto.getRandomValues(new Uint8Array(size));\n if (typeof msCrypto !== \"undefined\") return msCrypto.getRandomValues(new Uint8Array(size));\n return FillRandomBytes(new Uint8Array(size), size);\n }\n\n return FillRandomBytes(new Array(size), size);\n }\n\n function CreateUUID() {\n var data = GenRandomBytes(UUID_SIZE); // mark as random - RFC 4122 ยง 4.4\n\n data[6] = data[6] & 0x4f | 0x40;\n data[8] = data[8] & 0xbf | 0x80;\n var result = \"\";\n\n for (var offset = 0; offset < UUID_SIZE; ++offset) {\n var byte = data[offset];\n if (offset === 4 || offset === 6 || offset === 8) result += \"-\";\n if (byte < 16) result += \"0\";\n result += byte.toString(16).toLowerCase();\n }\n\n return result;\n }\n } // uses a heuristic used by v8 and chakra to force an object into dictionary mode.\n\n\n function MakeDictionary(obj) {\n obj.__ = undefined;\n delete obj.__;\n return obj;\n }\n });\n})(Reflect || (Reflect = {}));"],"sourceRoot":""}