@everymatrix/pam-player-addresses 0.11.0 → 0.11.2

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const pamPlayerAddresses = require('./pam-player-addresses-8214aff0.js');
5
+ const pamPlayerAddresses = require('./pam-player-addresses-e0f6227f.js');
6
6
  require('./index-bf6d2004.js');
7
7
 
8
8
 
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
8
8
  const defineCustomElements = async (win, options) => {
9
9
  if (typeof window === 'undefined') return undefined;
10
10
  await appGlobals.globalScripts();
11
- return index.bootstrapLazy([["pam-player-addresses_2.cjs",[[1,"pam-player-addresses",{"userId":[513,"user-id"],"session":[513],"endpoint":[513],"lang":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"isFullAddressDisplayed":[513,"is-full-address-displayed"],"isPermanentAdressEditable":[513,"is-permanent-adress-editable"],"isTemporaryAdressEditable":[513,"is-temporary-adress-editable"],"isStandAlone":[513,"is-stand-alone"],"limitStylingAppends":[32],"isSkeletonLoading":[32],"isSubmitButtonAvailable":[32],"invalidFields":[32],"isMobile":[32],"isPermanentAddressSectionActive":[32],"isTemporaryAddressSectionActive":[32]},null,{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[2,"border-radius"],"marginBottom":[2,"margin-bottom"],"marginTop":[2,"margin-top"],"marginLeft":[2,"margin-left"],"marginRight":[2,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
11
+ return index.bootstrapLazy([["pam-player-addresses_2.cjs",[[1,"pam-player-addresses",{"userId":[513,"user-id"],"session":[513],"endpoint":[513],"lang":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"isFullAddressDisplayed":[513,"is-full-address-displayed"],"isPermanentAdressEditable":[513,"is-permanent-adress-editable"],"isTemporaryAdressEditable":[513,"is-temporary-adress-editable"],"isStandAlone":[513,"is-stand-alone"],"limitStylingAppends":[32],"isSkeletonLoading":[32],"isSubmitButtonAvailable":[32],"invalidFields":[32],"isMobile":[32],"isPermanentAddressSectionActive":[32],"isTemporaryAddressSectionActive":[32],"isError":[32],"errorMessage":[32],"errorCode":[32]},null,{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;
@@ -387,7 +387,7 @@ const isMobile = (userAgent) => {
387
387
  userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
388
388
  };
389
389
 
390
- const pamPlayerAddressesCss = ":host {\n display: block;\n}\n\nbutton {\n font-family: var(--emw--button-typography);\n}\n\ninput, select, option {\n font-family: inherit;\n}\n\n.PamPlayerAddressesWrapper {\n color: var(--emw--pam-typography, var(--emw-color-contrast, #07072A));\n background: var(--emw-color-pale, var(--emw--color-gray-50, #F1F1F1));\n padding: 50px;\n height: 100%;\n border-radius: var(--emw--border-radius-large, 10px);\n container-type: inline-size;\n opacity: 1;\n animation-name: fadeIn;\n animation-iteration-count: 1;\n animation-timing-function: ease-in;\n animation-duration: 0.3s;\n}\n.PamPlayerAddressesWrapper .ReturnButton {\n display: none;\n}\n.PamPlayerAddressesWrapper .HeaderText {\n font-size: var(--emw--font-size-x-large, 24px);\n color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n text-transform: capitalize;\n font-weight: var(--emw--font-weight-semibold, 500);\n}\n.PamPlayerAddressesWrapper .Section {\n background: var(--emw-color-pale, var(--emw--color-gray-100, #E6E6E6));\n border-radius: var(--emw--border-radius-large, 10px);\n padding: 10px;\n margin-bottom: 10px;\n}\n.PamPlayerAddressesWrapper .Section .SectionTitle {\n font-size: var(--emw--font-size-large, 20px);\n color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n text-transform: capitalize;\n font-weight: var(--emw--font-weight-semibold, 500);\n padding: 0;\n border: 0;\n margin-top: 10px;\n margin-bottom: 10px;\n background: transparent;\n cursor: pointer;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent {\n display: grid;\n max-height: 0;\n padding-bottom: 0;\n margin-top: 0;\n overflow: hidden;\n transition: ease-in-out var(--emw--transition-medium, 250ms);\n column-gap: 50px;\n row-gap: 25px;\n grid-template-rows: auto;\n grid-template-columns: 1fr 1fr;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field {\n width: 100%;\n display: flex;\n flex-direction: column;\n /* Chrome, Safari, Edge, Opera */\n /* Firefox */\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field label {\n font-size: var(--emw--size-small, 14px);\n font-weight: var(--emw--font-weight-semibold, 500);\n margin-bottom: 5px;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field input {\n font-size: var(--emw--size-small, 14px);\n font-weight: var(--emw--font-weight-light, 300);\n color: var(--emw--pam-contrast, var(--emw-color-contrast, #07072A));\n padding: 10px;\n line-height: 16px;\n background: var(--emw-color-white, #FFFFFF);\n outline: none;\n transition-duration: var(--emw--transition-medium, 250ms);\n border: 1px solid var(--emw--color-gray-100, #353535);\n border-radius: var(--emw--border-radius-medium, 10px);\n width: 100%;\n box-sizing: border-box;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field input:focus, .PamPlayerAddressesWrapper .Section .SectionContent .Field input :focus-within, .PamPlayerAddressesWrapper .Section .SectionContent .Field input :focus-visible, .PamPlayerAddressesWrapper .Section .SectionContent .Field input :visited {\n border: 1px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n box-shadow: 0 0 0 1pt var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field input::-webkit-outer-spin-button,\n.PamPlayerAddressesWrapper .Section .SectionContent .Field input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field input[type=number] {\n -moz-appearance: textfield;\n appearance: textfield;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field.Invalid input {\n border: 1px solid var(--emw-color-error, var(--emw-color-red, #FD2839));\n background: var(--emw-color-pale, #FBECF4);\n color: var(--emw-color-error, var(--emw-color-red, #FD2839));\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field .Error {\n color: var(--emw-color-error, var(--emw-color-red, #FD2839));\n font-size: var(--emw--font-size-x-small, 12px);\n line-height: 10px;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field.Disabled input {\n opacity: 0.5;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .CompoundField {\n width: 100%;\n display: flex;\n gap: 10px;\n flex-direction: row;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent.Active {\n max-height: 800px;\n padding-bottom: 30px;\n margin-top: 20px;\n}\n.PamPlayerAddressesWrapper .ButtonsArea {\n grid-column-gap: 10px;\n grid-template-rows: auto;\n grid-template-columns: 1fr;\n margin-top: 20px;\n width: 50%;\n}\n.PamPlayerAddressesWrapper .ButtonsArea .SaveButton {\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n cursor: pointer;\n background-image: linear-gradient(to bottom, color-mix(in srgb, var(--emw--color-primary, #22B04E) 80%, black 20%), var(--emw--color-primary, #22B04E), color-mix(in srgb, var(--emw--color-primary, #22B04E) 80%, white 30%));\n border: 2px solid var(--emw--button-border-color, #0E5924);\n color: var(--emw--button-text-color, #FFFFFF);\n border-radius: var(--emw--button-border-radius, 10px);\n font-size: var(--emw--size-standard, 16px);\n text-transform: uppercase;\n transition-duration: var(--emw--transition-medium, 250ms);\n max-width: 400px;\n min-width: 200px;\n padding: 13px 0;\n width: 100%;\n}\n.PamPlayerAddressesWrapper .ButtonsArea .SaveButton:active {\n background: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n}\n.PamPlayerAddressesWrapper .ButtonsArea .SaveButton.Disabled {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.PamPlayerAddressesWrapper.skeleton .ReturnButton {\n display: block;\n width: 200px;\n margin-top: 15px;\n margin-bottom: 20px;\n}\n.PamPlayerAddressesWrapper.skeleton .Section .SectionTitle {\n width: 200px;\n margin-bottom: 30px;\n}\n.PamPlayerAddressesWrapper.skeleton .Section .SectionContent {\n max-height: 100%;\n grid-template-columns: 50% 50%;\n overflow: hidden;\n}\n.PamPlayerAddressesWrapper.skeleton .Section .SectionContent .Field {\n height: 60px;\n overflow: hidden;\n}\n.PamPlayerAddressesWrapper.skeleton .ButtonsArea .SaveButton {\n width: 500px;\n border-radius: 30px;\n overflow: hidden;\n display: block;\n background-image: none;\n border: none;\n}\n@container (max-width: 425px) {\n .PamPlayerAddressesWrapper {\n padding: 20px 15px;\n background: var(--emw-color-gray-50, #F9F8F8);\n max-width: unset;\n border-radius: var(--emw--border-radius-small, 5px);\n }\n .PamPlayerAddressesWrapper .HeaderText {\n display: none;\n }\n .PamPlayerAddressesWrapper .ReturnButton {\n color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n display: inline-flex;\n align-items: center;\n column-gap: 10px;\n margin-bottom: 10px;\n }\n .PamPlayerAddressesWrapper .ReturnButton svg {\n fill: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n }\n .PamPlayerAddressesWrapper h2 {\n color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n font-size: var(--emw--font-size-large, 20px);\n font-weight: var(--emw--font-weight-semibold, 500);\n }\n .PamPlayerAddressesWrapper .Section .SectionContent {\n row-gap: 15px;\n grid-template-columns: 1fr;\n }\n .PamPlayerAddressesWrapper .Section .SectionTitle {\n margin-top: 5px;\n margin-bottom: 5px;\n font-size: var(--emw--font-size-medium, 16px);\n }\n .PamPlayerAddressesWrapper .Section .Field label {\n color: var(--emw-color-gray-300, #58586B);\n font-size: var(--emw--size-x-small, 12px);\n font-weight: var(-emw--font-weight-normal, 400);\n }\n .PamPlayerAddressesWrapper .Section .Field input {\n color: var(--emw-color-gray-300, #58586B);\n font-size: var(--emw--size-x-small, 12px);\n font-weight: var(--emw--font-weight-light, 300);\n }\n .PamPlayerAddressesWrapper .Section .CompoundField {\n width: 100%;\n display: flex;\n gap: 10px;\n flex-direction: row;\n }\n .PamPlayerAddressesWrapper .ButtonsArea {\n grid-column-gap: 10px;\n width: 100%;\n grid-template-columns: 1fr 1fr;\n }\n .PamPlayerAddressesWrapper .ButtonsArea .SaveButton {\n font-size: var(--emw--size-x-small, 12px);\n height: 40px;\n color: var(--emw-button-typography, var(--emw-color-white, #FFFFFF));\n }\n .PamPlayerAddressesWrapper .ButtonsArea .SaveButton.Disabled {\n color: var(--emw-color-gray-300, #58586B);\n }\n .PamPlayerAddressesWrapper.skeleton .Section .SectionContent {\n display: block;\n }\n .PamPlayerAddressesWrapper.skeleton .Section .SectionContent .Field {\n margin-bottom: 15px;\n }\n .PamPlayerAddressesWrapper.skeleton .ButtonsArea .SaveButton {\n width: 100%;\n height: 100%;\n border-radius: 20px;\n }\n}\n\n@keyframes fadeIn {\n 0% {\n opacity: 0.01;\n }\n 1% {\n opacity: 0;\n }\n 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}";
390
+ const pamPlayerAddressesCss = ":host {\n display: block;\n}\n\nbutton {\n font-family: var(--emw--button-typography);\n}\n\ninput, select, option {\n font-family: inherit;\n}\n\n.errorContainer {\n font-family: \"Roboto\";\n font-style: normal;\n font-family: sans-serif;\n display: flex;\n flex-direction: column;\n gap: 24px;\n width: 100%;\n height: 100%;\n}\n.errorContainer .errorMessage {\n color: var(--emw--color-error, var(--emw--color-red, #ed0909));\n font-size: var(--emw-font-size-small, 13px);\n display: block;\n justify-content: center;\n text-align: center;\n}\n\n.PamPlayerAddressesWrapper {\n color: var(--emw--pam-typography, var(--emw-color-contrast, #07072A));\n background: var(--emw-color-pale, var(--emw--color-gray-50, #F1F1F1));\n padding: 50px;\n height: 100%;\n border-radius: var(--emw--border-radius-large, 10px);\n container-type: inline-size;\n opacity: 1;\n animation-name: fadeIn;\n animation-iteration-count: 1;\n animation-timing-function: ease-in;\n animation-duration: 0.3s;\n}\n.PamPlayerAddressesWrapper .ReturnButton {\n display: none;\n}\n.PamPlayerAddressesWrapper .HeaderText {\n font-size: var(--emw--font-size-x-large, 24px);\n color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n text-transform: capitalize;\n font-weight: var(--emw--font-weight-semibold, 500);\n}\n.PamPlayerAddressesWrapper .Section {\n background: var(--emw-color-pale, var(--emw--color-gray-100, #E6E6E6));\n border-radius: var(--emw--border-radius-large, 10px);\n padding: 10px;\n margin-bottom: 10px;\n}\n.PamPlayerAddressesWrapper .Section .SectionTitle {\n font-size: var(--emw--font-size-large, 20px);\n color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n text-transform: capitalize;\n font-weight: var(--emw--font-weight-semibold, 500);\n padding: 0;\n border: 0;\n margin-top: 10px;\n margin-bottom: 10px;\n background: transparent;\n cursor: pointer;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent {\n display: grid;\n max-height: 0;\n padding-bottom: 0;\n margin-top: 0;\n overflow: hidden;\n transition: ease-in-out var(--emw--transition-medium, 250ms);\n column-gap: 50px;\n row-gap: 25px;\n grid-template-rows: auto;\n grid-template-columns: 1fr 1fr;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field {\n width: 100%;\n display: flex;\n flex-direction: column;\n /* Chrome, Safari, Edge, Opera */\n /* Firefox */\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field label {\n font-size: var(--emw--size-small, 14px);\n font-weight: var(--emw--font-weight-semibold, 500);\n margin-bottom: 5px;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field input {\n font-size: var(--emw--size-small, 14px);\n font-weight: var(--emw--font-weight-light, 300);\n color: var(--emw--pam-contrast, var(--emw-color-contrast, #07072A));\n padding: 10px;\n line-height: 16px;\n background: var(--emw-color-white, #FFFFFF);\n outline: none;\n transition-duration: var(--emw--transition-medium, 250ms);\n border: 1px solid var(--emw--color-gray-100, #353535);\n border-radius: var(--emw--border-radius-medium, 10px);\n width: 100%;\n box-sizing: border-box;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field input:focus, .PamPlayerAddressesWrapper .Section .SectionContent .Field input :focus-within, .PamPlayerAddressesWrapper .Section .SectionContent .Field input :focus-visible, .PamPlayerAddressesWrapper .Section .SectionContent .Field input :visited {\n border: 1px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n box-shadow: 0 0 0 1pt var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field input::-webkit-outer-spin-button,\n.PamPlayerAddressesWrapper .Section .SectionContent .Field input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field input[type=number] {\n -moz-appearance: textfield;\n appearance: textfield;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field.Invalid input {\n border: 1px solid var(--emw-color-error, var(--emw-color-red, #FD2839));\n background: var(--emw-color-pale, #FBECF4);\n color: var(--emw-color-error, var(--emw-color-red, #FD2839));\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field .Error {\n color: var(--emw-color-error, var(--emw-color-red, #FD2839));\n font-size: var(--emw--font-size-x-small, 12px);\n line-height: 10px;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field.Disabled input {\n opacity: 0.5;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .CompoundField {\n width: 100%;\n display: flex;\n gap: 10px;\n flex-direction: row;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent.Active {\n max-height: 800px;\n padding-bottom: 30px;\n margin-top: 20px;\n}\n.PamPlayerAddressesWrapper .ButtonsArea {\n grid-column-gap: 10px;\n grid-template-rows: auto;\n grid-template-columns: 1fr;\n margin-top: 20px;\n width: 50%;\n}\n.PamPlayerAddressesWrapper .ButtonsArea .SaveButton {\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n cursor: pointer;\n background-image: linear-gradient(to bottom, color-mix(in srgb, var(--emw--color-primary, #22B04E) 80%, black 20%), var(--emw--color-primary, #22B04E), color-mix(in srgb, var(--emw--color-primary, #22B04E) 80%, white 30%));\n border: 2px solid var(--emw--button-border-color, #0E5924);\n color: var(--emw--button-text-color, #FFFFFF);\n border-radius: var(--emw--button-border-radius, 10px);\n font-size: var(--emw--size-standard, 16px);\n text-transform: uppercase;\n transition-duration: var(--emw--transition-medium, 250ms);\n max-width: 400px;\n min-width: 200px;\n padding: 13px 0;\n width: 100%;\n}\n.PamPlayerAddressesWrapper .ButtonsArea .SaveButton:active {\n background: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n}\n.PamPlayerAddressesWrapper .ButtonsArea .SaveButton.Disabled {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.PamPlayerAddressesWrapper.skeleton .ReturnButton {\n display: block;\n width: 200px;\n margin-top: 15px;\n margin-bottom: 20px;\n}\n.PamPlayerAddressesWrapper.skeleton .Section .SectionTitle {\n width: 200px;\n margin-bottom: 30px;\n}\n.PamPlayerAddressesWrapper.skeleton .Section .SectionContent {\n max-height: 100%;\n grid-template-columns: 50% 50%;\n overflow: hidden;\n}\n.PamPlayerAddressesWrapper.skeleton .Section .SectionContent .Field {\n height: 60px;\n overflow: hidden;\n}\n.PamPlayerAddressesWrapper.skeleton .ButtonsArea .SaveButton {\n width: 500px;\n border-radius: 30px;\n overflow: hidden;\n display: block;\n background-image: none;\n border: none;\n}\n@container (max-width: 425px) {\n .PamPlayerAddressesWrapper {\n padding: 20px 15px;\n background: var(--emw-color-gray-50, #F9F8F8);\n max-width: unset;\n border-radius: var(--emw--border-radius-small, 5px);\n }\n .PamPlayerAddressesWrapper .HeaderText {\n display: none;\n }\n .PamPlayerAddressesWrapper .ReturnButton {\n color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n display: inline-flex;\n align-items: center;\n column-gap: 10px;\n margin-bottom: 10px;\n }\n .PamPlayerAddressesWrapper .ReturnButton svg {\n fill: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n }\n .PamPlayerAddressesWrapper h2 {\n color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n font-size: var(--emw--font-size-large, 20px);\n font-weight: var(--emw--font-weight-semibold, 500);\n }\n .PamPlayerAddressesWrapper .Section .SectionContent {\n row-gap: 15px;\n grid-template-columns: 1fr;\n }\n .PamPlayerAddressesWrapper .Section .SectionTitle {\n margin-top: 5px;\n margin-bottom: 5px;\n font-size: var(--emw--font-size-medium, 16px);\n }\n .PamPlayerAddressesWrapper .Section .Field label {\n color: var(--emw-color-gray-300, #58586B);\n font-size: var(--emw--size-x-small, 12px);\n font-weight: var(-emw--font-weight-normal, 400);\n }\n .PamPlayerAddressesWrapper .Section .Field input {\n color: var(--emw-color-gray-300, #58586B);\n font-size: var(--emw--size-x-small, 12px);\n font-weight: var(--emw--font-weight-light, 300);\n }\n .PamPlayerAddressesWrapper .Section .CompoundField {\n width: 100%;\n display: flex;\n gap: 10px;\n flex-direction: row;\n }\n .PamPlayerAddressesWrapper .ButtonsArea {\n grid-column-gap: 10px;\n width: 100%;\n grid-template-columns: 1fr 1fr;\n }\n .PamPlayerAddressesWrapper .ButtonsArea .SaveButton {\n font-size: var(--emw--size-x-small, 12px);\n height: 40px;\n color: var(--emw-button-typography, var(--emw-color-white, #FFFFFF));\n }\n .PamPlayerAddressesWrapper .ButtonsArea .SaveButton.Disabled {\n color: var(--emw-color-gray-300, #58586B);\n }\n .PamPlayerAddressesWrapper.skeleton .Section .SectionContent {\n display: block;\n }\n .PamPlayerAddressesWrapper.skeleton .Section .SectionContent .Field {\n margin-bottom: 15px;\n }\n .PamPlayerAddressesWrapper.skeleton .ButtonsArea .SaveButton {\n width: 100%;\n height: 100%;\n border-radius: 20px;\n }\n}\n\n@keyframes fadeIn {\n 0% {\n opacity: 0.01;\n }\n 1% {\n opacity: 0;\n }\n 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}";
391
391
  const PamPlayerAddressesStyle0 = pamPlayerAddressesCss;
392
392
 
393
393
  const PamPlayerAddresses = class {
@@ -423,6 +423,35 @@ const PamPlayerAddresses = class {
423
423
  break;
424
424
  }
425
425
  };
426
+ /**
427
+ * Promise for fetching the response and returning the response or the erorr message
428
+ * @param res - response from the API
429
+ */
430
+ this.handleFetchResponse = async (res) => {
431
+ var _a;
432
+ if (res.status >= 300) {
433
+ this.isError = true;
434
+ let response = await res.json();
435
+ this.errorCode = (_a = response.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.errorCode;
436
+ this.errorMessage = this.errorCode ? translate(this.errorCode, this.lang) : translate('errorMessageFetch', this.lang);
437
+ window.postMessage({
438
+ type: 'WidgetNotification',
439
+ data: {
440
+ type: 'error',
441
+ message: this.errorMessage
442
+ }
443
+ }, window.location.href);
444
+ return Promise.reject(this.errorMessage);
445
+ }
446
+ else {
447
+ this.isError = false;
448
+ if (res.headers.get('content-type')) {
449
+ let response = await res.json();
450
+ return Promise.resolve(response);
451
+ }
452
+ return Promise.resolve();
453
+ }
454
+ };
426
455
  this.getData = () => {
427
456
  const url = new URL(`/api/v1/players/${this.userId}/player-identifiable-information/addresses/`, this.endpoint);
428
457
  const headers = new Headers();
@@ -431,17 +460,16 @@ const PamPlayerAddresses = class {
431
460
  method: 'GET',
432
461
  headers: headers
433
462
  };
434
- return new Promise((resolve) => {
463
+ return new Promise((resolve, reject) => {
435
464
  fetch(url.href, options)
436
- .then(res => {
437
- if (res.ok) {
438
- return res.json();
439
- }
440
- this.sendErrorNotification('errorMessageFetch');
441
- })
465
+ .then((res) => this.handleFetchResponse(res))
442
466
  .then(res => {
443
467
  this.data = res;
444
468
  resolve();
469
+ })
470
+ .catch((error) => {
471
+ console.error(error);
472
+ reject(error);
445
473
  });
446
474
  });
447
475
  };
@@ -485,7 +513,7 @@ const PamPlayerAddresses = class {
485
513
  if (!this.fieldsState[addressType]['hasChanged'])
486
514
  continue;
487
515
  const address = this.dataRef[addressType];
488
- const url = new URL(`/api/v1/players/${this.userId}/player-identifiable-information/addresses/${address['addressId']}`, this.endpoint);
516
+ const url = new URL(`/api/v1/players/${this.userId}/player-identifiable-information/addresses/${address['addressId']}/`, this.endpoint);
489
517
  const headers = new Headers();
490
518
  headers.append('X-SessionId', this.session);
491
519
  headers.append('Content-Type', 'application/json-patch+json');
@@ -579,6 +607,9 @@ const PamPlayerAddresses = class {
579
607
  this.isMobile = isMobile(window.navigator.userAgent);
580
608
  this.isPermanentAddressSectionActive = true;
581
609
  this.isTemporaryAddressSectionActive = false;
610
+ this.isError = false;
611
+ this.errorMessage = '';
612
+ this.errorCode = '';
582
613
  }
583
614
  handleStylingChange(newValue, oldValue) {
584
615
  if (newValue !== oldValue)
@@ -669,7 +700,10 @@ const PamPlayerAddresses = class {
669
700
  }
670
701
  }
671
702
  render() {
672
- return (index.h("div", { key: 'f273967a4c5ead5e29d5f475eb564f4f5c183134', ref: el => this.stylingContainer = el }, this.isSkeletonLoading
703
+ if (!this.isSkeletonLoading && this.isError) {
704
+ return (index.h("div", { class: "errorContainer" }, index.h("p", { class: "errorMessage", innerHTML: this.errorMessage })));
705
+ }
706
+ return (index.h("div", { ref: el => this.stylingContainer = el }, this.isSkeletonLoading
673
707
  ? index.h("form", { class: "PamPlayerAddressesWrapper skeleton" }, index.h("div", { class: "ReturnButton" }, index.h("ui-skeleton", { structure: "title", width: "auto", height: "30px" })), index.h("div", { class: "Section" }, index.h("section", { class: "SectionContent" }, [...Array(6).keys()].map(() => index.h("div", { class: "Field" }, index.h("ui-skeleton", { structure: "text", width: "auto", "margin-bottom": "10px", height: "10px" }), index.h("ui-skeleton", { structure: "rectangle", width: "100%", height: "20px" }))), index.h("div", { class: "CompoundField" }, index.h("div", { class: "Field" }, index.h("ui-skeleton", { structure: "text", width: "auto", "margin-bottom": "10px", height: "10px" }), index.h("ui-skeleton", { structure: "rectangle", width: "100%", height: "20px" })), index.h("div", { class: "Field" }, index.h("ui-skeleton", { structure: "text", width: "auto", "margin-bottom": "10px", height: "10px" }), index.h("ui-skeleton", { structure: "rectangle", width: "100%", height: "20px" }))), index.h("div", { class: "Field" }, index.h("ui-skeleton", { structure: "text", width: "auto", "margin-bottom": "10px", height: "10px" }), index.h("ui-skeleton", { structure: "rectangle", width: "auto", height: "20px" })))), index.h("section", { class: "ButtonsArea" }, index.h("div", { class: "SaveButton" }, index.h("ui-skeleton", { structure: "rectangle", width: "auto", height: "50px" }))))
674
708
  : index.h("form", { class: "PamPlayerAddressesWrapper" }, index.h("div", { class: "ReturnButton", onClick: this.toggleScreen }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, index.h("g", { transform: "translate(-20 -158)" }, index.h("g", { transform: "translate(20 158)" }, index.h("path", { class: "aaa", d: "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z", transform: "translate(15 15) rotate(180)" })))), index.h("h2", null, translate('title', this.lang))), index.h("h2", { class: "HeaderText" }, translate('title', this.lang)), this.dataRef['Temporary'] && this.section('Temporary', this.isTemporaryAdressEditable === 'true'), this.dataRef['Permanent'] && this.section('Permanent', this.isPermanentAdressEditable === 'true'), this.isStandAlone === 'true' &&
675
709
  index.h("section", { class: "ButtonsArea" }, index.h("button", { class: `SaveButton ${this.isSubmitButtonAvailable ? '' : 'Disabled'}`, onClick: this.updateData }, translate('saveButton'))))));
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["pam-player-addresses_2.cjs",[[1,"pam-player-addresses",{"userId":[513,"user-id"],"session":[513],"endpoint":[513],"lang":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"isFullAddressDisplayed":[513,"is-full-address-displayed"],"isPermanentAdressEditable":[513,"is-permanent-adress-editable"],"isTemporaryAdressEditable":[513,"is-temporary-adress-editable"],"isStandAlone":[513,"is-stand-alone"],"limitStylingAppends":[32],"isSkeletonLoading":[32],"isSubmitButtonAvailable":[32],"invalidFields":[32],"isMobile":[32],"isPermanentAddressSectionActive":[32],"isTemporaryAddressSectionActive":[32]},null,{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[2,"border-radius"],"marginBottom":[2,"margin-bottom"],"marginTop":[2,"margin-top"],"marginLeft":[2,"margin-left"],"marginRight":[2,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
22
+ return index.bootstrapLazy([["pam-player-addresses_2.cjs",[[1,"pam-player-addresses",{"userId":[513,"user-id"],"session":[513],"endpoint":[513],"lang":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"isFullAddressDisplayed":[513,"is-full-address-displayed"],"isPermanentAdressEditable":[513,"is-permanent-adress-editable"],"isTemporaryAdressEditable":[513,"is-temporary-adress-editable"],"isStandAlone":[513,"is-stand-alone"],"limitStylingAppends":[32],"isSkeletonLoading":[32],"isSubmitButtonAvailable":[32],"invalidFields":[32],"isMobile":[32],"isPermanentAddressSectionActive":[32],"isTemporaryAddressSectionActive":[32],"isError":[32],"errorMessage":[32],"errorCode":[32]},null,{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const pamPlayerAddresses = require('./pam-player-addresses-8214aff0.js');
5
+ const pamPlayerAddresses = require('./pam-player-addresses-e0f6227f.js');
6
6
  const index = require('./index-bf6d2004.js');
7
7
 
8
8
  const uiSkeletonCss = ":host{display:block;--emw-skeleton-rectangle-background:#c2c2c2;--emw-skeleton-circle-background:#c2c2c2;--emw-skeleton-text-background:#c2c2c2;--emw-skeleton-title-background:#c2c2c2;--emw-skeleton-image-background:#c2c2c2;--emw-skeleton-logo-background:#c2c2c2;--emw-skeleton-primary-color:#e0e0e0;--emw-skeleton-secondary-color:#f0f0f0}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 2px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 5px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:var(--emw-skeleton-text-width-100, 300px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 5px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, inherit)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 5px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, var(--emw-skeleton-color-0, #c2c2c2))}100%{background-color:var(--emw-skeleton-secondary-color, var(--emw-skeleton-color-100, #f0f0f0))}}";
@@ -11,26 +11,54 @@ const UiSkeletonStyle0 = uiSkeletonCss;
11
11
  const UiSkeleton = class {
12
12
  constructor(hostRef) {
13
13
  index.registerInstance(this, hostRef);
14
+ this.stylingValue = {
15
+ width: this.handleStylingProps(this.width),
16
+ height: this.handleStylingProps(this.height),
17
+ borderRadius: this.handleStylingProps(this.borderRadius),
18
+ marginBottom: this.handleStylingProps(this.marginBottom),
19
+ marginTop: this.handleStylingProps(this.marginTop),
20
+ marginLeft: this.handleStylingProps(this.marginLeft),
21
+ marginRight: this.handleStylingProps(this.marginRight)
22
+ };
14
23
  this.structure = undefined;
15
- this.width = undefined;
16
- this.height = undefined;
17
- this.borderRadius = undefined;
18
- this.marginBottom = undefined;
19
- this.marginTop = undefined;
20
- this.marginLeft = undefined;
21
- this.marginRight = undefined;
24
+ this.width = 'unset';
25
+ this.height = 'unset';
26
+ this.borderRadius = 'unset';
27
+ this.marginBottom = 'unset';
28
+ this.marginTop = 'unset';
29
+ this.marginLeft = 'unset';
30
+ this.marginRight = 'unset';
22
31
  this.animation = true;
23
- this.rows = undefined;
24
- this.size = undefined;
25
- this.color = undefined;
26
- this.primaryColor = undefined;
27
- this.secondaryColor = undefined;
32
+ this.rows = 0;
33
+ this.size = '100%';
34
+ this.color = '#c2c2c2';
35
+ this.primaryColor = '#c2c2c2';
36
+ this.secondaryColor = '#ffffff';
28
37
  }
29
38
  handleStructureChange(newValue, oldValue) {
30
39
  if (oldValue !== newValue) {
31
40
  this.handleStructure(newValue);
32
41
  }
33
42
  }
43
+ handleStylingProps(value) {
44
+ switch (typeof value) {
45
+ case 'number':
46
+ return value === 0 ? 0 : `${value}px`;
47
+ case 'undefined':
48
+ return 'unset';
49
+ case 'string':
50
+ if (['auto', 'unset', 'none', 'inherit', 'initial'].includes(value) ||
51
+ value.endsWith('px') ||
52
+ value.endsWith('%')) {
53
+ return value;
54
+ }
55
+ else {
56
+ return 'unset';
57
+ }
58
+ default:
59
+ return 'unset';
60
+ }
61
+ }
34
62
  handleStructure(structure) {
35
63
  switch (structure) {
36
64
  case 'logo':
@@ -50,22 +78,22 @@ const UiSkeleton = class {
50
78
  }
51
79
  }
52
80
  renderLogo() {
53
- return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: "Logo " + (this.animation ? 'Skeleton' : '') })));
81
+ return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: 'Logo ' + (this.animation ? 'Skeleton' : '') })));
54
82
  }
55
83
  renderImage() {
56
- return (index.h("div", { class: "Image " + (this.animation ? 'Skeleton' : '') }));
84
+ return index.h("div", { class: 'Image ' + (this.animation ? 'Skeleton' : '') });
57
85
  }
58
86
  renderTitle() {
59
- return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: "Title " + (this.animation ? 'Skeleton' : '') })));
87
+ return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: 'Title ' + (this.animation ? 'Skeleton' : '') })));
60
88
  }
61
89
  renderText() {
62
- return (index.h("div", { class: "SkeletonContainer" }, Array.from({ length: this.rows > 0 ? this.rows : 1 }).map((_, index$1) => (index.h("div", { key: index$1, class: "Text " + (this.animation ? 'Skeleton' : '') })))));
90
+ return (index.h("div", { class: "SkeletonContainer" }, Array.from({ length: this.rows > 0 ? this.rows : 1 }).map((_, index$1) => (index.h("div", { key: index$1, class: 'Text ' + (this.animation ? 'Skeleton' : '') })))));
63
91
  }
64
92
  renderRectangle() {
65
- return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: "Rectangle " + (this.animation ? 'Skeleton' : '') })));
93
+ return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: 'Rectangle ' + (this.animation ? 'Skeleton' : '') })));
66
94
  }
67
95
  renderCircle() {
68
- return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: "Circle " + (this.animation ? 'Skeleton' : '') })));
96
+ return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: 'Circle ' + (this.animation ? 'Skeleton' : '') })));
69
97
  }
70
98
  render() {
71
99
  let styleBlock = '';
@@ -73,13 +101,13 @@ const UiSkeleton = class {
73
101
  case 'logo':
74
102
  styleBlock = `
75
103
  :host {
76
- --emw-skeleton-logo-width: ${this.width};
77
- --emw-skeleton-logo-height: ${this.height};
78
- --emw-skeleton-logo-border-radius: ${this.borderRadius}px;
79
- --emw-skeleton-logo-margin-bottom: ${this.marginBottom}px;
80
- --emw-skeleton-logo-margin-top: ${this.marginTop}px;
81
- --emw-skeleton-logo-margin-left: ${this.marginLeft}px;
82
- --emw-skeleton-logo-margin-right: ${this.marginRight}px;
104
+ --emw-skeleton-logo-width: ${this.stylingValue.width};
105
+ --emw-skeleton-logo-height: ${this.stylingValue.height};
106
+ --emw-skeleton-logo-border-radius: ${this.stylingValue.borderRadius};
107
+ --emw-skeleton-logo-margin-bottom: ${this.stylingValue.marginBottom};
108
+ --emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};
109
+ --emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};
110
+ --emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};
83
111
  --emw-skeleton-logo-background: ${this.color};
84
112
  --emw-skeleton-primary-color: ${this.primaryColor};
85
113
  --emw-skeleton-secondary-color: ${this.secondaryColor};
@@ -89,13 +117,13 @@ const UiSkeleton = class {
89
117
  case 'image':
90
118
  styleBlock = `
91
119
  :host {
92
- --emw-skeleton-image-width: ${this.width};
93
- --emw-skeleton-image-height: ${this.height};
94
- --emw-skeleton-image-border-radius: ${this.borderRadius}px;
95
- --emw-skeleton-image-margin-bottom: ${this.marginBottom}px;
96
- --emw-skeleton-image-margin-top: ${this.marginTop}px;
97
- --emw-skeleton-image-margin-left: ${this.marginLeft}px;
98
- --emw-skeleton-image-margin-right: ${this.marginRight}px;
120
+ --emw-skeleton-image-width: ${this.stylingValue.width};
121
+ --emw-skeleton-image-height: ${this.stylingValue.height};
122
+ --emw-skeleton-image-border-radius: ${this.stylingValue.borderRadius};
123
+ --emw-skeleton-image-margin-bottom: ${this.stylingValue.marginBottom};
124
+ --emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};
125
+ --emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};
126
+ --emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};
99
127
  --emw-skeleton-image-background: ${this.color};
100
128
  --emw-skeleton-primary-color: ${this.primaryColor};
101
129
  --emw-skeleton-secondary-color: ${this.secondaryColor};
@@ -105,13 +133,13 @@ const UiSkeleton = class {
105
133
  case 'title':
106
134
  styleBlock = `
107
135
  :host {
108
- --emw-skeleton-title-width: ${this.width};
109
- --emw-skeleton-title-height: ${this.height};
110
- --emw-skeleton-title-border-radius: ${this.borderRadius}px;
111
- --emw-skeleton-title-margin-bottom: ${this.marginBottom}px;
112
- --emw-skeleton-title-margin-top: ${this.marginTop}px;
113
- --emw-skeleton-title-margin-left: ${this.marginLeft}px;
114
- --emw-skeleton-title-margin-right: ${this.marginRight}px;
136
+ --emw-skeleton-title-width: ${this.stylingValue.width};
137
+ --emw-skeleton-title-height: ${this.stylingValue.height};
138
+ --emw-skeleton-title-border-radius: ${this.stylingValue.borderRadius};
139
+ --emw-skeleton-title-margin-bottom: ${this.stylingValue.marginBottom};
140
+ --emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};
141
+ --emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};
142
+ --emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};
115
143
  --emw-skeleton-title-background: ${this.color};
116
144
  --emw-skeleton-primary-color: ${this.primaryColor};
117
145
  --emw-skeleton-secondary-color: ${this.secondaryColor};
@@ -121,13 +149,13 @@ const UiSkeleton = class {
121
149
  case 'text':
122
150
  styleBlock = `
123
151
  :host {
124
- --emw-skeleton-text-width: ${this.width};
125
- --emw-skeleton-text-height: ${this.height};
126
- --emw-skeleton-text-border-radius: ${this.borderRadius}px;
127
- --emw-skeleton-text-margin-bottom: ${this.marginBottom}px;
128
- --emw-skeleton-text-margin-top: ${this.marginTop}px;
129
- --emw-skeleton-text-margin-left: ${this.marginLeft}px;
130
- --emw-skeleton-text-margin-right: ${this.marginRight}px;
152
+ --emw-skeleton-text-width: ${this.stylingValue.width};
153
+ --emw-skeleton-text-height: ${this.stylingValue.height};
154
+ --emw-skeleton-text-border-radius: ${this.stylingValue.borderRadius};
155
+ --emw-skeleton-text-margin-bottom: ${this.stylingValue.marginBottom};
156
+ --emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};
157
+ --emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};
158
+ --emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};
131
159
  --emw-skeleton-text-background: ${this.color};
