{"version":3,"file":"globalObject.cjs","sourceRoot":"","sources":["../../src/common/globalObject.ts"],"names":[],"mappings":";;;AAAA,IAAK,iBASJ;AATD,WAAK,iBAAiB;IACpB,yEAAyE;IACzE,cAAc;IACd,yDAAyD;IACzD,8CAAyB,CAAA;IACzB,sCAAiB,CAAA;IACjB,kCAAa,CAAA;IACb,sCAAiB,CAAA;IACjB,wDAAwD;AAC1D,CAAC,EATI,iBAAiB,KAAjB,iBAAiB,QASrB;AAED,IAAI,gBAAmC,CAAC;AACxC,IAAI,oBAA4B,CAAC;AAEjC,0BAA0B;AAC1B,yCAAyC;AACzC,IAAI,OAAO,UAAU,KAAK,WAAW,EAAE,CAAC;IACtC,gBAAgB,GAAG,UAAU,CAAC;IAC9B,oBAAoB,GAAG,iBAAiB,CAAC,UAAU,CAAC;AACtD,CAAC;KAAM,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;IACvC,gBAAgB,GAAG,IAAI,CAAC;IACxB,oBAAoB,GAAG,iBAAiB,CAAC,IAAI,CAAC;AAChD,CAAC;KAAM,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IACzC,gBAAgB,GAAG,MAAM,CAAC;IAC1B,oBAAoB,GAAG,iBAAiB,CAAC,MAAM,CAAC;IAChD,iDAAiD;AACnD,CAAC;KAAM,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IACzC,iDAAiD;IACjD,gBAAgB,GAAG,MAAM,CAAC;IAC1B,oBAAoB,GAAG,iBAAiB,CAAC,MAAM,CAAC;AAClD,CAAC;KAAM,CAAC;IACN,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;AAC3E,CAAC;AACD,wCAAwC;AAExC;;GAEG;AACH,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAOhC,0CAAe;AALxB;;GAEG;AACH,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AAEvB,kDAAmB","sourcesContent":["enum GlobalObjectNames {\n  // The globalThis entry is incorrectly identified as shadowing the global\n  // globalThis.\n  /* eslint-disable @typescript-eslint/naming-convention */\n  globalThis = 'globalThis',\n  global = 'global',\n  self = 'self',\n  window = 'window',\n  /* eslint-enable @typescript-eslint/naming-convention */\n}\n\nlet _rootRealmGlobal: typeof globalThis;\nlet _rootRealmGlobalName: string;\n\n/* istanbul ignore next */\n/* eslint-disable no-negated-condition */\nif (typeof globalThis !== 'undefined') {\n  _rootRealmGlobal = globalThis;\n  _rootRealmGlobalName = GlobalObjectNames.globalThis;\n} else if (typeof self !== 'undefined') {\n  _rootRealmGlobal = self;\n  _rootRealmGlobalName = GlobalObjectNames.self;\n} else if (typeof window !== 'undefined') {\n  _rootRealmGlobal = window;\n  _rootRealmGlobalName = GlobalObjectNames.window;\n  // eslint-disable-next-line no-restricted-globals\n} else if (typeof global !== 'undefined') {\n  // eslint-disable-next-line no-restricted-globals\n  _rootRealmGlobal = global;\n  _rootRealmGlobalName = GlobalObjectNames.global;\n} else {\n  throw new Error('Unknown realm type; failed to identify global object.');\n}\n/* eslint-enable no-negated-condition */\n\n/**\n * A platform-agnostic alias for the root realm global object.\n */\nconst rootRealmGlobal = _rootRealmGlobal;\n\n/**\n * The string literal corresponding to the name of the root realm global object.\n */\nconst rootRealmGlobalName = _rootRealmGlobalName;\n\nexport { rootRealmGlobal, rootRealmGlobalName };\n"]}