@aglyn/shared-data-enums 1.0.0-beta.143

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.
Files changed (42) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +3 -0
  3. package/package.json +39 -0
  4. package/src/enums.d.ts +26 -0
  5. package/src/enums.js +27 -0
  6. package/src/enums.js.map +1 -0
  7. package/src/index.d.ts +17 -0
  8. package/src/index.js +18 -0
  9. package/src/index.js.map +1 -0
  10. package/src/lib/aglyn-applications.d.ts +39 -0
  11. package/src/lib/aglyn-applications.js +53 -0
  12. package/src/lib/aglyn-applications.js.map +1 -0
  13. package/src/lib/aglyn.d.ts +49 -0
  14. package/src/lib/aglyn.js +86 -0
  15. package/src/lib/aglyn.js.map +1 -0
  16. package/src/lib/breakpoint-span.d.ts +66 -0
  17. package/src/lib/breakpoint-span.js +117 -0
  18. package/src/lib/breakpoint-span.js.map +1 -0
  19. package/src/lib/data-table.d.ts +107 -0
  20. package/src/lib/data-table.js +225 -0
  21. package/src/lib/data-table.js.map +1 -0
  22. package/src/lib/firebase-auth.d.ts +73 -0
  23. package/src/lib/firebase-auth.js +178 -0
  24. package/src/lib/firebase-auth.js.map +1 -0
  25. package/src/lib/global.d.ts +32 -0
  26. package/src/lib/global.js +33 -0
  27. package/src/lib/global.js.map +1 -0
  28. package/src/lib/http.d.ts +145 -0
  29. package/src/lib/http.js +155 -0
  30. package/src/lib/http.js.map +1 -0
  31. package/src/lib/icons.d.ts +108 -0
  32. package/src/lib/icons.js +130 -0
  33. package/src/lib/icons.js.map +1 -0
  34. package/src/lib/palette-token-css-var.d.ts +111 -0
  35. package/src/lib/palette-token-css-var.js +221 -0
  36. package/src/lib/palette-token-css-var.js.map +1 -0
  37. package/src/lib/styles.d.ts +170 -0
  38. package/src/lib/styles.js +315 -0
  39. package/src/lib/styles.js.map +1 -0
  40. package/src/lib/sx-property-aliases.d.ts +129 -0
  41. package/src/lib/sx-property-aliases.js +231 -0
  42. package/src/lib/sx-property-aliases.js.map +1 -0