132
160
  --emw-skeleton-primary-color: ${this.primaryColor};
133
161
  --emw-skeleton-secondary-color: ${this.secondaryColor};
@@ -137,13 +165,13 @@ const UiSkeleton = class {
137
165
  case 'rectangle':
138
166
  styleBlock = `
139
167
  :host {
140
- --emw-skeleton-rectangle-width: ${this.width};
141
- --emw-skeleton-rectangle-height: ${this.height};
142
- --emw-skeleton-rectangle-border-radius: ${this.borderRadius}px;
143
- --emw-skeleton-rectangle-margin-bottom: ${this.marginBottom}px;
144
- --emw-skeleton-rectangle-margin-top: ${this.marginTop}px;
145
- --emw-skeleton-rectangle-margin-left: ${this.marginLeft}px;
146
- --emw-skeleton-rectangle-margin-right: ${this.marginRight}px;
168
+ --emw-skeleton-rectangle-width: ${this.stylingValue.width};
169
+ --emw-skeleton-rectangle-height: ${this.stylingValue.height};
170
+ --emw-skeleton-rectangle-border-radius: ${this.stylingValue.borderRadius};
171
+ --emw-skeleton-rectangle-margin-bottom: ${this.stylingValue.marginBottom};
172
+ --emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};
173
+ --emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};
174
+ --emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};
147
175
  --emw-skeleton-rectangle-background: ${this.color};
148
176
  --emw-skeleton-primary-color: ${this.primaryColor};
149
177
  --emw-skeleton-secondary-color: ${this.secondaryColor};
@@ -163,7 +191,7 @@ const UiSkeleton = class {
163
191
  default:
164
192
  styleBlock = '';
165
193
  }
166
- return (index.h(index.Host, { key: '3bb792a149db7fe732d5cbfa092cdb4d6ca0689e' }, index.h("style", { key: 'a4607599b60659f385ae2660513e38b383739674' }, styleBlock), this.handleStructure(this.structure)));
194
+ return (index.h(index.Host, { key: '5c185b76c438d20d4ad88bc48d94ff5628410bb7' }, index.h("style", { key: 'de95e60a5955d5b2af83710423fe40329c187f7e' }, styleBlock), this.handleStructure(this.structure)));
167
195
  }
168
196
  static get watchers() { return {
169
197
  "structure": ["handleStructureChange"]
@@ -10,6 +10,24 @@ input, select, option {
10
10
  font-family: inherit;
11
11
  }
12
12
 
13
+ .errorContainer {
14
+ font-family: "Roboto";
15
+ font-style: normal;
16
+ font-family: sans-serif;
17
+ display: flex;
18
+ flex-direction: column;
19
+ gap: 24px;
20
+ width: 100%;
21
+ height: 100%;
22
+ }
23
+ .errorContainer .errorMessage {
24
+ color: var(--emw--color-error, var(--emw--color-red, #ed0909));
25
+ font-size: var(--emw-font-size-small, 13px);
26
+ display: block;
27
+ justify-content: center;
28
+ text-align: center;
29
+ }
30
+
13
31
  .PamPlayerAddressesWrapper {
14
32
  color: var(--emw--pam-typography, var(--emw-color-contrast, #07072A));
15
33
  background: var(--emw-color-pale, var(--emw--color-gray-50, #F1F1F1));
@@ -35,6 +35,35 @@ export class PamPlayerAddresses {
35
35
  break;
36
36
  }
37
37
  };
38
+ /**
39
+ * Promise for fetching the response and returning the response or the erorr message
40
+ * @param res - response from the API
41
+ */
42
+ this.handleFetchResponse = async (res) => {
43
+ var _a;
44
+ if (res.status >= 300) {
45
+ this.isError = true;
46
+ let response = await res.json();
47
+ this.errorCode = (_a = response.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.errorCode;
48
+ this.errorMessage = this.errorCode ? translate(this.errorCode, this.lang) : translate('errorMessageFetch', this.lang);
49
+ window.postMessage({
50
+ type: 'WidgetNotification',
51
+ data: {
52
+ type: 'error',
53
+ message: this.errorMessage
54
+ }
55
+ }, window.location.href);
56
+ return Promise.reject(this.errorMessage);
57
+ }
58
+ else {
59
+ this.isError = false;
60
+ if (res.headers.get('content-type')) {
61
+ let response = await res.json();
62
+ return Promise.resolve(response);
63
+ }
64
+ return Promise.resolve();
65
+ }
66
+ };
38
67
  this.getData = () => {
39
68
  const url = new URL(`/api/v1/players/${this.userId}/player-identifiable-information/addresses/`, this.endpoint);
40
69
  const headers = new Headers();
@@ -43,17 +72,17 @@ export class PamPlayerAddresses {
43
72
  method: 'GET',
44
73
  headers: headers
45
74
  };
46
- return new Promise((resolve) => {
75
+ return new Promise((resolve, reject) => {
47
76
  fetch(url.href, options)
48
- .then(res => {
49
- if (res.ok) {
50
- return res.json();
51
- }
52
- this.sendErrorNotification('errorMessageFetch');
53
- })
77
+ .then((res) => this.handleFetchResponse(res))
54
78
  .then(res => {
55
79
  this.data = res;
56
80
  resolve();
81
+ })
82
+ .catch((error) => {
83
+ console.error(error);
84
+ reject(error);
85
+ ;
57
86
  });
58
87
  });
59
88
  };
@@ -97,7 +126,7 @@ export class PamPlayerAddresses {
97
126
  if (!this.fieldsState[addressType]['hasChanged'])
98
127
  continue;
99
128
  const address = this.dataRef[addressType];
100
- const url = new URL(`/api/v1/players/${this.userId}/player-identifiable-information/addresses/${address['addressId']}`, this.endpoint);
129
+ const url = new URL(`/api/v1/players/${this.userId}/player-identifiable-information/addresses/${address['addressId']}/`, this.endpoint);
101
130
  const headers = new Headers();
102
131
  headers.append('X-SessionId', this.session);
103
132
  headers.append('Content-Type', 'application/json-patch+json');
@@ -191,6 +220,9 @@ export class PamPlayerAddresses {
191
220
  this.isMobile = isMobile(window.navigator.userAgent);
192
221
  this.isPermanentAddressSectionActive = true;
193
222
  this.isTemporaryAddressSectionActive = false;
223
+ this.isError = false;
224
+ this.errorMessage = '';
225
+ this.errorCode = '';
194
226
  }
195
227
  handleStylingChange(newValue, oldValue) {
196
228
  if (newValue !== oldValue)
@@ -281,7 +313,10 @@ export class PamPlayerAddresses {
281
313
  }
282
314
  }
283
315
  render() {
284
- return (h("div", { key: 'f273967a4c5ead5e29d5f475eb564f4f5c183134', ref: el => this.stylingContainer = el }, this.isSkeletonLoading
316
+ if (!this.isSkeletonLoading && this.isError) {
317
+ return (h("div", { class: "errorContainer" }, h("p", { class: "errorMessage", innerHTML: this.errorMessage })));
318
+ }
319
+ return (h("div", { ref: el => this.stylingContainer = el }, this.isSkeletonLoading
285
320
  ? h("form", { class: "PamPlayerAddressesWrapper skeleton" }, h("div", { class: "ReturnButton" }, h("ui-skeleton", { structure: "title", width: "auto", height: "30px" })), h("div", { class: "Section" }, h("section", { class: "SectionContent" }, [...Array(6).keys()].map(() => h("div", { class: "Field" }, h("ui-skeleton", { structure: "text", width: "auto", "margin-bottom": "10px", height: "10px" }), h("ui-skeleton", { structure: "rectangle", width: "100%", height: "20px" }))), h("div", { class: "CompoundField" }, h("div", { class: "Field" }, h("ui-skeleton", { structure: "text", width: "auto", "margin-bottom": "10px", height: "10px" }), h("ui-skeleton", { structure: "rectangle", width: "100%", height: "20px" })), h("div", { class: "Field" }, h("ui-skeleton", { structure: "text", width: "auto", "margin-bottom": "10px", height: "10px" }), h("ui-skeleton", { structure: "rectangle", width: "100%", height: "20px" }))), h("div", { class: "Field" }, h("ui-skeleton", { structure: "text", width: "auto", "margin-bottom": "10px", height: "10px" }), h("ui-skeleton", { structure: "rectangle", width: "auto", height: "20px" })))), h("section", { class: "ButtonsArea" }, h("div", { class: "SaveButton" }, h("ui-skeleton", { structure: "rectangle", width: "auto", height: "50px" }))))
286
321
  : h("form", { class: "PamPlayerAddressesWrapper" }, h("div", { class: "ReturnButton", onClick: this.toggleScreen }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, h("g", { transform: "translate(-20 -158)" }, h("g", { transform: "translate(20 158)" }, h("path", { class: "aaa", d: "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z", transform: "translate(15 15) rotate(180)" })))), h("h2", null, translate('title', this.lang))), h("h2", { class: "HeaderText" }, translate('title', this.lang)), this.dataRef['Temporary'] && this.section('Temporary', this.isTemporaryAdressEditable === 'true'), this.dataRef['Permanent'] && this.section('Permanent', this.isPermanentAdressEditable === 'true'), this.isStandAlone === 'true' &&
287
322
  h("section", { class: "ButtonsArea" }, h("button", { class: `SaveButton ${this.isSubmitButtonAvailable ? '' : 'Disabled'}`, onClick: this.updateData }, translate('saveButton'))))));
@@ -519,7 +554,10 @@ export class PamPlayerAddresses {
519
554
  "invalidFields": {},
520
555
  "isMobile": {},
521
556
  "isPermanentAddressSectionActive": {},
522
- "isTemporaryAddressSectionActive": {}
557
+ "isTemporaryAddressSectionActive": {},
558
+ "isError": {},
559
+ "errorMessage": {},
560
+ "errorCode": {}
523
561
  };
524
562
  }
525
563
  static get watchers() {
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { P as PamPlayerAddresses } from './pam-player-addresses-911649b4.js';
1
+ export { P as PamPlayerAddresses } from './pam-player-addresses-6572a14c.js';
2
2
  import './index-79695a92.js';
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await globalScripts();
8
- return bootstrapLazy([["pam-player-addresses_2",[[1,"pam-player-addresses",{"userId":[513,"user-id"],"session":[513],"endpoint":[513],"lang":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"isFullAddressDisplayed":[513,"is-full-address-displayed"],"isPermanentAdressEditable":[513,"is-permanent-adress-editable"],"isTemporaryAdressEditable":[513,"is-temporary-adress-editable"],"isStandAlone":[513,"is-stand-alone"],"limitStylingAppends":[32],"isSkeletonLoading":[32],"isSubmitButtonAvailable":[32],"invalidFields":[32],"isMobile":[32],"isPermanentAddressSectionActive":[32],"isTemporaryAddressSectionActive":[32]},null,{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[2,"border-radius"],"marginBottom":[2,"margin-bottom"],"marginTop":[2,"margin-top"],"marginLeft":[2,"margin-left"],"marginRight":[2,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
8
+ return bootstrapLazy([["pam-player-addresses_2",[[1,"pam-player-addresses",{"userId":[513,"user-id"],"session":[513],"endpoint":[513],"lang":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"isFullAddressDisplayed":[513,"is-full-address-displayed"],"isPermanentAdressEditable":[513,"is-permanent-adress-editable"],"isTemporaryAdressEditable":[513,"is-temporary-adress-editable"],"isStandAlone":[513,"is-stand-alone"],"limitStylingAppends":[32],"isSkeletonLoading":[32],"isSubmitButtonAvailable":[32],"invalidFields":[32],"isMobile":[32],"isPermanentAddressSectionActive":[32],"isTemporaryAddressSectionActive":[32],"isError":[32],"errorMessage":[32],"errorCode":[32]},null,{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };