@icanbwell/composite 1.943.0 → 1.943.2-alpha.1
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.
- package/279.index.js +1 -1
- package/279.index.js.map +1 -1
- package/565.index.js +1 -1
- package/565.index.js.map +1 -1
- package/962.index.js +20 -0
- package/962.index.js.map +1 -0
- package/index.js +10 -10
- package/index.js.map +1 -1
- package/native.js +1 -1
- package/package.json +5 -5
- package/311.index.js +0 -19
- package/311.index.js.map +0 -1
package/279.index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_icanbwell_composite=globalThis.webpackChunk_icanbwell_composite||[]).push([[279],{3279:(F,d,n)=>{n.r(d),n.d(d,{DefaultErrorBoundaryFallback:()=>v});function l(r,t,o,e){if(o==="a"&&!e)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!e:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?e:o==="a"?e.call(r):e?e.value:t.get(r)}var u=n(934);const f="Looks like something went wrong when loading this page. Please try refreshing it.",h=r=>f;var c=n(9226);function C(r){var t;let o=h(c.ErrorCode.UNKNOWN),e=c.ErrorCode.UNKNOWN;return r instanceof u.b&&(e=(t=r.errorCode)!==null&&t!==void 0?t:e,o=h()),{message:o,errorCode:e}}var b=n(
|
|
1
|
+
"use strict";(globalThis.webpackChunk_icanbwell_composite=globalThis.webpackChunk_icanbwell_composite||[]).push([[279],{3279:(F,d,n)=>{n.r(d),n.d(d,{DefaultErrorBoundaryFallback:()=>v});function l(r,t,o,e){if(o==="a"&&!e)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!e:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?e:o==="a"?e.call(r):e?e.value:t.get(r)}var u=n(934);const f="Looks like something went wrong when loading this page. Please try refreshing it.",h=r=>f;var c=n(9226);function C(r){var t;let o=h(c.ErrorCode.UNKNOWN),e=c.ErrorCode.UNKNOWN;return r instanceof u.b&&(e=(t=r.errorCode)!==null&&t!==void 0?t:e,o=h()),{message:o,errorCode:e}}var b=n(750),a,i,g;const m="bwell-error-component";class w extends HTMLElement{static get observedAttributes(){return["message"]}constructor(){super(),a.add(this),this.attachShadow({mode:"open"})}connectedCallback(){var t,o;const{message:e}=C(),s=l(this,a,"m",g).call(this);this.shadowRoot.appendChild(s),l(this,a,"m",i).call(this,"message",this.getAttribute("message")||e),(o=(t=this.shadowRoot)===null||t===void 0?void 0:t.getElementById("refresh"))===null||o===void 0||o.addEventListener("click",()=>{this.resetError()})}attributeChangedCallback(t,o,e){l(this,a,"m",i).call(this,t,e)}resetError(){b.b.reloadView()}}a=new WeakSet,i=function(t,o){var e;const s=(e=this.shadowRoot)===null||e===void 0?void 0:e.getElementById(t);s&&(s.innerHTML=o)},g=function(){var t,o;let e=(o=(t=document.getElementById("bwell-custom-error-template"))===null||t===void 0?void 0:t.content)===null||o===void 0?void 0:o.cloneNode(!0);return e||(e=document.createElement("article"),e.innerHTML=`
|
|
2
2
|
<style>
|
|
3
3
|
:host {
|
|
4
4
|
--background: #FFFFFF;
|
package/279.index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://@icanbwell/composite/javascript/node_modules/@icanbwell/embeddable-core/node_modules/@icanbwell/ui-toolkit-v2/_virtual/_tslib.js","webpack://@icanbwell/composite/javascript/node_modules/@icanbwell/frontend-telemetry/lib/core/errors/get-error-messsage.js","webpack://@icanbwell/composite/javascript/node_modules/@icanbwell/frontend-telemetry/lib/core/errors/get-error-details.js","webpack://@icanbwell/composite/javascript/node_modules/@icanbwell/embeddable-core/node_modules/@icanbwell/ui-toolkit-v2/web-components/error-web-component.js","webpack://@icanbwell/composite/javascript/node_modules/@icanbwell/embeddable-core/node_modules/@icanbwell/ui-toolkit-v2/components/DefaultErrorBoundaryFallback.js"],"names":["__classPrivateFieldGet","receiver","state","kind","f","genericMesssage","getErrorMessage","errorCode","getErrorDetails","error","_a","message","_ErrorPageWebComponent_instances","_ErrorPageWebComponent_setValue","_ErrorPageWebComponent_template","ERROR_COMPONENT_TAG_NAME","ErrorPageWebComponent","_b","defaultMessage","template","name","_oldValue","newValue","value","el","DefaultErrorBoundaryFallback","errorDetails","resetError","ref","errorComponent"],"mappings":"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","file":"279.index.js","sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\n\nexport { __classPrivateFieldGet };\n","// TODO: Come up with a translation strategy. I18next?\nconst genericMesssage = 'Looks like something went wrong when loading this page. Please try refreshing it.';\nconst getErrorMessage = errorCode => {\n // Custom error messages here\n return genericMesssage;\n};\n\nexport { getErrorMessage };\n","import { BwellError } from './bwell-error.js';\nimport { getErrorMessage } from './get-error-messsage.js';\nimport { ErrorCode } from '@icanbwell/types';\n\nfunction getErrorDetails(error) {\n var _a;\n let message = getErrorMessage(ErrorCode.UNKNOWN);\n let errorCode = ErrorCode.UNKNOWN;\n if (error instanceof BwellError) {\n errorCode = (_a = error.errorCode) !== null && _a !== void 0 ? _a : errorCode;\n message = getErrorMessage();\n }\n return {\n message,\n errorCode\n };\n}\n\nexport { getErrorDetails };\n","import { __classPrivateFieldGet } from '../_virtual/_tslib.js';\nimport { getErrorDetails } from '@icanbwell/frontend-telemetry';\nimport { nativeBridge } from '@icanbwell/native-bridge';\n\nvar _ErrorPageWebComponent_instances, _ErrorPageWebComponent_setValue, _ErrorPageWebComponent_template;\nconst ERROR_COMPONENT_TAG_NAME = 'bwell-error-component';\nclass ErrorPageWebComponent extends HTMLElement {\n static get observedAttributes() {\n return ['message'];\n }\n constructor() {\n super();\n _ErrorPageWebComponent_instances.add(this);\n this.attachShadow({\n mode: 'open'\n });\n }\n connectedCallback() {\n var _a, _b;\n const {\n message: defaultMessage\n } = getErrorDetails();\n const template = __classPrivateFieldGet(this, _ErrorPageWebComponent_instances, \"m\", _ErrorPageWebComponent_template).call(this);\n this.shadowRoot.appendChild(template);\n __classPrivateFieldGet(this, _ErrorPageWebComponent_instances, \"m\", _ErrorPageWebComponent_setValue).call(this, 'message', this.getAttribute('message') || defaultMessage);\n (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('refresh')) === null || _b === void 0 ? void 0 : _b.addEventListener('click', () => {\n this.resetError();\n });\n }\n attributeChangedCallback(name, _oldValue, newValue) {\n __classPrivateFieldGet(this, _ErrorPageWebComponent_instances, \"m\", _ErrorPageWebComponent_setValue).call(this, name, newValue);\n }\n resetError() {\n // default behavior that can be overridden\n nativeBridge.reloadView();\n }\n}\n_ErrorPageWebComponent_instances = new WeakSet(), _ErrorPageWebComponent_setValue = function _ErrorPageWebComponent_setValue(name, value) {\n var _a;\n const el = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById(name);\n if (el) {\n el.innerHTML = value;\n }\n}, _ErrorPageWebComponent_template = function _ErrorPageWebComponent_template() {\n var _a, _b;\n let template = (_b = (_a = document.getElementById('bwell-custom-error-template')) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.cloneNode(true);\n if (!template) {\n template = document.createElement('article');\n // TODO: Do an accessibility review. Does body present any challenges?\n template.innerHTML = `\n <style>\n :host {\n --background: #FFFFFF;\n --messageTextColor: #6F6F6F;\n }\n article {\n background: var(--background);\n font-family: regular,sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n letter-spacing: 0px;\n line-height: 20px;\n margin: auto;\n max-width: 340px;\n text-align: center;\n }\n h3 {\n color: #2E3586;\n font-size: 28px;\n font-style: normal;\n font-weight: 400;\n line-height: 34px;\n }\n p {\n color: var(--messageTextColor);\n }\n button {\n background: #2E3586;\n border-radius: 5px;\n height: 55px;\n width: 200px;\n border: none;\n cursor: pointer;\n }\n button>span {\n color: #FFFFFF;\n font-size: 18px;\n font-style: normal;\n font-weight: 700;\n line-height: 22px;\n }\n </style>\n <header>\n <svg width=\"100\" height=\"100\" viewBox=\"0 0 100 100\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_645_19)\">\n <path d=\"M98.1598 74.7658L62.8319 11.0741C60.1952 6.38657 55.3902 3.51562 50 3.51562C44.6099 3.51562 39.8049 6.38657 37.1681 11.0741L1.84023 74.7658C-0.679762 79.3358 -0.621016 84.7855 2.07445 89.2967C4.71117 93.8087 9.45742 96.5042 14.6721 96.5042H85.3279C90.5426 96.5042 95.2889 93.8087 97.9256 89.2967C100.621 84.7855 100.68 79.3358 98.1598 74.7658Z\" fill=\"#FDBF00\"/>\n <path d=\"M97.9255 89.2967C95.2888 93.8087 90.5433 96.5042 85.3279 96.5042H50V3.51562C55.3902 3.51562 60.1952 6.38657 62.8319 11.0741L98.1598 74.7658C100.68 79.3358 100.621 84.7855 97.9255 89.2967Z\" fill=\"#FF9F00\"/>\n <path d=\"M41.2109 20.3325V64.2778H58.7891V20.3325H41.2109Z\" fill=\"#5A5A5A\"/>\n <path d=\"M50 70.137C45.1363 70.137 41.2109 74.0623 41.2109 78.926C41.2109 83.789 45.1363 87.7151 50 87.7151C54.8637 87.7151 58.7891 83.789 58.7891 78.926C58.7891 74.0623 54.8637 70.137 50 70.137Z\" fill=\"#5A5A5A\"/>\n <path d=\"M58.7891 78.926C58.7891 83.789 54.8637 87.7151 50 87.7151V70.137C54.8637 70.137 58.7891 74.0623 58.7891 78.926Z\" fill=\"#444444\"/>\n <path d=\"M50 20.3323H58.7891V64.2776H50V20.3323Z\" fill=\"#444444\"/>\n </g>\n <defs>\n <clipPath id=\"clip0_645_19\">\n <rect width=\"100\" height=\"100\" fill=\"white\"/>\n </clipPath>\n </defs>\n </svg>\n </header>\n <h3>Oops!</h3>\n <p id=\"message\">Looks like something went wrong when loading this page. Please try refreshing it.</p>\n <button id=\"refresh\">\n <span>Refresh</span>\n </button>\n `;\n }\n return template;\n};\nif (!customElements.get(ERROR_COMPONENT_TAG_NAME)) {\n customElements.define(ERROR_COMPONENT_TAG_NAME, ErrorPageWebComponent);\n}\n\nexport { ERROR_COMPONENT_TAG_NAME, ErrorPageWebComponent };\n","import { jsx } from 'react/jsx-runtime';\nimport { useRef, useEffect } from 'react';\n\nconst DefaultErrorBoundaryFallback = ({\n errorDetails,\n resetError\n}) => {\n const ref = useRef();\n useEffect(() => {\n const errorComponent = ref.current;\n if (errorComponent) {\n errorComponent.resetError = resetError;\n }\n }, []);\n return jsx(\"bwell-error-component\", {\n message: errorDetails.message,\n ref: ref\n });\n};\n\nexport { DefaultErrorBoundaryFallback };\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack://@icanbwell/composite/javascript/node_modules/@icanbwell/embeddable-core/node_modules/@icanbwell/ui-toolkit-v2/_virtual/_tslib.js","webpack://@icanbwell/composite/javascript/node_modules/@icanbwell/frontend-telemetry/lib/core/errors/get-error-messsage.js","webpack://@icanbwell/composite/javascript/node_modules/@icanbwell/frontend-telemetry/lib/core/errors/get-error-details.js","webpack://@icanbwell/composite/javascript/node_modules/@icanbwell/embeddable-core/node_modules/@icanbwell/ui-toolkit-v2/web-components/error-web-component.js","webpack://@icanbwell/composite/javascript/node_modules/@icanbwell/embeddable-core/node_modules/@icanbwell/ui-toolkit-v2/components/DefaultErrorBoundaryFallback.js"],"names":["__classPrivateFieldGet","receiver","state","kind","f","genericMesssage","getErrorMessage","errorCode","getErrorDetails","error","_a","message","_ErrorPageWebComponent_instances","_ErrorPageWebComponent_setValue","_ErrorPageWebComponent_template","ERROR_COMPONENT_TAG_NAME","ErrorPageWebComponent","_b","defaultMessage","template","name","_oldValue","newValue","value","el","DefaultErrorBoundaryFallback","errorDetails","resetError","ref","errorComponent"],"mappings":"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","file":"279.index.js","sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\n\nexport { __classPrivateFieldGet };\n","// TODO: Come up with a translation strategy. I18next?\nconst genericMesssage = 'Looks like something went wrong when loading this page. Please try refreshing it.';\nconst getErrorMessage = errorCode => {\n // Custom error messages here\n return genericMesssage;\n};\n\nexport { getErrorMessage };\n","import { BwellError } from './bwell-error.js';\nimport { getErrorMessage } from './get-error-messsage.js';\nimport { ErrorCode } from '@icanbwell/types';\n\nfunction getErrorDetails(error) {\n var _a;\n let message = getErrorMessage(ErrorCode.UNKNOWN);\n let errorCode = ErrorCode.UNKNOWN;\n if (error instanceof BwellError) {\n errorCode = (_a = error.errorCode) !== null && _a !== void 0 ? _a : errorCode;\n message = getErrorMessage();\n }\n return {\n message,\n errorCode\n };\n}\n\nexport { getErrorDetails };\n","import { __classPrivateFieldGet } from '../_virtual/_tslib.js';\nimport { getErrorDetails } from '@icanbwell/frontend-telemetry';\nimport { nativeBridge } from '@icanbwell/native-bridge';\n\nvar _ErrorPageWebComponent_instances, _ErrorPageWebComponent_setValue, _ErrorPageWebComponent_template;\nconst ERROR_COMPONENT_TAG_NAME = 'bwell-error-component';\nclass ErrorPageWebComponent extends HTMLElement {\n static get observedAttributes() {\n return ['message'];\n }\n constructor() {\n super();\n _ErrorPageWebComponent_instances.add(this);\n this.attachShadow({\n mode: 'open'\n });\n }\n connectedCallback() {\n var _a, _b;\n const {\n message: defaultMessage\n } = getErrorDetails();\n const template = __classPrivateFieldGet(this, _ErrorPageWebComponent_instances, \"m\", _ErrorPageWebComponent_template).call(this);\n this.shadowRoot.appendChild(template);\n __classPrivateFieldGet(this, _ErrorPageWebComponent_instances, \"m\", _ErrorPageWebComponent_setValue).call(this, 'message', this.getAttribute('message') || defaultMessage);\n (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('refresh')) === null || _b === void 0 ? void 0 : _b.addEventListener('click', () => {\n this.resetError();\n });\n }\n attributeChangedCallback(name, _oldValue, newValue) {\n __classPrivateFieldGet(this, _ErrorPageWebComponent_instances, \"m\", _ErrorPageWebComponent_setValue).call(this, name, newValue);\n }\n resetError() {\n // default behavior that can be overridden\n nativeBridge.reloadView();\n }\n}\n_ErrorPageWebComponent_instances = new WeakSet(), _ErrorPageWebComponent_setValue = function _ErrorPageWebComponent_setValue(name, value) {\n var _a;\n const el = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById(name);\n if (el) {\n el.innerHTML = value;\n }\n}, _ErrorPageWebComponent_template = function _ErrorPageWebComponent_template() {\n var _a, _b;\n let template = (_b = (_a = document.getElementById('bwell-custom-error-template')) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.cloneNode(true);\n if (!template) {\n template = document.createElement('article');\n // TODO: Do an accessibility review. Does body present any challenges?\n template.innerHTML = `\n <style>\n :host {\n --background: #FFFFFF;\n --messageTextColor: #6F6F6F;\n }\n article {\n background: var(--background);\n font-family: regular,sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n letter-spacing: 0px;\n line-height: 20px;\n margin: auto;\n max-width: 340px;\n text-align: center;\n }\n h3 {\n color: #2E3586;\n font-size: 28px;\n font-style: normal;\n font-weight: 400;\n line-height: 34px;\n }\n p {\n color: var(--messageTextColor);\n }\n button {\n background: #2E3586;\n border-radius: 5px;\n height: 55px;\n width: 200px;\n border: none;\n cursor: pointer;\n }\n button>span {\n color: #FFFFFF;\n font-size: 18px;\n font-style: normal;\n font-weight: 700;\n line-height: 22px;\n }\n </style>\n <header>\n <svg width=\"100\" height=\"100\" viewBox=\"0 0 100 100\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_645_19)\">\n <path d=\"M98.1598 74.7658L62.8319 11.0741C60.1952 6.38657 55.3902 3.51562 50 3.51562C44.6099 3.51562 39.8049 6.38657 37.1681 11.0741L1.84023 74.7658C-0.679762 79.3358 -0.621016 84.7855 2.07445 89.2967C4.71117 93.8087 9.45742 96.5042 14.6721 96.5042H85.3279C90.5426 96.5042 95.2889 93.8087 97.9256 89.2967C100.621 84.7855 100.68 79.3358 98.1598 74.7658Z\" fill=\"#FDBF00\"/>\n <path d=\"M97.9255 89.2967C95.2888 93.8087 90.5433 96.5042 85.3279 96.5042H50V3.51562C55.3902 3.51562 60.1952 6.38657 62.8319 11.0741L98.1598 74.7658C100.68 79.3358 100.621 84.7855 97.9255 89.2967Z\" fill=\"#FF9F00\"/>\n <path d=\"M41.2109 20.3325V64.2778H58.7891V20.3325H41.2109Z\" fill=\"#5A5A5A\"/>\n <path d=\"M50 70.137C45.1363 70.137 41.2109 74.0623 41.2109 78.926C41.2109 83.789 45.1363 87.7151 50 87.7151C54.8637 87.7151 58.7891 83.789 58.7891 78.926C58.7891 74.0623 54.8637 70.137 50 70.137Z\" fill=\"#5A5A5A\"/>\n <path d=\"M58.7891 78.926C58.7891 83.789 54.8637 87.7151 50 87.7151V70.137C54.8637 70.137 58.7891 74.0623 58.7891 78.926Z\" fill=\"#444444\"/>\n <path d=\"M50 20.3323H58.7891V64.2776H50V20.3323Z\" fill=\"#444444\"/>\n </g>\n <defs>\n <clipPath id=\"clip0_645_19\">\n <rect width=\"100\" height=\"100\" fill=\"white\"/>\n </clipPath>\n </defs>\n </svg>\n </header>\n <h3>Oops!</h3>\n <p id=\"message\">Looks like something went wrong when loading this page. Please try refreshing it.</p>\n <button id=\"refresh\">\n <span>Refresh</span>\n </button>\n `;\n }\n return template;\n};\nif (!customElements.get(ERROR_COMPONENT_TAG_NAME)) {\n customElements.define(ERROR_COMPONENT_TAG_NAME, ErrorPageWebComponent);\n}\n\nexport { ERROR_COMPONENT_TAG_NAME, ErrorPageWebComponent };\n","import { jsx } from 'react/jsx-runtime';\nimport { useRef, useEffect } from 'react';\n\nconst DefaultErrorBoundaryFallback = ({\n errorDetails,\n resetError\n}) => {\n const ref = useRef();\n useEffect(() => {\n const errorComponent = ref.current;\n if (errorComponent) {\n errorComponent.resetError = resetError;\n }\n }, []);\n return jsx(\"bwell-error-component\", {\n message: errorDetails.message,\n ref: ref\n });\n};\n\nexport { DefaultErrorBoundaryFallback };\n"],"sourceRoot":""}
|
package/565.index.js
CHANGED
|
@@ -12010,7 +12010,7 @@ Take a look at the reducer(s) handling this action type: `+Ke.type+`.
|
|
|
12010
12010
|
}
|
|
12011
12011
|
}
|
|
12012
12012
|
}
|
|
12013
|
-
`));function fFe(e){const t=Object.assign(Object.assign({},Yu),e);return Apollo.useMutation(Pee,t)}const C1={value:{system:"http://hl7.org/fhir/uv/smart-health-cards-and-links/StructureDefinition/ShlPayload",code:"smart-health-link"}};function _Fe(e={}){return useDocumentReferencesQuery(Object.assign(Object.assign({},e),{variables:Object.assign(Object.assign({},e.variables),{category:C1})}))}function pFe(e={}){return useDocumentReferencesLazyQuery(Object.assign(Object.assign({},e),{variables:Object.assign(Object.assign({},e.variables),{category:C1})}))}const b1={value:{system:"https://www.icanbwell.com/fhir/CodeSystem/shl-event-type",code:"access"}};function hFe(e={}){return useCommunicationRequestsQuery(Object.assign(Object.assign({},e),{variables:Object.assign(Object.assign({},e.variables),{category:b1})}))}function SFe(e={}){return useCommunicationRequestsLazyQuery(Object.assign(Object.assign({},e),{variables:Object.assign(Object.assign({},e.variables),{category:b1})}))}const O1={value:{system:"https://www.icanbwell.com/consent-category",code:"smartHealthLink"}};function gFe(e={}){return useConsentsForHealthLinksQuery(Object.assign(Object.assign({},e),{variables:Object.assign(Object.assign({},e.variables),{category:O1})}))}function mFe(e={}){return useConsentsForHealthLinksLazyQuery(Object.assign(Object.assign({},e),{variables:Object.assign(Object.assign({},e.variables),{category:O1})}))}const vFe=e=>useMutation(SendChatCompletionMutation,e);var R1=_(46),ch,Vv;class P1{constructor(){this.type="backend",ch.set(this,void 0),Vv.set(this,void 0)}init(t,{clientSlug:r,apiClient:n}){if(!n)throw t.logger.error('"apiClient" not supplied to "QueryBackend".'),new Error('"apiClient" required for "QueryBackend".');qu(this,ch,r,"f"),qu(this,Vv,y$(n),"f")}read(t,r,n){return Iv(this,void 0,void 0,function*(){try{const{translation:i}=yield Sn(this,Vv,"f").getClientTranslations({name:Sn(this,ch,"f"),key:r,lang:t});n(null,i?.json||{})}catch{const a=`Error fetching translation with key "${r}" and client "${Sn(this,ch,"f")||"N/A"}".`;n(a,null)}})}}ch=new WeakMap,Vv=new WeakMap,P1.type="backend";var _f;class M1{constructor(t){this.type="logger",_f.set(this,void 0),qu(this,_f,t,"f")}log([t,r,...n]){Sn(this,_f,"f").info({meta:r},t,...n)}warn([t,r,...n]){Sn(this,_f,"f").error({meta:r},t,...n)}error([t,r,...n]){Sn(this,_f,"f").error({meta:r},t,...n)}}_f=new WeakMap,M1.type="logger";var Bv,kv,hl,lh,Yi,Sl;const I1="appLanguage";class ka{constructor({keys:t,nativeBridge:r,fallbackKeys:n=[],defaultLanguage:i="en",logger:a,parent:c,debug:f=!1,remoteConfig:y={}}){hl.set(this,void 0),lh.set(this,void 0),Yi.set(this,void 0),Sl.set(this,void 0),qu(this,hl,t,"f"),qu(this,lh,n,"f"),qu(this,Sl,r,"f");const h={lng:i,fallbackNS:Sn(this,lh,"f"),debug:f,defaultNS:t,returnNull:!1};c?qu(this,Yi,c.cloneInstance(h),"f"):(qu(this,Yi,_a.createInstance(),"f"),a&&Sn(this,Yi,"f").use(new M1(a.child({library:"@icanbwell/i18n"}))),y.apiClient&&Sn(this,Yi,"f").use(P1),Sn(this,Yi,"f").init(Object.assign(Object.assign({},h),{fallbackLng:!1,partialBundledLanguages:!0,ns:[],resources:{},backend:y,saveMissing:!0,missingKeyHandler:(v,G,W)=>Sn(this,Yi,"f").services.logger.error(`missing key: ${W}; language: ${v}; key: ${G}`)}))),this.t=Sn(this,Yi,"f").t,ka.resolvedLanguage=Sn(this,Yi,"f").resolvedLanguage||i}load(){var t;return Iv(this,void 0,void 0,function*(){const r=(yield(t=Sn(this,Sl,"f"))===null||t===void 0?void 0:t.storage.getItem(I1))||ka.resolvedLanguage;r!==ka.resolvedLanguage&&(yield Sn(this,Yi,"f").changeLanguage(r),ka.resolvedLanguage=r),yield Sn(this,Yi,"f").loadNamespaces(Sn(this,hl,"f"));const n=Sn(this,hl,"f").filter(i=>!Sn(this,Yi,"f").hasResourceBundle(r,i));if(n.length)throw new Error(`Error loading translations for key(s): ${n.join(", ")}`);return Sn(ka,Bv,"f",kv).emit("changeLanguage",r),this})}child(t){return new ka(Object.assign(Object.assign({},t),{nativeBridge:Sn(this,Sl,"f"),fallbackKeys:[...Sn(this,lh,"f"),...Sn(this,hl,"f")],parent:Sn(this,Yi,"f"),defaultLanguage:Sn(this,Yi,"f").language}))}get isLoaded(){return Sn(this,hl,"f").every(t=>Sn(this,Yi,"f").hasResourceBundle(Sn(this,Yi,"f").language,t))}changeLanguage(t){var r;return Iv(this,void 0,void 0,function*(){ka.resolvedLanguage=t,yield Sn(this,Yi,"f").changeLanguage(t),Sn(ka,Bv,"f",kv).emit("changeLanguage",t),yield(r=Sn(this,Sl,"f"))===null||r===void 0?void 0:r.storage.setItem(I1,t),Sn(this,Sl,"f").reloadView()})}get resolvedLanguage(){return ka.resolvedLanguage}onChangeLanguage(t){Sn(ka,Bv,"f",kv).on("changeLanguage",t)}}Bv=ka,hl=new WeakMap,lh=new WeakMap,Yi=new WeakMap,Sl=new WeakMap,kv={value:new R1},ka.resolvedLanguage="en";var hP=_(1827),dh;(function(e){e.one="1.0.0"})(dh||(dh={}));const jv="orchestrator:native-bridge",Mee={id:jv,dependencies:{featureServices:{}},create:()=>({[dh.one]:()=>({featureService:hP.b})})};var fh;(function(e){e.one="1.0.0"})(fh||(fh={}));const Qv="orchestrator:translation-service",Iee={id:Qv,dependencies:{featureServices:{[vo]:Hr.one,[eu]:Vu.one,[ci]:Gi.one,[Yp]:nf.one,[jv]:dh.one}},create:({featureServices:e})=>{const t=e[vo],r=e[eu],n=e[Yp],{slug:i}=e[ci].getClientContext(),a=e[jv],c=new ka({keys:[],nativeBridge:a,defaultLanguage:"en",logger:r,remoteConfig:{clientSlug:i,apiClient:t}});return n.setProfileProperties({language:c.resolvedLanguage}),c.onChangeLanguage(f=>n.setProfileProperties({language:f})),{[fh.one]:()=>({featureService:c})}}};var pf,hf,qv,gl;const Hv="tokens";class Nee{constructor({apiClient:t,stateService:r,identityGatewaySdk:n,storage:i}){pf.set(this,void 0),hf.set(this,void 0),qv.set(this,void 0),gl.set(this,void 0),(0,R.GG)(this,pf,t,"f"),(0,R.GG)(this,hf,r,"f"),(0,R.GG)(this,qv,n,"f"),(0,R.GG)(this,gl,i,"f")}getStoredTokens(){const t=(0,R.gn)(this,gl,"f").getItem(Hv);return t?JSON.parse(t):void 0}removeStoredTokens(){(0,R.gn)(this,gl,"f").removeItem(Hv)}storeTokens(t){(0,R.gn)(this,gl,"f").setItem(Hv,JSON.stringify(t))}logout(){return(0,R.sH)(this,void 0,void 0,function*(){const t=(0,R.gn)(this,hf,"f").getUserTokenData().accessToken.jwtToken,{key:r,variant:n}=(0,R.gn)(this,hf,"f").getClientContext();n!==z.GUEST&&(yield(0,R.gn)(this,qv,"f").logout({accessToken:t},{context:{headers:{clientKey:r}}})),(0,R.gn)(this,pf,"f").stop(),(0,R.gn)(this,pf,"f").clearAuth(),yield(0,R.gn)(this,pf,"f").clearStore(),(0,R.gn)(this,hf,"f").logoutUser(),(0,R.gn)(this,gl,"f").removeItem(Hv)})}}pf=new WeakMap,hf=new WeakMap,qv=new WeakMap,gl=new WeakMap;var Yv;(function(e){e.one="1.0.0"})(Yv||(Yv={}));const N1="orchestrator:identity-utils",Lee={id:N1,dependencies:{featureServices:{[vo]:Hr.one,[eu]:Vu.one,[ci]:Gi.one,[Yp]:nf.one}},create:({featureServices:e})=>{const t=e[vo];return{[Yv.one]:()=>({featureService:new Nee({apiClient:t,stateService:e[ci],identityGatewaySdk:DG(t),storage:window.sessionStorage})})}}};var zv;(function(e){e.one="1.0.0"})(zv||(zv={}));const L1="orchestrator:globaleventemitter-service",Dee=e=>({id:L1,create:()=>({[zv.one]:()=>({featureService:e})})});var Wv;(function(e){e.one="1.0.0"})(Wv||(Wv={}));const D1="orchestrator:reboot-controller",wee=e=>({id:D1,create:()=>({[Wv.one]:()=>({featureService:e})})}),w1="orchestrator:bwell-sdk";var Kv;(function(e){e.one="1.0.0"})(Kv||(Kv={}));const Uee=e=>({id:w1,dependencies:{featureServices:{[ci]:Gi.one,[Qv]:fh.one,[eu]:Vu.one}},create:({featureServices:t})=>{const r=t[ci],n=t[Qv],i=t[eu],a=e;return r.getStore().subscribe(()=>{var c;if((c=r.getUser().tokenData)===null||c===void 0?void 0:c.idToken)try{a.language.setLanguage(n.resolvedLanguage),n.onChangeLanguage(h=>{const v=a.language.getLanguage();h!==v&&a.language.setLanguage(h)})}catch(h){i.error(h,"embeddable-core: Error occurred when switching language in SDK")}}),{[Kv.one]:()=>({featureService:a})}}}),SP={apiClient:l,theme:b,analytics:P,auth:T,logging:O,state:d,navigation:A,featureFlags:g,translation:N,identityUtils:C,nativeBridge:D,globalEventEmitter:L,rebootController:w,bwellSdk:B},EFe=Object.keys(SP).reduce((e,t)=>{const{id:r,version:n}=SP[t];return Object.assign(Object.assign({},e),{[t]:{id:r,version:n}})},{});var hr=SP,$ee=_(8561),Gee=_(295),U1=_.n(Gee),Fee=_(2424),$1=_.n(Fee);class xee{constructor(t){this.providedExternals=t;for(const[r,n]of Object.entries(t))if(!$1()(n))throw new Error(`The provided version ${JSON.stringify(n)} for the external ${JSON.stringify(r)} is invalid.`)}validate(t){for(const[r,n]of Object.entries(t)){const i=this.providedExternals[r];if(!i)throw new Error(`The external dependency ${JSON.stringify(r)} is not provided.`);if(!U1()(i,n))throw new Error(`The external dependency ${JSON.stringify(r)} in the required version range ${JSON.stringify(n)} is not satisfied. The provided version is ${JSON.stringify(i)}.`)}}}class Vee{constructor(t,r,n){this.promise=t,this.value=r,this.error=n,t.then(i=>this.value=i).catch(i=>this.error=i)}}function Bee(e,t,r){let n=`The Feature App module at the url ${JSON.stringify(e)} ${t?`with the module type ${JSON.stringify(t)}`:"with no specific module type"} is invalid. A Feature App module must have a Feature App definition as default export. A Feature App definition is an object with at least a \`create\` method.`;return r&&r.length>1&&!t&&(n+=" Hint: The provided module loader expects an optional second parameter `moduleType`. It might need to be provided for this Feature App."),n}function kee(e){return typeof e!="object"||!e?!1:typeof e.create=="function"}function jee(e){return typeof e!="object"||!e?!1:kee(e.default)}class Qee{constructor(t,r={}){this.featureServiceRegistry=t,this.options=r,this.asyncFeatureAppDefinitions=new Map,this.featureAppDefinitionsWithRegisteredOwnFeatureServices=new WeakSet,this.featureAppRetainers=new Map,this.logger=r.logger||console}getAsyncFeatureAppDefinition(t,r){const n=`${t}${r}`;let i=this.asyncFeatureAppDefinitions.get(n);return i||(i=this.createAsyncFeatureAppDefinition(t,r),this.asyncFeatureAppDefinitions.set(n,i)),i}createFeatureAppScope(t,r,n={}){const i=this.getFeatureAppRetainer(t,r,n);let a=!1;return{featureApp:i.featureApp,release:()=>{a?this.logger.warn(`The Feature App with the ID ${JSON.stringify(t)} has already been released for this scope.`):(a=!0,i.release())}}}async preloadFeatureApp(t,r){await this.getAsyncFeatureAppDefinition(t,r).promise}createAsyncFeatureAppDefinition(t,r){const{moduleLoader:n}=this.options;if(!n)throw new Error("No module loader provided.");return new Vee(n(t,r).then(i=>{if(!jee(i))throw new Error(Bee(t,r,this.options.moduleLoader));return this.logger.info(`The Feature App module at the url ${JSON.stringify(t)} has been successfully loaded.`),i.default}))}registerOwnFeatureServices(t,r){this.featureAppDefinitionsWithRegisteredOwnFeatureServices.has(r)||(r.ownFeatureServiceDefinitions&&this.featureServiceRegistry.registerFeatureServices(r.ownFeatureServiceDefinitions,t),this.featureAppDefinitionsWithRegisteredOwnFeatureServices.add(r))}getFeatureAppRetainer(t,r,n){let i=this.featureAppRetainers.get(t);return i?i.retain():(this.registerOwnFeatureServices(t,r),i=this.createFeatureAppRetainer(r,t,n)),i}createFeatureAppRetainer(t,r,n){var i,a;this.validateExternals(t);const{featureAppName:c,baseUrl:f,beforeCreate:y,config:h,done:v}=n,G=this.featureServiceRegistry.bindFeatureServices(t,r,c);try{(a=(i=this.options).onBind)===null||a===void 0||a.call(i,{featureAppDefinition:t,featureAppId:r,featureAppName:c})}catch(ye){this.logger.error("Failed to execute onBind callback.",ye)}const W={baseUrl:f,config:h,featureAppId:r,featureAppName:c,featureServices:G.featureServices,done:v};try{y?.(W);const ye=t.create(W);this.logger.info(`The Feature App with the ID ${JSON.stringify(r)} has been successfully created.`);let Te=1;const Re={featureApp:ye,retain:()=>{Te+=1},release:()=>{Te-=1,Te===0&&(this.featureAppRetainers.delete(r),G.unbind())}};return this.featureAppRetainers.set(r,Re),Re}catch(ye){throw G.unbind(),ye}}validateExternals(t){const{externalsValidator:r}=this.options;if(!r)return;const{dependencies:n}=t;n&&n.externals&&r.validate(n.externals)}}var qee=_(5725),Hee=_.n(qee);function Yee(e,t,r,n,i){return`The ${e?"optional":"required"} Feature Service ${JSON.stringify(t)} in the unsupported version range ${JSON.stringify(n)} could not be bound to consumer ${JSON.stringify(r)}. The supported versions are ${JSON.stringify(i)}.`}function zee(e,t,r){return`The Feature Service ${JSON.stringify(e)} could not be registered by registrant ${JSON.stringify(t)} because it defines the invalid version ${JSON.stringify(r)}.`}function Wee(e,t,r){return`The ${e?"optional":"required"} Feature Service ${JSON.stringify(t)} in an invalid version could not be bound to consumer ${JSON.stringify(r)}.`}function Kee(e,t,r){return`The ${e?"optional":"required"} Feature Service ${JSON.stringify(t)} is not registered and therefore could not be bound to consumer ${JSON.stringify(r)}.`}function Xee(e,t){return`The Feature Service ${JSON.stringify(e)} could not be registered by registrant ${JSON.stringify(t)} because it returned undefined.`}function Jee(e,t){return`The Feature Service ${JSON.stringify(e)} has been successfully registered by registrant ${JSON.stringify(t)}.`}function Zee(e,t){return`The already registered Feature Service ${JSON.stringify(e)} could not be re-registered by registrant ${JSON.stringify(t)}.`}function ete(e,t){return`The required Feature Service ${JSON.stringify(e)} has been successfully bound to consumer ${JSON.stringify(t)}.`}function tte(e){return`All required Feature Services are already bound to consumer ${JSON.stringify(e)}.`}function rte(e,t){return`The required Feature Service ${JSON.stringify(e)} could not be unbound from consumer ${JSON.stringify(t)}.`}function nte(e,t){return`The required Feature Service ${JSON.stringify(e)} has been successfully unbound from consumer ${JSON.stringify(t)}.`}function ite(e){return`All required Feature Services are already unbound from consumer ${JSON.stringify(e)}.`}var ate=_(2702),ote=_.n(ate);function ste(e){return t=>[e,t]}function ute(e,t){return Object.keys(t).map(ste(e))}function cte(e){return Array.from(e.keys()).reduce((t,r)=>{const n=e.get(r);if(!n)return t;const i=ute(r,n);return[...t,...i]},[])}function lte(e){const t=Array.from(e.keys()),r=cte(e),n=ote()(r);return n.push(...t.filter(i=>e.has(i)&&n.indexOf(i)===-1)),n.reverse()}function G1({dependencies:e,optionalDependencies:t}){return Object.assign(Object.assign({},e&&e.featureServices),t&&t.featureServices)}function dte(e){const t=new Map;for(const r of e)t.set(r.id,G1(r));return t}function fte({optionalDependencies:e},t){return Boolean(e&&e.featureServices&&e.featureServices.hasOwnProperty(t))}function _te(e){const t=new Map;for(const r of e)t.set(r.id,r);return t}class pte{constructor(t={}){this.options=t,this.sharedFeatureServices=new Map,this.consumerIds=new Set,this.logger=t.logger||console}registerFeatureServices(t,r){const n=_te(t),i=dte(t);for(const a of lte(i))this.registerFeatureService(n,a,r)}bindFeatureServices(t,r,n){if(this.consumerIds.has(r))throw new Error(tte(r));const i=new Map,a=Object.create(null),c=G1(t);for(const h of Object.keys(c)){const v=fte(t,h),G=c[h],W=this.bindFeatureService(h,r,n,G,{optional:v});!W||(this.logger.info(ete(h,r)),i.set(h,W),a[h]=W.featureService)}this.consumerIds.add(r);let f=!1;return{featureServices:a,unbind:()=>{if(f)throw new Error(ite(r));f=!0,this.consumerIds.delete(r);for(const[h,v]of i.entries())try{v.unbind&&v.unbind(),this.logger.info(nte(h,r))}catch(G){this.logger.error(rte(h,r),G)}}}}registerFeatureService(t,r,n){const i=t.get(r);if(!i)return;if(this.sharedFeatureServices.has(r)){this.logger.warn(Zee(r,n));return}this.validateExternals(i);const{featureServices:a}=this.bindFeatureServices(i,r),c=i.create({featureServices:a});c?(this.validateFeatureServiceVersions(c,r,n),this.sharedFeatureServices.set(r,c),this.logger.info(Jee(r,n))):this.logger.info(Xee(r,n))}bindFeatureService(t,r,n,i,{optional:a}){const c=i&&Hee()(i);if(!c){const W=Wee(a,t,r);if(a){this.logger.info(W);return}throw new Error(W)}const f=`^${c.version}`,y=this.sharedFeatureServices.get(t);if(!y){const W=Kee(a,t,r);if(a){this.logger.info(W);return}throw new Error(W)}const h=Object.keys(y),v=h.find(W=>U1()(W,f)),G=v?y[v]:void 0;if(!G){const W=Yee(a,t,r,f,h);if(a){this.logger.info(W);return}throw new Error(W)}return G(r,n)}validateExternals(t){const{externalsValidator:r}=this.options;if(!r)return;const{dependencies:n}=t;n&&n.externals&&r.validate(n.externals)}validateFeatureServiceVersions(t,r,n){for(const i of Object.keys(t))if(!$1()(i))throw new Error(zee(r,n,i))}}function F1(e,t={}){const{featureServiceDefinitions:r,featureServiceDependencies:n,providedExternals:i,moduleLoader:a,logger:c,onBind:f}=t;let y;i&&(y=new xee(i));const h=new pte({externalsValidator:y,logger:c}),v={dependencies:{featureServices:n}};r&&h.registerFeatureServices(r,e);const G=new Qee(h,{externalsValidator:y,moduleLoader:a,logger:c,onBind:f}),{featureServices:W}=h.bindFeatureServices(v,e);return{featureAppManager:G,featureServiceRegistry:h,featureServices:W}}/**
|
|
12013
|
+
`));function fFe(e){const t=Object.assign(Object.assign({},Yu),e);return Apollo.useMutation(Pee,t)}const C1={value:{system:"http://hl7.org/fhir/uv/smart-health-cards-and-links/StructureDefinition/ShlPayload",code:"smart-health-link"}};function _Fe(e={}){return useDocumentReferencesQuery(Object.assign(Object.assign({},e),{variables:Object.assign(Object.assign({},e.variables),{category:C1})}))}function pFe(e={}){return useDocumentReferencesLazyQuery(Object.assign(Object.assign({},e),{variables:Object.assign(Object.assign({},e.variables),{category:C1})}))}const b1={value:{system:"https://www.icanbwell.com/fhir/CodeSystem/shl-event-type",code:"access"}};function hFe(e={}){return useCommunicationRequestsQuery(Object.assign(Object.assign({},e),{variables:Object.assign(Object.assign({},e.variables),{category:b1})}))}function SFe(e={}){return useCommunicationRequestsLazyQuery(Object.assign(Object.assign({},e),{variables:Object.assign(Object.assign({},e.variables),{category:b1})}))}const O1={value:{system:"https://www.icanbwell.com/consent-category",code:"smartHealthLink"}};function gFe(e={}){return useConsentsForHealthLinksQuery(Object.assign(Object.assign({},e),{variables:Object.assign(Object.assign({},e.variables),{category:O1})}))}function mFe(e={}){return useConsentsForHealthLinksLazyQuery(Object.assign(Object.assign({},e),{variables:Object.assign(Object.assign({},e.variables),{category:O1})}))}const vFe=e=>useMutation(SendChatCompletionMutation,e);var R1=_(46),ch,Vv;class P1{constructor(){this.type="backend",ch.set(this,void 0),Vv.set(this,void 0)}init(t,{clientSlug:r,apiClient:n}){if(!n)throw t.logger.error('"apiClient" not supplied to "QueryBackend".'),new Error('"apiClient" required for "QueryBackend".');qu(this,ch,r,"f"),qu(this,Vv,y$(n),"f")}read(t,r,n){return Iv(this,void 0,void 0,function*(){try{const{translation:i}=yield Sn(this,Vv,"f").getClientTranslations({name:Sn(this,ch,"f"),key:r,lang:t});n(null,i?.json||{})}catch{const a=`Error fetching translation with key "${r}" and client "${Sn(this,ch,"f")||"N/A"}".`;n(a,null)}})}}ch=new WeakMap,Vv=new WeakMap,P1.type="backend";var _f;class M1{constructor(t){this.type="logger",_f.set(this,void 0),qu(this,_f,t,"f")}log([t,r,...n]){Sn(this,_f,"f").info({meta:r},t,...n)}warn([t,r,...n]){Sn(this,_f,"f").error({meta:r},t,...n)}error([t,r,...n]){Sn(this,_f,"f").error({meta:r},t,...n)}}_f=new WeakMap,M1.type="logger";var Bv,kv,hl,lh,Yi,Sl;const I1="appLanguage";class ka{constructor({keys:t,nativeBridge:r,fallbackKeys:n=[],defaultLanguage:i="en",logger:a,parent:c,debug:f=!1,remoteConfig:y={}}){hl.set(this,void 0),lh.set(this,void 0),Yi.set(this,void 0),Sl.set(this,void 0),qu(this,hl,t,"f"),qu(this,lh,n,"f"),qu(this,Sl,r,"f");const h={lng:i,fallbackNS:Sn(this,lh,"f"),debug:f,defaultNS:t,returnNull:!1};c?qu(this,Yi,c.cloneInstance(h),"f"):(qu(this,Yi,_a.createInstance(),"f"),a&&Sn(this,Yi,"f").use(new M1(a.child({library:"@icanbwell/i18n"}))),y.apiClient&&Sn(this,Yi,"f").use(P1),Sn(this,Yi,"f").init(Object.assign(Object.assign({},h),{fallbackLng:!1,partialBundledLanguages:!0,ns:[],resources:{},backend:y,saveMissing:!0,missingKeyHandler:(v,G,W)=>Sn(this,Yi,"f").services.logger.error(`missing key: ${W}; language: ${v}; key: ${G}`)}))),this.t=Sn(this,Yi,"f").t,ka.resolvedLanguage=Sn(this,Yi,"f").resolvedLanguage||i}load(){var t;return Iv(this,void 0,void 0,function*(){const r=(yield(t=Sn(this,Sl,"f"))===null||t===void 0?void 0:t.storage.getItem(I1))||ka.resolvedLanguage;r!==ka.resolvedLanguage&&(yield Sn(this,Yi,"f").changeLanguage(r),ka.resolvedLanguage=r),yield Sn(this,Yi,"f").loadNamespaces(Sn(this,hl,"f"));const n=Sn(this,hl,"f").filter(i=>!Sn(this,Yi,"f").hasResourceBundle(r,i));if(n.length)throw new Error(`Error loading translations for key(s): ${n.join(", ")}`);return Sn(ka,Bv,"f",kv).emit("changeLanguage",r),this})}child(t){return new ka(Object.assign(Object.assign({},t),{nativeBridge:Sn(this,Sl,"f"),fallbackKeys:[...Sn(this,lh,"f"),...Sn(this,hl,"f")],parent:Sn(this,Yi,"f"),defaultLanguage:Sn(this,Yi,"f").language}))}get isLoaded(){return Sn(this,hl,"f").every(t=>Sn(this,Yi,"f").hasResourceBundle(Sn(this,Yi,"f").language,t))}changeLanguage(t){var r;return Iv(this,void 0,void 0,function*(){ka.resolvedLanguage=t,yield Sn(this,Yi,"f").changeLanguage(t),Sn(ka,Bv,"f",kv).emit("changeLanguage",t),yield(r=Sn(this,Sl,"f"))===null||r===void 0?void 0:r.storage.setItem(I1,t),Sn(this,Sl,"f").reloadView()})}get resolvedLanguage(){return ka.resolvedLanguage}onChangeLanguage(t){Sn(ka,Bv,"f",kv).on("changeLanguage",t)}}Bv=ka,hl=new WeakMap,lh=new WeakMap,Yi=new WeakMap,Sl=new WeakMap,kv={value:new R1},ka.resolvedLanguage="en";var hP=_(750),dh;(function(e){e.one="1.0.0"})(dh||(dh={}));const jv="orchestrator:native-bridge",Mee={id:jv,dependencies:{featureServices:{}},create:()=>({[dh.one]:()=>({featureService:hP.b})})};var fh;(function(e){e.one="1.0.0"})(fh||(fh={}));const Qv="orchestrator:translation-service",Iee={id:Qv,dependencies:{featureServices:{[vo]:Hr.one,[eu]:Vu.one,[ci]:Gi.one,[Yp]:nf.one,[jv]:dh.one}},create:({featureServices:e})=>{const t=e[vo],r=e[eu],n=e[Yp],{slug:i}=e[ci].getClientContext(),a=e[jv],c=new ka({keys:[],nativeBridge:a,defaultLanguage:"en",logger:r,remoteConfig:{clientSlug:i,apiClient:t}});return n.setProfileProperties({language:c.resolvedLanguage}),c.onChangeLanguage(f=>n.setProfileProperties({language:f})),{[fh.one]:()=>({featureService:c})}}};var pf,hf,qv,gl;const Hv="tokens";class Nee{constructor({apiClient:t,stateService:r,identityGatewaySdk:n,storage:i}){pf.set(this,void 0),hf.set(this,void 0),qv.set(this,void 0),gl.set(this,void 0),(0,R.GG)(this,pf,t,"f"),(0,R.GG)(this,hf,r,"f"),(0,R.GG)(this,qv,n,"f"),(0,R.GG)(this,gl,i,"f")}getStoredTokens(){const t=(0,R.gn)(this,gl,"f").getItem(Hv);return t?JSON.parse(t):void 0}removeStoredTokens(){(0,R.gn)(this,gl,"f").removeItem(Hv)}storeTokens(t){(0,R.gn)(this,gl,"f").setItem(Hv,JSON.stringify(t))}logout(){return(0,R.sH)(this,void 0,void 0,function*(){const t=(0,R.gn)(this,hf,"f").getUserTokenData().accessToken.jwtToken,{key:r,variant:n}=(0,R.gn)(this,hf,"f").getClientContext();n!==z.GUEST&&(yield(0,R.gn)(this,qv,"f").logout({accessToken:t},{context:{headers:{clientKey:r}}})),(0,R.gn)(this,pf,"f").stop(),(0,R.gn)(this,pf,"f").clearAuth(),yield(0,R.gn)(this,pf,"f").clearStore(),(0,R.gn)(this,hf,"f").logoutUser(),(0,R.gn)(this,gl,"f").removeItem(Hv)})}}pf=new WeakMap,hf=new WeakMap,qv=new WeakMap,gl=new WeakMap;var Yv;(function(e){e.one="1.0.0"})(Yv||(Yv={}));const N1="orchestrator:identity-utils",Lee={id:N1,dependencies:{featureServices:{[vo]:Hr.one,[eu]:Vu.one,[ci]:Gi.one,[Yp]:nf.one}},create:({featureServices:e})=>{const t=e[vo];return{[Yv.one]:()=>({featureService:new Nee({apiClient:t,stateService:e[ci],identityGatewaySdk:DG(t),storage:window.sessionStorage})})}}};var zv;(function(e){e.one="1.0.0"})(zv||(zv={}));const L1="orchestrator:globaleventemitter-service",Dee=e=>({id:L1,create:()=>({[zv.one]:()=>({featureService:e})})});var Wv;(function(e){e.one="1.0.0"})(Wv||(Wv={}));const D1="orchestrator:reboot-controller",wee=e=>({id:D1,create:()=>({[Wv.one]:()=>({featureService:e})})}),w1="orchestrator:bwell-sdk";var Kv;(function(e){e.one="1.0.0"})(Kv||(Kv={}));const Uee=e=>({id:w1,dependencies:{featureServices:{[ci]:Gi.one,[Qv]:fh.one,[eu]:Vu.one}},create:({featureServices:t})=>{const r=t[ci],n=t[Qv],i=t[eu],a=e;return r.getStore().subscribe(()=>{var c;if((c=r.getUser().tokenData)===null||c===void 0?void 0:c.idToken)try{a.language.setLanguage(n.resolvedLanguage),n.onChangeLanguage(h=>{const v=a.language.getLanguage();h!==v&&a.language.setLanguage(h)})}catch(h){i.error(h,"embeddable-core: Error occurred when switching language in SDK")}}),{[Kv.one]:()=>({featureService:a})}}}),SP={apiClient:l,theme:b,analytics:P,auth:T,logging:O,state:d,navigation:A,featureFlags:g,translation:N,identityUtils:C,nativeBridge:D,globalEventEmitter:L,rebootController:w,bwellSdk:B},EFe=Object.keys(SP).reduce((e,t)=>{const{id:r,version:n}=SP[t];return Object.assign(Object.assign({},e),{[t]:{id:r,version:n}})},{});var hr=SP,$ee=_(8561),Gee=_(295),U1=_.n(Gee),Fee=_(2424),$1=_.n(Fee);class xee{constructor(t){this.providedExternals=t;for(const[r,n]of Object.entries(t))if(!$1()(n))throw new Error(`The provided version ${JSON.stringify(n)} for the external ${JSON.stringify(r)} is invalid.`)}validate(t){for(const[r,n]of Object.entries(t)){const i=this.providedExternals[r];if(!i)throw new Error(`The external dependency ${JSON.stringify(r)} is not provided.`);if(!U1()(i,n))throw new Error(`The external dependency ${JSON.stringify(r)} in the required version range ${JSON.stringify(n)} is not satisfied. The provided version is ${JSON.stringify(i)}.`)}}}class Vee{constructor(t,r,n){this.promise=t,this.value=r,this.error=n,t.then(i=>this.value=i).catch(i=>this.error=i)}}function Bee(e,t,r){let n=`The Feature App module at the url ${JSON.stringify(e)} ${t?`with the module type ${JSON.stringify(t)}`:"with no specific module type"} is invalid. A Feature App module must have a Feature App definition as default export. A Feature App definition is an object with at least a \`create\` method.`;return r&&r.length>1&&!t&&(n+=" Hint: The provided module loader expects an optional second parameter `moduleType`. It might need to be provided for this Feature App."),n}function kee(e){return typeof e!="object"||!e?!1:typeof e.create=="function"}function jee(e){return typeof e!="object"||!e?!1:kee(e.default)}class Qee{constructor(t,r={}){this.featureServiceRegistry=t,this.options=r,this.asyncFeatureAppDefinitions=new Map,this.featureAppDefinitionsWithRegisteredOwnFeatureServices=new WeakSet,this.featureAppRetainers=new Map,this.logger=r.logger||console}getAsyncFeatureAppDefinition(t,r){const n=`${t}${r}`;let i=this.asyncFeatureAppDefinitions.get(n);return i||(i=this.createAsyncFeatureAppDefinition(t,r),this.asyncFeatureAppDefinitions.set(n,i)),i}createFeatureAppScope(t,r,n={}){const i=this.getFeatureAppRetainer(t,r,n);let a=!1;return{featureApp:i.featureApp,release:()=>{a?this.logger.warn(`The Feature App with the ID ${JSON.stringify(t)} has already been released for this scope.`):(a=!0,i.release())}}}async preloadFeatureApp(t,r){await this.getAsyncFeatureAppDefinition(t,r).promise}createAsyncFeatureAppDefinition(t,r){const{moduleLoader:n}=this.options;if(!n)throw new Error("No module loader provided.");return new Vee(n(t,r).then(i=>{if(!jee(i))throw new Error(Bee(t,r,this.options.moduleLoader));return this.logger.info(`The Feature App module at the url ${JSON.stringify(t)} has been successfully loaded.`),i.default}))}registerOwnFeatureServices(t,r){this.featureAppDefinitionsWithRegisteredOwnFeatureServices.has(r)||(r.ownFeatureServiceDefinitions&&this.featureServiceRegistry.registerFeatureServices(r.ownFeatureServiceDefinitions,t),this.featureAppDefinitionsWithRegisteredOwnFeatureServices.add(r))}getFeatureAppRetainer(t,r,n){let i=this.featureAppRetainers.get(t);return i?i.retain():(this.registerOwnFeatureServices(t,r),i=this.createFeatureAppRetainer(r,t,n)),i}createFeatureAppRetainer(t,r,n){var i,a;this.validateExternals(t);const{featureAppName:c,baseUrl:f,beforeCreate:y,config:h,done:v}=n,G=this.featureServiceRegistry.bindFeatureServices(t,r,c);try{(a=(i=this.options).onBind)===null||a===void 0||a.call(i,{featureAppDefinition:t,featureAppId:r,featureAppName:c})}catch(ye){this.logger.error("Failed to execute onBind callback.",ye)}const W={baseUrl:f,config:h,featureAppId:r,featureAppName:c,featureServices:G.featureServices,done:v};try{y?.(W);const ye=t.create(W);this.logger.info(`The Feature App with the ID ${JSON.stringify(r)} has been successfully created.`);let Te=1;const Re={featureApp:ye,retain:()=>{Te+=1},release:()=>{Te-=1,Te===0&&(this.featureAppRetainers.delete(r),G.unbind())}};return this.featureAppRetainers.set(r,Re),Re}catch(ye){throw G.unbind(),ye}}validateExternals(t){const{externalsValidator:r}=this.options;if(!r)return;const{dependencies:n}=t;n&&n.externals&&r.validate(n.externals)}}var qee=_(5725),Hee=_.n(qee);function Yee(e,t,r,n,i){return`The ${e?"optional":"required"} Feature Service ${JSON.stringify(t)} in the unsupported version range ${JSON.stringify(n)} could not be bound to consumer ${JSON.stringify(r)}. The supported versions are ${JSON.stringify(i)}.`}function zee(e,t,r){return`The Feature Service ${JSON.stringify(e)} could not be registered by registrant ${JSON.stringify(t)} because it defines the invalid version ${JSON.stringify(r)}.`}function Wee(e,t,r){return`The ${e?"optional":"required"} Feature Service ${JSON.stringify(t)} in an invalid version could not be bound to consumer ${JSON.stringify(r)}.`}function Kee(e,t,r){return`The ${e?"optional":"required"} Feature Service ${JSON.stringify(t)} is not registered and therefore could not be bound to consumer ${JSON.stringify(r)}.`}function Xee(e,t){return`The Feature Service ${JSON.stringify(e)} could not be registered by registrant ${JSON.stringify(t)} because it returned undefined.`}function Jee(e,t){return`The Feature Service ${JSON.stringify(e)} has been successfully registered by registrant ${JSON.stringify(t)}.`}function Zee(e,t){return`The already registered Feature Service ${JSON.stringify(e)} could not be re-registered by registrant ${JSON.stringify(t)}.`}function ete(e,t){return`The required Feature Service ${JSON.stringify(e)} has been successfully bound to consumer ${JSON.stringify(t)}.`}function tte(e){return`All required Feature Services are already bound to consumer ${JSON.stringify(e)}.`}function rte(e,t){return`The required Feature Service ${JSON.stringify(e)} could not be unbound from consumer ${JSON.stringify(t)}.`}function nte(e,t){return`The required Feature Service ${JSON.stringify(e)} has been successfully unbound from consumer ${JSON.stringify(t)}.`}function ite(e){return`All required Feature Services are already unbound from consumer ${JSON.stringify(e)}.`}var ate=_(2702),ote=_.n(ate);function ste(e){return t=>[e,t]}function ute(e,t){return Object.keys(t).map(ste(e))}function cte(e){return Array.from(e.keys()).reduce((t,r)=>{const n=e.get(r);if(!n)return t;const i=ute(r,n);return[...t,...i]},[])}function lte(e){const t=Array.from(e.keys()),r=cte(e),n=ote()(r);return n.push(...t.filter(i=>e.has(i)&&n.indexOf(i)===-1)),n.reverse()}function G1({dependencies:e,optionalDependencies:t}){return Object.assign(Object.assign({},e&&e.featureServices),t&&t.featureServices)}function dte(e){const t=new Map;for(const r of e)t.set(r.id,G1(r));return t}function fte({optionalDependencies:e},t){return Boolean(e&&e.featureServices&&e.featureServices.hasOwnProperty(t))}function _te(e){const t=new Map;for(const r of e)t.set(r.id,r);return t}class pte{constructor(t={}){this.options=t,this.sharedFeatureServices=new Map,this.consumerIds=new Set,this.logger=t.logger||console}registerFeatureServices(t,r){const n=_te(t),i=dte(t);for(const a of lte(i))this.registerFeatureService(n,a,r)}bindFeatureServices(t,r,n){if(this.consumerIds.has(r))throw new Error(tte(r));const i=new Map,a=Object.create(null),c=G1(t);for(const h of Object.keys(c)){const v=fte(t,h),G=c[h],W=this.bindFeatureService(h,r,n,G,{optional:v});!W||(this.logger.info(ete(h,r)),i.set(h,W),a[h]=W.featureService)}this.consumerIds.add(r);let f=!1;return{featureServices:a,unbind:()=>{if(f)throw new Error(ite(r));f=!0,this.consumerIds.delete(r);for(const[h,v]of i.entries())try{v.unbind&&v.unbind(),this.logger.info(nte(h,r))}catch(G){this.logger.error(rte(h,r),G)}}}}registerFeatureService(t,r,n){const i=t.get(r);if(!i)return;if(this.sharedFeatureServices.has(r)){this.logger.warn(Zee(r,n));return}this.validateExternals(i);const{featureServices:a}=this.bindFeatureServices(i,r),c=i.create({featureServices:a});c?(this.validateFeatureServiceVersions(c,r,n),this.sharedFeatureServices.set(r,c),this.logger.info(Jee(r,n))):this.logger.info(Xee(r,n))}bindFeatureService(t,r,n,i,{optional:a}){const c=i&&Hee()(i);if(!c){const W=Wee(a,t,r);if(a){this.logger.info(W);return}throw new Error(W)}const f=`^${c.version}`,y=this.sharedFeatureServices.get(t);if(!y){const W=Kee(a,t,r);if(a){this.logger.info(W);return}throw new Error(W)}const h=Object.keys(y),v=h.find(W=>U1()(W,f)),G=v?y[v]:void 0;if(!G){const W=Yee(a,t,r,f,h);if(a){this.logger.info(W);return}throw new Error(W)}return G(r,n)}validateExternals(t){const{externalsValidator:r}=this.options;if(!r)return;const{dependencies:n}=t;n&&n.externals&&r.validate(n.externals)}validateFeatureServiceVersions(t,r,n){for(const i of Object.keys(t))if(!$1()(i))throw new Error(zee(r,n,i))}}function F1(e,t={}){const{featureServiceDefinitions:r,featureServiceDependencies:n,providedExternals:i,moduleLoader:a,logger:c,onBind:f}=t;let y;i&&(y=new xee(i));const h=new pte({externalsValidator:y,logger:c}),v={dependencies:{featureServices:n}};r&&h.registerFeatureServices(r,e);const G=new Qee(h,{externalsValidator:y,moduleLoader:a,logger:c,onBind:f}),{featureServices:W}=h.bindFeatureServices(v,e);return{featureAppManager:G,featureServiceRegistry:h,featureServices:W}}/**
|
|
12014
12014
|
* @license
|
|
12015
12015
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
12016
12016
|
* This code may only be used under the BSD style license found at
|