@openmrs/esm-globals 3.2.0 → 3.2.1-pre.933
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register([],(function(e,t){return{execute:function(){e((()=>{var e={968:(e,t,n)=>{const o=n(577).R;t.s=function(e){if(e||(e=1),!n.y.meta||!n.y.meta.url)throw console.error("__system_context__",n.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");n.p=o(n.y.meta.url,e)}},577:(e,t,n)=>{t.R=function(e,t){var n=document.createElement("a");n.href=e;for(var o="/"===n.pathname[0]?n.pathname:"/"+n.pathname,r=0,i=o.length;r!==t&&i>=0;)"/"===o[--i]&&r++;if(r!==t)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+t+") is greater than the number of directories ("+r+") in the URL path "+e);var s=o.slice(0,i+1);return n.protocol+"//"+n.host+s};Number.isInteger}},n={};function o(t){var r=n[t];if(void 0!==r)return r.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,o),i.exports}o.y=t,o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})();var r={};return(0,o(968).s)(1),(()=>{"use strict";o.r(r),o.d(r,{dispatchConnectivityChanged:()=>t,dispatchNotificationShown:()=>u,dispatchPrecacheStaticDependencies:()=>c,setupPaths:()=>v,setupUtils:()=>m,subscribeConnectivity:()=>i,subscribeConnectivityChanged:()=>n,subscribeNotificationShown:()=>w,subscribePrecacheStaticDependencies:()=>a,subscribeToastShown:()=>l});const e="openmrs:connectivity-changed";function t(t){window.dispatchEvent(new CustomEvent(e,{detail:{online:t}}))}function n(t){const n=e=>t(e.detail);return window.addEventListener(e,n),()=>window.removeEventListener(e,n)}function i(e){return e({online:navigator.onLine}),n(e)}const s="openmrs:precache-static-dependencies";function c(e={}
|
|
1
|
+
System.register([],(function(e,t){return{execute:function(){e((()=>{var e={968:(e,t,n)=>{const o=n(577).R;t.s=function(e){if(e||(e=1),!n.y.meta||!n.y.meta.url)throw console.error("__system_context__",n.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");n.p=o(n.y.meta.url,e)}},577:(e,t,n)=>{t.R=function(e,t){var n=document.createElement("a");n.href=e;for(var o="/"===n.pathname[0]?n.pathname:"/"+n.pathname,r=0,i=o.length;r!==t&&i>=0;)"/"===o[--i]&&r++;if(r!==t)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+t+") is greater than the number of directories ("+r+") in the URL path "+e);var s=o.slice(0,i+1);return n.protocol+"//"+n.host+s};Number.isInteger}},n={};function o(t){var r=n[t];if(void 0!==r)return r.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,o),i.exports}o.y=t,o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})();var r={};return(0,o(968).s)(1),(()=>{"use strict";o.r(r),o.d(r,{dispatchConnectivityChanged:()=>t,dispatchNotificationShown:()=>u,dispatchPrecacheStaticDependencies:()=>c,setupPaths:()=>v,setupUtils:()=>m,subscribeConnectivity:()=>i,subscribeConnectivityChanged:()=>n,subscribeNotificationShown:()=>w,subscribePrecacheStaticDependencies:()=>a,subscribeToastShown:()=>l});const e="openmrs:connectivity-changed";function t(t){window.dispatchEvent(new CustomEvent(e,{detail:{online:t}}))}function n(t){const n=e=>t(e.detail);return window.addEventListener(e,n),()=>window.removeEventListener(e,n)}function i(e){return e({online:navigator.onLine}),n(e)}const s="openmrs:precache-static-dependencies";function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};window.dispatchEvent(new CustomEvent(s,{detail:e}))}function a(e){const t=t=>e(t.detail);return window.addEventListener(s,t),()=>window.removeEventListener(s,t)}const d="openmrs:notification-shown",p="openmrs:toast-shown";function u(e){window.dispatchEvent(new CustomEvent(d,{detail:e}))}function w(e){const t=t=>e(t.detail);return window.addEventListener(d,t),()=>window.removeEventListener(d,t)}function l(e){const t=t=>e(t.detail);return window.addEventListener(p,t),()=>window.removeEventListener(p,t)}function v(e){window.openmrsBase=e.apiUrl,window.spaBase=e.spaPath,window.spaEnv=e.env||"production",window.spaVersion=process.env.BUILD_VERSION,window.getOpenmrsSpaBase=()=>`${window.spaBase}/`}function m(){window.copyText=e=>{const t=window.getSelection();if(t){const n=document.createRange();n.selectNode(e),t.removeAllRanges(),t.addRange(n),document.execCommand("copy"),t.removeAllR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UC,SAChBR,EAA6BC,GAKtC,MAAMQ,EACJ,uCAEK,SAASC,EACdC,EAAwC,IAExCrC,OAAOuB,cACL,IAAIC,YAAYW,EAAqC,CAAEV,OAAQY,KAI5D,SAASC,EACdX,GAEA,MAAMC,EAAWC,GAAoBF,EAAGE,EAAGJ,QAE3C,OADAzB,OAAO8B,iBAAiBK,EAAqCP,GACtD,IACL5B,OAAO+B,oBAAoBI,EAAqCP,GA8BpE,MAAMW,EAAwB,6BACxBC,EAAiB,sBAEhB,SAASC,EAA0BJ,GACxCrC,OAAOuB,cACL,IAAIC,YAAYe,EAAuB,CAAEd,OAAQY,KAI9C,SAASK,EACdf,GAEA,MAAMC,EAAWC,GAAoBF,EAAGE,EAAGJ,QAE3C,OADAzB,OAAO8B,iBAAiBS,EAAuBX,GACxC,IAAM5B,OAAO+B,oBAAoBQ,EAAuBX,GAG1D,SAASe,EAAoBhB,GAClC,MAAMC,EAAWC,GAAoBF,EAAGE,EAAGJ,QAE3C,OADAzB,OAAO8B,iBAAiBU,EAAgBZ,GACjC,IAAM5B,OAAO+B,oBAAoBS,EAAgBZ,GC/FnD,SAASgB,EAAWC,GACzB7C,OAAO8C,YAAcD,EAAOE,OAC5B/C,OAAOgD,QAAUH,EAAOI,QACxBjD,OAAOkD,OAASL,EAAOM,KAAO,aAC9BnD,OAAOoD,WAAaC,QAAQF,IAAIG,cAChCtD,OAAOuD,kBAAoB,IAAO,GAAEvD,OAAOgD,WAGtC,SAASQ,IACdxD,OAAOyD,SAAYC,IACjB,MAAMC,EAAM3D,OAAO4D,eAEnB,GAAID,EAAK,CACP,MAAMrD,EAAIzC,SAASgG,cACnBvD,EAAEwD,WAAWJ,GACbC,EAAII,kBACJJ,EAAIK,SAAS1D,GACbzC,SAASoG,YAAY,QACrBN,EAAII,sB","sources":["webpack://@openmrs/esm-globals/../../../node_modules/systemjs-webpack-interop/auto-public-path/auto-public-path.js","webpack://@openmrs/esm-globals/../../../node_modules/systemjs-webpack-interop/public-path.js","webpack://@openmrs/esm-globals/webpack/bootstrap","webpack://@openmrs/esm-globals/webpack/runtime/__system_context__","webpack://@openmrs/esm-globals/webpack/runtime/define property getters","webpack://@openmrs/esm-globals/webpack/runtime/global","webpack://@openmrs/esm-globals/webpack/runtime/hasOwnProperty shorthand","webpack://@openmrs/esm-globals/webpack/runtime/make namespace object","webpack://@openmrs/esm-globals/webpack/runtime/publicPath","webpack://@openmrs/esm-globals/../../../node_modules/systemjs-webpack-interop/auto-public-path/1.js","webpack://@openmrs/esm-globals/./src/events.ts","webpack://@openmrs/esm-globals/./src/globals.ts"],"sourcesContent":["const resolveDirectory = require(\"../public-path\").resolveDirectory;\n\nexports.autoPublicPath = function autoPublicPath(rootDirLevel) {\n if (!rootDirLevel) {\n rootDirLevel = 1;\n }\n\n if (typeof __webpack_public_path__ !== \"undefined\") {\n if (typeof __system_context__ === \"undefined\") {\n throw Error(\n \"systemjs-webpack-interop requires webpack@>=5.0.0-beta.15 and output.libraryTarget set to 'system'\"\n );\n }\n\n if (!__system_context__.meta || !__system_context__.meta.url) {\n console.error(\"__system_context__\", __system_context__);\n throw Error(\n \"systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided\"\n );\n }\n\n __webpack_public_path__ = resolveDirectory(\n __system_context__.meta.url,\n rootDirLevel\n );\n }\n};\n","exports.setPublicPath = function setPublicPath(\n systemjsModuleName,\n rootDirectoryLevel\n) {\n if (!rootDirectoryLevel) {\n rootDirectoryLevel = 1;\n }\n if (\n typeof systemjsModuleName !== \"string\" ||\n systemjsModuleName.trim().length === 0\n ) {\n throw Error(\n \"systemjs-webpack-interop: setPublicPath(systemjsModuleName) must be called with a non-empty string 'systemjsModuleName'\"\n );\n }\n\n if (\n typeof rootDirectoryLevel !== \"number\" ||\n rootDirectoryLevel <= 0 ||\n isNaN(rootDirectoryLevel) ||\n !isInteger(rootDirectoryLevel)\n ) {\n throw Error(\n \"systemjs-webpack-interop: setPublicPath(systemjsModuleName, rootDirectoryLevel) must be called with a positive integer 'rootDirectoryLevel'\"\n );\n }\n\n var moduleUrl;\n try {\n moduleUrl = window.System.resolve(systemjsModuleName);\n if (!moduleUrl) {\n throw Error();\n }\n } catch (err) {\n throw Error(\n \"systemjs-webpack-interop: There is no such module '\" +\n systemjsModuleName +\n \"' in the SystemJS registry. Did you misspell the name of your module?\"\n );\n }\n\n __webpack_public_path__ = resolveDirectory(moduleUrl, rootDirectoryLevel);\n};\n\nfunction resolveDirectory(urlString, rootDirectoryLevel) {\n // Our friend IE11 doesn't support new URL()\n // https://github.com/single-spa/single-spa/issues/612\n // https://gist.github.com/jlong/2428561\n\n var a = document.createElement(\"a\");\n a.href = urlString;\n\n var pathname = a.pathname[0] === \"/\" ? a.pathname : \"/\" + a.pathname;\n var numDirsProcessed = 0,\n index = pathname.length;\n while (numDirsProcessed !== rootDirectoryLevel && index >= 0) {\n var char = pathname[--index];\n if (char === \"/\") {\n numDirsProcessed++;\n }\n }\n\n if (numDirsProcessed !== rootDirectoryLevel) {\n throw Error(\n \"systemjs-webpack-interop: rootDirectoryLevel (\" +\n rootDirectoryLevel +\n \") is greater than the number of directories (\" +\n numDirsProcessed +\n \") in the URL path \" +\n urlString\n );\n }\n\n var finalPath = pathname.slice(0, index + 1);\n\n return a.protocol + \"//\" + a.host + finalPath;\n}\n\nexports.resolveDirectory = resolveDirectory;\n\n// borrowed from https://github.com/parshap/js-is-integer/blob/master/index.js\nvar isInteger =\n Number.isInteger ||\n function isInteger(val) {\n return typeof val === \"number\" && isFinite(val) && Math.floor(val) === val;\n };\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","__webpack_require__.y = __system_context__;","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","const autoPublicPath = require(\"./auto-public-path\").autoPublicPath;\n\nautoPublicPath(1);\n","export interface ConnectivityChangedEvent {\n online: boolean;\n}\n\nconst connectivityChangedEventName = \"openmrs:connectivity-changed\";\n\nexport function dispatchConnectivityChanged(online: boolean) {\n window.dispatchEvent(\n new CustomEvent(connectivityChangedEventName, { detail: { online } })\n );\n}\n\nexport function subscribeConnectivityChanged(\n cb: (ev: ConnectivityChangedEvent) => void\n) {\n const handler = (ev: CustomEvent) => cb(ev.detail);\n window.addEventListener(connectivityChangedEventName, handler);\n return () =>\n window.removeEventListener(connectivityChangedEventName, handler);\n}\n\nexport function subscribeConnectivity(\n cb: (ev: ConnectivityChangedEvent) => void\n) {\n cb({ online: navigator.onLine });\n return subscribeConnectivityChanged(cb);\n}\n\nexport interface PrecacheStaticDependenciesEvent {}\n\nconst precacheStaticDependenciesEventName =\n \"openmrs:precache-static-dependencies\";\n\nexport function dispatchPrecacheStaticDependencies(\n data: PrecacheStaticDependenciesEvent = {}\n) {\n window.dispatchEvent(\n new CustomEvent(precacheStaticDependenciesEventName, { detail: data })\n );\n}\n\nexport function subscribePrecacheStaticDependencies(\n cb: (data: PrecacheStaticDependenciesEvent) => void\n) {\n const handler = (ev: CustomEvent) => cb(ev.detail);\n window.addEventListener(precacheStaticDependenciesEventName, handler);\n return () =>\n window.removeEventListener(precacheStaticDependenciesEventName, handler);\n}\n\nexport interface ShowNotificationEvent {\n description: any;\n kind?:\n | \"error\"\n | \"info\"\n | \"info-square\"\n | \"success\"\n | \"warning\"\n | \"warning-alt\";\n title?: string;\n action?: any;\n millis?: number;\n}\n\nexport interface ShowToastEvent {\n description: any;\n kind?:\n | \"error\"\n | \"info\"\n | \"info-square\"\n | \"success\"\n | \"warning\"\n | \"warning-alt\";\n title?: string;\n millis?: number;\n}\n\nconst notificationShownName = \"openmrs:notification-shown\";\nconst toastShownName = \"openmrs:toast-shown\";\n\nexport function dispatchNotificationShown(data: ShowNotificationEvent) {\n window.dispatchEvent(\n new CustomEvent(notificationShownName, { detail: data })\n );\n}\n\nexport function subscribeNotificationShown(\n cb: (data: ShowNotificationEvent) => void\n) {\n const handler = (ev: CustomEvent) => cb(ev.detail);\n window.addEventListener(notificationShownName, handler);\n return () => window.removeEventListener(notificationShownName, handler);\n}\n\nexport function subscribeToastShown(cb: (data: ShowToastEvent) => void) {\n const handler = (ev: CustomEvent) => cb(ev.detail);\n window.addEventListener(toastShownName, handler);\n return () => window.removeEventListener(toastShownName, handler);\n}\n","import { SpaConfig } from \"./types\";\n\nexport function setupPaths(config: SpaConfig) {\n window.openmrsBase = config.apiUrl;\n window.spaBase = config.spaPath;\n window.spaEnv = config.env || \"production\";\n window.spaVersion = process.env.BUILD_VERSION;\n window.getOpenmrsSpaBase = () => `${window.spaBase}/`;\n}\n\nexport function setupUtils() {\n window.copyText = (source: HTMLElement) => {\n const sel = window.getSelection();\n\n if (sel) {\n const r = document.createRange();\n r.selectNode(source);\n sel.removeAllRanges();\n sel.addRange(r);\n document.execCommand(\"copy\");\n sel.removeAllRanges();\n }\n };\n}\n"],"names":["resolveDirectory","exports","rootDirLevel","meta","url","console","error","Error","urlString","rootDirectoryLevel","a","document","createElement","href","pathname","numDirsProcessed","index","length","finalPath","slice","protocol","host","Number","isInteger","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","module","__webpack_modules__","y","__system_context__","d","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","this","Function","e","window","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","scriptUrl","importScripts","location","currentScript","src","scripts","getElementsByTagName","replace","p","autoPublicPath","connectivityChangedEventName","dispatchConnectivityChanged","online","dispatchEvent","CustomEvent","detail","subscribeConnectivityChanged","cb","handler","ev","addEventListener","removeEventListener","subscribeConnectivity","navigator","onLine","precacheStaticDependenciesEventName","dispatchPrecacheStaticDependencies","data","subscribePrecacheStaticDependencies","notificationShownName","toastShownName","dispatchNotificationShown","subscribeNotificationShown","subscribeToastShown","setupPaths","config","openmrsBase","apiUrl","spaBase","spaPath","spaEnv","env","spaVersion","process","BUILD_VERSION","getOpenmrsSpaBase","setupUtils","copyText","source","sel","getSelection","createRange","selectNode","removeAllRanges","addR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AC,EACA,uDADwC,GAExCrC,OAAOuB,cACL,IAAIC,YAAYW,EAAqC,CAAEV,OAAQY,KAI5D,SAASC,EACdX,GAEA,MAAMC,EAAWC,GAAoBF,EAAGE,EAAGJ,QAE3C,OADAzB,OAAO8B,iBAAiBK,EAAqCP,GACtD,IACL5B,OAAO+B,oBAAoBI,EAAqCP,GA8BpE,MAAMW,EAAwB,6BACxBC,EAAiB,sBAEhB,SAASC,EAA0BJ,GACxCrC,OAAOuB,cACL,IAAIC,YAAYe,EAAuB,CAAEd,OAAQY,KAI9C,SAASK,EACdf,GAEA,MAAMC,EAAWC,GAAoBF,EAAGE,EAAGJ,QAE3C,OADAzB,OAAO8B,iBAAiBS,EAAuBX,GACxC,IAAM5B,OAAO+B,oBAAoBQ,EAAuBX,GAG1D,SAASe,EAAoBhB,GAClC,MAAMC,EAAWC,GAAoBF,EAAGE,EAAGJ,QAE3C,OADAzB,OAAO8B,iBAAiBU,EAAgBZ,GACjC,IAAM5B,OAAO+B,oBAAoBS,EAAgBZ,GC/FnD,SAASgB,EAAWC,GACzB7C,OAAO8C,YAAcD,EAAOE,OAC5B/C,OAAOgD,QAAUH,EAAOI,QACxBjD,OAAOkD,OAASL,EAAOM,KAAO,aAC9BnD,OAAOoD,WAAaC,QAAQF,IAAIG,cAChCtD,OAAOuD,kBAAoB,IAAO,GAAEvD,OAAOgD,WAGtC,SAASQ,IACdxD,OAAOyD,SAAYC,IACjB,MAAMC,EAAM3D,OAAO4D,eAEnB,GAAID,EAAK,CACP,MAAMrD,EAAIzC,SAASgG,cACnBvD,EAAEwD,WAAWJ,GACbC,EAAII,kBACJJ,EAAIK,SAAS1D,GACbzC,SAASoG,YAAY,QACrBN,EAAII,sB","sources":["webpack://@openmrs/esm-globals/../../../node_modules/systemjs-webpack-interop/auto-public-path/auto-public-path.js","webpack://@openmrs/esm-globals/../../../node_modules/systemjs-webpack-interop/public-path.js","webpack://@openmrs/esm-globals/webpack/bootstrap","webpack://@openmrs/esm-globals/webpack/runtime/__system_context__","webpack://@openmrs/esm-globals/webpack/runtime/define property getters","webpack://@openmrs/esm-globals/webpack/runtime/global","webpack://@openmrs/esm-globals/webpack/runtime/hasOwnProperty shorthand","webpack://@openmrs/esm-globals/webpack/runtime/make namespace object","webpack://@openmrs/esm-globals/webpack/runtime/publicPath","webpack://@openmrs/esm-globals/../../../node_modules/systemjs-webpack-interop/auto-public-path/1.js","webpack://@openmrs/esm-globals/./src/events.ts","webpack://@openmrs/esm-globals/./src/globals.ts"],"sourcesContent":["const resolveDirectory = require(\"../public-path\").resolveDirectory;\n\nexports.autoPublicPath = function autoPublicPath(rootDirLevel) {\n if (!rootDirLevel) {\n rootDirLevel = 1;\n }\n\n if (typeof __webpack_public_path__ !== \"undefined\") {\n if (typeof __system_context__ === \"undefined\") {\n throw Error(\n \"systemjs-webpack-interop requires webpack@>=5.0.0-beta.15 and output.libraryTarget set to 'system'\"\n );\n }\n\n if (!__system_context__.meta || !__system_context__.meta.url) {\n console.error(\"__system_context__\", __system_context__);\n throw Error(\n \"systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided\"\n );\n }\n\n __webpack_public_path__ = resolveDirectory(\n __system_context__.meta.url,\n rootDirLevel\n );\n }\n};\n","exports.setPublicPath = function setPublicPath(\n systemjsModuleName,\n rootDirectoryLevel\n) {\n if (!rootDirectoryLevel) {\n rootDirectoryLevel = 1;\n }\n if (\n typeof systemjsModuleName !== \"string\" ||\n systemjsModuleName.trim().length === 0\n ) {\n throw Error(\n \"systemjs-webpack-interop: setPublicPath(systemjsModuleName) must be called with a non-empty string 'systemjsModuleName'\"\n );\n }\n\n if (\n typeof rootDirectoryLevel !== \"number\" ||\n rootDirectoryLevel <= 0 ||\n isNaN(rootDirectoryLevel) ||\n !isInteger(rootDirectoryLevel)\n ) {\n throw Error(\n \"systemjs-webpack-interop: setPublicPath(systemjsModuleName, rootDirectoryLevel) must be called with a positive integer 'rootDirectoryLevel'\"\n );\n }\n\n var moduleUrl;\n try {\n moduleUrl = window.System.resolve(systemjsModuleName);\n if (!moduleUrl) {\n throw Error();\n }\n } catch (err) {\n throw Error(\n \"systemjs-webpack-interop: There is no such module '\" +\n systemjsModuleName +\n \"' in the SystemJS registry. Did you misspell the name of your module?\"\n );\n }\n\n __webpack_public_path__ = resolveDirectory(moduleUrl, rootDirectoryLevel);\n};\n\nfunction resolveDirectory(urlString, rootDirectoryLevel) {\n // Our friend IE11 doesn't support new URL()\n // https://github.com/single-spa/single-spa/issues/612\n // https://gist.github.com/jlong/2428561\n\n var a = document.createElement(\"a\");\n a.href = urlString;\n\n var pathname = a.pathname[0] === \"/\" ? a.pathname : \"/\" + a.pathname;\n var numDirsProcessed = 0,\n index = pathname.length;\n while (numDirsProcessed !== rootDirectoryLevel && index >= 0) {\n var char = pathname[--index];\n if (char === \"/\") {\n numDirsProcessed++;\n }\n }\n\n if (numDirsProcessed !== rootDirectoryLevel) {\n throw Error(\n \"systemjs-webpack-interop: rootDirectoryLevel (\" +\n rootDirectoryLevel +\n \") is greater than the number of directories (\" +\n numDirsProcessed +\n \") in the URL path \" +\n urlString\n );\n }\n\n var finalPath = pathname.slice(0, index + 1);\n\n return a.protocol + \"//\" + a.host + finalPath;\n}\n\nexports.resolveDirectory = resolveDirectory;\n\n// borrowed from https://github.com/parshap/js-is-integer/blob/master/index.js\nvar isInteger =\n Number.isInteger ||\n function isInteger(val) {\n return typeof val === \"number\" && isFinite(val) && Math.floor(val) === val;\n };\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","__webpack_require__.y = __system_context__;","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","const autoPublicPath = require(\"./auto-public-path\").autoPublicPath;\n\nautoPublicPath(1);\n","export interface ConnectivityChangedEvent {\n online: boolean;\n}\n\nconst connectivityChangedEventName = \"openmrs:connectivity-changed\";\n\nexport function dispatchConnectivityChanged(online: boolean) {\n window.dispatchEvent(\n new CustomEvent(connectivityChangedEventName, { detail: { online } })\n );\n}\n\nexport function subscribeConnectivityChanged(\n cb: (ev: ConnectivityChangedEvent) => void\n) {\n const handler = (ev: CustomEvent) => cb(ev.detail);\n window.addEventListener(connectivityChangedEventName, handler);\n return () =>\n window.removeEventListener(connectivityChangedEventName, handler);\n}\n\nexport function subscribeConnectivity(\n cb: (ev: ConnectivityChangedEvent) => void\n) {\n cb({ online: navigator.onLine });\n return subscribeConnectivityChanged(cb);\n}\n\nexport interface PrecacheStaticDependenciesEvent {}\n\nconst precacheStaticDependenciesEventName =\n \"openmrs:precache-static-dependencies\";\n\nexport function dispatchPrecacheStaticDependencies(\n data: PrecacheStaticDependenciesEvent = {}\n) {\n window.dispatchEvent(\n new CustomEvent(precacheStaticDependenciesEventName, { detail: data })\n );\n}\n\nexport function subscribePrecacheStaticDependencies(\n cb: (data: PrecacheStaticDependenciesEvent) => void\n) {\n const handler = (ev: CustomEvent) => cb(ev.detail);\n window.addEventListener(precacheStaticDependenciesEventName, handler);\n return () =>\n window.removeEventListener(precacheStaticDependenciesEventName, handler);\n}\n\nexport interface ShowNotificationEvent {\n description: any;\n kind?:\n | \"error\"\n | \"info\"\n | \"info-square\"\n | \"success\"\n | \"warning\"\n | \"warning-alt\";\n title?: string;\n action?: any;\n millis?: number;\n}\n\nexport interface ShowToastEvent {\n description: any;\n kind?:\n | \"error\"\n | \"info\"\n | \"info-square\"\n | \"success\"\n | \"warning\"\n | \"warning-alt\";\n title?: string;\n millis?: number;\n}\n\nconst notificationShownName = \"openmrs:notification-shown\";\nconst toastShownName = \"openmrs:toast-shown\";\n\nexport function dispatchNotificationShown(data: ShowNotificationEvent) {\n window.dispatchEvent(\n new CustomEvent(notificationShownName, { detail: data })\n );\n}\n\nexport function subscribeNotificationShown(\n cb: (data: ShowNotificationEvent) => void\n) {\n const handler = (ev: CustomEvent) => cb(ev.detail);\n window.addEventListener(notificationShownName, handler);\n return () => window.removeEventListener(notificationShownName, handler);\n}\n\nexport function subscribeToastShown(cb: (data: ShowToastEvent) => void) {\n const handler = (ev: CustomEvent) => cb(ev.detail);\n window.addEventListener(toastShownName, handler);\n return () => window.removeEventListener(toastShownName, handler);\n}\n","import { SpaConfig } from \"./types\";\n\nexport function setupPaths(config: SpaConfig) {\n window.openmrsBase = config.apiUrl;\n window.spaBase = config.spaPath;\n window.spaEnv = config.env || \"production\";\n window.spaVersion = process.env.BUILD_VERSION;\n window.getOpenmrsSpaBase = () => `${window.spaBase}/`;\n}\n\nexport function setupUtils() {\n window.copyText = (source: HTMLElement) => {\n const sel = window.getSelection();\n\n if (sel) {\n const r = document.createRange();\n r.selectNode(source);\n sel.removeAllRanges();\n sel.addRange(r);\n document.execCommand(\"copy\");\n sel.removeAllRanges();\n }\n };\n}\n"],"names":["resolveDirectory","exports","rootDirLevel","meta","url","console","error","Error","urlString","rootDirectoryLevel","a","document","createElement","href","pathname","numDirsProcessed","index","length","finalPath","slice","protocol","host","Number","isInteger","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","module","__webpack_modules__","y","__system_context__","d","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","this","Function","e","window","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","scriptUrl","importScripts","location","currentScript","src","scripts","getElementsByTagName","replace","p","autoPublicPath","connectivityChangedEventName","dispatchConnectivityChanged","online","dispatchEvent","CustomEvent","detail","subscribeConnectivityChanged","cb","handler","ev","addEventListener","removeEventListener","subscribeConnectivity","navigator","onLine","precacheStaticDependenciesEventName","dispatchPrecacheStaticDependencies","data","subscribePrecacheStaticDependencies","notificationShownName","toastShownName","dispatchNotificationShown","subscribeNotificationShown","subscribeToastShown","setupPaths","config","openmrsBase","apiUrl","spaBase","spaPath","spaEnv","env","spaVersion","process","BUILD_VERSION","getOpenmrsSpaBase","setupUtils","copyText","source","sel","getSelection","createRange","selectNode","removeAllRanges","addRange","execCommand"],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-globals",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1-pre.933",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"browser": "dist/openmrs-esm-globals.js",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"single-spa": "^5.9.3"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "1b80ed23aaf71ecd7744adaee5e0a885ed643683"
|
|
42
42
|
}
|