{"version":3,"sources":["webpack:///./src/util/script-loader.ts","webpack:///./src/util/global-this.ts"],"names":["async","loadScriptWithGlobal","url","globalName","targetElement","arguments","length","undefined","globals","getGlobalThis","document","Error","head","Promise","resolve","reject","script","createElement","setAttribute","onload","concat","appendChild","self","window","global"],"mappings":"+FAAA,+CAEOA,eAAeC,EAAoCC,EAAaC,GAA2E,IAAvDC,EAAsBC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,KAEnH,MAAMG,EAAUC,cAGhB,GAAID,EAAQL,GAEX,OAAOK,EAAQL,GAGhB,IAAKC,EAAe,CACnB,IAAII,EAAQE,SAIX,MAAM,IAAIC,MAAM,+CAHhBP,EAAgBI,EAAQE,SAASE,KAQnC,OAAO,IAAIC,QAAuB,CAACC,EAASC,KAE3C,MAAMC,EAASN,SAASO,cAAc,UACtCD,EAAOE,aAAa,MAAOhB,GAC3Bc,EAAOG,OAAS,KACXX,EAAQL,GACXW,EAAQN,EAAQL,IAGhBY,EAAO,IAAIJ,MAAM,WAADS,OAAYlB,EAAG,wBAIjCE,EAAciB,YAAYL,O,kCCnC5B,YAEO,SAASP,IACf,GAAoB,oBAATa,KAAwB,OAAOA,KAC1C,GAAsB,oBAAXC,OAA0B,OAAOA,OAC5C,QAAsB,IAAXC,EAA0B,OAAOA,EAC5C,MAAM,IAAIb,MAAM,kCANjB,oC","file":"15.6c1c2807f05740c0988d.js","sourcesContent":["import { getGlobalThis } from './global-this';\r\n\r\nexport async function loadScriptWithGlobal(url: string, globalName: string, targetElement: Element = null): Promise {\r\n\t// Get the global (i.e. window) object, where scripts' global namespaces should be found when loaded\r\n\tconst globals = getGlobalThis() as any;\r\n\r\n\t// Return the existing global API reference if it exists\r\n\tif (globals[globalName]) {\r\n\t\t// console.log(\"Global '\" + globalName + \"' is already loaded.\");\r\n\t\treturn globals[globalName] as TScriptGlobal;\r\n\t}\r\n\r\n\tif (!targetElement) {\r\n\t\tif (globals.document) {\r\n\t\t\ttargetElement = globals.document.head;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthrow new Error('Can\\'t load script without a target element.');\r\n\t\t}\r\n\t}\r\n\r\n\t// Load the target library via a `