@medplum/react 0.9.26 → 0.9.27

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.
@@ -37,9 +37,9 @@ function getGoogleClientId(clientId) {
37
37
  return clientId;
38
38
  }
39
39
  const origin = window.location.protocol + '//' + window.location.host;
40
- const authorizedOrigins = (_b = (_a = "http://localhost:3000,http://localhost:6006,https://app.medplum.com,https://docs.medplum.com") === null || _a === void 0 ? void 0 : _a.split(',')) !== null && _b !== void 0 ? _b : [];
40
+ const authorizedOrigins = (_b = (_a = "undefined") === null || _a === void 0 ? void 0 : _a.split(',')) !== null && _b !== void 0 ? _b : [];
41
41
  if (authorizedOrigins.includes(origin)) {
42
- return "921088377005-3j1sa10vr6hj86jgmdfh2l53v3mp7lfi.apps.googleusercontent.com";
42
+ return "undefined";
43
43
  }
44
44
  return undefined;
45
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleButton.js","sources":["../../src/GoogleButton.tsx"],"sourcesContent":["import { GoogleCredentialResponse } from '@medplum/core';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { useMedplum } from './MedplumProvider';\nimport { createScriptTag } from './utils';\n\ninterface GoogleApi {\n accounts: {\n id: {\n initialize: (args: any) => void;\n renderButton: (parent: HTMLElement, args: any) => void;\n };\n };\n}\n\ndeclare const google: GoogleApi;\n\nexport interface GoogleButtonProps {\n readonly googleClientId?: string;\n readonly handleGoogleCredential: (response: GoogleCredentialResponse) => void;\n}\n\nexport function GoogleButton(props: GoogleButtonProps): JSX.Element | null {\n const medplum = useMedplum();\n const { googleClientId, handleGoogleCredential } = props;\n const parentRef = useRef<HTMLDivElement>(null);\n const [scriptLoaded, setScriptLoaded] = useState<boolean>(typeof google !== 'undefined');\n const [initialized, setInitialized] = useState<boolean>(false);\n const [buttonRendered, setButtonRendered] = useState<boolean>(false);\n\n useEffect(() => {\n if (typeof google === 'undefined') {\n createScriptTag('https://accounts.google.com/gsi/client', () => setScriptLoaded(true));\n return;\n }\n\n if (!initialized) {\n google.accounts.id.initialize({\n client_id: googleClientId,\n callback: handleGoogleCredential,\n });\n setInitialized(true);\n }\n\n if (parentRef.current && !buttonRendered) {\n google.accounts.id.renderButton(parentRef.current, {});\n setButtonRendered(true);\n }\n }, [medplum, googleClientId, initialized, scriptLoaded, parentRef, buttonRendered, handleGoogleCredential]);\n\n if (!googleClientId) {\n return null;\n }\n\n return <div ref={parentRef} />;\n}\n\nexport function getGoogleClientId(clientId: string | undefined): string | undefined {\n if (clientId) {\n return clientId;\n }\n\n const origin = window.location.protocol + '//' + window.location.host;\n const authorizedOrigins = process.env.GOOGLE_AUTH_ORIGINS?.split(',') ?? [];\n if (authorizedOrigins.includes(origin)) {\n return process.env.GOOGLE_CLIENT_ID;\n }\n\n return undefined;\n}\n"],"names":[],"mappings":";;;;AAqBM,SAAU,YAAY,CAAC,KAAwB,EAAA;AACnD,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;AAC7B,IAAA,MAAM,EAAE,cAAc,EAAE,sBAAsB,EAAE,GAAG,KAAK,CAAC;AACzD,IAAA,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;AAC/C,IAAA,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAU,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC;IACzF,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IAC/D,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IAErE,SAAS,CAAC,MAAK;AACb,QAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;YACjC,eAAe,CAAC,wCAAwC,EAAE,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;YACvF,OAAO;AACR,SAAA;QAED,IAAI,CAAC,WAAW,EAAE;AAChB,YAAA,MAAM,CAAC,QAAQ,C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AAA,OAAO,0EAA4B,CAAC;AACrC,KAAA;AAED,IAAA,OAAO,SAAS,CAAC;AACnB;;;;"}
1
+ {"version":3,"file":"GoogleButton.js","sources":["../../src/GoogleButton.tsx"],"sourcesContent":["import { GoogleCredentialResponse } from '@medplum/core';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { useMedplum } from './MedplumProvider';\nimport { createScriptTag } from './utils';\n\ninterface GoogleApi {\n accounts: {\n id: {\n initialize: (args: any) => void;\n renderButton: (parent: HTMLElement, args: any) => void;\n };\n };\n}\n\ndeclare const google: GoogleApi;\n\nexport interface GoogleButtonProps {\n readonly googleClientId?: string;\n readonly handleGoogleCredential: (response: GoogleCredentialResponse) => void;\n}\n\nexport function GoogleButton(props: GoogleButtonProps): JSX.Element | null {\n const medplum = useMedplum();\n const { googleClientId, handleGoogleCredential } = props;\n const parentRef = useRef<HTMLDivElement>(null);\n const [scriptLoaded, setScriptLoaded] = useState<boolean>(typeof google !== 'undefined');\n const [initialized, setInitialized] = useState<boolean>(false);\n const [buttonRendered, setButtonRendered] = useState<boolean>(false);\n\n useEffect(() => {\n if (typeof google === 'undefined') {\n createScriptTag('https://accounts.google.com/gsi/client', () => setScriptLoaded(true));\n return;\n }\n\n if (!initialized) {\n google.accounts.id.initialize({\n client_id: googleClientId,\n callback: handleGoogleCredential,\n });\n setInitialized(true);\n }\n\n if (parentRef.current && !buttonRendered) {\n google.accounts.id.renderButton(parentRef.current, {});\n setButtonRendered(true);\n }\n }, [medplum, googleClientId, initialized, scriptLoaded, parentRef, buttonRendered, handleGoogleCredential]);\n\n if (!googleClientId) {\n return null;\n }\n\n return <div ref={parentRef} />;\n}\n\nexport function getGoogleClientId(clientId: string | undefined): string | undefined {\n if (clientId) {\n return clientId;\n }\n\n const origin = window.location.protocol + '//' + window.location.host;\n const authorizedOrigins = process.env.GOOGLE_AUTH_ORIGINS?.split(',') ?? [];\n if (authorizedOrigins.includes(origin)) {\n return process.env.GOOGLE_CLIENT_ID;\n }\n\n return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C,CAAC,CAAC;IAE5G,IAAI,CAAC,cAAc,EAAE;AACnB,QAAA,OAAO,IAAI,CAAC;AACb,KAAA;AAED,IAAA,OAAO,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,GAAG,EAAE,SAAS,GAAI,CAAC;AACjC,CAAC;AAEK,SAAU,iBAAiB,CAAC,QAA4B,EAAA;;AAC5D,IAAA,IAAI,QAAQ,EAAE;AACZ,QAAA,OAAO,QAAQ,CAAC;AACjB,KAAA;AAED,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,GAAG,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;AACtE,IAAA,MAAM,iBAAiB,GAAG,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,WAA+B,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,KAAK,CAAC,GAAG,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,EAAE,CAAC;AAC5E,IAAA,IAAI,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AACtC,QAAA,OAAO,WAA4B,CAAC;AACrC,KAAA;AAED,IAAA,OAAO,SAAS,CAAC;AACnB;;;;"}
@@ -40,7 +40,17 @@ function RegisterForm(props) {
40
40
  React.createElement(Form, { style: { maxWidth: 400 }, onSubmit: (formData) => __awaiter(this, void 0, void 0, function* () {
41
41
  try {
42
42
  const recaptchaToken = yield getRecaptcha(recaptchaSiteKey);
43
- const registerRequest = Object.assign(Object.assign({}, formData), { recaptchaToken });
43
+ const registerRequest = {
44
+ projectId: props.projectId,
45
+ projectName: formData.projectName,
46
+ firstName: formData.firstName,
47
+ lastName: formData.lastName,
48
+ email: formData.email,
49
+ password: formData.password,
50
+ remember: formData.remember === 'true',
51
+ recaptchaSiteKey,
52
+ recaptchaToken,
53
+ };
44
54
  const userLogin = yield medplum.startNewUser(registerRequest);
45
55
  handleAuthResponse(registerRequest, userLogin);
46
56
  }
@@ -64,6 +74,7 @@ function RegisterForm(props) {
64
74
  const userLogin = yield medplum.startGoogleLogin(loginRequest);
65
75
  const googleClaims = parseJWTPayload(loginRequest.googleCredential);
66
76
  const registerRequest = {
77
+ projectId: props.projectId,
67
78
  firstName: googleClaims.given_name,
68
79
  lastName: googleClaims.family_name,
69
80
  email: googleClaims.email,
@@ -1 +1 @@
1
- {"version":3,"file":"RegisterForm.js","sources":["../../src/RegisterForm.tsx"],"sourcesContent":["import { GoogleCredentialResponse, LoginAuthenticationResponse, parseJWTPayload, RegisterRequest } from '@medplum/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport React, { useEffect, useState } from 'react';\nimport { Button } from './Button';\nimport { Document } from './Document';\nimport { Form } from './Form';\nimport { FormSection } from './FormSection';\nimport { getGoogleClientId, GoogleButton } from './GoogleButton';\nimport { Input } from './Input';\nimport { useMedplum } from './MedplumProvider';\nimport { getIssuesForExpression } from './utils/outcomes';\nimport { getRecaptcha, initRecaptcha } from './utils/recaptcha';\nimport './SignInForm.css';\nimport './util.css';\n\nexport interface BaseRegisterFormProps {\n readonly googleClientId?: string;\n readonly recaptchaSiteKey: string;\n readonly children?: React.ReactNode;\n readonly onSuccess: () => void;\n}\n\nexport interface PatientRegisterFormProps extends BaseRegisterFormProps {\n readonly type: 'patient';\n readonly projectId: string;\n}\n\nexport interface ProjectRegisterFormProps extends BaseRegisterFormProps {\n readonly type: 'project';\n}\n\nexport type RegisterFormProps = PatientRegisterFormProps | ProjectRegisterFormProps;\n\nexport function RegisterForm(props: RegisterFormProps): JSX.Element {\n const medplum = useMedplum();\n const googleClientId = getGoogleClientId(props.googleClientId);\n const recaptchaSiteKey = props.recaptchaSiteKey;\n const [outcome, setOutcome] = useState<OperationOutcome>();\n const issues = getIssuesForExpression(outcome, undefined);\n\n useEffect(() => initRecaptcha(recaptchaSiteKey), [recaptchaSiteKey]);\n\n async function handleAuthResponse(\n registerRequest: RegisterRequest,\n partialLogin: LoginAuthenticationResponse\n ): Promise<void> {\n try {\n let login;\n if (props.type === 'patient') {\n login = await medplum.startNewPatient(registerRequest, partialLogin);\n } else {\n login = await medplum.startNewProject(registerRequest, partialLogin);\n }\n await medplum.processCode(login.code as string);\n props.onSuccess();\n } catch (err) {\n setOutcome(err as OperationOutcome);\n }\n }\n\n return (\n <Document width={450}>\n <Form\n style={{ maxWidth: 400 }}\n onSubmit={async (formData: Record<string, string>) => {\n try {\n const recaptchaToken = await getRecaptcha(recaptchaSiteKey);\n const registerRequest = { ...formData, recaptchaToken } as RegisterRequest;\n const userLogin = await medplum.startNewUser(registerRequest);\n handleAuthResponse(registerRequest, userLogin);\n } catch (err) {\n setOutcome(err as OperationOutcome);\n }\n }}\n >\n <div className=\"medplum-center\">{props.children}</div>\n {issues && (\n <div className=\"medplum-input-error\">\n {issues.map((issue) => (\n <div data-testid=\"text-field-error\" key={issue.details?.text}>\n {issue.details?.text}\n </div>\n ))}\n </div>\n )}\n {googleClientId && (\n <>\n <div className=\"medplum-signin-google-container\">\n <GoogleButton\n googleClientId={googleClientId}\n handleGoogleCredential={async (response: GoogleCredentialResponse) => {\n try {\n const loginRequest = {\n googleClientId: response.clientId,\n googleCredential: response.credential,\n };\n const userLogin = await medplum.startGoogleLogin(loginRequest);\n const googleClaims = parseJWTPayload(loginRequest.googleCredential);\n const registerRequest = {\n firstName: googleClaims.given_name as string,\n lastName: googleClaims.family_name as string,\n email: googleClaims.email as string,\n };\n handleAuthResponse(registerRequest, userLogin);\n } catch (err) {\n setOutcome(err as OperationOutcome);\n }\n }}\n />\n </div>\n <div className=\"medplum-signin-separator\">or</div>\n </>\n )}\n <FormSection title=\"First Name\" htmlFor=\"firstName\" outcome={outcome}>\n <Input\n name=\"firstName\"\n type=\"text\"\n testid=\"firstName\"\n placeholder=\"First name\"\n required={true}\n autoFocus={true}\n outcome={outcome}\n />\n </FormSection>\n <FormSection title=\"Last Name\" htmlFor=\"lastName\" outcome={outcome}>\n <Input\n name=\"lastName\"\n type=\"text\"\n testid=\"lastName\"\n placeholder=\"Last name\"\n required={true}\n outcome={outcome}\n />\n </FormSection>\n {props.type === 'project' && (\n <FormSection title=\"Project Name\" htmlFor=\"projectName\" outcome={outcome}>\n <Input\n name=\"projectName\"\n type=\"text\"\n testid=\"projectName\"\n placeholder=\"My Project\"\n required={true}\n outcome={outcome}\n />\n </FormSection>\n )}\n <FormSection title=\"Email\" htmlFor=\"email\" outcome={outcome}>\n <Input\n name=\"email\"\n type=\"email\"\n testid=\"email\"\n placeholder=\"name@domain.com\"\n required={true}\n outcome={outcome}\n />\n </FormSection>\n <FormSection title=\"Password\" htmlFor=\"password\" outcome={outcome}>\n <Input\n name=\"password\"\n type=\"password\"\n testid=\"password\"\n autoComplete=\"off\"\n required={true}\n outcome={outcome}\n />\n </FormSection>\n <p style={{ fontSize: '12px', color: '#888' }}>\n By clicking submit you agree to the Medplum <a href=\"https://www.medplum.com/privacy\">Privacy&nbsp;Policy</a>\n {' and '}\n <a href=\"https://www.medplum.com/terms\">Terms&nbsp;of&nbsp;Service</a>.\n </p>\n <p style={{ fontSize: '12px', color: '#888' }}>\n This site is protected by reCAPTCHA and the Google{' '}\n <a href=\"https://policies.google.com/privacy\">Privacy&nbsp;Policy</a>\n {' and '}\n <a href=\"https://policies.google.com/terms\">Terms&nbsp;of&nbsp;Service</a> apply.\n </p>\n <div className=\"medplum-signin-buttons\">\n <div>\n <input type=\"checkbox\" id=\"remember\" name=\"remember\" value=\"true\" />\n <label htmlFor=\"remember\">Remember me</label>\n </div>\n <div>\n <Button type=\"submit\" testid=\"submit\">\n Create account\n </Button>\n </div>\n </div>\n </Form>\n </Document>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAiCM,SAAU,YAAY,CAAC,KAAwB,EAAA;AACnD,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,cAAc,GAAG,iBAAiB,CAAC,KAAK,CA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Q,qBAE5B,CACL,CACF,CACD,CACE,EACX;AACJ;;;;"}
1
+ {"version":3,"file":"RegisterForm.js","sources":["../../src/RegisterForm.tsx"],"sourcesContent":["import {\n GoogleCredentialResponse,\n LoginAuthenticationResponse,\n NewPatientRequest,\n NewProjectRequest,\n parseJWTPayload,\n} from '@medplum/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport React, { useEffect, useState } from 'react';\nimport { Button } from './Button';\nimport { Document } from './Document';\nimport { Form } from './Form';\nimport { FormSection } from './FormSection';\nimport { getGoogleClientId, GoogleButton } from './GoogleButton';\nimport { Input } from './Input';\nimport { useMedplum } from './MedplumProvider';\nimport { getIssuesForExpression } from './utils/outcomes';\nimport { getRecaptcha, initRecaptcha } from './utils/recaptcha';\nimport './SignInForm.css';\nimport './util.css';\n\nexport interface BaseRegisterFormProps {\n readonly googleClientId?: string;\n readonly recaptchaSiteKey: string;\n readonly children?: React.ReactNode;\n readonly onSuccess: () => void;\n}\n\nexport interface PatientRegisterFormProps extends BaseRegisterFormProps {\n readonly type: 'patient';\n readonly projectId: string;\n}\n\nexport interface ProjectRegisterFormProps extends BaseRegisterFormProps {\n readonly type: 'project';\n}\n\nexport type RegisterFormProps = PatientRegisterFormProps | ProjectRegisterFormProps;\n\nexport function RegisterForm(props: RegisterFormProps): JSX.Element {\n const medplum = useMedplum();\n const googleClientId = getGoogleClientId(props.googleClientId);\n const recaptchaSiteKey = props.recaptchaSiteKey;\n const [outcome, setOutcome] = useState<OperationOutcome>();\n const issues = getIssuesForExpression(outcome, undefined);\n\n useEffect(() => initRecaptcha(recaptchaSiteKey), [recaptchaSiteKey]);\n\n async function handleAuthResponse(\n registerRequest: NewPatientRequest | NewProjectRequest,\n partialLogin: LoginAuthenticationResponse\n ): Promise<void> {\n try {\n let login;\n if (props.type === 'patient') {\n login = await medplum.startNewPatient(registerRequest as NewPatientRequest, partialLogin);\n } else {\n login = await medplum.startNewProject(registerRequest as NewProjectRequest, partialLogin);\n }\n await medplum.processCode(login.code as string);\n props.onSuccess();\n } catch (err) {\n setOutcome(err as OperationOutcome);\n }\n }\n\n return (\n <Document width={450}>\n <Form\n style={{ maxWidth: 400 }}\n onSubmit={async (formData: Record<string, string>) => {\n try {\n const recaptchaToken = await getRecaptcha(recaptchaSiteKey);\n const registerRequest = {\n projectId: (props as PatientRegisterFormProps).projectId,\n projectName: formData.projectName,\n firstName: formData.firstName,\n lastName: formData.lastName,\n email: formData.email,\n password: formData.password,\n remember: formData.remember === 'true',\n recaptchaSiteKey,\n recaptchaToken,\n };\n const userLogin = await medplum.startNewUser(registerRequest);\n handleAuthResponse(registerRequest, userLogin);\n } catch (err) {\n setOutcome(err as OperationOutcome);\n }\n }}\n >\n <div className=\"medplum-center\">{props.children}</div>\n {issues && (\n <div className=\"medplum-input-error\">\n {issues.map((issue) => (\n <div data-testid=\"text-field-error\" key={issue.details?.text}>\n {issue.details?.text}\n </div>\n ))}\n </div>\n )}\n {googleClientId && (\n <>\n <div className=\"medplum-signin-google-container\">\n <GoogleButton\n googleClientId={googleClientId}\n handleGoogleCredential={async (response: GoogleCredentialResponse) => {\n try {\n const loginRequest = {\n googleClientId: response.clientId,\n googleCredential: response.credential,\n };\n const userLogin = await medplum.startGoogleLogin(loginRequest);\n const googleClaims = parseJWTPayload(loginRequest.googleCredential);\n const registerRequest = {\n projectId: (props as PatientRegisterFormProps).projectId,\n firstName: googleClaims.given_name as string,\n lastName: googleClaims.family_name as string,\n email: googleClaims.email as string,\n };\n handleAuthResponse(registerRequest, userLogin);\n } catch (err) {\n setOutcome(err as OperationOutcome);\n }\n }}\n />\n </div>\n <div className=\"medplum-signin-separator\">or</div>\n </>\n )}\n <FormSection title=\"First Name\" htmlFor=\"firstName\" outcome={outcome}>\n <Input\n name=\"firstName\"\n type=\"text\"\n testid=\"firstName\"\n placeholder=\"First name\"\n required={true}\n autoFocus={true}\n outcome={outcome}\n />\n </FormSection>\n <FormSection title=\"Last Name\" htmlFor=\"lastName\" outcome={outcome}>\n <Input\n name=\"lastName\"\n type=\"text\"\n testid=\"lastName\"\n placeholder=\"Last name\"\n required={true}\n outcome={outcome}\n />\n </FormSection>\n {props.type === 'project' && (\n <FormSection title=\"Project Name\" htmlFor=\"projectName\" outcome={outcome}>\n <Input\n name=\"projectName\"\n type=\"text\"\n testid=\"projectName\"\n placeholder=\"My Project\"\n required={true}\n outcome={outcome}\n />\n </FormSection>\n )}\n <FormSection title=\"Email\" htmlFor=\"email\" outcome={outcome}>\n <Input\n name=\"email\"\n type=\"email\"\n testid=\"email\"\n placeholder=\"name@domain.com\"\n required={true}\n outcome={outcome}\n />\n </FormSection>\n <FormSection title=\"Password\" htmlFor=\"password\" outcome={outcome}>\n <Input\n name=\"password\"\n type=\"password\"\n testid=\"password\"\n autoComplete=\"off\"\n required={true}\n outcome={outcome}\n />\n </FormSection>\n <p style={{ fontSize: '12px', color: '#888' }}>\n By clicking submit you agree to the Medplum <a href=\"https://www.medplum.com/privacy\">Privacy&nbsp;Policy</a>\n {' and '}\n <a href=\"https://www.medplum.com/terms\">Terms&nbsp;of&nbsp;Service</a>.\n </p>\n <p style={{ fontSize: '12px', color: '#888' }}>\n This site is protected by reCAPTCHA and the Google{' '}\n <a href=\"https://policies.google.com/privacy\">Privacy&nbsp;Policy</a>\n {' and '}\n <a href=\"https://policies.google.com/terms\">Terms&nbsp;of&nbsp;Service</a> apply.\n </p>\n <div className=\"medplum-signin-buttons\">\n <div>\n <input type=\"checkbox\" id=\"remember\" name=\"remember\" value=\"true\" />\n <label htmlFor=\"remember\">Remember me</label>\n </div>\n <div>\n <Button type=\"submit\" testid=\"submit\">\n Create account\n </Button>\n </div>\n </div>\n </Form>\n </Document>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAuCM,SAAU,YAAY,CAAC,KAAwB,EAAA;AACnD,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,cAAc,GAAG,iBAAiB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;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