@@ -0,0 +1,178 @@
1
+ var _process_env_NEXT_PUBLIC_OPERATOR_SUPPORT_EMAIL, _process_env;
2
+ /**
3
+ * @license
4
+ * Copyright 2023 Aglyn LLC
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */ import { AuthErrorCodes } from "firebase/auth";
18
+ /**
19
+ * Codes the console raises itself, for failures Firebase has no code for
20
+ * (AGL-1416).
21
+ *
22
+ * These exist because `AuthErrorAlertComponent` renders NOTHING unless the
23
+ * error carries a `code` — an error built as `{ message }` alone is silently
24
+ * dropped, which is how the SSO page's own messages never reached anyone.
25
+ * Giving each failure a real code is what makes it visible, and registering a
26
+ * caption below is what stops it falling back to the generic "contact the
27
+ * system administrator" line — the single worst thing to tell someone whose
28
+ * actual problem is that they have another Google account in session.
29
+ */ /**
30
+ * Who a locked-out user is told to contact (AGL-2196).
31
+ *
32
+ * This string was `support@aglyn.com`, rendered on the sign-in screen of every
33
+ * deployment — including a self-hosted one, where the only person who can
34
+ * re-enable the account is the local operator and Aglyn's support desk has
35
+ * never heard of the user. An unauthenticated dead end pointed at the wrong
36
+ * company.
37
+ *
38
+ * Read straight from the environment rather than through
39
+ * `operatorIdentity()`, and that is not laziness: `@aglyn/aglyn` already
40
+ * imports this library, so importing it back would be a project cycle. The
41
+ * same reasoning is written down in `platform-brand.ts`, which re-reads this
42
+ * exact variable for the same reason.
43
+ *
44
+ * Unset, the sentence names no address at all rather than the wrong one —
45
+ * Aglyn's own deployment sets `NEXT_PUBLIC_OPERATOR_SUPPORT_EMAIL`
46
+ * (`.env.example`), so its copy is unchanged. Dot notation is load-bearing:
47
+ * Next substitutes `process.env.NAME` textually and never the bracket form.
48
+ *
49
+ * Used by every sentence that ends a person's journey: a disabled account,
50
+ * and the two failures they cannot act on at all — the generic fallback and
51
+ * an internal error. Those last two are the ones a stranger meets at the
52
+ * signup form, where a dead end with no address is indistinguishable from
53
+ * the product being broken on purpose.
54
+ */ const OPERATOR_CONTACT = typeof process !== 'undefined' && ((_process_env = process.env) == null ? void 0 : (_process_env_NEXT_PUBLIC_OPERATOR_SUPPORT_EMAIL = _process_env.NEXT_PUBLIC_OPERATOR_SUPPORT_EMAIL) == null ? void 0 : _process_env_NEXT_PUBLIC_OPERATOR_SUPPORT_EMAIL.trim()) || 'your administrator';
55
+ export const AuthAppErrorCodes = {
56
+ /** Google resolved SSO against the wrong signed-in account. */ SSO_ACCOUNT_MISMATCH: 'auth/sso-account-mismatch',
57
+ /** No SSO configured for the email domain the user typed. */ SSO_NOT_CONFIGURED: 'auth/sso-not-configured',
58
+ /** The user submitted the SSO gate without a usable email. */ SSO_INPUT_REQUIRED: 'auth/sso-input-required',
59
+ /** Authenticated with the IdP, but not a member of the organization. */ SSO_NOT_AUTHORIZED: 'auth/sso-not-authorized',
60
+ /**
61
+ * The IdP window closed without a result. On the SSO path this is NOT the
62
+ * plain cancel it is elsewhere: when Google refuses the SAML request it
63
+ * renders its own error page inside that window, so the user closing it
64
+ * looks identical to a cancel. Suppressing it — as the shared
65
+ * `AuthErrorIgnore` list does for popup-closed — is what left the desktop
66
+ * flow with Google's raw error and nothing from us.
67
+ */ SSO_INCOMPLETE: 'auth/sso-incomplete',
68
+ /** SSO failed for a reason we could not classify. */ SSO_FAILED: 'auth/sso-failed',
69
+ /**
70
+ * The WebAuthn ceremony ended without an assertion (AGL-1417).
71
+ *
72
+ * Deliberately NOT called "cancelled". The spec overloads
73
+ * `NotAllowedError` to cover a dismissed prompt, a timeout, AND no
74
+ * discoverable credential for the RP ID — the last on purpose, so a site
75
+ * cannot probe for a credential's existence. Naming this "cancelled" is
76
+ * what let "you have no passkey on this device" render as nothing at all.
77
+ */ PASSKEY_NOT_COMPLETED: 'auth/passkey-not-completed',
78
+ /** The ceremony ran but the server refused the assertion. */ PASSKEY_SIGNIN_FAILED: 'auth/passkey-signin-failed'
79
+ };
80
+ export const AuthErrorIgnore = {
81
+ [AuthErrorCodes.USER_CANCELLED]: true,
82
+ [AuthErrorCodes.REDIRECT_CANCELLED_BY_USER]: true,
83
+ [AuthErrorCodes.POPUP_CLOSED_BY_USER]: true
84
+ };
85
+ export const AuthErrorNotice = {
86
+ [AuthErrorCodes.USER_SIGNED_OUT]: true,
87
+ [AuthErrorCodes.CREDENTIAL_TOO_OLD_LOGIN_AGAIN]: true,
88
+ // Situations the person can fix themselves in one step. Rendering these as
89
+ // red errors invites a support ticket for something that is not broken.
90
+ [AuthAppErrorCodes.SSO_ACCOUNT_MISMATCH]: true,
91
+ [AuthAppErrorCodes.SSO_NOT_CONFIGURED]: true,
92
+ [AuthAppErrorCodes.SSO_INPUT_REQUIRED]: true,
93
+ [AuthAppErrorCodes.SSO_INCOMPLETE]: true,
94
+ [AuthAppErrorCodes.PASSKEY_NOT_COMPLETED]: true
95
+ };
96
+ export const AuthErrorMessage = {
97
+ // "the system administrator" is nobody a person signing up can find. The
98
+ // fallback sentence is the last thing they read before giving up, so it
99
+ // names a reachable address and says the attempt is safe to repeat.
100
+ general: `An error has occurred. Please try again — if it keeps happening, contact ${OPERATOR_CONTACT}.`,
101
+ [AuthErrorCodes.ADMIN_ONLY_OPERATION]: 'You are not authorized to perform this action.',
102
+ [AuthErrorCodes.ALREADY_INITIALIZED]: 'Failed to initialize authenticator. Already initialized.',
103
+ [AuthErrorCodes.ARGUMENT_ERROR]: 'Failed to provide valid arguments.',
104
+ [AuthErrorCodes.CAPTCHA_CHECK_FAILED]: 'CAPTCHA check failed. Try again.',
105
+ [AuthErrorCodes.CODE_EXPIRED]: 'Authentication code has expired. Request a new code and try again.',
106
+ [AuthErrorCodes.CREDENTIAL_ALREADY_IN_USE]: 'Authentication credential already in use.',
107
+ [AuthErrorCodes.CREDENTIAL_MISMATCH]: 'Unable to perform action. Authentication token mismatch.',
108
+ [AuthErrorCodes.CREDENTIAL_TOO_OLD_LOGIN_AGAIN]: 'You have been signed out. Sign in again to continue.',
109
+ [AuthErrorCodes.EMAIL_CHANGE_NEEDS_VERIFICATION]: 'New email is not verified. Check your email to verify.',
110
+ [AuthErrorCodes.EMAIL_EXISTS]: 'Account with email already exists. Sign in instead.',
111
+ [AuthErrorCodes.EXPIRED_OOB_CODE]: 'This link has expired. Request a new password reset link and try again.',
112
+ [AuthErrorCodes.EXPIRED_POPUP_REQUEST]: 'Request timeout. Try again.',
113
+ [AuthErrorCodes.INVALID_OOB_CODE]: 'This link is invalid or has already been used. Request a new password reset link.',
114
+ // A server-side failure, and the only Auth code a person can do nothing
115
+ // about. It is also where a refusing `beforeUserCreated` blocking function
116
+ // surfaces, so this exact sentence is what a stranger sees when signup is
117
+ // broken platform-side. Say the fault is ours, that their details were not
118
+ // kept, and who to tell.
119
+ [AuthErrorCodes.INTERNAL_ERROR]: `Something went wrong on our end — no account was created and nothing you entered was saved. Please try again, and if it keeps happening contact ${OPERATOR_CONTACT}.`,
120
+ [AuthErrorCodes.INVALID_API_KEY]: 'Invalid API key.',
121
+ [AuthErrorCodes.INVALID_AUTH]: 'Unable to perform action. Invalid authentication token.',
122
+ [AuthErrorCodes.INVALID_AUTH_EVENT]: 'Invalid authentication event.',
123
+ [AuthErrorCodes.INVALID_CERT_HASH]: 'Multi-factor authentication is required.',
124
+ [AuthErrorCodes.INVALID_CODE]: 'Invalid verification code. Try again with a different code.',
125
+ [AuthErrorCodes.INVALID_CUSTOM_TOKEN]: 'Unable to perform action. Invalid authentication token.',
126
+ [AuthErrorCodes.INVALID_EMAIL]: 'Unable to perform action. Email provided is invalid.',
127
+ [AuthErrorCodes.INVALID_IDP_RESPONSE]: 'Unable to perform action. Invalid authentication credential.',
128
+ [AuthErrorCodes.INVALID_MESSAGE_PAYLOAD]: 'Unable to perform action. Invalid message payload.',
129
+ [AuthErrorCodes.INVALID_MFA_SESSION]: 'Unable to perform action. Invalid multi-factor authentication.',
130
+ [AuthErrorCodes.INVALID_ORIGIN]: 'This domain is unauthorized to perform this action.',
131
+ [AuthErrorCodes.INVALID_PASSWORD]: 'No account matches the credentials provided.',
132
+ [AuthErrorCodes.INVALID_PHONE_NUMBER]: 'No account matches the credentials provided.',
133
+ [AuthErrorCodes.INVALID_RECIPIENT_EMAIL]: 'Unable to perform action. Invalid recipient email.',
134
+ [AuthErrorCodes.INVALID_SENDER]: 'Unable to perform action. Invalid sender email.',
135
+ [AuthErrorCodes.INVALID_SESSION_INFO]: 'Unable to perform action. Invalid verification ID.',
136
+ [AuthErrorCodes.INVALID_TENANT_ID]: 'Unable to perform action. Invalid tenant ID.',
137
+ [AuthErrorCodes.MFA_INFO_NOT_FOUND]: 'Unable to perform action. Multi-factor authentication info not found.',
138
+ [AuthErrorCodes.MFA_REQUIRED]: 'Multi-factor authentication is required.',
139
+ [AuthErrorCodes.MISSING_CODE]: 'Verification code is missing.',
140
+ [AuthErrorCodes.MISSING_OR_INVALID_NONCE]: 'Unable to perform action. Missing or invalid nonce.',
141
+ [AuthErrorCodes.MISSING_PHONE_NUMBER]: 'Unable to perform action. Missing phone number.',
142
+ [AuthErrorCodes.MODULE_DESTROYED]: 'Unable to perform action. App has been destroyed.',
143
+ [AuthErrorCodes.NEED_CONFIRMATION]: 'Authentication credential already in use with different credential.',
144
+ [AuthErrorCodes.NETWORK_REQUEST_FAILED]: 'Unable to connect. Check your internet connection and try again.',
145
+ [AuthErrorCodes.NULL_USER]: 'No account matches the credentials provided.',
146
+ [AuthErrorCodes.POPUP_BLOCKED]: 'Popups blocked. Allow popups in your browser and try again.',
147
+ [AuthErrorCodes.PROVIDER_ALREADY_LINKED]: 'Unable to perform action. Provider is linked to another account.',
148
+ [AuthErrorCodes.QUOTA_EXCEEDED]: 'Unable to perform action. Usage quota has been exceeded.',
149
+ [AuthErrorCodes.REJECTED_CREDENTIAL]: 'Unable to perform action. Rejected credential.',
150
+ [AuthErrorCodes.TENANT_ID_MISMATCH]: 'Unable to perform action. Authentication tenant ID mismatch.',
151
+ [AuthErrorCodes.TIMEOUT]: 'Unable to perform action. Timeout.',
152
+ [AuthErrorCodes.TOKEN_EXPIRED]: 'Your authentication token has expired.',
153
+ [AuthErrorCodes.TOO_MANY_ATTEMPTS_TRY_LATER]: 'Account blocked from too many attempts. Try again later.',
154
+ [AuthErrorCodes.UNVERIFIED_EMAIL]: 'Email is not verified. Check your email to verify.',
155
+ [AuthErrorCodes.USER_DELETED]: 'No account matches the credentials provided.',
156
+ // Lockdown (AGL-1501): a user-scope lock disables the Firebase account, so
157
+ // this is the notice a locked-out person actually sees at sign-in. The
158
+ // copy is the action, not the diagnosis — the reason lives with support.
159
+ [AuthErrorCodes.USER_DISABLED]: `This account is currently disabled. Contact ${OPERATOR_CONTACT} to restore access.`,
160
+ [AuthErrorCodes.USER_SIGNED_OUT]: 'You have been signed out. Sign in again to continue.',
161
+ [AuthErrorCodes.WEAK_PASSWORD]: 'Password is too weak. Enter a stronger password and try again.',
162
+ // AGL-1416. The captions carry the ACTION, because the headline above them
163
+ // is the diagnosis and a diagnosis with no next step is what sends people
164
+ // to their IT admin for a problem only they can fix.
165
+ [AuthAppErrorCodes.SSO_ACCOUNT_MISMATCH]: 'Your browser is signed in to another Google account, and single ' + 'sign-on was resolved against that one. Sign out of the other account, ' + 'or open this page in a private window, then try again.',
166
+ [AuthAppErrorCodes.SSO_NOT_CONFIGURED]: 'Check the spelling of your work email, or sign in with your password ' + 'or Google instead.',
167
+ [AuthAppErrorCodes.SSO_INPUT_REQUIRED]: 'Enter the full work email address your organization uses.',
168
+ [AuthAppErrorCodes.SSO_NOT_AUTHORIZED]: 'Ask an administrator of that organization to invite you, then sign in ' + 'again.',
169
+ [AuthAppErrorCodes.SSO_INCOMPLETE]: 'If you closed the window, just try again. If it showed an error about ' + 'the app not being configured for your account, you are signed in to a ' + 'different Google account — open this page in a private window and ' + 'enter your work email.',
170
+ [AuthAppErrorCodes.SSO_FAILED]: 'Single sign-on could not be completed. Try again, and if it keeps ' + 'happening contact an administrator of your organization.',
171
+ // AGL-1417. Both readings, because the browser deliberately refuses to say
172
+ // which one happened — and the far more common one is the first.
173
+ [AuthAppErrorCodes.PASSKEY_NOT_COMPLETED]: 'If you have not set one up on this device yet, sign in another way and ' + 'add one from Manage account → Security. If you closed the prompt, try ' + 'again.',
174
+ [AuthAppErrorCodes.PASSKEY_SIGNIN_FAILED]: 'Your other sign-in methods still work — password, Google, or single ' + 'sign-on.'
175
+ };
176
+ export const COOKIE_KEY_USER_TOKEN = 'aglyn-user-token';
177
+
178
+ //# sourceMappingURL=firebase-auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/shared/data/enums/src/lib/firebase-auth.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2023 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n type AuthError,\n AuthErrorCodes,\n type OAuthCredential,\n type UserCredential,\n} from 'firebase/auth'\n\n/**\n * Codes the console raises itself, for failures Firebase has no code for\n * (AGL-1416).\n *\n * These exist because `AuthErrorAlertComponent` renders NOTHING unless the\n * error carries a `code` — an error built as `{ message }` alone is silently\n * dropped, which is how the SSO page's own messages never reached anyone.\n * Giving each failure a real code is what makes it visible, and registering a\n * caption below is what stops it falling back to the generic \"contact the\n * system administrator\" line — the single worst thing to tell someone whose\n * actual problem is that they have another Google account in session.\n */\n/**\n * Who a locked-out user is told to contact (AGL-2196).\n *\n * This string was `support@aglyn.com`, rendered on the sign-in screen of every\n * deployment — including a self-hosted one, where the only person who can\n * re-enable the account is the local operator and Aglyn's support desk has\n * never heard of the user. An unauthenticated dead end pointed at the wrong\n * company.\n *\n * Read straight from the environment rather than through\n * `operatorIdentity()`, and that is not laziness: `@aglyn/aglyn` already\n * imports this library, so importing it back would be a project cycle. The\n * same reasoning is written down in `platform-brand.ts`, which re-reads this\n * exact variable for the same reason.\n *\n * Unset, the sentence names no address at all rather than the wrong one —\n * Aglyn's own deployment sets `NEXT_PUBLIC_OPERATOR_SUPPORT_EMAIL`\n * (`.env.example`), so its copy is unchanged. Dot notation is load-bearing:\n * Next substitutes `process.env.NAME` textually and never the bracket form.\n *\n * Used by every sentence that ends a person's journey: a disabled account,\n * and the two failures they cannot act on at all — the generic fallback and\n * an internal error. Those last two are the ones a stranger meets at the\n * signup form, where a dead end with no address is indistinguishable from\n * the product being broken on purpose.\n */\nconst OPERATOR_CONTACT: string =\n (typeof process !== 'undefined' &&\n process.env?.NEXT_PUBLIC_OPERATOR_SUPPORT_EMAIL?.trim()) ||\n 'your administrator'\n\nexport const AuthAppErrorCodes = {\n /** Google resolved SSO against the wrong signed-in account. */\n SSO_ACCOUNT_MISMATCH: 'auth/sso-account-mismatch',\n /** No SSO configured for the email domain the user typed. */\n SSO_NOT_CONFIGURED: 'auth/sso-not-configured',\n /** The user submitted the SSO gate without a usable email. */\n SSO_INPUT_REQUIRED: 'auth/sso-input-required',\n /** Authenticated with the IdP, but not a member of the organization. */\n SSO_NOT_AUTHORIZED: 'auth/sso-not-authorized',\n /**\n * The IdP window closed without a result. On the SSO path this is NOT the\n * plain cancel it is elsewhere: when Google refuses the SAML request it\n * renders its own error page inside that window, so the user closing it\n * looks identical to a cancel. Suppressing it — as the shared\n * `AuthErrorIgnore` list does for popup-closed — is what left the desktop\n * flow with Google's raw error and nothing from us.\n */\n SSO_INCOMPLETE: 'auth/sso-incomplete',\n /** SSO failed for a reason we could not classify. */\n SSO_FAILED: 'auth/sso-failed',\n /**\n * The WebAuthn ceremony ended without an assertion (AGL-1417).\n *\n * Deliberately NOT called \"cancelled\". The spec overloads\n * `NotAllowedError` to cover a dismissed prompt, a timeout, AND no\n * discoverable credential for the RP ID — the last on purpose, so a site\n * cannot probe for a credential's existence. Naming this \"cancelled\" is\n * what let \"you have no passkey on this device\" render as nothing at all.\n */\n PASSKEY_NOT_COMPLETED: 'auth/passkey-not-completed',\n /** The ceremony ran but the server refused the assertion. */\n PASSKEY_SIGNIN_FAILED: 'auth/passkey-signin-failed',\n} as const\n\nexport type AuthAppCode =\n (typeof AuthAppErrorCodes)[keyof typeof AuthAppErrorCodes]\n\nexport type AuthCode = IndexOf<typeof AuthErrorCodes> | AuthAppCode | 'general'\nexport type AuthResultError = AuthError //& {credential?: OAuthCredential}\nexport type AuthResultUser = UserCredential & { credential?: OAuthCredential }\nexport type AuthCallbackResult = Promise<UserCredential>\n\nexport const AuthErrorIgnore = {\n [AuthErrorCodes.USER_CANCELLED]: true,\n [AuthErrorCodes.REDIRECT_CANCELLED_BY_USER]: true,\n [AuthErrorCodes.POPUP_CLOSED_BY_USER]: true,\n}\n\nexport const AuthErrorNotice = {\n [AuthErrorCodes.USER_SIGNED_OUT]: true,\n [AuthErrorCodes.CREDENTIAL_TOO_OLD_LOGIN_AGAIN]: true,\n // Situations the person can fix themselves in one step. Rendering these as\n // red errors invites a support ticket for something that is not broken.\n [AuthAppErrorCodes.SSO_ACCOUNT_MISMATCH]: true,\n [AuthAppErrorCodes.SSO_NOT_CONFIGURED]: true,\n [AuthAppErrorCodes.SSO_INPUT_REQUIRED]: true,\n [AuthAppErrorCodes.SSO_INCOMPLETE]: true,\n [AuthAppErrorCodes.PASSKEY_NOT_COMPLETED]: true,\n}\n\nexport const AuthErrorMessage: Partial<Record<AuthCode, string>> = {\n // \"the system administrator\" is nobody a person signing up can find. The\n // fallback sentence is the last thing they read before giving up, so it\n // names a reachable address and says the attempt is safe to repeat.\n general: `An error has occurred. Please try again — if it keeps happening, contact ${OPERATOR_CONTACT}.`,\n [AuthErrorCodes.ADMIN_ONLY_OPERATION]:\n 'You are not authorized to perform this action.',\n [AuthErrorCodes.ALREADY_INITIALIZED]:\n 'Failed to initialize authenticator. Already initialized.',\n [AuthErrorCodes.ARGUMENT_ERROR]: 'Failed to provide valid arguments.',\n [AuthErrorCodes.CAPTCHA_CHECK_FAILED]: 'CAPTCHA check failed. Try again.',\n [AuthErrorCodes.CODE_EXPIRED]:\n 'Authentication code has expired. Request a new code and try again.',\n [AuthErrorCodes.CREDENTIAL_ALREADY_IN_USE]:\n 'Authentication credential already in use.',\n [AuthErrorCodes.CREDENTIAL_MISMATCH]:\n 'Unable to perform action. Authentication token mismatch.',\n [AuthErrorCodes.CREDENTIAL_TOO_OLD_LOGIN_AGAIN]:\n 'You have been signed out. Sign in again to continue.',\n [AuthErrorCodes.EMAIL_CHANGE_NEEDS_VERIFICATION]:\n 'New email is not verified. Check your email to verify.',\n [AuthErrorCodes.EMAIL_EXISTS]:\n 'Account with email already exists. Sign in instead.',\n [AuthErrorCodes.EXPIRED_OOB_CODE]:\n 'This link has expired. Request a new password reset link and try again.',\n [AuthErrorCodes.EXPIRED_POPUP_REQUEST]: 'Request timeout. Try again.',\n [AuthErrorCodes.INVALID_OOB_CODE]:\n 'This link is invalid or has already been used. Request a new password reset link.',\n // A server-side failure, and the only Auth code a person can do nothing\n // about. It is also where a refusing `beforeUserCreated` blocking function\n // surfaces, so this exact sentence is what a stranger sees when signup is\n // broken platform-side. Say the fault is ours, that their details were not\n // kept, and who to tell.\n [AuthErrorCodes.INTERNAL_ERROR]: `Something went wrong on our end — no account was created and nothing you entered was saved. Please try again, and if it keeps happening contact ${OPERATOR_CONTACT}.`,\n [AuthErrorCodes.INVALID_API_KEY]: 'Invalid API key.',\n [AuthErrorCodes.INVALID_AUTH]:\n 'Unable to perform action. Invalid authentication token.',\n [AuthErrorCodes.INVALID_AUTH_EVENT]: 'Invalid authentication event.',\n [AuthErrorCodes.INVALID_CERT_HASH]:\n 'Multi-factor authentication is required.',\n [AuthErrorCodes.INVALID_CODE]:\n 'Invalid verification code. Try again with a different code.',\n [AuthErrorCodes.INVALID_CUSTOM_TOKEN]:\n 'Unable to perform action. Invalid authentication token.',\n [AuthErrorCodes.INVALID_EMAIL]:\n 'Unable to perform action. Email provided is invalid.',\n [AuthErrorCodes.INVALID_IDP_RESPONSE]:\n 'Unable to perform action. Invalid authentication credential.',\n [AuthErrorCodes.INVALID_MESSAGE_PAYLOAD]:\n 'Unable to perform action. Invalid message payload.',\n [AuthErrorCodes.INVALID_MFA_SESSION]:\n 'Unable to perform action. Invalid multi-factor authentication.',\n [AuthErrorCodes.INVALID_ORIGIN]:\n 'This domain is unauthorized to perform this action.',\n [AuthErrorCodes.INVALID_PASSWORD]:\n 'No account matches the credentials provided.',\n [AuthErrorCodes.INVALID_PHONE_NUMBER]:\n 'No account matches the credentials provided.',\n [AuthErrorCodes.INVALID_RECIPIENT_EMAIL]:\n 'Unable to perform action. Invalid recipient email.',\n [AuthErrorCodes.INVALID_SENDER]:\n 'Unable to perform action. Invalid sender email.',\n [AuthErrorCodes.INVALID_SESSION_INFO]:\n 'Unable to perform action. Invalid verification ID.',\n [AuthErrorCodes.INVALID_TENANT_ID]:\n 'Unable to perform action. Invalid tenant ID.',\n [AuthErrorCodes.MFA_INFO_NOT_FOUND]:\n 'Unable to perform action. Multi-factor authentication info not found.',\n [AuthErrorCodes.MFA_REQUIRED]: 'Multi-factor authentication is required.',\n [AuthErrorCodes.MISSING_CODE]: 'Verification code is missing.',\n [AuthErrorCodes.MISSING_OR_INVALID_NONCE]:\n 'Unable to perform action. Missing or invalid nonce.',\n [AuthErrorCodes.MISSING_PHONE_NUMBER]:\n 'Unable to perform action. Missing phone number.',\n [AuthErrorCodes.MODULE_DESTROYED]:\n 'Unable to perform action. App has been destroyed.',\n [AuthErrorCodes.NEED_CONFIRMATION]:\n 'Authentication credential already in use with different credential.',\n [AuthErrorCodes.NETWORK_REQUEST_FAILED]:\n 'Unable to connect. Check your internet connection and try again.',\n [AuthErrorCodes.NULL_USER]: 'No account matches the credentials provided.',\n [AuthErrorCodes.POPUP_BLOCKED]:\n 'Popups blocked. Allow popups in your browser and try again.',\n [AuthErrorCodes.PROVIDER_ALREADY_LINKED]:\n 'Unable to perform action. Provider is linked to another account.',\n [AuthErrorCodes.QUOTA_EXCEEDED]:\n 'Unable to perform action. Usage quota has been exceeded.',\n [AuthErrorCodes.REJECTED_CREDENTIAL]:\n 'Unable to perform action. Rejected credential.',\n [AuthErrorCodes.TENANT_ID_MISMATCH]:\n 'Unable to perform action. Authentication tenant ID mismatch.',\n [AuthErrorCodes.TIMEOUT]: 'Unable to perform action. Timeout.',\n [AuthErrorCodes.TOKEN_EXPIRED]: 'Your authentication token has expired.',\n [AuthErrorCodes.TOO_MANY_ATTEMPTS_TRY_LATER]:\n 'Account blocked from too many attempts. Try again later.',\n [AuthErrorCodes.UNVERIFIED_EMAIL]:\n 'Email is not verified. Check your email to verify.',\n [AuthErrorCodes.USER_DELETED]: 'No account matches the credentials provided.',\n // Lockdown (AGL-1501): a user-scope lock disables the Firebase account, so\n // this is the notice a locked-out person actually sees at sign-in. The\n // copy is the action, not the diagnosis — the reason lives with support.\n [AuthErrorCodes.USER_DISABLED]:\n `This account is currently disabled. Contact ${OPERATOR_CONTACT} to restore access.`,\n [AuthErrorCodes.USER_SIGNED_OUT]:\n 'You have been signed out. Sign in again to continue.',\n [AuthErrorCodes.WEAK_PASSWORD]:\n 'Password is too weak. Enter a stronger password and try again.',\n // AGL-1416. The captions carry the ACTION, because the headline above them\n // is the diagnosis and a diagnosis with no next step is what sends people\n // to their IT admin for a problem only they can fix.\n [AuthAppErrorCodes.SSO_ACCOUNT_MISMATCH]:\n 'Your browser is signed in to another Google account, and single ' +\n 'sign-on was resolved against that one. Sign out of the other account, ' +\n 'or open this page in a private window, then try again.',\n [AuthAppErrorCodes.SSO_NOT_CONFIGURED]:\n 'Check the spelling of your work email, or sign in with your password ' +\n 'or Google instead.',\n [AuthAppErrorCodes.SSO_INPUT_REQUIRED]:\n 'Enter the full work email address your organization uses.',\n [AuthAppErrorCodes.SSO_NOT_AUTHORIZED]:\n 'Ask an administrator of that organization to invite you, then sign in ' +\n 'again.',\n [AuthAppErrorCodes.SSO_INCOMPLETE]:\n 'If you closed the window, just try again. If it showed an error about ' +\n 'the app not being configured for your account, you are signed in to a ' +\n 'different Google account — open this page in a private window and ' +\n 'enter your work email.',\n [AuthAppErrorCodes.SSO_FAILED]:\n 'Single sign-on could not be completed. Try again, and if it keeps ' +\n 'happening contact an administrator of your organization.',\n // AGL-1417. Both readings, because the browser deliberately refuses to say\n // which one happened — and the far more common one is the first.\n [AuthAppErrorCodes.PASSKEY_NOT_COMPLETED]:\n 'If you have not set one up on this device yet, sign in another way and ' +\n 'add one from Manage account → Security. If you closed the prompt, try ' +\n 'again.',\n [AuthAppErrorCodes.PASSKEY_SIGNIN_FAILED]:\n 'Your other sign-in methods still work — password, Google, or single ' +\n 'sign-on.',\n}\n\nexport const COOKIE_KEY_USER_TOKEN = 'aglyn-user-token'\n"],"names":["process","AuthErrorCodes","OPERATOR_CONTACT","env","NEXT_PUBLIC_OPERATOR_SUPPORT_EMAIL","trim","AuthAppErrorCodes","SSO_ACCOUNT_MISMATCH","SSO_NOT_CONFIGURED","SSO_INPUT_REQUIRED","SSO_NOT_AUTHORIZED","SSO_INCOMPLETE","SSO_FAILED","PASSKEY_NOT_COMPLETED","PASSKEY_SIGNIN_FAILED","AuthErrorIgnore","USER_CANCELLED","REDIRECT_CANCELLED_BY_USER","POPUP_CLOSED_BY_USER","AuthErrorNotice","USER_SIGNED_OUT","CREDENTIAL_TOO_OLD_LOGIN_AGAIN","AuthErrorMessage","general","ADMIN_ONLY_OPERATION","ALREADY_INITIALIZED","ARGUMENT_ERROR","CAPTCHA_CHECK_FAILED","CODE_EXPIRED","CREDENTIAL_ALREADY_IN_USE","CREDENTIAL_MISMATCH","EMAIL_CHANGE_NEEDS_VERIFICATION","EMAIL_EXISTS","EXPIRED_OOB_CODE","EXPIRED_POPUP_REQUEST","INVALID_OOB_CODE","INTERNAL_ERROR","INVALID_API_KEY","INVALID_AUTH","INVALID_AUTH_EVENT","INVALID_CERT_HASH","INVALID_CODE","INVALID_CUSTOM_TOKEN","INVALID_EMAIL","INVALID_IDP_RESPONSE","INVALID_MESSAGE_PAYLOAD","INVALID_MFA_SESSION","INVALID_ORIGIN","INVALID_PASSWORD","INVALID_PHONE_NUMBER","INVALID_RECIPIENT_EMAIL","INVALID_SENDER","INVALID_SESSION_INFO","INVALID_TENANT_ID","MFA_INFO_NOT_FOUND","MFA_REQUIRED","MISSING_CODE","MISSING_OR_INVALID_NONCE","MISSING_PHONE_NUMBER","MODULE_DESTROYED","NEED_CONFIRMATION","NETWORK_REQUEST_FAILED","NULL_USER","POPUP_BLOCKED","PROVIDER_ALREADY_LINKED","QUOTA_EXCEEDED","REJECTED_CREDENTIAL","TENANT_ID_MISMATCH","TIMEOUT","TOKEN_EXPIRED","TOO_MANY_ATTEMPTS_TRY_LATER","UNVERIFIED_EMAIL","USER_DELETED","USER_DISABLED","WEAK_PASSWORD","COOKIE_KEY_USER_TOKEN"],"mappings":"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"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export declare const PACKAGE_VERSION: string;
18
+ export declare const BUILD_ID: string;
19
+ export declare const COMMIT_REF: string;
20
+ export declare const IS_PRODUCTION: boolean;
21
+ export declare const IS_DEVELOPMENT: boolean;
22
+ export declare const IS_TEST: boolean;
23
+ export declare const FIREBASE_FIRESTORE_EMULATOR_ENABLED: boolean;
24
+ export declare const FIREBASE_AUTH_EMULATOR_ENABLED: boolean;
25
+ export declare const FIREBASE_STORAGE_EMULATOR_ENABLED: boolean;
26
+ export declare const FIREBASE_DATABASE_EMULATOR_ENABLED: boolean;
27
+ export declare const AGLYN_SILOED_HOST: string;
28
+ export declare const HAS_WINDOW: () => boolean;
29
+ export declare const HAS_DOCUMENT: () => boolean;
30
+ export declare const HAS_BROWSER: () => boolean;
31
+ export declare const CURRENT_YEAR: number;
32
+ export declare const CURRENT_YEAR_UTC: number;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ export const PACKAGE_VERSION = String(process.env['PACKAGE_VERSION'] || 'NULL');
17
+ export const BUILD_ID = String(process.env['BUILD_ID'] || 'NULL');
18
+ export const COMMIT_REF = String(process.env['COMMIT_REF'] || 'NULL');
19
+ export const IS_PRODUCTION = process.env['NODE_ENV'] === 'production';
20
+ export const IS_DEVELOPMENT = process.env['NODE_ENV'] === 'development';
21
+ export const IS_TEST = process.env['NODE_ENV'] === 'test';
22
+ export const FIREBASE_FIRESTORE_EMULATOR_ENABLED = process.env['FIREBASE_FIRESTORE_EMULATOR_ENABLED'] === 'true';
23
+ export const FIREBASE_AUTH_EMULATOR_ENABLED = process.env['FIREBASE_AUTH_EMULATOR_ENABLED'] === 'true';
24
+ export const FIREBASE_STORAGE_EMULATOR_ENABLED = process.env['FIREBASE_STORAGE_EMULATOR_ENABLED'] === 'true';
25
+ export const FIREBASE_DATABASE_EMULATOR_ENABLED = process.env['FIREBASE_DATABASE_EMULATOR_ENABLED'] === 'true';
26
+ export const AGLYN_SILOED_HOST = String(process.env['AGLYN_SILOED_HOST'] || '');
27
+ export const HAS_WINDOW = ()=>typeof window !== 'undefined';
28
+ export const HAS_DOCUMENT = ()=>typeof document !== 'undefined';
29
+ export const HAS_BROWSER = ()=>typeof process['browser'] !== 'undefined';
30
+ export const CURRENT_YEAR = new Date().getFullYear();
31
+ export const CURRENT_YEAR_UTC = new Date().getUTCFullYear();
32
+
33
+ //# sourceMappingURL=global.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/shared/data/enums/src/lib/global.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nexport const PACKAGE_VERSION = String(process.env['PACKAGE_VERSION'] || 'NULL')\nexport const BUILD_ID = String(process.env['BUILD_ID'] || 'NULL')\nexport const COMMIT_REF = String(process.env['COMMIT_REF'] || 'NULL')\n\nexport const IS_PRODUCTION = process.env['NODE_ENV'] === 'production'\nexport const IS_DEVELOPMENT = process.env['NODE_ENV'] === 'development'\nexport const IS_TEST = process.env['NODE_ENV'] === 'test'\n\nexport const FIREBASE_FIRESTORE_EMULATOR_ENABLED = process.env['FIREBASE_FIRESTORE_EMULATOR_ENABLED'] === 'true'\nexport const FIREBASE_AUTH_EMULATOR_ENABLED = process.env['FIREBASE_AUTH_EMULATOR_ENABLED'] === 'true'\nexport const FIREBASE_STORAGE_EMULATOR_ENABLED = process.env['FIREBASE_STORAGE_EMULATOR_ENABLED'] === 'true'\nexport const FIREBASE_DATABASE_EMULATOR_ENABLED = process.env['FIREBASE_DATABASE_EMULATOR_ENABLED'] === 'true'\n\nexport const AGLYN_SILOED_HOST = String(process.env['AGLYN_SILOED_HOST'] || '')\n\nexport const HAS_WINDOW = () => typeof window !== 'undefined'\nexport const HAS_DOCUMENT = () => typeof document !== 'undefined'\nexport const HAS_BROWSER = () => typeof (process as any)['browser'] !== 'undefined'\n\nexport const CURRENT_YEAR = new Date().getFullYear()\nexport const CURRENT_YEAR_UTC = new Date().getUTCFullYear()\n"],"names":["PACKAGE_VERSION","String","process","env","BUILD_ID","COMMIT_REF","IS_PRODUCTION","IS_DEVELOPMENT","IS_TEST","FIREBASE_FIRESTORE_EMULATOR_ENABLED","FIREBASE_AUTH_EMULATOR_ENABLED","FIREBASE_STORAGE_EMULATOR_ENABLED","FIREBASE_DATABASE_EMULATOR_ENABLED","AGLYN_SILOED_HOST","HAS_WINDOW","window","HAS_DOCUMENT","document","HAS_BROWSER","CURRENT_YEAR","Date","getFullYear","CURRENT_YEAR_UTC","getUTCFullYear"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAGD,OAAO,MAAMA,kBAAkBC,OAAOC,QAAQC,GAAG,CAAC,kBAAkB,IAAI,QAAO;AAC/E,OAAO,MAAMC,WAAWH,OAAOC,QAAQC,GAAG,CAAC,WAAW,IAAI,QAAO;AACjE,OAAO,MAAME,aAAaJ,OAAOC,QAAQC,GAAG,CAAC,aAAa,IAAI,QAAO;AAErE,OAAO,MAAMG,gBAAgBJ,QAAQC,GAAG,CAAC,WAAW,KAAK,aAAY;AACrE,OAAO,MAAMI,iBAAiBL,QAAQC,GAAG,CAAC,WAAW,KAAK,cAAa;AACvE,OAAO,MAAMK,UAAUN,QAAQC,GAAG,CAAC,WAAW,KAAK,OAAM;AAEzD,OAAO,MAAMM,sCAAsCP,QAAQC,GAAG,CAAC,sCAAsC,KAAK,OAAM;AAChH,OAAO,MAAMO,iCAAiCR,QAAQC,GAAG,CAAC,iCAAiC,KAAK,OAAM;AACtG,OAAO,MAAMQ,oCAAoCT,QAAQC,GAAG,CAAC,oCAAoC,KAAK,OAAM;AAC5G,OAAO,MAAMS,qCAAqCV,QAAQC,GAAG,CAAC,qCAAqC,KAAK,OAAM;AAE9G,OAAO,MAAMU,oBAAoBZ,OAAOC,QAAQC,GAAG,CAAC,oBAAoB,IAAI,IAAG;AAE/E,OAAO,MAAMW,aAAa,IAAM,OAAOC,WAAW,YAAW;AAC7D,OAAO,MAAMC,eAAe,IAAM,OAAOC,aAAa,YAAW;AACjE,OAAO,MAAMC,cAAc,IAAM,OAAO,AAAChB,OAAe,CAAC,UAAU,KAAK,YAAW;AAEnF,OAAO,MAAMiB,eAAe,IAAIC,OAAOC,WAAW,GAAE;AACpD,OAAO,MAAMC,mBAAmB,IAAIF,OAAOG,cAAc,GAAE"}
@@ -0,0 +1,145 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export declare enum HttpStatusCode {
18
+ OK = 200,
19
+ _200 = 200,
20
+ CREATED = 201,
21
+ _201 = 201,
22
+ ACCEPTED = 202,
23
+ _202 = 202,
24
+ NO_CONTENT = 204,
25
+ _204 = 204,
26
+ MOVED_PERMANENTLY = 301,
27
+ _301 = 301,
28
+ FOUND = 302,
29
+ _302 = 302,
30
+ SEE_OTHER = 303,
31
+ _303 = 303,
32
+ NOT_MODIFIED = 304,
33
+ _304 = 304,
34
+ TEMPORARY_REDIRECT = 307,
35
+ _307 = 307,
36
+ PERMANENT_REDIRECT = 308,
37
+ _308 = 308,
38
+ BAD_REQUEST = 400,
39
+ _400 = 400,
40
+ UNAUTHORIZED = 401,
41
+ _401 = 401,
42
+ PAYMENT_REQUIRED = 402,
43
+ _402 = 402,
44
+ FORBIDDEN = 403,
45
+ _403 = 403,
46
+ NOT_FOUND = 404,
47
+ _404 = 404,
48
+ METHOD_NOT_ALLOWED = 405,
49
+ _405 = 405,
50
+ NOT_ACCEPTABLE = 406,
51
+ _406 = 406,
52
+ PROXY_AUTHENTICATION_REQUIRED = 407,
53
+ _407 = 407,
54
+ REQUEST_TIMEOUT = 408,
55
+ _408 = 408,
56
+ CONFLICT = 409,
57
+ _409 = 409,
58
+ GONE = 410,
59
+ _410 = 410,
60
+ LENGTH_REQUIRED = 411,
61
+ _411 = 411,
62
+ PRECONDITION_FAILED = 412,
63
+ _412 = 412,
64
+ PAYLOAD_TOO_LARGE = 413,
65
+ _413 = 413,
66
+ URI_TOO_LONG = 414,
67
+ _414 = 414,
68
+ UNSUPPORTED_MEDIA_TYPE = 415,
69
+ _415 = 415,
70
+ RANGE_NOT_SATISFIABLE = 416,
71
+ _416 = 416,
72
+ EXPECTATION_FAILED = 417,
73
+ _417 = 417,
74
+ TOO_MANY_REQUESTS = 429,
75
+ _429 = 429,
76
+ REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
77
+ _431 = 431,
78
+ INTERNAL_SERVER_ERROR = 500,
79
+ _500 = 500,
80
+ NOT_IMPLEMENTED = 501,
81
+ _501 = 501,
82
+ BAD_GATEWAY = 502,
83
+ _502 = 502,
84
+ SERVICE_UNAVAILABLE = 503,
85
+ _503 = 503,
86
+ GATEWAY_TIMEOUT = 504,
87
+ _504 = 504,
88
+ HTTP_VERSION_NOT_SUPPORTED = 505,
89
+ _505 = 505,
90
+ INSUFFICIENT_STORAGE = 507,
91
+ _507 = 507,
92
+ LOOP_DETECTED = 508,
93
+ _508 = 508,
94
+ NOT_EXTENDED = 510,
95
+ _510 = 510,
96
+ NETWORK_AUTHENTICATION_REQUIRED = 511,
97
+ _511 = 511
98
+ }
99
+ export declare enum HttpRequestMethod {
100
+ CONNECT = "CONNECT",
101
+ DELETE = "DELETE",
102
+ GET = "GET",
103
+ HEAD = "HEAD",
104
+ OPTIONS = "OPTIONS",
105
+ PATCH = "PATCH",
106
+ POST = "POST",
107
+ PUT = "PUT",
108
+ TRACE = "TRACE"
109
+ }
110
+ export declare enum HttpResponseStatus {
111
+ SUCCESS = "success",
112
+ ERROR = "error"
113
+ }
114
+ export declare enum HttpRefCodeSimple {
115
+ SERVER_ERROR = "Internal server error",
116
+ INVALID_REQUEST = "Unknown or invalid request",
117
+ NOT_AUTHENTICATED = "Missing required authentication",
118
+ NOT_AUTHORIZED = "Missing required permissions",
119
+ TOO_MANY_REQUESTS = "Too many subsequent requests",
120
+ METHOD_NOT_ALLOWED = "Request method not allowed",
121
+ RESOURCE_NOT_FOUND = "Asset or resource not found",
122
+ FAILED_SECURITY = "Failed security requirements",
123
+ FAILED_CLIENT_MODIFY = "Failed to modify client"
124
+ }
125
+ export declare enum HttpRefCodeSubject {
126
+ SYSTEM_DOWN = "system-down",
127
+ NOT_AUTHORIZED = "not-authorized",
128
+ NOT_AUTHENTICATED = "not-authenticated",
129
+ BAD_REQUEST = "bad-request",
130
+ INVALID_REQUEST = "invalid-request",
131
+ TOO_MANY_REQUEST = "too-many-requests"
132
+ }
133
+ export declare enum HttpRefCodeTopic {
134
+ UNKNOWN = "unknown",
135
+ NOT_FOUND = "not-found",
136
+ SERVER_ERROR = "internal-server-error",
137
+ FAILED_REQUIREMENTS = "failed-requirements",
138
+ MISSING_HEADER = "missing-required-header",
139
+ FAIL_ID_TOKEN_CHECK = "id-token-verification-failed",
140
+ CREATE_SESSION_COOKIE = "create-session-cookie",
141
+ RATE_LIMIT_EXCEEDED = "rate-limit-exceeded",
142
+ METHOD_NOT_ALLOWED = "method-not-allowed"
143
+ }
144
+ export type HttpRefCode = `${HttpRefCodeSimple} (${HttpRefCodeSubject}/${HttpRefCodeTopic})`;
145
+ export declare const createHttpRefCode: (simple: HttpRefCodeSimple, subject: HttpRefCodeSubject, topic: HttpRefCodeTopic) => HttpRefCode;
@@ -0,0 +1,155 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ export var HttpStatusCode = /*#__PURE__*/ function(HttpStatusCode) {
17
+ // SUCCESS
18
+ HttpStatusCode[HttpStatusCode["OK"] = 200] = "OK";
19
+ HttpStatusCode[HttpStatusCode["_200"] = 200] = "_200";
20
+ HttpStatusCode[HttpStatusCode["CREATED"] = 201] = "CREATED";
21
+ HttpStatusCode[HttpStatusCode["_201"] = 201] = "_201";
22
+ HttpStatusCode[HttpStatusCode["ACCEPTED"] = 202] = "ACCEPTED";
23
+ HttpStatusCode[HttpStatusCode["_202"] = 202] = "_202";
24
+ HttpStatusCode[HttpStatusCode["NO_CONTENT"] = 204] = "NO_CONTENT";
25
+ HttpStatusCode[HttpStatusCode["_204"] = 204] = "_204";
26
+ // REDIRECTS
27
+ HttpStatusCode[HttpStatusCode["MOVED_PERMANENTLY"] = 301] = "MOVED_PERMANENTLY";
28
+ HttpStatusCode[HttpStatusCode["_301"] = 301] = "_301";
29
+ HttpStatusCode[HttpStatusCode["FOUND"] = 302] = "FOUND";
30
+ HttpStatusCode[HttpStatusCode["_302"] = 302] = "_302";
31
+ HttpStatusCode[HttpStatusCode["SEE_OTHER"] = 303] = "SEE_OTHER";
32
+ HttpStatusCode[HttpStatusCode["_303"] = 303] = "_303";
33
+ HttpStatusCode[HttpStatusCode["NOT_MODIFIED"] = 304] = "NOT_MODIFIED";
34
+ HttpStatusCode[HttpStatusCode["_304"] = 304] = "_304";
35
+ HttpStatusCode[HttpStatusCode["TEMPORARY_REDIRECT"] = 307] = "TEMPORARY_REDIRECT";
36
+ HttpStatusCode[HttpStatusCode["_307"] = 307] = "_307";
37
+ HttpStatusCode[HttpStatusCode["PERMANENT_REDIRECT"] = 308] = "PERMANENT_REDIRECT";
38
+ HttpStatusCode[HttpStatusCode["_308"] = 308] = "_308";
39
+ // ERRORS - CLIENT
40
+ HttpStatusCode[HttpStatusCode["BAD_REQUEST"] = 400] = "BAD_REQUEST";
41
+ HttpStatusCode[HttpStatusCode["_400"] = 400] = "_400";
42
+ HttpStatusCode[HttpStatusCode["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
43
+ HttpStatusCode[HttpStatusCode["_401"] = 401] = "_401";
44
+ HttpStatusCode[HttpStatusCode["PAYMENT_REQUIRED"] = 402] = "PAYMENT_REQUIRED";
45
+ HttpStatusCode[HttpStatusCode["_402"] = 402] = "_402";
46
+ HttpStatusCode[HttpStatusCode["FORBIDDEN"] = 403] = "FORBIDDEN";
47
+ HttpStatusCode[HttpStatusCode["_403"] = 403] = "_403";
48
+ HttpStatusCode[HttpStatusCode["NOT_FOUND"] = 404] = "NOT_FOUND";
49
+ HttpStatusCode[HttpStatusCode["_404"] = 404] = "_404";
50
+ HttpStatusCode[HttpStatusCode["METHOD_NOT_ALLOWED"] = 405] = "METHOD_NOT_ALLOWED";
51
+ HttpStatusCode[HttpStatusCode["_405"] = 405] = "_405";
52
+ HttpStatusCode[HttpStatusCode["NOT_ACCEPTABLE"] = 406] = "NOT_ACCEPTABLE";
53
+ HttpStatusCode[HttpStatusCode["_406"] = 406] = "_406";
54
+ HttpStatusCode[HttpStatusCode["PROXY_AUTHENTICATION_REQUIRED"] = 407] = "PROXY_AUTHENTICATION_REQUIRED";
55
+ HttpStatusCode[HttpStatusCode["_407"] = 407] = "_407";
56
+ HttpStatusCode[HttpStatusCode["REQUEST_TIMEOUT"] = 408] = "REQUEST_TIMEOUT";
57
+ HttpStatusCode[HttpStatusCode["_408"] = 408] = "_408";
58
+ HttpStatusCode[HttpStatusCode["CONFLICT"] = 409] = "CONFLICT";
59
+ HttpStatusCode[HttpStatusCode["_409"] = 409] = "_409";
60
+ HttpStatusCode[HttpStatusCode["GONE"] = 410] = "GONE";
61
+ HttpStatusCode[HttpStatusCode["_410"] = 410] = "_410";
62
+ HttpStatusCode[HttpStatusCode["LENGTH_REQUIRED"] = 411] = "LENGTH_REQUIRED";
63
+ HttpStatusCode[HttpStatusCode["_411"] = 411] = "_411";
64
+ HttpStatusCode[HttpStatusCode["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
65
+ HttpStatusCode[HttpStatusCode["_412"] = 412] = "_412";
66
+ HttpStatusCode[HttpStatusCode["PAYLOAD_TOO_LARGE"] = 413] = "PAYLOAD_TOO_LARGE";
67
+ HttpStatusCode[HttpStatusCode["_413"] = 413] = "_413";
68
+ HttpStatusCode[HttpStatusCode["URI_TOO_LONG"] = 414] = "URI_TOO_LONG";
69
+ HttpStatusCode[HttpStatusCode["_414"] = 414] = "_414";
70
+ HttpStatusCode[HttpStatusCode["UNSUPPORTED_MEDIA_TYPE"] = 415] = "UNSUPPORTED_MEDIA_TYPE";
71
+ HttpStatusCode[HttpStatusCode["_415"] = 415] = "_415";
72
+ HttpStatusCode[HttpStatusCode["RANGE_NOT_SATISFIABLE"] = 416] = "RANGE_NOT_SATISFIABLE";
73
+ HttpStatusCode[HttpStatusCode["_416"] = 416] = "_416";
74
+ HttpStatusCode[HttpStatusCode["EXPECTATION_FAILED"] = 417] = "EXPECTATION_FAILED";
75
+ HttpStatusCode[HttpStatusCode["_417"] = 417] = "_417";
76
+ HttpStatusCode[HttpStatusCode["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
77
+ HttpStatusCode[HttpStatusCode["_429"] = 429] = "_429";
78
+ HttpStatusCode[HttpStatusCode["REQUEST_HEADER_FIELDS_TOO_LARGE"] = 431] = "REQUEST_HEADER_FIELDS_TOO_LARGE";
79
+ HttpStatusCode[HttpStatusCode["_431"] = 431] = "_431";
80
+ // ERRORS - SERVER
81
+ HttpStatusCode[HttpStatusCode["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
82
+ HttpStatusCode[HttpStatusCode["_500"] = 500] = "_500";
83
+ HttpStatusCode[HttpStatusCode["NOT_IMPLEMENTED"] = 501] = "NOT_IMPLEMENTED";
84
+ HttpStatusCode[HttpStatusCode["_501"] = 501] = "_501";
85
+ HttpStatusCode[HttpStatusCode["BAD_GATEWAY"] = 502] = "BAD_GATEWAY";
86
+ HttpStatusCode[HttpStatusCode["_502"] = 502] = "_502";
87
+ HttpStatusCode[HttpStatusCode["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
88
+ HttpStatusCode[HttpStatusCode["_503"] = 503] = "_503";
89
+ HttpStatusCode[HttpStatusCode["GATEWAY_TIMEOUT"] = 504] = "GATEWAY_TIMEOUT";
90
+ HttpStatusCode[HttpStatusCode["_504"] = 504] = "_504";
91
+ HttpStatusCode[HttpStatusCode["HTTP_VERSION_NOT_SUPPORTED"] = 505] = "HTTP_VERSION_NOT_SUPPORTED";
92
+ HttpStatusCode[HttpStatusCode["_505"] = 505] = "_505";
93
+ HttpStatusCode[HttpStatusCode["INSUFFICIENT_STORAGE"] = 507] = "INSUFFICIENT_STORAGE";
94
+ HttpStatusCode[HttpStatusCode["_507"] = 507] = "_507";
95
+ HttpStatusCode[HttpStatusCode["LOOP_DETECTED"] = 508] = "LOOP_DETECTED";
96
+ HttpStatusCode[HttpStatusCode["_508"] = 508] = "_508";
97
+ HttpStatusCode[HttpStatusCode["NOT_EXTENDED"] = 510] = "NOT_EXTENDED";
98
+ HttpStatusCode[HttpStatusCode["_510"] = 510] = "_510";
99
+ HttpStatusCode[HttpStatusCode["NETWORK_AUTHENTICATION_REQUIRED"] = 511] = "NETWORK_AUTHENTICATION_REQUIRED";
100
+ HttpStatusCode[HttpStatusCode["_511"] = 511] = "_511";
101
+ return HttpStatusCode;
102
+ }({});
103
+ export var HttpRequestMethod = /*#__PURE__*/ function(HttpRequestMethod) {
104
+ HttpRequestMethod["CONNECT"] = "CONNECT";
105
+ HttpRequestMethod["DELETE"] = "DELETE";
106
+ HttpRequestMethod["GET"] = "GET";
107
+ HttpRequestMethod["HEAD"] = "HEAD";
108
+ HttpRequestMethod["OPTIONS"] = "OPTIONS";
109
+ HttpRequestMethod["PATCH"] = "PATCH";
110
+ HttpRequestMethod["POST"] = "POST";
111
+ HttpRequestMethod["PUT"] = "PUT";
112
+ HttpRequestMethod["TRACE"] = "TRACE";
113
+ return HttpRequestMethod;
114
+ }({});
115
+ export var HttpResponseStatus = /*#__PURE__*/ function(HttpResponseStatus) {
116
+ HttpResponseStatus["SUCCESS"] = "success";
117
+ HttpResponseStatus["ERROR"] = "error";
118
+ return HttpResponseStatus;
119
+ }({});
120
+ export var HttpRefCodeSimple = /*#__PURE__*/ function(HttpRefCodeSimple) {
121
+ HttpRefCodeSimple["SERVER_ERROR"] = "Internal server error";
122
+ HttpRefCodeSimple["INVALID_REQUEST"] = "Unknown or invalid request";
123
+ HttpRefCodeSimple["NOT_AUTHENTICATED"] = "Missing required authentication";
124
+ HttpRefCodeSimple["NOT_AUTHORIZED"] = "Missing required permissions";
125
+ HttpRefCodeSimple["TOO_MANY_REQUESTS"] = "Too many subsequent requests";
126
+ HttpRefCodeSimple["METHOD_NOT_ALLOWED"] = "Request method not allowed";
127
+ HttpRefCodeSimple["RESOURCE_NOT_FOUND"] = "Asset or resource not found";
128
+ HttpRefCodeSimple["FAILED_SECURITY"] = "Failed security requirements";
129
+ HttpRefCodeSimple["FAILED_CLIENT_MODIFY"] = "Failed to modify client";
130
+ return HttpRefCodeSimple;
131
+ }({});
132
+ export var HttpRefCodeSubject = /*#__PURE__*/ function(HttpRefCodeSubject) {
133
+ HttpRefCodeSubject["SYSTEM_DOWN"] = "system-down";
134
+ HttpRefCodeSubject["NOT_AUTHORIZED"] = "not-authorized";
135
+ HttpRefCodeSubject["NOT_AUTHENTICATED"] = "not-authenticated";
136
+ HttpRefCodeSubject["BAD_REQUEST"] = "bad-request";
137
+ HttpRefCodeSubject["INVALID_REQUEST"] = "invalid-request";
138
+ HttpRefCodeSubject["TOO_MANY_REQUEST"] = "too-many-requests";
139
+ return HttpRefCodeSubject;
140
+ }({});
141
+ export var HttpRefCodeTopic = /*#__PURE__*/ function(HttpRefCodeTopic) {
142
+ HttpRefCodeTopic["UNKNOWN"] = "unknown";
143
+ HttpRefCodeTopic["NOT_FOUND"] = "not-found";
144
+ HttpRefCodeTopic["SERVER_ERROR"] = "internal-server-error";
145
+ HttpRefCodeTopic["FAILED_REQUIREMENTS"] = "failed-requirements";
146
+ HttpRefCodeTopic["MISSING_HEADER"] = "missing-required-header";
147
+ HttpRefCodeTopic["FAIL_ID_TOKEN_CHECK"] = "id-token-verification-failed";
148
+ HttpRefCodeTopic["CREATE_SESSION_COOKIE"] = "create-session-cookie";
149
+ HttpRefCodeTopic["RATE_LIMIT_EXCEEDED"] = "rate-limit-exceeded";
150
+ HttpRefCodeTopic["METHOD_NOT_ALLOWED"] = "method-not-allowed";
151
+ return HttpRefCodeTopic;
152
+ }({});
153
+ export const createHttpRefCode = (simple, subject, topic)=>`${simple} (${subject}/${topic})`;
154
+
155
+ //# sourceMappingURL=http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/shared/data/enums/src/lib/http.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport enum HttpStatusCode {\n // SUCCESS\n OK = 200,\n _200 = OK,\n CREATED = 201,\n _201 = CREATED,\n ACCEPTED = 202,\n _202 = ACCEPTED,\n NO_CONTENT = 204,\n _204 = NO_CONTENT,\n\n // REDIRECTS\n MOVED_PERMANENTLY = 301,\n _301 = MOVED_PERMANENTLY,\n FOUND = 302,\n _302 = FOUND,\n SEE_OTHER = 303,\n _303 = SEE_OTHER,\n NOT_MODIFIED = 304,\n _304 = NOT_MODIFIED,\n TEMPORARY_REDIRECT = 307,\n _307 = TEMPORARY_REDIRECT,\n PERMANENT_REDIRECT = 308,\n _308 = PERMANENT_REDIRECT,\n\n // ERRORS - CLIENT\n BAD_REQUEST = 400,\n _400 = BAD_REQUEST,\n UNAUTHORIZED = 401,\n _401 = UNAUTHORIZED,\n PAYMENT_REQUIRED = 402,\n _402 = PAYMENT_REQUIRED,\n FORBIDDEN = 403,\n _403 = FORBIDDEN,\n NOT_FOUND = 404,\n _404 = NOT_FOUND,\n METHOD_NOT_ALLOWED = 405,\n _405 = METHOD_NOT_ALLOWED,\n NOT_ACCEPTABLE = 406,\n _406 = NOT_ACCEPTABLE,\n PROXY_AUTHENTICATION_REQUIRED = 407,\n _407 = PROXY_AUTHENTICATION_REQUIRED,\n REQUEST_TIMEOUT = 408,\n _408 = REQUEST_TIMEOUT,\n CONFLICT = 409,\n _409 = CONFLICT,\n GONE = 410,\n _410 = GONE,\n LENGTH_REQUIRED = 411,\n _411 = LENGTH_REQUIRED,\n PRECONDITION_FAILED = 412,\n _412 = PRECONDITION_FAILED,\n PAYLOAD_TOO_LARGE = 413,\n _413 = PAYLOAD_TOO_LARGE,\n URI_TOO_LONG = 414,\n _414 = URI_TOO_LONG,\n UNSUPPORTED_MEDIA_TYPE = 415,\n _415 = UNSUPPORTED_MEDIA_TYPE,\n RANGE_NOT_SATISFIABLE = 416,\n _416 = RANGE_NOT_SATISFIABLE,\n EXPECTATION_FAILED = 417,\n _417 = EXPECTATION_FAILED,\n TOO_MANY_REQUESTS = 429,\n _429 = TOO_MANY_REQUESTS,\n REQUEST_HEADER_FIELDS_TOO_LARGE = 431,\n _431 = REQUEST_HEADER_FIELDS_TOO_LARGE,\n\n // ERRORS - SERVER\n INTERNAL_SERVER_ERROR = 500,\n _500 = INTERNAL_SERVER_ERROR,\n NOT_IMPLEMENTED = 501,\n _501 = NOT_IMPLEMENTED,\n BAD_GATEWAY = 502,\n _502 = BAD_GATEWAY,\n SERVICE_UNAVAILABLE = 503,\n _503 = SERVICE_UNAVAILABLE,\n GATEWAY_TIMEOUT = 504,\n _504 = GATEWAY_TIMEOUT,\n HTTP_VERSION_NOT_SUPPORTED = 505,\n _505 = HTTP_VERSION_NOT_SUPPORTED,\n INSUFFICIENT_STORAGE = 507,\n _507 = INSUFFICIENT_STORAGE,\n LOOP_DETECTED = 508,\n _508 = LOOP_DETECTED,\n NOT_EXTENDED = 510,\n _510 = NOT_EXTENDED,\n NETWORK_AUTHENTICATION_REQUIRED = 511,\n _511 = NETWORK_AUTHENTICATION_REQUIRED,\n\n}\n\nexport enum HttpRequestMethod {\n CONNECT = 'CONNECT',\n DELETE = 'DELETE',\n GET = 'GET',\n HEAD = 'HEAD',\n OPTIONS = 'OPTIONS',\n PATCH = 'PATCH',\n POST = 'POST',\n PUT = 'PUT',\n TRACE = 'TRACE',\n}\n\nexport enum HttpResponseStatus {\n SUCCESS = 'success',\n ERROR = 'error'\n}\n\nexport enum HttpRefCodeSimple {\n SERVER_ERROR = 'Internal server error',\n INVALID_REQUEST = 'Unknown or invalid request',\n NOT_AUTHENTICATED = 'Missing required authentication',\n NOT_AUTHORIZED = 'Missing required permissions',\n TOO_MANY_REQUESTS = 'Too many subsequent requests',\n METHOD_NOT_ALLOWED = 'Request method not allowed',\n RESOURCE_NOT_FOUND = 'Asset or resource not found',\n FAILED_SECURITY = 'Failed security requirements',\n FAILED_CLIENT_MODIFY = 'Failed to modify client',\n}\n\nexport enum HttpRefCodeSubject {\n SYSTEM_DOWN = 'system-down',\n NOT_AUTHORIZED = 'not-authorized',\n NOT_AUTHENTICATED = 'not-authenticated',\n BAD_REQUEST = 'bad-request',\n INVALID_REQUEST = 'invalid-request',\n TOO_MANY_REQUEST = 'too-many-requests',\n}\n\nexport enum HttpRefCodeTopic {\n UNKNOWN = 'unknown',\n NOT_FOUND = 'not-found',\n SERVER_ERROR = 'internal-server-error',\n FAILED_REQUIREMENTS = 'failed-requirements',\n MISSING_HEADER = 'missing-required-header',\n FAIL_ID_TOKEN_CHECK = 'id-token-verification-failed',\n CREATE_SESSION_COOKIE = 'create-session-cookie',\n RATE_LIMIT_EXCEEDED = 'rate-limit-exceeded',\n METHOD_NOT_ALLOWED = 'method-not-allowed',\n}\n\nexport type HttpRefCode = `${HttpRefCodeSimple} (${HttpRefCodeSubject}/${HttpRefCodeTopic})`\n\nexport const createHttpRefCode = (\n simple: HttpRefCodeSimple,\n subject: HttpRefCodeSubject,\n topic: HttpRefCodeTopic,\n): HttpRefCode => `${simple} (${subject}/${topic})`\n"],"names":["HttpStatusCode","HttpRequestMethod","HttpResponseStatus","HttpRefCodeSimple","HttpRefCodeSubject","HttpRefCodeTopic","createHttpRefCode","simple","subject","topic"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,OAAO,IAAA,AAAKA,wCAAAA;IACV,UAAU;0CACL;4CAAA;+CAEK;4CAAA;gDAEC;4CAAA;kDAEE;4CAAA;IAGb,YAAY;yDACQ;4CAAA;6CAEZ;4CAAA;iDAEI;4CAAA;oDAEG;4CAAA;0DAEM;4CAAA;0DAEA;4CAAA;IAGrB,kBAAkB;mDACJ;4CAAA;oDAEC;4CAAA;wDAEI;4CAAA;iDAEP;4CAAA;iDAEA;4CAAA;0DAES;4CAAA;sDAEJ;4CAAA;qEAEe;4CAAA;uDAEd;4CAAA;gDAEP;4CAAA;4CAEJ;4CAAA;uDAEW;4CAAA;2DAEI;4CAAA;yDAEF;4CAAA;oDAEL;4CAAA;8DAEU;4CAAA;6DAED;4CAAA;0DAEH;4CAAA;yDAED;4CAAA;uEAEc;4CAAA;IAGlC,kBAAkB;6DACM;4CAAA;uDAEN;4CAAA;mDAEJ;4CAAA;2DAEQ;4CAAA;uDAEJ;4CAAA;kEAEW;4CAAA;4DAEN;4CAAA;qDAEP;4CAAA;oDAED;4CAAA;uEAEmB;4CAAA;WAtFxBA;MAyFX;AAED,OAAO,IAAA,AAAKC,2CAAAA;;;;;;;;;;WAAAA;MAUX;AAED,OAAO,IAAA,AAAKC,4CAAAA;;;WAAAA;MAGX;AAED,OAAO,IAAA,AAAKC,2CAAAA;;;;;;;;;;WAAAA;MAUX;AAED,OAAO,IAAA,AAAKC,4CAAAA;;;;;;;WAAAA;MAOX;AAED,OAAO,IAAA,AAAKC,0CAAAA;;;;;;;;;;WAAAA;MAUX;AAID,OAAO,MAAMC,oBAAoB,CAC/BC,QACAC,SACAC,QACgB,GAAGF,OAAO,EAAE,EAAEC,QAAQ,CAAC,EAAEC,MAAM,CAAC,CAAC,CAAA"}