{"version":3,"sources":["importmap.ts"],"sourcesContent":["import { Path } from \"datex-core-legacy/utils/path.ts\";\nimport { Logger } from \"datex-core-legacy/utils/logger.ts\";\nconst logger = new Logger(\"UIX Import Map\");\n\n/**\n * wrapper class around the import map object, with an optional linked path and helper methods\n */\nexport class ImportMap {\n\n\t/**\n\t * the orignal import map json\n\t */\n\tget json() {return this.#json}\n\t\n\t/**\n\t * imports property of the import map\n\t */\n\tget imports(){return this.#json.imports}\n\n\t\t\n\t/**\n\t * scopes property of the import map\n\t */\n\tget scopes(){return this.#json.scopes}\n\n\ttoString(onlyImports = false) {\n\t\treturn JSON.stringify(onlyImports ? {imports:this.imports, scopes: this.scopes} : this.#json, null, '    ')\n\t}\n\n\t#pinnedVersions:Record<string,string> = {};\n\t#libVersions:Record<string,string|undefined> = {};\n\n\t/**\n\t * imports without temporary imports\n\t * pinned versions are resolved\n\t */\n\tget static_imports(){\n\t\tconst imports = {...this.#json.imports};\n\t\tfor (const specifier of Object.keys(imports)) {\n\t\t\t// exclude .eternal.ts imports\n\t\t\tif (specifier.endsWith(\".eternal.ts\") || specifier.endsWith(\".eternal.tsx\") || specifier.endsWith(\".eternal.js\") || specifier.endsWith(\".eternal.jsx\") || specifier.endsWith(\".eternal.mts\") || specifier.endsWith(\".eternal.mjs\")) \n\t\t\t\tdelete imports[specifier];\n\t\t\t// exclude temp entries\n\t\t\tif (this.isEntryTemporary(specifier)) delete imports[specifier];\n\t\t\t// pinned versions\n\t\t\tif (specifier in this.#pinnedVersions) imports[specifier] = this.#pinnedVersions[specifier];\n\t\t}\n\t\treturn imports;\n\t}\n\n\t/**\n\t * resolves pinned versions (unyt CDNs)\n\t */\n\tasync resolvePinnedVersions() {\n\t\tfor (const [specifier, url] of Object.entries(this.static_imports)) {\n\t\t\t// only if url\n\t\t\tif (typeof url == \"string\" && (url.startsWith(\"https://\") || url.startsWith(\"http://\"))) {\n\t\t\t\t// get path (https://domain/path/VERSION.ts)\n\t\t\t\tconst path = new Path(url);\n\t\t\t\tconst lib = path.pathname.split(\"/\")[1];\n\t\t\t\tif (!(lib in this.#libVersions)) {\n\t\t\t\t\t// get version from VERSION.ts module\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst versionPath = new Path(path.origin).getChildPath(lib + \"/VERSION.ts\");\n\t\t\t\t\t\tconst version = (await import(versionPath.toString())).default;\n\n\t\t\t\t\t\t// ignore non-semver versions\n\t\t\t\t\t\tif (version.match(/\\d+\\.\\d+\\.\\d+/)) {\n\t\t\t\t\t\t\tthis.#libVersions[lib] = version;\n\t\t\t\t\t\t\tlogger.debug(\"using pinned version \" + version + \" for \" + lib);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse this.#libVersions[lib] = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tcatch {\n\t\t\t\t\t\tthis.#libVersions[lib] = undefined;\n\t\t\t\t\t}\n\t\t\t\t} \n\n\t\t\t\t// set pinned version for URL\n\t\t\t\tif (this.#libVersions[lib]) {\n\t\t\t\t\tthis.#pinnedVersions[specifier] = this.#getPinnedUrl(url, lib);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns the URL with the pinned version if available\n\t * @param url the original URL\n\t * @param lib the library name\n\t * @returns \n\t */\n\t#getPinnedUrl(url: string, lib: string) {\n\t\tif (!this.#libVersions[lib]) return url;\n\t\treturn url.replace(/(?<=https?:\\/\\/[^/]*\\/)[^/]*/, (v)=> {\n\t\t\treturn v.replace(/@.*/, '') + \"@\" + this.#libVersions[lib];\n\t\t})\n\t}\n\n\n\t/**\n\t * Same as import.meta.resolve, but uses pinned versions for CDN libraries if available\n\t * @param path \n\t */\n\tresolvePinned(path: string|URL) {\n\t\tconst resolved = import.meta.resolve(path.toString());\n\t\t// check if resolved path is a CDN library\n\t\tconst lib = URL.canParse(resolved) && new URL(resolved).pathname.split(\"/\")[1];\n\t\tif (lib && this.#libVersions[lib]) {\n\t\t\treturn this.#getPinnedUrl(resolved, lib);\n\t\t}\n\t\telse {\n\t\t\treturn resolved;\n\t\t}\n\t}\n\n\t#initialized = false;\n\tasync init() {\n\t\tif (this.#initialized) return;\n\t\tthis.#initialized = true;\n\t\tawait this.resolvePinnedVersions();\n\t}\n\n\t#readonly = true;\n\t#json: {imports:Record<string,string>, scopes?:Record<string,Record<string,string>>};\n\t#path?: Path;\n\t#originalPath?: Path\n\n\n\t#temporary_imports = new Set<string>;\n\n\tget readonly() {return this.#readonly}\n\tget path() {return this.#path}\n\tget originalPath() {return this.#originalPath??this.#path}\n\n\tstatic async fromPath(path:string|URL) {\n\t\tconst map = JSON.parse(<string>await new Path(path).getTextContent());\n\t\treturn new ImportMap(map, path);\n\t}\n\n\tconstructor(map:{imports:Record<string,string>}, path?:string|URL, resetOnUnload = false, originalPath?:Path) {\n\t\tthis.#json = map;\n\t\tthis.#path = path ? new Path(path) : undefined;\n\t\tthis.#originalPath = originalPath;\n\t\tthis.#readonly = !this.#path || this.#path.is_web;\n\n\t\tthis.clearEntriesForExtension(\".dx.d.ts\"); // remove temporarily created dx.d.ts entries from previous sessions\n\t\tif (resetOnUnload) addEventListener(\"unload\", ()=>this.clearTemporaryEntries());\n\n\t\t// make imports available as normal property\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(ImportMap.prototype, \"imports\");\n\t\tconst modified_descriptor = Object.assign(descriptor as any, {enumerable: true});\n\t\tObject.defineProperty(this, \"imports\", modified_descriptor);\n\t}\n\n\tpublic addEntry(name:string|URL, value:string|URL, temporary = true, scope?: string|URL){\n\t\tif (this.readonly) {\n\t\t\tlogger.warn(\"cannot dynamically update the current import map - no read access\");\n\t\t\treturn;\n\t\t}\n\t\tconst val_string = this.getNormalizedURL(value);\n\t\tconst name_string = this.getNormalizedURL(name);\n\t\tconst scope_string = scope && this.getNormalizedURL(scope);\n\t\t\n\t\t// also add entries for aliases, e.g. for ./backend/x.dx -> backend/x.dx\n\t\tconst namePath = name instanceof URL ? new Path(name) : null;\n\t\tif (namePath && !namePath.isWeb()) {\n\t\t\tfor (const alias of this.getPathAliases(namePath)) {\n\t\t\t\tthis.#addEntry(alias, val_string, temporary, scope_string);\n\t\t\t}\n\t\t}\n\t\tthis.#addEntry(name_string, val_string, temporary, scope_string);\n\n\t\tthis.#writeToFile();\n\t}\n\n\tpublic removeEntry(name: string|Path, temporary = true, scope?:string|\"*\"|URL) {\n\t\tif (this.readonly) {\n\t\t\tlogger.warn(\"cannot dynamically update the current import map - no read access\");\n\t\t\treturn;\n\t\t}\n\t\tconst name_string = this.getNormalizedURL(name);\n\t\tconst scope_string = scope && this.getNormalizedURL(scope);\n\n\t\t// also remove entries for aliases, e.g. for ./backend/x.dx -> backend/x.dx\n\t\tconst namePath = name instanceof URL ? new Path(name) : null;\n\t\tif (namePath instanceof Path && !namePath.isWeb()) {\n\t\t\tfor (const alias of this.getPathAliases(namePath)) {\n\t\t\t\tthis.#removeEntry(alias, temporary, scope_string);\n\t\t\t}\n\t\t}\n\t\tthis.#removeEntry(name_string, temporary, scope_string);\n\t\tthis.#writeToFile();\n\t}\n\n\tprivate getNormalizedURL(urlOrSpecifier:string|URL) {\n\t\tif (urlOrSpecifier instanceof URL) urlOrSpecifier = new Path(urlOrSpecifier);\n\t\treturn (urlOrSpecifier instanceof Path && !urlOrSpecifier.isWeb()) ? urlOrSpecifier.getAsRelativeFrom(this.#path!) : urlOrSpecifier.toString();\n\t}\n\n\tpublic isEntryTemporary(name:string) {\n\t\treturn this.#temporary_imports.has(name);\n\t}\n\n\n\tgetPathAliases(path:Path) {\n\t\tconst aliases = [];\n\t\tif (!this.#path) throw new Error(\"cannot resolve relative imports - no import map path\")\n\t\tfor (const [specifier, mapped] of Object.entries(this.imports)) {\n\t\t\tconst mapped_path = new Path(mapped, this.#path);\n\t\t\tif (Path.equals(path, mapped_path) || path.isChildOf(mapped_path)) {\n\t\t\t\taliases.push(path.toString().replace(mapped_path.toString(), specifier))\n\t\t\t}\n\t\t}\n\t\treturn aliases;\n\t}\n\n\tclearEntriesForExtension(ext:string){\n\t\tif (this.readonly) return;\n\n\t\tfor (const [specifier, mapped] of Object.entries(this.imports)) {\n\t\t\tif (mapped.endsWith(ext)) delete this.imports[specifier];\n\t\t}\n\t\tthis.#writeToFile();\n\t}\n\n\t// remove temporary entries\n\tclearTemporaryEntries() {\n\t\tif (this.readonly) return;\n\n\t\tlogger.info(\"removing temporary import map entries\")\n\t\tfor (const specifier of this.#temporary_imports) {\n\t\t\tdelete this.imports[specifier];\n\t\t}\n\t\tthis.#writeToFile();\n\t}\n\n\n\t#addEntry(name:string, value:string, temporary = true, scope?: string) {\n\t\tif (scope) {\n\t\t\tif (!this.scopes) this.#json.scopes = {};\n\t\t\tif (!(scope in this.scopes!)) this.scopes![scope] = {};\n\t\t\tthis.scopes![scope][name] = value;\n\t\t}\n\t\telse this.imports[name] = value;\n\t\tif (temporary) this.#temporary_imports.add(name)\n\t\tlogger.debug(`added${temporary?' temporary' : ''} entry: ${name}`)\n\t}\n\n\t#removeEntry(name:string, temporary = true, scope?: string) {\n\t\tif (scope == \"*\") {\n\t\t\tfor (const scope of Object.values(this.scopes??{})) {\n\t\t\t\tdelete scope[name]\n\t\t\t}\n\t\t}\n\t\telse if (scope) {\n\t\t\tdelete this.scopes?.[scope]?.[name];\n\t\t}\n\t\telse delete this.imports[name];\n\n\t\tif (temporary) this.#temporary_imports.add(name)\n\t\tlogger.debug(`removed${temporary?' temporary' : ''} entry: ${name}`)\n\t}\n\n\t#writeToFile(){\n\t\tif (!this.#path) throw new Error(\"import map is readonly\")\n\t\ttry {\n\t\t\tDeno.writeTextFileSync(this.#path.normal_pathname, this.toString())\n\t\t}\n\t\tcatch {\n\t\t\tlogger.error(\"could not update import map\")\n\t\t}\n\t}\n\n\tsave() {\n\t\tthis.#writeToFile()\n\t}\n\n\tgetMoved(newImportMapLocation: URL, resetOnUnload = false) {\n\t\tconst mappedImports:Record<string,string> = {};\n\t\tfor (let [key, value] of Object.entries(this.imports)) {\n\t\t\tif (key.startsWith(\"./\") || key.startsWith(\"../\")) {\n\t\t\t\tconst absPath = new Path(key, this.path);\n\t\t\t\tkey = absPath.getAsRelativeFrom(newImportMapLocation);\n\t\t\t} \n\t\t\tif (value.startsWith(\"./\") || value.startsWith(\"../\")) {\n\t\t\t\tconst absPath = new Path(value, this.path);\n\t\t\t\tvalue = absPath.getAsRelativeFrom(newImportMapLocation);\n\t\t\t}\n\t\t\tmappedImports[key] = value;\n\t\t}\n\t\treturn new ImportMap({imports:mappedImports}, newImportMapLocation, resetOnUnload, this.originalPath);\n\t}\n}\n\n"],"names":["Path","Logger","logger","ImportMap","json","imports","scopes","toString","onlyImports","JSON","stringify","static_imports","specifier","Object","keys","endsWith","isEntryTemporary","resolvePinnedVersions","url","entries","startsWith","path","lib","pathname","split","versionPath","origin","getChildPath","version","default","match","debug","undefined","replace","v","resolvePinned","resolved","resolve","URL","canParse","init","Set","readonly","originalPath","fromPath","parse","getTextContent","constructor","map","resetOnUnload","is_web","clearEntriesForExtension","addEventListener","clearTemporaryEntries","defineProperty","assign","getOwnPropertyDescriptor","prototype","enumerable","addEntry","name","value","temporary","scope","warn","val_string","getNormalizedURL","name_string","scope_string","namePath","isWeb","alias","getPathAliases","removeEntry","urlOrSpecifier","getAsRelativeFrom","has","aliases","Error","mapped","mapped_path","equals","isChildOf","push","ext","info","add","values","Deno","writeTextFileSync","normal_pathname","error","save","getMoved","newImportMapLocation","mappedImports","key","absPath"],"mappings":"AAAA,SAASA,IAAI,QAAQ,kCAAkC;AACvD,SAASC,MAAM,QAAQ,oCAAoC;AAC3D,IAAMC,SAAS,IAAID,OAAO;AAK1B,OAAO,MAAME;IAKZ,IAAIC,OAAO;QAAC,OAAO,IAAI,CAAC,CAAA,IAAK;IAAA;IAK7B,IAAIC,UAAS;QAAC,OAAO,IAAI,CAAC,CAAA,IAAK,CAACA,OAAO;IAAA;IAMvC,IAAIC,SAAQ;QAAC,OAAO,IAAI,CAAC,CAAA,IAAK,CAACA,MAAM;IAAA;IAErCC,SAASC,cAAc,CAAA,CAAK,EA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