π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
feat(app-lock): enhance reauthentication flow and cancellation handling
Aswin Asok2df6fbdc7b17
diff --git a/web/apps/photos/src/components/Sidebar.tsx b/web/apps/photos/src/components/Sidebar.tsxindex 253c3fc695..27e18a4073 100644--- a/web/apps/photos/src/components/Sidebar.tsx+++ b/web/apps/photos/src/components/Sidebar.tsx@@ -1006,9 +1006,9 @@ const Account: React.FC<AccountProps> = ({const handleRecoveryKey = useCallback(async () => {if (isDesktop) {- const didAuthenticateWithAppLock =- await reauthenticateWithAppLock();- if (!didAuthenticateWithAppLock) await onAuthenticateUser();+ const reauthResult = await reauthenticateWithAppLock();+ if (reauthResult === "cancelled") return;+ if (reauthResult === "fallback") await onAuthenticateUser();} else {await onAuthenticateUser();}@@ -1025,9 +1025,9 @@ const Account: React.FC<AccountProps> = ({const handleActiveSessions = useCallback(async () => {if (isDesktop) {- const didAuthenticateWithAppLock =- await reauthenticateWithAppLock();- if (!didAuthenticateWithAppLock) await onAuthenticateUser();+ const reauthResult = await reauthenticateWithAppLock();+ if (reauthResult === "cancelled") return;+ if (reauthResult === "fallback") await onAuthenticateUser();} else {await onAuthenticateUser();}diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsxindex 0a7d0493c4..6ed981f9bf 100644--- a/web/apps/photos/src/pages/gallery.tsx+++ b/web/apps/photos/src/pages/gallery.tsx@@ -346,8 +346,11 @@ const Page: React.FC = () => {const authenticateUser = useCallback(async () => {if (!isDesktop) return authenticateUserWithPasswordModal();- const didAuthenticateWithAppLock = await reauthenticateWithAppLock();- if (didAuthenticateWithAppLock) return;+ const reauthResult = await reauthenticateWithAppLock();+ if (reauthResult === "authenticated") return;+ if (reauthResult === "cancelled") {+ throw new Error("app_lock_reauthentication_cancelled");+ }return authenticateUserWithPasswordModal();}, [authenticateUserWithPasswordModal]);diff --git a/web/packages/new/photos/components/AppLockOverlay.tsx b/web/packages/new/photos/components/AppLockOverlay.tsxindex c0c6b6f4ee..0f7d235d99 100644--- a/web/packages/new/photos/components/AppLockOverlay.tsx+++ b/web/packages/new/photos/components/AppLockOverlay.tsx@@ -7,17 +7,18 @@* logout escape hatch.*/-import FingerprintIcon from "@mui/icons-material/Fingerprint";-import LockOutlinedIcon from "@mui/icons-material/LockOutlined";+import CloseIcon from "@mui/icons-material/Close";import {Box,CircularProgress,+ IconButton,Modal,Paper,Stack,TextField,Typography,} from "@mui/material";+import type { Theme } from "@mui/material/styles";import { EnteLogo } from "ente-base/components/EnteLogo";import { FocusVisibleButton } from "ente-base/components/mui/FocusVisibleButton";import { ShowHidePasswordInputAdornment } from "ente-base/components/mui/PasswordInputAdornment";@@ -32,7 +33,7 @@ import React, {useState,} from "react";import {- appLockCooldownDurationMs,+ cancelReauthentication,attemptDeviceLockUnlock,attemptUnlock,type DeviceLockUnlockResult,@@ -58,26 +59,55 @@ export const AppLockOverlay: React.FC = () => {if (!appLock.isLocked) return null;+ const closeAction =+ isReauthentication && !showLogoutConfirm ? (+ <IconButton+ aria-label={t("close")}+ onClick={cancelReauthentication}+ sx={(theme) => ({+ backgroundColor: "#FAFAFA",+ color: "#000",+ p: 1.25,+ "&:hover": { backgroundColor: "#F0F0F0" },+ ...theme.applyStyles("dark", {+ backgroundColor: "rgba(255, 255, 255, 0.12)",+ color: "#fff",+ "&:hover": {+ backgroundColor: "rgba(255, 255, 255, 0.16)",+ },+ }),+ })}+ >+ <CloseIcon sx={{ fontSize: 20 }} />+ </IconButton>+ ) : undefined;+const unlockForm =appLock.lockType === "pin" ? (<PinUnlockFormappLock={appLock}isReauthentication={isReauthentication}onLogout={() => setShowLogoutConfirm(true)}+ closeAction={closeAction}/>) : appLock.lockType === "password" ? (<PasswordUnlockFormappLock={appLock}isReauthentication={isReauthentication}onLogout={() => setShowLogoutConfirm(true)}+ closeAction={closeAction}/>) : appLock.lockType === "device" ? (- <DeviceLockUnlockForm isReauthentication={isReauthentication} />+ <DeviceLockUnlockForm+ isReauthentication={isReauthentication}+ closeAction={closeAction}+ />) : (<PinUnlockFormappLock={appLock}isReauthentication={isReauthentication}onLogout={() => setShowLogoutConfirm(true)}+ closeAction={closeAction}/>);@@ -87,6 +117,15 @@ export const AppLockOverlay: React.FC = () => {opendisableEscapeKeyDownaria-label={t("authenticate")}+ slotProps={{+ backdrop: {+ sx: {+ backgroundColor: "rgba(0, 0, 0, 0.04)",+ backdropFilter: "blur(3px)",+ WebkitBackdropFilter: "blur(3px)",+ },+ },+ }}sx={{ zIndex: "calc(var(--mui-zIndex-modal) + 1)" }}><Box@@ -123,8 +162,7 @@ export const AppLockOverlay: React.FC = () => {slotProps={{backdrop: {sx: {- backgroundColor:- "var(--mui-palette-background-default)",+ backgroundColor: "#000",},},}}@@ -195,24 +233,244 @@ interface UnlockFormProps {appLock: ReturnType<typeof useAppLockSnapshot>;isReauthentication: boolean;onLogout: () => void;+ closeAction?: React.ReactNode;}-const AppLockCard: React.FC<React.PropsWithChildren> = ({ children }) => (- <Paper- elevation={0}+const ENTE_GREEN = "#08C225";+const ENTE_GREEN_HOVER = "#07A820";++const titleTextSx = (theme: Theme) => ({+ fontWeight: 600,+ fontSize: 24,+ lineHeight: "28px",+ letterSpacing: "-0.48px",+ color: "#000",+ textAlign: "center" as const,+ ...theme.applyStyles("dark", {+ color: "#fff",+ }),+});++const subtitleTextSx = (theme: Theme) => ({+ fontWeight: 500,+ fontSize: 14,+ lineHeight: "20px",+ color: "#666",+ textAlign: "center" as const,+ maxWidth: 295,+ ...theme.applyStyles("dark", {+ color: "rgba(255, 255, 255, 0.64)",+ }),+});++const primaryActionButtonSx = (theme: Theme) => ({+ display: "flex",+ minHeight: 56,+ padding: "18px 16px",+ justifyContent: "center",+ alignItems: "center",+ gap: 1,+ borderRadius: "20px",+ backgroundColor: ENTE_GREEN,+ fontSize: 16,+ fontWeight: 500,+ lineHeight: "20px",+ textTransform: "none" as const,+ color: "#fff",+ boxShadow: "none",+ "&:hover": {+ backgroundColor: ENTE_GREEN_HOVER,+ boxShadow: "none",+ },+ "&.Mui-disabled": {+ backgroundColor: "rgba(0, 0, 0, 0.04)",+ color: "#999",+ opacity: 1,+ },+ ...theme.applyStyles("dark", {+ "&.Mui-disabled": {+ backgroundColor: "rgba(255, 255, 255, 0.08)",+ color: "rgba(255, 255, 255, 0.5)",+ opacity: 1,+ },+ }),+});++const secondaryActionButtonSx = (theme: Theme) => ({+ display: "flex",+ minHeight: 60,+ padding: "20px 16px",+ justifyContent: "center",+ alignItems: "center",+ gap: 1,+ borderRadius: "20px",+ backgroundColor: "#F2F2F2",+ fontSize: 16,+ fontWeight: 600,+ lineHeight: "20px",+ textTransform: "none" as const,+ color: "#333",+ boxShadow: "none",+ "&:hover": {+ backgroundColor: "#E8E8E8",+ boxShadow: "none",+ },+ ...theme.applyStyles("dark", {+ backgroundColor: "rgba(255, 255, 255, 0.08)",+ color: "rgba(255, 255, 255, 0.9)",+ "&:hover": {+ backgroundColor: "rgba(255, 255, 255, 0.12)",+ },+ }),+});++const inputFieldSx = (+ theme: Theme,+ options?: { borderRadius?: number },+) => ({+ borderRadius: options?.borderRadius ?? 12,+ "& .MuiInputBase-root": {+ // Enforce shape/height at InputBase level so variant-specific styles+ // don't collapse these fields into pill/circle forms.+ height: 54,+ borderRadius: `${String(options?.borderRadius ?? 12)}px !important`,+ overflow: "hidden",+ },+ "& .MuiInput-root": {+ height: 54,+ backgroundColor: "#FAFAFA",+ borderRadius: `${String(options?.borderRadius ?? 12)}px !important`,+ "&::before": {+ borderBottom: "1px solid #E0E0E0",+ },+ "&::after": { borderBottom: `2px solid ${ENTE_GREEN}` },+ "&.Mui-error::after": {+ borderBottomColor: theme.palette.error.main,+ },+ "&:hover:not(.Mui-disabled)::before": {+ borderBottom: "1px solid #BDBDBD",+ },+ },+ "& .MuiInputBase-input": {+ padding: "0 16px",+ height: "100%",+ boxSizing: "border-box" as const,+ fontSize: 16,+ color: "#000",+ "&::placeholder": {+ color: "#999",+ opacity: 1,+ },+ },+ ...theme.applyStyles("dark", {+ "& .MuiInput-root": {+ backgroundColor: "rgba(255, 255, 255, 0.08)",+ "&::before": {+ borderBottom: "1px solid rgba(255, 255, 255, 0.3)",+ },+ "&:hover:not(.Mui-disabled)::before": {+ borderBottom: "1px solid rgba(255, 255, 255, 0.5)",+ },+ },+ "& .MuiInputBase-root": {+ backgroundColor: "rgba(255, 255, 255, 0.08)",+ },+ "& .MuiInputBase-input": {+ color: "#fff",+ "&::placeholder": {+ color: "rgba(255, 255, 255, 0.5)",+ },+ },+ }),+});++const LOCK_ILLUSTRATION_SVG = String.raw`+<svg width="379" height="379" viewBox="0 0 379 379" fill="none" xmlns="http://www.w3.org/2000/svg">+<mask id="path-2-outside-1_19281_31704" maskUnits="userSpaceOnUse" x="27.8575" y="14.1463" width="307.021" height="337.36" fill="black">+<rect fill="white" x="27.8575" y="14.1463" width="307.021" height="337.36"/>+<path d="M197.717 54.3663C227.248 56.154 250.433 81.035 249.858 110.888L249.375 143.582L256.853 143.729C257.223 143.74 257.594 143.751 257.965 143.761C271.853 144.616 282.704 156.259 282.437 170.287L280.647 265.066C280.369 279.464 268.488 290.928 254.065 290.657L122.567 288.173C122.197 288.162 121.826 288.151 121.455 288.141C107.567 287.286 96.7164 275.643 96.9832 261.616L98.773 166.836C99.0505 152.438 110.932 140.974 125.355 141.245L138.27 141.48L138.753 108.785C139.337 78.1418 164.713 53.6996 195.357 54.2839C196.147 54.2928 196.92 54.3327 197.717 54.3663ZM164.124 141.943L223.533 143.064L224.016 110.369C224.317 94.4141 211.915 81.1151 196.129 80.1392C195.703 80.1163 195.301 80.0871 194.881 80.0889C178.506 79.789 164.932 92.8666 164.632 109.242L164.149 141.937M192.093 254.068C192.093 254.068 192.303 254.067 192.384 254.073C196.344 254.142 199.593 251.001 199.669 247.065L200.037 227.754C200.051 226.778 200.647 225.917 201.541 225.505C208.682 222.372 213.7 215.338 213.874 207.039C213.943 202.868 212.789 198.955 210.717 195.671C207.307 190.229 201.391 186.504 194.555 186.089C194.264 186.084 193.968 186.055 193.677 186.05C186.305 185.902 179.79 189.638 176.052 195.4C174.008 198.523 172.801 202.248 172.719 206.265C172.57 214.558 177.328 221.785 184.343 225.178C185.216 225.613 185.783 226.494 185.768 227.47L185.401 246.781C185.331 250.637 188.298 253.824 192.118 254.061M198.03 49.5021C197.177 49.4564 196.324 49.4107 195.477 49.3897C162.164 48.749 134.555 75.3634 133.914 108.677L133.503 136.49L125.47 136.327C117.202 136.171 109.362 139.245 103.405 144.967C97.4488 150.69 94.0776 158.41 93.9218 166.678L92.1321 261.457C91.821 278.098 104.572 291.94 121.179 292.943C121.606 292.966 122.057 292.982 122.483 293.005L253.981 295.489C262.249 295.645 270.089 292.571 276.045 286.848C282.002 281.125 285.373 273.406 285.529 265.138L287.318 170.358C287.63 153.717 274.878 139.876 258.271 138.873C257.845 138.85 257.394 138.833 256.967 138.81L254.329 138.772L254.758 110.928C255.055 95.2635 249.349 80.2859 238.659 68.759C228.031 57.269 213.586 50.405 198.024 49.4775L198.03 49.5021ZM169.065 137.188L169.495 109.345C169.745 95.6634 181.104 84.727 194.791 85.0015C195.137 85.0185 195.508 85.0293 195.854 85.0463C209.179 85.8599 219.416 96.95 219.165 110.316L218.754 138.129L169.09 137.182L169.065 137.188ZM192.381 249.21C191.151 249.129 190.207 248.107 190.239 246.89L190.607 227.579C190.669 224.724 189.02 222.068 186.438 220.806C180.921 218.136 177.455 212.473 177.552 206.349C177.613 203.389 178.49 200.537 180.099 198.077C183.088 193.504 188.112 190.831 193.556 190.944C193.791 190.937 194.007 190.96 194.224 190.984C199.242 191.284 203.858 194.026 206.552 198.308C208.182 200.89 209.022 203.884 208.968 206.973C208.84 213.079 205.15 218.618 199.544 221.071C196.917 222.213 195.186 224.809 195.13 227.689L194.763 247C194.743 248.266 193.685 249.272 192.443 249.247L192.344 249.272L192.381 249.21Z"/>+</mask>+<path d="M197.717 54.3663C227.248 56.154 250.433 81.035 249.858 110.888L249.375 143.582L256.853 143.729C257.223 143.74 257.594 143.751 257.965 143.761C271.853 144.616 282.704 156.259 282.437 170.287L280.647 265.066C280.369 279.464 268.488 290.928 254.065 290.657L122.567 288.173C122.197 288.162 121.826 288.151 121.455 288.141C107.567 287.286 96.7164 275.643 96.9832 261.616L98.773 166.836C99.0505 152.438 110.932 140.974 125.355 141.245L138.27 141.48L138.753 108.785C139.337 78.1418 164.713 53.6996 195.357 54.2839C196.147 54.2928 196.92 54.3327 197.717 54.3663ZM164.124 141.943L223.533 143.064L224.016 110.369C224.317 94.4141 211.915 81.1151 196.129 80.1392C195.703 80.1163 195.301 80.0871 194.881 80.0889C178.506 79.789 164.932 92.8666 164.632 109.242L164.149 141.937M192.093 254.068C192.093 254.068 192.303 254.067 192.384 254.073C196.344 254.142 199.593 251.001 199.669 247.065L200.037 227.754C200.051 226.778 200.647 225.917 201.541 225.505C208.682 222.372 213.7 215.338 213.874 207.039C213.943 202.868 212.789 198.955 210.717 195.671C207.307 190.229 201.391 186.504 194.555 186.089C194.264 186.084 193.968 186.055 193.677 186.05C186.305 185.902 179.79 189.638 176.052 195.4C174.008 198.523 172.801 202.248 172.719 206.265C172.57 214.558 177.328 221.785 184.343 225.178C185.216 225.613 185.783 226.494 185.768 227.47L185.401 246.781C185.331 250.637 188.298 253.824 192.118 254.061M198.03 49.5021C197.177 49.4564 196.324 49.4107 195.477 49.3897C162.164 48.749 134.555 75.3634 133.914 108.677L133.503 136.49L125.47 136.327C117.202 136.171 109.362 139.245 103.405 144.967C97.4488 150.69 94.0776 158.41 93.9218 166.678L92.1321 261.457C91.821 278.098 104.572 291.94 121.179 292.943C121.606 292.966 122.057 292.982 122.483 293.005L253.981 295.489C262.249 295.645 270.089 292.571 276.045 286.848C282.002 281.125 285.373 273.406 285.529 265.138L287.318 170.358C287.63 153.717 274.878 139.876 258.271 138.873C257.845 138.85 257.394 138.833 256.967 138.81L254.329 138.772L254.758 110.928C255.055 95.2635 249.349 80.2859 238.659 68.759C228.031 57.269 213.586 50.405 198.024 49.4775L198.03 49.5021ZM169.065 137.188L169.495 109.345C169.745 95.6634 181.104 84.727 194.791 85.0015C195.137 85.0185 195.508 85.0293 195.854 85.0463C209.179 85.8599 219.416 96.95 219.165 110.316L218.754 138.129L169.09 137.182L169.065 137.188ZM192.381 249.21C191.151 249.129 190.207 248.107 190.239 246.89L190.607 227.579C190.669 224.724 189.02 222.068 186.438 220.806C180.921 218.136 177.455 212.473 177.552 206.349C177.613 203.389 178.49 200.537 180.099 198.077C183.088 193.504 188.112 190.831 193.556 190.944C193.791 190.937 194.007 190.96 194.224 190.984C199.242 191.284 203.858 194.026 206.552 198.308C208.182 200.89 209.022 203.884 208.968 206.973C208.84 213.079 205.15 218.618 199.544 221.071C196.917 222.213 195.186 224.809 195.13 227.689L194.763 247C194.743 248.266 193.685 249.272 192.443 249.247L192.344 249.272L192.381 249.21Z" fill="#0A0A0A" style="fill:#0A0A0A;fill:color(display-p3 0.0385 0.0385 0.0385);fill-opacity:1;"/>+<path d="M197.717 54.3663L198.59 39.9511C198.502 39.9458 198.414 39.9412 198.326 39.9375L197.717 54.3663ZM249.858 110.888L235.419 110.609C235.419 110.631 235.418 110.653 235.418 110.674L249.858 110.888ZM249.375 143.582L234.935 143.369C234.818 151.317 241.145 157.865 249.092 158.021L249.375 143.582ZM256.853 143.729L257.271 129.294C257.226 129.292 257.181 129.291 257.136 129.29L256.853 143.729ZM257.965 143.761L258.852 129.347C258.696 129.338 258.54 129.33 258.384 129.326L257.965 143.761ZM282.437 170.287L267.998 170.012L267.998 170.014L282.437 170.287ZM280.647 265.066L295.086 265.344L295.086 265.339L280.647 265.066ZM254.065 290.657L253.792 305.096L253.793 305.096L254.065 290.657ZM122.567 288.173L122.149 302.609C122.197 302.61 122.246 302.611 122.295 302.612L122.567 288.173ZM121.455 288.141L120.568 302.555C120.724 302.565 120.88 302.572 121.036 302.576L121.455 288.141ZM96.9832 261.616L111.422 261.89L111.422 261.888L96.9832 261.616ZM98.773 166.836L84.334 166.558L84.3339 166.563L98.773 166.836ZM125.355 141.245L125.083 155.684L125.093 155.685L125.355 141.245ZM138.27 141.48L138.008 155.919C141.846 155.989 145.554 154.528 148.312 151.859C151.071 149.189 152.653 145.531 152.71 141.693L138.27 141.48ZM138.753 108.785L124.314 108.51C124.313 108.531 124.313 108.552 124.313 108.572L138.753 108.785ZM195.357 54.2839L195.081 68.7228C195.119 68.7236 195.156 68.7241 195.193 68.7245L195.357 54.2839ZM223.533 143.064L223.261 157.503C227.1 157.575 230.811 156.115 233.572 153.446C236.333 150.776 237.916 147.117 237.973 143.277L223.533 143.064ZM224.016 110.369L209.577 110.096C209.576 110.116 209.576 110.136 209.576 110.156L224.016 110.369ZM196.129 80.1392L197.021 65.7251C196.981 65.7227 196.942 65.7204 196.903 65.7183L196.129 80.1392ZM194.881 80.0889L194.617 94.5281C194.726 94.5301 194.835 94.5309 194.944 94.5304L194.881 80.0889ZM164.632 109.242L150.193 108.977C150.192 108.995 150.192 109.012 150.192 109.029L164.632 109.242ZM192.384 254.073L191.338 268.476C191.602 268.495 191.866 268.507 192.131 268.512L192.384 254.073ZM199.669 247.065L214.108 247.343L214.108 247.34L199.669 247.065ZM200.037 227.754L214.476 228.029C214.476 228.008 214.476 227.987 214.477 227.966L200.037 227.754ZM201.541 225.505L195.739 212.28C195.66 212.315 195.58 212.351 195.501 212.387L201.541 225.505ZM213.874 207.039L228.313 207.342C228.313 207.32 228.313 207.298 228.314 207.276L213.874 207.039ZM210.717 195.671L198.479 203.339C198.487 203.351 198.495 203.363 198.502 203.376L210.717 195.671ZM194.555 186.089L195.431 171.674C195.221 171.661 195.01 171.653 194.8 171.65L194.555 186.089ZM193.677 186.05L193.389 200.488C193.403 200.489 193.418 200.489 193.433 200.489L193.677 186.05ZM176.052 195.4L188.136 203.309C188.147 203.293 188.157 203.276 188.168 203.26L176.052 195.4ZM172.719 206.265L158.281 205.972C158.281 205.983 158.28 205.994 158.28 206.005L172.719 206.265ZM184.343 225.178L190.783 212.251C190.732 212.226 190.682 212.201 190.631 212.177L184.343 225.178ZM185.768 227.47L200.207 227.745C200.208 227.724 200.208 227.703 200.208 227.682L185.768 227.47ZM185.401 246.781L170.962 246.506L170.961 246.519L185.401 246.781ZM198.03 49.5021L197.256 63.923C201.844 64.1691 206.275 62.2177 209.19 58.6673C212.106 55.1169 213.158 50.3911 212.025 45.939L198.03 49.5021ZM195.477 49.3897L195.836 34.9525C195.809 34.9518 195.782 34.9512 195.755 34.9507L195.477 49.3897ZM133.914 108.677L119.475 108.399C119.475 108.42 119.474 108.442 119.474 108.463L133.914 108.677ZM133.503 136.49L133.21 150.928C137.053 151.006 140.769 149.549 143.534 146.879C146.299 144.209 147.886 140.547 147.943 136.703L133.503 136.49ZM125.47 136.327L125.763 121.888C125.756 121.888 125.749 121.888 125.742 121.888L125.47 136.327ZM93.9218 166.678L108.361 166.95L108.361 166.95L93.9218 166.678ZM92.1321 261.457L77.693 261.185L77.693 261.187L92.1321 261.457ZM121.179 292.943L120.308 307.358C120.341 307.36 120.373 307.362 120.406 307.364L121.179 292.943ZM122.483 293.005L121.71 307.426C121.877 307.435 122.044 307.441 122.211 307.444L122.483 293.005ZM253.981 295.489L253.708 309.928L253.709 309.928L253.981 295.489ZM285.529 265.138L271.09 264.865L271.09 264.866L285.529 265.138ZM287.318 170.358L301.757 170.631L301.758 170.628L287.318 170.358ZM258.271 138.873L259.142 124.457C259.11 124.455 259.077 124.453 259.045 124.452L258.271 138.873ZM256.967 138.81L257.741 124.389C257.552 124.379 257.363 124.373 257.175 124.37L256.967 138.81ZM254.329 138.772L239.889 138.55C239.83 142.382 241.296 146.081 243.966 148.831C246.635 151.581 250.289 153.157 254.121 153.212L254.329 138.772ZM254.758 110.928L240.319 110.655C240.319 110.672 240.319 110.689 240.318 110.706L254.758 110.928ZM238.659 68.759L228.057 78.5653C228.062 78.5699 228.066 78.5745 228.07 78.5791L238.659 68.759ZM198.024 49.4775L198.883 35.0615C194.282 34.7873 189.826 36.7258 186.89 40.2792C183.954 43.8326 182.891 48.5739 184.028 53.0407L198.024 49.4775ZM169.065 137.188L154.626 136.966C154.556 141.462 156.586 145.735 160.115 148.522C163.644 151.309 168.27 152.293 172.629 151.184L169.065 137.188ZM169.495 109.345L155.056 109.081C155.056 109.095 155.055 109.108 155.055 109.122L169.495 109.345ZM194.791 85.0015L195.501 70.5774C195.361 70.5705 195.221 70.5656 195.081 70.5628L194.791 85.0015ZM195.854 85.0463L196.734 70.6316C196.678 70.6281 196.621 70.625 196.564 70.6222L195.854 85.0463ZM219.165 110.316L204.726 110.045C204.726 110.064 204.725 110.083 204.725 110.103L219.165 110.316ZM218.754 138.129L218.479 152.568C222.319 152.641 226.03 151.182 228.791 148.512C231.553 145.843 233.137 142.183 233.194 138.343L218.754 138.129ZM169.09 137.182L169.365 122.743C168.072 122.718 166.781 122.868 165.527 123.187L169.09 137.182ZM192.381 249.21L204.785 256.605C207.359 252.288 207.503 246.944 205.166 242.494C202.829 238.045 198.347 235.131 193.332 234.8L192.381 249.21ZM190.239 246.89L204.676 247.267C204.677 247.233 204.678 247.198 204.678 247.164L190.239 246.89ZM190.607 227.579L176.169 227.266C176.168 227.279 176.168 227.292 176.168 227.304L190.607 227.579ZM186.438 220.806L192.778 207.831C192.762 207.823 192.745 207.815 192.729 207.807L186.438 220.806ZM177.552 206.349L163.113 206.05C163.113 206.073 163.112 206.097 163.112 206.12L177.552 206.349ZM180.099 198.077L192.186 205.979L192.187 205.979L180.099 198.077ZM193.556 190.944L193.258 205.382C193.505 205.387 193.752 205.386 193.999 205.379L193.556 190.944ZM194.224 190.984L192.646 205.339C192.885 205.366 193.124 205.386 193.363 205.4L194.224 190.984ZM206.552 198.308L194.327 205.998C194.332 206.005 194.336 206.011 194.34 206.018L206.552 198.308ZM208.968 206.973L223.406 207.276C223.407 207.26 223.407 207.244 223.407 207.228L208.968 206.973ZM199.544 221.071L205.302 234.315C205.312 234.311 205.322 234.306 205.333 234.302L199.544 221.071ZM195.13 227.689L180.691 227.411L180.691 227.414L195.13 227.689ZM194.763 247L180.324 246.725C180.323 246.743 180.323 246.762 180.323 246.78L194.763 247ZM192.443 249.247L192.74 234.808C191.439 234.781 190.141 234.93 188.88 235.251L192.443 249.247ZM192.344 249.272L179.94 241.876C176.947 246.897 177.275 253.226 180.771 257.91C184.268 262.594 190.243 264.709 195.907 263.267L192.344 249.272ZM197.717 54.3663L196.844 68.7815C218.674 70.1031 235.845 88.5297 235.419 110.609L249.858 110.888L264.297 111.166C265.022 73.5402 235.821 42.205 198.59 39.9511L197.717 54.3663ZM249.858 110.888L235.418 110.674L234.935 143.369L249.375 143.582L263.815 143.796L264.298 111.101L249.858 110.888ZM249.375 143.582L249.092 158.021L256.569 158.168L256.853 143.729L257.136 129.29L249.659 129.143L249.375 143.582ZM256.853 143.729L256.434 158.165C256.619 158.17 256.805 158.176 256.99 158.181C257.175 158.186 257.361 158.192 257.546 158.197L257.965 143.761L258.384 129.326C258.198 129.321 258.013 129.315 257.827 129.31C257.642 129.304 257.457 129.299 257.271 129.294L256.853 143.729ZM257.965 143.761L257.078 158.176C263.283 158.558 268.117 163.762 267.998 170.012L282.437 170.287L296.876 170.561C297.29 148.757 280.422 130.674 258.852 129.347L257.965 143.761ZM282.437 170.287L267.998 170.014L266.208 264.793L280.647 265.066L295.086 265.339L296.876 170.559L282.437 170.287ZM280.647 265.066L266.208 264.788C266.084 271.224 260.777 276.339 254.337 276.218L254.065 290.657L253.793 305.096C276.198 305.517 294.655 287.704 295.086 265.344L280.647 265.066ZM254.065 290.657L254.338 276.218L122.84 273.734L122.567 288.173L122.295 302.612L253.792 305.096L254.065 290.657ZM122.567 288.173L122.986 273.738C122.802 273.732 122.618 273.727 122.433 273.721C122.248 273.716 122.061 273.711 121.874 273.705L121.455 288.141L121.036 302.576C121.22 302.582 121.404 302.587 121.59 302.592C121.775 302.598 121.962 302.603 122.149 302.609L122.567 288.173ZM121.455 288.141L122.342 273.726C116.136 273.345 111.303 268.14 111.422 261.89L96.9832 261.616L82.5442 261.341C82.1294 283.145 98.9984 301.228 120.568 302.555L121.455 288.141ZM96.9832 261.616L111.422 261.888L113.212 167.109L98.773 166.836L84.3339 166.563L82.5441 261.343L96.9832 261.616ZM98.773 166.836L113.212 167.114C113.336 160.678 118.643 155.563 125.083 155.684L125.355 141.245L125.627 126.806C103.222 126.385 84.7651 144.198 84.334 166.558L98.773 166.836ZM125.355 141.245L125.093 155.685L138.008 155.919L138.27 141.48L138.532 127.041L125.617 126.806L125.355 141.245ZM138.27 141.48L152.71 141.693L153.193 108.999L138.753 108.785L124.313 108.572L123.83 141.267L138.27 141.48ZM138.753 108.785L153.192 109.061C153.624 86.3862 172.417 68.2908 195.081 68.7228L195.357 54.2839L195.632 39.8449C157.008 39.1085 125.05 69.8974 124.314 108.51L138.753 108.785ZM195.357 54.2839L195.193 68.7245C195.693 68.7302 196.129 68.7538 197.109 68.7951L197.717 54.3663L198.326 39.9375C197.711 39.9116 196.602 39.8554 195.52 39.8432L195.357 54.2839ZM164.124 141.943L163.852 156.382L223.261 157.503L223.533 143.064L223.806 128.625L164.397 127.504L164.124 141.943ZM223.533 143.064L237.973 143.277L238.456 110.582L224.016 110.369L209.576 110.156L209.093 142.851L223.533 143.064ZM224.016 110.369L238.455 110.642C238.904 86.9081 220.481 67.1756 197.021 65.7251L196.129 80.1392L195.238 94.5533C203.348 95.0547 209.731 101.92 209.577 110.096L224.016 110.369ZM196.129 80.1392L196.903 65.7183C196.834 65.7146 195.787 65.6433 194.819 65.6474L194.881 80.0889L194.944 94.5304C194.805 94.531 194.736 94.5262 194.808 94.5297C194.845 94.5315 194.897 94.5342 194.993 94.5397C195.073 94.5442 195.218 94.5527 195.356 94.5601L196.129 80.1392ZM194.881 80.0889L195.146 65.6497C170.801 65.2039 150.639 84.6223 150.193 108.977L164.632 109.242L179.071 109.506C179.225 101.111 186.211 94.3742 194.617 94.5281L194.881 80.0889ZM164.632 109.242L150.192 109.029L149.709 141.723L164.149 141.937L178.589 142.15L179.072 109.455L164.632 109.242ZM192.093 254.068C192.151 268.509 192.151 268.509 192.151 268.509C192.151 268.509 192.151 268.509 192.15 268.509C192.15 268.509 192.15 268.509 192.15 268.509C192.149 268.509 192.149 268.509 192.148 268.509C192.147 268.509 192.146 268.509 192.145 268.509C192.143 268.509 192.141 268.509 192.14 268.509C192.136 268.509 192.133 268.509 192.131 268.509C192.126 268.509 192.122 268.509 192.119 268.509C192.114 268.509 192.105 268.509 192.089 268.509C192.079 268.509 192.031 268.508 191.959 268.507C191.946 268.506 191.684 268.501 191.338 268.476L192.384 254.073L193.429 239.669C193.042 239.641 192.725 239.634 192.649 239.632C192.515 239.629 192.4 239.627 192.328 239.627C192.249 239.626 192.182 239.626 192.135 239.626C192.111 239.626 192.09 239.626 192.073 239.626C192.065 239.626 192.058 239.626 192.051 239.626C192.048 239.626 192.045 239.626 192.042 239.626C192.041 239.626 192.04 239.626 192.038 239.626C192.038 239.626 192.037 239.626 192.037 239.626C192.036 239.626 192.036 239.626 192.036 239.626C192.036 239.626 192.035 239.626 192.035 239.626C192.035 239.626 192.035 239.626 192.093 254.068ZM192.384 254.073L192.131 268.512C204.048 268.721 213.879 259.252 214.108 247.343L199.669 247.065L185.23 246.787C185.308 242.751 188.641 239.563 192.636 239.633L192.384 254.073ZM199.669 247.065L214.108 247.34L214.476 228.029L200.037 227.754L185.598 227.48L185.23 246.79L199.669 247.065ZM200.037 227.754L214.477 227.966C214.404 232.927 211.386 236.871 207.58 238.623L201.541 225.505L195.501 212.387C189.907 214.963 185.698 220.629 185.596 227.543L200.037 227.754ZM201.541 225.505L207.342 238.73C219.459 233.415 228.017 221.449 228.313 207.342L213.874 207.039L199.436 206.736C199.384 209.226 197.906 211.33 195.739 212.28L201.541 225.505ZM213.874 207.039L228.314 207.276C228.429 200.261 226.482 193.594 222.931 187.966L210.717 195.671L198.502 203.376C199.096 204.316 199.456 205.474 199.435 206.802L213.874 207.039ZM210.717 195.671L222.955 188.002C217.145 178.731 207.061 172.381 195.431 171.674L194.555 186.089L193.679 200.504C195.72 200.628 197.47 201.728 198.479 203.339L210.717 195.671ZM194.555 186.089L194.8 171.65C194.925 171.652 195.012 171.656 195.033 171.657C195.047 171.657 195.048 171.658 194.962 171.653C194.901 171.649 194.753 171.64 194.593 171.633C194.425 171.624 194.193 171.615 193.922 171.61L193.677 186.05L193.433 200.489C193.307 200.487 193.22 200.483 193.199 200.482C193.185 200.481 193.184 200.481 193.27 200.486C193.331 200.49 193.479 200.499 193.639 200.506C193.807 200.514 194.039 200.524 194.31 200.529L194.555 186.089ZM193.677 186.05L193.966 171.611C181.401 171.36 170.283 177.757 163.936 187.541L176.052 195.4L188.168 203.26C189.297 201.519 191.209 200.445 193.389 200.488L193.677 186.05ZM176.052 195.4L163.969 187.492C160.46 192.852 158.418 199.21 158.281 205.972L172.719 206.265L187.158 206.558C187.184 205.286 187.556 204.195 188.136 203.309L176.052 195.4ZM172.719 206.265L158.28 206.005C158.026 220.126 166.149 232.42 178.056 238.179L184.343 225.178L190.631 212.177C188.507 211.149 187.114 208.989 187.159 206.525L172.719 206.265ZM184.343 225.178L177.904 238.104C174.08 236.199 171.257 232.135 171.328 227.258L185.768 227.47L200.208 227.682C200.308 220.852 196.353 215.026 190.783 212.251L184.343 225.178ZM185.768 227.47L171.329 227.195L170.962 246.506L185.401 246.781L199.84 247.056L200.207 227.745L185.768 227.47ZM185.401 246.781L170.961 246.519C170.751 258.134 179.72 267.762 191.224 268.475L192.118 254.061L193.011 239.647C196.877 239.887 199.911 243.139 199.84 247.042L185.401 246.781ZM198.03 49.5021L198.803 35.0813C197.985 35.0374 196.925 34.9796 195.836 34.9525L195.477 49.3897L195.118 63.8268C195.723 63.8419 196.369 63.8754 197.256 63.923L198.03 49.5021ZM195.477 49.3897L195.755 34.9507C154.453 34.1564 120.269 67.1261 119.475 108.399L133.914 108.677L148.353 108.954C148.841 83.6007 169.876 63.3416 195.2 63.8286L195.477 49.3897ZM133.914 108.677L119.474 108.463L119.063 136.276L133.503 136.49L147.943 136.703L148.354 108.89L133.914 108.677ZM133.503 136.49L133.796 122.051L125.763 121.888L125.47 136.327L125.177 150.765L133.21 150.928L133.503 136.49ZM125.47 136.327L125.742 121.888C113.648 121.66 102.113 126.183 93.3998 134.553L103.405 144.967L113.411 155.381C116.611 152.307 120.755 150.682 125.198 150.766L125.47 136.327ZM103.405 144.967L93.3998 134.553C84.6726 142.938 79.7107 154.309 79.4827 166.406L93.9218 166.678L108.361 166.95C108.444 162.511 110.225 158.442 113.411 155.381L103.405 144.967ZM93.9218 166.678L79.4828 166.405L77.693 261.185L92.1321 261.457L106.571 261.73L108.361 166.95L93.9218 166.678ZM92.1321 261.457L77.693 261.187C77.2376 285.544 95.948 305.887 120.308 307.358L121.179 292.943L122.05 278.528C113.197 277.993 106.404 270.653 106.571 261.727L92.1321 261.457ZM121.179 292.943L120.406 307.364C120.693 307.379 120.976 307.392 121.184 307.401C121.415 307.412 121.571 307.419 121.71 307.426L122.483 293.005L123.257 278.584C122.969 278.569 122.686 278.556 122.479 278.547C122.247 278.537 122.092 278.53 121.953 278.522L121.179 292.943ZM122.483 293.005L122.211 307.444L253.708 309.928L253.981 295.489L254.254 281.05L122.756 278.566L122.483 293.005ZM253.981 295.489L253.709 309.928C265.802 310.156 277.338 305.633 286.051 297.262L276.045 286.848L266.04 276.434C262.84 279.508 258.696 281.133 254.253 281.05L253.981 295.489ZM276.045 286.848L286.051 297.262C294.778 288.877 299.74 277.506 299.968 265.41L285.529 265.138L271.09 264.866C271.006 269.305 269.225 273.374 266.04 276.434L276.045 286.848ZM285.529 265.138L299.968 265.41L301.757 170.631L287.318 170.358L272.879 170.085L271.09 264.865L285.529 265.138ZM287.318 170.358L301.758 170.628C302.213 146.272 283.503 125.929 259.142 124.457L258.271 138.873L257.4 153.288C266.254 153.823 273.046 161.162 272.879 170.088L287.318 170.358ZM258.271 138.873L259.045 124.452C258.759 124.436 258.477 124.424 258.269 124.414C258.038 124.404 257.881 124.397 257.741 124.389L256.967 138.81L256.194 153.231C256.48 153.246 256.762 153.259 256.969 153.268C257.2 153.279 257.357 153.286 257.498 153.293L258.271 138.873ZM256.967 138.81L257.175 124.37L254.536 124.332L254.329 138.772L254.121 153.212L256.76 153.25L256.967 138.81ZM254.329 138.772L268.769 138.995L269.198 111.151L254.758 110.928L240.318 110.706L239.889 138.55L254.329 138.772ZM254.758 110.928L269.197 111.202C269.565 91.7988 262.477 73.2038 249.248 58.9389L238.659 68.759L228.07 78.5791C236.221 87.3679 240.545 98.7282 240.319 110.655L254.758 110.928ZM238.659 68.759L249.261 58.9527C236.119 44.7454 218.192 36.2122 198.883 35.0615L198.024 49.4775L197.164 63.8935C208.98 64.5977 219.943 69.7926 228.057 78.5653L238.659 68.759ZM198.024 49.4775L184.028 53.0407L184.035 53.0653L198.03 49.5021L212.025 45.939L212.019 45.9143L198.024 49.4775ZM169.065 137.188L183.505 137.411L183.935 109.567L169.495 109.345L155.055 109.122L154.626 136.966L169.065 137.188ZM169.495 109.345L183.934 109.608C184.038 103.911 188.799 99.3259 194.502 99.4402L194.791 85.0015L195.081 70.5628C173.408 70.1282 155.451 87.4159 155.056 109.081L169.495 109.345ZM194.791 85.0015L194.081 99.4256C194.342 99.4385 194.598 99.4483 194.763 99.4547C194.956 99.4622 195.059 99.4663 195.144 99.4705L195.854 85.0463L196.564 70.6222C196.303 70.6093 196.047 70.5995 195.882 70.5932C195.689 70.5856 195.586 70.5815 195.501 70.5774L194.791 85.0015ZM195.854 85.0463L194.974 99.4611C200.566 99.8026 204.832 104.408 204.726 110.045L219.165 110.316L233.604 110.587C234.001 89.492 217.792 71.9173 196.734 70.6316L195.854 85.0463ZM219.165 110.316L204.725 110.103L204.314 137.916L218.754 138.129L233.194 138.343L233.605 110.529L219.165 110.316ZM218.754 138.129L219.029 123.69L169.365 122.743L169.09 137.182L168.815 151.621L218.479 152.568L218.754 138.129ZM169.09 137.182L165.527 123.187L165.502 123.193L169.065 137.188L172.629 151.184L172.653 151.177L169.09 137.182ZM192.381 249.21L193.332 234.8C199.674 235.218 204.851 240.571 204.676 247.267L190.239 246.89L175.803 246.512C175.564 255.642 182.628 263.039 191.43 263.62L192.381 249.21ZM190.239 246.89L204.678 247.164L205.046 227.854L190.607 227.579L176.168 227.304L175.8 246.615L190.239 246.89ZM190.607 227.579L205.045 227.892C205.231 219.281 200.304 211.509 192.778 207.831L186.438 220.806L180.097 233.782C177.735 232.628 176.106 230.167 176.169 227.266L190.607 227.579ZM186.438 220.806L192.729 207.807C192.302 207.601 191.983 207.117 191.991 206.578L177.552 206.349L163.112 206.12C162.926 217.828 169.54 228.672 180.146 233.806L186.438 220.806ZM177.552 206.349L191.99 206.648C191.996 206.368 192.072 206.155 192.186 205.979L180.099 198.077L168.011 190.175C164.909 194.919 163.23 200.41 163.113 206.05L177.552 206.349ZM180.099 198.077L192.187 205.979C192.35 205.728 192.526 205.59 192.675 205.511C192.823 205.432 193.009 205.377 193.258 205.382L193.556 190.944L193.854 176.505C183.382 176.289 173.699 181.474 168.011 190.175L180.099 198.077ZM193.556 190.944L193.999 205.379C193.491 205.394 193.088 205.373 192.85 205.356C192.651 205.342 192.496 205.323 192.646 205.339L194.224 190.984L195.802 176.629C195.7 176.618 194.511 176.466 193.114 176.509L193.556 190.944ZM194.224 190.984L193.363 205.4C193.695 205.42 194.095 205.63 194.327 205.998L206.552 198.308L218.776 190.619C213.62 182.422 204.789 177.148 195.084 176.568L194.224 190.984ZM206.552 198.308L194.34 206.018C194.464 206.214 194.533 206.438 194.528 206.718L208.968 206.973L223.407 207.228C223.511 201.329 221.899 195.567 218.763 190.599L206.552 198.308ZM208.968 206.973L194.529 206.67C194.525 206.897 194.453 207.143 194.3 207.372C194.148 207.6 193.954 207.753 193.756 207.84L199.544 221.071L205.333 234.302C216.114 229.585 223.161 218.987 223.406 207.276L208.968 206.973ZM199.544 221.071L193.787 207.827C185.94 211.238 180.855 218.925 180.691 227.411L195.13 227.689L209.569 227.967C209.517 230.694 207.893 233.189 205.302 234.315L199.544 221.071ZM195.13 227.689L180.691 227.414L180.324 246.725L194.763 247L209.202 247.275L209.569 227.964L195.13 227.689ZM194.763 247L180.323 246.78C180.426 240.012 186.007 234.67 192.74 234.808L192.443 249.247L192.146 263.685C201.363 263.874 209.061 256.521 209.203 247.219L194.763 247ZM192.443 249.247L188.88 235.251L188.781 235.277L192.344 249.272L195.907 263.267L196.006 263.242L192.443 249.247ZM192.344 249.272L204.748 256.667L204.785 256.605L192.381 249.21L179.977 241.814L179.94 241.876L192.344 249.272Z" fill="#0A0A0A" style="fill:#0A0A0A;fill:color(display-p3 0.0385 0.0385 0.0385);fill-opacity:1;" mask="url(#path-2-outside-1_19281_31704)"/>+<path d="M222.603 83.6654L166.571 82.7305L165.559 143.414L221.591 144.349L222.603 83.6654Z" fill="#0A0A0A" stroke="white" style="fill:#0A0A0A;fill:color(display-p3 0.0385 0.0385 0.0385);fill-opacity:1;stroke:white;stroke-opacity:1;" stroke-width="0.963729" stroke-miterlimit="10"/>+<path d="M239.089 169.587L155.453 164.492L149.056 269.513L232.691 274.608L239.089 169.587Z" fill="#0A0A0A" stroke="white" style="fill:#0A0A0A;fill:color(display-p3 0.0385 0.0385 0.0385);fill-opacity:1;stroke:white;stroke-opacity:1;" stroke-width="0.963729" stroke-miterlimit="10"/>+<path d="M120.105 290.547C104.802 289.606 93.0439 276.879 93.3421 261.529L95.1318 166.75C95.4408 151.029 108.467 138.486 124.181 138.77L134.668 138.965L135.118 108.724C135.727 76.7332 162.223 51.2173 194.208 51.8019C195.029 51.8292 195.851 51.8566 196.649 51.8902C227.755 53.7762 251.681 79.7044 251.074 110.879L250.624 141.121L255.673 141.229C256.068 141.233 256.495 141.256 256.896 141.285C272.199 142.226 283.957 154.953 283.659 170.303L281.869 265.082C281.56 280.803 268.534 293.347 252.82 293.063L121.322 290.579C120.927 290.574 120.5 290.552 120.098 290.522L120.105 290.547ZM193.217 188.545C192.951 188.534 192.71 188.516 192.445 188.505C186.154 188.372 180.341 191.455 176.903 196.747C175.049 199.585 174.026 202.895 173.954 206.331C173.83 213.381 177.838 219.932 184.197 223.019C185.937 223.864 187.019 225.639 186.978 227.542L186.611 246.853C186.572 249.386 188.503 251.497 191.043 251.666L191.253 251.665C193.867 251.709 196.021 249.636 196.065 247.022L196.433 227.711C196.474 225.808 197.634 224.067 199.379 223.281C205.837 220.454 210.122 214.052 210.246 207.002C210.31 203.436 209.35 199.974 207.459 196.985C204.36 192.043 199.033 188.878 193.211 188.52L193.217 188.545ZM194.792 82.5949C194.415 82.5595 194.019 82.555 193.648 82.5443C178.62 82.2694 166.166 94.2732 165.866 109.308L165.416 139.549L219.937 140.574L220.387 110.333C220.67 95.6441 209.421 83.4708 194.785 82.5702L194.792 82.5949Z" fill="#08C225" style="fill:#08C225;fill:color(display-p3 0.0314 0.7608 0.1451);fill-opacity:1;"/>+<path d="M136.164 141.45L166.381 142.012L165.419 115.206C165.419 115.206 163.794 93.6422 177.767 88.6386C191.741 83.6351 194.715 82.8251 194.715 82.8251L212.907 88.8141L221.632 105.941L218.936 134.073L219.03 143.014L250.73 143.618L251.934 104.877L245.227 86.8948L238.206 73.7764L223.417 60.1912L213.025 54.6876L190.785 51.3853L170.001 55.9673L155.74 65.8288L142.084 81.5822L139.223 91.4065L135.871 103.643L134.891 119.929L134.731 138.713L136.189 141.444L136.164 141.45Z" fill="white" style="fill:white;fill-opacity:1;"/>+<path d="M196.515 54.3663C226.045 56.154 249.231 81.035 248.656 110.888L248.173 143.582L255.65 143.729C256.021 143.74 256.392 143.751 256.763 143.761C270.65 144.616 281.501 156.259 281.235 170.287L279.445 265.066C279.167 279.464 267.286 290.928 252.863 290.657L121.365 288.173C120.994 288.162 120.624 288.151 120.253 288.141C106.365 287.286 95.5142 275.643 95.781 261.616L97.5708 166.836C97.8484 152.438 109.73 140.974 124.153 141.245L137.068 141.48L137.55 108.785C138.135 78.1418 163.511 53.6996 194.154 54.2839C194.945 54.2928 195.718 54.3327 196.515 54.3663ZM162.922 141.943L222.331 143.064L222.814 110.369C223.115 94.4141 210.712 81.1151 194.927 80.1392C194.501 80.1163 194.099 80.0871 193.679 80.0889C177.304 79.789 163.73 92.8666 163.43 109.242L162.947 141.937M190.891 254.068C190.891 254.068 191.101 254.067 191.181 254.073C195.142 254.142 198.391 251.001 198.467 247.065L198.834 227.754C198.849 226.778 199.444 225.917 200.339 225.505C207.48 222.372 212.498 215.338 212.672 207.039C212.741 202.868 211.587 198.955 209.515 195.671C206.105 190.229 200.188 186.504 193.353 186.089C193.062 186.084 192.766 186.055 192.475 186.05C185.103 185.902 178.588 189.638 174.85 195.4C172.806 198.523 171.599 202.248 171.517 206.265C171.368 214.558 176.126 221.785 183.141 225.178C184.014 225.613 184.58 226.494 184.566 227.47L184.199 246.781C184.129 250.637 187.096 253.824 190.916 254.061M196.828 49.5021C195.975 49.4564 195.122 49.4107 194.275 49.3897C160.962 48.749 133.353 75.3634 132.712 108.677L132.301 136.49L124.268 136.327C116 136.171 108.16 139.245 102.203 144.967C96.2467 150.69 92.8754 158.41 92.7196 166.678L90.9299 261.457C90.6188 278.098 103.37 291.94 119.977 292.943C120.404 292.966 120.855 292.982 121.281 293.005L252.779 295.489C261.047 295.645 268.887 292.571 274.843 286.848C280.8 281.125 284.171 273.406 284.327 265.138L286.116 170.358C286.427 153.717 273.676 139.876 257.069 138.873C256.643 138.85 256.192 138.833 255.765 138.81L253.127 138.772L253.556 110.928C253.853 95.2635 248.147 80.2859 237.457 68.759C226.829 57.269 212.384 50.405 196.821 49.4775L196.828 49.5021ZM167.863 137.188L168.293 109.345C168.543 95.6634 179.902 84.727 193.589 85.0015C193.935 85.0185 194.306 85.0293 194.652 85.0463C207.977 85.8599 218.214 96.95 217.963 110.316L217.552 138.129L167.888 137.182L167.863 137.188ZM191.179 249.21C189.949 249.129 189.005 248.107 189.037 246.89L189.405 227.579C189.466 224.724 187.818 222.068 185.236 220.806C179.719 218.136 176.252 212.473 176.349 206.349C176.411 203.389 177.288 200.537 178.897 198.077C181.886 193.504 186.91 190.831 192.354 190.944C192.589 190.937 192.805 190.96 193.022 190.984C198.04 191.284 202.655 194.026 205.349 198.308C206.979 200.89 207.82 203.884 207.766 206.973C207.638 213.079 203.948 218.618 198.342 221.071C195.715 222.213 193.984 224.809 193.928 227.689L193.561 247C193.541 248.266 192.483 249.272 191.241 249.247L191.142 249.272L191.179 249.21Z" fill="#0A0A0A" style="fill:#0A0A0A;fill:color(display-p3 0.0385 0.0385 0.0385);fill-opacity:1;"/>+<path d="M156.361 157.034L127.142 156.669C118.799 156.565 111.952 163.238 111.848 171.574C111.743 179.91 118.422 186.752 126.765 186.856L155.984 187.221C164.326 187.325 171.174 180.652 171.278 172.316C171.382 163.981 164.704 157.139 156.361 157.034Z" fill="white" fill-opacity="0.27" style="fill:white;fill-opacity:0.27;"/>+<path d="M102.728 74.8462C89.3356 76.9852 78.9047 85.2799 77.254 96.5039C78.9047 85.2799 71.3148 74.3483 59.0939 68.4288C72.4865 66.2898 82.9175 57.9952 84.5682 46.7712C82.9175 57.9952 90.5074 68.9267 102.728 74.8462Z" fill="#505050" style="fill:#505050;fill:color(display-p3 0.3137 0.3137 0.3137);fill-opacity:1;"/>+<path d="M60.0476 253.393C47.1184 258.746 38.6353 269.568 39.6655 281.228C38.6353 269.568 28.401 260.414 14.7188 257.398C27.6479 252.046 36.1311 241.224 35.1009 229.564C36.1311 241.224 46.3653 250.378 60.0476 253.393Z" fill="#505050" style="fill:#505050;fill:color(display-p3 0.3137 0.3137 0.3137);fill-opacity:1;"/>+<path d="M372.543 219.068C358.002 220.389 346.211 228.525 343.617 240.455C346.211 228.525 338.862 216.228 326.182 208.989C340.723 207.668 352.514 199.532 355.108 187.602C352.514 199.532 359.863 211.829 372.543 219.068Z" fill="#505050" style="fill:#505050;fill:color(display-p3 0.3137 0.3137 0.3137);fill-opacity:1;"/>+</svg>+`;++const LockIllustration: React.FC = () => (+ <Box+ aria-hiddensx={{- width: "min(420px, 85vw)",- minHeight: "375px",- px: { xs: 3, sm: 5 },- py: 5,- borderRadius: "20px",- boxShadow: "var(--mui-palette-boxShadow-paper)",- display: "flex",- alignItems: "center",- justifyContent: "center",+ width: 148,+ maxWidth: "100%",+ lineHeight: 0,+ "& svg": {+ display: "block",+ width: "100%",+ height: "auto",+ },}}+ dangerouslySetInnerHTML={{ __html: LOCK_ILLUSTRATION_SVG }}+ />+);++const AppLockCard: React.FC<+ React.PropsWithChildren<{ closeAction?: React.ReactNode }>+> = ({ children, closeAction }) => (+ <Paper+ elevation={0}+ sx={(theme) => ({+ width: 381,+ maxWidth: "calc(100% - 32px)",+ borderRadius: "28px",+ backgroundColor: "#fff",+ border: "1px solid #E0E0E0",+ boxShadow: "none",+ overflow: "visible",+ ...theme.applyStyles("dark", {+ backgroundColor: "#1B1B1B",+ border: "1px solid rgba(255, 255, 255, 0.18)",+ }),+ })}>- {children}+ <Box+ sx={{+ position: "relative",+ width: "100%",+ pt: closeAction ? 2 : 6,+ px: 2,+ pb: 2.5,+ }}+ >+ {closeAction && (+ <Box+ sx={{+ width: "100%",+ display: "flex",+ justifyContent: "flex-end",+ mb: 1,+ }}+ >+ {closeAction}+ </Box>+ )}+ <Box+ sx={{+ width: "100%",+ display: "flex",+ justifyContent: "center",+ }}+ >+ {children}+ </Box>+ </Box></Paper>);@@ -305,6 +563,7 @@ const PinUnlockForm: React.FC<UnlockFormProps> = ({appLock,isReauthentication,onLogout,+ closeAction,}) => {const { logout } = useBaseContext();@@ -312,6 +571,8 @@ const PinUnlockForm: React.FC<UnlockFormProps> = ({const [error, setError] = useState<string>();const [loading, setLoading] = useState(false);const inputRefs = useRef<(HTMLInputElement | null)[]>([]);+ const isSubmittingRef = useRef(false);+ const hasAutoSubmittedRef = useRef(false);const cooldown = useCooldownState(appLock.cooldownExpiresAt);const cooldownText = cooldown.text;@@ -362,8 +623,9 @@ const PinUnlockForm: React.FC<UnlockFormProps> = ({}, [pin, focusPinInput]);const handleSubmit = useCallback(async () => {- if (fullPin.length !== 4 || loading) return;+ if (fullPin.length !== 4 || loading || isSubmittingRef.current) return;+ isSubmittingRef.current = true;setLoading(true);try {const result: UnlockResult = await attemptUnlock(fullPin);@@ -377,6 +639,8 @@ const PinUnlockForm: React.FC<UnlockFormProps> = ({log.error("Unlock attempt failed", e);setError(t("generic_error"));setLoading(false);+ } finally {+ isSubmittingRef.current = false;}// Clear PIN after each attempt and refocus the first field.@@ -384,16 +648,21 @@ const PinUnlockForm: React.FC<UnlockFormProps> = ({focusPinInput(0);}, [fullPin, loading, logout, focusPinInput]);- // Auto-submit when all 4 digits are entered.useEffect(() => {- if (fullPin.length === 4) {- void handleSubmit();+ if (fullPin.length !== 4) {+ hasAutoSubmittedRef.current = false;+ return;}- }, [fullPin, handleSubmit]);++ if (loading || hasAutoSubmittedRef.current) return;++ hasAutoSubmittedRef.current = true;+ void handleSubmit();+ }, [fullPin, loading, handleSubmit]);if (cooldownText) {return (- <AppLockCard>+ <AppLockCard closeAction={closeAction}><CooldownScreenremainingMs={cooldown.remainingMs}cooldownText={cooldownText}@@ -405,29 +674,57 @@ const PinUnlockForm: React.FC<UnlockFormProps> = ({}return (- <AppLockCard>+ <AppLockCard closeAction={closeAction}><Stack- spacing={2}+ spacing={0}+ useFlexGapalignItems="center"- sx={{ maxWidth: 340, width: "100%" }}+ sx={{ maxWidth: 349, width: "100%" }}>- <LockOutlinedIcon sx={{ fontSize: 48, color: "text.muted" }} />- <Typography variant="h3">- {isReauthentication ? t("authenticate") : t("app_locked")}- </Typography>- <Typography variant="small" color="text.muted" sx={{ mb: 1 }}>- {t("enter_pin")}- </Typography>+ <Box+ sx={{+ mt: -2.5,+ mb: 1,+ display: "flex",+ justifyContent: "center",+ width: "100%",+ "& > *": {+ transform: "translateY(-4px)",+ },+ }}+ >+ <LockIllustration />+ </Box>++ <Box+ sx={{+ display: "flex",+ flexDirection: "column",+ alignItems: "center",+ gap: "9px",+ textAlign: "center",+ mb: 2,+ }}+ >+ <Typography sx={titleTextSx}>+ {isReauthentication ? t("authenticate") : t("app_locked")}+ </Typography>+ <Typography sx={subtitleTextSx}>+ Enter your app lock pin to unlock+ </Typography>+ </Box><Stackdirection="row"spacing={1.5}justifyContent="center"onClick={focusFirstEmptyPinInput}+ sx={{ mb: 0 }}>{pin.map((digit, i) => (<TextFieldkey={i}+ variant="standard"hiddenLabelautoFocus={i === 0}error={!!error}@@ -446,25 +743,47 @@ const PinUnlockForm: React.FC<UnlockFormProps> = ({autoComplete: "off",style: {textAlign: "center",- fontSize: "1.25rem",- padding: "12px 0",WebkitTextSecurity: "disc",},"aria-label": `PIN digit ${String(i + 1)}`,},}}- sx={{- width: 48,- "& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline":- {- borderColor: "accent.main",- borderWidth: 2,- },- }}+ sx={(theme) => ({+ ...inputFieldSx(theme, { borderRadius: 6 }),+ width: 56,+ "& .MuiInputBase-input": {+ padding: 0,+ textAlign: "center",+ height: "100%",+ fontSize: 20,+ fontWeight: 600,+ },+ })}/>))}</Stack>+ <FocusVisibleButton+ fullWidth+ color="accent"+ disabled={fullPin.length !== 4 || loading}+ onClick={() => {+ void handleSubmit();+ }}+ sx={(theme) => ({+ ...primaryActionButtonSx(theme),+ mt: 2,+ })}+ >+ {loading ? (+ <CircularProgress size={18} color="inherit" />+ ) : isReauthentication ? (+ t("authenticate")+ ) : (+ t("unlock")+ )}+ </FocusVisibleButton>+<ErrorMessageerror={error}attemptCount={appLock.invalidAttemptCount}@@ -480,6 +799,7 @@ const PasswordUnlockForm: React.FC<UnlockFormProps> = ({appLock,isReauthentication,onLogout,+ closeAction,}) => {const { logout } = useBaseContext();@@ -514,7 +834,7 @@ const PasswordUnlockForm: React.FC<UnlockFormProps> = ({if (cooldownText) {return (- <AppLockCard>+ <AppLockCard closeAction={closeAction}><CooldownScreenremainingMs={cooldown.remainingMs}cooldownText={cooldownText}@@ -526,26 +846,53 @@ const PasswordUnlockForm: React.FC<UnlockFormProps> = ({}return (- <AppLockCard>+ <AppLockCard closeAction={closeAction}><Stackcomponent="form"onSubmit={(e: React.FormEvent) => void handleSubmit(e)}- spacing={3}+ spacing={0}+ useFlexGapalignItems="center"- sx={{ maxWidth: 340, width: "100%" }}+ sx={{ maxWidth: 349, width: "100%" }}>- <LockOutlinedIcon sx={{ fontSize: 48, color: "text.muted" }} />- <Typography variant="h3">- {isReauthentication ? t("password") : t("app_locked")}- </Typography>- <Typography variant="small" color="text.muted">- {t("app_lock_enter_password")}- </Typography>+ <Box+ sx={{+ mt: -2.5,+ mb: 1,+ display: "flex",+ justifyContent: "center",+ width: "100%",+ "& > *": {+ transform: "translateY(-4px)",+ },+ }}+ >+ <LockIllustration />+ </Box>++ <Box+ sx={{+ display: "flex",+ flexDirection: "column",+ alignItems: "center",+ gap: "9px",+ textAlign: "center",+ mb: 2,+ }}+ >+ <Typography sx={titleTextSx}>+ {isReauthentication ? t("password") : t("app_locked")}+ </Typography>+ <Typography sx={subtitleTextSx}>+ {t("app_lock_enter_password")}+ </Typography>+ </Box><TextFieldinputRef={inputRef}fullWidthhiddenLabel+ variant="standard"autoFocuserror={!!error}type={showPassword ? "text" : "password"}@@ -571,6 +918,7 @@ const PasswordUnlockForm: React.FC<UnlockFormProps> = ({),},}}+ sx={inputFieldSx}/><FocusVisibleButton@@ -578,6 +926,10 @@ const PasswordUnlockForm: React.FC<UnlockFormProps> = ({fullWidthcolor="accent"disabled={!password || loading}+ sx={(theme) => ({+ ...primaryActionButtonSx(theme),+ mt: 2,+ })}>{isReauthentication ? t("authenticate") : t("unlock")}</FocusVisibleButton>@@ -593,9 +945,10 @@ const PasswordUnlockForm: React.FC<UnlockFormProps> = ({// -- Device lock unlock form ---const DeviceLockUnlockForm: React.FC<{ isReauthentication: boolean }> = ({- isReauthentication,-}) => {+const DeviceLockUnlockForm: React.FC<{+ isReauthentication: boolean;+ closeAction?: React.ReactNode;+}> = ({ isReauthentication, closeAction }) => {const [error, setError] = useState<string>();const [loading, setLoading] = useState(false);const isUnlockInProgress = useRef(false);@@ -620,23 +973,45 @@ const DeviceLockUnlockForm: React.FC<{ isReauthentication: boolean }> = ({}, []);return (- <AppLockCard>+ <AppLockCard closeAction={closeAction}><Stack- spacing={3}+ spacing={0}+ useFlexGapalignItems="center"- sx={{ maxWidth: 340, width: "100%" }}+ sx={{ maxWidth: 349, width: "100%" }}>- <FingerprintIcon sx={{ fontSize: 48, color: "text.muted" }} />- <Typography variant="h3">- {isReauthentication ? t("authenticate") : t("app_locked")}- </Typography>- <Typography- variant="small"- color="text.muted"- textAlign="center"+ <Box+ sx={{+ mt: -2.5,+ mb: 1,+ display: "flex",+ justifyContent: "center",+ width: "100%",+ "& > *": {+ transform: "translateY(-4px)",+ },+ }}>- {t("device_lock_login_instructions")}- </Typography>+ <LockIllustration />+ </Box>++ <Box+ sx={{+ display: "flex",+ flexDirection: "column",+ alignItems: "center",+ gap: "9px",+ textAlign: "center",+ mb: 2,+ }}+ >+ <Typography sx={titleTextSx}>+ {isReauthentication ? t("authenticate") : t("app_locked")}+ </Typography>+ <Typography sx={subtitleTextSx}>+ {t("device_lock_login_instructions")}+ </Typography>+ </Box><FocusVisibleButtonfullWidth@@ -645,6 +1020,15 @@ const DeviceLockUnlockForm: React.FC<{ isReauthentication: boolean }> = ({onClick={() => {void handleDeviceLockUnlock();}}+ sx={(theme) => ({+ ...primaryActionButtonSx(theme),+ backgroundColor: ENTE_GREEN,+ "&:hover": {+ backgroundColor: ENTE_GREEN_HOVER,+ },+ fontWeight: 600,+ mt: 2,+ })}>{loading ? (<CircularProgress size={18} color="inherit" />@@ -655,13 +1039,17 @@ const DeviceLockUnlockForm: React.FC<{ isReauthentication: boolean }> = ({)}</FocusVisibleButton>- <Typography- variant="small"- color={error ? "critical.main" : "text.muted"}- textAlign="center"- >- {error}- </Typography>+ {error && (+ <Typography+ sx={(theme) => ({+ ...subtitleTextSx(theme),+ color: theme.palette.error.main,+ mt: 0.75,+ })}+ >+ {error}+ </Typography>+ )}</Stack></AppLockCard>);@@ -678,9 +1066,11 @@ const ErrorMessage: React.FC<ErrorMessageProps> = ({ error, attemptCount }) => {if (error) {return (<Typography- variant="small"- color="critical.main"- textAlign="center"+ sx={(theme) => ({+ ...subtitleTextSx(theme),+ color: theme.palette.error.main,+ mt: 0.75,+ })}>{error}{attemptCount > 0 && ` (${String(attemptCount)}/10)`}@@ -765,78 +1155,76 @@ const CooldownScreen: React.FC<CooldownScreenProps> = ({attemptCount,onLogout,}) => {- const durationMs = appLockCooldownDurationMs(attemptCount);- const progress =- durationMs > 0- ? Math.min(100, ((durationMs - remainingMs) / durationMs) * 100)- : 0;+ void remainingMs;return (<Stack- spacing={1.25}+ spacing={0}useFlexGapalignItems="center"justifyContent="center"- sx={{ maxWidth: 380, width: "100%", px: 2 }}+ sx={{ maxWidth: 349, width: "100%" }}>- <Typography- variant="h3"- color="text.primary"- textAlign="center"- sx={{ mb: 2.5 }}+ <Box+ sx={{+ mt: -2.5,+ mb: 1,+ display: "flex",+ justifyContent: "center",+ width: "100%",+ "& > *": {+ transform: "translateY(-4px)",+ },+ }}>- {t("app_locked")}- </Typography>+ <LockIllustration />+ </Box>- <Box sx={{ position: "relative", display: "inline-flex", mb: 2 }}>- <CircularProgress- variant="determinate"- value={100}- size={112}- thickness={2.2}- sx={{ color: "var(--mui-palette-fill-faint)" }}- />- <CircularProgress- variant="determinate"- value={progress}- size={112}- thickness={2.6}- sx={{- position: "absolute",- left: 0,- color: "critical.main",- }}- />- <Box- sx={{- position: "absolute",- inset: 0,- display: "flex",- alignItems: "center",- justifyContent: "center",- }}- >- <Typography- variant="body"- color="critical.main"- textAlign="center"- >- {cooldownText}- </Typography>- </Box>+ <Box+ sx={{+ display: "flex",+ flexDirection: "column",+ alignItems: "center",+ gap: "9px",+ textAlign: "center",+ mb: 2,+ }}+ >+ <Typography sx={titleTextSx}>{t("app_locked")}</Typography>+ <Typography sx={subtitleTextSx}>Please try again in</Typography></Box>- <Typography variant="small" color="text.muted" textAlign="center">- {t("wrong_unlock_code", { count: attemptCount })}+ <Typography+ sx={(theme) => ({+ fontWeight: 600,+ fontSize: 33,+ lineHeight: "40px",+ color: theme.palette.error.main,+ textAlign: "center",+ mb: 2,+ })}+ >+ {cooldownText}</Typography>+<FocusVisibleButtonfullWidthcolor="secondary"onClick={onLogout}- sx={{ mt: 1 }}+ sx={secondaryActionButtonSx}>{t("logout")}</FocusVisibleButton>+ <Typography+ sx={(theme) => ({+ ...subtitleTextSx(theme),+ mt: 1.25,+ fontSize: 12,+ lineHeight: "16px",+ })}+ >+ {t("wrong_unlock_code", { count: attemptCount })}+ </Typography></Stack>);};diff --git a/web/packages/new/photos/services/app-lock.ts b/web/packages/new/photos/services/app-lock.tsindex 3cbc7d256d..04829dc60b 100644--- a/web/packages/new/photos/services/app-lock.ts+++ b/web/packages/new/photos/services/app-lock.ts@@ -83,6 +83,7 @@ class AppLockModuleState {let _state: AppLockModuleState | undefined;let _bruteForceStateHydration = Promise.resolve();let _bruteForceStateHydrationGeneration = 0;+let _wasReauthenticationCancelled = false;const appLockState = () => {_state ??= new AppLockModuleState();@@ -562,6 +563,7 @@ const resetBruteForceState = async () => {const unlockLocally = () => {const snapshot = appLockState().snapshot;+ const wasReauthentication = snapshot.lockScreenMode === "reauthenticate";setSnapshot({...snapshot,lockScreenMode: "lock",@@ -569,6 +571,26 @@ const unlockLocally = () => {invalidAttemptCount: 0,cooldownExpiresAt: 0,});+ if (wasReauthentication) {+ _wasReauthenticationCancelled = false;+ }+ stopBruteForceStateHydration();+};++/**+ * Cancel an in-progress explicit reauthentication prompt.+ *+ * This only dismisses the reauthentication lock screen, allowing callers of+ * {@link reauthenticateWithAppLock} to fall back to alternate auth flows.+ */+export const cancelReauthentication = () => {+ const snapshot = appLockState().snapshot;+ if (!snapshot.isLocked || snapshot.lockScreenMode !== "reauthenticate") {+ return;+ }++ _wasReauthenticationCancelled = true;+ setSnapshot({ ...snapshot, lockScreenMode: "lock", isLocked: false });stopBruteForceStateHydration();};@@ -857,12 +879,20 @@ export const attemptUnlock = async (input: string): Promise<UnlockResult> => {/*** Perform an explicit reauthentication using app lock.*- * Returns `true` when app lock was successfully used for reauthentication.- * Returns `false` when app lock is unavailable or cannot be started, so callers- * can fall back to an alternate flow (for example, master password prompt).- */-export const reauthenticateWithAppLock = async (): Promise<boolean> => {+ * - `"authenticated"` when app lock reauthentication succeeds.+ * - `"cancelled"` when the user dismisses the reauthentication prompt.+ * - `"fallback"` when app lock is unavailable or cannot be started, so callers+ * can use an alternate auth flow (for example, master password prompt).+ */+export type ReauthenticateWithAppLockResult =+ | "authenticated"+ | "cancelled"+ | "fallback";++export const reauthenticateWithAppLock =+ async (): Promise<ReauthenticateWithAppLockResult> => {try {+ _wasReauthenticationCancelled = false;const snapshot = appLockSnapshot();let canUseAppLock = snapshot.enabled && snapshot.lockType !== "none";if (canUseAppLock && snapshot.lockType === "device") {@@ -871,25 +901,30 @@ export const reauthenticateWithAppLock = async (): Promise<boolean> => {const capability = await resolveDeviceLockCapability();canUseAppLock = capability.usable;}- if (!canUseAppLock) return false;+ if (!canUseAppLock) return "fallback";- return await new Promise<boolean>((resolve) => {+ return await new Promise<ReauthenticateWithAppLockResult>((resolve) => {const unsubscribe = appLockSubscribe(() => {if (!appLockSnapshot().isLocked) {unsubscribe();- resolve(true);+ const wasAuthenticated =+ !_wasReauthenticationCancelled;+ _wasReauthenticationCancelled = false;+ resolve(+ wasAuthenticated ? "authenticated" : "cancelled",+ );}});lock("reauthenticate");if (!appLockSnapshot().isLocked) {unsubscribe();- resolve(false);+ resolve("fallback");}});} catch (e) {log.error("Failed to start app lock reauthentication", e);- return false;+ return "fallback";}};@@ -922,6 +957,7 @@ export const logoutAppLock = async () => {]);stopBruteForceStateHydration();+ _wasReauthenticationCancelled = false;_state = undefined;};