diff --git a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawBleCommunicator.java b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawBleCommunicator.java index 5e0ee3b0..abd08337 100644 --- a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawBleCommunicator.java +++ b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawBleCommunicator.java @@ -1686,17 +1686,44 @@ public class FaceclawBleCommunicator implements FaceclawBleListener, Runnable { ); faceclawWakeNotification = true; lastConnectionOrInputAtMs = lastIncomingAtMs; + // The event type says which gesture woke the glasses: TS + // gives a head-up the Glanceboard and a double tap the + // regular UI. The claim handshake is the same for both. + boolean headUp = BleProtocol.parseFaceclawWakeEventCode(frame.pb) + == BleProtocol.FACECLAW_WAKE_EVENT_HEAD_UP; event = new G2Event( "display-wake", "", - BleProtocol.EVENT_DOUBLE_CLICK, + headUp ? BleProtocol.EVENT_HEAD_UP : BleProtocol.EVENT_DOUBLE_CLICK, 0, 0 ); - logLine("claimed deferred dashboard wake nonce=" + wakeNonce); + logLine("claimed deferred dashboard wake nonce=" + wakeNonce + + (headUp ? " (head-up)" : "")); } } if (!faceclawWakeNotification + && shutdownRequested + && frame.ok + && frame.sid == BleProtocol.SID_UI_SETTING + && address.equalsIgnoreCase(rightAddress)) { + // CFW idle-gesture forwarding (firmware revision 2+): with no + // EvenHub page the stock display thread drops taps, long + // presses and releases; the CFW reports them on the settings + // sid while our wake lease is held. Deliver them as the + // sys-events a live page would have produced, so TS treats a + // sleep-time tap or hold exactly like one during soft sleep + // (the Glanceboard). + BleProtocol.FaceclawGestureEvent gesture = BleProtocol.parseFaceclawGestureEvent(frame.pb); + if (gesture != null) { + lastConnectionOrInputAtMs = lastIncomingAtMs; + event = new G2Event("sys-event", "", gesture.eventType, gesture.eventSource, 0); + logLine("idle gesture forwarded by CFW: type=" + gesture.eventType + + " source=" + gesture.eventSource); + } + } + if (!faceclawWakeNotification + && event == null && shutdownRequested && address.equalsIgnoreCase(rightAddress) && BleProtocol.isDisplayWakeStateChange(frame)) { @@ -1770,6 +1797,15 @@ public class FaceclawBleCommunicator implements FaceclawBleListener, Runnable { && address.equalsIgnoreCase(rightAddress) && (frame.flag == BleProtocol.FLAG_NOTIFY || frame.flag == BleProtocol.FLAG_NOTIFY_ALT)) { event = G2Event.decode(frame); + if (event != null + && "sys-event".equals(event.kind) + && event.eventType == BleProtocol.EVENT_HEAD_UP) { + // CFW forwards the IMU head-up while our page is on screen + // (soft sleep). Surface it as the same wake-only input the + // deferred head-up wake produces from a dark display. + event = new G2Event("display-wake", "", BleProtocol.EVENT_HEAD_UP, event.eventSource, 0); + logLine("head-up forwarded by CFW while page on screen"); + } if (event != null) { // Pure IMU samples arrive continuously; don't let them count // as user input (which would starve battery polling). diff --git a/App_Resources/Android/src/main/java/com/faceclaw/app/g2protocol/BleProtocol.java b/App_Resources/Android/src/main/java/com/faceclaw/app/g2protocol/BleProtocol.java index 0d4fa794..20a4b2eb 100644 --- a/App_Resources/Android/src/main/java/com/faceclaw/app/g2protocol/BleProtocol.java +++ b/App_Resources/Android/src/main/java/com/faceclaw/app/g2protocol/BleProtocol.java @@ -71,6 +71,19 @@ public class BleProtocol { public static final int FACECLAW_WEAR_OP_QUERY = 7; public static final int CFW_IMAGE_MODE_CLEANUP = 11; private static final int FACECLAW_WAKE_EVENT = 1; + // Field-102 deferred wake from the IMU head-up (Faceclaw firmware revision + // 3+); same nonce handshake as the double-tap wake event 1. + public static final int FACECLAW_WAKE_EVENT_HEAD_UP = 5; + // Field-102 idle-gesture events (Faceclaw firmware revision 2+): gestures the + // stock display thread drops while no app is on screen, forwarded while the + // wake lease is held. Their last two bytes are the raw touch source and 0. + public static final int FACECLAW_GESTURE_EVENT_TAP = 2; + public static final int FACECLAW_GESTURE_EVENT_LONG_PRESS = 3; + public static final int FACECLAW_GESTURE_EVENT_LONG_PRESS_RELEASE = 4; + // The display thread's raw touch sources, as the firmware reports them. + private static final int FACECLAW_RAW_SOURCE_LEFT_TEMPLE = 0; + private static final int FACECLAW_RAW_SOURCE_RIGHT_TEMPLE = 1; + private static final int FACECLAW_RAW_SOURCE_RING = 4; private static final int FACECLAW_WAKE_PROTOCOL_VERSION = 1; // UI_FOREGROUND_EVEN_AI_ID: the stock "Even AI" assistant app. It is a // FOREGROUND app, whereas EvenHub (and therefore faceclaw) is the @@ -111,6 +124,9 @@ public class BleProtocol { public static final int EVENT_RING_LONG_PRESS_RELEASE = 10; // CFW extension: G2 2.2.9 tap-then-hold gesture forwarded to the phone. public static final int EVENT_SHORT_THEN_LONG_PRESS = 11; + // CFW extension (firmware revision 3+): the IMU head-up, forwarded as a + // sys-event while an EvenHub page is on screen (soft sleep). + public static final int EVENT_HEAD_UP = 12; public static final int EVENT_SOURCE_GLASSES_R = 1; public static final int EVENT_SOURCE_RING = 2; @@ -501,23 +517,100 @@ public class BleProtocol { } /** - * Return the uint16 wake nonce from a CFW field-102 notification, or -1 - * when this is an ordinary settings frame. + * Return the uint16 wake nonce from a CFW field-102 deferred-wake + * notification (double tap or head-up), or -1 when this is an ordinary + * settings frame (idle-gesture events included). */ public static int parseFaceclawWakeEvent(byte[] pb) { + byte[] event = faceclawWakeEventBytes(pb); + return event == null ? -1 : (event[4] & 0xff) | ((event[5] & 0xff) << 8); + } + + /** + * Which gesture a CFW deferred-wake notification reports: 1 (double tap) + * or FACECLAW_WAKE_EVENT_HEAD_UP; -1 when the frame is not a wake event. + */ + public static int parseFaceclawWakeEventCode(byte[] pb) { + byte[] event = faceclawWakeEventBytes(pb); + return event == null ? -1 : (event[3] & 0xff); + } + + private static byte[] faceclawWakeEventBytes(byte[] pb) { if (pb == null) { - return -1; + return null; } byte[] event = readFieldBytes(stripTrailingCrc(pb), FACECLAW_WAKE_EVENT_FIELD); if (event == null || event.length != 6 || event[0] != 'F' || event[1] != 'C' - || (event[2] & 0xff) != FACECLAW_WAKE_PROTOCOL_VERSION - || (event[3] & 0xff) != FACECLAW_WAKE_EVENT) { - return -1; + || (event[2] & 0xff) != FACECLAW_WAKE_PROTOCOL_VERSION) { + return null; } - return (event[4] & 0xff) | ((event[5] & 0xff) << 8); + int code = event[3] & 0xff; + return code == FACECLAW_WAKE_EVENT || code == FACECLAW_WAKE_EVENT_HEAD_UP ? event : null; + } + + /** An idle gesture from a CFW field-102 notification, in EvenHub sys-event terms. */ + public static final class FaceclawGestureEvent { + public final int eventType; + public final int eventSource; + + FaceclawGestureEvent(int eventType, int eventSource) { + this.eventType = eventType; + this.eventSource = eventSource; + } + } + + /** + * Decode a CFW field-102 idle-gesture event (tap, long press, release + * while no app is on screen) into the EvenHub sys-event type and source + * the same gesture would carry from a live page, or null when the frame + * is not one (ordinary settings frames and the double-tap wake event + * included). + */ + public static FaceclawGestureEvent parseFaceclawGestureEvent(byte[] pb) { + if (pb == null) { + return null; + } + byte[] event = readFieldBytes(stripTrailingCrc(pb), FACECLAW_WAKE_EVENT_FIELD); + if (event == null + || event.length != 6 + || event[0] != 'F' + || event[1] != 'C' + || (event[2] & 0xff) != FACECLAW_WAKE_PROTOCOL_VERSION) { + return null; + } + int eventType; + switch (event[3] & 0xff) { + case FACECLAW_GESTURE_EVENT_TAP: + eventType = EVENT_CLICK; + break; + case FACECLAW_GESTURE_EVENT_LONG_PRESS: + eventType = EVENT_RING_LONG_PRESS; + break; + case FACECLAW_GESTURE_EVENT_LONG_PRESS_RELEASE: + eventType = EVENT_RING_LONG_PRESS_RELEASE; + break; + default: + return null; + } + int eventSource; + switch (event[4] & 0xff) { + case FACECLAW_RAW_SOURCE_LEFT_TEMPLE: + eventSource = EVENT_SOURCE_GLASSES_L; + break; + case FACECLAW_RAW_SOURCE_RIGHT_TEMPLE: + eventSource = EVENT_SOURCE_GLASSES_R; + break; + case FACECLAW_RAW_SOURCE_RING: + eventSource = EVENT_SOURCE_RING; + break; + default: + eventSource = 0; + break; + } + return new FaceclawGestureEvent(eventType, eventSource); } /** diff --git a/CHANGELOG b/CHANGELOG index e045fa54..a10a75f9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -13,6 +13,7 @@ * Change the styling and add more customization options for battery indicators * Expand Pinball game * Add Flappy game +* Add Glanceboard app ## 0.6.5 - 2026-09-04 * Changed context menu gestures: — for system, ●— for app context menu. diff --git a/app/apps/all-apps.ts b/app/apps/all-apps.ts index 42dfd8e6..864b8536 100644 --- a/app/apps/all-apps.ts +++ b/app/apps/all-apps.ts @@ -23,6 +23,7 @@ import pinballApp from "./pinball"; import flappyApp from "./flappy"; import developerApp from "./developer"; import evenhubApp from "./evenhub"; +import glanceboardApp from "./glanceboard"; import settingsApp from "./settings"; /** @@ -55,5 +56,6 @@ export const ALL_APPS: readonly AppDefinition[] = [ flappyApp, developerApp, evenhubApp, + glanceboardApp, settingsApp, ]; diff --git a/app/apps/app-definition.ts b/app/apps/app-definition.ts index f5872232..25940ab8 100644 --- a/app/apps/app-definition.ts +++ b/app/apps/app-definition.ts @@ -32,6 +32,37 @@ export type AppDefinition = { showInLauncher?: boolean; /** Present on the app that handles text shared via the Android share intent. */ openSharedText?: (ctx: AppContext, title: string, text: string) => void; + /** + * Present on the app that supplies the Glanceboard: the sleep-time display + * the controller shows on a tap or hold while the shell is asleep (see + * app/g2/glance-host.ts). At most one app provides it. + */ + glanceboard?: GlanceboardProvider; +}; + +/** A board the glance host can show while the shell sleeps. */ +export type GlanceboardProvider = { + /** Board pixel size; the host centres it in the standard 576x288 band. */ + size: { width: number; height: number }; + /** Whether sleep-time gestures should show the board at all (user setting). */ + isEnabled: () => boolean; + /** How long a tap or head-tilt keeps the board up. */ + tapTimeoutMs: () => number; + /** Whether a long-press holds the board up until released. */ + showOnLongPress: () => boolean; + /** Whether the head-tilt wake goes to the board rather than the regular UI. */ + showOnHeadTilt: () => boolean; + /** A fresh board; requestRender asks the host to repaint it. */ + createBoard: (requestRender: () => void) => GlanceBoardInstance; +}; + +export type GlanceBoardInstance = { + /** The board is about to show: start widgets (subscriptions, hardware). */ + start: () => void; + /** The board was hidden: stop everything start began. */ + stop: () => void; + /** Paint the board at its size. */ + paint: () => GrayImage; }; export type AppLaunchParams = { diff --git a/app/apps/calendar/calendar.ts b/app/apps/calendar/calendar.ts index 86907634..d2cc8629 100644 --- a/app/apps/calendar/calendar.ts +++ b/app/apps/calendar/calendar.ts @@ -178,7 +178,7 @@ function dayKeyOf(timestampMs: number): string { return `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`; } -function dayHeaderLabel(timestampMs: number): string { +export function dayHeaderLabel(timestampMs: number): string { const date = new Date(timestampMs); const now = new Date(); const midnight = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime(); @@ -189,7 +189,7 @@ function dayHeaderLabel(timestampMs: number): string { return base; } -function formatEventTime(timestampMs: number): string { +export function formatEventTime(timestampMs: number): string { const date = new Date(timestampMs); const minutes = String(date.getMinutes()).padStart(2, "0"); const hour24 = date.getHours(); diff --git a/app/apps/compass/compass-app.ts b/app/apps/compass/compass-app.ts index a0f75e18..85e0f287 100644 --- a/app/apps/compass/compass-app.ts +++ b/app/apps/compass/compass-app.ts @@ -23,6 +23,7 @@ import { import { shell } from "../../ui/shell/shell"; import { ensureLocationPermission, hasLocationPermission } from "../../g2/android-permissions"; import { isCompassCalibrated, normalizeHeading } from "./calibration"; +import { cardinalDirection, createCompassBackground, drawCompassRose, layoutCompassRose, TICK_HEIGHT } from "./compass-rose"; import { CompassCalibrationLayer } from "./calibration-layer"; import { getDeclinationAvailability, onDeclinationChanged, refreshDeclination } from "./declination"; import { getNorthReference, resolveHeading, setNorthReference, type NorthReference } from "./heading"; @@ -41,59 +42,6 @@ const EDGE_PAD = 8; /** Cap on the rose's radius, so a tall window doesn't get a comical one. */ const MAX_ROSE_RADIUS = 98; -/** - * The rose is drawn as a flat disc lying in front of the wearer, tilted away - * from vertical: `TILT_SQUASH` is how much that tilt shortens the depth axis, - * and `TILT_PERSPECTIVE` how much nearer parts of the disc are magnified - * relative to farther ones. Together they turn the ring into an egg-shaped - * oval — wider and taller at the bottom — and give the rose's points their - * foreshortening for free. - */ -const TILT_SQUASH = 0.42; -const TILT_PERSPECTIVE = 0.22; -/** Screen height of the projected ring, per unit of radius. */ -const RING_HEIGHT_PER_RADIUS = - TILT_SQUASH * (1 / (1 + TILT_PERSPECTIVE) + 1 / (1 - TILT_PERSPECTIVE)); -/** Screen half-width of the projected ring, per unit of radius. */ -const RING_HALF_WIDTH_PER_RADIUS = 1 / Math.sqrt(1 - TILT_PERSPECTIVE * TILT_PERSPECTIVE); - -/** Tip radii of the rose's long and short points, as a fraction of the ring. */ -const CARDINAL_TIP = 0.9; -const INTERCARDINAL_TIP = 0.54; -/** Radius the point bases sit on: how fat the rose is at its waist. */ -const POINT_BASE_RADIUS = 0.17; -/** Half-angle of a point's base. 22.5° makes neighbouring bases just meet. */ -const POINT_BASE_HALF_ANGLE = 22.5; -/** - * A polar grid lying in the same plane as the disc, to give it somewhere to - * sit and to fill the empty flanks either side of it. Rings are multiples of - * the disc's radius; spokes are offset by half a step so none runs up the - * middle into the heading tick. - */ -const PLANE_RINGS = [1.35, 1.8, 2.5, 3.6, 5.6]; -const PLANE_SPOKE_STEP = 30; -/** Grid brightness at the disc's rim, and how fast it falls off with distance. */ -const PLANE_NEAR_VALUE = 78; -const PLANE_FALLOFF = 0.55; -/** Dimmer than this is left unpainted, so the grid ends by vanishing. */ -const PLANE_CUTOFF = 22; -/** Height over which the grid fades out as it approaches the readout. */ -const PLANE_FADE_SPAN = 45; - -/** Size of the fixed tick that marks the direction the wearer is facing. */ -const TICK_HEIGHT = 7; -const TICK_HALF_WIDTH = 4; -/** Depth of the disc's side wall, as a fraction of the ring's radius. */ -const DISC_DEPTH = 0.1; -/** - * Rim angle at which the silhouette turns vertical. Between this and its - * mirror the wall faces the wearer; outside it the rim curves back away, so a - * wall drawn there would hook inward instead of ending on the vertical edge. - */ -const WALL_START_ANGLE = (Math.acos(-TILT_PERSPECTIVE) * 180) / Math.PI; -/** Side-wall shading, from the edges of the silhouette to the nearest point. */ -const WALL_DARK = 20; -const WALL_LIT = 62; class CompassLayer implements Layer { private rawHeading: number | null = null; @@ -233,21 +181,15 @@ class CompassLayer implements Layer { // The rose is sized and placed first — it hangs off the bottom edge — and // the readout then floats in whatever room is left above it. const textHeight = readoutHeight + 4 + statusLines.length * smallStep; - const radius = Math.max( - 24, - Math.min( - MAX_ROSE_RADIUS, - Math.floor( - (height - BOTTOM_PAD - TOP_PAD - textHeight - STACK_GAP - TICK_HEIGHT) - / (RING_HEIGHT_PER_RADIUS + DISC_DEPTH), - ), - Math.floor((Math.min(cx, width - cx) - EDGE_PAD) / RING_HALF_WIDTH_PER_RADIUS), - ), - ); - // The wall hangs below the rim, so the near rim sits a wall's depth up - // from the bottom padding rather than on it. - const cy = height - BOTTOM_PAD - discDepth(radius) - (radius * TILT_SQUASH) / (1 - TILT_PERSPECTIVE); - const ringTop = cy - (radius * TILT_SQUASH) / (1 + TILT_PERSPECTIVE); + const { cy, radius, ringTop } = layoutCompassRose({ + width, + height, + cx, + topClearance: TOP_PAD + textHeight + STACK_GAP, + bottomPad: BOTTOM_PAD, + edgePad: EDGE_PAD, + maxRadius: MAX_ROSE_RADIUS, + }); let y = Math.max(TOP_PAD, Math.round((ringTop - TICK_HEIGHT - textHeight) / 2)); const fade = heading === null ? 0.45 : 1; @@ -356,257 +298,3 @@ function frameStatusText(): string { return "Magnetic heading - waiting for location"; } } - -function cardinalDirection(heading: number): string { - const names = ["N", "NE", "E", "SE", "S", "SW", "W", "NW"]; - return names[Math.round(normalizeHeading(heading) / 45) % names.length]!; -} - -interface Point { - x: number; - y: number; -} - -/** - * Project a point of the rose's plane onto the screen. `angle` is degrees - * clockwise from the far side of the disc — the direction the wearer faces — - * and `radius` is a fraction of the rose's outer ring. - */ -function projectRose(cx: number, cy: number, scale: number, radius: number, angle: number): Point { - const radians = (angle * Math.PI) / 180; - const across = radius * Math.sin(radians); - const away = radius * Math.cos(radians); - const depth = 1 + TILT_PERSPECTIVE * away; - return { - x: cx + (across * scale) / depth, - y: cy - (away * scale * TILT_SQUASH) / depth, - }; -} - -/** - * Bounds of every orientation of the rotating points. The longest tip sweeps - * a circle in the disc's plane; perspective projects it to an offset ellipse. - * Round outward so all rasterized triangle pixels fit inside the rectangle. - */ -function rotatingRoseBounds(cx: number, cy: number, radius: number): { - x: number; y: number; width: number; height: number; -} { - const perspective = TILT_PERSPECTIVE * CARDINAL_TIP; - const halfWidth = radius * CARDINAL_TIP / Math.sqrt(1 - perspective * perspective); - const depth = radius * CARDINAL_TIP * TILT_SQUASH; - const x = Math.floor(cx - halfWidth); - const y = Math.floor(cy - depth / (1 + perspective)); - return { - x, - y, - width: Math.ceil(cx + halfWidth) - x, - height: Math.ceil(cy + depth / (1 - perspective)) - y, - }; -} - -/** - * Keep the fixed pixels inside the rotating rose's dirty rectangle as one - * immutable texture. The wire planner can omit them from each raster delta - * and restore them with a cached image draw. Outside that rectangle the - * background stays raster, since heading updates do not change it. - * - * The texture uses transparent zero for the empty disc interior, so it can - * overlay the rotating points. Its only ink over the points is the fixed - * heading tick, which belongs on top of them. - */ -function createCompassBackground( - width: number, height: number, cx: number, cy: number, radius: number, clipY: number, fade: number, -): GrayImage { - const image = new GrayImage(width, height, 0); - drawPlaneGrid(image, cx, cy, radius, clipY); - drawDiscWall(image, cx, cy, radius, fade); - drawTiltedRing(image, cx, cy, radius, 105 * fade); - drawHeadingTick(image, cx, cy, radius, 255 * fade); - - const bounds = rotatingRoseBounds(cx, cy, radius); - const left = Math.max(0, bounds.x); - const top = Math.max(0, bounds.y); - const right = Math.min(width, bounds.x + bounds.width); - const bottom = Math.min(height, bounds.y + bounds.height); - if (right > left && bottom > top) { - const texture = new GrayImage(right - left, bottom - top, 0); - texture.bitBlt(image, 0, 0, { sx: left, sy: top, width: texture.width, height: texture.height }); - image.fillRect(left, top, texture.width, texture.height, 0); - image.drawImage(texture, left, top); - } - return image; -} - -/** Draw only the rotating points, with the brightest one aimed at north. */ -function drawCompassRose(image: GrayImage, cx: number, cy: number, radius: number, heading: number | null): void { - // Without a reading there is nothing to aim, so show the rose in its resting - // orientation, dimmed, rather than an empty ring. - const fade = heading === null ? 0.45 : 1; - const bearing = heading ?? 0; - // Short points first, so the long ones sit on top of them at the waist. Only - // north is drawn at full brightness: the other seven are there to make the - // rose read as a rose, and competing with north would defeat the point. - for (const degrees of [45, 135, 225, 315]) { - drawRosePoint(image, cx, cy, radius, degrees - bearing, INTERCARDINAL_TIP, 85 * fade, 40 * fade); - } - for (const degrees of [90, 180, 270]) { - drawRosePoint(image, cx, cy, radius, degrees - bearing, CARDINAL_TIP, 120 * fade, 55 * fade); - } - drawRosePoint(image, cx, cy, radius, -bearing, CARDINAL_TIP, 255 * fade, 140 * fade); -} - -/** - * One point of the rose: a tapered spike split down its axis into a lit and a - * shaded facet, which is what keeps the eight points readable once perspective - * has squashed the ones lying across the wearer's line of sight. - */ -function drawRosePoint( - image: GrayImage, - cx: number, - cy: number, - radius: number, - angle: number, - tipRadius: number, - litValue: number, - shadedValue: number, -): void { - const centre = { x: cx, y: cy }; - const tip = projectRose(cx, cy, radius, tipRadius, angle); - const clockwise = projectRose(cx, cy, radius, POINT_BASE_RADIUS, angle + POINT_BASE_HALF_ANGLE); - const anticlockwise = projectRose(cx, cy, radius, POINT_BASE_RADIUS, angle - POINT_BASE_HALF_ANGLE); - fillTriangle(image, tip, centre, clockwise, litValue); - fillTriangle(image, tip, centre, anticlockwise, shadedValue); -} - -/** - * The side wall below the wearer-facing arc of the rim, which turns the tilted - * disc into a shallow cylinder. The arc runs between the two points where the - * silhouette turns vertical, so the wall ends flush with that vertical edge, - * and it is shaded from dark there to lit where it faces the wearer head-on. - */ -function drawDiscWall(image: GrayImage, cx: number, cy: number, radius: number, fade: number): void { - const depth = discDepth(radius); - const segments = 48; - const sweep = 360 - WALL_START_ANGLE * 2; - const rimValue = 105 * fade; - let previous = projectRose(cx, cy, radius, 1, WALL_START_ANGLE); - image.drawLine(previous.x, previous.y, previous.x, previous.y + depth, rimValue); - for (let i = 1; i <= segments; i++) { - const angle = WALL_START_ANGLE + (i * sweep) / segments; - const point = projectRose(cx, cy, radius, 1, angle); - // Quads rather than per-column lines, so no gap opens up where the rim - // runs nearly horizontal across the bottom of the oval. - const value = (WALL_DARK + (WALL_LIT - WALL_DARK) * wallFacing(angle)) * fade; - const top = { x: previous.x, y: previous.y }; - const next = { x: point.x, y: point.y }; - fillTriangle(image, top, next, { x: next.x, y: next.y + depth }, value); - fillTriangle(image, top, { x: top.x, y: top.y + depth }, { x: next.x, y: next.y + depth }, value); - image.drawLine(top.x, top.y + depth, next.x, next.y + depth, rimValue); - previous = point; - } - image.drawLine(previous.x, previous.y, previous.x, previous.y + depth, rimValue); -} - -/** 1 where the wall faces the wearer head-on, 0 at the silhouette's edges. */ -function wallFacing(angle: number): number { - const towardWearer = -Math.cos((angle * Math.PI) / 180); - return (towardWearer - TILT_PERSPECTIVE) / (1 - TILT_PERSPECTIVE); -} - -/** - * The grid the disc sits on, drawn before the disc so the disc occludes it. - * Brightness falls off with distance and fades to nothing as the plane climbs - * towards `clipY`, so the grid dissolves into the black under the readout - * rather than stopping at a hard edge. - */ -function drawPlaneGrid(image: GrayImage, cx: number, cy: number, radius: number, clipY: number): void { - const shade = (point: Point, ringRadius: number): number => { - if (point.y > image.height || Math.abs(point.x - cx) > image.width) return 0; - const fade = Math.max(0, Math.min(1, (point.y - clipY) / PLANE_FADE_SPAN)); - const value = (PLANE_NEAR_VALUE / (1 + PLANE_FALLOFF * (ringRadius - 1))) * fade; - return value >= PLANE_CUTOFF ? value : 0; - }; - const trace = ( - steps: number, - at: (step: number) => { point: Point; ringRadius: number }, - ): void => { - let previous: Point | null = null; - let previousValue = 0; - for (let i = 0; i <= steps; i++) { - const { point, ringRadius } = at(i); - const value = shade(point, ringRadius); - if (previous !== null && previousValue > 0 && value > 0) { - image.drawLine(previous.x, previous.y, point.x, point.y, (previousValue + value) / 2); - } - previous = point; - previousValue = value; - } - }; - - for (const ringRadius of PLANE_RINGS) { - trace(96, (step) => ({ point: projectRose(cx, cy, radius, ringRadius, (step * 360) / 96), ringRadius })); - } - // Spokes run from just outside the disc to the outermost ring, so the grid - // closes on itself instead of trailing off into loose ends. - const outer = PLANE_RINGS[PLANE_RINGS.length - 1]!; - for (let angle = PLANE_SPOKE_STEP / 2; angle < 360; angle += PLANE_SPOKE_STEP) { - trace(24, (step) => { - const ringRadius = 1.05 + (step * (outer - 1.05)) / 24; - return { point: projectRose(cx, cy, radius, ringRadius, angle), ringRadius }; - }); - } -} - -/** Screen depth of the disc's side wall at the given ring radius. */ -function discDepth(radius: number): number { - return Math.max(3, Math.round(radius * DISC_DEPTH)); -} - -/** The ring bounding the rose: the tilted disc's rim, drawn as a polygon. */ -function drawTiltedRing(image: GrayImage, cx: number, cy: number, radius: number, value: number): void { - const segments = 72; - let previous = projectRose(cx, cy, radius, 1, 0); - for (let i = 1; i <= segments; i++) { - const point = projectRose(cx, cy, radius, 1, (i * 360) / segments); - image.drawLine(previous.x, previous.y, point.x, point.y, value); - previous = point; - } -} - -/** A fixed mark just inside the top rim: the heading the wearer is facing. */ -function drawHeadingTick(image: GrayImage, cx: number, cy: number, radius: number, value: number): void { - const top = projectRose(cx, cy, radius, 1, 0); - const tickTop = top.y + 1; - fillTriangle( - image, - { x: cx, y: tickTop + TICK_HEIGHT - 1 }, - { x: cx - TICK_HALF_WIDTH, y: tickTop }, - { x: cx + TICK_HALF_WIDTH, y: tickTop }, - value, - ); -} - -function fillTriangle(image: GrayImage, a: Point, b: Point, c: Point, value: number): void { - const left = Math.max(0, Math.floor(Math.min(a.x, b.x, c.x))); - const right = Math.min(image.width - 1, Math.ceil(Math.max(a.x, b.x, c.x))); - const top = Math.max(0, Math.floor(Math.min(a.y, b.y, c.y))); - const bottom = Math.min(image.height - 1, Math.ceil(Math.max(a.y, b.y, c.y))); - const shade = Math.round(value); - for (let y = top; y <= bottom; y++) { - for (let x = left; x <= right; x++) { - const point = { x: x + 0.5, y: y + 0.5 }; - const ab = edge(a, b, point); - const bc = edge(b, c, point); - const ca = edge(c, a, point); - // Accept either winding, so callers don't have to order their vertices. - if ((ab >= 0 && bc >= 0 && ca >= 0) || (ab <= 0 && bc <= 0 && ca <= 0)) { - image.setPixel(x, y, shade); - } - } - } -} - -/** Twice the signed area of the triangle a-b-p; its sign is p's side of a-b. */ -function edge(a: Point, b: Point, p: Point): number { - return (b.x - a.x) * (p.y - a.y) - (b.y - a.y) * (p.x - a.x); -} diff --git a/app/apps/compass/compass-rose.ts b/app/apps/compass/compass-rose.ts new file mode 100644 index 00000000..e8410c1a --- /dev/null +++ b/app/apps/compass/compass-rose.ts @@ -0,0 +1,352 @@ +/** + * The compass rose renderer: a tilted disc with eight rotating points, drawn + * from a heading into any GrayImage. Pure drawing code shared by the Compass + * app's full-window view and the Glanceboard's compass widget; the callers + * own the magnetometer lifecycle and the readout text around it. + */ +import { GrayImage } from "../../graphics/image"; +import { normalizeHeading } from "./calibration"; + +/** + * The rose is drawn as a flat disc lying in front of the wearer, tilted away + * from vertical: `TILT_SQUASH` is how much that tilt shortens the depth axis, + * and `TILT_PERSPECTIVE` how much nearer parts of the disc are magnified + * relative to farther ones. Together they turn the ring into an egg-shaped + * oval — wider and taller at the bottom — and give the rose's points their + * foreshortening for free. + */ +const TILT_SQUASH = 0.42; +const TILT_PERSPECTIVE = 0.22; +/** Screen height of the projected ring, per unit of radius. */ +const RING_HEIGHT_PER_RADIUS = + TILT_SQUASH * (1 / (1 + TILT_PERSPECTIVE) + 1 / (1 - TILT_PERSPECTIVE)); +/** Screen half-width of the projected ring, per unit of radius. */ +const RING_HALF_WIDTH_PER_RADIUS = 1 / Math.sqrt(1 - TILT_PERSPECTIVE * TILT_PERSPECTIVE); + +/** Tip radii of the rose's long and short points, as a fraction of the ring. */ +const CARDINAL_TIP = 0.9; +const INTERCARDINAL_TIP = 0.54; +/** Radius the point bases sit on: how fat the rose is at its waist. */ +const POINT_BASE_RADIUS = 0.17; +/** Half-angle of a point's base. 22.5° makes neighbouring bases just meet. */ +const POINT_BASE_HALF_ANGLE = 22.5; +/** + * A polar grid lying in the same plane as the disc, to give it somewhere to + * sit and to fill the empty flanks either side of it. Rings are multiples of + * the disc's radius; spokes are offset by half a step so none runs up the + * middle into the heading tick. + */ +const PLANE_RINGS = [1.35, 1.8, 2.5, 3.6, 5.6]; +const PLANE_SPOKE_STEP = 30; +/** Grid brightness at the disc's rim, and how fast it falls off with distance. */ +const PLANE_NEAR_VALUE = 78; +const PLANE_FALLOFF = 0.55; +/** Dimmer than this is left unpainted, so the grid ends by vanishing. */ +const PLANE_CUTOFF = 22; +/** Height over which the grid fades out as it approaches the readout. */ +const PLANE_FADE_SPAN = 45; + +/** Size of the fixed tick that marks the direction the wearer is facing. */ +const TICK_HEIGHT = 7; +const TICK_HALF_WIDTH = 4; +/** Depth of the disc's side wall, as a fraction of the ring's radius. */ +const DISC_DEPTH = 0.1; +/** + * Rim angle at which the silhouette turns vertical. Between this and its + * mirror the wall faces the wearer; outside it the rim curves back away, so a + * wall drawn there would hook inward instead of ending on the vertical edge. + */ +const WALL_START_ANGLE = (Math.acos(-TILT_PERSPECTIVE) * 180) / Math.PI; +/** Side-wall shading, from the edges of the silhouette to the nearest point. */ +const WALL_DARK = 20; +const WALL_LIT = 62; + +/** Size of the fixed tick that marks the direction the wearer is facing. */ +export { TICK_HEIGHT }; + +/** + * Fit a rose into a box: the largest radius whose projected ring plus disc + * wall fits between `topClearance` (the bottom of whatever text sits above) + * and the box's bottom padding, and whose width clears the side padding + * around `cx`. Returns the centre and radius to hand to drawCompassRose. + */ +export function layoutCompassRose(options: { + width: number; + height: number; + cx: number; + /** Lowest y already used above the rose (readout text, its gap). */ + topClearance: number; + bottomPad: number; + edgePad: number; + maxRadius: number; + minRadius?: number; +}): { cx: number; cy: number; radius: number; ringTop: number } { + const { width, height, cx } = options; + const radius = Math.max( + options.minRadius ?? 24, + Math.min( + options.maxRadius, + Math.floor((height - options.bottomPad - options.topClearance - TICK_HEIGHT) / (RING_HEIGHT_PER_RADIUS + DISC_DEPTH)), + Math.floor((Math.min(cx, width - cx) - options.edgePad) / RING_HALF_WIDTH_PER_RADIUS), + ), + ); + // The wall hangs below the rim, so the near rim sits a wall's depth up + // from the bottom padding rather than on it. + const cy = height - options.bottomPad - discDepth(radius) - (radius * TILT_SQUASH) / (1 - TILT_PERSPECTIVE); + const ringTop = cy - (radius * TILT_SQUASH) / (1 + TILT_PERSPECTIVE); + return { cx, cy, radius, ringTop }; +} + +export function cardinalDirection(heading: number): string { + const names = ["N", "NE", "E", "SE", "S", "SW", "W", "NW"]; + return names[Math.round(normalizeHeading(heading) / 45) % names.length]!; +} + +interface Point { + x: number; + y: number; +} + +/** + * Project a point of the rose's plane onto the screen. `angle` is degrees + * clockwise from the far side of the disc — the direction the wearer faces — + * and `radius` is a fraction of the rose's outer ring. + */ +function projectRose(cx: number, cy: number, scale: number, radius: number, angle: number): Point { + const radians = (angle * Math.PI) / 180; + const across = radius * Math.sin(radians); + const away = radius * Math.cos(radians); + const depth = 1 + TILT_PERSPECTIVE * away; + return { + x: cx + (across * scale) / depth, + y: cy - (away * scale * TILT_SQUASH) / depth, + }; +} + +/** + * Bounds of every orientation of the rotating points. The longest tip sweeps + * a circle in the disc's plane; perspective projects it to an offset ellipse. + * Round outward so all rasterized triangle pixels fit inside the rectangle. + */ +function rotatingRoseBounds(cx: number, cy: number, radius: number): { + x: number; y: number; width: number; height: number; +} { + const perspective = TILT_PERSPECTIVE * CARDINAL_TIP; + const halfWidth = radius * CARDINAL_TIP / Math.sqrt(1 - perspective * perspective); + const depth = radius * CARDINAL_TIP * TILT_SQUASH; + const x = Math.floor(cx - halfWidth); + const y = Math.floor(cy - depth / (1 + perspective)); + return { + x, + y, + width: Math.ceil(cx + halfWidth) - x, + height: Math.ceil(cy + depth / (1 - perspective)) - y, + }; +} + +/** + * Keep the fixed pixels inside the rotating rose's dirty rectangle as one + * immutable texture. The wire planner can omit them from each raster delta + * and restore them with a cached image draw. Outside that rectangle the + * background stays raster, since heading updates do not change it. + * + * The texture uses transparent zero for the empty disc interior, so it can + * overlay the rotating points. Its only ink over the points is the fixed + * heading tick, which belongs on top of them. + */ +export function createCompassBackground( + width: number, height: number, cx: number, cy: number, radius: number, clipY: number, fade: number, +): GrayImage { + const image = new GrayImage(width, height, 0); + drawPlaneGrid(image, cx, cy, radius, clipY); + drawDiscWall(image, cx, cy, radius, fade); + drawTiltedRing(image, cx, cy, radius, 105 * fade); + drawHeadingTick(image, cx, cy, radius, 255 * fade); + + const bounds = rotatingRoseBounds(cx, cy, radius); + const left = Math.max(0, bounds.x); + const top = Math.max(0, bounds.y); + const right = Math.min(width, bounds.x + bounds.width); + const bottom = Math.min(height, bounds.y + bounds.height); + if (right > left && bottom > top) { + const texture = new GrayImage(right - left, bottom - top, 0); + texture.bitBlt(image, 0, 0, { sx: left, sy: top, width: texture.width, height: texture.height }); + image.fillRect(left, top, texture.width, texture.height, 0); + image.drawImage(texture, left, top); + } + return image; +} + +/** Draw only the rotating points, with the brightest one aimed at north. */ +export function drawCompassRose(image: GrayImage, cx: number, cy: number, radius: number, heading: number | null): void { + // Without a reading there is nothing to aim, so show the rose in its resting + // orientation, dimmed, rather than an empty ring. + const fade = heading === null ? 0.45 : 1; + const bearing = heading ?? 0; + // Short points first, so the long ones sit on top of them at the waist. Only + // north is drawn at full brightness: the other seven are there to make the + // rose read as a rose, and competing with north would defeat the point. + for (const degrees of [45, 135, 225, 315]) { + drawRosePoint(image, cx, cy, radius, degrees - bearing, INTERCARDINAL_TIP, 85 * fade, 40 * fade); + } + for (const degrees of [90, 180, 270]) { + drawRosePoint(image, cx, cy, radius, degrees - bearing, CARDINAL_TIP, 120 * fade, 55 * fade); + } + drawRosePoint(image, cx, cy, radius, -bearing, CARDINAL_TIP, 255 * fade, 140 * fade); +} + +/** + * One point of the rose: a tapered spike split down its axis into a lit and a + * shaded facet, which is what keeps the eight points readable once perspective + * has squashed the ones lying across the wearer's line of sight. + */ +function drawRosePoint( + image: GrayImage, + cx: number, + cy: number, + radius: number, + angle: number, + tipRadius: number, + litValue: number, + shadedValue: number, +): void { + const centre = { x: cx, y: cy }; + const tip = projectRose(cx, cy, radius, tipRadius, angle); + const clockwise = projectRose(cx, cy, radius, POINT_BASE_RADIUS, angle + POINT_BASE_HALF_ANGLE); + const anticlockwise = projectRose(cx, cy, radius, POINT_BASE_RADIUS, angle - POINT_BASE_HALF_ANGLE); + fillTriangle(image, tip, centre, clockwise, litValue); + fillTriangle(image, tip, centre, anticlockwise, shadedValue); +} + +/** + * The side wall below the wearer-facing arc of the rim, which turns the tilted + * disc into a shallow cylinder. The arc runs between the two points where the + * silhouette turns vertical, so the wall ends flush with that vertical edge, + * and it is shaded from dark there to lit where it faces the wearer head-on. + */ +function drawDiscWall(image: GrayImage, cx: number, cy: number, radius: number, fade: number): void { + const depth = discDepth(radius); + const segments = 48; + const sweep = 360 - WALL_START_ANGLE * 2; + const rimValue = 105 * fade; + let previous = projectRose(cx, cy, radius, 1, WALL_START_ANGLE); + image.drawLine(previous.x, previous.y, previous.x, previous.y + depth, rimValue); + for (let i = 1; i <= segments; i++) { + const angle = WALL_START_ANGLE + (i * sweep) / segments; + const point = projectRose(cx, cy, radius, 1, angle); + // Quads rather than per-column lines, so no gap opens up where the rim + // runs nearly horizontal across the bottom of the oval. + const value = (WALL_DARK + (WALL_LIT - WALL_DARK) * wallFacing(angle)) * fade; + const top = { x: previous.x, y: previous.y }; + const next = { x: point.x, y: point.y }; + fillTriangle(image, top, next, { x: next.x, y: next.y + depth }, value); + fillTriangle(image, top, { x: top.x, y: top.y + depth }, { x: next.x, y: next.y + depth }, value); + image.drawLine(top.x, top.y + depth, next.x, next.y + depth, rimValue); + previous = point; + } + image.drawLine(previous.x, previous.y, previous.x, previous.y + depth, rimValue); +} + +/** 1 where the wall faces the wearer head-on, 0 at the silhouette's edges. */ +function wallFacing(angle: number): number { + const towardWearer = -Math.cos((angle * Math.PI) / 180); + return (towardWearer - TILT_PERSPECTIVE) / (1 - TILT_PERSPECTIVE); +} + +/** + * The grid the disc sits on, drawn before the disc so the disc occludes it. + * Brightness falls off with distance and fades to nothing as the plane climbs + * towards `clipY`, so the grid dissolves into the black under the readout + * rather than stopping at a hard edge. + */ +function drawPlaneGrid(image: GrayImage, cx: number, cy: number, radius: number, clipY: number): void { + const shade = (point: Point, ringRadius: number): number => { + if (point.y > image.height || Math.abs(point.x - cx) > image.width) return 0; + const fade = Math.max(0, Math.min(1, (point.y - clipY) / PLANE_FADE_SPAN)); + const value = (PLANE_NEAR_VALUE / (1 + PLANE_FALLOFF * (ringRadius - 1))) * fade; + return value >= PLANE_CUTOFF ? value : 0; + }; + const trace = ( + steps: number, + at: (step: number) => { point: Point; ringRadius: number }, + ): void => { + let previous: Point | null = null; + let previousValue = 0; + for (let i = 0; i <= steps; i++) { + const { point, ringRadius } = at(i); + const value = shade(point, ringRadius); + if (previous !== null && previousValue > 0 && value > 0) { + image.drawLine(previous.x, previous.y, point.x, point.y, (previousValue + value) / 2); + } + previous = point; + previousValue = value; + } + }; + + for (const ringRadius of PLANE_RINGS) { + trace(96, (step) => ({ point: projectRose(cx, cy, radius, ringRadius, (step * 360) / 96), ringRadius })); + } + // Spokes run from just outside the disc to the outermost ring, so the grid + // closes on itself instead of trailing off into loose ends. + const outer = PLANE_RINGS[PLANE_RINGS.length - 1]!; + for (let angle = PLANE_SPOKE_STEP / 2; angle < 360; angle += PLANE_SPOKE_STEP) { + trace(24, (step) => { + const ringRadius = 1.05 + (step * (outer - 1.05)) / 24; + return { point: projectRose(cx, cy, radius, ringRadius, angle), ringRadius }; + }); + } +} + +/** Screen depth of the disc's side wall at the given ring radius. */ +function discDepth(radius: number): number { + return Math.max(3, Math.round(radius * DISC_DEPTH)); +} + +/** The ring bounding the rose: the tilted disc's rim, drawn as a polygon. */ +function drawTiltedRing(image: GrayImage, cx: number, cy: number, radius: number, value: number): void { + const segments = 72; + let previous = projectRose(cx, cy, radius, 1, 0); + for (let i = 1; i <= segments; i++) { + const point = projectRose(cx, cy, radius, 1, (i * 360) / segments); + image.drawLine(previous.x, previous.y, point.x, point.y, value); + previous = point; + } +} + +/** A fixed mark just inside the top rim: the heading the wearer is facing. */ +function drawHeadingTick(image: GrayImage, cx: number, cy: number, radius: number, value: number): void { + const top = projectRose(cx, cy, radius, 1, 0); + const tickTop = top.y + 1; + fillTriangle( + image, + { x: cx, y: tickTop + TICK_HEIGHT - 1 }, + { x: cx - TICK_HALF_WIDTH, y: tickTop }, + { x: cx + TICK_HALF_WIDTH, y: tickTop }, + value, + ); +} + +function fillTriangle(image: GrayImage, a: Point, b: Point, c: Point, value: number): void { + const left = Math.max(0, Math.floor(Math.min(a.x, b.x, c.x))); + const right = Math.min(image.width - 1, Math.ceil(Math.max(a.x, b.x, c.x))); + const top = Math.max(0, Math.floor(Math.min(a.y, b.y, c.y))); + const bottom = Math.min(image.height - 1, Math.ceil(Math.max(a.y, b.y, c.y))); + const shade = Math.round(value); + for (let y = top; y <= bottom; y++) { + for (let x = left; x <= right; x++) { + const point = { x: x + 0.5, y: y + 0.5 }; + const ab = edge(a, b, point); + const bc = edge(b, c, point); + const ca = edge(c, a, point); + // Accept either winding, so callers don't have to order their vertices. + if ((ab >= 0 && bc >= 0 && ca >= 0) || (ab <= 0 && bc <= 0 && ca <= 0)) { + image.setPixel(x, y, shade); + } + } + } +} + +/** Twice the signed area of the triangle a-b-p; its sign is p's side of a-b. */ +function edge(a: Point, b: Point, p: Point): number { + return (b.x - a.x) * (p.y - a.y) - (b.y - a.y) * (p.x - a.x); +} diff --git a/app/apps/glanceboard/board.ts b/app/apps/glanceboard/board.ts new file mode 100644 index 00000000..dc815f7d --- /dev/null +++ b/app/apps/glanceboard/board.ts @@ -0,0 +1,117 @@ +import { GrayImage } from "../../graphics/image"; +import { onAnySettingChanged } from "../../ui/dashboard-settings"; +import { glanceShowLinesSetting, glanceSlotSettings } from "./glanceboard-settings"; +import { QUADRANT_LAYOUT, resolveGlanceRegions, slotDividers, type GlanceLayout, type GlanceRegion } from "./layout"; +import { type GlanceWidget } from "./widget"; +import { findGlanceWidget, glanceWidgetSpans } from "./widgets"; + +/** Brightness of the hairlines between regions: the dimmest shade that survives 4bpp quantization. */ +const DIVIDER_VALUE = 20; + +type LiveRegion = { region: GlanceRegion; key: string; widget: GlanceWidget | null }; + +/** Identity of a region for diffing: which widget, in which slots. */ +function regionKey(region: GlanceRegion): string { + return `${region.choice}@${region.slots.join(",")}`; +} + +/** + * A board: the layout's slots filled with the widgets the settings choose, + * painted as one image. A widget chosen for two vertically adjacent slots + * (when it supports that) gets one double-height region with no divider + * between the slots. Widgets are created and started when the board starts + * and stopped when it stops; a settings change meanwhile restarts only the + * regions that changed. + */ +export class GlanceBoard { + private regions: LiveRegion[] = []; + private started = false; + private unsubscribeSettings: (() => void) | null = null; + + constructor( + private readonly requestRender: () => void, + readonly layout: GlanceLayout = QUADRANT_LAYOUT, + ) {} + + get width(): number { + return this.layout.width; + } + + get height(): number { + return this.layout.height; + } + + start(): void { + if (this.started) return; + this.started = true; + this.applySlotSettings(); + this.unsubscribeSettings = onAnySettingChanged(() => this.applySlotSettings()); + } + + stop(): void { + if (!this.started) return; + this.started = false; + this.unsubscribeSettings?.(); + this.unsubscribeSettings = null; + for (const live of this.regions) live.widget?.stop(); + this.regions = []; + } + + private currentRegions(): GlanceRegion[] { + const choices = glanceSlotSettings(this.layout).map((setting) => setting.get()); + return resolveGlanceRegions(this.layout, choices, glanceWidgetSpans); + } + + /** Rebuild the live regions from the settings, keeping widgets whose region is unchanged. */ + private applySlotSettings(): void { + if (!this.started) return; + const previous = new Map(this.regions.map((live) => [live.key, live])); + const next: LiveRegion[] = []; + let changed = false; + for (const region of this.currentRegions()) { + const key = regionKey(region); + const kept = previous.get(key); + if (kept) { + previous.delete(key); + next.push(kept); + continue; + } + const widget = findGlanceWidget(region.choice)?.create() ?? null; + widget?.start(this.requestRender); + next.push({ region, key, widget }); + changed = true; + } + for (const removed of previous.values()) { + removed.widget?.stop(); + changed = true; + } + this.regions = next; + if (changed) this.requestRender(); + } + + /** Paint the whole board (layout-sized). Widgets each get a fresh canvas of their region's size. */ + paint(): GrayImage { + const image = new GrayImage(this.layout.width, this.layout.height, 0); + for (const live of this.regions) { + if (!live.widget) continue; + const { rect } = live.region; + const canvas = new GrayImage(rect.width, rect.height, 0); + try { + live.widget.paint(canvas); + } catch (error) { + console.warn(`glanceboard widget ${live.region.choice} paint failed`, error); + } + canvas.composeInto(image, rect.x, rect.y); + } + if (glanceShowLinesSetting.get()) { + drawDividers(image, this.layout, this.regions.map((live) => live.region)); + } + return image; + } +} + +function drawDividers(image: GrayImage, layout: GlanceLayout, regions: readonly GlanceRegion[]): void { + for (const line of slotDividers(layout, regions)) { + image.drawLine(line.x0, line.y0, line.x1, line.y1, DIVIDER_VALUE); + } +} diff --git a/app/apps/glanceboard/glanceboard-app.ts b/app/apps/glanceboard/glanceboard-app.ts new file mode 100644 index 00000000..38a5ec6c --- /dev/null +++ b/app/apps/glanceboard/glanceboard-app.ts @@ -0,0 +1,328 @@ +import { GrayImage } from "../../graphics/image"; +import { truncateText, wrapText } from "../../graphics/textwrap"; +import { getDefaultSmallFont } from "../../graphics/ui-fonts"; +import { enumSettingMenuItem, toggleSettingMenuItem } from "../../ui/dashboard-settings"; +import { type InputEvent } from "../../ui/gestures"; +import { type Layer, type LayerContext, type PaintBelow } from "../../ui/layers"; +import { drawSelectionHighlight, MenuLayer, openModalMenu, type MenuItem } from "../../ui/menu"; +import { LIST_ROW_TEXT_INSET, lineStep } from "../../ui/metrics"; +import { createInProcessWindow, type InProcessAppOptions, type InProcessWindow } from "../../ui/shell/in-process-window"; +import { shell } from "../../ui/shell/shell"; +import { GlanceBoard } from "./board"; +import { + clearConflictingSlots, + glanceboardEnabledSetting, + glanceShowLinesSetting, + glanceShowOnHeadTiltSetting, + glanceShowOnLongPressSetting, + glanceSlotChoiceLabel, + glanceSlotSettings, + glanceTapDurationSetting, + type GlanceSlotChoice, +} from "./glanceboard-settings"; +import { QUADRANT_LAYOUT, resolveGlanceRegions, slotDividers } from "./layout"; +import { glanceWidgetSpans } from "./widgets"; + +export const GLANCEBOARD_WINDOW_ID = "glanceboard"; +export const GLANCEBOARD_SURFACE_ID = "window:glanceboard"; + +const TITLE_X = 18; +const TITLE_Y = 10; +const PARAGRAPH_X = 24; +/** The entry page splits at the middle: menu left, slot preview right. */ +const PREVIEW_MARGIN = 8; +const PREVIEW_MIN_LINE_VALUE = 20; +const PREVIEW_LINE_VALUE = 100; + +const INTRO = + "Small widgets shown while the display is asleep, without waking the regular UI. " + + "A tap or a head-tilt shows the board for a few seconds and a long-press holds it " + + "up until released; a double-tap wakes the regular UI instead."; + +/** Full-page list layout shared by the sub-screens. */ +function pageMenuLayout(width: number) { + return { x: 8, y: 8, width: width - 16, opaque: true, showBorder: false } as const; +} + +/** + * The Glanceboard app's entry page. Left half: title, a short description + * and the menu (enable toggle, live preview, slot contents, settings). Right + * half: a scaled preview of the board's slots with their dividers and the + * name of the widget in each. "Select Contents" moves focus into that + * preview, where scroll picks a quadrant and a tap opens the picker for it; + * a double-tap returns focus to the menu. + */ +class GlanceboardHomeLayer implements Layer { + private menu: MenuLayer | null = null; + private menuTop = 0; + private focus: "menu" | "preview" = "menu"; + private selectedSlot = 0; + + private currentMenu(ctx: LayerContext, menuTop: number): MenuLayer { + if (!this.menu || this.menuTop !== menuTop) { + const { width, height } = ctx.stack.getBaseSize(); + const half = (width / 2) | 0; + const items: MenuItem[] = [ + toggleSettingMenuItem(glanceboardEnabledSetting), + { + label: "Preview", + onSelect: (menuCtx) => menuCtx.stack.push(new GlancePreviewLayer(() => menuCtx.actions.requestRender())), + }, + { + label: "Select Contents", + onSelect: () => { + this.focus = "preview"; + }, + }, + { + label: "Settings", + onSelect: (menuCtx) => menuCtx.stack.push(new GlanceSettingsLayer()), + }, + ]; + this.menuTop = menuTop; + this.menu = new MenuLayer(null, items, { + x: 8, y: menuTop, width: half - 16, + showBorder: false, minHeight: 0, maxHeight: height - menuTop, + }); + } + return this.menu; + } + + /** Where the scaled board sits: the right half, board aspect, vertically centred. */ + private previewRect(width: number, height: number): { x: number; y: number; width: number; height: number } { + const half = (width / 2) | 0; + const availableWidth = width - half - 2 * PREVIEW_MARGIN; + const scale = Math.min(availableWidth / QUADRANT_LAYOUT.width, (height - 2 * PREVIEW_MARGIN) / QUADRANT_LAYOUT.height); + const previewWidth = Math.round(QUADRANT_LAYOUT.width * scale); + const previewHeight = Math.round(QUADRANT_LAYOUT.height * scale); + return { + x: half + PREVIEW_MARGIN + (((availableWidth - previewWidth) / 2) | 0), + y: ((height - previewHeight) / 2) | 0, + width: previewWidth, + height: previewHeight, + }; + } + + paint(ctx: LayerContext): GrayImage { + const font = getDefaultSmallFont(); + const { width, height } = ctx.stack.getBaseSize(); + const image = new GrayImage(width, height, 0); + const half = (width / 2) | 0; + image.drawText(font, TITLE_X, TITLE_Y, "Glanceboard", 220); + const step = lineStep(font); + let y = TITLE_Y + step + 6; + for (const line of wrapText(font, INTRO, half - PARAGRAPH_X - 12)) { + image.drawText(font, PARAGRAPH_X, y, line, 160); + y += step; + } + // The menu paints onto this page below the paragraph (its fill is raster, + // so the deferred paragraph glyphs above stay untouched either way). + // While the preview has focus the menu keeps its outline-only selection. + const menu = this.currentMenu(ctx, y + 4); + const menuFocused = ctx.stack.isFocused() && this.focus === "menu"; + const menuCtx: LayerContext = { ...ctx, stack: Object.assign(Object.create(ctx.stack), { isFocused: () => menuFocused }) }; + menu.paint(menuCtx, () => image); + + const preview = this.previewRect(width, height); + drawSlotPreview(image, preview, { + selectedSlot: this.selectedSlot, + selectionFocused: ctx.stack.isFocused() && this.focus === "preview", + }); + return image; + } + + async handleInput(event: InputEvent, ctx: LayerContext): Promise { + if (this.focus === "preview") { + const slotCount = QUADRANT_LAYOUT.slots.length; + switch (event.type) { + case "scroll-up": + this.selectedSlot = (this.selectedSlot + slotCount - 1) % slotCount; + return; + case "scroll-down": + this.selectedSlot = (this.selectedSlot + 1) % slotCount; + return; + case "click": + openSlotPicker(ctx, this.selectedSlot); + return; + case "double-click": + // Back from the preview is back to the menu, not out of the app; + // this layer is the window's root and handles the yield itself + // (see createGlanceboardAppWindow), so the gesture arrives here. + this.focus = "menu"; + return; + default: + return; + } + } + if (event.type === "double-click") { + shell.yieldFocusToSidebar(); + return; + } + await this.currentMenu(ctx, this.menuTop).handleInput(event, ctx); + } +} + +/** + * The board's slots scaled into `rect`: dividers (full brightness, or the + * dimmest dotted line when "Show lines" is off), the widget name centred in + * each region (a merged double-height region has one name and no line + * across it), and the selected quadrant highlighted. + */ +function drawSlotPreview( + image: GrayImage, + rect: { x: number; y: number; width: number; height: number }, + options: { selectedSlot: number; selectionFocused: boolean }, +): void { + const font = getDefaultSmallFont(); + const layout = QUADRANT_LAYOUT; + const settings = glanceSlotSettings(layout); + const choices = settings.map((setting) => setting.get()); + const regions = resolveGlanceRegions(layout, choices, glanceWidgetSpans); + const sx = rect.width / layout.width; + const sy = rect.height / layout.height; + const scaled = (r: { x: number; y: number; width: number; height: number }) => ({ + x: rect.x + Math.round(r.x * sx), + y: rect.y + Math.round(r.y * sy), + width: Math.round(r.width * sx), + height: Math.round(r.height * sy), + }); + + image.drawRect(rect.x - 1, rect.y - 1, rect.width + 2, rect.height + 2, 72); + const selected = scaled(layout.slots[options.selectedSlot]!.rect); + drawSelectionHighlight(image, selected.x + 1, selected.y + 1, selected.width - 2, selected.height - 2, options.selectionFocused, 4); + + const showLines = glanceShowLinesSetting.get(); + for (const line of slotDividers(layout, regions)) { + const x0 = rect.x + Math.round(line.x0 * sx); + const y0 = rect.y + Math.round(line.y0 * sy); + const x1 = rect.x + Math.round(line.x1 * sx); + const y1 = rect.y + Math.round(line.y1 * sy); + if (showLines) { + image.drawLine(x0, y0, x1, y1, PREVIEW_LINE_VALUE); + } else { + // Every other pixel at the dimmest visible shade: the line is there to + // read the layout by, but says "off". + drawDottedLine(image, x0, y0, x1, y1, PREVIEW_MIN_LINE_VALUE); + } + } + + // Names: one per region, "Empty" in slots no region covers. + const covered = new Set(); + const label = (r: { x: number; y: number; width: number; height: number }, text: string, value: number) => { + const clipped = truncateText(font, text, Math.max(0, r.width - 8)); + image.drawText(font, r.x + (((r.width - font.measureText(clipped)) / 2) | 0), r.y + (((r.height - font.lineHeight) / 2) | 0), clipped, value); + }; + for (const region of regions) { + for (const index of region.slots) covered.add(index); + label(scaled(region.rect), glanceSlotChoiceLabel(region.choice as GlanceSlotChoice), 210); + } + layout.slots.forEach((slot, index) => { + if (!covered.has(index)) label(scaled(slot.rect), "Empty", 90); + }); +} + +/** A horizontal or vertical line lit on every other pixel. */ +function drawDottedLine(image: GrayImage, x0: number, y0: number, x1: number, y1: number, value: number): void { + if (y0 === y1) { + for (let x = Math.min(x0, x1); x <= Math.max(x0, x1); x += 2) image.setPixel(x, y0, value); + } else { + for (let y = Math.min(y0, y1); y <= Math.max(y0, y1); y += 2) image.setPixel(x0, y, value); + } +} + +/** The picker for one slot: every widget, the current one marked; choosing applies the one-per-board rule. */ +function openSlotPicker(ctx: LayerContext, slotIndex: number): void { + const setting = glanceSlotSettings(QUADRANT_LAYOUT)[slotIndex]; + if (!setting) return; + const current = setting.get(); + const items: MenuItem[] = setting.values.map((value) => ({ + label: setting.displayValue(value), + onSelect: (menuCtx) => { + setting.set(value); + clearConflictingSlots(QUADRANT_LAYOUT, slotIndex, value); + menuCtx.stack.pop(); + }, + render: ({ image, x, y }) => { + image.drawText(getDefaultSmallFont(), x, y + LIST_ROW_TEXT_INSET, `${setting.displayValue(value)}${setting.get() === value ? " *" : ""}`, 200); + }, + })); + openModalMenu(ctx, setting.label, items, Math.max(0, setting.values.indexOf(current))); +} + +/** Settings: which sleep gestures show the board, for how long, and the slot lines. */ +class GlanceSettingsLayer implements Layer { + private menu: MenuLayer | null = null; + + private currentMenu(ctx: LayerContext): MenuLayer { + if (!this.menu) { + const { width } = ctx.stack.getBaseSize(); + const items: MenuItem[] = [ + enumSettingMenuItem(glanceTapDurationSetting), + toggleSettingMenuItem(glanceShowOnLongPressSetting), + toggleSettingMenuItem(glanceShowOnHeadTiltSetting), + toggleSettingMenuItem(glanceShowLinesSetting), + ]; + this.menu = new MenuLayer("Glanceboard settings", items, pageMenuLayout(width)); + } + return this.menu; + } + + paint(ctx: LayerContext, paintBelow: PaintBelow): GrayImage { + return this.currentMenu(ctx).paint(ctx, paintBelow); + } + + async handleInput(event: InputEvent, ctx: LayerContext): Promise { + await this.currentMenu(ctx).handleInput(event, ctx); + } +} + +/** The live board in the window; any click or double-click returns to the list. */ +class GlancePreviewLayer implements Layer { + private readonly board: GlanceBoard; + + constructor(requestRender: () => void) { + this.board = new GlanceBoard(requestRender); + this.board.start(); + } + + paint(ctx: LayerContext): GrayImage { + const { width, height } = ctx.stack.getBaseSize(); + const board = this.board.paint(); + if (board.width === width && board.height === height) return board; + // A viewport of another size (a per-app display override) shows the board + // top-left, cropped or padded, rather than scaled. + const image = new GrayImage(width, height, 0); + board.composeInto(image, 0, 0); + return image; + } + + handleInput(event: InputEvent, ctx: LayerContext): void { + if (event.type === "click" || event.type === "double-click") ctx.stack.pop(); + } + + onRemoved(): void { + this.board.stop(); + } +} + +export function createGlanceboardAppWindow(options: InProcessAppOptions): InProcessWindow { + return createInProcessWindow({ + appId: "glanceboard", + windowId: GLANCEBOARD_WINDOW_ID, + title: "Glanceboard", + iconLetter: "Gb", + icon: "eye", + closeable: true, + // 576x288: the board's own size, so the preview is pixel-exact. + heightMode: "medium", + actions: options.actions, + // Not wrapped in YieldAtRootLayer: the home page routes double-click + // itself (preview focus -> menu focus, menu focus -> sidebar). + baseLayer: new GlanceboardHomeLayer(), + submitFrame: options.submitFrame, + setSurfaceVisible: options.setSurfaceVisible, + removeSurface: options.removeSurface, + reconfigureSurface: options.reconfigureSurface, + onClosed: options.onClosed, + }); +} diff --git a/app/apps/glanceboard/glanceboard-settings.ts b/app/apps/glanceboard/glanceboard-settings.ts new file mode 100644 index 00000000..c10c8066 --- /dev/null +++ b/app/apps/glanceboard/glanceboard-settings.ts @@ -0,0 +1,121 @@ +import { ConfigSettingBoolean, ConfigSettingEnum } from "../../ui/dashboard-settings"; +import { QUADRANT_LAYOUT, slotsVerticallyAdjacent, type GlanceLayout } from "./layout"; +import { type GlanceWidgetId } from "./widget"; +import { glanceWidgetSpans } from "./widgets"; + +export type GlanceSlotChoice = GlanceWidgetId | "none"; + +const SLOT_CHOICES: readonly GlanceSlotChoice[] = ["none", "system-card", "calendar", "terminal", "nightscout", "compass", "music"]; + +const SLOT_CHOICE_LABELS: Record = { + none: "Empty", + "system-card": "System card", + calendar: "Calendar", + terminal: "Terminal", + nightscout: "Nightscout", + compass: "Compass", + music: "Music", +}; + +export function glanceSlotChoiceLabel(choice: GlanceSlotChoice): string { + return SLOT_CHOICE_LABELS[choice] ?? choice; +} + +const DEFAULT_QUADRANT_CHOICES: readonly GlanceSlotChoice[] = ["system-card", "music", "compass", "nightscout"]; + +/** + * Whether sleep-time gestures show the board at all. Off restores the plain + * behaviour: a tap, hold or head-tilt while asleep does nothing (a head-tilt + * wakes the regular UI), double-tap wakes. + */ +export const glanceboardEnabledSetting = new ConfigSettingBoolean({ + id: "glanceboard-enabled", + label: "Enable Glanceboard", + storageKey: "glanceboard.enabled", + defaultValue: true, + description: + "While the display is asleep, a tap, a long-press or a head-tilt shows the Glanceboard instead of the regular UI. Double-tap still wakes the regular UI.", +}); + +export type GlanceTapDuration = "3s" | "5s" | "7s" | "10s"; + +/** How long a tap (or head-tilt) keeps the board up; each further tap restarts it. */ +export const glanceTapDurationSetting = new ConfigSettingEnum({ + id: "glanceboard-tap-duration", + label: "Show on tap", + storageKey: "glanceboard.tapDuration", + defaultValue: "5s", + values: ["3s", "5s", "7s", "10s"], + formatValue: (value) => value.replace("s", " s"), + description: "How long a single tap (or a head-tilt) keeps the Glanceboard on screen.", +}); + +export function glanceTapTimeoutMs(): number { + return Number.parseInt(glanceTapDurationSetting.get(), 10) * 1000; +} + +/** A long-press holds the board up until the press is released. */ +export const glanceShowOnLongPressSetting = new ConfigSettingBoolean({ + id: "glanceboard-show-on-long-press", + label: "Show on long press", + storageKey: "glanceboard.showOnLongPress", + defaultValue: true, + description: "Holding a long-press while asleep shows the Glanceboard until the press is released.", +}); + +/** The head-tilt wake shows the board (for the tap duration) instead of the regular UI. */ +export const glanceShowOnHeadTiltSetting = new ConfigSettingBoolean({ + id: "glanceboard-show-on-head-tilt", + label: "Show on head tilt", + storageKey: "glanceboard.showOnHeadTilt", + defaultValue: true, + description: "Tilting your head up while asleep shows the Glanceboard instead of waking the regular UI.", +}); + +/** Hairlines between the board's slots. */ +export const glanceShowLinesSetting = new ConfigSettingBoolean({ + id: "glanceboard-show-lines", + label: "Show lines", + storageKey: "glanceboard.showLines", + defaultValue: true, + description: "Draw the separator lines between the Glanceboard's slots.", +}); + +/** + * One picker per layout slot, keyed by layout id and slot index so a future + * layout gets its own stored choices rather than inheriting the quadrants'. + */ +export function glanceSlotSettings(layout: GlanceLayout = QUADRANT_LAYOUT): ConfigSettingEnum[] { + return layout.slots.map( + (slot, index) => + new ConfigSettingEnum({ + id: `glanceboard-${layout.id}-slot-${index}`, + label: slot.label, + storageKey: `glanceboard.${layout.id}.slot.${index}`, + defaultValue: (layout === QUADRANT_LAYOUT ? DEFAULT_QUADRANT_CHOICES[index] : undefined) ?? "none", + values: SLOT_CHOICES, + formatValue: glanceSlotChoiceLabel, + description: `Which widget fills the ${slot.label.toLowerCase()} slot of the Glanceboard.`, + }), + ); +} + +/** + * A slot was just set to `choice`: each widget appears on the board once, so + * clear every other slot holding the same choice, except a vertically + * adjacent one when the widget can span two slots (it then renders at + * double height). Returns the indices cleared. + */ +export function clearConflictingSlots(layout: GlanceLayout, changedIndex: number, choice: GlanceSlotChoice): number[] { + if (choice === "none") return []; + const settings = glanceSlotSettings(layout); + const spans = glanceWidgetSpans(choice); + const cleared: number[] = []; + settings.forEach((setting, index) => { + if (index === changedIndex || setting.get() !== choice) return; + if (spans && slotsVerticallyAdjacent(layout, changedIndex, index)) return; + setting.set("none"); + cleared.push(index); + }); + return cleared; +} diff --git a/app/apps/glanceboard/index.ts b/app/apps/glanceboard/index.ts new file mode 100644 index 00000000..00616ea1 --- /dev/null +++ b/app/apps/glanceboard/index.ts @@ -0,0 +1,27 @@ +import { type AppDefinition } from "../app-definition"; +import { GlanceBoard } from "./board"; +import { createGlanceboardAppWindow, GLANCEBOARD_SURFACE_ID, GLANCEBOARD_WINDOW_ID } from "./glanceboard-app"; +import { + glanceboardEnabledSetting, + glanceShowOnHeadTiltSetting, + glanceShowOnLongPressSetting, + glanceTapTimeoutMs, +} from "./glanceboard-settings"; +import { QUADRANT_LAYOUT } from "./layout"; + +const glanceboardApp: AppDefinition = { + appId: "glanceboard", + title: "Glanceboard", + icon: "eye", + launch: (ctx) => ctx.launchInProcessApp(GLANCEBOARD_WINDOW_ID, GLANCEBOARD_SURFACE_ID, createGlanceboardAppWindow), + glanceboard: { + size: { width: QUADRANT_LAYOUT.width, height: QUADRANT_LAYOUT.height }, + isEnabled: () => glanceboardEnabledSetting.get(), + tapTimeoutMs: glanceTapTimeoutMs, + showOnLongPress: () => glanceShowOnLongPressSetting.get(), + showOnHeadTilt: () => glanceShowOnHeadTiltSetting.get(), + createBoard: (requestRender) => new GlanceBoard(requestRender, QUADRANT_LAYOUT), + }, +}; + +export default glanceboardApp; diff --git a/app/apps/glanceboard/layout.ts b/app/apps/glanceboard/layout.ts new file mode 100644 index 00000000..993d73c1 --- /dev/null +++ b/app/apps/glanceboard/layout.ts @@ -0,0 +1,108 @@ +/** + * Board geometry. A layout names its slots and places them on the board; + * the Glanceboard app's slot pickers and the board renderer are both driven + * by it, so a replacement layout (different slot count, sizes, positions) is + * a matter of swapping this object out and reusing the same widgets. + */ +export const GLANCEBOARD_WIDTH = 576; +export const GLANCEBOARD_HEIGHT = 288; + +export type GlanceSlotRect = { x: number; y: number; width: number; height: number }; + +export type GlanceLayout = { + id: string; + width: number; + height: number; + slots: readonly { label: string; rect: GlanceSlotRect }[]; +}; + +/** The first layout: four equal quadrants, each 288x144. */ +export const QUADRANT_LAYOUT: GlanceLayout = { + id: "quadrants", + width: GLANCEBOARD_WIDTH, + height: GLANCEBOARD_HEIGHT, + slots: [ + { label: "Top left", rect: { x: 0, y: 0, width: 288, height: 144 } }, + { label: "Top right", rect: { x: 288, y: 0, width: 288, height: 144 } }, + { label: "Bottom left", rect: { x: 0, y: 144, width: 288, height: 144 } }, + { label: "Bottom right", rect: { x: 288, y: 144, width: 288, height: 144 } }, + ], +}; + +/** Whether two slots stack vertically with matching width (one region if merged). */ +export function slotsVerticallyAdjacent(layout: GlanceLayout, a: number, b: number): boolean { + const first = layout.slots[a]?.rect; + const second = layout.slots[b]?.rect; + if (!first || !second || a === b) return false; + if (first.x !== second.x || first.width !== second.width) return false; + return first.y + first.height === second.y || second.y + second.height === first.y; +} + +/** A painted area of the board: one slot, or two vertically adjacent slots merged. */ +export type GlanceRegion = { + /** The slot choice (widget id) filling the region. */ + choice: string; + rect: GlanceSlotRect; + /** Indices into layout.slots, ascending. */ + slots: number[]; +}; + +/** + * Turn per-slot choices into regions. A widget chosen for two vertically + * adjacent slots, when `canSpan` says it supports it, becomes one + * double-height region; every other non-empty slot is a region of its own + * (a duplicate that cannot merge simply paints twice). Regions come out in + * slot order. + */ +export function resolveGlanceRegions( + layout: GlanceLayout, + choices: readonly string[], + canSpan: (choice: string) => boolean, +): GlanceRegion[] { + const regions: GlanceRegion[] = []; + const consumed = new Set(); + layout.slots.forEach((slot, index) => { + if (consumed.has(index)) return; + const choice = choices[index] ?? "none"; + if (choice === "none") return; + consumed.add(index); + let rect = { ...slot.rect }; + const slots = [index]; + if (canSpan(choice)) { + const partner = layout.slots.findIndex( + (_, other) => !consumed.has(other) && choices[other] === choice && slotsVerticallyAdjacent(layout, index, other), + ); + if (partner >= 0) { + consumed.add(partner); + slots.push(partner); + const other = layout.slots[partner]!.rect; + const top = Math.min(rect.y, other.y); + rect = { x: rect.x, y: top, width: rect.width, height: Math.max(rect.y + rect.height, other.y + other.height) - top }; + } + } + regions.push({ choice, rect, slots }); + }); + return regions; +} + +/** A divider line between slots, in board coordinates (inclusive endpoints). */ +export type GlanceDivider = { x0: number; y0: number; x1: number; y1: number }; + +/** + * The hairlines between slots: every slot's left edge (when not at the + * board's left) and top edge (when not at the top), except the top edge of + * the lower slot of a merged double-height region, which is that region's + * interior. Shared by the board painter and the config app's preview. + */ +export function slotDividers(layout: GlanceLayout, regions: readonly GlanceRegion[]): GlanceDivider[] { + const dividers: GlanceDivider[] = []; + layout.slots.forEach(({ rect }, index) => { + if (rect.x > 0) dividers.push({ x0: rect.x, y0: rect.y, x1: rect.x, y1: rect.y + rect.height - 1 }); + if (rect.y === 0) return; + const interior = regions.some( + (region) => region.slots.length > 1 && region.slots.includes(index) && region.rect.y < rect.y, + ); + if (!interior) dividers.push({ x0: rect.x, y0: rect.y, x1: rect.x + rect.width - 1, y1: rect.y }); + }); + return dividers; +} diff --git a/app/apps/glanceboard/widget.ts b/app/apps/glanceboard/widget.ts new file mode 100644 index 00000000..0f5c2d78 --- /dev/null +++ b/app/apps/glanceboard/widget.ts @@ -0,0 +1,43 @@ +import { type GrayImage } from "../../graphics/image"; + +/** + * A Glanceboard widget: a small self-contained view that paints into a slot + * of the board. Widgets are sized by the layout (the first layout is four + * 288x144 quadrants) and own their data subscriptions and any hardware they + * need between start and stop, so a board that is not showing costs nothing. + * + * Layouts are expected to be swapped out and iterated on; widgets are the + * stable part, so keep them independent of any particular board geometry + * beyond the slot size they are handed. + */ +export interface GlanceWidget { + /** + * The board became visible (or this widget was added to a visible board): + * subscribe to data, start timers, enable hardware. `requestRender` asks + * the board to repaint when something changed. + */ + start(requestRender: () => void): void; + /** Undo start. Called once for every start; must be safe to call twice. */ + stop(): void; + /** + * Paint the widget into `image`, a fresh 0-filled canvas of the slot's + * size. Deferred draws (text, drawImage) are welcome and keep the cheap + * texture-cache wire path. + */ + paint(image: GrayImage): void; +} + +export type GlanceWidgetId = "system-card" | "nightscout" | "compass" | "music" | "calendar" | "terminal"; + +export type GlanceWidgetDefinition = { + id: GlanceWidgetId; + /** Picker label in the Glanceboard app. */ + label: string; + /** + * The widget can fill two vertically adjacent slots as one double-height + * region (chosen for both left or both right quadrants). Its paint then + * gets the taller canvas; the divider between the slots is not drawn. + */ + tall?: boolean; + create: () => GlanceWidget; +}; diff --git a/app/apps/glanceboard/widgets/calendar-widget.ts b/app/apps/glanceboard/widgets/calendar-widget.ts new file mode 100644 index 00000000..85f74ff4 --- /dev/null +++ b/app/apps/glanceboard/widgets/calendar-widget.ts @@ -0,0 +1,137 @@ +import { type GrayImage, type UiFont } from "../../../graphics/image"; +import { truncateText } from "../../../graphics/textwrap"; +import { getDefaultMediumFont, getDefaultSmallFont } from "../../../graphics/ui-fonts"; +import { hasCalendarPermission } from "../../../g2/android-permissions"; +import { readUpcomingEvents, type CalendarEvent } from "../../../native/calendar"; +import { lineStep } from "../../../ui/metrics"; +import { dayHeaderLabel, formatEventTime } from "../../calendar/calendar"; +import { type GlanceWidget } from "../widget"; + +const PAD = 8; +/** A row fits while its glyph line clears this margin above the bottom edge. */ +const BOTTOM_MARGIN = 2; +const MINUTE_MS = 60_000; +const HOUR_MS = 60 * MINUTE_MS; + +/** + * What is next on the calendar: the current or next event large, with how + * far off it is (or when it ends), then the following events grouped under + * day headers, as many as fit. Reads the same cached provider query as the + * Calendar app; a minute tick keeps the countdown honest and lets the + * 30-second cache refresh on its own. + */ +export class CalendarWidget implements GlanceWidget { + private tick: ReturnType | null = null; + + start(requestRender: () => void): void { + this.tick = setInterval(requestRender, MINUTE_MS); + } + + stop(): void { + if (this.tick !== null) clearInterval(this.tick); + this.tick = null; + } + + paint(image: GrayImage): void { + const small = getDefaultSmallFont(); + const medium = getDefaultMediumFont(); + const step = lineStep(small); + const textWidth = image.width - 2 * PAD; + + if (!hasCalendarPermission()) { + image.drawText(small, PAD, PAD, "Calendar", 150); + image.drawText(small, PAD, PAD + step + 4, "Calendar permission needed", 140); + image.drawText(small, PAD, PAD + 2 * step + 4, "Open the Calendar app to grant it", 100); + return; + } + const nowMs = Date.now(); + // Events still in progress count; the provider's window starts at "now", + // so the list can include an event that began earlier and is still on. + const events = readUpcomingEvents().filter((event) => event.endMs > nowMs); + if (!events.length) { + image.drawText(small, PAD, PAD, "Calendar", 150); + image.drawText(small, PAD, PAD + step + 4, "No upcoming events", 140); + return; + } + + // Headline: the current or next event, with its day when it is not today. + const next = events[0]!; + let y = PAD; + const headline = truncateText(medium, next.title || "(untitled)", textWidth); + image.drawText(medium, PAD, y, headline, 230); + y += medium.lineHeight + 2; + image.drawText(small, PAD, y, truncateText(small, headlineDetail(next, nowMs), textWidth), 170); + y += step + 6; + + // The rest, grouped by day. A day header only where the day changes from + // the previous listed event (the headline's day included). + let previousDayKey = dayKeyOf(next.startMs); + for (let index = 1; index < events.length; index++) { + const event = events[index]!; + const dayKey = dayKeyOf(event.startMs); + const needsHeader = dayKey !== previousDayKey; + // The header and its row are placed a step apart; the row only needs + // its line height to fit above the bottom margin. + if (y + (needsHeader ? step : 0) + small.lineHeight > image.height - BOTTOM_MARGIN) break; + if (needsHeader) { + image.drawText(small, PAD, y, truncateText(small, dayHeaderLabel(event.startMs), textWidth), 120); + y += step; + previousDayKey = dayKey; + } + drawEventLine(image, small, PAD, y, textWidth, event, 190); + y += step; + } + } +} + +/** "Now, ends 14:30", "In 25 min", "Tomorrow 09:00", "All day"... for the headline. */ +function headlineDetail(event: CalendarEvent, nowMs: number): string { + const dayDelta = dayDeltaFromToday(event.startMs); + const when = event.allDay + ? "All day" + : `${formatEventTime(event.startMs)} - ${formatEventTime(event.endMs)}`; + if (event.startMs <= nowMs) { + if (event.allDay) return dayDelta === 0 ? "All day today" : `All day, ${dayHeaderLabel(event.startMs)}`; + return `Now, ends ${formatEventTime(event.endMs)}`; + } + const untilMs = event.startMs - nowMs; + if (dayDelta === 0 && untilMs < 12 * HOUR_MS) { + return `In ${formatDuration(untilMs)}, ${when}`; + } + const day = dayDelta === 0 ? "Today" : dayDelta === 1 ? "Tomorrow" : dayHeaderLabel(event.startMs); + return `${day}, ${when}`; +} + +function drawEventLine( + image: GrayImage, + font: UiFont, + x: number, + y: number, + width: number, + event: CalendarEvent, + value: number, +): void { + const time = event.allDay ? "All day" : formatEventTime(event.startMs); + const timeWidth = font.measureText(time); + image.drawText(font, x, y, time, value - 50); + const titleX = x + timeWidth + 8; + image.drawText(font, titleX, y, truncateText(font, event.title || "(untitled)", Math.max(0, x + width - titleX)), value); +} + +function formatDuration(ms: number): string { + const minutes = Math.max(1, Math.round(ms / MINUTE_MS)); + if (minutes < 60) return `${minutes} min`; + const hours = Math.floor(minutes / 60); + const rest = minutes % 60; + return rest ? `${hours} h ${rest} min` : `${hours} h`; +} + +function dayKeyOf(timestampMs: number): string { + const date = new Date(timestampMs); + return `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`; +} + +function dayDeltaFromToday(timestampMs: number): number { + const midnight = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime(); + return Math.round((midnight(new Date(timestampMs)) - midnight(new Date())) / (24 * HOUR_MS)); +} diff --git a/app/apps/glanceboard/widgets/compass-widget.ts b/app/apps/glanceboard/widgets/compass-widget.ts new file mode 100644 index 00000000..0a3a6d1d --- /dev/null +++ b/app/apps/glanceboard/widgets/compass-widget.ts @@ -0,0 +1,100 @@ +import { type GrayImage } from "../../../graphics/image"; +import { getDefaultMediumFont, getDefaultSmallFont } from "../../../graphics/ui-fonts"; +import { hasLocationPermission } from "../../../g2/android-permissions"; +import { addCompassListener, COMPASS_CHANGED, setCompassEnabled } from "../../../native/compass"; +import { isCompassCalibrated, normalizeHeading } from "../../compass/calibration"; +import { cardinalDirection, createCompassBackground, drawCompassRose, layoutCompassRose, TICK_HEIGHT } from "../../compass/compass-rose"; +import { getDeclinationAvailability, onDeclinationChanged, refreshDeclination } from "../../compass/declination"; +import { getNorthReference, resolveHeading } from "../../compass/heading"; +import { type GlanceWidget } from "../widget"; + +/** Owner token for the refcounted magnetometer, distinct from the Compass app's. */ +const COMPASS_OWNER = "glanceboard"; +const TOP_PAD = 4; +const BOTTOM_PAD = 4; +const EDGE_PAD = 8; +const MAX_ROSE_RADIUS = 60; + +/** + * The Compass app's rose at card size: heading readout above, tilted rose + * below. Turns the magnetometer on for as long as the board shows it (the + * Compass app keeps its own hold, so the two never switch each other off). + * Never prompts for location: true north is used when a declination is + * already known, otherwise the readout says it is magnetic. + */ +export class CompassWidget implements GlanceWidget { + private rawHeading: number | null = null; + private unsubscribe: (() => void) | null = null; + private unsubscribeDeclination: (() => void) | null = null; + private enabled = false; + private background: { key: string; image: GrayImage } | null = null; + + start(requestRender: () => void): void { + this.unsubscribe = addCompassListener((event) => { + if (event.command === COMPASS_CHANGED && event.headingDegrees >= 0) { + this.rawHeading = normalizeHeading(event.headingDegrees); + requestRender(); + } + }); + this.unsubscribeDeclination = onDeclinationChanged(requestRender); + if (!this.enabled) { + this.enabled = true; + setCompassEnabled(true, COMPASS_OWNER); + } + if (getNorthReference() === "true" && hasLocationPermission()) refreshDeclination(); + } + + stop(): void { + this.unsubscribe?.(); + this.unsubscribe = null; + this.unsubscribeDeclination?.(); + this.unsubscribeDeclination = null; + if (this.enabled) { + this.enabled = false; + setCompassEnabled(false, COMPASS_OWNER); + } + } + + private statusText(): string | null { + if (this.rawHeading === null) return "Waiting for compass"; + if (!isCompassCalibrated()) return "Uncalibrated"; + if (getNorthReference() === "true" && getDeclinationAvailability() !== "available") return "Magnetic"; + return null; + } + + paint(image: GrayImage): void { + const medium = getDefaultMediumFont(); + const small = getDefaultSmallFont(); + const { width, height } = image; + const heading = this.rawHeading === null ? null : resolveHeading(this.rawHeading).displayDegrees; + const headingText = heading === null ? "--°" : `${Math.round(heading)}° ${cardinalDirection(heading)}`; + const status = this.statusText(); + const textHeight = medium.lineHeight + (status ? small.lineHeight + 2 : 0); + const cx = width / 2; + const { cy, radius, ringTop } = layoutCompassRose({ + width, + height, + cx, + topClearance: TOP_PAD + textHeight + 4, + bottomPad: BOTTOM_PAD, + edgePad: EDGE_PAD, + maxRadius: MAX_ROSE_RADIUS, + minRadius: 16, + }); + const fade = heading === null ? 0.45 : 1; + const y = Math.max(TOP_PAD, Math.round((ringTop - TICK_HEIGHT - textHeight) / 2)); + const clipY = y + textHeight + 4; + const key = [width, height, cx, cy, radius, clipY, fade].join(","); + if (this.background?.key !== key) { + this.background = { key, image: createCompassBackground(width, height, cx, cy, radius, clipY, fade) }; + } + // composeInto keeps the background's cached interior texture as a + // deferred image draw, so the wire planner can restore it from cache. + this.background.image.composeInto(image, 0, 0); + drawCompassRose(image, cx, cy, radius, heading); + image.drawText(medium, Math.round(cx - medium.measureText(headingText) / 2), y, headingText, heading === null ? 150 : 255); + if (status) { + image.drawText(small, Math.round(cx - small.measureText(status) / 2), y + medium.lineHeight + 2, status, 125); + } + } +} diff --git a/app/apps/glanceboard/widgets/index.ts b/app/apps/glanceboard/widgets/index.ts new file mode 100644 index 00000000..2efd48ab --- /dev/null +++ b/app/apps/glanceboard/widgets/index.ts @@ -0,0 +1,26 @@ +import { type GlanceWidgetDefinition, type GlanceWidgetId } from "../widget"; +import { CalendarWidget } from "./calendar-widget"; +import { CompassWidget } from "./compass-widget"; +import { MusicWidget } from "./music-widget"; +import { NightscoutWidget } from "./nightscout-widget"; +import { SystemCardWidget } from "./system-card"; +import { TerminalWidget } from "./terminal-widget"; + +/** Every widget a board slot can hold. */ +export const GLANCE_WIDGETS: readonly GlanceWidgetDefinition[] = [ + { id: "system-card", label: "System card", create: () => new SystemCardWidget() }, + { id: "calendar", label: "Calendar", tall: true, create: () => new CalendarWidget() }, + { id: "terminal", label: "Terminal", tall: true, create: () => new TerminalWidget() }, + { id: "nightscout", label: "Nightscout", create: () => new NightscoutWidget() }, + { id: "compass", label: "Compass", create: () => new CompassWidget() }, + { id: "music", label: "Music", create: () => new MusicWidget() }, +]; + +export function findGlanceWidget(id: GlanceWidgetId | string): GlanceWidgetDefinition | null { + return GLANCE_WIDGETS.find((widget) => widget.id === id) ?? null; +} + +/** Whether a slot choice may span two vertically adjacent slots (see GlanceWidgetDefinition.tall). */ +export function glanceWidgetSpans(choice: string): boolean { + return Boolean(findGlanceWidget(choice)?.tall); +} diff --git a/app/apps/glanceboard/widgets/music-widget.ts b/app/apps/glanceboard/widgets/music-widget.ts new file mode 100644 index 00000000..b142f28f --- /dev/null +++ b/app/apps/glanceboard/widgets/music-widget.ts @@ -0,0 +1,161 @@ +import { GrayImage } from "../../../graphics/image"; +import { renderIcon } from "../../../graphics/icons"; +import { getDefaultMediumFont, getDefaultSmallFont } from "../../../graphics/ui-fonts"; +import { truncateText } from "../../../graphics/textwrap"; +import { mediaControllerBridge, type MediaControllerState } from "../../../native/media-controller"; +import { clamp } from "../../../util/numeric-util"; +import { type GlanceWidget } from "../widget"; + +const PAD = 8; +const ART_SIZE = 96; +/** The idle note: the Music app's icon, at this size and the dimmest shade. */ +const IDLE_NOTE_SIZE = 64; +const IDLE_NOTE_VALUE = 20; +let idleNote: GrayImage | null | undefined; + +/** + * The music icon reduced to a single dim shade: every pixel the renderer + * lit at least half becomes IDLE_NOTE_VALUE, the rest stay transparent + * (scaling the antialiased original down would quantize its edges away). + * Built once and kept, so drawImage's content-addressed cache holds. + */ +function idleNoteImage(): GrayImage | null { + if (idleNote !== undefined) return idleNote; + const icon = renderIcon("music", IDLE_NOTE_SIZE); + if (!icon) { + idleNote = null; + return null; + } + const note = new GrayImage(icon.width, icon.height, 0); + for (let y = 0; y < icon.height; y++) { + for (let x = 0; x < icon.width; x++) { + if (icon.getPixel(x, y) >= 128) note.setPixel(x, y, IDLE_NOTE_VALUE); + } + } + idleNote = note; + return note; +} +const ART_X = PAD; +const PROGRESS_BAR_HEIGHT = 5; + +/** + * Now playing: album art, title/artist/album and a progress bar for the + * active Android media session, the Music app's header at card size. The + * media bridge runs for the whole session; the widget subscribes and ticks + * once a second only while something is playing. + */ +export class MusicWidget implements GlanceWidget { + private media: MediaControllerState = mediaControllerBridge.snapshot(); + private unsubscribe: (() => void) | null = null; + private progressTimer: ReturnType | null = null; + private art: GrayImage | null = null; + private artKey = ""; + + start(requestRender: () => void): void { + this.unsubscribe = mediaControllerBridge.onStateChange((state) => { + this.media = state; + if (state.playbackState === "playing" && state.durationMs > 0 && state.positionMs >= 0) { + this.progressTimer ??= setInterval(requestRender, 1_000); + } else { + this.stopProgressTimer(); + } + requestRender(); + }); + } + + stop(): void { + this.unsubscribe?.(); + this.unsubscribe = null; + this.stopProgressTimer(); + } + + private stopProgressTimer(): void { + if (this.progressTimer !== null) clearInterval(this.progressTimer); + this.progressTimer = null; + } + + paint(image: GrayImage): void { + const medium = getDefaultMediumFont(); + const small = getDefaultSmallFont(); + const media = mediaControllerBridge.snapshot(); + this.media = media; + if (!media.available || (!media.title && !media.artist)) { + if (!media.accessEnabled) { + // Actionable, so it stays as text. + image.drawText(small, PAD, PAD, "Music", 150); + image.drawText(small, PAD, PAD + small.lineHeight + 6, "Notification access needed", 140); + return; + } + // Nothing playing: a dim note, centred, and nothing else. + const note = idleNoteImage(); + if (note) image.drawImage(note, ((image.width - note.width) / 2) | 0, ((image.height - note.height) / 2) | 0); + return; + } + + const artY = Math.max(PAD, ((image.height - ART_SIZE) / 2) | 0); + this.drawArt(image, media, artY); + + const textX = ART_X + ART_SIZE + 12; + const textWidth = image.width - textX - PAD; + let y = artY; + image.drawText(medium, textX, y, truncateText(medium, media.title || "Unknown title", textWidth), 230); + y += medium.lineHeight + 2; + if (media.artist) { + image.drawText(small, textX, y, truncateText(small, media.artist, textWidth), 170); + y += small.lineHeight + 2; + } + if (media.album) { + image.drawText(small, textX, y, truncateText(small, media.album, textWidth), 120); + } + + // Progress pinned to the art's bottom edge; the state label sits beside it. + const barY = artY + ART_SIZE - PROGRESS_BAR_HEIGHT; + const timeY = barY - small.lineHeight - 3; + const stateLabel = media.playbackState === "playing" ? "" : media.playbackState === "paused" ? "Paused" : media.playbackState; + if (media.durationMs > 0 && media.positionMs >= 0) { + const elapsed = formatMediaTime(media.positionMs); + const duration = formatMediaTime(media.durationMs); + image.drawText(small, textX, timeY, elapsed, 140); + image.drawText(small, textX + textWidth - small.measureText(duration), timeY, duration, 140); + if (stateLabel) { + image.drawText(small, textX + (((textWidth - small.measureText(stateLabel)) / 2) | 0), timeY, stateLabel, 140); + } + image.drawRect(textX, barY, textWidth, PROGRESS_BAR_HEIGHT, 55); + const progress = clamp(media.positionMs / media.durationMs, 0, 1); + image.fillRect(textX + 1, barY + 1, Math.round((textWidth - 2) * progress), PROGRESS_BAR_HEIGHT - 2, 170); + } else if (stateLabel) { + image.drawText(small, textX, timeY, stateLabel, 140); + } + } + + private drawArt(image: GrayImage, media: MediaControllerState, artY: number): void { + const key = `${media.packageName}|${media.title}|${media.album}`; + // Retry while null: players often publish metadata before the bitmap. + if (key !== this.artKey || this.art === null) { + this.artKey = key; + this.art = mediaControllerBridge.getAlbumArt(ART_SIZE); + } + if (this.art) { + const dx = ART_X + Math.max(0, ((ART_SIZE - this.art.width) / 2) | 0); + const dy = artY + Math.max(0, ((ART_SIZE - this.art.height) / 2) | 0); + image.bitBlt(this.art, dx, dy); + image.drawRect(dx - 1, dy - 1, this.art.width + 2, this.art.height + 2, 60); + } else { + image.drawRect(ART_X, artY, ART_SIZE, ART_SIZE, 60); + const font = getDefaultSmallFont(); + image.drawText(font, ART_X + Math.round((ART_SIZE - font.measureText("no art")) / 2), + artY + Math.round((ART_SIZE - font.lineHeight) / 2), "no art", 90); + } + } +} + +function formatMediaTime(milliseconds: number): string { + const totalSeconds = Math.max(0, Math.floor(milliseconds / 1_000)); + const seconds = totalSeconds % 60; + const totalMinutes = Math.floor(totalSeconds / 60); + const minutes = totalMinutes % 60; + const hours = Math.floor(totalMinutes / 60); + return hours > 0 + ? `${hours}:${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}` + : `${minutes}:${String(seconds).padStart(2, "0")}`; +} diff --git a/app/apps/glanceboard/widgets/nightscout-widget.ts b/app/apps/glanceboard/widgets/nightscout-widget.ts new file mode 100644 index 00000000..d9425d84 --- /dev/null +++ b/app/apps/glanceboard/widgets/nightscout-widget.ts @@ -0,0 +1,119 @@ +import { type GrayImage } from "../../../graphics/image"; +import { getDefaultLargeFont, getDefaultSmallFont } from "../../../graphics/ui-fonts"; +import { truncateText } from "../../../graphics/textwrap"; +import { nightscoutBridge, type NightscoutState } from "../../../native/nightscout-bridge"; +import { isNightscoutSettingsConfigured, loadNightscoutThresholds } from "../../../ui/dashboard-settings"; +import { lineStep } from "../../../ui/metrics"; +import { formatAgeShortFromTimestamp } from "~/util/date-util"; +import { evaluateNightscoutAlerts } from "../../nightscout/nightscout-alerts"; +import { + drawDirectionIndicator, + drawNightscoutGraph, + drawNightscoutValueStrikeThrough, + formatDelta, + isNightscoutPointStale, +} from "../../nightscout/nightscout"; +import { type GlanceWidget } from "../widget"; + +const PAD = 8; +/** Width of the readout column left of the graph. */ +const READOUT_WIDTH = 96; + +/** + * Current glucose (struck through once older than the app's staleness + * limit) with delta, trend, age and IOB beside the Nightscout app's 2-hour + * graph, plus any of cannula age, reservoir, pump battery and loop age that + * breach the limits in Nightscout settings, inverted as the app shows them. The bridge polls on its own for the whole session, so the + * widget only subscribes; a minute tick keeps the age and staleness moving + * during a stalled fetch. + */ +export class NightscoutWidget implements GlanceWidget { + private state: NightscoutState = nightscoutBridge.snapshot(); + private unsubscribe: (() => void) | null = null; + private tick: ReturnType | null = null; + + start(requestRender: () => void): void { + this.unsubscribe = nightscoutBridge.onStateChange((state) => { + this.state = state; + requestRender(); + }); + this.tick = setInterval(requestRender, 60_000); + } + + stop(): void { + this.unsubscribe?.(); + this.unsubscribe = null; + if (this.tick !== null) clearInterval(this.tick); + this.tick = null; + } + + paint(image: GrayImage): void { + const small = getDefaultSmallFont(); + const large = getDefaultLargeFont(); + const state = this.state; + const nowMs = Date.now(); + const step = lineStep(small); + image.drawText(small, PAD, PAD, "Nightscout", 150); + + if (!isNightscoutSettingsConfigured() || state.configurationMissing) { + image.drawText(small, PAD, PAD + step + 4, "Not configured", 140); + image.drawText(small, PAD, PAD + 2 * step + 4, "Set the site URL in the Nightscout app", 100); + return; + } + const latest = state.latest; + if (!state.available || !latest) { + image.drawText(small, PAD, PAD + step + 4, "No data", 140); + image.drawText(small, PAD, PAD + 2 * step + 4, truncateText(small, state.status, image.width - 2 * PAD), 100); + return; + } + + // Readout column: big value, units, then delta + trend, age and IOB. + const glucoseText = `${latest.sgv}`; + const glucoseY = PAD + step; + const glucoseWidth = large.measureText(glucoseText); + image.drawText(large, PAD, glucoseY, glucoseText, 230); + if (isNightscoutPointStale(latest, nowMs)) { + // Same rule as the app: older than NIGHTSCOUT_STALE_MS (15 min) gets a + // line through the digits at mid-height. + drawNightscoutValueStrikeThrough(image, PAD, glucoseY + (large.lineHeight >> 1), glucoseWidth); + } + const unitsX = PAD + glucoseWidth + 4; + if (unitsX + small.measureText(state.units) <= PAD + READOUT_WIDTH) { + image.drawText(small, unitsX, glucoseY + large.lineHeight - small.lineHeight, state.units, 140); + } + let y = glucoseY + large.lineHeight + 2; + const deltaText = `${formatDelta(state.delta)} `; + image.drawText(small, PAD, y, deltaText, 180); + drawDirectionIndicator(image, small, PAD + small.measureText(deltaText), y, state.direction, 180); + y += step; + image.drawText(small, PAD, y, `${formatAgeShortFromTimestamp(latest.timestampMs, nowMs)} ago`, 130); + y += step; + image.drawText(small, PAD, y, `IOB ${state.iob === null ? "--" : state.iob.toFixed(2)}`, 160); + y += step; + + // Breached limits only, one per line while they fit, inverted like the + // app's warning fields. Nothing here means nothing is out of range. + const alerts = evaluateNightscoutAlerts(state, loadNightscoutThresholds(), nowMs); + const warnings: string[] = []; + if (alerts.cannula) warnings.push(`CAGE ${formatAgeShortFromTimestamp(state.cageTimestampMs, nowMs)}`); + if (alerts.cartridge) warnings.push(`Reservoir ${state.reservoirUnits === null ? "--" : Math.round(state.reservoirUnits)}U`); + if (alerts.battery) warnings.push(`Battery ${state.batteryVoltage === null ? "--" : state.batteryVoltage.toFixed(2)}V`); + if (alerts.loop) warnings.push(`Loop ${formatAgeShortFromTimestamp(state.loopTimestampMs, nowMs)}`); + for (const warning of warnings) { + if (y + small.lineHeight > image.height - 2) break; + const text = truncateText(small, warning, READOUT_WIDTH - 4); + image.fillRect(PAD - 2, y - 1, small.measureText(text) + 4, small.lineHeight + 2, 230); + image.drawText(small, PAD, y, text, 1); + y += step; + } + + const graphX = PAD + READOUT_WIDTH + PAD; + drawNightscoutGraph( + image, + { x: graphX, y: PAD, width: image.width - graphX - PAD, height: image.height - 2 * PAD }, + state, + nowMs, + small, + ); + } +} diff --git a/app/apps/glanceboard/widgets/system-card.ts b/app/apps/glanceboard/widgets/system-card.ts new file mode 100644 index 00000000..ef60ac24 --- /dev/null +++ b/app/apps/glanceboard/widgets/system-card.ts @@ -0,0 +1,230 @@ +import { BATTERY_ICON_WIDTH, drawBattery } from "../../../graphics/battery"; +import { type GrayImage, type UiFont } from "../../../graphics/image"; +import { getDefaultLargeFont, getDefaultMediumFont, getDefaultSmallFont } from "../../../graphics/ui-fonts"; +import { onAndroidNotificationPosted, readActiveNotificationIcons } from "../../../native/notification-icons"; +import { readPhoneBatteryState } from "../../../native/phone-battery"; +import { formatClockDate, formatClockTime } from "../../../ui/clock-format"; +import { + batteryDisplayModeSetting, + batteryIndicatorVisible, + glassesBatteryVisibilitySetting, + onAnySettingChanged, + phoneBatteryVisibilitySetting, + ringBatteryVisibilitySetting, + type BatteryIndicatorVisibility, +} from "../../../ui/dashboard-settings"; +import { shell } from "../../../ui/shell/shell"; +import { noteStaleDataUsed, renderPassAllowsStaleData } from "../../../util/render-freshness"; +import { truncateText } from "../../../graphics/textwrap"; +import { timerEngine } from "../../timer/timer-engine"; +import { formatCountdown, sortTimers, timerDisplayName, timerPhase, timerRemainingMs } from "../../timer/timer-model"; +import { lineStep } from "../../../ui/metrics"; +import { type GlanceWidget } from "../widget"; + +const PAD = 8; +const NOTIFICATION_ICON_SIZE = 24; +const NOTIFICATION_ICON_GAP = 4; +const BATTERY_ITEM_GAP = 12; +const BATTERY_LABEL_VALUE = 150; + +type BatteryItem = { label: string; percent: number; charging: boolean }; + +/** + * Date and time, the phone's notification icons, the phone/G2/R1 battery + * indicators, and the Timers app's countdowns: the top bar's contents plus + * timers, laid out for a card. Battery style and per-device visibility + * follow Settings > Display > Battery indicators, so the card agrees with + * the bar. Countdowns tick once a second only while one is running. + */ +export class SystemCardWidget implements GlanceWidget { + private requestRender: (() => void) | null = null; + private minuteTimer: ReturnType | null = null; + private secondTimer: ReturnType | null = null; + private unsubscribeNotifications: (() => void) | null = null; + private unsubscribeSettings: (() => void) | null = null; + private unsubscribeTimers: (() => void) | null = null; + + start(requestRender: () => void): void { + this.requestRender = requestRender; + this.scheduleMinuteTick(); + this.unsubscribeNotifications = onAndroidNotificationPosted(() => this.requestRender?.()); + this.unsubscribeSettings = onAnySettingChanged(() => this.requestRender?.()); + this.unsubscribeTimers = timerEngine.onChange(() => { + this.syncSecondTick(); + this.requestRender?.(); + }); + this.syncSecondTick(); + } + + stop(): void { + this.requestRender = null; + if (this.minuteTimer !== null) clearTimeout(this.minuteTimer); + this.minuteTimer = null; + if (this.secondTimer !== null) clearInterval(this.secondTimer); + this.secondTimer = null; + this.unsubscribeNotifications?.(); + this.unsubscribeNotifications = null; + this.unsubscribeSettings?.(); + this.unsubscribeSettings = null; + this.unsubscribeTimers?.(); + this.unsubscribeTimers = null; + } + + /** Countdowns change every second; run that clock only while one is running. */ + private syncSecondTick(): void { + const running = timerEngine.timers().some((timer) => timerPhase(timer) === "running"); + if (running && this.secondTimer === null) { + this.secondTimer = setInterval(() => this.requestRender?.(), 1_000); + } else if (!running && this.secondTimer !== null) { + clearInterval(this.secondTimer); + this.secondTimer = null; + } + } + + /** Repaint on the minute boundary, so the clock never shows a stale minute. */ + private scheduleMinuteTick(): void { + if (this.minuteTimer !== null) clearTimeout(this.minuteTimer); + const now = Date.now(); + const untilNextMinute = 60_000 - (now % 60_000) + 50; + this.minuteTimer = setTimeout(() => { + this.minuteTimer = null; + if (!this.requestRender) return; + this.requestRender(); + this.scheduleMinuteTick(); + }, untilNextMinute); + } + + paint(image: GrayImage): void { + const large = getDefaultLargeFont(); + const medium = getDefaultMediumFont(); + const small = getDefaultSmallFont(); + const now = new Date(); + + // Clock and date down the left; batteries take the right edge. + const batteryLeft = drawBatteryBlock(image, small, image.width - PAD, PAD); + const textWidth = Math.max(0, batteryLeft - BATTERY_ITEM_GAP - PAD); + const timeText = formatClockTime(now); + const timeFont = large.measureText(timeText) <= textWidth ? large : medium; + let y = PAD; + image.drawText(timeFont, PAD, y, timeText, 230); + y += timeFont.lineHeight + 2; + image.drawText(medium, PAD, y, formatClockDate(now), 170); + y += medium.lineHeight + 4; + + // Notification icons along the bottom, as many as fit; the Timers app's + // countdowns take the band between the date and the icons. + const iconY = image.height - PAD - NOTIFICATION_ICON_SIZE; + drawTimers(image, small, PAD, y, textWidth, iconY - 4, now.getTime()); + const maxIcons = Math.max(0, ((image.width - 2 * PAD + NOTIFICATION_ICON_GAP) / (NOTIFICATION_ICON_SIZE + NOTIFICATION_ICON_GAP)) | 0); + if (maxIcons > 0) { + const { icons, stale } = readActiveNotificationIcons(maxIcons, renderPassAllowsStaleData()); + if (stale) noteStaleDataUsed(); + for (let index = 0; index < icons.length; index++) { + image.drawImage(icons[index]!, PAD + index * (NOTIFICATION_ICON_SIZE + NOTIFICATION_ICON_GAP), iconY); + } + } + } +} + +function collectBatteryItems(): BatteryItem[] { + const items: BatteryItem[] = []; + const push = (visibility: BatteryIndicatorVisibility, label: string, percent: number | null, charging: boolean | null) => { + if (percent === null || !Number.isFinite(percent)) return; + const clamped = Math.max(0, Math.min(100, Math.round(percent))); + if (!batteryIndicatorVisible(visibility, clamped)) return; + items.push({ label, percent: clamped, charging: Boolean(charging) }); + }; + const phone = readPhoneBatteryState(); + push(phoneBatteryVisibilitySetting.get(), "Phone", phone.battery, phone.charging); + const levels = shell.getBatteryLevels(); + push(glassesBatteryVisibilitySetting.get(), "G2", levels.headset, levels.headsetCharging); + if (levels.ring !== null && Number.isInteger(levels.ring) && levels.ring >= 0 && levels.ring <= 100) { + push(ringBatteryVisibilitySetting.get(), "R1", levels.ring, levels.ringCharging); + } + return items; +} + +/** + * The battery indicators right-aligned at `right`, in the configured style. + * Side-by-side styles put the label beside the gauge (or percentage) on one + * line; stacked styles centre the label above it. Returns the block's left + * edge (or `right` when nothing is shown). + */ +function drawBatteryBlock(image: GrayImage, font: UiFont, right: number, top: number): number { + const items = collectBatteryItems(); + if (!items.length) return right; + const mode = batteryDisplayModeSetting.get(); + const percentage = mode === "percentage" || mode === "stacked-percentage"; + const stacked = mode === "stacked" || mode === "stacked-percentage"; + const gaugeHeight = drawBattery(0, false).height; + let x = right; + for (let index = items.length - 1; index >= 0; index--) { + const item = items[index]!; + const percentText = `${item.percent}%`; + const labelWidth = font.measureText(item.label); + const valueWidth = percentage ? font.measureText(percentText) : BATTERY_ICON_WIDTH; + if (stacked) { + const itemWidth = Math.max(labelWidth, valueWidth); + x -= itemWidth; + image.drawText(font, x + (((itemWidth - labelWidth) / 2) | 0), top, item.label, BATTERY_LABEL_VALUE); + drawBatteryValue(image, font, x + (((itemWidth - valueWidth) / 2) | 0), top + font.lineHeight + 2, item, percentage, gaugeHeight); + } else { + x -= labelWidth + 5 + valueWidth; + image.drawText(font, x, top, item.label, BATTERY_LABEL_VALUE); + drawBatteryValue(image, font, x + labelWidth + 5, top, item, percentage, gaugeHeight); + } + x -= BATTERY_ITEM_GAP; + } + return x + BATTERY_ITEM_GAP; +} + +function drawBatteryValue( + image: GrayImage, + font: UiFont, + x: number, + lineTop: number, + item: BatteryItem, + percentage: boolean, + gaugeHeight: number, +): void { + if (percentage) { + const percentText = `${item.percent}%`; + if (item.charging) { + // Inverted text marks charging, as in the top bar. + image.fillRect(x - 2, lineTop - 1, font.measureText(percentText) + 4, font.lineHeight + 2, 255); + image.drawText(font, x, lineTop, percentText, 1); + } else { + image.drawText(font, x, lineTop, percentText, 200); + } + return; + } + const icon = drawBattery(item.percent, item.charging); + image.bitBlt(icon, x, lineTop + Math.max(0, ((font.lineHeight - gaugeHeight) / 2) | 0), { transparentZero: true }); +} + +/** + * The Timers app's countdowns, soonest first: remaining time (or "Done" once + * rung, inverted so it is noticed; "paused" for a paused one) and the + * timer's name, one per line while they fit between `top` and `bottom`. + */ +function drawTimers(image: GrayImage, font: UiFont, x: number, top: number, width: number, bottom: number, nowMs: number): void { + const timers = sortTimers(timerEngine.timers(), nowMs); + const step = lineStep(font); + let y = top; + for (const timer of timers) { + if (y + font.lineHeight > bottom) break; + const phase = timerPhase(timer); + const clock = phase === "rung" ? "Done" : formatCountdown(timerRemainingMs(timer, nowMs)); + const clockWidth = font.measureText(clock); + if (phase === "rung") { + image.fillRect(x - 2, y - 1, clockWidth + 4, font.lineHeight + 2, 230); + image.drawText(font, x, y, clock, 1); + } else { + image.drawText(font, x, y, clock, phase === "paused" ? 120 : 200); + } + const nameX = x + clockWidth + 8; + const name = phase === "paused" ? `${timerDisplayName(timer)} (paused)` : timerDisplayName(timer); + image.drawText(font, nameX, y, truncateText(font, name, Math.max(0, x + width - nameX)), 160); + y += step; + } +} diff --git a/app/apps/glanceboard/widgets/terminal-widget.ts b/app/apps/glanceboard/widgets/terminal-widget.ts new file mode 100644 index 00000000..b48b8543 --- /dev/null +++ b/app/apps/glanceboard/widgets/terminal-widget.ts @@ -0,0 +1,126 @@ +import { type GrayImage } from "../../../graphics/image"; +import { truncateText } from "../../../graphics/textwrap"; +import { getDefaultSmallFont } from "../../../graphics/ui-fonts"; +import { lineStep } from "../../../ui/metrics"; +import { onWorkerStateChanged, readWorkerState } from "../../../ui/shell/worker-state"; +import { + drawSessionRow, + isSessionRowActive, + SESSION_ACTIVITY_STEP_MS, + TERMINAL_SESSIONS_STATE_KEY, + type TerminalSessionsSnapshot, +} from "../../terminal/session-list"; +import { type GlanceWidget } from "../widget"; + +const PAD = 8; +const GUTTER_X = PAD; +/** A row fits while its glyph line clears this margin above the bottom edge. */ +const BOTTOM_MARGIN = 2; + +/** + * The Terminal app's session list at card size: the same hosts, sessions, + * activity indicators and open-window numbers as the hub window, painted + * with the same row painter from the snapshot the Terminal worker publishes. + * The indicator animates on the hub's cadence while any session is active; + * each row carries its own activity deadline, so nothing needs the worker + * once the snapshot is in. + */ +export class TerminalWidget implements GlanceWidget { + private snapshot: TerminalSessionsSnapshot | undefined = readWorkerState(TERMINAL_SESSIONS_STATE_KEY); + private unsubscribe: (() => void) | null = null; + private requestRender: (() => void) | null = null; + private phase = 0; + private animationTimer: ReturnType | null = null; + + start(requestRender: () => void): void { + this.requestRender = requestRender; + this.snapshot = readWorkerState(TERMINAL_SESSIONS_STATE_KEY); + this.unsubscribe = onWorkerStateChanged(TERMINAL_SESSIONS_STATE_KEY, (snapshot) => { + this.snapshot = snapshot; + this.syncAnimation(); + requestRender(); + }); + this.syncAnimation(); + } + + stop(): void { + this.requestRender = null; + this.unsubscribe?.(); + this.unsubscribe = null; + if (this.animationTimer !== null) clearInterval(this.animationTimer); + this.animationTimer = null; + } + + private anyActive(nowMs = Date.now()): boolean { + return Boolean(this.snapshot?.hosts.some((host) => host.sessions.some((row) => isSessionRowActive(row, nowMs)))); + } + + /** Run the indicator clock only while something is active; the last tick clears expired ones. */ + private syncAnimation(): void { + const shouldRun = this.anyActive(); + if (shouldRun && this.animationTimer === null) { + this.phase = 0; + this.animationTimer = setInterval(() => { + this.phase = (this.phase + 1) % 2; + this.requestRender?.(); + if (!this.anyActive()) this.syncAnimation(); + }, SESSION_ACTIVITY_STEP_MS); + } else if (!shouldRun && this.animationTimer !== null) { + clearInterval(this.animationTimer); + this.animationTimer = null; + } + } + + paint(image: GrayImage): void { + const font = getDefaultSmallFont(); + const step = lineStep(font); + const textWidth = image.width - 2 * PAD; + const snapshot = this.snapshot; + const nowMs = Date.now(); + let y = PAD; + image.drawText(font, PAD, y, "Terminal", 150); + y += step; + + if (!snapshot) { + image.drawText(font, PAD, y, "Open the Terminal app to connect", 120); + return; + } + const hosts = snapshot.hosts; + const sessionCount = hosts.reduce((sum, host) => sum + host.sessions.length, 0); + if (!hosts.length || !sessionCount) { + const text = !snapshot.configured + ? "No connections configured" + : !hosts.length + ? snapshot.status + : "No live sessions"; + image.drawText(font, PAD, y, truncateText(font, text, textWidth), 120); + return; + } + + // Rows are placed a line step apart but only need their line height to + // fit, so the last one may sit right against the bottom margin. + const fits = (top: number) => top + font.lineHeight <= image.height - BOTTOM_MARGIN; + const multiHost = hosts.length > 1; + for (const host of hosts) { + if (multiHost) { + if (!fits(y)) return; + image.drawText(font, PAD, y, truncateText(font, host.name, textWidth), 110); + y += step; + } + for (const row of host.sessions) { + if (!fits(y)) return; + drawSessionRow(image, font, { + x: GUTTER_X, + y, + width: image.width - GUTTER_X - PAD, + label: row.label, + openGlyph: row.openGlyph, + active: isSessionRowActive(row, nowMs), + phase: this.phase, + value: 200, + }); + y += step; + } + } + } +} diff --git a/app/apps/nightscout/nightscout.ts b/app/apps/nightscout/nightscout.ts index 380f0595..8a0878da 100644 --- a/app/apps/nightscout/nightscout.ts +++ b/app/apps/nightscout/nightscout.ts @@ -24,11 +24,11 @@ import { openSettingsSubMenu } from "../../ui/dashboard/settings-panel"; import { lineStep } from "../../ui/metrics"; const nightscoutLargeFont = getDefaultLargeFont(); -const NIGHTSCOUT_STALE_MS = 15 * 60 * 1000; +export const NIGHTSCOUT_STALE_MS = 15 * 60 * 1000; const NIGHTSCOUT_GRAPH_WINDOW_MS = 2 * 60 * 60 * 1000; const NIGHTSCOUT_GRAPH_TIME_QUANTUM_MS = 60 * 1000; -function drawDirectionIndicator( +export function drawDirectionIndicator( image: GrayImage, font: UiFont, x: number, @@ -85,7 +85,7 @@ function truncateLine(text: string, maxChars: number): string { return `${text.slice(0, Math.max(0, maxChars - 3))}...`; } -function formatDelta(delta: number | null): string { +export function formatDelta(delta: number | null): string { if (delta === null) return "--"; return `${delta >= 0 ? "+" : ""}${Math.round(delta)}`; } @@ -98,7 +98,7 @@ function formatBolusLabel(value: number): string { return Number.isInteger(value) ? `${value}` : value.toFixed(1); } -function drawNightscoutGraph( +export function drawNightscoutGraph( image: GrayImage, bounds: { x: number; y: number; width: number; height: number }, nightscout: NightscoutState, @@ -431,10 +431,10 @@ export function nightscoutMenuItems(): MenuItem[] { ]; } -function isNightscoutPointStale(point: NightscoutState["latest"], nowMs: number): boolean { +export function isNightscoutPointStale(point: NightscoutState["latest"], nowMs: number): boolean { return point !== null && nowMs - point.timestampMs > NIGHTSCOUT_STALE_MS; } -function drawNightscoutValueStrikeThrough(image: GrayImage, x: number, y: number, width: number): void { +export function drawNightscoutValueStrikeThrough(image: GrayImage, x: number, y: number, width: number): void { image.drawLine(x, y, x + width, y, 180); } diff --git a/app/apps/terminal/session-list.ts b/app/apps/terminal/session-list.ts new file mode 100644 index 00000000..fec37741 --- /dev/null +++ b/app/apps/terminal/session-list.ts @@ -0,0 +1,100 @@ +/** + * The terminal session list as it is drawn in two places: the Terminal app's + * hub window (in the worker) and the Glanceboard's Terminal widget (on the + * main thread). The worker publishes a snapshot of the list through the + * host's worker-state channel; both painters use drawSessionRow so a row + * looks the same in each. + * + * No NativeScript imports: this module is bundled into the worker as well. + */ +import { type GrayImage, type UiFont } from "../../graphics/image"; +import { truncateText } from "../../graphics/textwrap"; + +/** Worker-state key the Terminal worker publishes its snapshot under. */ +export const TERMINAL_SESSIONS_STATE_KEY = "terminal:sessions"; + +/** Alternation period of the activity indicator, shared by hub rows, the widget and sidebar cursors. */ +export const SESSION_ACTIVITY_STEP_MS = 800; + +export type TerminalSessionRow = { + /** Connection-scoped identity (connection id + socket). */ + key: string; + label: string; + /** Local-clock time (Date.now() domain) until which the session counts as active; 0 = idle. */ + activeUntilMs: number; + /** Sidebar glyph ("1", "2", ...) of the view window showing this session, or null when none is open. */ + openGlyph: string | null; +}; + +export type TerminalHostGroup = { + /** Host name, shown as a heading when more than one host is connected. */ + name: string; + sessions: TerminalSessionRow[]; +}; + +export type TerminalSessionsSnapshot = { + /** Connected hosts, each with its live sessions most-recently-updated first. */ + hosts: TerminalHostGroup[]; + /** The hub's status line ("Connecting...", "No connections configured.", ...). */ + status: string; + /** Whether any g2mirror connection is configured at all. */ + configured: boolean; +}; + +/** Whether a row's activity indicator should show right now. */ +export function isSessionRowActive(row: TerminalSessionRow, nowMs = Date.now()): boolean { + return row.activeUntilMs > nowMs; +} + +/** Width of the window-number column (one glyph plus breathing room). */ +export function sessionGlyphColumnWidth(font: UiFont): number { + return font.measureText("W") + 6; +} + +/** Left edge of the label in a row whose activity gutter starts at `x`. */ +export function sessionLabelX(font: UiFont, x: number): number { + return x + SESSION_INDICATOR_SIZE + 4 + sessionGlyphColumnWidth(font); +} + +const SESSION_INDICATOR_SIZE = 6; + +/** + * One session row: the activity indicator in the gutter at `x` (a small + * square, filled on even animation phases and outlined on odd ones, drawn as + * shapes rather than a font glyph so both states read in every UI font), + * then the open view window's glyph in its own column, then the label, + * truncated (never wrapped) to fit `width`. + */ +export function drawSessionRow( + image: GrayImage, + font: UiFont, + options: { + x: number; + /** Top of the text line. */ + y: number; + /** Horizontal room from `x`, label included. */ + width: number; + label: string; + openGlyph: string | null; + active: boolean; + /** Animation phase (0 = filled indicator). */ + phase: number; + /** Text brightness for the label (the glyph draws a little dimmer). */ + value: number; + }, +): void { + const { x, y, width, label, openGlyph, active, phase, value } = options; + if (active) { + const iy = y + Math.max(0, ((font.lineHeight - SESSION_INDICATOR_SIZE) / 2) | 0); + if (phase % 2 === 0) { + image.fillRect(x, iy, SESSION_INDICATOR_SIZE, SESSION_INDICATOR_SIZE, value); + } else { + image.drawRect(x, iy, SESSION_INDICATOR_SIZE, SESSION_INDICATOR_SIZE, value); + } + } + if (openGlyph) { + image.drawText(font, x + SESSION_INDICATOR_SIZE + 4, y, openGlyph, Math.max(0, value - 60)); + } + const labelX = sessionLabelX(font, x); + image.drawText(font, labelX, y, truncateText(font, label, Math.max(0, x + width - labelX)), value); +} diff --git a/app/apps/terminal/terminal-app.worker.ts b/app/apps/terminal/terminal-app.worker.ts index 3f315a0b..26e748c6 100644 --- a/app/apps/terminal/terminal-app.worker.ts +++ b/app/apps/terminal/terminal-app.worker.ts @@ -37,6 +37,11 @@ import { prepareFrameDraws } from "../../graphics/glyph-wire"; import { getDefaultSmallFont, getTerminalFontConfig } from "../../graphics/ui-fonts"; import { truncateText } from "../../graphics/textwrap"; import { TERMINAL_ICON_GLYPHS, type IconActivity } from "../../graphics/icons"; +import { + drawSessionRow, + TERMINAL_SESSIONS_STATE_KEY, + type TerminalSessionsSnapshot, +} from "./session-list"; import * as frameTimings from "../../native/frame-timings"; import { getActiveDisplay } from "../../native/active-display"; import { GESTURE_DOUBLE_CLICK, type InputEvent } from "../../ui/gestures"; @@ -722,6 +727,48 @@ function renderHubWindows(): void { for (const window of windows.values()) { if (window.kind === "hub") scheduleRender(window); } + // Every change the hub repaints for is one the published list may reflect. + publishSessionsSnapshot(); +} + +let lastPublishedSnapshot = ""; + +/** + * Publish the session list for main-thread consumers (the Glanceboard's + * Terminal widget): connected hosts with their sessions most-recently-updated + * first, each with its activity deadline (local clock, so the consumer can + * expire and animate it itself) and the glyph of its open view window. Posted + * only when the JSON actually changed. + */ +function publishSessionsSnapshot(): void { + const connected = connectedControls(); + const snapshot: TerminalSessionsSnapshot = { + hosts: connected.map((control) => { + const connectionId = control.config.id; + const sessions = (control.state?.sessions ?? []) + .slice() + .sort( + (a, b) => + (sessionRecency.get(recencyKey(connectionId, b.socket)) ?? 0) - + (sessionRecency.get(recencyKey(connectionId, a.socket)) ?? 0), + ); + return { + name: connectionDisplayName(control.config), + sessions: sessions.map((session) => ({ + key: recencyKey(connectionId, session.socket), + label: sessionLabel(session), + activeUntilMs: (sessionActivity.get(recencyKey(connectionId, session.socket)) ?? -ACTIVITY_ACTIVE_MS) + ACTIVITY_ACTIVE_MS, + openGlyph: viewGlyphForSocket(connectionId, session.socket), + })), + }; + }), + status: sessionsStatusLine(), + configured: controls.size > 0, + }; + const encoded = JSON.stringify(snapshot); + if (encoded === lastPublishedSnapshot) return; + lastPublishedSnapshot = encoded; + post({ type: "publish-state", key: TERMINAL_SESSIONS_STATE_KEY, state: snapshot }); } // One animation clock for foreground hub rows and every terminal sidebar icon. @@ -1117,6 +1164,8 @@ type HubItem = { heading?: boolean; /** Session with recent output: an animated indicator marks the row. */ active?: boolean; + /** Glyph of the view window showing this session (the number column). */ + openGlyph?: string | null; onSelect?: () => void; }; @@ -1182,10 +1231,10 @@ function hubSessionItems(window: HubWindow): HubItem[] { } const sessions = orderedSessions(window, control); for (const session of sessions) { - const openWindowId = viewWindowIdForSocket(control.config.id, session.socket); items.push({ - label: openWindowId ? `${sessionLabel(session)} [open]` : sessionLabel(session), + label: sessionLabel(session), active: isSessionActive(control.config.id, session.socket), + openGlyph: viewGlyphForSocket(control.config.id, session.socket), onSelect: () => { const windowId = viewWindowIdForSocket(control.config.id, session.socket); if (windowId) { @@ -1420,6 +1469,19 @@ function handleHubInput(window: HubWindow, event: InputEvent, frameId: number): * Includes views that were requested but whose surface hasn't opened yet, so * a quick double-select can't spawn two windows for one session. */ +/** Sidebar glyph of the (open or opening) view window on a session, or null. */ +function viewGlyphForSocket(connectionId: string, socket: string): string | null { + for (const window of windows.values()) { + if (window.kind === "view" && window.connectionId === connectionId && window.socket === socket) { + return window.glyph || null; + } + } + for (const pending of pendingViews.values()) { + if (pending.connectionId === connectionId && pending.socket === socket) return pending.glyph || null; + } + return null; +} + function viewWindowIdForSocket(connectionId: string, socket: string): string | null { for (const window of windows.values()) { if (window.kind === "view" && window.connectionId === connectionId && window.socket === socket) { @@ -1538,20 +1600,18 @@ function paintHub(window: HubWindow): GrayImage { // an outline-only selection signals the sidebar owns input. drawSelectionHighlight(image, 20, y - 2, window.viewportWidth - 40, hubRowH - 1, window.focused, 8); } - image.drawText(chromeFont(), 32, y + 2, item.label, selected ? 255 : 200); - if (item.active) { - // Activity indicator in the gutter left of the label, alternating - // filled/outline each animation step (drawn shapes, not a font glyph, - // so the two states render distinctly in every UI font). - const size = 6; - const iy = y + 2 + Math.max(0, ((font.lineHeight - size) / 2) | 0); - const value = selected ? 255 : 200; - if (hubAnimationPhase === 0) { - image.fillRect(22, iy, size, size, value); - } else { - image.drawRect(22, iy, size, size, value); - } - } + // Activity gutter, open-window number column, then the label, truncated + // to the row (shared with the Glanceboard's Terminal widget). + drawSessionRow(image, chromeFont(), { + x: 22, + y: y + 2, + width: window.viewportWidth - 22 - 26, + label: item.label, + openGlyph: item.openGlyph ?? null, + active: Boolean(item.active), + phase: hubAnimationPhase, + value: selected ? 255 : 200, + }); } if (items.length > visibleRowCount) { drawListScrollbar( @@ -1594,6 +1654,11 @@ function hubStatusLine(window: HubWindow): string { if (window.mode === "connections") { return "Select a connection to connect, disconnect, or remove."; } + return sessionsStatusLine(); +} + +/** The sessions view's status line (also published with the session snapshot). */ +function sessionsStatusLine(): string { if (controls.size === 0) { return "No connections configured."; } @@ -1829,7 +1894,8 @@ function toolListSessions(): ToolResult { lines.push(`${connectionDisplayName(control.config)}:`); } for (const session of sessions) { - const open = viewWindowIdForSocket(control.config.id, session.socket) ? " [open]" : ""; + const glyph = viewGlyphForSocket(control.config.id, session.socket); + const open = glyph ? ` [open in window ${glyph}]` : viewWindowIdForSocket(control.config.id, session.socket) ? " [open]" : ""; lines.push(`- ${sessionLabel(session)}${open}`); } if (!sessions.length && multiHost) { diff --git a/app/apps/timer/timer-engine.ts b/app/apps/timer/timer-engine.ts index 61efa9c7..57bb5e88 100644 --- a/app/apps/timer/timer-engine.ts +++ b/app/apps/timer/timer-engine.ts @@ -266,6 +266,11 @@ export class TimerEngine { ); } + /** Every countdown timer (running, paused or rung), unsorted. */ + timers(): readonly CountdownTimer[] { + return this.state.timers; + } + ringingItems(): RingingItem[] { const items: RingingItem[] = []; for (const timer of this.state.timers) { diff --git a/app/g2/dashboard-controller.ts b/app/g2/dashboard-controller.ts index ed1ccb29..fbd9b57d 100644 --- a/app/g2/dashboard-controller.ts +++ b/app/g2/dashboard-controller.ts @@ -43,6 +43,8 @@ const MIRROR_TOUCH_GESTURES: Record, WearRemoteI "swipe-right": "swipe-right", }; import { findSoundEffect, playSoundEffect } from "../ui/sound-effects"; +import { GlanceHost } from "./glance-host"; +import { type GlanceEvent } from "./glance-state"; import { isWelcomeSoundPending, setWelcomeSoundPending } from "../phone-ui/onboarding-state"; import { beginRenderPass, endRenderPass } from "../util/render-freshness"; import { voiceControlBridge } from "../native/voice-control"; @@ -52,6 +54,7 @@ import { prepareFrameDraws } from "../graphics/glyph-wire"; import { getDefaultMediumFont } from "../graphics/ui-fonts"; import { wrapText } from "../graphics/textwrap"; import { rawInputEventToInputEvent, shell, type ShellInputOutcome } from "../ui/shell/shell"; +import { type InputEvent } from "../ui/gestures"; import { registerSystemTools } from "../assistant/system-tools"; import { updateGlassesPresence } from "./glasses-presence"; import { timerEngine } from "../apps/timer/timer-engine"; @@ -252,6 +255,26 @@ class DashboardController { private screenTimeoutTimer: ReturnType | null = null; private evenHubSuspendTimer: ReturnType | null = null; private evenHubSessionSuspended = false; + /** + * The Glanceboard: the alternate sleep-time display, on its own surface + * above the shell. Fed sleep-time input from handleInputEvent; it uses the + * same wake barrier as the shell and hands the compositor back to the + * screen-off path when it hides. + */ + private readonly glance = new GlanceHost({ + getDisplay: () => this.display, + getProvider: () => ALL_APPS.find((app) => app.glanceboard)?.glanceboard ?? null, + canShow: () => (this.phase === "connected" || this.isPreviewDisplayActive()) && !this.glassesLocked, + ensureSessionActive: (frameId) => this.ensureEvenHubSessionActive(frameId), + onHiddenWhileAsleep: () => { + if (!shell.isScreenOn()) this.handleScreenStateChanged(false); + }, + onVisibilityChanged: () => { + this.schedulePreviewUpdate(); + this.emit(); + }, + appendLog: (message) => this.appendLog(message), + }); private evenHubResumePromise: Promise | null = null; /** Faceclaw's firmware at the required revision reported in; its extensions can be used. */ private customFirmwareConfirmed = false; @@ -359,6 +382,8 @@ class DashboardController { this.emit(); }, onScreenStateChanged: (on) => { + // Any wake of the regular UI replaces a showing Glanceboard. + if (on) this.glance.dismiss(); this.handleScreenStateChanged(on); if (on) this.requestShellRender(); this.emit(); @@ -788,6 +813,7 @@ class DashboardController { if ( !suspendEvenHubWhenScreenOffSetting.get() || shell.isScreenOn() || + this.glance.isVisible() || this.phase !== "connected" || !this.communicator || this.evenHubSessionSuspended @@ -801,9 +827,11 @@ class DashboardController { if ( !suspendEvenHubWhenScreenOffSetting.get() || shell.isScreenOn() || + this.glance.isVisible() || this.phase !== "connected" || this.communicator !== communicator ) { + // A showing Glanceboard re-arms this when it hides. return; } @@ -829,6 +857,7 @@ class DashboardController { if ( !suspendEvenHubWhenScreenOffSetting.get() || shell.isScreenOn() || + this.glance.isVisible() || this.phase !== "connected" || this.communicator !== communicator ) { @@ -1250,6 +1279,7 @@ class DashboardController { const target = this.previewTarget; if (!target) return; this.previewTarget = null; + this.glance.reset(); target.release(); this.clearDashboardTimer(); this.appendLog("Preview-only display released."); @@ -1294,6 +1324,7 @@ class DashboardController { this.customFirmwareConfirmed = false; this.faceclawWakeLeaseState = null; this.lockSurfaceConfigured = false; + this.glance.reset(); this.evenHubResumePromise = null; this.connectRunning = true; @@ -1549,6 +1580,7 @@ class DashboardController { } this.communicator = null; this.lockSurfaceConfigured = false; + this.glance.reset(); this.customFirmwareConfirmed = false; this.faceclawWakeLeaseState = null; this.evenHubResumePromise = null; @@ -1683,6 +1715,7 @@ class DashboardController { const communicator = this.communicator; this.communicator = null; this.lockSurfaceConfigured = false; + this.glance.reset(); this.evenHubSessionSuspended = false; this.evenHubResumePromise = null; @@ -1756,14 +1789,14 @@ class DashboardController { * finger-down/finger-up (the watch) hold for as long as the user does. */ async injectSyntheticRingInput(kind: WearRemoteInputKind, origin: SyntheticInputOrigin = "ring"): Promise { - // Match the ring while the display is dark: only a double-click wakes it, - // and that wake is handled by Shell.receiveInput. This check also protects - // against a watch acting on a stale state snapshot. + // Match the ring while the display is dark: a double-click wakes it + // (handled by Shell.receiveInput) and a tap or hold shows the + // Glanceboard; scrolls and the menu gesture mean nothing. This check also + // protects against a watch acting on a stale state snapshot. if ( origin === "watch" && !shell.isScreenOn() && - kind !== "double-click" && - kind !== "long-press-release" + (kind === "scroll-up" || kind === "scroll-down" || kind === "short-then-long-press") ) { this.appendLog(`${kind} (watch scheme) ignored while display is off`); return; @@ -1794,7 +1827,12 @@ class DashboardController { return; } if (!shell.isScreenOn()) { + // Asleep, the mirror offers the sleep gestures: double-tap wakes, a + // tap shows the Glanceboard for its timeout. The mirror's hold has no + // real release (the synthetic long-press releases at once, which would + // only flash the board), so it counts as a tap here too. if (kind === "double-tap") await this.injectSyntheticRingInput("double-click", "watch"); + else if (kind === "tap" || kind === "long-press") await this.injectSyntheticRingInput("click", "watch"); return; } if (kind !== "tap") { @@ -2056,6 +2094,20 @@ class DashboardController { } return; } + if (!shell.isScreenOn()) { + // Sleep-time gestures belong to the Glanceboard: a tap or a hold + // shows it (the shell would ignore them), and a double-tap while it + // is up dismisses it and falls through to the normal wake below. + const glanceEvent = this.glanceEventFor(inputEvent, event); + if (glanceEvent?.type === "dismiss") { + this.glance.dismiss(); + } else if (glanceEvent) { + frameTimings.annotateFrame(frameId, `glanceboard ${glanceEvent.type}`); + await this.glance.handleEvent(glanceEvent, frameId); + frameOwned = true; + return; + } + } const wakewordShouldWake = event.kind === "even-ai" && event.eventType === EvenAIStatus.EVEN_AI_WAKE_UP && @@ -2129,6 +2181,19 @@ class DashboardController { } } + /** + * The Glanceboard event a sleep-time input means, or null when the shell + * should see the input as usual. A display-wake carries the head-tilt + * gesture (HEAD_UP_EVENT) as a press; the double-tap display-wake stays the + * regular UI's wake. + */ + private glanceEventFor(inputEvent: InputEvent, event: RawInputEvent): GlanceEvent | null { + if (inputEvent.type === "display-wake") { + return event.eventType === OsEventTypeList.HEAD_UP_EVENT ? this.glance.eventForGesture("head-tilt") : null; + } + return this.glance.eventForGesture(inputEvent.type); + } + /** Launch or focus an in-process singleton app (notifications, debug tests). */ private async launchInProcessApp( windowId: string, diff --git a/app/g2/events.ts b/app/g2/events.ts index 877dd901..8e6a7ee2 100644 --- a/app/g2/events.ts +++ b/app/g2/events.ts @@ -71,6 +71,12 @@ export const OsEventTypeList = { RING_LONG_PRESS_RELEASE_EVENT: 10, /** CFW extension: the 2.2.9 tap-then-hold Menu gesture. */ SHORT_THEN_LONG_PRESS_EVENT: 11, + /** + * CFW extension (head-tilt wake branch): the IMU head-up gesture, forwarded + * while the display sleeps. Reaches the phone as a display-wake carrying + * this eventType; the glance host treats it as a press. + */ + HEAD_UP_EVENT: 12, } as const; export const OsEventTypeName: Record = { @@ -86,4 +92,5 @@ export const OsEventTypeName: Record = { 9: "RING_LONG_PRESS_EVENT", 10: "RING_LONG_PRESS_RELEASE_EVENT", 11: "SHORT_THEN_LONG_PRESS_EVENT", + 12: "HEAD_UP_EVENT", }; diff --git a/app/g2/firmware-compat.ts b/app/g2/firmware-compat.ts index 543ef294..024b9eea 100644 --- a/app/g2/firmware-compat.ts +++ b/app/g2/firmware-compat.ts @@ -26,7 +26,7 @@ export type FirmwareInfo = { }; /** The Faceclaw firmware revision this build of the app needs. */ -export const REQUIRED_FACECLAW_FIRMWARE_VERSION = 1; +export const REQUIRED_FACECLAW_FIRMWARE_VERSION = 3; const FACECLAW_PREFIX = "Faceclaw/"; const LEGACY_PREFIX = "EVENCFW"; diff --git a/app/g2/firmware/cfw-patches.ts b/app/g2/firmware/cfw-patches.ts index a5c69c8c..63ff3f5f 100644 --- a/app/g2/firmware/cfw-patches.ts +++ b/app/g2/firmware/cfw-patches.ts @@ -19,7 +19,7 @@ export type FirmwarePatchSet = { export const CFW_PATCH_SET: FirmwarePatchSet = { "base": "g2_2.2.9.22.bin", "baseSha256": "a03fbea9f68a9de6bc271daabb9f3a41c59053d1086622c76a4e990f829cc561", - "outputSha256": "d65a2930519e82a5ff72e7c6c852a25f2ed7651133fa95ccba5fbecdf76ef950", + "outputSha256": "55fdfb81d4d6432ffd01d340b21286c121d6bd14af0012acf2c92ca80dbce277", "patches": [ { "offset": 1363762, @@ -66,7 +66,7 @@ export const CFW_PATCH_SET: FirmwarePatchSet = { { "offset": 1516784, "old": "70f775ff", - "new": "d6f2fffa", + "new": "d6f22dfa", "desc": "bl snapshot_side @ 0x4ec0ee (shared image-complete helper)" }, { @@ -78,55 +78,67 @@ export const CFW_PATCH_SET: FirmwarePatchSet = { { "offset": 1222660, "old": "49f0daff", - "new": "1ef379f9", + "new": "1ef3a7f8", "desc": "bl image_deferred (deferred consumer -> FIFO restore + worker, both lenses)" }, { "offset": 1242342, "old": "d4f790fb", - "new": "1af320fd", + "new": "1af3e2fb", "desc": "bl settings_send_wrapper (append caps field 100)" }, { "offset": 1240038, "old": "f5f710f9", - "new": "1af3b6fe", + "new": "1af3b8fd", "desc": "bl settings_decode_wrapper (Faceclaw lease field 101)" }, { "offset": 939336, "old": "0bf02af9", - "new": "64f321f9", - "desc": "bl faceclaw_display_start @ 0x45f146 (fail-open double-tap takeover)" + "new": "64f32ff8", + "desc": "bl faceclaw_display_start @ 0x45f146 (fail-open wake takeover)" }, { "offset": 939528, "old": "0bf0caf8", - "new": "64f3c1f8", - "desc": "bl faceclaw_display_start @ 0x45f206 (fail-open double-tap takeover)" + "new": "64f39df8", + "desc": "bl faceclaw_display_start_headup @ 0x45f206 (fail-open wake takeover)" + }, + { + "offset": 939016, + "old": "10f096f8", + "new": "65f3affd", + "desc": "bl headup_gate (head-up sensor event -> EvenHub sys event 12 under lease)" + }, + { + "offset": 939036, + "old": "fff765fb", + "new": "63f3f3ff", + "desc": "bl faceclaw_idle_input_gate (idle tap/long/release -> field-102 events 2/3/4)" }, { "offset": 831036, "old": "1df057fc", - "new": "80f333f9", + "new": "7ff38bff", "desc": "bl gesture_press (Faceclaw lease gates event 9 vs stock UI event 8)" }, { "offset": 831042, "old": "24f023f9", - "new": "80f3d4f9", + "new": "80f32cf8", "desc": "bl gesture_short_long (Faceclaw lease gates event 11 vs stock Menu path)" }, { "offset": 831800, "old": "1df0d9fa", - "new": "7ff3b9ff", + "new": "7ff311fe", "desc": "bl gesture_release (source-qualified event 10 vs stock UI event 0x4a)" }, { "offset": 1553752, "old": "7fb50600", - "new": "cef2d5bc", + "new": "cef297bb", "desc": "even_ai_display_ctrl entry -> conditional Faceclaw lease trampoline" }, { @@ -144,67 +156,67 @@ export const CFW_PATCH_SET: FirmwarePatchSet = { { "offset": 1255404, "old": "d9f758ff", - "new": "16f3cdfe", + "new": "16f30ffe", "desc": "bl faceclaw_send_wear_event @ 0x4ac3ea (outside onboarding)" }, { "offset": 1255504, "old": "d9f726ff", - "new": "16f39bfe", + "new": "16f3ddfd", "desc": "bl faceclaw_send_wear_event @ 0x4ac44e (outside onboarding)" }, { "offset": 1297700, "old": "65f0affd", - "new": "0cf3a1f9", + "new": "0cf367f8", "desc": "bl compass_decode_capture (sample-matched GAF diagnostics)" }, { "offset": 1296176, "old": "fff759fc", - "new": "0cf315fd", + "new": "0cf3dbfb", "desc": "bl compass_report_event (stock UI + heading with diagnostics over BLE)" }, { "offset": 4476518, "old": "", - "new": "02fb01f000e000bfb0b54ff2ac44c2f229040146206846f23f52c5f28802b2eb500f40f258304cf2e9124cf67e25c2f20000c0f24802caf2101518bf25609047002804bf691c2160b0bd00bf0846ffe7014640f258304cf20732c2f20000c0f24802104770b500284ed001684ef66a62ccf2ff02914218bf70bd90f8081190f8095146f6756c8d42c0f2510c2ad205eb8501014491f80d2191f80e4191f80ae191f80b3191f80c1142ea0424012c4ff0010298bf14466e1c054680f80961b9b164294eea032028bf6421012888bf024644f62060824228bf02460cf5e2731046984706e0002180f80811bde870406047e047d5f8040138b142f64d42c0f244022146bde87040104770bd00bf2de9f04f9db04ff2a84ac2f2290adaf800b058466ff39600b0f1005f40f07d81dbf800004ef66a67ccf2ff07b84240f074819bf82802002800f05d81dbf82442002c00f0588140f6b400c2f20000d0f8008004a802f0d4ffb8f1000f00f02382032045f24075cff68070a4f1600108f160026ff0bf03c0f2020500bf0e6ed41826664e6ec03366668e6eab42a666ce6ee6660e6f26674e6f66678e6fa667ce6fe667d1f88060c4f88060d1f88460c4f88460d1f88860c4f88860d1f88c60c4f88c60d1f89060c4f89060d1f89460c4f89460d1f89860c4f89860d1f89c60c4f89c60d1f8a060c4f8a060d1f8a460c4f8a460d1f8a860c4f8a860d1f8ac60c4f8ac60d1f8b060c4f8b060d1f8b460c4f8b460d1f8b860c4f8b860d1f8bc60c4f8bc6051f8c06fc4f8c0604e68c4f8c4608e68c4f8c860ce68c4f8cc600e69c4f8d0604e69c4f8d4608e69c4f8d860ce69c4f8dc600e6ac4f8e0604e6ac4f8e4608e6ac4f8e860ce6ac4f8ec600e6bc4f8f0604e6bc4f8f4608e6bc4f8f860ce6bc4f8fc600e6cc4f800614e6cc4f804618e6cc4f80861ce6cc4f80c610e6dc4f810614e6dc4f814618e6dc4f81861ce6dc4f81c617ff462afdaf800603040b0f1005f40f0b2803068b84240f0ae8096f8ce00002840f07a8196f8dc10002000298df8140000f0f28105a90a5c002a00f0c5810a185378002b00f083819378002b00f08181d378002b00f07f811379002b00f07d815379002b00f07b819379002b00f07981d379002b00f07781137a002b00f07581537a002b00f07381937a002b00f07181d37a002b00f06f81137b002b00f06d81537b002b00f06b81937b002b00f06981d37b002b00f06781137c002b00f06581537c002b00f06381937c002b00f06181d37c002b00f05f81137d002b00f05d81537d002b00f05b81937d002b00f05981d37d002b00f05781137e002b00f05581537e002b00f05381937e002b00f05181d37e002b00f04f81137f002b00f04d81537f002b00f04b81937f002b00f04981d27f002a00f04781203060287ff47baf66e19bf82a0270b1dbf82c0240b146f68051c2f207010968401a002800f3f48000208bf82a0240f6d100c0f247001db0bde8f04f00474ff4497005f0dbf8002800f0c7804ff6dc41cff6ff71002200bf4318433183f8242383f8252383f8262383f8272383f8282383f8292383f82a2383f82b2383f82c2383f82d2383f82e2383f82f2383f8302383f8312383f8322383f8332383f8342383f8352383f8362383f8372383f8382383f8392383f83a2383f83b2383f83c2383f83d2383f83e2383f83f2383f8402383f8412383f8422383f8432383f8442383f8452383f8462383f8472383f8482383f8492383f84a2383f84b2383f84c2383f84d2383f84e2383f84f2383f8502383f8512383f8522383f8532383f8542383f8552383f8562383f8572383f8582383f8592383f85a2383f85b2383f85c2383f85d2383f85e2383f85f2383f8602383f8612383f8622383f8632383f8642383f8652383f866237ff476af012180f8ce104ff0ff310760a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe1010e000208bf82802cbf824028bf82a0201208bf8290240f6d100c0f24700804715e00020caf8000000208bf82802cbf824024ff416304cf60361069005a8c0f24701cdf81480884701208bf82a0204a802f0b4fecbf8d4001db0bde8f08f01303ae0023038e0033036e0043034e0053032e0063030e007302ee008302ce009302ae00a3028e00b3026e00c3024e00d3022e00e3020e00f301ee010301ce011301ae0123018e0133016e0143014e0153012e0163010e017300ee018300ce019300ae01a3008e01b3006e01c3004e01d3002e01e3000e01f305f2821d84ff052020a541dd0014445225e284a7018d04f225d288a7014d052225c28ca7010d044225b280a710cd045225a284a7108d0522259288a7104d020225828ca7142f0168500208df87300012096f8dd10002900f0c280002105aa535c002b00f0a08057187b78002b5ed0bb78002b5dd0fb78002b5cd03b79002b5bd07b79002b5ad0bb79002b59d0fb79002b58d03b7a002b57d07b7a002b56d0bb7a002b55d0fb7a002b54d03b7b002b53d07b7b002b52d0bb7b002b51d0fb7b002b50d03b7c002b4fd07b7c002b4ed0bb7c002b4dd0fb7c002b4cd03b7d002b4bd07b7d002b4ad0bb7d002b49d0fb7d002b48d03b7e002b47d07b7e002b46d0bb7e002b45d0fb7e002b44d03b7f002b43d07b7f002b42d0bb7f002b41d0fb7f002b40d0203160297ff49aaf54e001313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2915d84ff05303535411d00a444b235e2953700cd049235d29937008d050235c29d37004d020235b29137140f0c28200218df87310013096f8de10002900f0be80002105aa535c002b00f0a08057187b78002b5ed0bb78002b5dd0fb78002b5cd03b79002b5bd07b79002b5ad0bb79002b59d0fb79002b58d03b7a002b57d07b7a002b56d0bb7a002b55d0fb7a002b54d03b7b002b53d07b7b002b52d0bb7b002b51d0fb7b002b50d03b7c002b4fd07b7c002b4ed0bb7c002b4dd0fb7c002b4cd03b7d002b4bd07b7d002b4ad0bb7d002b49d0fb7d002b48d03b7e002b47d07b7e002b46d0bb7e002b45d0fb7e002b44d03b7f002b43d07b7f002b42d0bb7f002b41d0fb7f002b40d0203160297ff49aaf50e001313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2911d84ff0440353540dd00a4455235e29537008d050235d29937004d020235c29d37040f08e8000218df87310013096f8df10002900f0cd80002005a90a5c002a00f0a3800a185378002b5ed09378002b5dd0d378002b5cd01379002b5bd05379002b5ad09379002b59d0d379002b58d0137a002b57d0537a002b56d0937a002b55d0d37a002b54d0137b002b53d0537b002b52d0937b002b51d0d37b002b53d0137c002b52d0537c002b51d0937c002b50d0d37c002b4fd0137d002b4ed0537d002b4dd0937d002b4cd0d37d002b4bd0137e002b4ad0537e002b49d0937e002b48d0d37e002b47d0137f002b46d0537f002b45d0937f002b44d0d27f002a43d0203060287ff49aaf5fe001303de002303be0033039e0043037e0053035e0063033e0073031e008302fe009302de00a302be00b3029e00c3027e00d3025e00e3023e00021117171e70f301ee010301ce011301ae0123018e0133016e0143014e0153012e0163010e017300ee018300ce019300ae01a3008e01b3006e01c3004e01d3002e01e3000e01f305f281dd84ff053020a5419d001444e225e284a7014d041225d288a7010d050225c28ca700cd04f225b280a7108d046225a284a7104d0202259288a7142f0b28200208df873000120daf8041046f23f52c5f28802b2eb510f40f08b80c90700f08e80002005a90a5c002a00f083810a185378002b00f0f7809378002b00f0f780d378002b00f0f7801379002b00f0f7805379002b00f0f7809379002b00f0f780d379002b00f0f780137a002b00f0fa80537a002b00f0fa80937a002b00f0fa80d37a002b00f0fa80137b002b00f0fa80537b002b00f0fa80937b002b00f0fa80d37b002b00f0fa80137c002b00f0fa80537c002b00f0fa80937c002b00f0fa80d37c002b00f0fa80137d002b00f0fa80537d002b00f0fa80937d002b00f0fa80d37d002b00f0fa80137e002b00f0fa80537e002b00f0fa80937e002b00f0fa80d37e002b00f0fa80137f002b00f00b81537f002b00f00981937f002b00f00781d27f002a00f00581203060287ff47baf1be14cf67e21caf21011caf80410002840f01681002005a90a5c002a00f0d9800a185378002b5ed09378002b5dd0d378002b5cd01379002b5bd05379002b5cd09379002b5dd0d379002b5ed0137a002b5fd0537a002b60d0937a002b61d0d37a002b65d0137b002b66d0537b002b67d0937b002b68d0d37b002b69d0137c002b6ad0537c002b6bd0937c002b6cd0d37c002b6dd0137d002b6ed0537d002b6fd0937d002b70d0d37d002b71d0137e002b72d0537e002b73d0937e002b74d0d37e002b75d0137f002b76d0537f002b77d0937f002b78d0d27f002a79d0203060287ff49aafa9e0013073e0023071e003306fe004306de0013084e0053069e0023080e0063065e003307ce0073061e0043078e008305de0053074e0093059e0063070e00a3055e007306ce0002151713de50b304ee0083065e00c304ae0093061e00d3046e00a305de00e3042e00b3059e00f303ee00c3055e010303ae00d3051e0113036e00e304de0123032e00f3049e013302ee0103045e014302ae0113041e0153026e012303de0163022e0133039e017301ee0143035e018301ae0153031e0193016e016302de01a3012e0173029e01b300ee0183025e01c300ae0193021e01d3006e01a301de01e3002e01b3019e01f305f2831d84ff04f020a542dd001444b225e284a7028d020225d288a7024d00020c87024e01c3004e01d3002e01e3000e01f305f2818d84ff041020a5414d001444c225e284a700fd05d288a700cd04f225c28ca7008d043225b280a7104d020225a284a7142f0018100208df8730005a80021cdf80880804618f80100002800f0a18008eb0102507800285ed0907800285dd0d07800285cd0107900285bd0507900285ad09079002859d0d079002858d0107a002857d0507a002856d0907a002855d0d07a002854d0107b002853d0507b002852d0907b002851d0d07b002850d0107c00284fd0507c00284ed0907c00284dd0d07c00284cd0107d00284bd0507d00284ad0907d002849d0d07d002848d0107e002847d0507e002846d0907e002845d0d07e002844d0107f002843d0507f002842d0907f002841d0d07f002840d0203160297ff498af43e001313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2904d84ff0770008f8010003d100208df8730003e008eb010000214170d6f8d0704ff0000918f80900002800f0c48008eb09014878002862d08878002862d0c878002862d00879002862d04879002862d08879002862d0c879002862d0087a002862d0487a002862d0887a002862d0c87a002862d0087b002862d0487b002862d0887b002862d0c87b002862d0087c002862d0487c002862d0887c002862d0c87c002862d0087d002862d0487d002862d0887d002862d0c87d002862d0087e002862d0487e002862d0887e002862d0c87e002862d0087f002862d0487f002862d0887f002862d0c87f002862d009f12009b9f1600f7ff496af4ff060095be009f1010958e009f1020955e009f1030952e009f104094fe009f105094ce009f1060949e009f1070946e009f1080943e009f1090940e009f10a093de009f10b093ae009f10c0937e009f10d0934e009f10e0931e009f10f092ee009f110092be009f1110928e009f1120925e009f1130922e009f114091fe009f115091ce009f1160919e009f1170916e009f1180913e009f1190910e009f11a090de009f11b090ae009f11c0907e009f11d0904e009f11e0901e009f11f090a2f4ff0010103961ed364204ff47a7542f2107401eb81035b00b7fbf3f60a2e11d301fb00f3b7fbf3f60a2e0bd301fb05f3b7fbf3f60a2e05d36143b7fbf1f3092be7d800e01946cc46b9f15f0f98bf4ff05f0cccf1000e1eeb090052d0b7fbf1f34cf6cd4203f13004ccf6cc4208f809400a29a1fb025446d3451c42d003fb1173e608b3fbf6f448f21f5204f1300508eb0907c5f2eb127d706429a1fb025835d3851c36d004fb16334fea5814b3fbf4f644f6d35206f13005c1f26202bd70b1f57a7fa1fb022526d303300df1140818d006fb1430aa0941f25974b0fbf2f3cdf2b714a1fb044503f13004fc7003fb120742f2107009f1040981424fea5531aad20de0e1460be009f1010908e009f1020903e0e14601e009f103090df11408039b002108f8091018f80100002800f0a18008eb0102507800285ed0907800285dd0d07800285cd0107900285bd0507900285ad09079002859d0d079002858d0107a002857d0507a002856d0907a002855d0d07a002854d0107b002853d0507b002852d0907b002851d0d07b002850d0107c00284fd0507c00284ed0907c00284dd0d07c00284cd0107d00284bd0507d00284ad0907d002849d0d07d002848d0107e002847d0507e002846d0907e002845d0d07e002844d0107f002843d0507f002842d0907f002841d0d07f002840d0203160297ff498af52e001313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2913d84ff0750008f801000ed008eb010073225e29427008d020225d29827004d070225c29c27040f09e8000208df87300d3f8d4104ff0000918f80900002800f0c78008eb09035878002862d09878002862d0d878002862d01879002862d05879002862d09879002862d0d879002862d0187a002862d0587a002862d0987a002862d0d87a002862d0187b002862d0587b002862d0987b002862d0d87b002865d0187c002865d0587c002865d0987c002865d0d87c002865d0187d002865d0587d002865d0987d002865d0d87d002865d0187e002865d0587e002865d0987e002865d0d87e002865d0187f002865d0587f002865d0987f002865d0d87f002865d009f12009b9f1600f7ff496af4ff060095ee009f101095be009f1020958e009f1030955e009f1040952e009f105094fe009f106094ce009f1070949e009f1080946e009f1090943e009f10a0940e009f10b093de009f10c093ae009f10d0937e009f10e0934e00021017161e709f10f092ee009f110092be009f1110928e009f1120925e009f1130922e009f114091fe009f115091ce009f1160919e009f1170916e009f1180913e009f1190910e009f11a090de009f11b090ae009f11c0907e009f11d0904e009f11e0901e009f11f0901230a291ed364204ff47a7742f2107503eb83067600b1fbf6f40a2c11d303fb00f6b1fbf6f40a2c0bd303fb07f6b1fbf6f40a2c05d36b43b1fbf3f6092ee7d800e03346ce46b9f15f0f98bf4ff05f0ecef1000842f2107c18eb09004ed0b1fbf3f405aa04f1300502f809504cf6cd42ccf6cc420a2ba3fb025641d3451c3dd004fb1317f608b7fbf6f405a948f21f5204f130054944c5f2eb124d70642ba3fb022530d3821c29d004fb16776c09b7fbf4f6b3f57a7f06f130028a7044f6d352c1f26202a3fb022520d3033016d006fb1470aa0941f25975b0fbf2f4cdf2b715a3fb055604f13005cd7004fb120109f1040963454fea5633aed209e0f14607e009f1010904e009f1020901e009f1030900210df1140808f80910ddf8089018f80100002800f0a18008eb0102507800285ed0907800285dd0d07800285cd0107900285bd0507900285ad09079002859d0d079002858d0107a002857d0507a002856d0907a002855d0d07a002854d0107b002853d0507b002852d0907b002851d0d07b002850d0107c00284fd0507c00284ed0907c00284dd0d07c00284cd0107d00284bd0507d00284ad0907d002849d0d07d002848d0107e002847d0507e002846d0907e002845d0d07e002844d0107f002843d0507f002842d0907f002841d0d07f002840d0203160297ff498af4ae001313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f290bd84ff0750008f8010006d008eb010073225e29427040f00f8100208df8730040f2403cc2f2000cdcf81c1045f2a800c2f2130042f2a0038142c2f2200328d1dcf82810b1f54d2f23d1dcf82c1081421fd145f61c540022c2f213044cf639471d1d4ff0ff3eac4213d8216831f0030000f0a683a34228bf0c290cd31e1bb04209d8c90718bf02442044013f00f10404e9d14ff0ff3e46f68050c2f20700d0f8880003f1080142f6a0038842c2f2270321d142f61c550022c2f2200546f6b974181d854217d8296831f0030700f0d980ab424ff0ff36039628bf0c290ed35e1bb7420bd8c90705eb070118bf3a44013c01f10405e5d14ff0ff300390dcf8001003f1080081422bd1dcf80c10b1f5333f26d1dcf81010814222d143f21c530021c2f2270342f6f932aaf10404aaf108004ff0ff3ca34213d81e6836f0030500f04683984228bf0c2e0cd3c71abd4209d8f7072b4418bf2944013a03f10403e9d14ff0ff3c002118f80100002800f0aa8008eb01046078002861d0a078002860d0e07800285fd0207900285ed0607900285dd0a07900285cd0e07900285bd0207a00285ad0607a002859d0a07a002858d0e07a002857d0207b002856d0607b002855d0a07b002854d0e07b002853d0207c002852d0607c002851d0a07c002856d0e07c002855d0207d002854d0607d002853d0a07d002852d0e07d002851d0207e002850d0607e00284fd0a07e00284ed0e07e00284dd0207f00284cd0607f00284bd0a07f00284ad0e07f002849d0203160297ff498af77e000218170f0e6013140e002313ee003313ce004313ae0053138e0063136e0073134e0083132e0093130e00a312ee00b312ce00c312ae00d3128e00e3126e00f3124e0103122e0113120e0854218bf4ff0ff32039236e7123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f292fd84ff0200008f801002ad008eb010366205e29587024d031205d29987020d033205c29d8701cd02f205b29187118d032205a29587114d030205929987110d02f205829d8710cd032205729187208d037205629587204d03d205529987241f0928200208df873001ef10100cdf804c000f090804fea9e214ff0000a18f80a00002800f0898108eb0a046078002800f00b81a078002800f00a81e078002800f009812079002800f008816079002800f00781a079002800f00681e079002800f00581207a002800f00481607a002800f00381a07a002800f00281e07a002800f00181207b002800f00081607b002800f0ff80a07b002800f0fe80e07b002800f0fd80207c002800f0fc80607c002800f0fb80a07c002800f0fc80e07c002800f0fd80207d002800f0fe80607d002800f0ff80a07d002800f00081e07d002800f00181207e002800f00281607e002800f00381a07e002800f00481e07e002800f00581207f002800f00681607f002800f00781a07f002800f00881e07f002800f009810af1200abaf1600f7ff477af4ff0600a01e1039b002118f80100002800f0ba8108eb01025078002800f0b0809078002800f0b180d078002800f0b2801079002800f0b3805079002800f0b4809079002800f0b580d079002800f0b680107a002800f0b780507a002800f0b880907a002800f0b980d07a002800f0ba80107b002800f0bb80507b002800f0bc80907b002800f0bd80d07b002800f04e81107c002800f04c81507c002800f04a81907c002800f04881d07c002800f04681107d002800f04481507d002800f04281907d002800f04081d07d002800f03e81107e002800f03c81507e002800f03a81907e002800f03881d07e002800f03681107f002800f03481507f002800f03281907f002800f03081d07f002800f03b81203160297ff479af3de10af1010a74e00af1020a71e00af1030a6ee00af1040a6be00af1050a68e00af1060a65e00af1070a62e00af1080a5fe00af1090a5ce00af10a0a59e00af10b0a56e00af10c0a53e00af10d0a50e00af10e0a4de00af10f0a4ae00af1100a47e00af1110a44e0013101e10af1120a3fe00231fce00af1130a3ae00331f7e00af1140a35e00431f2e00af1150a30e00531ede00af1160a2be00631e8e00af1170a26e00731e3e00af1180a21e00831dee00af1190a1ce00931d9e00af11a0a17e00a31d4e00af11b0a12e00b31cfe00af11c0a0de00c31cae00af11d0a08e00d31c5e00af11e0a03e00e31c0e00af11f0a0122bef5205f1ed364204ff47a7342f2107502eb82077f00b1fbf7f40a2c11d302fb00f7b1fbf7f40a2c0bd302fb03f7b1fbf7f40a2c05d36a43b1fbf2f7092fe7d800e03a46d146baf15f0f98bf4ff05f09c9f1000842f2107e18eb0a004ed0b1fbf2f305af03f1300407f80a404cf6cd47ccf6cc470a2aa2fb075441d3451c3dd003fb1217e308b7fbf3f405a948f21f5604f130055144c5f2eb164d70642aa2fb06c530d3861c29d004fb13736c09b3fbf4f7b2f57a7f07f130068e7044f6d356c1f26206a2fb066520d3033016d007fb1430ab0941f25976b0fbf3f7cdf2b716a2fb066507f13006ce7007fb13010af1040a72454fea5532aed209e0ca4607e00af1010a04e00af1020a01e00af1030a00200df11408dde9029308f80a003ce00f312be0103129e0113127e0123125e0133123e0143121e015311fe016311de017311be0183119e0193117e01a3115e01b3113e01c3111e01d310fe01e310de0ac4218bf4ff0ff329646fff764bca34218bf4ff0ff318c46c4e41f315f2904d84ff03f0008f8010003d100208df8730003e008eb010000214170002118f80100002800f0a18008eb0102507800285ed0907800285dd0d07800285cd0107900285bd0507900285ad09079002859d0d079002858d0107a002857d0507a002856d0907a002855d0d07a002854d0107b002853d0507b002852d0907b002851d0d07b002850d0107c00284fd0507c00284ed0907c00284dd0d07c00284cd0107d00284bd0507d00284ad0907d002849d0d07d002848d0107e002847d0507e002846d0907e002845d0d07e002844d0107f002843d0507f002842d0907f002841d0d07f002840d0203160297ff498af43e001313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2904d84ff02f0008f8010003d100208df8730003e008eb010000214170ddf804a0581c00f08f80990a4ff0000c18f80c00002800f0888108eb0c046078002800f00a81a078002800f00981e078002800f008812079002800f007816079002800f00681a079002800f00581e079002800f00481207a002800f00381607a002800f00281a07a002800f00181e07a002800f00081207b002800f0ff80607b002800f0fe80a07b002800f0fd80e07b002800f0fc80207c002800f0fb80607c002800f0fa80a07c002800f0fb80e07c002800f0fc80207d002800f0fd80607d002800f0fe80a07d002800f0ff80e07d002800f00081207e002800f00181607e002800f00281a07e002800f00381e07e002800f00481207f002800f00581607f002800f00681a07f002800f00781e07f002800f008810cf1200cbcf1600f7ff477af4ff0600c00e1002118f80100002800f0ad8108eb01025078002800f0b0809078002800f0b180d078002800f0b2801079002800f0b3805079002800f0b4809079002800f0b580d079002800f0b680107a002800f0b780507a002800f0b880907a002800f0b980d07a002800f0ba80107b002800f0bb80507b002800f0bc80907b002800f0bd80d07b002800f04e81107c002800f04c81507c002800f04a81907c002800f04881d07c002800f04681107d002800f04481507d002800f04281907d002800f04081d07d002800f03e81107e002800f03c81507e002800f03a81907e002800f03881d07e002800f03681107f002800f03481507f002800f03281907f002800f03081d07f002800f02e81203160297ff479af30e10cf1010c74e00cf1020c71e00cf1030c6ee00cf1040c6be00cf1050c68e00cf1060c65e00cf1070c62e00cf1080c5fe00cf1090c5ce00cf10a0c59e00cf10b0c56e00cf10c0c53e00cf10d0c50e00cf10e0c4de00cf10f0c4ae00cf1100c47e00cf1110c44e00131f4e00cf1120c3fe00231efe00cf1130c3ae00331eae00cf1140c35e00431e5e00cf1150c30e00531e0e00cf1160c2be00631dbe00cf1170c26e00731d6e00cf1180c21e00831d1e00cf1190c1ce00931cce00cf11a0c17e00a31c7e00cf11b0c12e00b31c2e00cf11c0c0de00c31bde00cf11d0c08e00d31b8e00cf11e0c03e00e31b3e00cf11f0c0124b3f5205f1ed364204ff47a7342f2107704eb84067600b1fbf6f50a2d11d304fb00f6b1fbf6f50a2d0bd304fb03f6b1fbf6f50a2d05d37c43b1fbf4f6092ee7d800e03446e146bcf15f0f98bf4ff05f09c9f1000842f2107e18eb0c004ed0b1fbf4f305aa03f1300702f80c704cf6cd42ccf6cc420a2ca4fb027541d3471c3dd003fb1417eb08b7fbf3f505a948f21f5205f130066144c5f2eb124e70642ca4fb022630d3821c29d005fb13737509b3fbf5f7b4f57a7f07f130028a7044f6d352c1f26202a4fb022620d3033016d007fb1530b20941f25975b0fbf2f3cdf2b715a4fb055603f13005cd7003fb12010cf1040c74454fea5634aed209e0cc4607e00cf1010c04e00cf1020c01e00cf1030c00200df11408ddf8089008f80c002fe00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2904d84ff03f0008f8010003d100208df8730003e008eb010000214170002118f80100002800f0a18008eb0102507800285ed0907800285dd0d07800285cd0107900285bd0507900285ad09079002859d0d079002858d0107a002857d0507a002856d0907a002855d0d07a002854d0107b002853d0507b002852d0907b002851d0d07b002850d0107c00284fd0507c00284ed0907c00284dd0d07c00284cd0107d00284bd0507d00284ad0907d002849d0d07d002848d0107e002847d0507e002846d0907e002845d0d07e002844d0107f002843d0507f002842d0907f002841d0d07f002840d0203160297ff498af43e001313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2904d84ff02f0008f8010003d100208df8730003e008eb0100002141701af1010000f090804fea9a214ff0000918f80900002800f0888108eb09046078002800f00a81a078002800f00981e078002800f008812079002800f007816079002800f00681a079002800f00581e079002800f00481207a002800f00381607a002800f00281a07a002800f00181e07a002800f00081207b002800f0ff80607b002800f0fe80a07b002800f0fd80e07b002800f0fc80207c002800f0fb80607c002800f0fa80a07c002800f0fb80e07c002800f0fc80207d002800f0fd80607d002800f0fe80a07d002800f0ff80e07d002800f00081207e002800f00181607e002800f00281a07e002800f00381e07e002800f00481207f002800f00581607f002800f00681a07f002800f00781e07f002800f0088109f12009b9f1600f7ff477af4ff0600900e1002118f80100002800f0ad8108eb01025078002800f0b0809078002800f0b180d078002800f0b2801079002800f0b3805079002800f0b4809079002800f0b580d079002800f0b680107a002800f0b780507a002800f0b880907a002800f0b980d07a002800f0ba80107b002800f0bb80507b002800f0bc80907b002800f0bd80d07b002800f04e81107c002800f04c81507c002800f04a81907c002800f04881d07c002800f04681107d002800f04481507d002800f04281907d002800f04081d07d002800f03e81107e002800f03c81507e002800f03a81907e002800f03881d07e002800f03681107f002800f03481507f002800f03281907f002800f03081d07f002800f02e81203160297ff479af30e109f1010974e009f1020971e009f103096ee009f104096be009f1050968e009f1060965e009f1070962e009f108095fe009f109095ce009f10a0959e009f10b0956e009f10c0953e009f10d0950e009f10e094de009f10f094ae009f1100947e009f1110944e00131f4e009f112093fe00231efe009f113093ae00331eae009f1140935e00431e5e009f1150930e00531e0e009f116092be00631dbe009f1170926e00731d6e009f1180921e00831d1e009f119091ce00931cce009f11a0917e00a31c7e009f11b0912e00b31c2e009f11c090de00c31bde009f11d0908e00d31b8e009f11e0903e00e31b3e009f11f090123baf5205f1ed364204ff47a7742f2107603eb83056d00b1fbf5f40a2c11d303fb00f5b1fbf5f40a2c0bd303fb07f5b1fbf5f40a2c05d37343b1fbf3f5092de7d800e02b46ce46b9f15f0f98bf4ff05f0ecef1000842f2107c18eb09004ed0b1fbf3f405aa04f1300502f809504cf6cd42ccf6cc420a2ba3fb025741d3451c3dd004fb1316ff08b6fbf7f405a948f21f5204f130054944c5f2eb124d70642ba3fb022530d3821c29d004fb17676c09b7fbf4f6b3f57a7f06f130028a7044f6d352c1f26202a3fb022520d3033016d006fb1470aa0941f25975b0fbf2f4cdf2b715a3fb055604f13005cd7004fb120109f1040963454fea5633aed209e0f14607e009f1010904e009f1020901e009f1030900200df1140808f80900ddf808902fe00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2904d84ff03f0008f8010003d100208df8730003e008eb010000214170002118f80100002800f0a18008eb0102507800285ed0907800285dd0d07800285cd0107900285bd0507900285ad09079002859d0d079002858d0107a002857d0507a002856d0907a002855d0d07a002854d0107b002853d0507b002852d0907b002851d0d07b002850d0107c00284fd0507c00284ed0907c00284dd0d07c00284cd0107d00284bd0507d00284ad0907d002849d0d07d002848d0107e002847d0507e002846d0907e002845d0d07e002844d0107f002843d0507f002842d0907f002841d0d07f002840d0203160297ff498af43e001313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2904d84ff06b0008f8010003d100208df8730003e008eb0100002141709df814a0baf1000f10d0022208eb020010f8013c63b118f8023063b143784bb1807804320028f1d1023a04e0002005e0013a00e0013202eb4200400040eae070821c09f5207c00f1010e02f0030822f0030709f5a0724ff0ff3504e001350d2d02f5a07268d005eb8500bef1030f0ceb801405d24ff0ff30b8f1000f2dd1ede70020164603e0874206f1020621d0431cdb09042b03d8337803f0f0033370831cdb09042b03d8737803f00f037370c31cdb09042b03d8737803f0f00373700430c309042bdfd84308e15c01f00f01e154d9e70138b8f1000fc0d0861cf109042908d87108635cc6076ff00f0608bf0f2633406354b8f1010fb0d0c61cf109042909d87108635cc6074ff00f0608bf6ff00f0633406354b8f1020f9fd0061df10904299bd87108c007635c6ff00f0008bf0f201840605491e7baf1000f00f0ab800298022200f281280df1140e40f27d2940f27a2c08e01ef801af0632baf1000f08f1030800f09780aaf17f0010f15f0ff1d347f22021c0f200010aeb4a00794401eb8000a0f5c0710027d409404605e000bf02370c2f00f52070dcd0cb57042c06d8b3f1ff3f03dc067846f0f0060670042cdeb206d816f0400303d0037843f00f030370b30605d54a4503d8437843f0f0034370f30606d5b2f51f7f03d8437843f00f03437033074fea920305d59e2b03d8857845f0f0058570750705d5624503d8857845f00f058570cd1995f90160042c08d8b6f1ff3f05dc90f8405145f0f00580f84051042cf6b208d816f0400505d090f8405145f00f0580f84051b50607d54a4505d890f8415145f0f00580f84151f50608d5b2f51f7f05d890f8415145f00f0580f84151350707d59e2b05d890f8423143f0f00380f8423173077ff588af62453ff685af90f8423143f00f0380f842317de7ddf80880fdf776ba0020c871fdf74dbd00208871fdf7febe00200872fdf7e9ba0020d872fef76dbdf0b581b041f204054cf65561cef20005ccf2ac51c5f8ac1f4ef6fc51cef200010a684ff2a84642f080720a6055f8041cc2f2290641f0010145f8041c316807460a466ff39602b2f1005f07d108684ef66a62ccf2ff02904200f0c3804ff4497002f042fa002800f0f48001464ff6dc40cff6ff70002200bf0b18433083f8242383f8252383f8262383f8272383f8282383f8292383f82a2383f82b2383f82c2383f82d2383f82e2383f82f2383f8302383f8312383f8322383f8332383f8342383f8352383f8362383f8372383f8382383f8392383f83a2383f83b2383f83c2383f83d2383f83e2383f83f2383f8402383f8412383f8422383f8432383f8442383f8452383f8462383f8472383f8482383f8492383f84a2383f84b2383f84c2383f84d2383f84e2383f84f2383f8502383f8512383f8522383f8532383f8542383f8552383f8562383f8572383f8582383f8592383f85a2383f85b2383f85c2383f85d2383f85e2383f85f2383f8602383f8612383f8622383f8632383f8642383f8652383f866237ff476af4ef66a60ccf2ff000860012081f8ce004ff0ff30a1f8e000a1f8e200a1f8e400a1f8e600a1f8e800a1f8ea00a1f8ec00a1f8ee00a1f8f000a1f8f200a1f8f400a1f8f600a1f8f800a1f8fa00a1f8fc00a1f8fe003160d1f8d800b0bb46f6805245f6e464c2f20702cff6f8741368204616689e420ed116689e420bd116689e4208d116689e4203d1002800f10400efd19e421ad02b6816681068b0420ed11068b0420bd11068b04208d11068b04203d1002c04f10404efd1b04206d02868c01ac1f8d80001e0002030602868386001b0f0bd00bf2de9f04141f204084ff2a847cef20008c2f229070146d8f8004038680d6801466ff39601b1f1005f07d101684ef66a62ccf2ff02914200f0c2804ff4497002f023f9002800f0cb804ff6dc41cff6ff71002200bf4318433183f8242383f8252383f8262383f8272383f8282383f8292383f82a2383f82b2383f82c2383f82d2383f82e2383f82f2383f8302383f8312383f8322383f8332383f8342383f8352383f8362383f8372383f8382383f8392383f83a2383f83b2383f83c2383f83d2383f83e2383f83f2383f8402383f8412383f8422383f8432383f8442383f8452383f8462383f8472383f8482383f8492383f84a2383f84b2383f84c2383f84d2383f84e2383f84f2383f8502383f8512383f8522383f8532383f8542383f8552383f8562383f8572383f8582383f8592383f85a2383f85b2383f85c2383f85d2383f85e2383f85f2383f8602383f8612383f8622383f8632383f8642383f8652383f866237ff476af4ef66a61ccf2ff010160012180f8ce104ff0ff31a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe103860d0f8d81081b144f6d350c1f26200a1fb0001880901284ff0010088bf88094ce000203860fa2048e046f6805245f6e466c2f20702cff6f8761368314600bf17689f420ed117689f420bd117689f4208d117689f4203d1002901f10401efd19f422ad0d8f80030176800bf1168b9420ed11168b9420bd11168b94208d11168b94203d1002e06f10406efd1b94214d0d8f8001044f6d357ca1ac1f26207a2fb0776c0f8d820b00901284ff0010088bfb009994208bffa2000e0fa20611bb1fbf0f0bde8f08100bf2de9f04f85b0044618b1a069002840f0d8804ff2a845c2f22905286801466ff39601b1f1005f07d101684ef66a62ccf2ff02914200f0c1804ff4497001f0e2ff002800f0b9804ff6dc41cff6ff7100224318433183f8242383f8252383f8262383f8272383f8282383f8292383f82a2383f82b2383f82c2383f82d2383f82e2383f82f2383f8302383f8312383f8322383f8332383f8342383f8352383f8362383f8372383f8382383f8392383f83a2383f83b2383f83c2383f83d2383f83e2383f83f2383f8402383f8412383f8422383f8432383f8442383f8452383f8462383f8472383f8482383f8492383f84a2383f84b2383f84c2383f84d2383f84e2383f84f2383f8502383f8512383f8522383f8532383f8542383f8552383f8562383f8572383f8582383f8592383f85a2383f85b2383f85c2383f85d2383f85e2383f85f2383f8602383f8612383f8622383f8632383f8642383f8652383f866237ff476af4ef66a61ccf2ff010160012180f8ce104ff0ff31a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe102860002c18bf002807d14cf6dd70c0f2450005b0bde8f04f0047d4f80cc0bcf1000ff2d0d4f820a0baf1000fedd0d4f844e000f104094ff0ff38002700264ff0ff3105e06037c02f06f1060600f0eb81c3195a68002a50d01a69013205d01a6942453cbfd3f8108031465a69002a06f1010241d01d6a013505d01d6a45453cbfd3f8208011465a6a002a06f1020233d01d6b013505d01d6b45453cbfd3f8308011465a6b002a06f1030225d01d6c013505d01d6c45453cbfd3f8408011465a6c002a06f1040217d01d6d013505d01d6d45453cbfd3f8508011465a6d002a06f1050209d01d6e0135acd01d6e45453cbfd3f860801146a5e71646002e019600f1a281f24500f29f810aeb0c0102910eeb0c0100220491cdf80c9000bf130159f80330a34224d109eb02135f68674507d30499b94204d304999e68cd1bae4208d9df68013714d00021196059609960d9600ee00299b9420bd9df68013708d00021196059609960d960012180f8df1000bf01320c2ad2d1049e04e000bfbef1000f00f0ba80b6eb0c02c0f0b880924500f2b5803546a6eb0a0b00224ff0000e02e06032c02aead000eb0208d8f80430a34217d1d8f80830a3b1d8f80c90002709eb03018b454ff0000138bf01219d4288bf01279e4238bf33460f421cbf4ff0010e1e46d8f81410a14216d1d8f818309bb1d8f81c10002719448b454ff0000138bf01219d4288bf01279e4238bf33460f421cbf4ff0010e1e46d8f82410a14216d1d8f828309bb1d8f82c10002719448b454ff0000138bf01219d4288bf01279e4238bf33460f421cbf4ff0010e1e46d8f83410a14216d1d8f838309bb1d8f83c10002719448b454ff0000138bf01219d4288bf01279e4238bf33460f421cbf4ff0010e1e46d8f84410a14216d1d8f848309bb1d8f84c10002719448b454ff0000138bf01219d4288bf01279e4238bf33460f421cbf4ff0010e1e46d8f85410a1427ff46eafd8f85830002b3ff469afd8f85c10002719448b454ff0000138bf01219d4288bf01279e4238bf33460f421cbf4ff0010e1e4653e7554562d1ddf80c904ff0ff36002200274ff0ff3505e000bf6032c02a07f1060744d083185968a14207d11969013104d01969a9423cbf1d693e465969a14207d1196a013104d0196aa9423cbf1d6a7e1c596aa14207d1196b013104d0196ba9423cbf1d6bbe1c596ba14207d1196c013104d0196ca9423cbf1d6cfe1c596ca14207d1196d013104d0196da9423cbf1d6d3e1d596da142bfd1196e0131bcd0196ea9423cbf1d6e7e1db6e700bf002e4ed409eb06113301002249f803204a608a60ca60012180f8df10ace6dc4543d21af00303524615d0aaf101021cf80210012b0bf802100dd0aaf102021cf80210022b0bf8021005d0aaf103021cf802100bf80210baf1040f5dd3abf10203acf10406b118cf789d186f708f789f54497805f8011cb15c043a05f8021cf1d14ae000290dd409eb01120b01002549f8035055609560d56001220e4680f8df2059e6012180f8df10dde535d90af0030e5fea9a024ff0000317d0a3eb82080bf101060cf101026ff003055119cf787319df700f7904351f714f795f71897908eb050704379971f0d12b1dbef1000f13d01cf80310bef1010f0bf803100cd0591c1cf80120bef1020f0bf8012004d0991c1cf801200bf80120039b019a03eb021112019c50d0f8c420c1f804b0531cc1f808a024bf01230022c0f8c430ca6092e520463146fff7aebc2de9f047044648b1a06938b14ef2bb33c0f24e032046bde8f04718474ff2a848c2f22908d8f8005028466ff39600b0f1005f07d128684ef66a63ccf2ff03984200f0c6804ff449700f46164601f088fc0546002800f052814ff6dc40cff6ff70002100bf2a18433082f8241382f8251382f8261382f8271382f8281382f8291382f82a1382f82b1382f82c1382f82d1382f82e1382f82f1382f8301382f8311382f8321382f8331382f8341382f8351382f8361382f8371382f8381382f8391382f83a1382f83b1382f83c1382f83d1382f83e1382f83f1382f8401382f8411382f8421382f8431382f8441382f8451382f8461382f8471382f8481382f8491382f84a1382f84b1382f84c1382f84d1382f84e1382f84f1382f8501382f8511382f8521382f8531382f8541382f8551382f8561382f8571382f8581382f8591382f85a1382f85b1382f85c1382f85d1382f85e1382f85f1382f8601382f8611382f8621382f8631382f8641382f8651382f866137ff476af4ef66a60ccf2ff002860012085f8ce004ff0ff30a5f8e000a5f8e200a5f8e400a5f8e600a5f8e800a5f8ea00a5f8ec00a5f8ee00a5f8f000a5f8f200a5f8f400a5f8f600a5f8f800a5f8fa00a5f8fc00a5f8fe00c8f8005005f1040a4ff000094ff0ff38002015e0002948bfbde8f0870aeb01170e017968ba682046c7f80c8000f088f84af80690c7f80490c7f80890c7f80c90daf80010a14205d04ff0ff314ff0ff3205e000bf29690131f6d02a6900216b69a34204d12b6a93423cbf2a6a01216b6aa34204d12b6b93423cbf2a6b02216b6ba34204d12b6c93423cbf2a6c03216b6ca34204d12b6d93423cbf2a6d04216b6da34204d12b6e93423cbf2a6e05216b6ea34204d12b6f93423cbf2a6f06216b6fa34206d1d5f8803093423cbfd5f880200721d5f88430a34206d1d5f8903093423cbfd5f890200821d5f89430a34206d1d5f8a03093423cbfd5f8a0200921d5f8a430a34206d1d5f8b03093423cbfd5f8b0200a21d5f8b430a3427ff47bafd5f8c0309342bff476afd5f8c0000b2175e7204639463246c8f80050bde8f047ffe72de9f047a4b0804643f677504ff2a847c0f24f0091468a46c2f2290780473c68002021466ff39601b1f1005f02908df80c0007d120684ef66a61ccf2ff01884200f0c3804ff4497001f004fb0446002800f0ba804ff6dc40cff6ff70002100bf2218433082f8241382f8251382f8261382f8271382f8281382f8291382f82a1382f82b1382f82c1382f82d1382f82e1382f82f1382f8301382f8311382f8321382f8331382f8341382f8351382f8361382f8371382f8381382f8391382f83a1382f83b1382f83c1382f83d1382f83e1382f83f1382f8401382f8411382f8421382f8431382f8441382f8451382f8461382f8471382f8481382f8491382f84a1382f84b1382f84c1382f84d1382f84e1382f84f1382f8501382f8511382f8521382f8531382f8541382f8551382f8561382f8571382f8581382f8591382f85a1382f85b1382f85c1382f85d1382f85e1382f85f1382f8601382f8611382f8621382f8631382f8641382f8651382f866137ff476af4ef66a60ccf2ff002060012084f8ce004ff0ff30a4f8e000a4f8e200a4f8e400a4f8e600a4f8e800a4f8ea00a4f8ec00a4f8ee00a4f8f000a4f8f200a4f8f400a4f8f600a4f8f800a4f8fa00a4f8fc00a4f8fe003c60baf1000f4ff0010618bfb9f1000f23d101af3846fef7c5ff02ad404651464a460123009502f00df905463846fff7e9f8002e064608d19df80c0028b949f28340c0f247004c308047002c18bfc4f8d060284624b0bde8f0879af8001001f07f00a0f1100212f1040f09d80b2807d001f07e01082903d0032801d00628c8d13cb149f28340c0f24700804794f8280210b14ff0ff35dce70026bae7b0b54cf28544c0f251041d46a0474ff2a841c2f2290109680a466ff39602b2f1005f08d10a684ef66a63ccf2ff039a4218bf002100e00021421c18bf002900d1b0bd95f84d20002afad091f80722002a08bfb0bd45f2e823c2f206031a68132aeed8c2ebc20403eb04135b6801ebc2014ff40042c1f88432a1f88a222a7a01f52171002a0fbf802248f20112ca808122ab7c33b1ab7d23b1022342f002028b71ca7195f820303bb195f8243023b1032342f004028b71ca7195f846304bb195f8443042f008020b7195f84530ca714b71b0bd47f27e32c2f207021378002b14bf9378ff230b711378002b14bf5278ff224a71b0bd2de9f04f89b045f6e532c0f24b020c46054690474ff2a841c2f229010e6831466ff39601b1f1005f08d131684ef66a62ccf2ff02914208bf092d02d009b0bde8f08fe1082c29f9d896f807120029f5d04cf6dd71c0f2450105468847014628460129ebd145f2e821c2f206010b68581e13284ff0000047d8c3ebc30701eb07111a1fa1f5de7191f85471bf0618d4d71c3ad091f8e470bf0616d4971c34d091f87470bf0613d4571c2ed00f79bf0610d4043aa1f5e071171da3f10403e3d123e05a1e01f5a87104e09a1ee03101e0da1e703106ebc203d1f8009093f98b22b2f1ff3f11dc03f521710b684b450cd191f804804b798979029301914fea192a4fea194b4fea19610ce0ff2102914ff00009002200214ff0ff084ff0000a4ff0000b01910f278df80d70102708238df80e705227b4f5804f4ff080068df80c308df810708df8123038bf4ff48046b4f5001f6ff07f0c04f07f0338bf4ff0000c802c28bf80338df813309df815e09df816308df80f0004d29df814700226002416e0c4f3c610b4f5804f06eb000703d20326012400200be0b4f5001f03d204260224012003e00526032401200023e6468df8163004f108038df814708df815e08df81160f8b903a8a226c718c654062078700c20b8704320f8704d20387101207871029804f11703f871019887f80680387200207a72b87287f80b9087f80ca087f80db0b9734df60f1703aac0f2470701200821b847284609b0bde8f08f70b505464ef6a970c0f2470016460c46804770b147f2a620c2f207000188c8b2642809d8b1f5807f4ff0070138bf032104e0ff20002101e0ff200121321b28bf082a01d2204670bdd2232a192b5506235370052393705223d370422313710123083453719171d071204670bd024600284ff0ff3009d0022918bf70471078112801d1507810b14ff0ff30704710b584b04cf6dd70c0f24500804701284ff0000037d103900446029040f20830c0f2100001904ef6a970c0f24700804770b147f2a620c2f207000188c8b2642809d8b1f5807f4ff0070138bf032104e0ff20214601e0ff20012140f2d262c5f2052202924ff4a1724df60f14adf80c208df80e108df80f0001aac0f24704012009210c23a04704b010bd00bf4ff2a840c2f22900016808466ff39600b0f1005f16d108684ef66a62ccf2ff0290420fd1d1f8fc0160b146f68052c2f207021268801a0028cebf01200020c1f8fc017047002070474ff2a840c2f22900026810466ff39600b0f1005f28d110684ef66a61ccf2ff01884221d1d2f82c02f0b146f68051c2f207010968401a0028c4bf01207047d2f8301200200029c2f82c0282f82a0208bf704710b5c2f8300204460846fbf7befc2046bde81040704700207047f0b101684ef66a62ccf2ff02914218bf704790f8061299b110b54af29f344ff0000cc0f24604864680f806c20120002100220023aef804c2a446bde810406047704700bf70b54ff2a846c2f229063468054621466ff39601b1f1005f07d120684ef66a61ccf2ff01884200f0c2804ff4497000f04fff002800f0e38004464ff6dc40cff6ff7000212218433082f8241382f8251382f8261382f8271382f8281382f8291382f82a1382f82b1382f82c1382f82d1382f82e1382f82f1382f8301382f8311382f8321382f8331382f8341382f8351382f8361382f8371382f8381382f8391382f83a1382f83b1382f83c1382f83d1382f83e1382f83f1382f8401382f8411382f8421382f8431382f8441382f8451382f8461382f8471382f8481382f8491382f84a1382f84b1382f84c1382f84d1382f84e1382f84f1382f8501382f8511382f8521382f8531382f8541382f8551382f8561382f8571382f8581382f8591382f85a1382f85b1382f85c1382f85d1382f85e1382f85f1382f8601382f8611382f8621382f8631382f8641382f8651382f866137ff476af4ef66a60ccf2ff002060012084f8ce004ff0ff30a4f8e000a4f8e200a4f8e400a4f8e600a4f8e800a4f8ea00a4f8ec00a4f8ee00a4f8f000a4f8f200a4f8f400a4f8f600a4f8f800a4f8fa00a4f8fc00a4f8fe00346000230820032184f81b322a2384f8180284f81912102184f81c32042384f81e0201204df60f1c04f5067284f81a1284f81d3284f81f0284f82012002d18bf0125c0f2470c0a2384f82152bde8704060470020306070bd2de9f0414ff2a847c2f229073f684ff000083c466ff39604b4f1005f07d13e684ef66a65ccf2ff05ae4208bfb84601280fd11c4615460f460646fff763fe2346044639462a463046002c18bfb8f1000f06d14af29f3cc0f2460cbde8f041604798f8060270b1d8f800020021002888f80612a8f804123ed042f68d41c0f24401884738e0b8f804020121013080b2012898bf0846a8f80402d8f8000242f68d44c0f2440488f8061268b94ff6ff40cff6ff70a4f594777844002142460023b847c8f8000240b1a047d8f80002a4f140024ff4c8719047c8b198f80602002808bfbde8f081d8f80002002188f80612a8f8041200b1a0474af29f3cc0f2460c0120002100220023bde8f04160474cf6dd70c0f245008047012830d1082088f80802032088f80902102088f80a02002088f80b02b22088f80c02062088f80d0288f80e024620b8f8041288f80f02432088f8100201200f0a4df6090c08f5027288f8110288f8120288f81312c0f2470c09210d2388f81472bde8f0416047bde8f08170b50446d0f8000242f665360d46c0f2440668b94ff61940cff6ff707844002122460023b0470028c4f8000208bf70bd06f594718847d4f8000206f1e8022946bde87040104700bf2de9f04f81b04568002d00f0c9828368002b00f0c58205eb030a4ff000080026002412e04ff2a840c2f229000099c0f8008020463246bc460ceb0903002653451d464ff0000480f0ab82ab461bf9013b03f07f07b740002b44ea070410d404f00703012b16dc0bb3012b40f09982aaeb0b03082bc0f0948205f10903dee700bfd34580f08d82182e06f107065d46dcd986e200bf022b3ad0052b40f08182aaeb0b03042bc0f07c826b1dc7e7d34580f0778295f90130002b05f10203bed5534580f06e8295f90230b3f1ff3f05f10303b4dc534580f0648295f90330b3f1ff3f05f10403aadc534580f05a8295f90430b3f1ff3f05f10503a0dc534580f0508295f90530002b00f14b82ab1d96e7d34580f0468295f9013005f1020c002b03f07f091fd5d44580f03b8295f90260eb1c06f07f07b6f1ff3f49eac71902dde3469c460fe0534580f02b8295f9037005f1040c07f07f06b7f1ff3f49ea863940f349819b46aaeb0c03994500f21982e308672b00f03281652b7ff45eafb9f1060ffff45aaf9cf80030462b7ff455af9bf80230432b7ff450af9bf80330012b7ff44baf4ff2a843c2f229031d682b466ff39603b3f1005f07d12b684ef66a67ccf2ff07bb4200f0cd8004464ff4497067460091164600f096fc00283ff423af4ff6dc4300990546cff6ff7320463246bc46ec18433384f8248384f8258384f8268384f8278384f8288384f8298384f82a8384f82b8384f82c8384f82d8384f82e8384f82f8384f8308384f8318384f8328384f8338384f8348384f8358384f8368384f8378384f8388384f8398384f83a8384f83b8384f83c8384f83d8384f83e8384f83f8384f8408384f8418384f8428384f8438384f8448384f8458384f8468384f8478384f8488384f8498384f84a8384f84b8384f84c8384f84d8384f84e8384f84f8384f8508384f8518384f8528384f8538384f8548384f8558384f8568384f8578384f8588384f8598384f85a8384f85b8384f85c8384f85d8384f85e8384f85f8384f8608384f8618384f8628384f8638384f8648384f8658384f866837ff476af4ef66a63ccf2ff032b60012385f8ce304ff0ff33a5f8e030a5f8e230a5f8e430a5f8e630a5f8e830a5f8ea30a5f8ec30a5f8ee30a5f8f030a5f8f230a5f8f430a5f8f630a5f8f830a5f8fa30a5f8fc30a5f8fe304ff2a843c2f229031d609bf804309bf805709bf80660032b47ea062459dd052b7adc042b00f0a780052b7ff459aed5f82c323bb146f68057c2f207073f68db1b002b11dcd5f8303285f82a8263b183461846c5f8308216460c466746fbf7d4f8bc4621463246584646f68053c2f207031b6845f69077c0f201073b44c5f82c322ee6044660460d4649461646674600f0e7fbbc4629463246204621e6d44580f0d38095f904706b1d07f07f06b7f1ff3f49ea46593ff797ae534580f0c58095f90560002e00f1c08005f1060c49ea06799be6012b42d0022b00f08f80032b7ff4ffad009016468b466746fff77bfb03460098bc4659463246002b3ff4f1ad95f80632002b3ff4ecad284641f28831a5f80442fff7a5fd55e0062b58d0072b7ff4dfad83464cf23330c0f24a0015460e466446804703465f1ea44631462a465846012f3ff6cdad981eb0fa80f04009fff7c5fba44631462a465846c1e546f68053c2f207031b6845f69077c0f201073b44c5f8fc31b4e5009016468b466746fff731fb03460098bc4659463246002b3ff4a7ad95f80632002b3ff4a2adb5f80432a3427ff49dadd5f8003285f80682002ba5f804823ff494ad42f68d411846c0f2440188470098bc465946324688e5d5f83032c5f82c82002b85f82a823ff480ad04461846c5f8308215460e466746fbf70bf8bc4631462a464ee795f80632c5f8fc81002b3ff46cad0446d5f800028b461646cdf800c085f80682a5f8048220b142f68d41c0f2440188474af29f370120002100220023c0f24607b847ddf800c02046324659464be54df60923c0f2490301b0bde8f04f18477fb50646002806d1fff7c0fa002807d19de80f00064645f25b1cc0f24f0c60477fbd00bf4df6090c0929c0f2470c40f0fd802de9f04f89b0f32b19d8a226d718d65406267e700a26be704626fe7061263e717e7277266325be722f267d716524fd716c25fe7231260d33bc713d723e734ff2a847c2f22907d7f800b0cde907105c466ff39604b4f1005f7ad1dbf800004ef66a61ccf2ff01884272d19bf83502bbf83c9200909bf83702bbf83e7202909bf838029bf8348204904fea192003909bf83a029bf8395205909bf83b029a460690380a01904cf6dd70c0f2450016468047dbf8404232465346210a4fea144c4fea146b4ff0a00ae82b5bd802eb030e06268ef8016015268ef802604d268ef80a50039d8ef8036043268ef8046001268ef80c50019d8ef80560009e8ef80e50059d8ef80760029e8ef80f50069d8ef80860049e8ef8110000208ef810508ef812408ef81700c220144603f118058ef806808ef809608ef80b908ef80d708ef813108ef814c08ef815b08ef816a0d0541ae0002700264ff0000a4ff0000b4ff0000c002100240020cde90577019703964ff0000900250496029600964ff00008e82ba3d914461d464df60900c0f2470000f5bd50804778b147f2a620c2f207000288dde90710d7b2642f0ad80726b2f5807f38bf032606e0dde90710ff27002601e0ff2701262b4622464df6090cc0f2470cf82b0fd8d224d518d45406246c700524ac705224ec7042242c71012408336c71ae71ef7109b0bde8f04f604700bf2de9f04f89b04ff2a843c2f229031d680c4629466ff39601b1f1005f38d129684ef66a63ccf2ff0399424bd195f83412b5f83c82039195f8351295f83862019195f8371295f83a92079195f8391295f83b7204914fea18210891b5f83e1282460291090a05914cf6dd71c0f2450193468847d5f840525a46290c06910199be463346844650462e0a4fea156aa02734e0002100234ff0000b00274ff0000a0691002600254ff0000c4ff0000e4ff000090591029108934ff0000804910791cdf80cb01ae0002100234ff0000b4ff0000a00260027069300254ff0000c4ff0000e4ff000090593029308934ff000080493cdf81ca08a4603965e46121b28bf182a2cd3c22202552044c17107990622017204994270152282704d2281720299c270432202710122417305994271039a817306998271089a017500211834437280f80b80027380f80f9080f810e080f811c08574c67480f815a08775c175204609b0bde8f08f2de9f04f81b04ff2a840c2f22900066830466ff39600b0f1005f0dd130684ef66a63ccf2ff03984206d196f8340218b1002a18bf002902d101b0bde8f08f96f83b020028f8d0d6f844020028f4d046f6805ac2f2070adaf80030c01a0128ebdb96f83502012802d14ff0010b06e096f837b2bbf1010f18bf4ff0020b96f83a520020eb078846adf80200adf8000013d0bbf1020f10d196f8390268b96b464bf2f1270df10201c0f25a07404614461a46b84796f83a5222461446b2f5c86f28bf4ff4c86404f115094846174600f078f80028b1d0b7f5c86f88bf45f08005daf80010d6f8402253230271120a42710a0a8171c2710a0c090e03704d234172a02143700123c17200218370c570027280f80ab0017396f8392283734273bdf80020bdf80230c273120a02741a0a8274220a0275621e032a04f0030c4374c47414d340f2fc7104ea010308f1010700217d1815f8014c421854757c5c043194756c788b42d475ad781576f1d1bcf1000f12d018f8017000f11503bcf1010f5f540ad04f1c18f80750bcf1020fdd5503d0023118f801205a544df66d22c0f24702494605469047d6f8400248f2c7310130c6f84002c0f245012846884701b0bde8f08fb0b54ff2ac44c2f22904216846f23f52c5f28802b2eb510f48f283314cf67e25c0f24501caf2101518bf25608847002804bf691c2160b0bd10b301684ef66a62ccf2ff0291421bd190f83b12c1b1d0f84412b1b146f68052c2f207021368cb1a012b0edb1268d0f84802002808bf7047891a42f64d42c0f2440208bf01211047704710b5002143f2c942c0f8441280f83b12c0f25902002044f24361904748f65354c0f25a04a04704f1bc00bde81040004700bf70b50429c0f0fb80024600784d2840f0f6805078432840f0f2809078012840f0ee804ff2a844c2f22904206803466ff39603b3f1005f07d103684ef66a66ccf2ff06b34200f0c5804ff449700d461646fff77cff002800f0d0804ff6dc41cff6ff7100224318433183f8242383f8252383f8262383f8272383f8282383f8292383f82a2383f82b2383f82c2383f82d2383f82e2383f82f2383f8302383f8312383f8322383f8332383f8342383f8352383f8362383f8372383f8382383f8392383f83a2383f83b2383f83c2383f83d2383f83e2383f83f2383f8402383f8412383f8422383f8432383f8442383f8452383f8462383f8472383f8482383f8492383f84a2383f84b2383f84c2383f84d2383f84e2383f84f2383f8502383f8512383f8522383f8532383f8542383f8552383f8562383f8572383f8582383f8592383f85a2383f85b2383f85c2383f85d2383f85e2383f85f2383f8602383f8612383f8622383f8632383f8642383f8652383f866237ff476af4ef66a61ccf2ff010160012180f8ce104ff0ff31a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe10324629462060d378022b06dc012b11d0022b0ed1bde87040e6e0032b73d0042b07d190f8341221b1bde87040aae00020206070bd0d2938bf70bd90f83b12b1b1002143f2c94380f83b12c0f259030446002044f243611546984748f65356c0f25a06b04706f1bc0080472a46204611790446012988bf002180f83512517901f00303012b4ff0010198bf0b4680f837329679012e88bf002680f83862d679022e88bf002680f83962167a557a46ea0526502e98bf5026b6f5f07f28bf4ff4f076a0f83c62967ad57a46ea052641f28835ae4238bf3546a0f83e52127b80f8341202f0030280f83a2203f0010202eb5302002180f83622c0f8401200f00bf8204600f040f802e0044600f0def82046bde8704069e0b0b5044690f83a02800758bfb0bd94f8350248f6a3450128c0f25a0507d105f1b000804705f58b71002088470ee005f5b670804794f83502012801d1002004e094f83702013818bf0120a8474ff65122cff6ff7243f271337a44c0f25903002044f243619847012084f83b02b0bd00bf70b5044646f68050c2f20700006894f83b1245f69075c0f2010500292844c4f8440208bf70bdd4f8480242f66536c0f2440658b94ff6f530cff6ff707844002122460023b047c4f8480250b106f594718847d4f8480206f1e8022946bde87040104770bd70b5044600f51375082084f84c02032084f84d02102084f84e02c22084f85002062084f851024d2084f85302432084f85402012084f8550294f8340294f8351284f8560284f8571294f83902b4f83c1284f85a0284f85b12080ab4f83e1284f85c02080a84f85e0294f83a0294f8372294f8383284f85d1294f83b1284f85f024cf6dd700026c0f2450084f84f6284f8582284f8593284f860128047d4f8401284f86102080a84f86302080c84f86402080e84f86502a02084f8676215264df6090c84f8621284f86602c0f2470c012009212a461c2384f85262bde87040604770b54ff2a840c2f22900046820466ff39600b0f1005f33d120684ef66a61ccf2ff01884218bf70bd94f83b020025c4f8445288b143f2c942c0f25902002044f2436184f83b52904748f65356c0f25a06b04706f1bc008047d4f8480284f8345270b142f68d45c0f24405a847d4f8480205f166018847002804bf0020c4f8480270bd00bf2de9f04182b04ff2a841c2f229010c6821466ff39601b1f1005f75d121684ef66a62ccf2ff0291426ed194f86c1279b394f86e02c0070ad0d4f82c0278b346f68051c2f207010968401a002827dd46f2d835c2f2070555f8040c002854d04ff27717c0f24b0747f62938002607f5437101a8c0f24b0801968847a8b1032084f86f622860b4f87002c04702b0bde8f081d4f87812c1b302b0bde8f0410847204602b0bde8f04133e001984ef6ed56c0f24b06a861b04706f5af708047e861b847012084f86f0203202860b4f87002c047d4f88002a0b10199d4f87c22b4f87272531a38bf8b1abb420ad2b4f8741259b146f68052c2f207021268101a884203d32046022100f06ef802b0bde8f08100bfb0b590f86c42002c42d043f60852c2f2000211880829114622d0114631f8083f082b1dd0114631f8103f082b18d0114631f8183f082b13d0114631f8203f082b0ed0114631f8283f082b09d0114631f8303f082b04d032f8381f0829114614d14a68b2f5870f10d36ff35602012a0cd14a684ff67363cff6ff737b449a4204d1d0f87822002a18bf4a60002180f86c1290f86d12b1b1002180f86d1244f68241c2f20701097869b946f2d431c2f20701096839b148f26111c0f24b010546042088472846002c08bfb0bd0321bde8b04000e000bfb0b588b004464cf6dd70c0f245000d468047012840f08f8008208df8010003208df8020010208df8030000208df80400ca208df8050006208df8060018208df8070046f2f030c2f2070050f81c2c94f86c12002a18bf0122002944f68141c2f207014b7818bf0232002b94f86f3218bf0432002b4ff0410318bf08328df808304c238df8093001238df80a308df80b508df80c2050f8182c4df609058df80d200268c0f24705130a8df80e208df80f30130c120e8df810308df811204268130a8df812208df81330130c120e8df814308df8152002698df81620120a8df8172009788df8181081688df819106821c2f2000109688df81a10090a8df81b1046f68051c2f207010a68130a8df81c208df81d30130c120e8df81e308df81f2000680df10102c4f87c0208680921c4f8800201201f23a84708b0b0bd00bf02293cbf4ff0ff3070472de9f0414ff2a84540f20108c2f22905cff680782c68074608f1020020400e46b0f1005f07d120684ef66a61ccf2ff01884200f0c3804ff44970fff766fb002800f0d48004464ff6dc40cff6ff70002100bf2218433082f8241382f8251382f8261382f8271382f8281382f8291382f82a1382f82b1382f82c1382f82d1382f82e1382f82f1382f8301382f8311382f8321382f8331382f8341382f8351382f8361382f8371382f8381382f8391382f83a1382f83b1382f83c1382f83d1382f83e1382f83f1382f8401382f8411382f8421382f8431382f8441382f8451382f8461382f8471382f8481382f8491382f84a1382f84b1382f84c1382f84d1382f84e1382f84f1382f8501382f8511382f8521382f8531382f8541382f8551382f8561382f8571382f8581382f8591382f85a1382f85b1382f85c1382f85d1382f85e1382f85f1382f8601382f8611382f8621382f8631382f8641382f8651382f866137ff476af4ef66a60ccf2ff002060012084f8ce004ff0ff30a4f8e000a4f8e200a4f8e400a4f8e600a4f8e800a4f8ea00a4f8ec00a4f8ee00a4f8f000a4f8f200a4f8f400a4f8f600a4f8f800a4f8fa00a4f8fc00a4f8fe002c604cf6dd70c0f24500804701281cbf0020bde8f081787802281bd001280ed048b9204600210024fff76afe2046bde8f081002028604ff0ff30bde8f081022e41f288300cd14ff4fa720021012341f2883721e02046fff7e9fd0020bde8f081b978052e10d3fa783b79072e42ea03220fd37b79bd79092e43ea0523e7d3fe793f7a46ea072707e041f288374ff4fa7201e041f288370123642a98bf6422824228bf024694f86c0284f86e12a4f87022a4f87232a4f8747278b146f2d430c2f207000068002852d020460121fff718fe0020c4f88002bde8f08143f60850c2f2000001880829014622d0014631f8082f082a1dd0014631f8102f082a18d0014631f8182f082a13d0014631f8202f082a0ed0014631f8282f082a09d0014631f8302f082a04d030f8381f0829014630d14a686ff00100b2f5870f38bfbde8f08102ea0802012a7ff478af4a684ff6c510cff6ff707844824214bfc4f87822d4f87822b2b14860012084f86c02a5e748f2ef01c0f24b010420884730b105462046fff754fd2846bde8f081012084f86d029ae76ff00100bde8f08100bf334600f005b800bf334600f037b800bf2de9f04182b042f2d7281e4614460d460746c0f24608fef705fa002e18bf002808d108f1160338462946224602b0bde8f041184746f26870c2f207000068c0470028eed00068e028ebd130784bf6d32601900027c0f24e0600200021002209230097b047012002b0bde8f0812de9f04182b042f2d7281e4614460d460746c0f24608fef7cff9002e18bf002808d108f1160338462946224602b0bde8f041184746f26870c2f207000068c0470028eed00068e028ebd130784bf6d32601900027c0f24e060020002100220a230097b047012002b0bde8f08110b582b00446fef7a1f90146002c4ff0000018bf002901d102b010bd46f26870c2f20700006842f2d721c0f24601884790b10068e0284ff00000edd121784bf6d32c0191c0f24e0c002100220b230090e047012002b010bd002002b010bd00bf08b53046fff7ccff002805d002b044f6e970c0f24400004748f68b43c0f24603984708bd2de9f04f95b0002918bf002a04d115b0bde8f04f01f01eba0e78ddf878b006f07f070b2f00f32781092f00f33481052f00f0ec81072f40f0c6814ff2a844c2f22904236818466ff39600b0f1005f07d118684ef66a67ccf2ff07b84200f0c7804ff4497015460e46fff7eef80346002800f0ba804ff6dc40cff6ff70002100bf1a18433082f8241382f8251382f8261382f8271382f8281382f8291382f82a1382f82b1382f82c1382f82d1382f82e1382f82f1382f8301382f8311382f8321382f8331382f8341382f8351382f8361382f8371382f8381382f8391382f83a1382f83b1382f83c1382f83d1382f83e1382f83f1382f8401382f8411382f8421382f8431382f8441382f8451382f8461382f8471382f8481382f8491382f84a1382f84b1382f84c1382f84d1382f84e1382f84f1382f8501382f8511382f8521382f8531382f8541382f8551382f8561382f8571382f8581382f8591382f85a1382f85b1382f85c1382f85d1382f85e1382f85f1382f8601382f8611382f8621382f8631382f8641382f8651382f866137ff476af4ef66a60ccf2ff001860012083f8ce004ff0ff30a3f8e000a3f8e200a3f8e400a3f8e600a3f8e800a3f8ea00a3f8ec00a3f8ee00a3f8f000a3f8f200a3f8f400a3f8f600a3f8f800a3f8fa00a3f8fc00a3f8fe0031462a462360022a2cbf4978ff21002b01f0f28002294ff0000000f0d386012900f0cc86002941f0e8804cf67e21caf21011c3f8dc0061604ff0ff31a3f8cc00c3f8c800a3f8e010a3f8e210a3f8e410a3f8e610a3f8e810a3f8ea10a3f8ec10a3f8ee10a3f8f010a3f8f210a3f8f410a3f8f610a3f8f810a3f8fa10a3f8fc10a3f8fe1083f8000115b0bde8f08f102f00f39f800c2f00f0bb81102f40f09f800846114615b0bde8f04ffff74fbc0a2f00f099830b2f40f092804ff2a846c2f22906346820466ff39600b0f1005f41f0938020684ef66a67ccf2ff07b8424ff0000041f08a80c4f82c0284f82a0284f82802d4f83012c4f8240284f8290221b1c4f830020846f9f7d9fcd4f8040140f2030942f68d48cff68079c0f244080021a4f8081150b1c047d4f8040108f166018847002804bf0020c4f8040146f67560c0f251008047356805ea0900b0f1005f2bd12868b84228d195f83b024ff0000ac5f844a288b143f2c942c0f25902002044f2436185f83ba2904748f6535bc0f25a0bd8470bf1bc008047d5f8480285f834a250b1c047d5f8480208f166018847002804bf0020c5f84802306800ea0901b1f1005f40f054870168b94240f0508790f86c12002900f04587fff7b7fa00f047bf112f00f0fe83422f3ff424aea7f10d05022d00f22b848568002d00f0ae86b0f84060b0f842406643b6f5163fc0f0a58601310e2fa2f101029846064628465b4600f095860d2f40f0958601f0a0f800f093be4ff2a848c2f22908022a2cbf4d78ff25d8f8004020466ff39600b0f1005f07d120684ef66a63ccf2ff03984200f0c7804ff4497016460f46fef700ff002800f03f8404464ff6dc40cff6ff70002132462318433083f8241383f8251383f8261383f8271383f8281383f8291383f82a1383f82b1383f82c1383f82d1383f82e1383f82f1383f8301383f8311383f8321383f8331383f8341383f8351383f8361383f8371383f8381383f8391383f83a1383f83b1383f83c1383f83d1383f83e1383f83f1383f8401383f8411383f8421383f8431383f8441383f8451383f8461383f8471383f8481383f8491383f84a1383f84b1383f84c1383f84d1383f84e1383f84f1383f8501383f8511383f8521383f8531383f8541383f8551383f8561383f8571383f8581383f8591383f85a1383f85b1383f85c1383f85d1383f85e1383f85f1383f8601383f8611383f8621383f8631383f8641383f8651383f866137ff476af4ef66a60ccf2ff002060012084f8ce004ff0ff303946a4f8e000a4f8e200a4f8e400a4f8e600a4f8e800a4f8ea00a4f8ec00a4f8ee00a4f8f000a4f8f200a4f8f400a4f8f600a4f8f800a4f8fa00a4f8fc00a4f8fe00c8f8004094f8080170b1d4f8040140b142f68d43c0f244030e46174698473a463146002084f808010123032a80f073837de3b2f1010900f0f08601f1010b00230022a9eb03000428c0f091850beb0306b078f7781c1d40ea0727a9eb040087424ff0ff3000f2da861bf80330767843ea06233b44b3f5803f00f2d086002f07eb040318bf01224b45dbd3002a00f0c5868846fdf736fe002800f069854ff2a847c2f229073c6820466ff39600b0f1005f07d120684ef66a61ccf2ff01884200f0c2804ff44970fef7dcfd002800f0588604464ff6dc40cff6ff7000212218433082f8241382f8251382f8261382f8271382f8281382f8291382f82a1382f82b1382f82c1382f82d1382f82e1382f82f1382f8301382f8311382f8321382f8331382f8341382f8351382f8361382f8371382f8381382f8391382f83a1382f83b1382f83c1382f83d1382f83e1382f83f1382f8401382f8411382f8421382f8431382f8441382f8451382f8461382f8471382f8481382f8491382f84a1382f84b1382f84c1382f84d1382f84e1382f84f1382f8501382f8511382f8521382f8531382f8541382f8551382f8561382f8571382f8581382f8591382f85a1382f85b1382f85c1382f85d1382f85e1382f85f1382f8601382f8611382f8621382f8631382f8641382f8651382f866137ff476af4ef66a60ccf2ff002060012084f8ce004ff0ff30a4f8e000a4f8e200a4f8e400a4f8e600a4f8e800a4f8ea00a4f8ec00a4f8ee00a4f8f000a4f8f200a4f8f400a4f8f600a4f8f800a4f8fa00a4f8fc00a4f8fe003c60d4f8300200286fd14ff48030f9f720fa002800f0898400210022831881544032b2f5803f59709970d970197159719971d971197259729972d972197359739973d973197459749974d974197559759975d975197659769976d976197759779977d97783f8201083f8211083f8221083f8231083f8241083f8251083f8261083f8271083f8281083f8291083f82a1083f82b1083f82c1083f82d1083f82e1083f82f1083f8301083f8311083f8321083f8331083f8341083f8351083f8361083f8371083f8381083f8391083f83a1083f83b1083f83c1083f83d1083f83e1083f83f109ad1c4f830020021cdf80c8006e007eb0a0149454ff0000080f06c850beb01039878da7801f1040a50ea0227efd012025b7802441bf80160013a1d02032a00f0030e04a8e0c001d2002224e00398a7eb0e030844a919002200bf8618d4f830c296f805800ceb010707f80280d4f83072b5790f4417447d70d4f83072f5790f441744bd70d4f83072367a0f44174404329342fe70e1d1069fdde90465bef1000fb5d0d4f830120beb0a00835c31442944bef1010f8b54aad0d4f83032511c10f801c033442b44bef1020f03f801c09ed0911cd4f83022405c32442a44505496e7022ac0f0b0834ff2a844c2f22904206803466ff39603b3f1005f07d103684ef66a67ccf2ff07bb4200f0c6804ff4497015460e46fef721fc002800f0d5824ff6dc41cff6ff71002200bf4318433183f8242383f8252383f8262383f8272383f8282383f8292383f82a2383f82b2383f82c2383f82d2383f82e2383f82f2383f8302383f8312383f8322383f8332383f8342383f8352383f8362383f8372383f8382383f8392383f83a2383f83b2383f83c2383f83d2383f83e2383f83f2383f8402383f8412383f8422383f8432383f8442383f8452383f8462383f8472383f8482383f8492383f84a2383f84b2383f84c2383f84d2383f84e2383f84f2383f8502383f8512383f8522383f8532383f8542383f8552383f8562383f8572383f8582383f8592383f85a2383f85b2383f85c2383f85d2383f85e2383f85f2383f8602383f8612383f8622383f8632383f8642383f8652383f866237ff476af4ef66a61ccf2ff010160012180f8ce104ff0ff31a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe1031462a4620604c78002c00f01782022c00f2d08240f0fb83062ac0f0cb828a78cb780f794e7942ea032147ea062232290791089280f0e5833221e7e3022a4ff0ff3008bf112e40f00c844878002840f0b1824cf6dd70c0f24500804701284ff0000040f0fe8309900446089040f20830c0f2100007904ef6a970c0f247008047002800f0188347f2a620c2f207000188c8b2642800f29a83b1f5807f4ff0070138bf032194e3092f00f08a80082f40f012810746002b4ff0ff3000f0d2834af28973cff6fd73d61802339e42c0f0c98391f801803846b8f1000f00f075820226b71c974200f266828b198e5d5b7856ea032300f05f82de19964200f25b82cc5d04f07f0cacf1100515f1030f0ad804f07b05092d06d0bcf1030f03d0bcf1060f40f0488214460d4639441a4600230746cdf800b0fff7a4f9002840f03b82b8f10108294622463846cad13de20023c8f80030002439463246032a0bd355b98878082800f27d8346f67561c0f251019631884775e3052a1ad3012d18d18d78681e06284ff0000000f26c83cb78032b00f268830a79002a00f0648346f67560c0f2510000f59a7728461946b84758e3022d40f0598146f67560c0f2510080474fe337064ff0210658bf1126b242c0f0f281002f01f101050ed54cf6dd72c0f245020f4604461e469047334601462046022918bf07f1110584462879697950ea01264ff0ff301ebfa979ea7951ea022900f02883297b6a7b41ea02218e4240f02183a97bea7b41ea0221894540f01a832878697840ea01217018b0f5207f4ff0ff3000f20f83aa78ec7842ea042209eb0204b4f5f07f00f205832c7a6f7a44ea072806eb0807b7f5207f00f2fb82af7aed7a47ea052509eb0507b7f5f07f00f2f182dcf80800002800f09581bcf84070bcf842406743b7f5163fc0f08c819a4643466446cde90169009502f0f2f8dbf800000f280ad80bebc0010130a1f806800d814e81a1f80c90cbf80000baf1000f00f0c782204678e1fd1e18bf0125bc1f18bf0124032afff4d3a825407ff4d0a800254c1ca2f1010c8df81c508df81d508df820508df824508df825508df826508df827508df828508df829508df82a508df82b508df82c508df82d508df82e508df82f508df830508df831508df832508df833508df834508df835508df836508df837508df838508df839508df83a508df83b508df848508df849508df84a508df84b508df84c508df84d508df84e508df84f508df850508df851508df852508df85350cde9074c48f63354cff6ff747c440f9448f67354cff6ff747c44032f1094119500f00d81062f40f0fc800646002000211d4602f06efab168002900f0f280b6f84020b6f842005043b0f5163fc0f0e98007a84ff4a0724ff4f07302f0aefb002800f0df80dbf800000f280dd80bebc0010022ca800a814ff420724a814ff4f07201308a81cbf80000002d304640f0d3801de2012083f8ce0019e283f8ce0015b0bde8f08f00202060bbe0002480f807424cf6dd70c0f24500804701462046012940f006824df25f50c0f2550015b0bde8f04f0047072a33d3032d31d18878cb780a7940ea03204d798e7901284ff0010498bf204644f62061884228bf084646f67561c0f25101642a28bf642201f5e2731146984746f2a070c2f207000068002800f0d58145ea0621012988bf0c4642f68d41c0f24401a1f1400221469047c6e1032a4ff00000c0f0c3812f1fb7fa87f77f093b4000f0bc81d01e4cf6cd42ccf6cc428b78a0fb0202b3eb920f88bf9308302b184628bf3020002b00f0cf8100eb800303f0030c03f4fe770023ce18f578e21882f80a513579043382f80b5175799f4282f80c51b67982f80d61eed1bcf1000f10d01944ca782344bcf1010f83f80a2108d00a79bcf1020f83f80b211cbf497983f80c1184f80801d4f8040142f68d45c0f24405002184f8091170b948f6a930cff6ff70a5f59477784422460023b8470028c4f8040100f08e81a5f14002012190475be100f0b4fd01e001f015fa20b14ff0ff3015b0bde8f08fb8f1000f00f04d813046594601f053fe47e1370600f14981082aecd306464ff0070e4ff0050c0127cc1994f802804ff0ff30b8f1000f00f03581e578002d00f0318111f807a04fea880909eb8a07b7f5207f00f2278167786c00cde9043e0696164604eb4702b2f5f07f00f21b8101eb0c00039111f80c10407841ea002081b2012002f030f9002840f00b81069988680028b0d0b1f84020b1f842105143b1f5163fa8d30399059b4fea480219440791f11a089107eb870100ebc11000eb4a0107a8234602f063fa002894d0dbf800000f280cd84fea8a017a000bebc0030130d9801a81a3f80a909c81cbf8000004980028069889d1d4e0ff20214689e090f86d12002918bffef76efb94f80702002684f8076258b14cf6dd70c0f245008047012804d14df25f50c0f255008047d4f8000294f80652c4f8fc6184f80662a4f8046250b1c047d4f8000208f166018847002804bf0020c4f8000200200121002d6060a060e06020616061a061e06120626062a062e06220636063a063e06320646064a064e06420656065a065e06520666066a066e06620676067a067e067c4f88000c4f88400c4f88800c4f88c00c4f89000c4f89400c4f89800c4f89c00c4f8a000c4f8a400c4f8a800c4f8ac00c4f8b000c4f8b400c4f8b800c4f8bc00c4f8c000c4f8c40084f8ce105bd04af29f37c0f2460701200021002200230024b847204615b0bde8f08f00203860f3e6ff20012140f2d262c5f2052208924ff4a1724df60f17adf824208df826108df8270007aac0f24707012009210c23b84715b0bde8f08fb1f5fa6f02d94ff4fa6107910121054680f807124cf6dd70c0f24500804701281dd14df25f56c0f25506a6f188008047022c08bf002801d058b910e048f2d31207a9c0f24b020220904740b10446b0472046002185f8071215b0bde8f08f002015b0bde8f08f0c2afff4a3aecf78ce79b7427ff49eae814608790e46097a88427ff497ae4cf6dd70c0f245009846144680470527022808bf01274ff00b0e4ff0090c314622464e4643469be60020a4f8080115b0bde8f08f46f675600025c0f2510084f808518047284615b0bde8f08f00bff0b583b04ff2a843c2f229031f683b466ff39603b3f1005f09d13b684ef66a66ccf2ff06b34204bf002387f82a32002958d0362a56d30b78422b53d14b784d2b50d10b7f4f7f43ea0723042b4ad18b7dcf7d0e7e43ea072343ea06434f7e8e7ccd7c53ea076346ea05270e7d4d7d47ea064747ea05641d4648bf5d42b0f84070002b4ff00003c8bf0123bc422ad1b0f84270bd4226d18f7ace7a91f80cc047ea06274e7b47ea0c4747ea0667974219d2621c032606eb5202866822f0030cca19cde901c30746304621462346009502f01bfb3846314622462b4602f0affb002003b0f0bd4ef2bb33c0f24e0303b0bde8f0401847072a1cbf4ff0ff3070472de9f04f8db00e4683461d46fcf7b3fe002800f065834ff2a847c2f22907386801466ff39601b1f1005f07d101684ef66a62ccf2ff02914200f0c2804ff44970fdf759fe002800f049834ff6dc41cff6ff71002200bf4318433183f8242383f8252383f8262383f8272383f8282383f8292383f82a2383f82b2383f82c2383f82d2383f82e2383f82f2383f8302383f8312383f8322383f8332383f8342383f8352383f8362383f8372383f8382383f8392383f83a2383f83b2383f83c2383f83d2383f83e2383f83f2383f8402383f8412383f8422383f8432383f8442383f8452383f8462383f8472383f8482383f8492383f84a2383f84b2383f84c2383f84d2383f84e2383f84f2383f8502383f8512383f8522383f8532383f8542383f8552383f8562383f8572383f8582383f8592383f85a2383f85b2383f85c2383f85d2383f85e2383f85f2383f8602383f8612383f8622383f8632383f8642383f8652383f866237ff476af4ef66a61ccf2ff010160012180f8ce104ff0ff31a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe1038603178727841ea02274ff6ff718f424ff0ff3200f08a82d0f830121046002900f08182cb5d4ff0ff30002b00f07b8239444a78002a00f0768202fb03f001f1020a4ff0000c4ff000010195009278b34ff6fe794ff6fd78cd194d4500f061828e4651440a78140904d00125a0421bd257e200bf454500f054824c781cb10225a04211d24de24ff6fb72aa1a042ac0f048828a78c97852ea012400f042820425a042c0f03e8200bf001b05eb0e01d3d10691b078f178b77940ea0129b8060f213279757907f00f0601eae07000fb06f189204143c90a8df824100e2142ea0525069a17f0200f08bf4ff00f0c08bf012106fb01f100fb01f14fead1218df825104ff00d0108bf022106fb01f100fb01f14fead1218df826104ff00c0108bf032106fb01f100fb01f14fead1218df827104ff00b0108bf042106fb01f100fb01f14fead1218df828104ff00a0108bf052106fb01f100fb01f14fead1218df829104ff0090108bf062106fb01f100fb01f14fead1218df82a104ff0080108bf072106fb01f100fb01f14fead1218df82b104ff0070108bf082106fb01f100fb01f14fead1218df82c104ff0060108bf092106fb01f100fb01f14fead1218df82d104ff0050108bf0a2106fb01f100fb01f14fead1218df82e104ff0040108bf0b2106fb01f100fb01f14fead1218df82f104ff0030108bf0c2106fb01f100fb01f14fead1218df830104ff0020108bf0d2106fb01f100fb01f14fead1218df831104ff0010108bf0e2171434143c90a8df832100cfb06f148434ff0010ec00a002a8df8330000f0768107f010008eea1010002604904ff00008cdf814a009e000bfdde90706069a0644ddf814a0964280f061811af806000896040901d0012113e0971b012f00f056810aeb06014c780cb1022109e0042fc0f04d818a78c97852ea012400f047810421079110f00f0109a810f801a018bf012104984fea0a1e40ea010c14f00300474600f08080b8fbf3f100224f19b7f1ff3fc8bf012202ea0c02012a1dd101fb13814944ca09042a17d87a090e2a14d807eb87020beb82124f08d65dc9076ff00f01029608bf0f210390504608bf7046029e314001430398d155012808f1010751d0b7fbf3f100264a19b2f1ff3fc8bf012606ea0c06012e1ad101fb13714944ce09042e14d856090e2e11d802eb82020beb82124e08c9070390905d6ff00f01574604bf0f2177460140039839439155022808f1020726d0b7fbf3f100224e19b6f1ff3fc8bf012202ea0c02012a18d101fb13714944ca09042a12d872090e2a0fd806eb86020beb82124e08c907905d6ff00f01574604bf0f21774601403943915508f10307611e0329a04405d244e700bf0437b8453ff440afb7fbf3f600227119b1f1ff3fc8bf012202ea0c02012a19d106fb137202eb0906f209042a12d84a090e2a0fd801eb81010beb811172088c5cf6076ff00f06504604bf0f2670463440204388547e1cb6fbf3f200205119b1f1ff3fc8bf012000ea0c00012819d102fb136000eb0906f009042812d848090e280fd801eb81000beb80107108425cf4076ff00f04564604bf0f247646224032434254be1cb6fbf3f200205119b1f1ff3fc8bf012000ea0c00012819d102fb136000eb0906f009042812d848090e280fd801eb81000beb80107108425cf4076ff00f04564604bf0f247646224032434254fe1cb6fbf3f200205119b1f1ff3fc8bf012000ea0c0001287ff47aaf02fb136000eb0906f00904283ff672af48090e283ff66eaf01eb81000beb80107108425cf4076ff00f04564604bf0f2476462240324342545ce7002038604ff0ff300db0bde8f08f10460db0bde8f08f009909eb03002944b0f5207fa8bf4ff42070b1f5f07fa8bf4ff4f071019f484588bfa94203d800200db0bde8f08f3a680f2af8d8a0eb090007ebc203491b5881501ca3f806901d8199813860ebe700bf082a3cbf4ff0ff3070472de9f04f93b015460c4680469a46fcf70cfb002800f03382e77907f1080085424ff0ff3040f02d822178627841ea02254ff640718d4200f224824ff2a849c2f22909d9f80000a67901466ff39601b1f1005f07d101684ef66a62ccf2ff02914200f0c3804ff44970fdf79ffa002800f003824ff6dc41cff6ff71002200bf4318433183f8242383f8252383f8262383f8272383f8282383f8292383f82a2383f82b2383f82c2383f82d2383f82e2383f82f2383f8302383f8312383f8322383f8332383f8342383f8352383f8362383f8372383f8382383f8392383f83a2383f83b2383f83c2383f83d2383f83e2383f83f2383f8402383f8412383f8422383f8432383f8442383f8452383f8462383f8472383f8482383f8492383f84a2383f84b2383f84c2383f84d2383f84e2383f84f2383f8502383f8512383f8522383f8532383f8542383f8552383f8562383f8572383f8582383f8592383f85a2383f85b2383f85c2383f85d2383f85e2383f85f2383f8602383f8612383f8622383f8632383f8642383f8652383f866237ff476af4ef66a61ccf2ff010160012180f8ce104ff0ff31a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe10c9f80000d0f830c2bcf1000f00f04481a178b3060e9121790f220d9106f00f0102eae3724a434ff0890b02fb0bf2d20a8df83c200e2294f8039094f805e0099616f0200f08bf012201fb02f202fb0bf24fead2228df83d204ff00d0208bf022201fb02f202fb0bf24fead2228df83e204ff00c0208bf032201fb02f202fb0bf24fead2228df83f204ff00b0208bf042201fb02f202fb0bf24fead2228df840204ff00a0208bf052201fb02f202fb0bf24fead2228df841204ff0090208bf062201fb02f202fb0bf24fead2228df842204ff0080208bf072201fb02f202fb0bf24fead2228df843204ff0070208bf082201fb02f202fb0bf24fead2228df844204ff0060208bf092201fb02f202fb0bf24fead2228df845204ff0050208bf0a2201fb02f202fb0bf24fead2228df846204ff0040208bf0b2201fb02f202fb0bf24fead2228df847204ff0030208bf0c2201fb02f202fb0bf24fead2228df848204ff0020208bf0d2201fb02f202fb0bf24fead2228df849204ff0010208bf0e2201fb02f202fb0bf24fead2228df84a204ff0000208bf0f22514301fb0bf10023c90a002f8df84b1000f091820e9a0ceb050142ea09220e920d9a0a9104f1080142ea0e224ff0000b4ff6fe7946460d92cdf820a0cde90b7105e00b9f0bf1010b0c99bb455dd011f80b104a1e1f2af4d34ab2202a50db0a9a02eb410111f8402c11f83f1c42ea01274ff6ff718f4243d01cf807104ff0ff33002900f058820ceb07025578002d00f0528202f102086943002200bfd5194d452ed008eb020423785fea131a04d04ff0010e51451cd223e04ff6fd739d421fd094f801a0baf1000f04d04ff0020e51450ed215e04ff6fb73eb1a042b10d3a378e57853ea052a0bd04ff0040e514507d3b1eb0a017244d1d1a3e70020c9f800004ff0ff3013b0bde8f08f08990122063100910999002501f010014ff6ff7482ea111106910c994a5d1f2a03d80e9911440b39fae1d0f830124ff0ff33002900f0fa810a9f07eb420212f8407c12f83f2c47ea0222a24200f0ee8111f802e0bef1000f00f0e88111444c78002c00f0e38104fb0ef34ff6fd7c002bcde9024500f09d818c1c4ff0000b4ff6fe780beb02054545b5d004eb0b073978090901d0012710e06545acd0797809b102270ae04ff6fb71691a0429a3d3b978ff7851ea07219ed004278b429bd35b1abb44ded1bbf1000f00f0738100254ff00008059406e0099d0799059c0d445d4580f06781615d09950f0901d0012213e0abeb0503012b00f05c81621957780fb1022209e0042bc0f054819378d27853ea022700f04e810422079211f00f010faa12f801c018bf0121069a4fea0c1942ea010a17f00304424600f08980b8fbfef20e9b02fb1e8100251944b1f1ff3fc8bf012505ea0a05012d1dd10d9bd2181ad4cd09042d17d855090e2d14d802eb820206eb82124d08535dc9076ff00f01019308bf0f210494644608bf4c46019b19402143049c5155012c08f1010257d0b2fbfef505fb1e210e9a11440022b1f1ff3fc8bf012202ea0a02012a1ad10d9a521917d4cb09042b14d853090e2b11d802eb820206eb82124b08c9070494d45c6ff00f01654604bf0f214d462140049c2943d154022c08f1020229d0b2fbfef303fb1e210e9a11440022b1f1ff3fc8bf012202ea0a02012a18d10d9ad21815d4cb09042b12d853090e2b0fd802eb820206eb82124b08c907d45c6ff00f01654604bf0f214d4621402943d15408f10302791eb8440d9f032904d23de7043290453ff43aafb2fbfef30e9c03fb1e2100252144b1f1ff3fc8bf012505ea0a05012d18d1db1916d4cd09042d13d85d090e2d10d803eb830306eb83134d08c9075f5d6ff00f01644604bf0f214c4639400d9f21435955511cb1fbfef30e9c03fb1e1121440024b1f1ff3fc8bf012404ea0a04012c18d1db1916d4cc09042c13d85c090e2c10d803eb830306eb83134c08c9071d5d6ff00f01674604bf0f214f46294039430d9f1955911cb1fbfef30e9c03fb1e1121440024b1f1ff3fc8bf012404ea0a04012c18d1db1916d4cc09042c13d85c090e2c10d803eb830306eb83134c08c9071d5d6ff00f01674604bf0f214f46294039430d9f1955d11cb1fbfef30e9c03fb1e1121440024b1f1ff3fc8bf012404ea0a04012c7ff471afdb193ff56eafcc09042c3ff66aaf5c090e2c3ff666af03eb830306eb83134c08c9071d5d6ff00f01674604bf0f214f46294039430d9f195553e70e9a0d9f029b02eb0e013b44b1f5207f0c4622eae272a8bf4ff42074b3f5f07fa8bf4ff4f07394421dddbb420b9f1bd9ddf82080d8f800500f2d15d8ddf834e0a4eb0209a3eb0e0c009b03ebc50423f835206a1ca4f802e0a4f80490a4f806c0c8f8002000e00b9f039d4ff6ff7401350023bd420e917ff4f7ad184613b0bde8f08f00bf062a3cbf4ff0ff3070472de9f04fadf2944d9a46154688460f90fbf7a7fe002800f0d68098f80510881d854240f0298446f6ac10c2f20700d0f800b0bbf1000f00f01f849bf80c009bf80d209bf80e309bf80f7040ea022040ea034040ea0769a9f1810010f1800f4ff0ff30c0f0b2809bf810209bf811309bf8137042ea03229bf8123042ea034242ea07620692813a12f5817f40f29e800029cdf828b000f09d8008f1060b002426aa4ff4e01c00270ae000bf05f1004042f8240001378f4204f1010480f08e801bf80750681e1e28f0d968b21f2801dd012075e0a5f1c2000beb07061d28a1eb07000fd8012800f0c88396f9010010f1410f00f3c28300f03f0365f38a1302201d465de005f0f003e02b24d10328c0f0b48396f9013013f1410f00f3ae8396f9020010f1410f00f3a883e02ddeb202d1a02ec0f0a283ed2d02d19f2e00f29d832b039bb206f03f0643ea861300f03f001d18032034e004284ff0ff3036d3a5f1f50313f1050f31d396f9013013f1410f2cdc96f9020010f1410f00f37e8396f9036016f1410f00f37883f02ddbb202d1902bc0f07283f42d02d18f2b00f26d830cea854e03f03f054eea053300f03f0043ea801006f03f0326aac518042000bf074442f8245076e74ff0ff300df2944dbde8f08f0021012007915ee0002c57d0a4f1010bcdf86090cdf810a000250df1780a5f46914608e026aaab4505f1010509f10409a7f1010739d052f825100029f3d400202b4687421dd009eb80067268b2f1ff3f18dc5a1c934514d0b268b2f1ff3f11dc9a1c93450dd0f268b2f1ff3f0adcda1c934506d032690433002a00f10400e0d400e000220a9853461aae009601f096fa002800f008831a980028c3d046f2a1415046c0f24e018847bce7ddf810a0ddf828b0ddf860900020079404e00020ddf828b00790012098f804400f21a20604f00f0501eae271694389225143c90a8df8681001260e2198f800c098f801e098f8023098f8037014f0200f08bf0e2608bf012105fb01f102fb01f14fead1218df869104ff00d0108bf022105fb01f102fb01f14fead1218df86a104ff00c0108bf032105fb01f102fb01f14fead1218df86b104ff00b0108bf042105fb01f102fb01f14fead1218df86c104ff00a0108bf052105fb01f102fb01f14fead1218df86d104ff0090108bf062105fb01f102fb01f14fead1218df86e104ff0080108bf072105fb01f102fb01f14fead1218df86f104ff0070108bf082105fb01f102fb01f14fead1218df870104ff0060108bf092105fb01f102fb01f14fead1218df871104ff0050108bf0a2105fb01f102fb01f14fead1218df872104ff0040108bf0b2105fb01f102fb01f14fead1218df873104ff0030108bf0c2105fb01f102fb01f14fead1218df874104ff0020108bf0d2105fb01f102fb01f14fead1218df8751006fb05f102fb01f14fead1218df876104ff0000108bf0f2169435143c90a00284ff000008df877107ff4cdae43ea0720079a484403904cea0e290af10600571e00260df198080190cdf810a0029718e000bf46f2a1411ea8c0f24e0188479df87c009df87d10dde90ab9029fdde9072640ea01200df1980801369642814400f0ff8158f82610b1f1ff3f1edd33469f421fd008eb83004268b2f1ff3f1adc0133bb4216d08268b2f1ff3f13dc0133bb420fd0c268b2f1ff3f0cdc0133bb4208d002690133002ae2d404e001f01f000b38d2e7002258461eab19ad009501f055f9002800f0c781199900290d9100f0ba819df880209df881309df87e009df87f1052ea03259df8822040ea01279df8833010979df884704fea024208969df8856042ea0362069b4fea074747ea06672b4403eb2743039fcdf82c90a7eb030609eb22491aaf149500f05e810902109b014400f0030809f101004ff0010c099009f102000ceb530305900d980c934b1e0e930b9b0130121415900ceb510003eb020e9a1acde91180a1eb08001890d0074ff0000a17904feace70169013960ae014980af1010a824512981599139e0144159100f029810aeb06014b090e2befd810980028ecd00e9801eb810103280f984ff0000600eb811e80f0848011980028ded0dde90c105feac67c0afb01084fea560018f8000000f00f03c1b208bf0b09b3fa83f0400910ea141f14d106eb0901c80904280fd848081ef80020fb5c02f00f0b02f0f0021a431aafc90708bf4bea03120ef8002011980128b1d0701c400818f80000bcf1000fc1b24fea111308bf00f00f03d8b2b0fa80f0400910ea141f14d109983118c80904280fd848081ef80020fb5c02f00f0b02f0f0021a431aafc90708bf4bea03120ef80020119802283ff486afb01c400818f80000bcf1000f00f00f01c2b208bf1109b1fa81f0400910ea141f7ff474af05983318d80904283ff66eaf58081ef80020795c02f00f0602f0f0020a43db0708bf46ea01120ef800205de7ddf8548007e000bf18980436b04208f102083ff471af18f8011c0023c9b2102938bf012313ea141f09eb060c16d14feadc13042b12d84fea5c0309091ef80320795c02f00f0b02f0f0020a431aaf5feac97008bf4bea01120ef8032018f8010c00f00f01b1fa81f0400910ea141f15d10cf10103d809042810d858081ef80020795c02f00f03179d43ea011302f0f002002d08bf42ea01030ef8003098f80000c1b210294ff0000038bf012010ea141f15d10cf10203d809042810d8080959081ef80120385c02f00f0302f0f002169d0243002d08bf43ea00120ef8012098f8000000f00f01b1fa81f0400910ea141f8ad10cf10303d80904283ff685af58081ef80020795c02f00f03179d43ea011302f0f002002d08bf42ea01030ef8003072e700bf109809eb00011498b1f5207f06eb000229eae970a8bf4ff42071b2f5f07fa8bf4ff4f072ddf810a081427ff70fae26eae6739a427ff70aaedaf800700f2f3ff605ae019dd21a091a05ebc70625f83700781c7380b180f280caf80000f6e59df87c009df87d10079a40ea012001e64ff0ff300df2944dbde8f08f00200df2944dbde8f08f2de9f04182b04ff2a847c2f229073d68884629466ff39601b1f1005f064607d128684ef66a61ccf2ff01884200f0c3804ff44970fcf70efa0546002800f0ba804ff6dc40cff6ff70002100bf2a18433082f8241382f8251382f8261382f8271382f8281382f8291382f82a1382f82b1382f82c1382f82d1382f82e1382f82f1382f8301382f8311382f8321382f8331382f8341382f8351382f8361382f8371382f8381382f8391382f83a1382f83b1382f83c1382f83d1382f83e1382f83f1382f8401382f8411382f8421382f8431382f8441382f8451382f8461382f8471382f8481382f8491382f84a1382f84b1382f84c1382f84d1382f84e1382f84f1382f8501382f8511382f8521382f8531382f8541382f8551382f8561382f8571382f8581382f8591382f85a1382f85b1382f85c1382f85d1382f85e1382f85f1382f8601382f8611382f8621382f8631382f8641382f8651382f866137ff476af4ef66a60ccf2ff002860012085f8ce004ff0ff30a5f8e000a5f8e200a5f8e400a5f8e600a5f8e800a5f8ea00a5f8ec00a5f8ee00a5f8f000a5f8f200a5f8f400a5f8f600a5f8f800a5f8fa00a5f8fc00a5f8fe003d60b068002818bf002d02d102b0bde8f081b6f84010b6f842205143b1f5163ff4d3c5f8240201264ff4f07085f8286201904ff4207049f683540090c0f2470400200021002200230027a04730b185f82872c5f8247202b0bde8f08188f8046002b0bde8f08100bf2de9f04f8ab0dde914a5089243ea010242ea0a02d207864640f0c4800eeb51004ff0ff374fea5a0c0eeb53068646012207eb5a00bcf1010f88bf4fea5a02069002f003000790caf341006ff00107059007eb5a006ff00207019007eb5a00009022f00302701c544203900ef101004ff0000b09960290cdf810e004e00bf1010bab4500f0c3810898139e5f466fea0b02864288bfaf183a183744099802eb820207eb87070eeb82198b4200eb871835d9059e6246b6b10698012e19f8002008f8002002460ed00198022e19f8002008f80020024606d0009819f8002008f80020024600bf06980328c8d300bf09eb020717f8016c08eb020000f8016c17f8026c043a00f8026c17f8036c00f8036c17f8047c00f8047ce9d1b0e700bfbaf1080f02d2002223e000bf03989601ba0102440298e64600eb060a6ff0030c0aeb0c00c67802eb0c07fe7006790cf1040c3e7146797e71807904eb0c060436b871edd10cf10402dde914a5f446ddf810e0079800283ff483af079e19f80200012e08f802003ff47baf501c079e19f80070022e08f800703ff472af901c19f8002008f800206be74ff6fc7000ea0a000af0030b0990aaf1010000240490cde905be07e0079c159d0134ddf850a0ac4200f01e81089f139ee0432246be42079488bf2a18d01900eb80000eeb801c901900eb8000baf1040f0eeb80184ff00009c0f09880ddf810a0ddf850e048468b4288bf504600eb010400eb03054fea54001cf800706ff0010080ea090009f1010288bf0eeb00026ff0020089ea000609f1020088bf0eeb06006ff0030686ea090609f1030b4feac47488bf0eeb060b07f00f06002c4fea550408bf3e0918f80470ed0707f00f0507f0f007374408bf45ea061708f80470541865081cf805501a44e40705f00f064fea520408bf2e0918f80450d20705f00f0205f0f005354408bf42ea0615421808f8045054081cf804401844d20704f00f054fea500208bf250918f80240c00704f00f0004f0f0042c4408bf40ea05140beb010008f8024042081cf802200beb0304c00702f00f054fea540008bf150918f80020e40702f00f0402f0f0022a4408bf44ea051208f80020099809f104098145aaf1040a7ff46eafdde905bebbf1000f3ff444af6fea09004a468b42149f88bf3a18501845081a44c0071cf805504fea520018f8007005f00f0408bf2c0907f00f0507f0f0072744d20708bf45ea0417bbf1010f08f800703ff420af149809f10102a0eb090a8b4288bfaaf10202541865081a44e4071cf805504fea520418f8040005f00f0708bf2f0900f00f0500f0f0003844d20708bf45ea0710bbf1020f08f804003ff4faae09f102008b4288bfaaf10300421854081844d2071cf804704fea500218f8024007f00f0508bf3d0904f00f0704f0f0042c44c00708bf47ea051408f80240d9e60ab0bde8f08f00bf70b54ff2a846c2f2290632680c4611466ff39601b1f1005f054607d110684ef66a61ccf2ff01884200f0c3804ff44970fbf7f8fe002800f0068102464ff6dc40cff6ff70002100bf1318433083f8241383f8251383f8261383f8271383f8281383f8291383f82a1383f82b1383f82c1383f82d1383f82e1383f82f1383f8301383f8311383f8321383f8331383f8341383f8351383f8361383f8371383f8381383f8391383f83a1383f83b1383f83c1383f83d1383f83e1383f83f1383f8401383f8411383f8421383f8431383f8441383f8451383f8461383f8471383f8481383f8491383f84a1383f84b1383f84c1383f84d1383f84e1383f84f1383f8501383f8511383f8521383f8531383f8541383f8551383f8561383f8571383f8581383f8591383f85a1383f85b1383f85c1383f85d1383f85e1383f85f1383f8601383f8611383f8621383f8631383f8641383f8651383f866137ff476af4ef66a60ccf2ff001060012082f8ce004ff0ff30a2f8e000a2f8e200a2f8e400a2f8e600a2f8e800a2f8ea00a2f8ec00a2f8ee00a2f8f000a2f8f200a2f8f400a2f8f600a2f8f800a2f8fa00a2f8fc00a2f8fe0032600120002d82f8cc0047d0104630f8e01fa1423bd0b2f8e210a14237d0b2f8e410a14233d0b2f8e610a1422fd0b2f8e810a1422bd0b2f8ea10a14227d0b2f8ec10a14223d0b2f8ee10a1421fd0b2f8f010a1421bd0b2f8f210a14217d0b2f8f410a14213d0b2f8f610a1420fd0b2f8f810a1420bd0b2f8fa10a14207d0b2f8fc10a14203d0b2f8fe10a1420ad1012082f8de0070bd0020306070bd82f8cd00002070bd92f8cd1081b9b2f8c810611a0bb2b3f1ff3f06dd89b2022924bf012182f8dd1002e0012182f8dc10b2f8ca30002182f8cd109c42a2f8c84088bfa2f8ca4092f8001120f81140481c00f00f0082f80001002070bd2de9f04fcdb046f22b149246c0f25d0447f2f85298460e4604f13c07c0f27b020f2138230546b84718b12846a047002423e20afb08f040000b960295059001250da94ff4807004f585724ff0000b4ff0000947464ff000080023564604930a930697cdf820a00192029ce1602061204600219047e1680daa891a07910da900f0e681ddf82ce00021002400900be000bf04940c9c002101234ff0030807980134844200f0d181002940f0e0810da80c94045db8f1020febd0b8f1010f00f09280b8f1000f40f0968004f00f000a900598210900f0a6808842c0f08880401a05900a9800eb00140001039014e01cf80b000a9a00f0f00010440cf80b000bf1010b01390125b34524bf4ff0000b09f10109002900f08c81b9454ff000084ff0000338bf012380f0028109eb8900002d0eeb801cdbd0cdf82490a946a6eb0b05b5eb510f88bf4d088db3a8080ceb0b0820d0002708f10102a7eb80006ff0030600bf02eb060e043600eb060a1af104078ef803408ef804408ef805408ef80640efd1301d069f089eddf82ce015f0030204d10ce0002015f0030208d0012a08f8004004d04044022a447018bf8470a1eb4501ab4489b1b34510d21cf80b00039a00f00f001043ddf824900cf80b00013900250029a0d12be100bf00214d46ddf8249090e700bfbcb10598a04228d201214ff0000821e0ddf810a005985aea042a16d00c9c5045cdf810a080f0938001214ff00008002342e70c9c002101234ff002083ce70c9c00214ff00108012336e7002001214ff0000804900c9c00232ee7001b05900a9800eb00110001099015e000bf1af80b200a9802f0f00202430af80b200bf1010b013c0125b34524bf4ff0000b09f10109002c00f0da80b9454ff000084ff0000338bf012350d209eb8902002d0eeb821adcd0ac46a6eb0b05b5eb540f88bf650855b3ae080aeb0b0818d0002008f10102a0eb860e6ff00306901904360eeb06070437c170017141718171f5d1069fddf82ce0321d15f0030604d10de0002215f0030609d0012e08f8021005d04244022e517018bf917000bfa4eb4504ab447cb1089eb3450ed21af80b00099a00f00f0010430af80b00013c0025002cabd184e0089e002465469de70c9c0121b4e6a0eb0a0005900a9800eb00110001099015e01cf80b000a9a00f0f00010430cf80b000bf1010baaf1010a0125b34524bf4ff0000b09f10109baf1000f65d0b9454ff000084ff0000338bf01235bd20b9a09eb8900002d02eb801cdad0ce46a946a6eb0b05b5eb5a0f88bf4fea5a0545b3a8080ceb0b0817d0002408f10102a4eb80006ff003069719043684190434f97039717971b971f6d1301d069f089e0c9c15f0030204d10ce0002015f0030208d0012a08f8001004d04044022a417018bf8170aaeb450abaf1000fab4411d0b34511d21cf80b00099a00f00f0010430cf80b00aaf1010a0025f146baf1000fa6d10be04ff0000a4d46f14697e70c9c4ff00008002131e6012102e04ff000080021ddf82ce029e600980da973b1012817d04ff0000450b90798019ab0fa80f040094ff480703ff4ffad00e00024029846f22b11c0f25d01884720464db0bde8f08f059840ea0800b0fa80f04409eee72de9f04f83b00c9e0292002e019000f08e80019823f00304471c029803f0030ac4f1000c01384ff00008009005e000bf08f10108b0450f4479d00e98c14600286fea080418bf06eb0409002bf0d0042b06d24ff0000bbaf1000f2ed1e8e700bf0d98b64609fb00f400986ff003050444607800f0f00242ea10107a19d0706078043500f00f0646ea0010107114f8020f00f0f00646ea10105071207800f00f0646ea00100ceb050604369071e0d105f1040b7646baf1000fbad002980d9a4fea5b0509fb0204019814f805e008fb01050ef00f025feacb7908bf4fea1e1242ea0212baf1010f05f80b20a1d00bf1010e4fea5e00205cb9f1000f4fea101208bf00f00f0242ea0210baf1020f05f80e008ed00bf102004208a25cb9f1000f02f00f0408bf140944ea04122a5480e703b0bde8f08f2de9f04182b003fb02f68846cde900164cf6036107466846c0f247011c461546884740f2196047f8240f788946f2c10245ea0040b86045ea044057f8204c7860c0f24a0220463946fe60c7f81080904740f69b51c0f244012046884702b0bde8f08100bf2de9f04188b046f24f461c46c0f24e0613460a46ddf83880002706f1ae05214627706770a770e77027716771a771e77127726772a772e77227736773a773e77327746774a774e77427756775a775e77527766776a776e77627776777a777e777a8470028c8f800705cd020786178a278e3780843104318434ff0010008d0e179a27911431ebf617a227a51ea020102d108b0bde8f081a07b14284ff00000f7d1217d8df8040041f0010121758df805008df806008df807008df808008df809008df80a008df80b008df80c008df80d008df80e008df80f008df810008df811008df812008df813008df814008df815008df816008df817008df818008df819008df81a008df81b008df81c008df81d008df81e008df81f0001a92046b047c8f8000018b1012008b0bde8f08106f1520120468847d8f80000002818bf012008b0bde8f08108031000000000000000000000000000000000000000000000002020202020002020000000505050000000000000000000005050f85050f85050000000002070a8a07028a8702000000048a85010202854480000000020505020689090680000002020200000000000000000000010204040404020100000000040201010101020400000000000005020f82050000000000000002020f82020000000000000000000000020204000000000000000f800000000000000000000000000202000000000080810102020404000000000708898a8c88888700000000020602020202020700000000070888808102040f8000000007088083008088870000000000818284888f8080800000000f88080f00808887000000000708080f08888887000000000f808081010202020000000007088887088888870000000007088888878080870000000000000202000002020000000000000202000002020400000000008102040201008000000000000f80000f8000000000000004020100810204000000000708888102000202000000000708898a8a89880780000000070888888f888888800000000f08888f0888888f000000000708880808080887000000000e0908888888890e000000000f88080f0808080f800000000f88080f0808080800000000070888080b888887000000000888888f888888888000000007020202020202070000000003810101010909060000000008890a0c0c0a090880000000080808080808080f80000000088d8a8a888888888000000008888c8a89888888800000000708888888888887000000000f0888888f080808000000000708888888888a87008000000f0888888f0a0908800000000708880700808887000000000f8202020202020200000000088888888888888700000000088888850505020200000000088888888a8a8d88800000000888850202050888800000000888850502020202000000000f8081020408080f8000000007040404040404070000000004040202010100808000000007010101010101070000000205088000000000000000000000000000000000000f80040200000000000000000000000000000700878888878000000008080f088888888f00000000000007088808088700000000008087888888888780000000000007088f8808078000000001820702020202020000000000000788888888878087000008080f08888888888000000202000602020202070000000080800180808080808483000004040485060605048000000006020202020202070000000000000f0a8a8a8a8a8000000000000f08888888888000000000000708888888870000000000000f088888888f0808000000000788888888878080800000000b8c0808080800000000000007880700808f00000000020207020202020180000000000008888888888780000000000008888505020200000000000008888a8a8a870000000000000885020205088000000000000888888888878087000000000f810204080f800000000182020402020201800000000202020202020202000000000601010081010106000000048a8900000000000000000", + "new": "02fb01f000e000bfb0b54ff2ac44c2f229040146206846f23f52c5f28802b2eb500f40f258304cf2e9124cf67e25c2f20000c0f24802caf2101518bf25609047002804bf691c2160b0bd00bf0846ffe7014640f258304cf20732c2f20000c0f24802104770b500284ed001684ef66a62ccf2ff02914218bf70bd90f8081190f8095146f6756c8d42c0f2510c2ad205eb8501014491f80d2191f80e4191f80ae191f80b3191f80c1142ea0424012c4ff0010298bf14466e1c054680f80961b9b164294eea032028bf6421012888bf024644f62060824228bf02460cf5e2731046984706e0002180f80811bde870406047e047d5f8040138b142f64d42c0f244022146bde87040104770bd00bf2de9f04f9db04ff2a84ac2f2290adaf800b058466ff39600b0f1005f40f07d81dbf800004ef66a67ccf2ff07b84240f074819bf82802002800f05d81dbf82442002c00f0588140f6b400c2f20000d0f8008004a802f0a0ffb8f1000f00f0ee81032045f24075cff68070a4f1600108f160026ff0bf03c0f2020500bf0e6ed41826664e6ec03366668e6eab42a666ce6ee6660e6f26674e6f66678e6fa667ce6fe667d1f88060c4f88060d1f88460c4f88460d1f88860c4f88860d1f88c60c4f88c60d1f89060c4f89060d1f89460c4f89460d1f89860c4f89860d1f89c60c4f89c60d1f8a060c4f8a060d1f8a460c4f8a460d1f8a860c4f8a860d1f8ac60c4f8ac60d1f8b060c4f8b060d1f8b460c4f8b460d1f8b860c4f8b860d1f8bc60c4f8bc6051f8c06fc4f8c0604e68c4f8c4608e68c4f8c860ce68c4f8cc600e69c4f8d0604e69c4f8d4608e69c4f8d860ce69c4f8dc600e6ac4f8e0604e6ac4f8e4608e6ac4f8e860ce6ac4f8ec600e6bc4f8f0604e6bc4f8f4608e6bc4f8f860ce6bc4f8fc600e6cc4f800614e6cc4f804618e6cc4f80861ce6cc4f80c610e6dc4f810614e6dc4f814618e6dc4f81861ce6dc4f81c617ff462afdaf800603040b0f1005f40f0b2803068b84240f0ae8096f8ce00002840f0458196f8dc10002000298df8140000f0bd8105a90a5c002a00f090810a185378002b00f04e819378002b00f04c81d378002b00f04a811379002b00f048815379002b00f046819379002b00f04481d379002b00f04281137a002b00f04081537a002b00f03e81937a002b00f03c81d37a002b00f03a81137b002b00f03881537b002b00f03681937b002b00f03481d37b002b00f03281137c002b00f03081537c002b00f02e81937c002b00f02c81d37c002b00f02a81137d002b00f02881537d002b00f02681937d002b00f02481d37d002b00f02281137e002b00f02081537e002b00f01e81937e002b00f01c81d37e002b00f01a81137f002b00f01881537f002b00f01681937f002b00f01481d27f002a00f01281203060287ff47baf31e19bf82a0270b1dbf82c0240b146f68051c2f207010968401a002800f3bf8000208bf82a0240f6d100c0f247001db0bde8f04f00474ff44d7004f09dff002800f092804ff6cc41cff6ff71002200bf4318293183f8342383f8352383f8362383f8372383f8382383f8392383f83a2383f83b2383f83c2383f83d2383f83e2383f83f2383f8402383f8412383f8422383f8432383f8442383f8452383f8462383f8472383f8482383f8492383f84a2383f84b2383f84c2383f84d2383f84e2383f84f2383f8502383f8512383f8522383f8532383f8542383f8552383f8562383f8572383f8582383f8592383f85a2383f85b2383f85c23aad1012180f8ce104ff0ff310760a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe1010e000208bf82802cbf824028bf82a0201208bf8290240f6d100c0f24700804715e00020caf8000000208bf82802cbf824024ff416304cf60361069005a8c0f24701cdf81480884701208bf82a0204a802f081fecbf8d4001db0bde8f08f01303ae0023038e0033036e0043034e0053032e0063030e007302ee008302ce009302ae00a3028e00b3026e00c3024e00d3022e00e3020e00f301ee010301ce011301ae0123018e0133016e0143014e0153012e0163010e017300ee018300ce019300ae01a3008e01b3006e01c3004e01d3002e01e3000e01f305f2821d84ff052020a541dd0014445225e284a7018d04f225d288a7014d052225c28ca7010d044225b280a710cd045225a284a7108d0522259288a7104d020225828ca7142f0178500208df87300012096f8dd10002900f0c280002105aa535c002b00f0a08057187b78002b5ed0bb78002b5dd0fb78002b5cd03b79002b5bd07b79002b5ad0bb79002b59d0fb79002b58d03b7a002b57d07b7a002b56d0bb7a002b55d0fb7a002b54d03b7b002b53d07b7b002b52d0bb7b002b51d0fb7b002b50d03b7c002b4fd07b7c002b4ed0bb7c002b4dd0fb7c002b4cd03b7d002b4bd07b7d002b4ad0bb7d002b49d0fb7d002b48d03b7e002b47d07b7e002b46d0bb7e002b45d0fb7e002b44d03b7f002b43d07b7f002b42d0bb7f002b41d0fb7f002b40d0203160297ff49aaf54e001313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2915d84ff05303535411d00a444b235e2953700cd049235d29937008d050235c29d37004d020235b29137140f0c28200218df87310013096f8de10002900f0be80002105aa535c002b00f0a08057187b78002b5ed0bb78002b5dd0fb78002b5cd03b79002b5bd07b79002b5ad0bb79002b59d0fb79002b58d03b7a002b57d07b7a002b56d0bb7a002b55d0fb7a002b54d03b7b002b53d07b7b002b52d0bb7b002b51d0fb7b002b50d03b7c002b4fd07b7c002b4ed0bb7c002b4dd0fb7c002b4cd03b7d002b4bd07b7d002b4ad0bb7d002b49d0fb7d002b48d03b7e002b47d07b7e002b46d0bb7e002b45d0fb7e002b44d03b7f002b43d07b7f002b42d0bb7f002b41d0fb7f002b40d0203160297ff49aaf50e001313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2911d84ff0440353540dd00a4455235e29537008d050235d29937004d020235c29d37040f08e8000218df87310013096f8df10002900f0cd80002005a90a5c002a00f0a3800a185378002b5ed09378002b5dd0d378002b5cd01379002b5bd05379002b5ad09379002b59d0d379002b58d0137a002b57d0537a002b56d0937a002b55d0d37a002b54d0137b002b53d0537b002b52d0937b002b51d0d37b002b53d0137c002b52d0537c002b51d0937c002b50d0d37c002b4fd0137d002b4ed0537d002b4dd0937d002b4cd0d37d002b4bd0137e002b4ad0537e002b49d0937e002b48d0d37e002b47d0137f002b46d0537f002b45d0937f002b44d0d27f002a43d0203060287ff49aaf5fe001303de002303be0033039e0043037e0053035e0063033e0073031e008302fe009302de00a302be00b3029e00c3027e00d3025e00e3023e00021117171e70f301ee010301ce011301ae0123018e0133016e0143014e0153012e0163010e017300ee018300ce019300ae01a3008e01b3006e01c3004e01d3002e01e3000e01f305f281dd84ff053020a5419d001444e225e284a7014d041225d288a7010d050225c28ca700cd04f225b280a7108d046225a284a7104d0202259288a7142f0b38200208df873000120daf8041046f23f52c5f28802b2eb510f40f08b80c90700f08e80002005a90a5c002a00f083810a185378002b00f0f7809378002b00f0f780d378002b00f0f7801379002b00f0f7805379002b00f0f7809379002b00f0f780d379002b00f0f780137a002b00f0fa80537a002b00f0fa80937a002b00f0fa80d37a002b00f0fa80137b002b00f0fa80537b002b00f0fa80937b002b00f0fa80d37b002b00f0fa80137c002b00f0fa80537c002b00f0fa80937c002b00f0fa80d37c002b00f0fa80137d002b00f0fa80537d002b00f0fa80937d002b00f0fa80d37d002b00f0fa80137e002b00f0fa80537e002b00f0fa80937e002b00f0fa80d37e002b00f0fa80137f002b00f00b81537f002b00f00981937f002b00f00781d27f002a00f00581203060287ff47baf1be14cf67e21caf21011caf80410002840f01681002005a90a5c002a00f0d9800a185378002b5ed09378002b5dd0d378002b5cd01379002b5bd05379002b5cd09379002b5dd0d379002b5ed0137a002b5fd0537a002b60d0937a002b61d0d37a002b65d0137b002b66d0537b002b67d0937b002b68d0d37b002b69d0137c002b6ad0537c002b6bd0937c002b6cd0d37c002b6dd0137d002b6ed0537d002b6fd0937d002b70d0d37d002b71d0137e002b72d0537e002b73d0937e002b74d0d37e002b75d0137f002b76d0537f002b77d0937f002b78d0d27f002a79d0203060287ff49aafa9e0013073e0023071e003306fe004306de0013084e0053069e0023080e0063065e003307ce0073061e0043078e008305de0053074e0093059e0063070e00a3055e007306ce0002151713de50b304ee0083065e00c304ae0093061e00d3046e00a305de00e3042e00b3059e00f303ee00c3055e010303ae00d3051e0113036e00e304de0123032e00f3049e013302ee0103045e014302ae0113041e0153026e012303de0163022e0133039e017301ee0143035e018301ae0153031e0193016e016302de01a3012e0173029e01b300ee0183025e01c300ae0193021e01d3006e01a301de01e3002e01b3019e01f305f2831d84ff04f020a542dd001444b225e284a7028d020225d288a7024d00020c87024e01c3004e01d3002e01e3000e01f305f2818d84ff041020a5414d001444c225e284a700fd05d288a700cd04f225c28ca7008d043225b280a7104d020225a284a7142f0028100208df8730005a80021cdf80880804618f80100002800f0a18008eb0102507800285ed0907800285dd0d07800285cd0107900285bd0507900285ad09079002859d0d079002858d0107a002857d0507a002856d0907a002855d0d07a002854d0107b002853d0507b002852d0907b002851d0d07b002850d0107c00284fd0507c00284ed0907c00284dd0d07c00284cd0107d00284bd0507d00284ad0907d002849d0d07d002848d0107e002847d0507e002846d0907e002845d0d07e002844d0107f002843d0507f002842d0907f002841d0d07f002840d0203160297ff498af43e001313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2904d84ff0770008f8010003d100208df8730003e008eb010000214170d6f8d0704ff0000918f80900002800f0c48008eb09014878002862d08878002862d0c878002862d00879002862d04879002862d08879002862d0c879002862d0087a002862d0487a002862d0887a002862d0c87a002862d0087b002862d0487b002862d0887b002862d0c87b002862d0087c002862d0487c002862d0887c002862d0c87c002862d0087d002862d0487d002862d0887d002862d0c87d002862d0087e002862d0487e002862d0887e002862d0c87e002862d0087f002862d0487f002862d0887f002862d0c87f002862d009f12009b9f1600f7ff496af4ff060095be009f1010958e009f1020955e009f1030952e009f104094fe009f105094ce009f1060949e009f1070946e009f1080943e009f1090940e009f10a093de009f10b093ae009f10c0937e009f10d0934e009f10e0931e009f10f092ee009f110092be009f1110928e009f1120925e009f1130922e009f114091fe009f115091ce009f1160919e009f1170916e009f1180913e009f1190910e009f11a090de009f11b090ae009f11c0907e009f11d0904e009f11e0901e009f11f090a2f4ff0010103961ed364204ff47a7542f2107401eb81035b00b7fbf3f60a2e11d301fb00f3b7fbf3f60a2e0bd301fb05f3b7fbf3f60a2e05d36143b7fbf1f3092be7d800e01946cc46b9f15f0f98bf4ff05f0cccf1000e1eeb090052d0b7fbf1f34cf6cd4203f13004ccf6cc4208f809400a29a1fb025446d3451c42d003fb1173e608b3fbf6f448f21f5204f1300508eb0907c5f2eb127d706429a1fb025835d3851c36d004fb16334fea5814b3fbf4f644f6d35206f13005c1f26202bd70b1f57a7fa1fb022526d303300df1140818d006fb1430aa0941f25974b0fbf2f3cdf2b714a1fb044503f13004fc7003fb120742f2107009f1040981424fea5531aad20de0e1460be009f1010908e009f1020903e0e14601e009f103090df11408039b002108f8091018f80100002800f0a18008eb0102507800285ed0907800285dd0d07800285cd0107900285bd0507900285ad09079002859d0d079002858d0107a002857d0507a002856d0907a002855d0d07a002854d0107b002853d0507b002852d0907b002851d0d07b002850d0107c00284fd0507c00284ed0907c00284dd0d07c00284cd0107d00284bd0507d00284ad0907d002849d0d07d002848d0107e002847d0507e002846d0907e002845d0d07e002844d0107f002843d0507f002842d0907f002841d0d07f002840d0203160297ff498af52e001313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2913d84ff0750008f801000ed008eb010073225e29427008d020225d29827004d070225c29c27040f09e8000208df87300d3f8d4104ff0000918f80900002800f0c78008eb09035878002862d09878002862d0d878002862d01879002862d05879002862d09879002862d0d879002862d0187a002862d0587a002862d0987a002862d0d87a002862d0187b002862d0587b002862d0987b002862d0d87b002865d0187c002865d0587c002865d0987c002865d0d87c002865d0187d002865d0587d002865d0987d002865d0d87d002865d0187e002865d0587e002865d0987e002865d0d87e002865d0187f002865d0587f002865d0987f002865d0d87f002865d009f12009b9f1600f7ff496af4ff060095ee009f101095be009f1020958e009f1030955e009f1040952e009f105094fe009f106094ce009f1070949e009f1080946e009f1090943e009f10a0940e009f10b093de009f10c093ae009f10d0937e009f10e0934e00021017161e709f10f092ee009f110092be009f1110928e009f1120925e009f1130922e009f114091fe009f115091ce009f1160919e009f1170916e009f1180913e009f1190910e009f11a090de009f11b090ae009f11c0907e009f11d0904e009f11e0901e009f11f0901230a291ed364204ff47a7742f2107503eb83067600b1fbf6f40a2c11d303fb00f6b1fbf6f40a2c0bd303fb07f6b1fbf6f40a2c05d36b43b1fbf3f6092ee7d800e03346ce46b9f15f0f98bf4ff05f0ecef1000842f2107c18eb09004ed0b1fbf3f405aa04f1300502f809504cf6cd42ccf6cc420a2ba3fb025641d3451c3dd004fb1317f608b7fbf6f405a948f21f5204f130054944c5f2eb124d70642ba3fb022530d3821c29d004fb16776c09b7fbf4f6b3f57a7f06f130028a7044f6d352c1f26202a3fb022520d3033016d006fb1470aa0941f25975b0fbf2f4cdf2b715a3fb055604f13005cd7004fb120109f1040963454fea5633aed209e0f14607e009f1010904e009f1020901e009f1030900210df1140808f80910ddf8089018f80100002800f0a18008eb0102507800285ed0907800285dd0d07800285cd0107900285bd0507900285ad09079002859d0d079002858d0107a002857d0507a002856d0907a002855d0d07a002854d0107b002853d0507b002852d0907b002851d0d07b002850d0107c00284fd0507c00284ed0907c00284dd0d07c00284cd0107d00284bd0507d00284ad0907d002849d0d07d002848d0107e002847d0507e002846d0907e002845d0d07e002844d0107f002843d0507f002842d0907f002841d0d07f002840d0203160297ff498af4ae001313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f290bd84ff0750008f8010006d008eb010073225e29427040f00f8100208df8730040f2403cc2f2000cdcf81c1045f2a800c2f2130042f2a0038142c2f2200328d1dcf82810b1f54d2f23d1dcf82c1081421fd145f61c540022c2f213044cf639471d1d4ff0ff3eac4213d8216831f0030000f0a683a34228bf0c290cd31e1bb04209d8c90718bf02442044013f00f10404e9d14ff0ff3e46f68050c2f20700d0f8880003f1080142f6a0038842c2f2270321d142f61c550022c2f2200546f6b974181d854217d8296831f0030700f0d980ab424ff0ff36039628bf0c290ed35e1bb7420bd8c90705eb070118bf3a44013c01f10405e5d14ff0ff300390dcf8001003f1080081422bd1dcf80c10b1f5333f26d1dcf81010814222d143f21c530021c2f2270342f6f932aaf10404aaf108004ff0ff3ca34213d81e6836f0030500f04683984228bf0c2e0cd3c71abd4209d8f7072b4418bf2944013a03f10403e9d14ff0ff3c002118f80100002800f0aa8008eb01046078002861d0a078002860d0e07800285fd0207900285ed0607900285dd0a07900285cd0e07900285bd0207a00285ad0607a002859d0a07a002858d0e07a002857d0207b002856d0607b002855d0a07b002854d0e07b002853d0207c002852d0607c002851d0a07c002856d0e07c002855d0207d002854d0607d002853d0a07d002852d0e07d002851d0207e002850d0607e00284fd0a07e00284ed0e07e00284dd0207f00284cd0607f00284bd0a07f00284ad0e07f002849d0203160297ff498af77e000218170f0e6013140e002313ee003313ce004313ae0053138e0063136e0073134e0083132e0093130e00a312ee00b312ce00c312ae00d3128e00e3126e00f3124e0103122e0113120e0854218bf4ff0ff32039236e7123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f292fd84ff0200008f801002ad008eb010366205e29587024d031205d29987020d033205c29d8701cd02f205b29187118d032205a29587114d030205929987110d02f205829d8710cd032205729187208d037205629587204d03d205529987241f0938200208df873001ef10100cdf804c000f090804fea9e214ff0000a18f80a00002800f0898108eb0a046078002800f00b81a078002800f00a81e078002800f009812079002800f008816079002800f00781a079002800f00681e079002800f00581207a002800f00481607a002800f00381a07a002800f00281e07a002800f00181207b002800f00081607b002800f0ff80a07b002800f0fe80e07b002800f0fd80207c002800f0fc80607c002800f0fb80a07c002800f0fc80e07c002800f0fd80207d002800f0fe80607d002800f0ff80a07d002800f00081e07d002800f00181207e002800f00281607e002800f00381a07e002800f00481e07e002800f00581207f002800f00681607f002800f00781a07f002800f00881e07f002800f009810af1200abaf1600f7ff477af4ff0600a01e1039b002118f80100002800f0ba8108eb01025078002800f0b0809078002800f0b180d078002800f0b2801079002800f0b3805079002800f0b4809079002800f0b580d079002800f0b680107a002800f0b780507a002800f0b880907a002800f0b980d07a002800f0ba80107b002800f0bb80507b002800f0bc80907b002800f0bd80d07b002800f04e81107c002800f04c81507c002800f04a81907c002800f04881d07c002800f04681107d002800f04481507d002800f04281907d002800f04081d07d002800f03e81107e002800f03c81507e002800f03a81907e002800f03881d07e002800f03681107f002800f03481507f002800f03281907f002800f03081d07f002800f03b81203160297ff479af3de10af1010a74e00af1020a71e00af1030a6ee00af1040a6be00af1050a68e00af1060a65e00af1070a62e00af1080a5fe00af1090a5ce00af10a0a59e00af10b0a56e00af10c0a53e00af10d0a50e00af10e0a4de00af10f0a4ae00af1100a47e00af1110a44e0013101e10af1120a3fe00231fce00af1130a3ae00331f7e00af1140a35e00431f2e00af1150a30e00531ede00af1160a2be00631e8e00af1170a26e00731e3e00af1180a21e00831dee00af1190a1ce00931d9e00af11a0a17e00a31d4e00af11b0a12e00b31cfe00af11c0a0de00c31cae00af11d0a08e00d31c5e00af11e0a03e00e31c0e00af11f0a0122bef5205f1ed364204ff47a7342f2107502eb82077f00b1fbf7f40a2c11d302fb00f7b1fbf7f40a2c0bd302fb03f7b1fbf7f40a2c05d36a43b1fbf2f7092fe7d800e03a46d146baf15f0f98bf4ff05f09c9f1000842f2107e18eb0a004ed0b1fbf2f305af03f1300407f80a404cf6cd47ccf6cc470a2aa2fb075441d3451c3dd003fb1217e308b7fbf3f405a948f21f5604f130055144c5f2eb164d70642aa2fb06c530d3861c29d004fb13736c09b3fbf4f7b2f57a7f07f130068e7044f6d356c1f26206a2fb066520d3033016d007fb1430ab0941f25976b0fbf3f7cdf2b716a2fb066507f13006ce7007fb13010af1040a72454fea5532aed209e0ca4607e00af1010a04e00af1020a01e00af1030a00200df11408dde9029308f80a003ce00f312be0103129e0113127e0123125e0133123e0143121e015311fe016311de017311be0183119e0193117e01a3115e01b3113e01c3111e01d310fe01e310de0ac4218bf4ff0ff329646fff764bca34218bf4ff0ff318c46c4e41f315f2904d84ff03f0008f8010003d100208df8730003e008eb010000214170002118f80100002800f0a18008eb0102507800285ed0907800285dd0d07800285cd0107900285bd0507900285ad09079002859d0d079002858d0107a002857d0507a002856d0907a002855d0d07a002854d0107b002853d0507b002852d0907b002851d0d07b002850d0107c00284fd0507c00284ed0907c00284dd0d07c00284cd0107d00284bd0507d00284ad0907d002849d0d07d002848d0107e002847d0507e002846d0907e002845d0d07e002844d0107f002843d0507f002842d0907f002841d0d07f002840d0203160297ff498af43e001313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2904d84ff02f0008f8010003d100208df8730003e008eb010000214170ddf804a0581c00f08f80990a4ff0000c18f80c00002800f0888108eb0c046078002800f00a81a078002800f00981e078002800f008812079002800f007816079002800f00681a079002800f00581e079002800f00481207a002800f00381607a002800f00281a07a002800f00181e07a002800f00081207b002800f0ff80607b002800f0fe80a07b002800f0fd80e07b002800f0fc80207c002800f0fb80607c002800f0fa80a07c002800f0fb80e07c002800f0fc80207d002800f0fd80607d002800f0fe80a07d002800f0ff80e07d002800f00081207e002800f00181607e002800f00281a07e002800f00381e07e002800f00481207f002800f00581607f002800f00681a07f002800f00781e07f002800f008810cf1200cbcf1600f7ff477af4ff0600c00e1002118f80100002800f0ad8108eb01025078002800f0b0809078002800f0b180d078002800f0b2801079002800f0b3805079002800f0b4809079002800f0b580d079002800f0b680107a002800f0b780507a002800f0b880907a002800f0b980d07a002800f0ba80107b002800f0bb80507b002800f0bc80907b002800f0bd80d07b002800f04e81107c002800f04c81507c002800f04a81907c002800f04881d07c002800f04681107d002800f04481507d002800f04281907d002800f04081d07d002800f03e81107e002800f03c81507e002800f03a81907e002800f03881d07e002800f03681107f002800f03481507f002800f03281907f002800f03081d07f002800f02e81203160297ff479af30e10cf1010c74e00cf1020c71e00cf1030c6ee00cf1040c6be00cf1050c68e00cf1060c65e00cf1070c62e00cf1080c5fe00cf1090c5ce00cf10a0c59e00cf10b0c56e00cf10c0c53e00cf10d0c50e00cf10e0c4de00cf10f0c4ae00cf1100c47e00cf1110c44e00131f4e00cf1120c3fe00231efe00cf1130c3ae00331eae00cf1140c35e00431e5e00cf1150c30e00531e0e00cf1160c2be00631dbe00cf1170c26e00731d6e00cf1180c21e00831d1e00cf1190c1ce00931cce00cf11a0c17e00a31c7e00cf11b0c12e00b31c2e00cf11c0c0de00c31bde00cf11d0c08e00d31b8e00cf11e0c03e00e31b3e00cf11f0c0124b3f5205f1ed364204ff47a7342f2107704eb84067600b1fbf6f50a2d11d304fb00f6b1fbf6f50a2d0bd304fb03f6b1fbf6f50a2d05d37c43b1fbf4f6092ee7d800e03446e146bcf15f0f98bf4ff05f09c9f1000842f2107e18eb0c004ed0b1fbf4f305aa03f1300702f80c704cf6cd42ccf6cc420a2ca4fb027541d3471c3dd003fb1417eb08b7fbf3f505a948f21f5205f130066144c5f2eb124e70642ca4fb022630d3821c29d005fb13737509b3fbf5f7b4f57a7f07f130028a7044f6d352c1f26202a4fb022620d3033016d007fb1530b20941f25975b0fbf2f3cdf2b715a4fb055603f13005cd7003fb12010cf1040c74454fea5634aed209e0cc4607e00cf1010c04e00cf1020c01e00cf1030c00200df11408ddf8089008f80c002fe00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2904d84ff03f0008f8010003d100208df8730003e008eb010000214170002118f80100002800f0a18008eb0102507800285ed0907800285dd0d07800285cd0107900285bd0507900285ad09079002859d0d079002858d0107a002857d0507a002856d0907a002855d0d07a002854d0107b002853d0507b002852d0907b002851d0d07b002850d0107c00284fd0507c00284ed0907c00284dd0d07c00284cd0107d00284bd0507d00284ad0907d002849d0d07d002848d0107e002847d0507e002846d0907e002845d0d07e002844d0107f002843d0507f002842d0907f002841d0d07f002840d0203160297ff498af43e001313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2904d84ff02f0008f8010003d100208df8730003e008eb0100002141701af1010000f090804fea9a214ff0000918f80900002800f0888108eb09046078002800f00a81a078002800f00981e078002800f008812079002800f007816079002800f00681a079002800f00581e079002800f00481207a002800f00381607a002800f00281a07a002800f00181e07a002800f00081207b002800f0ff80607b002800f0fe80a07b002800f0fd80e07b002800f0fc80207c002800f0fb80607c002800f0fa80a07c002800f0fb80e07c002800f0fc80207d002800f0fd80607d002800f0fe80a07d002800f0ff80e07d002800f00081207e002800f00181607e002800f00281a07e002800f00381e07e002800f00481207f002800f00581607f002800f00681a07f002800f00781e07f002800f0088109f12009b9f1600f7ff477af4ff0600900e1002118f80100002800f0ad8108eb01025078002800f0b0809078002800f0b180d078002800f0b2801079002800f0b3805079002800f0b4809079002800f0b580d079002800f0b680107a002800f0b780507a002800f0b880907a002800f0b980d07a002800f0ba80107b002800f0bb80507b002800f0bc80907b002800f0bd80d07b002800f04e81107c002800f04c81507c002800f04a81907c002800f04881d07c002800f04681107d002800f04481507d002800f04281907d002800f04081d07d002800f03e81107e002800f03c81507e002800f03a81907e002800f03881d07e002800f03681107f002800f03481507f002800f03281907f002800f03081d07f002800f02e81203160297ff479af30e109f1010974e009f1020971e009f103096ee009f104096be009f1050968e009f1060965e009f1070962e009f108095fe009f109095ce009f10a0959e009f10b0956e009f10c0953e009f10d0950e009f10e094de009f10f094ae009f1100947e009f1110944e00131f4e009f112093fe00231efe009f113093ae00331eae009f1140935e00431e5e009f1150930e00531e0e009f116092be00631dbe009f1170926e00731d6e009f1180921e00831d1e009f119091ce00931cce009f11a0917e00a31c7e009f11b0912e00b31c2e009f11c090de00c31bde009f11d0908e00d31b8e009f11e0903e00e31b3e009f11f090123baf5205f1ed364204ff47a7742f2107603eb83056d00b1fbf5f40a2c11d303fb00f5b1fbf5f40a2c0bd303fb07f5b1fbf5f40a2c05d37343b1fbf3f5092de7d800e02b46ce46b9f15f0f98bf4ff05f0ecef1000842f2107c18eb09004ed0b1fbf3f405aa04f1300502f809504cf6cd42ccf6cc420a2ba3fb025741d3451c3dd004fb1316ff08b6fbf7f405a948f21f5204f130054944c5f2eb124d70642ba3fb022530d3821c29d004fb17676c09b7fbf4f6b3f57a7f06f130028a7044f6d352c1f26202a3fb022520d3033016d006fb1470aa0941f25975b0fbf2f4cdf2b715a3fb055604f13005cd7004fb120109f1040963454fea5633aed209e0f14607e009f1010904e009f1020901e009f1030900200df1140808f80900ddf808902fe00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2904d84ff03f0008f8010003d100208df8730003e008eb010000214170002118f80100002800f0a18008eb0102507800285ed0907800285dd0d07800285cd0107900285bd0507900285ad09079002859d0d079002858d0107a002857d0507a002856d0907a002855d0d07a002854d0107b002853d0507b002852d0907b002851d0d07b002850d0107c00284fd0507c00284ed0907c00284dd0d07c00284cd0107d00284bd0507d00284ad0907d002849d0d07d002848d0107e002847d0507e002846d0907e002845d0d07e002844d0107f002843d0507f002842d0907f002841d0d07f002840d0203160297ff498af43e001313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2904d84ff06b0008f8010003d100208df8730003e008eb0100002141709df814a0baf1000f10d0022208eb020010f8013c63b118f8023063b143784bb1807804320028f1d1023a04e0002005e0013a00e0013202eb4200400040eae070821c09f5207c00f1010e02f0030822f0030709f5a0724ff0ff3504e001350d2d02f5a07269d005eb8500bef1030f0ceb801405d24ff0ff30b8f1000f2ed1ede70020164604e000bf874206f1020621d0431cdb09042b03d8337803f0f0033370831cdb09042b03d8737803f00f037370c31cdb09042b03d8737803f0f00373700430c309042bdfd84308e15c01f00f01e154d9e70138b8f1000fbfd0861cf109042908d87108635cc6076ff00f0608bf0f2633406354b8f1010fafd0c61cf109042909d87108635cc6074ff00f0608bf6ff00f0633406354b8f1020f9ed0061df10904299ad87108c007635c6ff00f0008bf0f201840605490e7baf1000f00f0ab800298022200f281280df1140e40f27d2940f27a2c08e01ef801af0632baf1000f08f1030800f09780aaf17f0010f15f0ff1d346f60851c0f200010aeb4a00794401eb8000a0f5c0710027d409404605e000bf02370c2f00f52070dcd0cb57042c06d8b3f1ff3f03dc067846f0f0060670042cdeb206d816f0400303d0037843f00f030370b30605d54a4503d8437843f0f0034370f30606d5b2f51f7f03d8437843f00f03437033074fea920305d59e2b03d8857845f0f0058570750705d5624503d8857845f00f058570cd1995f90160042c08d8b6f1ff3f05dc90f8405145f0f00580f84051042cf6b208d816f0400505d090f8405145f00f0580f84051b50607d54a4505d890f8415145f0f00580f84151f50608d5b2f51f7f05d890f8415145f00f0580f84151350707d59e2b05d890f8423143f0f00380f8423173077ff588af62453ff685af90f8423143f00f0380f842317de7ddf80880fdf775ba0020c871fdf74cbd00208871fdf7fdbe00200872fdf7e8ba0020d872fef76cbdf0b581b041f204054cf65561cef20005ccf2ac51c5f8ac1f4ef6fc51cef200010a684ff2a84642f080720a6055f8041cc2f2290641f0010145f8041c316807460a466ff39602b2f1005f07d108684ef66a62ccf2ff02904200f08e804ff44d7002f038f9002800f0c08001464ff6cc40cff6ff70002200bf0b18293083f8342383f8352383f8362383f8372383f8382383f8392383f83a2383f83b2383f83c2383f83d2383f83e2383f83f2383f8402383f8412383f8422383f8432383f8442383f8452383f8462383f8472383f8482383f8492383f84a2383f84b2383f84c2383f84d2383f84e2383f84f2383f8502383f8512383f8522383f8532383f8542383f8552383f8562383f8572383f8582383f8592383f85a2383f85b2383f85c23aad14ef66a60ccf2ff000860012081f8ce004ff0ff30a1f8e000a1f8e200a1f8e400a1f8e600a1f8e800a1f8ea00a1f8ec00a1f8ee00a1f8f000a1f8f200a1f8f400a1f8f600a1f8f800a1f8fa00a1f8fc00a1f8fe003160d1f8d800b8bb46f6805245f6e464c2f20702cff6f8741368204600bf16689e420ed116689e420bd116689e4208d116689e4203d1002800f10400efd19e421ad02b6816681068b0420ed11068b0420bd11068b04208d11068b04203d1002c04f10404efd1b04206d02868c01ac1f8d80001e0002030602868386001b0f0bd00bf2de9f04141f204084ff2a847cef20008c2f229070146d8f8004038680d6801466ff39601b1f1005f07d101684ef66a62ccf2ff02914200f08d804ff44d7002f04df8002800f096804ff6cc41cff6ff71002200bf4318293183f8342383f8352383f8362383f8372383f8382383f8392383f83a2383f83b2383f83c2383f83d2383f83e2383f83f2383f8402383f8412383f8422383f8432383f8442383f8452383f8462383f8472383f8482383f8492383f84a2383f84b2383f84c2383f84d2383f84e2383f84f2383f8502383f8512383f8522383f8532383f8542383f8552383f8562383f8572383f8582383f8592383f85a2383f85b2383f85c23aad14ef66a61ccf2ff010160012180f8ce104ff0ff31a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe103860d0f8d81081b144f6d350c1f26200a1fb0001880901284ff0010088bf88094be000203860fa2047e046f6805245f6e466c2f20702cff6f8761368314617689f420ed117689f420bd117689f4208d117689f4203d1002901f10401efd19f422ad0d8f80030176800bf1168b9420ed11168b9420bd11168b94208d11168b94203d1002e06f10406efd1b94214d0d8f8001044f6d357ca1ac1f26207a2fb0776c0f8d820b00901284ff0010088bfb009994208bffa2000e0fa20611bb1fbf0f0bde8f08100bf2de9f04f85b0044618b1a069002840f0a3804ff2a845c2f22905286801466ff39601b1f1005f07d101684ef66a62ccf2ff02914200f08c804ff44d7001f042ff002800f084804ff6cc41cff6ff7100224318293183f8342383f8352383f8362383f8372383f8382383f8392383f83a2383f83b2383f83c2383f83d2383f83e2383f83f2383f8402383f8412383f8422383f8432383f8442383f8452383f8462383f8472383f8482383f8492383f84a2383f84b2383f84c2383f84d2383f84e2383f84f2383f8502383f8512383f8522383f8532383f8542383f8552383f8562383f8572383f8582383f8592383f85a2383f85b2383f85c23aad14ef66a61ccf2ff010160012180f8ce104ff0ff31a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe102860002c18bf002807d14cf6dd70c0f2450005b0bde8f04f0047d4f80cc0bcf1000ff2d0d4f820a0baf1000fedd0d4f844e000f104094ff0ff38002700264ff0ff3106e000bf6037c02f06f1060600f0eb81c3195a68002a50d01a69013205d01a6942453cbfd3f8108031465a69002a06f1010241d01d6a013505d01d6a45453cbfd3f8208011465a6a002a06f1020233d01d6b013505d01d6b45453cbfd3f8308011465a6b002a06f1030225d01d6c013505d01d6c45453cbfd3f8408011465a6c002a06f1040217d01d6d013505d01d6d45453cbfd3f8508011465a6d002a06f1050209d01d6e0135acd01d6e45453cbfd3f860801146a5e71646002e019600f1a281f24500f29f810aeb0c0102910eeb0c0100220491cdf80c9000bf130159f80330a34224d109eb02135f68674507d30499b94204d304999e68cd1bae4208d9df68013714d00021196059609960d9600ee00299b9420bd9df68013708d00021196059609960d960012180f8df1000bf01320c2ad2d1049e04e000bfbef1000f00f0ba80b6eb0c02c0f0b880924500f2b5803546a6eb0a0b00224ff0000e02e06032c02aead000eb0208d8f80430a34217d1d8f80830a3b1d8f80c90002709eb03018b454ff0000138bf01219d4288bf01279e4238bf33460f421cbf4ff0010e1e46d8f81410a14216d1d8f818309bb1d8f81c10002719448b454ff0000138bf01219d4288bf01279e4238bf33460f421cbf4ff0010e1e46d8f82410a14216d1d8f828309bb1d8f82c10002719448b454ff0000138bf01219d4288bf01279e4238bf33460f421cbf4ff0010e1e46d8f83410a14216d1d8f838309bb1d8f83c10002719448b454ff0000138bf01219d4288bf01279e4238bf33460f421cbf4ff0010e1e46d8f84410a14216d1d8f848309bb1d8f84c10002719448b454ff0000138bf01219d4288bf01279e4238bf33460f421cbf4ff0010e1e46d8f85410a1427ff46eafd8f85830002b3ff469afd8f85c10002719448b454ff0000138bf01219d4288bf01279e4238bf33460f421cbf4ff0010e1e4653e7554562d1ddf80c904ff0ff36002200274ff0ff3505e000bf6032c02a07f1060744d083185968a14207d11969013104d01969a9423cbf1d693e465969a14207d1196a013104d0196aa9423cbf1d6a7e1c596aa14207d1196b013104d0196ba9423cbf1d6bbe1c596ba14207d1196c013104d0196ca9423cbf1d6cfe1c596ca14207d1196d013104d0196da9423cbf1d6d3e1d596da142bfd1196e0131bcd0196ea9423cbf1d6e7e1db6e700bf002e4ed409eb06113301002249f803204a608a60ca60012180f8df10ace6dc4543d21af00303524615d0aaf101021cf80210012b0bf802100dd0aaf102021cf80210022b0bf8021005d0aaf103021cf802100bf80210baf1040f5dd3abf10203acf10406b118cf789d186f708f789f54497805f8011cb15c043a05f8021cf1d14ae000290dd409eb01120b01002549f8035055609560d56001220e4680f8df2059e6012180f8df10dce535d90af0030e5fea9a024ff0000317d0a3eb82080bf101060cf101026ff003055119cf787319df700f7904351f714f795f71897908eb050704379971f0d12b1dbef1000f13d01cf80310bef1010f0bf803100cd0591c1cf80120bef1020f0bf8012004d0991c1cf801200bf80120039b019a03eb021112019c50d0f8c420c1f804b0531cc1f808a024bf01230022c0f8c430ca6091e520463146fff7e2bc2de9f047044648b1a06938b14ef2bb33c0f24e032046bde8f04718474ff2a848c2f22908d8f8005028466ff39600b0f1005f07d128684ef66a63ccf2ff03984200f091804ff44d700f46164601f01cfc0546002800f01e814ff6cc40cff6ff70002100bf2a18293082f8341382f8351382f8361382f8371382f8381382f8391382f83a1382f83b1382f83c1382f83d1382f83e1382f83f1382f8401382f8411382f8421382f8431382f8441382f8451382f8461382f8471382f8481382f8491382f84a1382f84b1382f84c1382f84d1382f84e1382f84f1382f8501382f8511382f8521382f8531382f8541382f8551382f8561382f8571382f8581382f8591382f85a1382f85b1382f85c13aad14ef66a60ccf2ff002860012085f8ce004ff0ff30a5f8e000a5f8e200a5f8e400a5f8e600a5f8e800a5f8ea00a5f8ec00a5f8ee00a5f8f000a5f8f200a5f8f400a5f8f600a5f8f800a5f8fa00a5f8fc00a5f8fe00c8f8005005f1040a4ff000094ff0ff38002016e000bf002948bfbde8f0870aeb01170e017968ba682046c7f80c8000f088f84af80690c7f80490c7f80890c7f80c90daf80010a14205d04ff0ff314ff0ff3205e000bf29690131f6d02a6900216b69a34204d12b6a93423cbf2a6a01216b6aa34204d12b6b93423cbf2a6b02216b6ba34204d12b6c93423cbf2a6c03216b6ca34204d12b6d93423cbf2a6d04216b6da34204d12b6e93423cbf2a6e05216b6ea34204d12b6f93423cbf2a6f06216b6fa34206d1d5f8803093423cbfd5f880200721d5f88430a34206d1d5f8903093423cbfd5f890200821d5f89430a34206d1d5f8a03093423cbfd5f8a0200921d5f8a430a34206d1d5f8b03093423cbfd5f8b0200a21d5f8b430a3427ff47bafd5f8c0309342bff476afd5f8c0000b2175e7204639463246c8f80050bde8f047ffe72de9f047a4b0804643f677504ff2a847c0f24f0091468a46c2f2290780473c68002021466ff39601b1f1005f02908df80c0007d120684ef66a61ccf2ff01884200f08e804ff44d7001f0ccfa0446002800f085804ff6cc40cff6ff70002100bf2218293082f8341382f8351382f8361382f8371382f8381382f8391382f83a1382f83b1382f83c1382f83d1382f83e1382f83f1382f8401382f8411382f8421382f8431382f8441382f8451382f8461382f8471382f8481382f8491382f84a1382f84b1382f84c1382f84d1382f84e1382f84f1382f8501382f8511382f8521382f8531382f8541382f8551382f8561382f8571382f8581382f8591382f85a1382f85b1382f85c13aad14ef66a60ccf2ff002060012084f8ce004ff0ff30a4f8e000a4f8e200a4f8e400a4f8e600a4f8e800a4f8ea00a4f8ec00a4f8ee00a4f8f000a4f8f200a4f8f400a4f8f600a4f8f800a4f8fa00a4f8fc00a4f8fe003c60baf1000f4ff0010618bfb9f1000f23d101af3846fff7ccf802ad404651464a460123009502f000f905463846fff7bcf9002e064608d19df80c0028b949f28340c0f247004c308047002c18bfc4f8d060284624b0bde8f0879af8001001f07f00a0f1100212f1040f09d80b2807d001f07e01082903d0032801d00628c8d13cb149f28340c0f24700804794f8280210b14ff0ff35dce70026bae700bfb0b54cf28544c0f251041d46a0474ff2a841c2f2290109680a466ff39602b2f1005f08d10a684ef66a63ccf2ff039a4218bf002100e00021421c18bf002900d1b0bd95f84d20002afad091f80722002a08bfb0bd45f2e823c2f206031a68132aeed8c2ebc20403eb04135b6801ebc2014ff40042c1f88432a1f88a222a7a01f52171002a0fbf802248f20112ca808122ab7c33b1ab7d23b1022342f002028b71ca7195f820303bb195f8243023b1032342f004028b71ca7195f846304bb195f8443042f008020b7195f84530ca714b71b0bd47f27e32c2f207021378002b14bf9378ff230b711378002b14bf5278ff224a71b0bd2de9f04f89b045f6e532c0f24b020c46054690474ff2a841c2f229010e6831466ff39601b1f1005f08d131684ef66a62ccf2ff02914208bf092d02d009b0bde8f08fe1082c29f9d896f807120029f5d04cf6dd71c0f2450105468847014628460129ebd145f2e821c2f206010b68581e13284ff0000047d8c3ebc30701eb07111a1fa1f5de7191f85471bf0618d4d71c3ad091f8e470bf0616d4971c34d091f87470bf0613d4571c2ed00f79bf0610d4043aa1f5e071171da3f10403e3d123e05a1e01f5a87104e09a1ee03101e0da1e703106ebc203d1f8009093f98b22b2f1ff3f11dc03f521710b684b450cd191f804804b798979029301914fea192a4fea194b4fea19610ce0ff2102914ff00009002200214ff0ff084ff0000a4ff0000b01910f278df80d70102708238df80e705227b4f5804f4ff080068df80c308df810708df8123038bf4ff48046b4f5001f6ff07f0c04f07f0338bf4ff0000c802c28bf80338df813309df815e09df816308df80f0004d29df814700226002416e0c4f3c610b4f5804f06eb000703d20326012400200be0b4f5001f03d204260224012003e00526032401200023e6468df8163004f108038df814708df815e08df81160f8b903a8a226c718c654062078700c20b8704320f8704d20387101207871029804f11703f871019887f80680387200207a72b87287f80b9087f80ca087f80db0b9734df60f1703aac0f2470701200821b847284609b0bde8f08f70b505464ef6a970c0f2470016460c46804770b147f2a620c2f207000188c8b2642809d8b1f5807f4ff0070138bf032104e0ff20002101e0ff200121321b28bf082a01d2204670bdd2232a192b5506235370052393705223d370422313710123083453719171d071204670bd024600284ff0ff3009d0022918bf70471078112801d1507810b14ff0ff30704710b584b04cf6dd70c0f24500804701284ff0000037d103900446029040f20830c0f2100001904ef6a970c0f24700804770b147f2a620c2f207000188c8b2642809d8b1f5807f4ff0070138bf032104e0ff20214601e0ff20012140f2d262c5f2052202924ff4a1724df60f14adf80c208df80e108df80f0001aac0f24704012009210c23a04704b010bd00bf4ff2a840c2f22900016808466ff39600b0f1005f16d108684ef66a62ccf2ff0290420fd1d1f8fc0160b146f68052c2f207021268801a0028cebf01200020c1f8fc017047002070474ff2a840c2f22900026810466ff39600b0f1005f28d110684ef66a61ccf2ff01884221d1d2f82c02f0b146f68051c2f207010968401a0028c4bf01207047d2f8301200200029c2f82c0282f82a0208bf704710b5c2f8300204460846fbf7f8fd2046bde81040704700207047f0b101684ef66a62ccf2ff02914218bf704790f8061299b110b54af29f344ff0000cc0f24604864680f806c20120002100220023aef804c2a446bde810406047704700bff0b581b004464ef2e960c0f245008047002c18bf012801d101b0f0bd21796279a379e77941ea022141ea034151ea076109d00e2904d00329eed10646032504e00646042501e006460225fff75dff00283046e1d04ff2a841c2f229010e6831466ff39601b1f1005fd6d131684ef66a62ccf2ff029142cfd14cf6dd71a778c0f2450104468847014620460129c4d1b221082086f82813062186f82403032086f8291386f82a13462186f82503102086f82b13432186f82603002086f82c13012186f82f734df6090706f5497286f8270386f82d1386f83003c0f24707012009210d2386f82e53b847204601b0f0bd00bf2046fff785bf00bf70b54ff2a846c2f229063468054621466ff39601b1f1005f07d120684ef66a61ccf2ff01884200f08d804ff44d7000f0cffe002800f0ae8004464ff6cc40cff6ff7000212218293082f8341382f8351382f8361382f8371382f8381382f8391382f83a1382f83b1382f83c1382f83d1382f83e1382f83f1382f8401382f8411382f8421382f8431382f8441382f8451382f8461382f8471382f8481382f8491382f84a1382f84b1382f84c1382f84d1382f84e1382f84f1382f8501382f8511382f8521382f8531382f8541382f8551382f8561382f8571382f8581382f8591382f85a1382f85b1382f85c13aad14ef66a60ccf2ff002060012084f8ce004ff0ff30a4f8e000a4f8e200a4f8e400a4f8e600a4f8e800a4f8ea00a4f8ec00a4f8ee00a4f8f000a4f8f200a4f8f400a4f8f600a4f8f800a4f8fa00a4f8fc00a4f8fe00346000230820032184f81b322a2384f8180284f81912102184f81c32042384f81e0201204df60f1c04f5067284f81a1284f81d3284f81f0284f82012002d18bf0125c0f2470c0a2384f82152bde8704060470020306070bd00bf80b582b04ff0010ccdf800c000f002f802b080bd2de9f04381b04ff2a847c2f229073f684ff000093e466ff39606b6f1005f07d13e684ef66a65ccf2ff05ae4208bfb946012811d1ddf820801c4615460e460746fff70efe2346044631462a463846002c18bfb9f1000f07d14af29f3cc0f2460c01b0bde8f043604799f8060288b1b8f1010f40f08580d9f80002002189f80612a9f80412e0b342f68d41c0f24401884736e0b9f804020121013080b2012898bf0846a9f80402d9f8000242f68d44c0f2440489f8061268b94ff64d40cff6ff70a4f59477784400214a460023b847c9f8000240b1a047d9f80002a4f140024ff4c8719047a8b199f80602002848d0d9f80002002189f80612a9f8041200b1a0474af29f3cc0f2460c0120002100220023a6e74cf6dd70c0f24500804701282fd1082089f80802032089f80902102089f80a02002089f80b02b22089f80c02062089f80d0289f80e02462089f80f02432089f81002012089f81102b9f804024df6090c070a09f5027289f8128289f81302c0f2470c012009210d2389f814726fe701b0bde8f08300bf80b582b04ff0050ccdf800c0fff734ff02b080bd2de9f04f81b04568002d00f088828368002b00f0848205eb03090024002614e046f68053c2f207031b6845f69077c0f201073b44c4f8fc310aeb080300244b451d464ff0000680f06a82ab461bf9013b03f07f07a740002b46ea070610d406f00703012b16dc0bb3012b40f05882a9eb0b03082bc0f0538205f10903dee700bfcb4580f04c82182c04f107045d46dcd945e200bf022b3ad0052b40f04082a9eb0b03042bc0f03b826b1dc7e7cb4580f0368295f90130002b05f10203bed54b4580f02d8295f90230b3f1ff3f05f10303b4dc4b4580f0238295f90330b3f1ff3f05f10403aadc4b4580f0198295f90430b3f1ff3f05f10503a0dc4b4580f00f8295f90530002b00f10a82ab1d96e7cb4580f0058295f9013005f1020a002b03f07f083dd5ca4580f0fa8195f90270eb1c07f07f04b7f1ff3f48eac41802ddd3469a462de04b4580f0ea8195f9037005f1040a07f07f04b7f1ff3f48ea843801dd9b461de0ca4580f0da8195f9043005f1050c03f07f07b3f1ff3f48ea475802ddd346e2460ce0cc4580f0c98195f90530002b00f1c48105f1060a48ea0378e346a9eb0a03984500f2ba81f308672b00f0fc80652b7ff440afb8f1060ffff43caf9af80030462b7ff437af9bf80230432b7ff432af9bf80330012b7ff42daf4ff2a843c2f229031c6823466ff39603b3f1005f07d123684ef66a67ccf2ff07bb4200f0988005464ff44d700091164600f039fc002800f0f6804ff6cc4300990446cff6ff7328463246002700bfe618293386f8347386f8357386f8367386f8377386f8387386f8397386f83a7386f83b7386f83c7386f83d7386f83e7386f83f7386f8407386f8417386f8427386f8437386f8447386f8457386f8467386f8477386f8487386f8497386f84a7386f84b7386f84c7386f84d7386f84e7386f84f7386f8507386f8517386f8527386f8537386f8547386f8557386f8567386f8577386f8587386f8597386f85a7386f85b7386f85c73aad14ef66a63ccf2ff032360012384f8ce304ff0ff33a4f8e030a4f8e230a4f8e430a4f8e630a4f8e830a4f8ea30a4f8ec30a4f8ee30a4f8f030a4f8f230a4f8f430a4f8f630a4f8f830a4f8fa30a4f8fc30a4f8fe304ff2a843c2f229031c609bf804309bf805709bf80660032b47ea06253bdd052b65dc042b00f08280052b7ff470aed4f82c323bb146f68057c2f207073f68db1b002b10dcd4f83032002784f82a7253b183461846c4f8307216460d46fbf7e9f929463246584646f68053c2f207031b6845f69077c0f201073b44c4f82c3246e6054650460e464146144600f0c0fb3146224628463be6012b3ff42dae022b00f08380032b7ff433ae009016468b46fff774fb0346009859463246002b3ff427ae94f80632002b3ff422ae204641f28831a4f8045204f093ff4ee04ff2a8410020c2f2290108600099284632460fe6062b45d0072b7ff40bae04464cf23330c0f24a0016460d46804703465f1e294632462046012f3ff6fbad981eb0fa80f04009fff733fc294632462046f0e5009016468b46fff732fb0346009859463246002b3ff4e5ad94f80632002b3ff4e0adb4f80432ab427ff4dbadd4f800320027002b84f80672a4f804723ff4d1ad42f68d411846c0f24401884700985946b5e7d4f830320027002bc4f82c7284f82a723ff4bead05461846c4f8307216460c46fbf748f92146324674e794f80632002b4ff00003c4f8fc313ff4aaad0546d4f800028b461646002184f80612a4f8041220b142f68d41c0f2440188474af29f370120002100220023c0f24607b8472846324659468ce54df60923c0f2490301b0bde8f04f184700bf7fb50646002806d1fff7c4fa002807d19de80f00064645f25b1cc0f24f0c60477fbd00bf4df6090c0929c0f2470c40f0fd802de9f04f89b0f32b19d8a226d718d65406267e700a26be704626fe7061263e717e7277266325be722f267d716524fd716c25fe7233260d33bc713d723e734ff2a847c2f22907d7f800b0cde907105c466ff39604b4f1005f7ad1dbf800004ef66a61ccf2ff01884272d19bf83502bbf83c9200909bf83702bbf83e7202909bf838029bf8348204904fea192003909bf83a029bf8395205909bf83b029a460690380a01904cf6dd70c0f2450016468047dbf8404232465346210a4fea144c4fea146b4ff0a00ae82b5bd802eb030e06268ef8016015268ef802604d268ef80a50039d8ef8036043268ef8046001268ef80c50019d8ef80560009e8ef80e50059d8ef80760029e8ef80f50069d8ef80860049e8ef8110000208ef810508ef812408ef81700c220144603f118058ef806808ef809608ef80b908ef80d708ef813108ef814c08ef815b08ef816a0d0541ae0002700264ff0000a4ff0000b4ff0000c002100240020cde90577019703964ff0000900250496029600964ff00008e82ba3d914461d464df60900c0f2470000f5bd50804778b147f2a620c2f207000288dde90710d7b2642f0ad80726b2f5807f38bf032606e0dde90710ff27002601e0ff2701262b4622464df6090cc0f2470cf82b0fd8d224d518d45406246c700524ac705224ec7042242c71012408336c71ae71ef7109b0bde8f04f604700bf2de9f04f89b04ff2a843c2f229031d680c4629466ff39601b1f1005f38d129684ef66a63ccf2ff0399424bd195f83412b5f83c82039195f8351295f83862019195f8371295f83a92079195f8391295f83b7204914fea18210891b5f83e1282460291090a05914cf6dd71c0f2450193468847d5f840525a46290c06910199be463346844650462e0a4fea156aa02734e0002100234ff0000b00274ff0000a0691002600254ff0000c4ff0000e4ff000090591029108934ff0000804910791cdf80cb01ae0002100234ff0000b4ff0000a00260027069300254ff0000c4ff0000e4ff000090593029308934ff000080493cdf81ca08a4603965e46121b28bf182a2cd3c22202552044c17107990622017204994270152282704d2281720299c270432202710122417305994271039a817306998271089a017500211834437280f80b80027380f80f9080f810e080f811c08574c67480f815a08775c175204609b0bde8f08f2de9f04f81b04ff2a840c2f22900066830466ff39600b0f1005f0dd130684ef66a63ccf2ff03984206d196f8340218b1002a18bf002902d101b0bde8f08f96f83b020028f8d0d6f844020028f4d046f6805ac2f2070adaf80030c01a0128ebdb96f83502012802d14ff0010b06e096f837b2bbf1010f18bf4ff0020b96f83a520020eb078846adf80200adf8000013d0bbf1020f10d196f8390268b96b464bf2f1270df10201c0f25a07404614461a46b84796f83a5222461446b2f5c86f28bf4ff4c86404f115094846174600f078f80028b1d0b7f5c86f88bf45f08005daf80010d6f8402253230271120a42710a0a8171c2710a0c090e03704d234172a02143700123c17200218370c570027280f80ab0017396f8392283734273bdf80020bdf80230c273120a02741a0a8274220a0275621e032a04f0030c4374c47414d340f2fc7104ea010308f1010700217d1815f8014c421854757c5c043194756c788b42d475ad781576f1d1bcf1000f12d018f8017000f11503bcf1010f5f540ad04f1c18f80750bcf1020fdd5503d0023118f801205a544df66d22c0f24702494605469047d6f8400248f2c7310130c6f84002c0f245012846884701b0bde8f08fb0b54ff2ac44c2f22904216846f23f52c5f28802b2eb510f48f283314cf67e25c0f24501caf2101518bf25608847002804bf691c2160b0bd10b301684ef66a62ccf2ff0291421bd190f83b12c1b1d0f84412b1b146f68052c2f207021368cb1a012b0edb1268d0f84802002808bf7047891a42f64d42c0f2440208bf01211047704710b5002143f2c942c0f8441280f83b12c0f25902002044f24361904748f65354c0f25a04a04704f1bc00bde81040004700bf70b50429c0f0c680024600784d2840f0c1805078432840f0bd809078012840f0b9804ff2a844c2f22904206803466ff39603b3f1005f07d103684ef66a66ccf2ff06b34200f090804ff44d700d461646fff77cff002800f09b804ff6cc41cff6ff7100224318293183f8342383f8352383f8362383f8372383f8382383f8392383f83a2383f83b2383f83c2383f83d2383f83e2383f83f2383f8402383f8412383f8422383f8432383f8442383f8452383f8462383f8472383f8482383f8492383f84a2383f84b2383f84c2383f84d2383f84e2383f84f2383f8502383f8512383f8522383f8532383f8542383f8552383f8562383f8572383f8582383f8592383f85a2383f85b2383f85c23aad14ef66a61ccf2ff010160012180f8ce104ff0ff31a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe10324629462060d378022b06dc012b11d0022b0ed1bde87040e7e0032b73d0042b07d190f8341221b1bde87040abe00020206070bd0d2938bf70bd90f83b12b1b1002143f2c94380f83b12c0f259030446002044f243611546984748f65356c0f25a06b04706f1bc0080472a46204611790446012988bf002180f83512517901f00303012b4ff0010198bf0b4680f837329679012e88bf002680f83862d679022e88bf002680f83962167a557a46ea0526502e98bf5026b6f5f07f28bf4ff4f076a0f83c62967ad57a46ea052641f28835ae4238bf3546a0f83e52127b80f8341202f0030280f83a2203f0010202eb5302002180f83622c0f8401200f00cf8204600f041f802e0044600f0dff82046bde870406ae000bfb0b5044690f83a02800758bfb0bd94f8350248f6a3450128c0f25a0507d105f1b000804705f58b71002088470ee005f5b670804794f83502012801d1002004e094f83702013818bf0120a8474ff6b922cff6ff7243f271337a44c0f25903002044f243619847012084f83b02b0bd00bf70b5044646f68050c2f20700006894f83b1245f69075c0f2010500292844c4f8440208bf70bdd4f8480242f66536c0f2440658b94ff65d40cff6ff707844002122460023b047c4f8480250b106f594718847d4f8480206f1e8022946bde87040104770bd70b5044600f51375082084f84c02032084f84d02102084f84e02c22084f85002062084f851024d2084f85302432084f85402012084f8550294f8340294f8351284f8560284f8571294f83902b4f83c1284f85a0284f85b12080ab4f83e1284f85c02080a84f85e0294f83a0294f8372294f8383284f85d1294f83b1284f85f024cf6dd700026c0f2450084f84f6284f8582284f8593284f860128047d4f8401284f86102080a84f86302080c84f86402080e84f86502a02084f8676215264df6090c84f8621284f86602c0f2470c012009212a461c2384f85262bde87040604770b54ff2a840c2f22900046820466ff39600b0f1005f33d120684ef66a61ccf2ff01884218bf70bd94f83b020025c4f8445288b143f2c942c0f25902002044f2436184f83b52904748f65356c0f25a06b04706f1bc008047d4f8480284f8345270b142f68d45c0f24405a847d4f8480205f166018847002804bf0020c4f8480270bd00bf2de9f04182b04ff2a841c2f229010c6821466ff39601b1f1005f75d121684ef66a62ccf2ff0291426ed194f86c1279b394f86e02c0070ad0d4f82c0278b346f68051c2f207010968401a002827dd46f2d835c2f2070555f8040c002854d04ff27717c0f24b0747f62938002607f5437101a8c0f24b0801968847a8b1032084f86f622860b4f87002c04702b0bde8f081d4f87812c1b302b0bde8f0410847204602b0bde8f04133e001984ef6ed56c0f24b06a861b04706f5af708047e861b847012084f86f0203202860b4f87002c047d4f88002a0b10199d4f87c22b4f87272531a38bf8b1abb420ad2b4f8741259b146f68052c2f207021268101a884203d32046022100f06ef802b0bde8f08100bfb0b590f86c42002c42d043f60852c2f2000211880829114622d0114631f8083f082b1dd0114631f8103f082b18d0114631f8183f082b13d0114631f8203f082b0ed0114631f8283f082b09d0114631f8303f082b04d032f8381f0829114614d14a68b2f5870f10d36ff35602012a0cd14a684ff67363cff6ff737b449a4204d1d0f87822002a18bf4a60002180f86c1290f86d12b1b1002180f86d1244f68241c2f20701097869b946f2d431c2f20701096839b148f26111c0f24b010546042088472846002c08bfb0bd0321bde8b04000e000bfb0b588b004464cf6dd70c0f245000d468047012840f08f8008208df8010003208df8020010208df8030000208df80400ca208df8050006208df8060018208df8070046f2f030c2f2070050f81c2c94f86c12002a18bf0122002944f68141c2f207014b7818bf0232002b94f86f3218bf0432002b4ff0410318bf08328df808304c238df8093001238df80a308df80b508df80c2050f8182c4df609058df80d200268c0f24705130a8df80e208df80f30130c120e8df810308df811204268130a8df812208df81330130c120e8df814308df8152002698df81620120a8df8172009788df8181081688df819106821c2f2000109688df81a10090a8df81b1046f68051c2f207010a68130a8df81c208df81d30130c120e8df81e308df81f2000680df10102c4f87c0208680921c4f8800201201f23a84708b0b0bd00bf02293cbf4ff0ff3070472de9f0414ff2a84540f20108c2f22905cff680782c68074608f1020020400e46b0f1005f07d120684ef66a61ccf2ff01884200f08e804ff44d70fff79afb002800f09f8004464ff6cc40cff6ff70002100bf2218293082f8341382f8351382f8361382f8371382f8381382f8391382f83a1382f83b1382f83c1382f83d1382f83e1382f83f1382f8401382f8411382f8421382f8431382f8441382f8451382f8461382f8471382f8481382f8491382f84a1382f84b1382f84c1382f84d1382f84e1382f84f1382f8501382f8511382f8521382f8531382f8541382f8551382f8561382f8571382f8581382f8591382f85a1382f85b1382f85c13aad14ef66a60ccf2ff002060012084f8ce004ff0ff30a4f8e000a4f8e200a4f8e400a4f8e600a4f8e800a4f8ea00a4f8ec00a4f8ee00a4f8f000a4f8f200a4f8f400a4f8f600a4f8f800a4f8fa00a4f8fc00a4f8fe002c604cf6dd70c0f24500804701281cbf0020bde8f081787802281bd001280ed048b9204600210024fff79ffe2046bde8f081002028604ff0ff30bde8f081022e41f288300cd14ff4fa720021012341f2883721e02046fff71efe0020bde8f081b978052e10d3fa783b79072e42ea03220fd37b79bd79092e43ea0523e7d3fe793f7a46ea072707e041f288374ff4fa7201e041f288370123642a98bf6422824228bf024694f86c0284f86e12a4f87022a4f87232a4f8747278b146f2d430c2f207000068002852d020460121fff74dfe0020c4f88002bde8f08143f60850c2f2000001880829014622d0014631f8082f082a1dd0014631f8102f082a18d0014631f8182f082a13d0014631f8202f082a0ed0014631f8282f082a09d0014631f8302f082a04d030f8381f0829014630d14a686ff00100b2f5870f38bfbde8f08102ea0802012a7ff478af4a684ff62f20cff6ff707844824214bfc4f87822d4f87822b2b14860012084f86c02a5e748f2ef01c0f24b010420884730b105462046fff789fd2846bde8f081012084f86d029ae76ff00100bde8f081334600f005b800bf334600f037b800bf2de9f04182b042f2d7281e4614460d460746c0f24608fef773fa002e18bf002808d108f1160338462946224602b0bde8f041184746f26870c2f207000068c0470028eed00068e028ebd130784bf6d32601900027c0f24e0600200021002209230097b047012002b0bde8f0812de9f04182b042f2d7281e4614460d460746c0f24608fef73dfa002e18bf002808d108f1160338462946224602b0bde8f041184746f26870c2f207000068c0470028eed00068e028ebd130784bf6d32601900027c0f24e060020002100220a230097b047012002b0bde8f08110b582b00446fef70ffa0146002c4ff0000018bf002901d102b010bd46f26870c2f20700006842f2d721c0f24601884790b10068e0284ff00000edd121784bf6d32c0191c0f24e0c002100220b230090e047012002b010bd002002b010bd00bf08b53046fff7ccff002805d002b044f6e970c0f24400004748f68b43c0f24603984708bd012818bf002900d170478968002908bf704710b582b00a794b798c79c97942ea032242ea044242ea0161062910d14ef22151c0f24501044688470146204639b144f6e100c0f2440080470146204619b102b0bde810407047fef7a4f9014620460029f5d046f26870c2f20700006842f2d721c0f246018847014620460029e7d00968e029e4d14bf6d32e4ff0000cc0f24e0e0020002100220c23cdf804c0cdf800c0f0472046d3e710b5059c4ff23710c0f2460080472146fff7a2ff10bd00bf2de9f04f95b0002918bf002a04d115b0bde8f04f01f04ab90e78ddf878b006f07f070b2f00f3f280092f00f3ff80052f00f0b781072f40f091814ff2a844c2f22904236818466ff39600b0f1005f07d118684ef66a67ccf2ff07b84200f092804ff44d7015460e46fff7f8f80346002800f085804ff6cc40cff6ff70002100bf1a18293082f8341382f8351382f8361382f8371382f8381382f8391382f83a1382f83b1382f83c1382f83d1382f83e1382f83f1382f8401382f8411382f8421382f8431382f8441382f8451382f8461382f8471382f8481382f8491382f84a1382f84b1382f84c1382f84d1382f84e1382f84f1382f8501382f8511382f8521382f8531382f8541382f8551382f8561382f8571382f8581382f8591382f85a1382f85b1382f85c13aad14ef66a60ccf2ff001860012083f8ce004ff0ff30a3f8e000a3f8e200a3f8e400a3f8e600a3f8e800a3f8ea00a3f8ec00a3f8ee00a3f8f000a3f8f200a3f8f400a3f8f600a3f8f800a3f8fa00a3f8fc00a3f8fe0031462a462360022a2cbf4978ff21002b01f0548002294ff0000000f03586012900f02e86002941f04a804cf67e21caf21011c3f8dc0061604ff0ff31a3f8cc00c3f8c800a3f8e010a3f8e210a3f8e410a3f8e610a3f8e810a3f8ea10a3f8ec10a3f8ee10a3f8f010a3f8f210a3f8f410a3f8f610a3f8f810a3f8fa10a3f8fc10a3f8fe1083f8000115b0bde8f08f102f00f39f800c2f00f08781102f40f09f800846114615b0bde8f04ffff75abc0a2f00f030830b2f40f092804ff2a846c2f22906346820466ff39600b0f1005f40f0f58720684ef66a67ccf2ff07b8424ff0000040f0ec87c4f82c0284f82a0284f82802d4f83012c4f8240284f8290221b1c4f830020846f9f756fed4f8040140f2030942f68d48cff68079c0f244080021a4f8081150b1c047d4f8040108f166018847002804bf0020c4f8040146f67560c0f251008047356805ea0900b0f1005f2bd12868b84228d195f83b024ff0000ac5f844a288b143f2c942c0f25902002044f2436185f83ba2904748f6535bc0f25a0bd8470bf1bc008047d5f8480285f834a250b1c047d5f8480208f166018847002804bf0020c5f84802306800ea0901b1f1005f40f0b6860168b94240f0b28690f86c12002900f0a786fff7c2fa00f0a9be112f00f06083422f3ff459aea7f10d05022d00f28d838568002d00f01086b0f84060b0f842406643b6f5163fc0f0078601310e2fa2f101029846064628465b4600f0f7850d2f40f0f78501f001f800f0f5bd4ff2a848c2f22908022a2cbf4d78ff25d8f8004020466ff39600b0f1005f07d120684ef66a63ccf2ff03984200f093804ff44d7016460f46fef73fff002800f0a18304464ff6cc40cff6ff700021324600bf2318293083f8341383f8351383f8361383f8371383f8381383f8391383f83a1383f83b1383f83c1383f83d1383f83e1383f83f1383f8401383f8411383f8421383f8431383f8441383f8451383f8461383f8471383f8481383f8491383f84a1383f84b1383f84c1383f84d1383f84e1383f84f1383f8501383f8511383f8521383f8531383f8541383f8551383f8561383f8571383f8581383f8591383f85a1383f85b1383f85c13aad14ef66a60ccf2ff002060012084f8ce004ff0ff303946a4f8e000a4f8e200a4f8e400a4f8e600a4f8e800a4f8ea00a4f8ec00a4f8ee00a4f8f000a4f8f200a4f8f400a4f8f600a4f8f800a4f8fa00a4f8fc00a4f8fe00c8f8004094f8080170b1d4f8040140b142f68d43c0f244030e46174698473a463146002084f808010123032a80f0098313e3b2f1010900f0868601f1010b0023002200bfa9eb03000428c0f026850beb0306b078f7781c1d40ea0727a9eb040087424ff0ff3000f26f861bf80330767843ea06233b44b3f5803f00f26586002f07eb040318bf01224b45dbd3002a00f05a868846fdf7acfe002800f0fe844ff2a847c2f229073c6820466ff39600b0f1005f07d120684ef66a61ccf2ff01884200f08d804ff44d70fef74efe002800f0ed8504464ff6cc40cff6ff7000212218293082f8341382f8351382f8361382f8371382f8381382f8391382f83a1382f83b1382f83c1382f83d1382f83e1382f83f1382f8401382f8411382f8421382f8431382f8441382f8451382f8461382f8471382f8481382f8491382f84a1382f84b1382f84c1382f84d1382f84e1382f84f1382f8501382f8511382f8521382f8531382f8541382f8551382f8561382f8571382f8581382f8591382f85a1382f85b1382f85c13aad14ef66a60ccf2ff002060012084f8ce004ff0ff30a4f8e000a4f8e200a4f8e400a4f8e600a4f8e800a4f8ea00a4f8ec00a4f8ee00a4f8f000a4f8f200a4f8f400a4f8f600a4f8f800a4f8fa00a4f8fc00a4f8fe003c60d4f8300200286fd14ff48030f9f705fc002800f0538400210022831881544032b2f5803f59709970d970197159719971d971197259729972d972197359739973d973197459749974d974197559759975d975197659769976d976197759779977d97783f8201083f8211083f8221083f8231083f8241083f8251083f8261083f8271083f8281083f8291083f82a1083f82b1083f82c1083f82d1083f82e1083f82f1083f8301083f8311083f8321083f8331083f8341083f8351083f8361083f8371083f8381083f8391083f83a1083f83b1083f83c1083f83d1083f83e1083f83f109ad1c4f830020021cdf80c8006e007eb0a0149454ff0000080f036850beb01039878da7801f1040a50ea0227efd012025b7802441bf80160013a1d02032a00f0030e04a8e0c001d2002223e00398a7eb0e030844a91900228618d4f830c296f805800ceb010707f80280d4f83072b5790f4417447d70d4f83072f5790f441744bd70d4f83072367a0f44174404329342fe70e1d1069fdde90465bef1000fb6d0d4f830120beb0a00835c31442944bef1010f8b54abd0d4f83032511c10f801c033442b44bef1020f03f801c09fd0911cd4f83022405c32442a44505497e7022ac0f07b834ff2a844c2f22904206803466ff39603b3f1005f07d103684ef66a67ccf2ff07bb4200f091804ff44d7015460e46fef7c9fc002800f0a0824ff6cc41cff6ff71002200bf4318293183f8342383f8352383f8362383f8372383f8382383f8392383f83a2383f83b2383f83c2383f83d2383f83e2383f83f2383f8402383f8412383f8422383f8432383f8442383f8452383f8462383f8472383f8482383f8492383f84a2383f84b2383f84c2383f84d2383f84e2383f84f2383f8502383f8512383f8522383f8532383f8542383f8552383f8562383f8572383f8582383f8592383f85a2383f85b2383f85c23aad14ef66a61ccf2ff010160012180f8ce104ff0ff31a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe1031462a4620604c78002c00f01782022c00f2d08240f0fb83062ac0f0cb828a78cb780f794e7942ea032147ea062232290791089280f0e5833221e7e3022a4ff0ff3008bf112e40f00c844878002840f0b1824cf6dd70c0f24500804701284ff0000040f0fe8309900446089040f20830c0f2100007904ef6a970c0f247008047002800f0188347f2a620c2f207000188c8b2642800f29a83b1f5807f4ff0070138bf032194e3092f00f08a80082f40f012810746002b4ff0ff3000f0d2834af28973cff6fd73d61802339e42c0f0c98391f801803846b8f1000f00f075820226b71c974200f266828b198e5d5b7856ea032300f05f82de19964200f25b82cc5d04f07f0cacf1100515f1030f0ad804f07b05092d06d0bcf1030f03d0bcf1060f40f0488214460d4639441a4600230746cdf800b0fff777fa002840f03b82b8f10108294622463846cad13de20023c8f80030002439463246032a0bd355b98878082800f27d8346f67561c0f251019631884775e3052a1ad3012d18d18d78681e06284ff0000000f26c83cb78032b00f268830a79002a00f0648346f67560c0f2510000f59a7728461946b84758e3022d40f0598146f67560c0f2510080474fe337064ff0210658bf1126b242c0f0f281002f01f101050ed54cf6dd72c0f245020f4604461e469047334601462046022918bf07f1110584462879697950ea01264ff0ff301ebfa979ea7951ea022900f02883297b6a7b41ea02218e4240f02183a97bea7b41ea0221894540f01a832878697840ea01217018b0f5207f4ff0ff3000f20f83aa78ec7842ea042209eb0204b4f5f07f00f205832c7a6f7a44ea072806eb0807b7f5207f00f2fb82af7aed7a47ea052509eb0507b7f5f07f00f2f182dcf80800002800f09581bcf84070bcf842406743b7f5163fc0f08c819a4643466446cde90169009502f05df8dbf800000f280ad80bebc0010130a1f806800d814e81a1f80c90cbf80000baf1000f00f0c782204678e1fd1e18bf0125bc1f18bf0124032afff4a6a925407ff4a3a900254c1ca2f1010c8df81c508df81d508df820508df824508df825508df826508df827508df828508df829508df82a508df82b508df82c508df82d508df82e508df82f508df830508df831508df832508df833508df834508df835508df836508df837508df838508df839508df83a508df83b508df848508df849508df84a508df84b508df84c508df84d508df84e508df84f508df850508df851508df852508df85350cde9074c49f26914cff6ff747c440f9449f2a914cff6ff747c44032f1094119500f00d81062f40f0fc800646002000211d4602f0d9f9b168002900f0f280b6f84020b6f842005043b0f5163fc0f0e98007a84ff4a0724ff4f07302f0e5fa002800f0df80dbf800000f280dd80bebc0010022ca800a814ff420724a814ff4f07201308a81cbf80000002d304640f0d3801de2012083f8ce0019e283f8ce0015b0bde8f08f00202060bbe0002480f807424cf6dd70c0f24500804701462046012940f006824df25f50c0f2550015b0bde8f04f0047072a33d3032d31d18878cb780a7940ea03204d798e7901284ff0010498bf204644f62061884228bf084646f67561c0f25101642a28bf642201f5e2731146984746f2a070c2f207000068002800f0d58145ea0621012988bf0c4642f68d41c0f24401a1f1400221469047c6e1032a4ff00000c0f0c3812f1fb7fa87f77f093b4000f0bc81d01e4cf6cd42ccf6cc428b78a0fb0202b3eb920f88bf9308302b184628bf3020002b00f0cf8100eb800303f0030c03f4fe770023ce18f578e21882f80a513579043382f80b5175799f4282f80c51b67982f80d61eed1bcf1000f10d01944ca782344bcf1010f83f80a2108d00a79bcf1020f83f80b211cbf497983f80c1184f80801d4f8040142f68d45c0f24405002184f8091170b948f6df70cff6ff70a5f59477784422460023b8470028c4f8040100f08e81a5f14002012190475be100f07dfd01e001f0b6f920b14ff0ff3015b0bde8f08fb8f1000f00f04d813046594601f0f4fd47e1370600f14981082aecd306464ff0070e4ff0050c0127cc1994f802804ff0ff30b8f1000f00f03581e578002d00f0318111f807a04fea880909eb8a07b7f5207f00f2278167786c00cde9043e0696164604eb4702b2f5f07f00f21b8101eb0c00039111f80c10407841ea002081b2012002f09bf8002840f00b81069988680028b0d0b1f84020b1f842105143b1f5163fa8d30399059b4fea480219440791f11a089107eb870100ebc11000eb4a0107a8234602f09af9002894d0dbf800000f280cd84fea8a017a000bebc0030130d9801a81a3f80a909c81cbf8000004980028069889d1d4e0ff20214689e090f86d12002918bffef717fc94f80702002684f8076258b14cf6dd70c0f245008047012804d14df25f50c0f255008047d4f8000294f80652c4f8fc6184f80662a4f8046250b1c047d4f8000208f166018847002804bf0020c4f8000200200121002d6060a060e06020616061a061e06120626062a062e06220636063a063e06320646064a064e06420656065a065e06520666066a066e06620676067a067e067c4f88000c4f88400c4f88800c4f88c00c4f89000c4f89400c4f89800c4f89c00c4f8a000c4f8a400c4f8a800c4f8ac00c4f8b000c4f8b400c4f8b800c4f8bc00c4f8c000c4f8c40084f8ce105bd04af29f37c0f2460701200021002200230024b847204615b0bde8f08f00203860f3e6ff20012140f2d262c5f2052208924ff4a1724df60f17adf824208df826108df8270007aac0f24707012009210c23b84715b0bde8f08fb1f5fa6f02d94ff4fa6107910121054680f807124cf6dd70c0f24500804701281dd14df25f56c0f25506a6f188008047022c08bf002801d058b910e048f2d31207a9c0f24b020220904740b10446b0472046002185f8071215b0bde8f08f002015b0bde8f08f0c2afff4a3aecf78ce79b7427ff49eae814608790e46097a88427ff497ae4cf6dd70c0f245009846144680470527022808bf01274ff00b0e4ff0090c314622464e4643469be60020a4f8080115b0bde8f08f46f675600025c0f2510084f808518047284615b0bde8f08ff0b583b04ff2a843c2f229031f683b466ff39603b3f1005f09d13b684ef66a66ccf2ff06b34204bf002387f82a32002958d0362a56d30b78422b53d14b784d2b50d10b7f4f7f43ea0723042b4ad18b7dcf7d0e7e43ea072343ea06434f7e8e7ccd7c53ea076346ea05270e7d4d7d47ea064747ea05641d4648bf5d42b0f84070002b4ff00003c8bf0123bc422ad1b0f84270bd4226d18f7ace7a91f80cc047ea06274e7b47ea0c4747ea0667974219d2621c032606eb5202866822f0030cca19cde901c30746304621462346009502f053fa3846314622462b4602f0e7fa002003b0f0bd4ef2bb33c0f24e0303b0bde8f0401847072a1cbf4ff0ff3070472de9f04f8db00f4683461d46fcf795ff002800f02f834ff2a846c2f22906306801466ff39601b1f1005f07d101684ef66a62ccf2ff02914200f08d804ff44d70fdf737ff002800f013834ff6cc41cff6ff71002200bf4318293183f8342383f8352383f8362383f8372383f8382383f8392383f83a2383f83b2383f83c2383f83d2383f83e2383f83f2383f8402383f8412383f8422383f8432383f8442383f8452383f8462383f8472383f8482383f8492383f84a2383f84b2383f84c2383f84d2383f84e2383f84f2383f8502383f8512383f8522383f8532383f8542383f8552383f8562383f8572383f8582383f8592383f85a2383f85b2383f85c23aad14ef66a61ccf2ff010160012180f8ce104ff0ff31a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe10306039787a7841ea022a4ff6ff718a454ff0ff3200f08982d0f830121046002900f0808211f80a304ff0ff30002b00f0798251444a78002a00f0748202fb03f001f1020c4ff000064ff000010195009278b34ff6fe794ff6fd7801eb0a054d4500f05e828e4661440a78140903d00125a0421ad254e2454500f052824c781cb10225a04211d24be24ff6fb72aa1a042ac0f046828a78c97852ea012400f040820425a042c0f03c8200bf001b05eb0e01d3d10691b878f9783a797d79bf7940ea0129b8060f2142ea052507f00f0201eae07000fb02f189204143c90a8df824100e2117f0200f08bf0f2608bf012102fb01f100fb01f14fead1218df825104ff00d0108bf022102fb01f100fb01f14fead1218df826104ff00c0108bf032102fb01f100fb01f14fead1218df827104ff00b0108bf042102fb01f100fb01f14fead1218df828104ff00a0108bf052102fb01f100fb01f14fead1218df829104ff0090108bf062102fb01f100fb01f14fead1218df82a104ff0080108bf072102fb01f100fb01f14fead1218df82b104ff0070108bf082102fb01f100fb01f14fead1218df82c104ff0060108bf092102fb01f100fb01f14fead1218df82d104ff0050108bf0a2102fb01f100fb01f14fead1218df82e104ff0040108bf0b2102fb01f100fb01f14fead1218df82f104ff0030108bf0c2102fb01f100fb01f14fead1218df830104ff0020108bf0d2102fb01f100fb01f14fead1218df831104ff0010108bf0e2151434143c90a8df8321006fb02f1069a48434ff0010ec00a002a8df8330000f0758107f010008eea1010002604904ff00008cdf814c008e0dde90706069a0644ddf814c0964280f061811cf806000896040901d0012113e0971b012f00f056810ceb06014c780cb1022109e0042fc0f04d818a78c97852ea012400f047810421079110f00f0109a810f801a018bf012104984fea0a1e40ea010c14f00300474600f08080b8fbf3f100224f19b7f1ff3fc8bf012202ea0c02012a1dd101fb13814944ca09042a17d87a090e2a14d807eb87020beb82124f08d65dc9076ff00f01029608bf0f210390504608bf7046029e314001430398d155012808f1010751d0b7fbf3f100264a19b2f1ff3fc8bf012606ea0c06012e1ad101fb13714944ce09042e14d856090e2e11d802eb82020beb82124e08c9070390905d6ff00f01574604bf0f2177460140039839439155022808f1020726d0b7fbf3f100224e19b6f1ff3fc8bf012202ea0c02012a18d101fb13714944ca09042a12d872090e2a0fd806eb86020beb82124e08c907905d6ff00f01574604bf0f21774601403943915508f10307611e0329a04405d244e700bf0437b8453ff440afb7fbf3f600227119b1f1ff3fc8bf012202ea0c02012a19d106fb137202eb0906f209042a12d84a090e2a0fd801eb81010beb811172088c5cf6076ff00f06504604bf0f2670463440204388547e1cb6fbf3f200205119b1f1ff3fc8bf012000ea0c00012819d102fb136000eb0906f009042812d848090e280fd801eb81000beb80107108425cf4076ff00f04564604bf0f247646224032434254be1cb6fbf3f200205119b1f1ff3fc8bf012000ea0c00012819d102fb136000eb0906f009042812d848090e280fd801eb81000beb80107108425cf4076ff00f04564604bf0f247646224032434254fe1cb6fbf3f200205119b1f1ff3fc8bf012000ea0c0001287ff47aaf02fb136000eb0906f00904283ff672af48090e283ff66eaf01eb81000beb80107108425cf4076ff00f04564604bf0f2476462240324342545ce7002030604ff0ff300db0bde8f08f10460db0bde8f08f009909eb03002944b0f5207fa8bf4ff42070b1f5f07fa8bf4ff4f071019f484588bfa94203d800200db0bde8f08f3a680f2af8d8a0eb090007ebc203491b5881501ca3f806901d8199813860ebe700bf082a3cbf4ff0ff3070472de9f04f95b015460c4680469a46fcf724fc002800f0fa81e67906f1080085424ff0ff3040f0f4812178627841ea02254ff640718d4200f2eb814ff2a849c2f22909d9f80000a77901466ff39601b1f1005f07d101684ef66a62ccf2ff02914200f08e804ff44d70fdf7b3fb002800f0ca814ff6cc41cff6ff71002200bf4318293183f8342383f8352383f8362383f8372383f8382383f8392383f83a2383f83b2383f83c2383f83d2383f83e2383f83f2383f8402383f8412383f8422383f8432383f8442383f8452383f8462383f8472383f8482383f8492383f84a2383f84b2383f84c2383f84d2383f84e2383f84f2383f8502383f8512383f8522383f8532383f8542383f8552383f8562383f8572383f8582383f8592383f85a2383f85b2383f85c23aad14ef66a61ccf2ff010160012180f8ce104ff0ff31a0f8e010a0f8e210a0f8e410a0f8e610a0f8e810a0f8ea10a0f8ec10a0f8ee10a0f8f010a0f8f210a0f8f410a0f8f610a0f8f810a0f8fa10a0f8fc10a0f8fe10c9f80000d0f830e2bef1000f00f04081a178ba061091e1780f230d91217903eae2720e9107f00f014a434ff0890c02fb0cf2d20a8df844200e2294f805900b9717f0200f08bf012201fb02f202fb0cf24fead2228df845204ff00d0208bf022201fb02f202fb0cf24fead2228df846204ff00c0208bf032201fb02f202fb0cf24fead2228df847204ff00b0208bf042201fb02f202fb0cf24fead2228df848204ff00a0208bf052201fb02f202fb0cf24fead2228df849204ff0090208bf062201fb02f202fb0cf24fead2228df84a204ff0080208bf072201fb02f202fb0cf24fead2228df84b204ff0070208bf082201fb02f202fb0cf24fead2228df84c204ff0060208bf092201fb02f202fb0cf24fead2228df84d204ff0050208bf0a2201fb02f202fb0cf24fead2228df84e204ff0040208bf0b2201fb02f202fb0cf24fead2228df84f204ff0030208bf0c2201fb02f202fb0cf24fead2228df850204ff0020208bf0d2201fb02f202fb0cf24fead2228df851204ff0010208bf0e2201fb02f202fb0cf24fead2228df852204ff0000208bf0f22514301fb0cf14ff0000bc90a002e0f968df8531000f09d820eeb05010c9110990d9a04f1080641ea02210d910e994ff6fd7241ea09210e914ff6ff714ff000094ff6fe7c57469246cdf8408088460a9704e00f9909f10109894552d016f809104a1e1f2af5d34ab2202a45db0c9a02eb410111f8402c11f83f1c42ea012747453ad01ef807104ff0ff3b002900f061820eeb07025378002b00f05b8202f1020b5943002200bfd319634525d00beb02052c78240903d00125a14216d21ce053451ad06c781cb10225a1420ed214e04ff6fb741b1b042b0fd3ab78ec7853ea04240ad00425a14207d300bf091b2a44dad1afe70020c9f800004ff0ff3015b0bde8f08f0a990122063101910b99002501f010014ff6ff774ff6fe7a82ea1111cde90616725d1f2a04d80d990f9c11440b3908e2d0f830124ff0ff3b002900f009820c9b03eb420212f8403c12f83f2c43ea0228b84500f0fd8111f808e0bef1000f00f0f78141444b78002b00f0f28103fb0ef7ddf834c0002fcde9023500f0ac818b1c002202eb08055545b5d09c182178090901d0012412e04ff6fd718d42abd0617809b102240ae04ff6fb71691a0429a2d3a178e47851ea04219dd004248f429ad37f1a2244ddd1002a00f0858100250027cde904230ae00b9d0999049a0d44079e059b95424ff6fe7a80f07581595d0b955fea111b01d0012215e0541b012c00f06a815a1992f801b0bbf1000f01d0022209e0042cc0f05f819478d27854ea022b00f059810422099211f00f0111aa12f8018018bf0121069a0e9e42ea010a4fea08191bf003013a4600f09280b7fbfef4cdf820b004fb1e724ff0000b6244b2f1ff3fc8bf4ff0010b0aea0b05012d1cd1a4191ad4d509042d17d865090e2d14d80b46109904eb840401eb84145508d207194614f805b06ff00f02434604bf0f224b4602ea0b021a436255ddf820b0012907f101025cd0b2fbfef4002504fb1e226244b2f1ff3fc8bf012505ea0a05012d1ed1a4191cd4d509042d19d865090e2d16d80b46109904eb840401eb841b5508d20719461bf805306ff00f02444604bf0f224c461a4022430bf80520ddf820b0022907f102022bd0b2fbfef4002504fb1e226244b2f1ff3fc8bf012505ea0a05012d1cd1a4191ad4d509042d17d865090e2d14d8109904eb840401eb841b5508d2071bf805306ff00f02444604bf0f224c461a4022430bf80520ddf820b0fa1cabf10104032c5f4405d22ce704325f4693453ff428afb2fbfef4002304fb1e25bb466544b5f1ff3fc8bf012303ea0a03012b18d1a41916d4eb09042b13d863090e2b10d8109904eb840301eb83136c08195ded076ff00f05474604bf0f254f46294039431955511cb1fbfef404fb1e1101eb0c050021b5f1ff3fc8bf012101ea0a01012918d1a41916d4e909042913d861090e2910d8109b04eb840103eb81116b08cc5ced076ff00f05474604bf0f254f462c403c43cc54911cb1fbfef404fb1e1101eb0c050021b5f1ff3fc8bf012101ea0a01012918d1a41916d4e909042913d861090e2910d8109b04eb840103eb81116b08cc5ced076ff00f05474604bf0f254f462c403c43cc54d11cb1fbfef404fb1e1101eb0c050021b5f1ff3fc8bf012101ea0a0101297ff470afa4193ff56dafe90904293ff669af61090e293ff665af109b04eb840103eb81116b08cc5ced076ff00f05474604bf0f254f462c403c43cc5452e70e9d029a0ceb0e01ab18b1f5207f0f462ceaec72a8bf4ff42077b3f5f07fa8bf4ff4f07397421ddd0f9cab421bd9ddf82880d8f800500f2d15d8ddf838e0a7eb0209019fa3eb0e0c07ebc50327f835206a1ca3f802e0a3f80490a3f806c0c8f8002000e00f9c039d4ff6ff7701354ff0000ba5420d917ff4e8ad584615b0bde8f08f062a3cbf4ff0ff3070472de9f04fadf2944d9a46154688460f90fbf7e7ff002800f0d68098f80510881d854240f0298446f6ac10c2f20700d0f800b0bbf1000f00f01f849bf80c009bf80d209bf80e309bf80f7040ea022040ea034040ea0769a9f1810010f1800f4ff0ff30c0f0b2809bf810209bf811309bf8137042ea03229bf8123042ea034242ea07620692813a12f5817f40f29e800029cdf828b000f09d8008f1060b002426aa4ff4e01c00270ae000bf05f1004042f8240001378f4204f1010480f08e801bf80750681e1e28f0d968b21f2801dd012075e0a5f1c2000beb07061d28a1eb07000fd8012800f0c88396f9010010f1410f00f3c28300f03f0365f38a1302201d465de005f0f003e02b24d10328c0f0b48396f9013013f1410f00f3ae8396f9020010f1410f00f3a883e02ddeb202d1a02ec0f0a283ed2d02d19f2e00f29d832b039bb206f03f0643ea861300f03f001d18032034e004284ff0ff3036d3a5f1f50313f1050f31d396f9013013f1410f2cdc96f9020010f1410f00f37e8396f9036016f1410f00f37883f02ddbb202d1902bc0f07283f42d02d18f2b00f26d830cea854e03f03f054eea053300f03f0043ea801006f03f0326aac518042000bf074442f8245076e74ff0ff300df2944dbde8f08f0021012007915ee0002c57d0a4f1010bcdf86090cdf810a000250df1780a5f46914608e026aaab4505f1010509f10409a7f1010739d052f825100029f3d400202b4687421dd009eb80067268b2f1ff3f18dc5a1c934514d0b268b2f1ff3f11dc9a1c93450dd0f268b2f1ff3f0adcda1c934506d032690433002a00f10400e0d400e000220a9853461aae009601f02cfa002800f008831a980028c3d046f2a1415046c0f24e018847bce7ddf810a0ddf828b0ddf860900020079404e00020ddf828b00790012098f804400f21a20604f00f0501eae271694389225143c90a8df8681001260e2198f800c098f801e098f8023098f8037014f0200f08bf0e2608bf012105fb01f102fb01f14fead1218df869104ff00d0108bf022105fb01f102fb01f14fead1218df86a104ff00c0108bf032105fb01f102fb01f14fead1218df86b104ff00b0108bf042105fb01f102fb01f14fead1218df86c104ff00a0108bf052105fb01f102fb01f14fead1218df86d104ff0090108bf062105fb01f102fb01f14fead1218df86e104ff0080108bf072105fb01f102fb01f14fead1218df86f104ff0070108bf082105fb01f102fb01f14fead1218df870104ff0060108bf092105fb01f102fb01f14fead1218df871104ff0050108bf0a2105fb01f102fb01f14fead1218df872104ff0040108bf0b2105fb01f102fb01f14fead1218df873104ff0030108bf0c2105fb01f102fb01f14fead1218df874104ff0020108bf0d2105fb01f102fb01f14fead1218df8751006fb05f102fb01f14fead1218df876104ff0000108bf0f2169435143c90a00284ff000008df877107ff4cdae43ea0720079a484403904cea0e290af10600571e00260df198080190cdf810a0029718e000bf46f2a1411ea8c0f24e0188479df87c009df87d10dde90ab9029fdde9072640ea01200df1980801369642814400f0ff8158f82610b1f1ff3f1edd33469f421fd008eb83004268b2f1ff3f1adc0133bb4216d08268b2f1ff3f13dc0133bb420fd0c268b2f1ff3f0cdc0133bb4208d002690133002ae2d404e001f01f000b38d2e7002258461eab19ad009501f0ebf8002800f0c781199900290d9100f0ba819df880209df881309df87e009df87f1052ea03259df8822040ea01279df8833010979df884704fea024208969df8856042ea0362069b4fea074747ea06672b4403eb2743039fcdf82c90a7eb030609eb22491aaf149500f05e810902109b014400f0030809f101004ff0010c099009f102000ceb530305900d980c934b1e0e930b9b0130121415900ceb510003eb020e9a1acde91180a1eb08001890d0074ff0000a17904feace70169013960ae014980af1010a824512981599139e0144159100f029810aeb06014b090e2befd810980028ecd00e9801eb810103280f984ff0000600eb811e80f0848011980028ded0dde90c105feac67c0afb01084fea560018f8000000f00f03c1b208bf0b09b3fa83f0400910ea141f14d106eb0901c80904280fd848081ef80020fb5c02f00f0b02f0f0021a431aafc90708bf4bea03120ef8002011980128b1d0701c400818f80000bcf1000fc1b24fea111308bf00f00f03d8b2b0fa80f0400910ea141f14d109983118c80904280fd848081ef80020fb5c02f00f0b02f0f0021a431aafc90708bf4bea03120ef80020119802283ff486afb01c400818f80000bcf1000f00f00f01c2b208bf1109b1fa81f0400910ea141f7ff474af05983318d80904283ff66eaf58081ef80020795c02f00f0602f0f0020a43db0708bf46ea01120ef800205de7ddf8548007e000bf18980436b04208f102083ff471af18f8011c0023c9b2102938bf012313ea141f09eb060c16d14feadc13042b12d84fea5c0309091ef80320795c02f00f0b02f0f0020a431aaf5feac97008bf4bea01120ef8032018f8010c00f00f01b1fa81f0400910ea141f15d10cf10103d809042810d858081ef80020795c02f00f03179d43ea011302f0f002002d08bf42ea01030ef8003098f80000c1b210294ff0000038bf012010ea141f15d10cf10203d809042810d8080959081ef80120385c02f00f0302f0f002169d0243002d08bf43ea00120ef8012098f8000000f00f01b1fa81f0400910ea141f8ad10cf10303d80904283ff685af58081ef80020795c02f00f03179d43ea011302f0f002002d08bf42ea01030ef8003072e700bf109809eb00011498b1f5207f06eb000229eae970a8bf4ff42071b2f5f07fa8bf4ff4f072ddf810a081427ff70fae26eae6739a427ff70aaedaf800700f2f3ff605ae019dd21a091a05ebc70625f83700781c7380b180f280caf80000f6e59df87c009df87d10079a40ea012001e64ff0ff300df2944dbde8f08f00200df2944dbde8f08f2de9f04182b04ff2a847c2f229073d68884629466ff39601b1f1005f064607d128684ef66a61ccf2ff01884200f08e804ff44d70fcf74afb0546002800f085804ff6cc40cff6ff70002100bf2a18293082f8341382f8351382f8361382f8371382f8381382f8391382f83a1382f83b1382f83c1382f83d1382f83e1382f83f1382f8401382f8411382f8421382f8431382f8441382f8451382f8461382f8471382f8481382f8491382f84a1382f84b1382f84c1382f84d1382f84e1382f84f1382f8501382f8511382f8521382f8531382f8541382f8551382f8561382f8571382f8581382f8591382f85a1382f85b1382f85c13aad14ef66a60ccf2ff002860012085f8ce004ff0ff30a5f8e000a5f8e200a5f8e400a5f8e600a5f8e800a5f8ea00a5f8ec00a5f8ee00a5f8f000a5f8f200a5f8f400a5f8f600a5f8f800a5f8fa00a5f8fc00a5f8fe003d60b068002818bf002d02d102b0bde8f081b6f84010b6f842205143b1f5163ff4d3c5f8240201264ff4f07085f8286201904ff4207049f683540090c0f2470400200021002200230027a04730b185f82872c5f8247202b0bde8f08188f8046002b0bde8f0812de9f04f8ab0dde914a5089243ea010242ea0a02d207864640f0c4800eeb51004ff0ff374fea5a0c0eeb53068646012207eb5a00bcf1010f88bf4fea5a02069002f003000790caf341006ff00107059007eb5a006ff00207019007eb5a00009022f00302701c544203900ef101004ff0000b09960290cdf810e004e00bf1010bab4500f0c3810898139e5f466fea0b02864288bfaf183a183744099802eb820207eb87070eeb82198b4200eb871835d9059e6246b6b10698012e19f8002008f8002002460ed00198022e19f8002008f80020024606d0009819f8002008f80020024600bf06980328c8d300bf09eb020717f8016c08eb020000f8016c17f8026c043a00f8026c17f8036c00f8036c17f8047c00f8047ce9d1b0e700bfbaf1080f02d2002223e000bf03989601ba0102440298e64600eb060a6ff0030c0aeb0c00c67802eb0c07fe7006790cf1040c3e7146797e71807904eb0c060436b871edd10cf10402dde914a5f446ddf810e0079800283ff483af079e19f80200012e08f802003ff47baf501c079e19f80070022e08f800703ff472af901c19f8002008f800206be74ff6fc7000ea0a000af0030b0990aaf1010000240490cde905be07e0079c159d0134ddf850a0ac4200f01e81089f139ee0432246be42079488bf2a18d01900eb80000eeb801c901900eb8000baf1040f0eeb80184ff00009c0f09880ddf810a0ddf850e048468b4288bf504600eb010400eb03054fea54001cf800706ff0010080ea090009f1010288bf0eeb00026ff0020089ea000609f1020088bf0eeb06006ff0030686ea090609f1030b4feac47488bf0eeb060b07f00f06002c4fea550408bf3e0918f80470ed0707f00f0507f0f007374408bf45ea061708f80470541865081cf805501a44e40705f00f064fea520408bf2e0918f80450d20705f00f0205f0f005354408bf42ea0615421808f8045054081cf804401844d20704f00f054fea500208bf250918f80240c00704f00f0004f0f0042c4408bf40ea05140beb010008f8024042081cf802200beb0304c00702f00f054fea540008bf150918f80020e40702f00f0402f0f0022a4408bf44ea051208f80020099809f104098145aaf1040a7ff46eafdde905bebbf1000f3ff444af6fea09004a468b42149f88bf3a18501845081a44c0071cf805504fea520018f8007005f00f0408bf2c0907f00f0507f0f0072744d20708bf45ea0417bbf1010f08f800703ff420af149809f10102a0eb090a8b4288bfaaf10202541865081a44e4071cf805504fea520418f8040005f00f0708bf2f0900f00f0500f0f0003844d20708bf45ea0710bbf1020f08f804003ff4faae09f102008b4288bfaaf10300421854081844d2071cf804704fea500218f8024007f00f0508bf3d0904f00f0704f0f0042c44c00708bf47ea051408f80240d9e60ab0bde8f08f00bf70b54ff2a846c2f2290632680c4611466ff39601b1f1005f054607d110684ef66a61ccf2ff01884200f08e804ff44d70fcf76af8002800f0d18002464ff6cc40cff6ff70002100bf1318293083f8341383f8351383f8361383f8371383f8381383f8391383f83a1383f83b1383f83c1383f83d1383f83e1383f83f1383f8401383f8411383f8421383f8431383f8441383f8451383f8461383f8471383f8481383f8491383f84a1383f84b1383f84c1383f84d1383f84e1383f84f1383f8501383f8511383f8521383f8531383f8541383f8551383f8561383f8571383f8581383f8591383f85a1383f85b1383f85c13aad14ef66a60ccf2ff001060012082f8ce004ff0ff30a2f8e000a2f8e200a2f8e400a2f8e600a2f8e800a2f8ea00a2f8ec00a2f8ee00a2f8f000a2f8f200a2f8f400a2f8f600a2f8f800a2f8fa00a2f8fc00a2f8fe0032600120002d82f8cc0047d0104630f8e01fa1423bd0b2f8e210a14237d0b2f8e410a14233d0b2f8e610a1422fd0b2f8e810a1422bd0b2f8ea10a14227d0b2f8ec10a14223d0b2f8ee10a1421fd0b2f8f010a1421bd0b2f8f210a14217d0b2f8f410a14213d0b2f8f610a1420fd0b2f8f810a1420bd0b2f8fa10a14207d0b2f8fc10a14203d0b2f8fe10a1420ad1012082f8de0070bd0020306070bd82f8cd00002070bd92f8cd1081b9b2f8c810611a0bb2b3f1ff3f06dd89b2022924bf012182f8dd1002e0012182f8dc10b2f8ca30002182f8cd109c42a2f8c84088bfa2f8ca4092f8001120f81140481c00f00f0082f80001002070bd00bf2de9f04fcdb046f22b149246c0f25d0447f2f85298460e4604f13c07c0f27b020f2138230546b84718b12846a047002423e20afb08f040000b960295059001250da94ff4807004f585724ff0000b4ff0000947464ff000080023564604930a930697cdf820a00192029ce1602061204600219047e1680daa891a07910da900f0e681ddf82ce00021002400900be000bf04940c9c002101234ff0030807980134844200f0d181002940f0e0810da80c94045db8f1020febd0b8f1010f00f09280b8f1000f40f0968004f00f000a900598210900f0a6808842c0f08880401a05900a9800eb00140001039014e01cf80b000a9a00f0f00010440cf80b000bf1010b01390125b34524bf4ff0000b09f10109002900f08c81b9454ff000084ff0000338bf012380f0028109eb8900002d0eeb801cdbd0cdf82490a946a6eb0b05b5eb510f88bf4d088db3a8080ceb0b0820d0002708f10102a7eb80006ff0030600bf02eb060e043600eb060a1af104078ef803408ef804408ef805408ef80640efd1301d069f089eddf82ce015f0030204d10ce0002015f0030208d0012a08f8004004d04044022a447018bf8470a1eb4501ab4489b1b34510d21cf80b00039a00f00f001043ddf824900cf80b00013900250029a0d12be100bf00214d46ddf8249090e700bfbcb10598a04228d201214ff0000821e0ddf810a005985aea042a16d00c9c5045cdf810a080f0938001214ff00008002342e70c9c002101234ff002083ce70c9c00214ff00108012336e7002001214ff0000804900c9c00232ee7001b05900a9800eb00110001099015e000bf1af80b200a9802f0f00202430af80b200bf1010b013c0125b34524bf4ff0000b09f10109002c00f0da80b9454ff000084ff0000338bf012350d209eb8902002d0eeb821adcd0ac46a6eb0b05b5eb540f88bf650855b3ae080aeb0b0818d0002008f10102a0eb860e6ff00306901904360eeb06070437c170017141718171f5d1069fddf82ce0321d15f0030604d10de0002215f0030609d0012e08f8021005d04244022e517018bf917000bfa4eb4504ab447cb1089eb3450ed21af80b00099a00f00f0010430af80b00013c0025002cabd184e0089e002465469de70c9c0121b4e6a0eb0a0005900a9800eb00110001099015e01cf80b000a9a00f0f00010430cf80b000bf1010baaf1010a0125b34524bf4ff0000b09f10109baf1000f65d0b9454ff000084ff0000338bf01235bd20b9a09eb8900002d02eb801cdad0ce46a946a6eb0b05b5eb5a0f88bf4fea5a0545b3a8080ceb0b0817d0002408f10102a4eb80006ff003069719043684190434f97039717971b971f6d1301d069f089e0c9c15f0030204d10ce0002015f0030208d0012a08f8001004d04044022a417018bf8170aaeb450abaf1000fab4411d0b34511d21cf80b00099a00f00f0010430cf80b00aaf1010a0025f146baf1000fa6d10be04ff0000a4d46f14697e70c9c4ff00008002131e6012102e04ff000080021ddf82ce029e600980da973b1012817d04ff0000450b90798019ab0fa80f040094ff480703ff4ffad00e00024029846f22b11c0f25d01884720464db0bde8f08f059840ea0800b0fa80f04409eee72de9f04f83b00c9e0292002e019000f08e80019823f00304471c029803f0030ac4f1000c01384ff00008009005e000bf08f10108b0450f4479d00e98c14600286fea080418bf06eb0409002bf0d0042b06d24ff0000bbaf1000f2ed1e8e700bf0d98b64609fb00f400986ff003050444607800f0f00242ea10107a19d0706078043500f00f0646ea0010107114f8020f00f0f00646ea10105071207800f00f0646ea00100ceb050604369071e0d105f1040b7646baf1000fbad002980d9a4fea5b0509fb0204019814f805e008fb01050ef00f025feacb7908bf4fea1e1242ea0212baf1010f05f80b20a1d00bf1010e4fea5e00205cb9f1000f4fea101208bf00f00f0242ea0210baf1020f05f80e008ed00bf102004208a25cb9f1000f02f00f0408bf140944ea04122a5480e703b0bde8f08f2de9f04182b003fb02f68846cde900164cf6036107466846c0f247011c461546884740f2196047f8240f788946f2c10245ea0040b86045ea044057f8204c7860c0f24a0220463946fe60c7f81080904740f69b51c0f244012046884702b0bde8f08100bf2de9f04188b046f24f461c46c0f24e0613460a46ddf83880002706f1ae05214627706770a770e77027716771a771e77127726772a772e77227736773a773e77327746774a774e77427756775a775e77527766776a776e77627776777a777e777a8470028c8f800705cd020786178a278e3780843104318434ff0010008d0e179a27911431ebf617a227a51ea020102d108b0bde8f081a07b14284ff00000f7d1217d8df8040041f0010121758df805008df806008df807008df808008df809008df80a008df80b008df80c008df80d008df80e008df80f008df810008df811008df812008df813008df814008df815008df816008df817008df818008df819008df81a008df81b008df81c008df81d008df81e008df81f0001a92046b047c8f8000018b1012008b0bde8f08106f1520120468847d8f80000002818bf012008b0bde8f08170b50446d0f8000242f665360d46c0f2440668b94af63100cff6ff707844002122460023b0470028c4f8000208bf70bd06f594718847d4f8000206f1e8022946bde870401047000008031000000000000000000000000000000000000000000000002020202020002020000000505050000000000000000000005050f85050f85050000000002070a8a07028a8702000000048a85010202854480000000020505020689090680000002020200000000000000000000010204040404020100000000040201010101020400000000000005020f82050000000000000002020f82020000000000000000000000020204000000000000000f800000000000000000000000000202000000000080810102020404000000000708898a8c88888700000000020602020202020700000000070888808102040f8000000007088083008088870000000000818284888f8080800000000f88080f00808887000000000708080f08888887000000000f808081010202020000000007088887088888870000000007088888878080870000000000000202000002020000000000000202000002020400000000008102040201008000000000000f80000f8000000000000004020100810204000000000708888102000202000000000708898a8a89880780000000070888888f888888800000000f08888f0888888f000000000708880808080887000000000e0908888888890e000000000f88080f0808080f800000000f88080f0808080800000000070888080b888887000000000888888f888888888000000007020202020202070000000003810101010909060000000008890a0c0c0a090880000000080808080808080f80000000088d8a8a888888888000000008888c8a89888888800000000708888888888887000000000f0888888f080808000000000708888888888a87008000000f0888888f0a0908800000000708880700808887000000000f8202020202020200000000088888888888888700000000088888850505020200000000088888888a8a8d88800000000888850202050888800000000888850502020202000000000f8081020408080f8000000007040404040404070000000004040202010100808000000007010101010101070000000205088000000000000000000000000000000000000f80040200000000000000000000000000000700878888878000000008080f088888888f00000000000007088808088700000000008087888888888780000000000007088f8808078000000001820702020202020000000000000788888888878087000008080f08888888888000000202000602020202070000000080800180808080808483000004040485060605048000000006020202020202070000000000000f0a8a8a8a8a8000000000000f08888888888000000000000708888888870000000000000f088888888f0808000000000788888888878080800000000b8c0808080800000000000007880700808f00000000020207020202020180000000000008888888888780000000000008888505020200000000000008888a8a8a870000000000000885020205088000000000000888888888878087000000000f810204080f800000000182020402020201800000000202020202020202000000000601010081010106000000048a8900000000000000000", "desc": "append injected blobs to main-app payload" }, { "offset": 779114, "old": "846a3800", - "new": "e8103900", + "new": "680b3900", "desc": "main-app subheader payload size (ps)" }, { "offset": 152, "old": "046b3800", - "new": "68113900", + "new": "e80b3900", "desc": "main-app TOC entry size (ps + 128)" }, { "offset": 779234, "old": "846a3804", - "new": "e8103904", + "new": "680b3904", "desc": "main-app preamble length (low 24 bits)" }, { "offset": 779238, "old": "85c355a2", - "new": "642d8359", + "new": "d0ef3d77", "desc": "[5] ota/s200_firmware_ota.bin preamble crc32" }, { "offset": 156, "old": "ed292ee4", - "new": "2ecbc5ac", + "new": "dc9ffb3b", "desc": "[5] ota/s200_firmware_ota.bin component crc32c (TOC)" }, { "offset": 779118, "old": "ed292ee4", - "new": "2ecbc5ac", + "new": "dc9ffb3b", "desc": "[5] ota/s200_firmware_ota.bin component crc32c (subheader)" } ] diff --git a/app/g2/glance-host.ts b/app/g2/glance-host.ts new file mode 100644 index 00000000..7c84736b --- /dev/null +++ b/app/g2/glance-host.ts @@ -0,0 +1,278 @@ +/** + * Shows the Glanceboard while the shell sleeps. The board is not a window: + * it lives on its own full-screen opaque compositor surface above the shell + * (below only the lock screen), so it never composites with the sidebar, + * top bar, or the sleeping app's retained frame. The host owns that surface, + * the visibility state machine (glance-state.ts), its auto-hide timer, and + * the board's render loop; the controller feeds it sleep-time input and the + * wake barrier, and takes the compositor back to blank when the board hides. + */ +import { GrayImage, G2_LENS_HEIGHT, G2_LENS_WIDTH } from "../graphics/image"; +import { prepareFrameDraws } from "../graphics/glyph-wire"; +import { flattenPlanesWithDraws, planesFingerprint, type Plane } from "../graphics/plane"; +import * as frameTimings from "../native/frame-timings"; +import { type DisplayTarget } from "../native/preview-display"; +import { minWindowTop } from "../ui/shell/geometry"; +import { beginRenderPass, endRenderPass } from "../util/render-freshness"; +import { type GlanceBoardInstance, type GlanceboardProvider } from "../apps/app-definition"; +import { GLANCE_HIDDEN, glanceEventForGesture, reduceGlance, type GlanceEvent, type GlanceState } from "./glance-state"; + +export const GLANCE_SURFACE_ID = "glance"; +/** Above the shell (1) and every window (0); below the lock screen (1000). */ +export const GLANCE_SURFACE_Z_ORDER = 900; + +export type GlanceHostOptions = { + getDisplay: () => DisplayTarget | null; + getProvider: () => GlanceboardProvider | null; + /** Whether a board may show right now (connected or preview, not locked). */ + canShow: () => boolean; + /** + * The controller's wake barrier: restore the EvenHub session if it was + * suspended and unblank the compositor. Resolves once the frame is visible. + */ + ensureSessionActive: (frameId: number) => Promise; + /** + * The board hid on its own (timer or release) with the shell still + * asleep: the controller re-blanks and re-arms the screen-off power save. + */ + onHiddenWhileAsleep: () => void; + /** Visibility changed either way (phone mirror refresh). */ + onVisibilityChanged: () => void; + appendLog: (message: string) => void; +}; + +export class GlanceHost { + private state: GlanceState = GLANCE_HIDDEN; + private board: GlanceBoardInstance | null = null; + /** Whether the surface is currently visible on the compositor. */ + private shown = false; + private hideTimer: ReturnType | null = null; + private configuredFor: DisplayTarget | null = null; + /** Serializes show/hide against each other and against in-flight renders. */ + private queue: Promise = Promise.resolve(); + private rendering = false; + private renderPending = false; + private nextRenderWantsFreshData = false; + + constructor(private readonly options: GlanceHostOptions) {} + + isVisible(): boolean { + return this.state.visible; + } + + /** Whether sleep-time gestures should reach the board at all. */ + isEnabled(): boolean { + return this.options.getProvider()?.isEnabled() ?? false; + } + + /** + * The glance event a sleep-time gesture means under the board's settings, + * or null when the shell should see the input as usual: nothing while the + * board is disabled, no hold when "Show on long press" is off, no press + * from a head-tilt when "Show on head tilt" is off (it then wakes the + * regular UI). A release always passes so a hold in progress can end. + */ + eventForGesture(gesture: "head-tilt" | string): GlanceEvent | null { + const provider = this.options.getProvider(); + if (!provider?.isEnabled()) return null; + if (gesture === "long-press" && !provider.showOnLongPress()) return null; + if (gesture === "head-tilt" && !provider.showOnHeadTilt()) return null; + return glanceEventForGesture(gesture, this.isVisible()); + } + + /** + * Apply a glance event from sleep-time input. The frame is owned from here: + * a show submits it with the board's first frame, anything else finishes it. + */ + async handleEvent(event: GlanceEvent, frameId: number): Promise { + const before = this.state; + const timeoutMs = this.options.getProvider()?.tapTimeoutMs(); + this.state = reduceGlance(before, event, Date.now(), timeoutMs); + this.armHideTimer(); + if (this.state.visible === before.visible) { + frameTimings.finishFrame(frameId, this.state.visible ? "glanceboard stays up" : "glance event while hidden"); + return; + } + if (this.state.visible) { + await this.enqueue(() => this.show(frameId)); + } else { + frameTimings.finishFrame(frameId, "glanceboard hidden"); + await this.enqueue(() => this.hide(true)); + } + } + + /** + * Hide because the regular UI is waking (double-tap, a notification, ...): + * the shell's own wake path handles the compositor from here, so no re-blank. + */ + dismiss(): void { + if (!this.state.visible && !this.shown && !this.board) return; + this.state = GLANCE_HIDDEN; + this.armHideTimer(); + void this.enqueue(() => this.hide(false)); + } + + /** The display target went away (disconnect, preview teardown): forget everything. */ + reset(): void { + this.state = GLANCE_HIDDEN; + this.armHideTimer(); + this.board?.stop(); + this.board = null; + this.shown = false; + this.configuredFor = null; + this.renderPending = false; + } + + private enqueue(operation: () => Promise): Promise { + const run = this.queue.then(operation, operation).catch((error) => { + this.options.appendLog(`glanceboard operation failed: ${String(error)}`); + }); + this.queue = run; + return run; + } + + private armHideTimer(): void { + if (this.hideTimer !== null) clearTimeout(this.hideTimer); + this.hideTimer = null; + const hideAtMs = this.state.hideAtMs; + if (!this.state.visible || hideAtMs === null) return; + this.hideTimer = setTimeout(() => { + this.hideTimer = null; + void this.handleEvent({ type: "timeout" }, frameTimings.startFrame("glanceboard timeout")); + }, Math.max(0, hideAtMs - Date.now())); + } + + private async configureSurface(display: DisplayTarget): Promise { + await display.configureSurface(GLANCE_SURFACE_ID, { + x: 0, + y: 0, + width: G2_LENS_WIDTH, + height: G2_LENS_HEIGHT, + zOrder: GLANCE_SURFACE_Z_ORDER, + transparency: "opaque", + }); + await display.setSurfaceVisible(GLANCE_SURFACE_ID, false); + this.configuredFor = display; + } + + private async show(frameId: number): Promise { + if (!this.state.visible) { + // Hidden again before this ran (a quick release); nothing to do. + frameTimings.finishFrame(frameId, "glanceboard show superseded"); + return; + } + const display = this.options.getDisplay(); + const provider = this.options.getProvider(); + if (!display || !provider || !this.options.canShow()) { + this.state = GLANCE_HIDDEN; + this.armHideTimer(); + frameTimings.finishFrame(frameId, "glanceboard unavailable"); + return; + } + if (this.configuredFor !== display) await this.configureSurface(display); + if (!this.board) { + this.board = provider.createBoard(() => this.requestRender()); + this.board.start(); + } + // Submit the first frame and reveal the surface while the compositor is + // still blanked, so the unblank below composites the board on top of the + // sleeping UI in one step rather than flashing the app first. + await this.render(frameId); + await display.setSurfaceVisible(GLANCE_SURFACE_ID, true); + this.shown = true; + const ready = await this.options.ensureSessionActive(frameId); + if (!ready) this.options.appendLog("glanceboard: wake barrier did not complete"); + this.options.onVisibilityChanged(); + } + + private async hide(stillAsleep: boolean): Promise { + const wasShown = this.shown; + this.shown = false; + const display = this.options.getDisplay(); + if (wasShown && display && this.configuredFor === display) { + // Blank before revealing what is under the board: hiding the surface + // first recomposites the sleeping UI's retained frames and transmits + // them, a visible flash of the main UI before the screen goes dark. + // Blanked, the surface change composites to the same black frame. (The + // controller's screen-off path below blanks again, harmlessly.) + if (stillAsleep) { + await display.setScreenBlanked(true); + } + await display.setSurfaceVisible(GLANCE_SURFACE_ID, false); + } + this.board?.stop(); + this.board = null; + this.renderPending = false; + if (wasShown && stillAsleep) this.options.onHiddenWhileAsleep(); + if (wasShown) this.options.onVisibilityChanged(); + } + + private requestRender(): void { + if (!this.board) return; + if (this.rendering) { + this.renderPending = true; + return; + } + void this.enqueue(() => this.render(frameTimings.startFrame("render:glanceboard"))); + } + + /** Paint the board into a full-screen frame and submit it to the surface. */ + private async render(frameId: number): Promise { + const board = this.board; + const display = this.options.getDisplay(); + if (!board || !display || this.configuredFor !== display) { + frameTimings.finishFrame(frameId, "discarded: glanceboard not showing"); + return; + } + this.rendering = true; + try { + frameTimings.annotateFrame(frameId, "glanceboard"); + const wantFreshData = this.nextRenderWantsFreshData; + this.nextRenderWantsFreshData = false; + beginRenderPass(!wantFreshData); + const paintStartedAtMs = Date.now(); + const frame = frameTimings.span(frameId, "paint", () => + frameTimings.runWithFrame(frameId, () => { + const boardImage = board.paint(); + const full = new GrayImage(G2_LENS_WIDTH, G2_LENS_HEIGHT, 0); + // Centred horizontally in the panel, in the standard window band + // vertically (Display > Vertical position). + const x = Math.max(0, ((G2_LENS_WIDTH - boardImage.width) / 2) | 0); + const y = Math.max(0, Math.min(G2_LENS_HEIGHT - boardImage.height, minWindowTop())); + boardImage.composeInto(full, x, y); + return full; + }), + ); + const paintUsedStaleData = endRenderPass(); + const paintMs = Date.now() - paintStartedAtMs; + const planes: Plane[] = [{ image: frame, x: 0, y: 0 }]; + const fingerprint = frameTimings.span(frameId, "fingerprint", () => planesFingerprint(planes)); + const { image, draws } = frameTimings.span(frameId, "flatten", () => flattenPlanesWithDraws(planes)); + const buffer = frameTimings.span(frameId, "to8bpp", () => image.to8bppBuffer()); + const preparedDraws = frameTimings.span(frameId, "prepareFrameDraws", () => prepareFrameDraws(draws)); + await frameTimings.spanAsync(frameId, "submit", () => + display.submitSurfaceFrame( + GLANCE_SURFACE_ID, + buffer, + { x: 0, y: 0, width: image.width, height: image.height }, + fingerprint, + paintMs, + frameId, + preparedDraws, + ), + ); + if (paintUsedStaleData) { + // Same contract as the windows: a paint that used cached data (the + // notification icons) gets one follow-up with fresh data. + this.nextRenderWantsFreshData = true; + this.renderPending = true; + } + } finally { + this.rendering = false; + if (this.renderPending && this.board) { + this.renderPending = false; + this.requestRender(); + } + } + } +} diff --git a/app/g2/glance-state.ts b/app/g2/glance-state.ts new file mode 100644 index 00000000..8f606f36 --- /dev/null +++ b/app/g2/glance-state.ts @@ -0,0 +1,86 @@ +/** + * The Glanceboard's visibility rules, as a pure reducer so they can be tested + * without the display plumbing. The board is an alternate sleep-time display: + * while the shell is asleep a press (single tap, or a head-tilt wake) shows it + * for a short while, a hold (long-press) shows it until the press is released, + * and a double-tap dismisses it in favour of the regular UI. GlanceHost feeds + * these events in and applies the resulting visibility to the compositor. + * + * No NativeScript imports: this module is compiled and run under plain node + * by tests/glance-state.test.cjs. + */ + +/** Fallback press timeout when the host supplies none; each further press restarts it. */ +export const GLANCE_TIMEOUT_MS = 3000; + +export type GlanceState = { + visible: boolean; + /** A long-press is holding the board up; the timer does not run meanwhile. */ + holding: boolean; + /** When the board hides on its own (epoch ms), or null while held / hidden. */ + hideAtMs: number | null; +}; + +export type GlanceEvent = + /** Single tap or head-tilt wake: show, and (re)start the auto-hide timer. */ + | { type: "press" } + /** Long-press: show and keep showing until the release. */ + | { type: "hold" } + /** The long-press ended. */ + | { type: "release" } + /** The auto-hide timer fired. */ + | { type: "timeout" } + /** Double-tap (or any other wake of the regular UI): hide now. */ + | { type: "dismiss" }; + +export const GLANCE_HIDDEN: GlanceState = Object.freeze({ visible: false, holding: false, hideAtMs: null }); + +export function reduceGlance( + state: GlanceState, + event: GlanceEvent, + nowMs: number, + timeoutMs: number = GLANCE_TIMEOUT_MS, +): GlanceState { + switch (event.type) { + case "press": + // A tap during a hold changes nothing: the hold decides when it ends. + if (state.holding) return state; + return { visible: true, holding: false, hideAtMs: nowMs + timeoutMs }; + case "hold": + return { visible: true, holding: true, hideAtMs: null }; + case "release": + // Releases also follow presses the board was never holding for (a + // tap-then-hold, a release delivered late); those mean nothing here. + return state.holding ? GLANCE_HIDDEN : state; + case "timeout": + if (!state.visible || state.holding || state.hideAtMs === null || nowMs < state.hideAtMs) return state; + return GLANCE_HIDDEN; + case "dismiss": + return GLANCE_HIDDEN; + } +} + +/** + * Which glance event, if any, a shell input gesture means while the screen is + * off. A double-tap only concerns the board while it is showing (it then + * dismisses it before waking the regular UI); everything else the shell + * already handles or ignores while asleep. + */ +export function glanceEventForGesture( + gesture: "click" | "double-click" | "long-press" | "long-press-release" | "head-tilt" | string, + boardVisible: boolean, +): GlanceEvent | null { + switch (gesture) { + case "click": + case "head-tilt": + return { type: "press" }; + case "long-press": + return { type: "hold" }; + case "long-press-release": + return { type: "release" }; + case "double-click": + return boardVisible ? { type: "dismiss" } : null; + default: + return null; + } +} diff --git a/app/graphics/icons.ts b/app/graphics/icons.ts index eb3ff5d3..dadd1488 100644 --- a/app/graphics/icons.ts +++ b/app/graphics/icons.ts @@ -20,6 +20,8 @@ const ICON_STROKE_WIDTH = 2; export const ICON_SVGS = { "message-circle": '', + eye: + '', "layout-grid": '', timer: diff --git a/app/phone-ui/main-view-model.ts b/app/phone-ui/main-view-model.ts index 7a0768e4..2670134c 100644 --- a/app/phone-ui/main-view-model.ts +++ b/app/phone-ui/main-view-model.ts @@ -1001,8 +1001,15 @@ export class MainViewModel extends Observable { // Each pad therefore defers its double-click until the finger-up (the touch // handler) and converts the deferred pair into the G2 tap-then-hold gesture // when a longPress lands first. + // + // A hold is two events, like the hardware's: longPress sends the press + // (long-press-start, which the controller delivers as a plain long-press) + // and the finger-up sends the release, so a hold really holds (the + // Glanceboard stays up until the finger lifts). The firmware sends the + // same release after a tap-then-hold, so that pair gets one too. private ringPadDoubleTapPending = false; + private ringPadHeld = false; async onRingPadTap(): Promise { await dashboardController.injectSyntheticRingInput("click"); @@ -1013,8 +1020,9 @@ export class MainViewModel extends Observable { } async onRingPadLongPress(): Promise { - const kind = this.ringPadDoubleTapPending ? "short-then-long-press" : "long-press"; + const kind = this.ringPadDoubleTapPending ? "short-then-long-press" : "long-press-start"; this.ringPadDoubleTapPending = false; + this.ringPadHeld = true; await dashboardController.injectSyntheticRingInput(kind); } @@ -1022,6 +1030,11 @@ export class MainViewModel extends Observable { if (args.action !== "up" && args.action !== "cancel") return; const pending = this.ringPadDoubleTapPending; this.ringPadDoubleTapPending = false; + if (this.ringPadHeld) { + this.ringPadHeld = false; + await dashboardController.injectSyntheticRingInput("long-press-release"); + return; + } if (args.action === "up" && pending) { await dashboardController.injectSyntheticRingInput("double-click"); } @@ -1048,8 +1061,9 @@ export class MainViewModel extends Observable { private padTwoFingerDown = false; // See the ring pad above: defers the double-click so a longPress can turn - // the pair into tap-then-hold. + // the pair into tap-then-hold, and pairs every hold with a release. private padDoubleTapPending = false; + private padHeld = false; /** What the next gesture lands on, as the watch pad shows it. */ get padFocusLine(): string { @@ -1071,8 +1085,10 @@ export class MainViewModel extends Observable { } async onPadLongPress(): Promise { - const kind = this.padDoubleTapPending ? "short-then-long-press" : "long-press"; + if (this.padTwoFingerDown) return; + const kind = this.padDoubleTapPending ? "short-then-long-press" : "long-press-start"; this.padDoubleTapPending = false; + this.padHeld = true; await dashboardController.injectSyntheticRingInput(kind, "watch"); this.refreshPadFocusLine(); } @@ -1092,6 +1108,12 @@ export class MainViewModel extends Observable { if (args.action === "up" || args.action === "cancel") { const pendingDouble = this.padDoubleTapPending; this.padDoubleTapPending = false; + if (this.padHeld) { + this.padHeld = false; + await dashboardController.injectSyntheticRingInput("long-press-release", "watch"); + this.refreshPadFocusLine(); + return; + } const twoFinger = this.padTwoFingerDown; if (twoFinger) { // Let the single-tap recognizer's delayed tap see the flag first. diff --git a/app/ui/clock-format.ts b/app/ui/clock-format.ts new file mode 100644 index 00000000..62255e86 --- /dev/null +++ b/app/ui/clock-format.ts @@ -0,0 +1,25 @@ +/** + * Clock/date text shared by the shell's top bar and the Glanceboard's System + * Card, so the two never disagree on the time-format setting or the date + * spelling. + */ +import { timeFormatSetting } from "./dashboard-settings"; + +const WEEKDAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; +const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + +/** Format a clock time, honoring the 12/24-hour setting ("14:05" / "2:05 PM"). */ +export function formatClockTime(now: Date): string { + const minutes = String(now.getMinutes()).padStart(2, "0"); + const hour24 = now.getHours(); + if (timeFormatSetting.get() === "12h") { + const hour12 = ((hour24 + 11) % 12) + 1; + return `${hour12}:${minutes} ${hour24 < 12 ? "AM" : "PM"}`; + } + return `${hour24}:${minutes}`; +} + +/** Short date as the top bar shows it: "Thu 11 Sep". */ +export function formatClockDate(now: Date): string { + return `${WEEKDAYS[now.getDay()]} ${now.getDate()} ${MONTHS[now.getMonth()]}`; +} diff --git a/app/ui/shell/chrome-layer.ts b/app/ui/shell/chrome-layer.ts index 5811997d..ef5d69e0 100644 --- a/app/ui/shell/chrome-layer.ts +++ b/app/ui/shell/chrome-layer.ts @@ -13,9 +13,9 @@ import { glassesBatteryVisibilitySetting, phoneBatteryVisibilitySetting, ringBatteryVisibilitySetting, - timeFormatSetting, type BatteryIndicatorVisibility, } from "../dashboard-settings"; +import { formatClockDate, formatClockTime } from "../clock-format"; import { getFont } from "../../graphics/bdffont"; import { Layer } from "../layers"; import { scrollToKeepSelectionVisible } from "../menu"; @@ -92,8 +92,6 @@ export function sidebarContentLeft(windowCount: number): number { } const NOTIFICATION_ICON_SIZE = 24; const BORDER_VALUE = 40; -const WEEKDAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; -const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; export type ShellChromeWindow = { windowId: string; @@ -321,8 +319,7 @@ export class ShellChromeLayer implements Layer { image.drawLine(barLeft, barTop + TOP_BAR_HEIGHT - 1, G2_LENS_WIDTH - 1, barTop + TOP_BAR_HEIGHT - 1, BORDER_VALUE); const now = new Date(); - const clock = `${WEEKDAYS[now.getDay()]} ${now.getDate()} ${MONTHS[now.getMonth()]} ` + - formatClockTime(now); + const clock = `${formatClockDate(now)} ${formatClockTime(now)}`; const clockX = barLeft + 10; const textY = barTop + Math.max(0, ((TOP_BAR_HEIGHT - font.lineHeight) / 2) | 0); image.drawText(font, clockX, textY, clock, 210); @@ -607,17 +604,6 @@ function tabLeftInset(yy: number, top: number, bottom: number, radius: number): return Math.max(0, Math.round(radius - Math.sqrt(Math.max(0, radius * radius - dy * dy)))); } -/** Format the top-bar clock time, honoring the 12/24-hour setting. */ -function formatClockTime(now: Date): string { - const minutes = String(now.getMinutes()).padStart(2, "0"); - const hour24 = now.getHours(); - if (timeFormatSetting.get() === "12h") { - const hour12 = ((hour24 + 11) % 12) + 1; - return `${hour12}:${minutes} ${hour24 < 12 ? "AM" : "PM"}`; - } - return `${hour24}:${minutes}`; -} - /** Small triangle marker for sidebar overflow; direction -1 = up, 1 = down. */ function drawChevron(image: GrayImage, centerX: number, y: number, direction: -1 | 1): void { const half = 5; diff --git a/app/ui/shell/worker-state.ts b/app/ui/shell/worker-state.ts new file mode 100644 index 00000000..e8b7536d --- /dev/null +++ b/app/ui/shell/worker-state.ts @@ -0,0 +1,38 @@ +/** + * Main-thread mirror of small state that worker apps publish (the + * "publish-state" worker reply): the latest value per key, with change + * notifications, so main-thread consumers that are not the app's own windows + * (a Glanceboard widget, say) can show what a worker knows without a second + * data connection. Values cross postMessage, so they are plain JSON. + */ +const values = new Map(); +const listeners = new Map void>>(); + +export function publishWorkerState(key: string, value: unknown): void { + values.set(key, value); + for (const listener of Array.from(listeners.get(key) ?? [])) { + try { + listener(value); + } catch (error) { + console.warn(`worker-state listener for ${key} failed`, error); + } + } +} + +/** The latest published value for `key`, or undefined when nothing was published yet. */ +export function readWorkerState(key: string): T | undefined { + return values.get(key) as T | undefined; +} + +/** Subscribe to later publications of `key`; returns the unsubscribe. */ +export function onWorkerStateChanged(key: string, listener: (value: T) => void): () => void { + let set = listeners.get(key); + if (!set) { + set = new Set(); + listeners.set(key, set); + } + set.add(listener as (value: unknown) => void); + return () => { + set!.delete(listener as (value: unknown) => void); + }; +} diff --git a/app/ui/shell/worker-window.ts b/app/ui/shell/worker-window.ts index ce68989b..be8c6901 100644 --- a/app/ui/shell/worker-window.ts +++ b/app/ui/shell/worker-window.ts @@ -5,6 +5,7 @@ import { toolRegistry, type ToolResult, type ToolSpec } from "../../assistant/to import { appViewportSize, type WindowHeightMode } from "./geometry"; import * as frameTimings from "../../native/frame-timings"; import { shell, type ShellWindow } from "./shell"; +import { publishWorkerState } from "./worker-state"; /** * Messages between the shell (main thread) and an app worker. One worker @@ -134,6 +135,15 @@ export type WorkerAppReply = type: "tool-result"; callId: string; result: ToolResult; + } + | { + /** + * Publish a small piece of app state for main-thread consumers outside + * the app's windows (see app/ui/shell/worker-state.ts). JSON only. + */ + type: "publish-state"; + key: string; + state: unknown; }; export type WorkerWindowSpec = { @@ -306,6 +316,9 @@ export class WorkerAppHost { case "set-title": // Titles are informational for now (sidebar shows icons only). break; + case "publish-state": + publishWorkerState(message.key, message.state); + break; case "set-tools": // Only a window we actually have open may contribute tools. if (this.openWindows.has(message.windowId)) { diff --git a/tests/ai-chat.test.cjs b/tests/ai-chat.test.cjs new file mode 100644 index 00000000..9423f06c --- /dev/null +++ b/tests/ai-chat.test.cjs @@ -0,0 +1,356 @@ +const test = require('node:test'); +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const path = require('node:path'); +const vm = require('node:vm'); +const ts = require('typescript'); + +function load(file, deps, globals = {}) { + const exports = {}; + const source = fs.readFileSync(path.join(__dirname, '..', file), 'utf8'); + vm.runInNewContext(ts.transpileModule(source, { + compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 }, + }).outputText, { exports, console, setTimeout, clearTimeout, ...globals, require(name) { + assert.ok(name in deps, `Unexpected import ${name} in ${file}`); + return deps[name]; + } }); + return exports; +} +const callbacks = () => ({ onTextDelta() {}, onToolActivity() {}, onTurnDone() {}, onError() {} }); +const config = (model = 'terra', effort = 'low') => ({ kind: 'direct', llm: { + provider: model === 'sonnet' ? 'anthropic' : 'openai', selection: model, model, effort, apiKey: 'secret-key', +} }); +function sessions() { + const turns = []; + let synchronousError = false; + const { AssistantSession } = load('app/assistant/session.ts', { + '../prompts': { ASSISTANT_SYSTEM_PROMPT_BASE: '', buildAssistantSystemPrompt: () => '', describeAssistantContext: () => '' }, + './bridge-client': { assistantBridge: {} }, + './direct-backend': { DirectAssistantBackend: class { runTurn(options) { + const turn = { ...options, cancelled: false }; + turns.push(turn); + if (synchronousError) options.callbacks.onError('failed'); + return { cancel() { turn.cancelled = true; } }; + } } }, + './tool-registry': { toolRegistry: { listTools: () => [] } }, + }); + function done(text) { + const turn = turns.at(-1); + turn.messages.push({ role: 'assistant', content: text }); + turn.callbacks.onTextDelta(text, text); + turn.callbacks.onTurnDone({ stopReason: 'end_turn' }); + } + return { AssistantSession, turns, done, setError() { synchronousError = true; } }; +} +function conversations(saved = '') { + const env = sessions(); + const { AssistantConversations } = load('app/assistant/conversations.ts', { + './session': { AssistantSession: env.AssistantSession }, + './models': { ASSISTANT_MODEL_VALUES: ['auto', 'terra', 'sonnet'] }, + }); + let stored = ''; + const store = new AssistantConversations((model, effort) => config(model, effort), () => 'terra', (value) => { stored = value; }, saved); + return { ...env, store, saved: () => stored }; +} + +test('voice and chat reuse selected history; sessions isolate context and persist without credentials', () => { + const env = conversations(); + const firstId = env.store.current().id; + const voice = env.store.ensureSession(); + voice.sendUtterance('Remember the blue door', {}, callbacks()); + assert.equal(env.store.create(), false); + env.done('I will remember.'); + const chat = env.store.ensureSession(); + assert.equal(chat, voice); + chat.sendUtterance('What color?', {}, callbacks()); + assert.equal(env.turns.at(-1).messages[0].content, 'Remember the blue door'); + assert.equal(chat.transcript[1].text, 'I will remember.'); + env.done('Blue.'); + assert.ok(env.store.create()); + env.store.ensureSession().sendUtterance('A separate topic', {}, callbacks()); + assert.equal(env.turns.at(-1).messages.length, 1); + env.done('New topic.'); + assert.ok(env.store.select(firstId)); + assert.equal(env.store.ensureSession(), voice); + const restored = conversations(env.saved()); + assert.equal(restored.store.current().id, firstId); + assert.equal(restored.store.ensureSession().transcript.at(-1).text, 'Blue.'); + assert.equal(env.saved().includes('secret-key'), false); + restored.store.ensureSession().sendUtterance('Continue after restart', {}, callbacks()); + assert.equal(restored.turns.at(-1).messages[0].content, 'Remember the blue door'); +}); + +test('model and effort changes retain transcript and apply only to the chosen session', () => { + const env = conversations(); + const original = env.store.current().id; + env.store.ensureSession().sendUtterance('hello', {}, callbacks()); + assert.equal(env.store.configure('sonnet', 'high'), false); + env.done('hi'); + env.store.configure('sonnet', 'high'); + env.store.ensureSession().sendUtterance('follow up', {}, callbacks()); + assert.equal(env.turns.at(-1).provider, 'anthropic'); + assert.equal(env.turns.at(-1).effort, 'high'); + assert.equal(env.turns.at(-1).messages[0].content, 'hello'); + env.done('still here'); + env.store.create(); + assert.equal(env.store.current().model, 'terra'); + assert.equal(env.store.current().reasoning, 'default'); + env.store.select(original); + assert.equal(env.store.current().reasoning, 'high'); +}); + +test('cancelled tools and late callbacks cannot mutate the next turn or its history', () => { + const env = sessions(); + const session = new env.AssistantSession(config()); + session.sendUtterance('first', {}, callbacks()); + const old = env.turns[0]; + old.callbacks.onTextDelta('partial', 'partial'); + session.cancel(); + session.sendUtterance('second', {}, callbacks()); + old.messages.push({ role: 'user', content: [{ type: 'tool_result', tool_use_id: 'old', content: 'late' }] }); + old.callbacks.onTextDelta('late', 'late'); + old.callbacks.onTurnDone({ stopReason: 'end_turn' }); + assert.equal(session.isTurnActive(), true); + assert.equal(session.transcript[1].text, 'partial'); + assert.equal(JSON.stringify(env.turns[1].messages).includes('tool_result'), false); + env.done('new answer'); + assert.equal(session.isTurnActive(), false); +}); + +test('synchronous provider errors do not leave a permanently active turn', () => { + const env = sessions(); env.setError(); + const session = new env.AssistantSession(config()); + session.sendUtterance('hello', {}, callbacks()); + assert.equal(session.isTurnActive(), false); + assert.equal(session.status, 'failed'); +}); + +function draftEnv({ prepare = async () => true, start = async () => {}, initialStatus = 'Ready' } = {}) { + const transcripts = new Set(), statuses = new Set(), timers = new Map(); + const sent = []; + let starts = 0, stops = 0, mic = false, timerId = 0; + const { VoiceDraft } = load('app/apps/ai-chat/voice-draft.ts', { + '../../native/voice-control': { voiceControlBridge: { + onTranscript(cb) { transcripts.add(cb); return () => transcripts.delete(cb); }, + onStatus(cb) { statuses.add(cb); cb({ status: initialStatus }); return () => statuses.delete(cb); }, + } }, + '../../ui/shell/voice-activity': { voiceActivity: { setActive(value) { mic = value; } } }, + }, { + setTimeout(cb) { timers.set(++timerId, cb); return timerId; }, + clearTimeout(id) { timers.delete(id); }, + }); + const draft = new VoiceDraft({ startVoiceCapture: async () => { starts++; await start(); }, stopVoiceCapture: () => { stops++; } }, prepare, () => {}, (text) => sent.push(text)); + return { draft, sent, starts: () => starts, stops: () => stops, mic: () => mic, + transcript(text, isFinal = false) { for (const cb of [...transcripts]) cb({ text, isFinal }); }, + status(status) { for (const cb of [...statuses]) cb({ status }); }, + timeout() { for (const cb of [...timers.values()]) cb(); }, + subscriptions: () => transcripts.size + statuses.size, + }; +} + +test('hold displays partials, release waits for final and sends exactly once', async () => { + const env = draftEnv(); + await env.draft.start(); + env.transcript('hello'); + assert.equal(env.draft.text, 'hello'); + assert.deepEqual(env.sent, []); + env.draft.release(); + assert.equal(env.stops(), 1); + env.transcript('hello world', true); + env.timeout(); + env.transcript('duplicate', true); + assert.deepEqual(env.sent, ['hello world']); + assert.equal(env.subscriptions(), 0); + assert.equal(env.mic(), false); +}); + +test('release before permission resolves never starts a microphone', async () => { + let ready; + const env = draftEnv({ prepare: () => new Promise((resolve) => { ready = resolve; }) }); + const start = env.draft.start(); + env.draft.release(); ready(true); await start; + assert.equal(env.starts(), 0); + assert.equal(env.draft.active, false); + assert.deepEqual(env.sent, []); +}); + +test('release during async mic startup stops capture after it starts', async () => { + let started; + const env = draftEnv({ start: () => new Promise((resolve) => { started = resolve; }) }); + const pending = env.draft.start(); + await new Promise(setImmediate); + env.transcript('quick message'); + env.draft.release(); started(); await pending; + assert.equal(env.stops(), 1); + env.timeout(); + assert.deepEqual(env.sent, ['quick message']); +}); + +test('empty capture, rejection and closing never submit stale speech', async () => { + for (const cancel of ['empty', 'rejection', 'close']) { + const env = draftEnv({ initialStatus: 'old error' }); + await env.draft.start(); + assert.equal(env.starts(), 1); + if (cancel !== 'empty') env.transcript('should not send'); + if (cancel === 'rejection') env.status('Ignored — not your enrolled voice'); + if (cancel === 'close') env.draft.cancel(); + env.draft.release(); env.timeout(); env.transcript('late', true); + assert.deepEqual(env.sent, []); + assert.equal(env.subscriptions(), 0); + } +}); + +function shellEnv() { + const gestures = load('app/ui/gestures.ts', {}); + class Image { constructor(width = 576, height = 260) { this.width = width; this.height = height; } } + const images = { GrayImage: Image, G2_LENS_WIDTH: 640, G2_LENS_HEIGHT: 480 }; + const timings = { spanCurrent: (_, fn) => fn(), span: (_, __, fn) => fn(), spanAsync: (_, __, fn) => fn(), + startFrame: () => 0, annotateFrame() {}, finishFrame() {}, runWithFrame: (_, fn) => fn() }; + const layers = load('app/ui/layers.ts', { + '../graphics/image': images, '../graphics/plane': { dimPlanes: (planes) => planes }, + '../native/frame-timings': timings, './gestures': gestures, + }); + class Menu { + constructor(title, items) { this.title = title; this.items = items; this.selectedIndex = 0; } + selectItem(index) { this.selectedIndex = index; return this; } + paint(_ctx, below) { return below(); } + handleInput(event, ctx) { if (event.type === 'double-click') ctx.stack.pop(); } + } + const settings = { wakeWordActionSetting: { get: () => 'voice-input' }, brightnessSetting: { get: () => 'auto' } }; + const { shell } = load('app/ui/shell/shell.ts', { + '../../graphics/image': images, '../../graphics/plane': {}, '../../graphics/ui-fonts': {}, '../../g2/events': {}, + '../gestures': gestures, '../layers': layers, '../menu': { MenuLayer: Menu }, + './voice-input': {}, './keyboard-input': {}, './voice-activity': {}, './assistant': {}, + '../../assistant/conversations': {}, '../../assistant/models': {}, '../../native/settings-store': {}, + '../notifications': {}, '../dashboard-settings': settings, './ambient-cards': {}, + './chrome-layer': { ShellChromeLayer: class {} }, './modal-layer': {}, './tool-debug-layer': {}, + './brightness-picker-layer': {}, + '../../assistant/tool-registry': {}, './geometry': { sidebarWidth: () => 64, minWindowTop: () => 96, TOP_BAR_HEIGHT: 28 }, + }); + const { createInProcessWindow } = load('app/ui/shell/in-process-window.ts', { + '../../graphics/image': images, '../../native/frame-timings': timings, + '../../util/render-freshness': { beginRenderPass() {}, endRenderPass: () => false }, + '../layers': layers, '../window-menu': { WindowMenuLayer: Menu }, + './chrome-layer': { windowIcon: () => () => null }, './geometry': { appViewportSize: () => ({ width: 576, height: 260 }) }, + './shell': { shell }, + }); + const input = [], menus = []; + let microphone = false; + const app = createInProcessWindow({ + appId: 'ai-chat', windowId: 'ai-chat', title: 'AI Chat', iconLetter: 'AI', closeable: true, holdToTalk: true, + baseLayer: { paint: () => new Image(), handleInput(event) { + input.push(event.type); + if (event.type === 'long-press') microphone = true; + if (event.type === 'long-press-release') microphone = false; + if (event.type === 'double-click') shell.yieldFocusToSidebar(); + } }, + menuItems: () => [{ label: 'New session', onSelect() {} }], + onAppMenuOpened() { menus.push('app'); microphone = false; }, + onSystemMenuOpened() { menus.push('system'); microphone = false; }, + isVoiceCapturing: () => microphone, + actions: layers.noopLayerActions, submitFrame: async () => {}, setSurfaceVisible() {}, + }); + shell.registerWindow(app.window); + shell.focusWindow('ai-chat'); + return { shell, app, input, menus, microphone: () => microphone, event: (type) => gestures.makeInputEvent({ type }) }; +} + +test('chat holds bypass the escape timer; release, menus and double tap follow the requested routing', async () => { + const env = shellEnv(); + await env.shell.receiveInput(env.event('long-press')); + assert.equal(env.microphone(), true); + assert.equal(env.shell.escapeMenuTimer, null); + await env.shell.receiveInput(env.event('long-press-release')); + assert.equal(env.microphone(), false); + assert.deepEqual(env.input, ['long-press', 'long-press-release']); + await env.shell.receiveInput(env.event('click')); + assert.deepEqual(env.menus, ['app']); + assert.equal(env.app.stack.isAtBase(), false); + await env.shell.receiveInput(env.event('short-then-long-press')); + assert.deepEqual(env.menus, ['app', 'system']); + assert.equal(env.app.stack.isAtBase(), true); + assert.equal(env.shell.stack.isAtBase(), false); + await env.shell.receiveInput(env.event('long-press-release')); + assert.deepEqual(env.input, ['long-press', 'long-press-release']); + env.shell.stack.clearToBase(); + env.shell.focusWindow('ai-chat'); + await env.shell.receiveInput(env.event('double-click')); + assert.equal(env.shell.isWindowFocused('ai-chat'), false); +}); + +test('ordinary apps retain long-press system menu and games retain the escape timer', async () => { + const env = shellEnv(); + env.app.window.holdToTalk = false; + await env.shell.receiveInput(env.event('long-press')); + assert.deepEqual(env.menus, ['system']); + assert.deepEqual(env.input, []); + env.shell.stack.clearToBase(); + env.app.window.claimsLongPress = () => true; + await env.shell.receiveInput(env.event('long-press')); + assert.notEqual(env.shell.escapeMenuTimer, null); + await env.shell.receiveInput(env.event('long-press-release')); + assert.equal(env.shell.escapeMenuTimer, null); +}); + +function chatLayerEnv() { + const env = conversations(); + const textwrap = load('app/graphics/textwrap.ts', {}); + const { BdfFont } = load('app/graphics/bdffont.ts', { '@nativescript/core': {} }); + const graphics = load('app/graphics/image.ts', { './textwrap': textwrap }); + const font = BdfFont.parse(fs.readFileSync(path.join(__dirname, '../app/fonts/terminus/ter-u12n.bdf'), 'utf8')); + let windowOptions; + const { createAiChatWindow } = load('app/apps/ai-chat/ai-chat-app.ts', { + '../../graphics/image': graphics, '../../graphics/ui-fonts': { getDefaultSmallFont: () => font }, + '../../graphics/textwrap': textwrap, '../../assistant/models': { assistantModelLabel: (s) => s }, + '../../ui/dashboard-settings': { assistantBackendSetting: { get: () => 'direct' } }, + '../../ui/gestures': load('app/ui/gestures.ts', {}), '../../ui/window-menu': {}, + '../../ui/shell/in-process-window': { createInProcessWindow(options) { + windowOptions = options; return { requestRender() {} }; + } }, + '../../ui/shell/shell': { shell: { getAssistantConversations: () => env.store } }, + './voice-draft': { VoiceDraft: class { active = false; text = ''; status = ''; cancel() {} } }, + }); + createAiChatWindow({ actions: {}, setSurfaceVisible() {}, onClosed() {} }); + const layer = windowOptions.baseLayer; + return { ...env, layer, paint: (width = 576, height = 260) => layer.paint({ stack: { getBaseSize: () => ({ width, height }) } }) }; +} + +test('scrollback stays anchored during streaming, follows at the bottom and resets on session switch', () => { + const env = chatLayerEnv(); + const session = env.store.ensureSession(); + for (let i = 0; i < 20; i++) session.transcript.push({ role: i % 2 ? 'assistant' : 'user', text: `Message ${i}: sample conversation text.` }); + env.paint(); + assert.ok(env.layer.maxFirstLine > 0); + env.layer.handleInput({ type: 'swipe-up' }); + const first = env.layer.firstLine; + session.transcript.push({ role: 'assistant', text: 'New streamed text '.repeat(30) }); + env.paint(); + assert.equal(env.layer.firstLine, first); + for (let i = 0; i < 50; i++) env.layer.handleInput({ type: 'swipe-down' }); + assert.equal(env.layer.firstLine, null); + env.layer.handleInput({ type: 'scroll-up' }); + env.store.create(); env.paint(); + assert.equal(env.layer.firstLine, null); +}); + +test('chat paints at both window heights with pending speech pinned beneath history', () => { + const env = chatLayerEnv(); + env.store.ensureSession().transcript.push({ role: 'user', text: 'Plan my afternoon.' }, { + role: 'assistant', text: 'You have a meeting at two. There is time for a walk beforehand. '.repeat(8), + }); + env.layer.draft.active = true; + env.layer.draft.status = 'Listening... release to send'; + env.layer.draft.text = 'Actually, leave some time to pick up lunch on the way.'; + for (const [width, height] of [[576, 260], [576, 452], [640, 452]]) { + const image = env.paint(width, height); + assert.equal(image.width, width); assert.equal(image.height, height); + assert.equal(image.to8bppBuffer().length, width * height); + if (process.env.FACECLAW_CHAT_RENDER_DIR) { + const pixels = image.to8bppBuffer(); + const rgba = new Uint8Array(pixels.length * 4); + for (let i = 0; i < pixels.length; i++) rgba.set([pixels[i], pixels[i], pixels[i], 255], i * 4); + const png = require('upng-js').encode([rgba.buffer], width, height, 0); + fs.writeFileSync(path.join(process.env.FACECLAW_CHAT_RENDER_DIR, `chat-${width}x${height}.png`), Buffer.from(png)); + } + } +}); diff --git a/tests/brightness-picker.test.cjs b/tests/brightness-picker.test.cjs new file mode 100644 index 00000000..80a83431 --- /dev/null +++ b/tests/brightness-picker.test.cjs @@ -0,0 +1,131 @@ +const test = require('node:test'); +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const path = require('node:path'); +const vm = require('node:vm'); +const ts = require('typescript'); + +function load(file, modules = {}) { + const source = fs.readFileSync(path.join(__dirname, '..', file), 'utf8'); + const context = { exports: {}, require: (name) => modules[name] ?? {}, console }; + vm.runInNewContext(ts.transpileModule(source, { + compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 }, + }).outputText, context, { filename: file }); + return context.exports; +} + +const textwrap = load('app/graphics/textwrap.ts'); +const graphics = load('app/graphics/image.ts', { './textwrap': textwrap }); +const plane = load('app/graphics/plane.ts', { './image': graphics }); +const gestures = load('app/ui/gestures.ts'); +const numeric = load('app/util/numeric-util.ts'); +const { BdfFont } = load('app/graphics/bdffont.ts'); +const font = BdfFont.parse(fs.readFileSync(path.join(__dirname, '../app/fonts/terminus/ter-u18n.bdf'), 'utf8')); +const fonts = { getDefaultSmallFont: () => font }; +const layers = load('app/ui/layers.ts', { + '../graphics/image': graphics, '../graphics/plane': plane, './gestures': gestures, + '../native/frame-timings': { spanCurrent: (_name, paint) => paint() }, +}); +const menu = load('app/ui/menu.ts', { + '../graphics/image': graphics, '../graphics/ui-fonts': fonts, '../graphics/textwrap': textwrap, + '../util/numeric-util': numeric, './gestures': gestures, './metrics': load('app/ui/metrics.ts'), +}); + +function fixture(initial = '50', viewport = { x: 64, y: 124, width: 576, height: 260 }) { + let value = initial, writes = 0, closed = 0; + const settings = { + brightnessSetting: { get: () => value, set: (next) => { value = next; writes++; } }, + brightnessSettingToLevel: (value) => value === 'auto' ? null : Number(value), + }; + const geometry = { + appViewportRect: () => viewport, SHELL_OPAQUE_BLACK: 1, + sidebarWidth: () => viewport.x, minWindowTop: () => viewport.y - 28, TOP_BAR_HEIGHT: 28, + }; + const picker = load('app/ui/shell/brightness-picker-layer.ts', { + '../../graphics/ui-fonts': fonts, '../../util/numeric-util': numeric, + '../dashboard-settings': settings, '../gestures': gestures, './geometry': geometry, + }); + const base = { paint: () => new graphics.GrayImage(640, 480), handleInput() {} }; + const stack = new layers.LayerStack(base, layers.noopLayerActions); + const open = () => stack.push(new picker.BrightnessPickerLayer(() => closed++)); + open(); + return { stack, open, settings, geometry, picker, value: () => value, writes: () => writes, + closed: () => closed, input: (type) => stack.handleInput(gestures.makeInputEvent({ type, source: 'watch' })) }; +} + +test('swipes change the saved level by 10, clamp at both ends, and both tap gestures confirm', async () => { + const f = fixture(); + await f.input('swipe-up'); assert.equal(f.value(), '60'); + await f.input('swipe-down'); assert.equal(f.value(), '50'); + for (let i = 0; i < 8; i++) await f.input('scroll-up'); + assert.equal(f.value(), '100'); assert.equal(f.writes(), 7); + await f.input('click'); assert.ok(f.stack.isAtBase()); assert.equal(f.closed(), 1); + f.open(); + for (let i = 0; i < 12; i++) await f.input('scroll-down'); + assert.equal(f.value(), '0'); assert.equal(f.writes(), 17); + await f.input('double-click'); assert.ok(f.stack.isAtBase()); assert.equal(f.closed(), 2); + assert.equal(f.value(), '0'); +}); + +test('enabling Auto while the picker is open prevents manual changes', async () => { + const f = fixture(); + f.settings.brightnessSetting.set('auto'); + await f.input('scroll-up'); await f.input('scroll-down'); + assert.equal(f.value(), 'auto'); assert.equal(f.writes(), 1); +}); + +test('the thin bar fills upward in proportion to brightness in each viewport', () => { + for (const viewport of [ + { x: 64, y: 28, width: 576, height: 260 }, + { x: 64, y: 220, width: 576, height: 260 }, + { x: 0, y: 28, width: 640, height: 452 }, + ]) { + for (const level of [0, 10, 50, 100]) { + const f = fixture(String(level), viewport); + const image = f.stack.paint().at(-1).image; + const fill = []; + for (let y = 0; y < image.height; y++) { + for (let x = 0; x < image.width; x++) { + if (image.getPixel(x, y) === 255) fill.push({ x, y }); + } + } + assert.equal(fill.length, 12 * level); + if (level) { + assert.equal(new Set(fill.map((p) => p.x)).size, 12); + assert.equal(new Set(fill.map((p) => p.y)).size, level); + assert.ok(fill.every((p) => p.x >= viewport.x && p.x < viewport.x + viewport.width + && p.y >= viewport.y && p.y < viewport.y + viewport.height)); + const bottom = fill.at(-1); + assert.equal(image.getPixel(bottom.x, bottom.y + 1), 1); + assert.equal(image.getPixel(bottom.x, bottom.y + 2), 150); + } + } + } +}); + +test('system menu hides brightness in Auto and opens its picker between Voice input and Debug', async () => { + const f = fixture('auto'); + const { shell } = load('app/ui/shell/shell.ts', { + '../../graphics/image': graphics, '../layers': layers, '../menu': menu, '../gestures': gestures, + '../dashboard-settings': f.settings, './geometry': f.geometry, './brightness-picker-layer': f.picker, + './chrome-layer': { ShellChromeLayer: class {} }, + }); + shell.registerWindow({ windowId: 'test', appId: 'test', closeable: true, handleInput() {} }); + shell.openSystemMenu('test'); + let opened = shell.stack.layers.at(-1); + assert.deepEqual(Array.from(opened.items, (item) => item.label), + ['Close window', 'Focus app switcher', 'Voice input', 'Debug']); + shell.stack.clearToBase(); + f.settings.brightnessSetting.set('40'); + shell.openSystemMenu('test'); + opened = shell.stack.layers.at(-1); + assert.deepEqual(Array.from(opened.items, (item) => item.label), + ['Close window', 'Focus app switcher', 'Voice input', 'Brightness', 'Debug']); + await shell.stack.handleInput(gestures.makeInputEvent({ type: 'scroll-down' })); + await shell.stack.handleInput(gestures.makeInputEvent({ type: 'scroll-down' })); + await shell.stack.handleInput(gestures.makeInputEvent({ type: 'click', source: 'ring' })); + assert.ok(shell.stack.topMatches((layer) => layer instanceof f.picker.BrightnessPickerLayer)); + await shell.stack.handleInput(gestures.makeInputEvent({ type: 'double-click', source: 'ring' })); + assert.ok(shell.stack.isAtBase()); + assert.equal(shell.focus, 'sidebar'); +}); diff --git a/tests/compass-debug.test.cjs b/tests/compass-debug.test.cjs index 6df4cffe..a000c57a 100644 --- a/tests/compass-debug.test.cjs +++ b/tests/compass-debug.test.cjs @@ -42,9 +42,14 @@ function compass(width = 576, height = 260) { RecordingImage.prototype.clone = function () { const image = baseClone.call(this); Object.setPrototypeOf(image, RecordingImage.prototype); image.texts = []; return image; }; + const calibration = { isCompassCalibrated: () => true, normalizeHeading: (v) => v }; + const rose = load('app/apps/compass/compass-rose.ts', { + '../../graphics/image': { GrayImage: RecordingImage }, './calibration': calibration, + }); const app = load('app/apps/compass/compass-app.ts', { '../../graphics/ui-fonts': { getDefaultSmallFont: () => small, getDefaultLargeFont: () => large }, '../../graphics/image': { GrayImage: RecordingImage }, '../../graphics/textwrap': textwrap, + './compass-rose': rose, '../../native/compass': { COMPASS_CHANGED: 15, COMPASS_CALIBRATION_STARTED: 16, COMPASS_CALIBRATION_COMPLETE: 17, addCompassListener: (fn) => { listener = fn; return () => {}; }, setCompassEnabled() {} }, '../../ui/metrics': { lineStep: (font) => font.lineHeight + 2 }, @@ -55,7 +60,7 @@ function compass(width = 576, height = 260) { }, '../../ui/shell/shell': { shell: { isWindowVisible: () => true } }, '../../g2/android-permissions': { hasLocationPermission: () => false }, - './calibration': { isCompassCalibrated: () => true, normalizeHeading: (v) => v }, + './calibration': calibration, './calibration-layer': {}, './declination': { onDeclinationChanged: () => () => {} }, './heading': { getNorthReference: () => 'magnetic', resolveHeading: (v) => ({ displayDegrees: v }) }, './debug': debug, diff --git a/tests/compass-style.test.cjs b/tests/compass-style.test.cjs index 66d07a7b..c6ef2d21 100644 --- a/tests/compass-style.test.cjs +++ b/tests/compass-style.test.cjs @@ -61,6 +61,10 @@ function compass({ style, width = 576, height = 260 } = {}) { '../../g2/android-permissions': { hasLocationPermission: () => false }, './calibration': { isCompassCalibrated: () => true, normalizeHeading: (n) => ((n % 360) + 360) % 360 }, './calibration-layer': {}, + './compass-rose': load('app/apps/compass/compass-rose.ts', { + '../../graphics/image': { ...graphics, GrayImage: RecordingImage }, + './calibration': { normalizeHeading: (n) => ((n % 360) + 360) % 360 }, + }), './declination': { onDeclinationChanged: () => () => {} }, './heading': { getNorthReference: () => 'magnetic', resolveHeading: (n) => ({ displayDegrees: n }) }, }; diff --git a/tests/compass-texture-cache.test.cjs b/tests/compass-texture-cache.test.cjs index 15828b99..55edd8ff 100644 --- a/tests/compass-texture-cache.test.cjs +++ b/tests/compass-texture-cache.test.cjs @@ -26,6 +26,14 @@ const font = (size) => BdfFont.parse(fs.readFileSync( const small = font(12); const large = font(24); let viewportWidth = 576; +const calibration = { isCompassCalibrated: () => true, normalizeHeading: (n) => ((n % 360) + 360) % 360 }; +// The rose renderer's private helpers are re-exported for referenceFrame. +const rose = load('app/apps/compass/compass-rose.ts', { + '../../graphics/image': graphics, + './calibration': calibration, +}, ` +export { rotatingRoseBounds, drawPlaneGrid, drawDiscWall, drawTiltedRing, drawHeadingTick }; +`); const compass = load('app/apps/compass/compass-app.ts', { '../../graphics/ui-fonts': { getDefaultSmallFont: () => small, getDefaultLargeFont: () => large }, '../../graphics/image': graphics, @@ -36,20 +44,26 @@ const compass = load('app/apps/compass/compass-app.ts', { '../../ui/shell/in-process-window': {}, '../../ui/shell/shell': {}, '../../g2/android-permissions': {}, - './calibration': { isCompassCalibrated: () => true, normalizeHeading: (n) => ((n % 360) + 360) % 360 }, + './calibration': calibration, './calibration-layer': {}, + './compass-rose': rose, + './debug': { compassDebugLines: () => [], isCompassDebugEnabled: () => false, setCompassDebugEnabled: () => {} }, './declination': {}, './heading': { getNorthReference: () => 'magnetic', resolveHeading: (n) => ({ displayDegrees: n }) }, }, ` -export { CompassLayer, rotatingRoseBounds, createCompassBackground, drawCompassRose }; +export { CompassLayer }; +const rose_1 = require('./compass-rose'); +export const rotatingRoseBounds = rose_1.rotatingRoseBounds; +export const createCompassBackground = rose_1.createCompassBackground; +export const drawCompassRose = rose_1.drawCompassRose; export function referenceFrame(width, height, cx, cy, radius, clipY, heading) { const image = new GrayImage(width, height, 0); const fade = heading === null ? 0.45 : 1; - drawPlaneGrid(image, cx, cy, radius, clipY); - drawDiscWall(image, cx, cy, radius, fade); - drawTiltedRing(image, cx, cy, radius, 105 * fade); - drawCompassRose(image, cx, cy, radius, heading); - drawHeadingTick(image, cx, cy, radius, 255 * fade); + rose_1.drawPlaneGrid(image, cx, cy, radius, clipY); + rose_1.drawDiscWall(image, cx, cy, radius, fade); + rose_1.drawTiltedRing(image, cx, cy, radius, 105 * fade); + rose_1.drawCompassRose(image, cx, cy, radius, heading); + rose_1.drawHeadingTick(image, cx, cy, radius, 255 * fade); return image; } `); diff --git a/tests/faceclaw-gesture-event.test.cjs b/tests/faceclaw-gesture-event.test.cjs new file mode 100644 index 00000000..1071c1f7 --- /dev/null +++ b/tests/faceclaw-gesture-event.test.cjs @@ -0,0 +1,19 @@ +const test = require('node:test'); +const fs = require('node:fs'); +const os = require('node:os'); +const path = require('node:path'); +const { execFileSync } = require('node:child_process'); + +test('CFW idle-gesture events decode to sys-event types and sources; wake and junk do not', () => { + const directory = fs.mkdtempSync(path.join(os.tmpdir(), 'faceclaw-gesture-java-')); + const javaBin = (name) => process.env.JAVA_HOME ? path.join(process.env.JAVA_HOME, 'bin', name) : name; + try { + execFileSync(javaBin('javac'), ['-d', directory, + path.join(__dirname, '../App_Resources/Android/src/main/java/com/faceclaw/app/g2protocol/BleProtocol.java'), + path.join(__dirname, '../App_Resources/Android/src/main/java/com/faceclaw/app/util/CollectionUtils.java'), + path.join(__dirname, 'fixtures/FaceclawGestureEventTest.java')], { stdio: 'pipe' }); + execFileSync(javaBin('java'), ['-ea', '-cp', directory, 'com.faceclaw.app.FaceclawGestureEventTest'], { stdio: 'pipe' }); + } finally { + fs.rmSync(directory, { recursive: true, force: true }); + } +}); diff --git a/tests/firmware-compat.test.cjs b/tests/firmware-compat.test.cjs new file mode 100644 index 00000000..1db8134f --- /dev/null +++ b/tests/firmware-compat.test.cjs @@ -0,0 +1,75 @@ +// Pins the firmware-extension parsing and the compatibility / onboarding +// classification that the firmware check page and the main screen share. +const test = require("node:test"); +const assert = require("node:assert/strict"); + +const compat = require("../.test-build/app/g2/firmware-compat.js"); + +const REQUIRED = compat.REQUIRED_FACECLAW_FIRMWARE_VERSION; +const info = (extension, left = "2.2.9.22", right = "2.2.9.22") => ({ leftVersion: left, rightVersion: right, extension }); + +test("parseFirmwareExtension recognizes each slot format", () => { + assert.deepEqual(compat.parseFirmwareExtension(""), { kind: "none" }); + assert.deepEqual(compat.parseFirmwareExtension(" "), { kind: "none" }); + assert.deepEqual(compat.parseFirmwareExtension("Faceclaw/1"), { kind: "faceclaw", version: 1 }); + assert.deepEqual(compat.parseFirmwareExtension(" Faceclaw/12 "), { kind: "faceclaw", version: 12 }); + assert.deepEqual(compat.parseFirmwareExtension("EVENCFW/22 img640 imgz rle"), { + kind: "legacy-faceclaw", + text: "EVENCFW/22 img640 imgz rle", + }); + assert.deepEqual(compat.parseFirmwareExtension("EVENCFW"), { kind: "legacy-faceclaw", text: "EVENCFW" }); + assert.deepEqual(compat.parseFirmwareExtension("OtherCFW/3"), { kind: "other", text: "OtherCFW/3" }); + // A Faceclaw prefix without a usable number is not ours. + assert.deepEqual(compat.parseFirmwareExtension("Faceclaw/x"), { kind: "other", text: "Faceclaw/x" }); +}); + +test("the required revision and newer revisions are compatible", () => { + assert.equal(compat.hasCompatibleFirmware(info(`Faceclaw/${REQUIRED}`)), true); + assert.equal(compat.firmwareIncompatibilityMessage(info(`Faceclaw/${REQUIRED}`)), null); + assert.equal(compat.hasCompatibleFirmware(info(`Faceclaw/${REQUIRED + 5}`)), true); + assert.equal(compat.firmwareIncompatibilityMessage(info(`Faceclaw/${REQUIRED + 5}`)), null); + assert.equal(compat.classifyOnboardingFirmware(info(`Faceclaw/${REQUIRED + 5}`)).kind, "custom"); +}); + +test("older Faceclaw revisions and legacy EVENCFW builds need a reflash", () => { + const older = info(`Faceclaw/${REQUIRED - 1}`); + assert.equal(compat.hasCompatibleFirmware(older), false); + assert.match(compat.firmwareIncompatibilityMessage(older), new RegExp(`revision ${REQUIRED - 1}`)); + assert.match(compat.firmwareIncompatibilityMessage(older), new RegExp(`requires revision ${REQUIRED}`)); + assert.equal(compat.classifyOnboardingFirmware(older).kind, "older-faceclaw"); + + const legacy = info("EVENCFW/22 img640 fbguard wearnotify"); + assert.equal(compat.hasCompatibleFirmware(legacy), false); + assert.match(compat.firmwareIncompatibilityMessage(legacy), /older version of Faceclaw's custom firmware/); + const classified = compat.classifyOnboardingFirmware(legacy); + assert.equal(classified.kind, "older-faceclaw"); + assert.equal(classified.version, "2.2.9.22"); + assert.equal(classified.extension.kind, "legacy-faceclaw"); +}); + +test("custom firmware from another source is flashable with its own messaging", () => { + const other = info("OtherCFW/3", "2.2.9.22", "2.2.9.22"); + assert.equal(compat.hasCompatibleFirmware(other), false); + assert.match(compat.firmwareIncompatibilityMessage(other), /different source/); + assert.match(compat.firmwareIncompatibilityMessage(other), /OtherCFW\/3/); + assert.equal(compat.classifyOnboardingFirmware(other).kind, "other-custom"); + assert.match(compat.describeFirmwareExtension({ kind: "other", text: "OtherCFW/3" }), /different source/); +}); + +test("stock firmware classifies by base version and warns on the main screen", () => { + assert.equal(compat.firmwareIncompatibilityMessage(info("", "", "")), null, "nothing reported is not a verdict"); + assert.match(compat.firmwareIncompatibilityMessage(info("")), /stock firmware/); + assert.equal(compat.classifyOnboardingFirmware(info("", "", "")).kind, "unknown"); + assert.equal(compat.classifyOnboardingFirmware(info("", "2.2.9.22", "2.2.9.22")).kind, "flashable-stock"); + assert.equal(compat.classifyOnboardingFirmware(info("", "2.2.4.34", "")).kind, "flashable-stock"); + assert.equal(compat.classifyOnboardingFirmware(info("", "2.2.10.10", "2.2.10.10")).kind, "newer-stock-validated"); + assert.equal(compat.classifyOnboardingFirmware(info("", "2.3.0.1", "2.3.0.1")).kind, "newer-stock-unvalidated"); + // Faceclaw firmware on a newer base is still judged by its revision, not the base. + assert.equal(compat.classifyOnboardingFirmware(info(`Faceclaw/${REQUIRED}`, "2.3.0.1", "2.3.0.1")).kind, "custom"); +}); + +test("reportedFirmwareVersion picks the higher arm", () => { + assert.equal(compat.reportedFirmwareVersion(info("", "2.2.9.22", "2.2.10.10")), "2.2.10.10"); + assert.equal(compat.reportedFirmwareVersion(info("", "", "2.2.9.22")), "2.2.9.22"); + assert.equal(compat.reportedFirmwareVersion(info("", "", "")), ""); +}); diff --git a/tests/fixtures/FaceclawGestureEventTest.java b/tests/fixtures/FaceclawGestureEventTest.java new file mode 100644 index 00000000..ef31030c --- /dev/null +++ b/tests/fixtures/FaceclawGestureEventTest.java @@ -0,0 +1,67 @@ +package com.faceclaw.app; +import java.util.Arrays; + +public class FaceclawGestureEventTest { + private static byte[] hex(String value) { + byte[] result = new byte[value.length() / 2]; + for (int i = 0; i < result.length; ++i) + result[i] = (byte)Integer.parseInt(value.substring(i * 2, i * 2 + 2), 16); + return result; + } + private static byte[] pb(byte[] payload) { + byte[] frame = BleProtocol.framePb(payload, 9, BleProtocol.FLAG_NOTIFY, 15).get(0); + return BleProtocol.parseFrame(frame).pb; + } + /** G2SettingPackage{commandId=3, magic=0, field102=['F','C',1,event,source,0]}: the CFW's wire shape. */ + private static byte[] packet(int event, int source) { + byte[] p = hex("08031000b20606464301000000"); + p[10] = (byte)event; p[11] = (byte)source; + return p; + } + public static void main(String[] args) { + // Event codes map to the sys-events a live page would produce. + int[][] events = { + {2, BleProtocol.EVENT_CLICK}, + {3, BleProtocol.EVENT_RING_LONG_PRESS}, + {4, BleProtocol.EVENT_RING_LONG_PRESS_RELEASE}, + }; + int[][] sources = { + {0, BleProtocol.EVENT_SOURCE_GLASSES_L}, + {1, BleProtocol.EVENT_SOURCE_GLASSES_R}, + {4, BleProtocol.EVENT_SOURCE_RING}, + {7, 0}, + }; + for (int[] e : events) for (int[] s : sources) { + BleProtocol.FaceclawGestureEvent g = BleProtocol.parseFaceclawGestureEvent(pb(packet(e[0], s[0]))); + assert g != null && g.eventType == e[1] && g.eventSource == s[1] : e[0] + "/" + s[0]; + } + // The double-tap wake event (1) and unknown codes are not gestures, and the + // wake parser does not mistake a gesture for a wake. + byte[] wake = packet(1, 0x34); wake[12] = 0x12; + assert BleProtocol.parseFaceclawGestureEvent(pb(wake)) == null; + assert BleProtocol.parseFaceclawWakeEvent(pb(wake)) == 0x1234; + assert BleProtocol.parseFaceclawWakeEventCode(pb(wake)) == 1; + // The head-up wake (5) shares the nonce handshake but keeps its own code. + byte[] headUp = packet(5, 0x34); headUp[12] = 0x12; + assert BleProtocol.parseFaceclawGestureEvent(pb(headUp)) == null; + assert BleProtocol.parseFaceclawWakeEvent(pb(headUp)) == 0x1234; + assert BleProtocol.parseFaceclawWakeEventCode(pb(headUp)) == BleProtocol.FACECLAW_WAKE_EVENT_HEAD_UP; + for (int code : new int[] {2, 3, 4, 6}) { + assert BleProtocol.parseFaceclawWakeEvent(pb(packet(code, 1))) == -1; + assert BleProtocol.parseFaceclawWakeEventCode(pb(packet(code, 1))) == -1; + } + for (int code : new int[] {0, 5, 6, 255}) + assert BleProtocol.parseFaceclawGestureEvent(pb(packet(code, 1))) == null; + // Wrong protocol version, wrong magic letters, truncated payloads, plain settings. + byte[] bad = packet(2, 1); bad[9] = 2; + assert BleProtocol.parseFaceclawGestureEvent(pb(bad)) == null; + bad = packet(2, 1); bad[7] = 'X'; + assert BleProtocol.parseFaceclawGestureEvent(pb(bad)) == null; + byte[] full = packet(2, 1); + for (int n = 0; n < full.length; ++n) + assert BleProtocol.parseFaceclawGestureEvent(pb(Arrays.copyOf(full, n))) == null : n; + assert BleProtocol.parseFaceclawGestureEvent(pb(hex("08031000"))) == null; + assert BleProtocol.parseFaceclawGestureEvent(null) == null; + System.out.println("FaceclawGestureEventTest ok"); + } +} diff --git a/tests/fixtures/RingBatteryProtocolTest.java b/tests/fixtures/RingBatteryProtocolTest.java new file mode 100644 index 00000000..671450fc --- /dev/null +++ b/tests/fixtures/RingBatteryProtocolTest.java @@ -0,0 +1,50 @@ +package com.faceclaw.app; +import java.util.Arrays; + +public class RingBatteryProtocolTest { + private static byte[] hex(String value) { + byte[] result = new byte[value.length() / 2]; + for (int i = 0; i < result.length; ++i) + result[i] = (byte)Integer.parseInt(value.substring(i * 2, i * 2 + 2), 16); + return result; + } + private static BleProtocol.RingBatterySnapshot parse(byte[] payload) { + byte[] frame = BleProtocol.framePb(payload, 9, BleProtocol.FLAG_NOTIFY, 15).get(0); + return BleProtocol.parseRingBattery(BleProtocol.parseFrame(frame).pb); + } + public static void main(String[] args) { + // Same golden payload as g2flash/tests/ring_battery_test.c. + byte[] packet = hex("08031000d206055242010752"); + BleProtocol.RingBatterySnapshot result = parse(packet); + assert result.battery == 82 && result.charging == 1; + packet[10] = 3; + for (int level = 0; level <= 100; ++level) { + packet[11] = (byte)level; + result = parse(packet); + assert result.battery == level && result.charging == 0; + } + for (int flags : new int[] {0, 1}) { + packet[10] = (byte)flags; packet[11] = (byte)255; + result = parse(packet); + assert result.battery == -1 && result.charging == -1; + } + packet = hex("08031000d206055242010752"); + for (int n = 0; n < packet.length; ++n) + assert parse(Arrays.copyOf(packet, n)) == null; + for (int offset : new int[] {7, 8, 9, 10, 11}) { + byte previous = packet[offset]; packet[offset] = (byte)255; + assert parse(packet) == null; + packet[offset] = previous; + } + assert parse(hex("08031000")) == null; // older firmware + assert parse(hex("d206055242010252")) == null; // valid without connected + assert parse(hex("d206055242010352")).battery == 82; + assert parse(hex("d2060552420100ff")).battery == -1; + // Invalid unknown value and charging-without-valid must be rejected. + assert parse(hex("d206055242010052")) == null; + assert parse(hex("d2060552420105ff")) == null; + assert parse(hex("d206055242010364")).battery == 100; + assert parse(hex("d206055242010365")) == null; + assert BleProtocol.parseRingBattery(null) == null; + } +} diff --git a/tests/fixtures/pinball-worker.cjs b/tests/fixtures/pinball-worker.cjs new file mode 100644 index 00000000..a9d6e052 --- /dev/null +++ b/tests/fixtures/pinball-worker.cjs @@ -0,0 +1,59 @@ +// Execute the production worker, replacing only NativeScript/platform services. +const fs = require('node:fs'); +const path = require('node:path'); +const vm = require('node:vm'); +const ts = require('typescript'); +const root = path.resolve(__dirname, '../..'); + +function load(file, modules = {}, extra = '', globals = {}) { + const context = { exports: {}, console, ...globals, require: (name) => { + if (!(name in modules)) throw new Error(`Unexpected dependency: ${name}`); + return modules[name]; + } }; + const source = fs.readFileSync(path.join(root, file), 'utf8'); + vm.runInNewContext(ts.transpileModule(source, { + compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 }, + }).outputText + extra, context, { filename: file }); + return context.exports; +} + +const { BdfFont } = load('app/graphics/bdffont.ts', { '@nativescript/core': {} }); +const font = (size) => BdfFont.parse(fs.readFileSync(path.join(root, `app/fonts/terminus/ter-u${size}n.bdf`), 'utf8')); +const fonts = { terminus24: font(24), terminus32: font(32) }; +const smallFont = font(18); +const graphics = load('app/graphics/image.ts', { './textwrap': load('app/graphics/textwrap.ts') }); + +module.exports = function worker() { + let now = 10000; + let highScore = '0'; + const noop = () => {}; + const global = { postMessage: noop }; + const api = load('app/apps/pinball/pinball-app.worker.ts', { + '@nativescript/core/globals': {}, + '../../graphics/image': graphics, + '../../graphics/plane': {}, '../../graphics/glyph-wire': {}, + '../../graphics/bdffont': { getFont: (name) => fonts[name] }, + '../../graphics/ui-fonts': { getDefaultSmallFont: () => smallFont }, + '../../native/frame-timings': { finishFrame: noop, logFrame: noop }, + '../../native/active-display': {}, + '../../native/settings-store': { getStringSetting: () => highScore, setStringSetting: (_, value) => { highScore = value; } }, + '../../ui/sound-effects': {}, + '../../ui/window-menu': { WindowMenu: class { open() {} } }, + '../../ui/gestures': { directionalFallback: (event) => event, GESTURE_CLICK: '●', GESTURE_DOUBLE_CLICK: '●●', GESTURE_SCROLL: '↕', GESTURE_LONG_PRESS: '—' }, + '../../util/numeric-util': { clamp: (v, lo, hi) => Math.max(lo, Math.min(hi, v)) }, + }, ` + renderAndSubmit = () => {}; + playSfx = () => {}; + exports.api = { windows, launchBall, ballDrained, stepPhysics, tick, flip, nudge, + checkTargets, checkRollovers, collideBumpers, resetGame, paintContent, TARGETS, ROLLOVERS }; + `, { global, Date: { now: () => now }, setInterval: () => 1, clearInterval: noop }).api; + const message = (data) => global.onmessage({ data }); + message({ type: 'open-window', windowId: 'test', surfaceId: 'test', title: 'Pinball', viewport: { width: 576, height: 260 } }); + message({ type: 'foreground', windowId: 'test', foreground: true, focused: true }); + const w = api.windows.get('test'); + return { ...api, w, message, highScore: () => Number(highScore), + input: (type) => message({ type: 'input', windowId: 'test', focused: true, frameId: 1, event: { type } }), + advance: (seconds) => { for (let i = 0; i < Math.round(seconds * 120); i++) { now += 1000 / 120; api.stepPhysics(w); } }, + elapse: (seconds) => { now += seconds * 1000; }, + }; +}; diff --git a/tests/glance-state.test.cjs b/tests/glance-state.test.cjs new file mode 100644 index 00000000..7e1eab49 --- /dev/null +++ b/tests/glance-state.test.cjs @@ -0,0 +1,66 @@ +const test = require("node:test"); +const assert = require("node:assert/strict"); + +const { + GLANCE_HIDDEN, + GLANCE_TIMEOUT_MS, + glanceEventForGesture, + reduceGlance, +} = require("../.test-build/app/g2/glance-state.js"); + +const T0 = 1_000_000; + +test("a press shows the board and arms the auto-hide timer", () => { + const shown = reduceGlance(GLANCE_HIDDEN, { type: "press" }, T0); + assert.deepEqual(shown, { visible: true, holding: false, hideAtMs: T0 + GLANCE_TIMEOUT_MS }); + // A timer firing early is ignored; on time it hides. + assert.equal(reduceGlance(shown, { type: "timeout" }, T0 + GLANCE_TIMEOUT_MS - 1), shown); + assert.deepEqual(reduceGlance(shown, { type: "timeout" }, T0 + GLANCE_TIMEOUT_MS), GLANCE_HIDDEN); +}); + +test("a further press renews the timer from the new press", () => { + const shown = reduceGlance(GLANCE_HIDDEN, { type: "press" }, T0); + const renewed = reduceGlance(shown, { type: "press" }, T0 + 2000); + assert.equal(renewed.hideAtMs, T0 + 2000 + GLANCE_TIMEOUT_MS); + assert.equal(reduceGlance(renewed, { type: "timeout" }, T0 + GLANCE_TIMEOUT_MS), renewed); +}); + +test("a hold shows the board without a timer and the release hides it", () => { + const held = reduceGlance(GLANCE_HIDDEN, { type: "hold" }, T0); + assert.deepEqual(held, { visible: true, holding: true, hideAtMs: null }); + assert.equal(reduceGlance(held, { type: "timeout" }, T0 + 60_000), held); + // A tap mid-hold neither hides nor starts a timer. + assert.equal(reduceGlance(held, { type: "press" }, T0 + 500), held); + assert.deepEqual(reduceGlance(held, { type: "release" }, T0 + 1000), GLANCE_HIDDEN); +}); + +test("a release that was not holding the board is ignored", () => { + assert.equal(reduceGlance(GLANCE_HIDDEN, { type: "release" }, T0), GLANCE_HIDDEN); + const shown = reduceGlance(GLANCE_HIDDEN, { type: "press" }, T0); + assert.equal(reduceGlance(shown, { type: "release" }, T0 + 100), shown); +}); + +test("dismiss hides from any state", () => { + const held = reduceGlance(GLANCE_HIDDEN, { type: "hold" }, T0); + assert.deepEqual(reduceGlance(held, { type: "dismiss" }, T0), GLANCE_HIDDEN); + const shown = reduceGlance(GLANCE_HIDDEN, { type: "press" }, T0); + assert.deepEqual(reduceGlance(shown, { type: "dismiss" }, T0), GLANCE_HIDDEN); +}); + +test("gesture mapping: taps and head-tilt press, long-press holds, double-tap dismisses only a visible board", () => { + assert.deepEqual(glanceEventForGesture("click", false), { type: "press" }); + assert.deepEqual(glanceEventForGesture("head-tilt", false), { type: "press" }); + assert.deepEqual(glanceEventForGesture("long-press", false), { type: "hold" }); + assert.deepEqual(glanceEventForGesture("long-press-release", true), { type: "release" }); + assert.equal(glanceEventForGesture("double-click", false), null); + assert.deepEqual(glanceEventForGesture("double-click", true), { type: "dismiss" }); + assert.equal(glanceEventForGesture("scroll-up", true), null); + assert.equal(glanceEventForGesture("short-then-long-press", true), null); +}); + +test("the press timeout is the host's when supplied", () => { + const shown = reduceGlance(GLANCE_HIDDEN, { type: "press" }, T0, 10_000); + assert.equal(shown.hideAtMs, T0 + 10_000); + assert.equal(reduceGlance(shown, { type: "timeout" }, T0 + GLANCE_TIMEOUT_MS), shown); + assert.deepEqual(reduceGlance(shown, { type: "timeout" }, T0 + 10_000), GLANCE_HIDDEN); +}); diff --git a/tests/glanceboard-layout.test.cjs b/tests/glanceboard-layout.test.cjs new file mode 100644 index 00000000..8b602aba --- /dev/null +++ b/tests/glanceboard-layout.test.cjs @@ -0,0 +1,59 @@ +const test = require("node:test"); +const assert = require("node:assert/strict"); + +const { QUADRANT_LAYOUT, resolveGlanceRegions, slotsVerticallyAdjacent } = require("../.test-build/app/apps/glanceboard/layout.js"); + +const spans = (choice) => choice === "terminal" || choice === "calendar"; + +test("quadrant adjacency: left pair and right pair stack, nothing else", () => { + assert.equal(slotsVerticallyAdjacent(QUADRANT_LAYOUT, 0, 2), true); + assert.equal(slotsVerticallyAdjacent(QUADRANT_LAYOUT, 3, 1), true); + assert.equal(slotsVerticallyAdjacent(QUADRANT_LAYOUT, 0, 1), false); + assert.equal(slotsVerticallyAdjacent(QUADRANT_LAYOUT, 0, 3), false); + assert.equal(slotsVerticallyAdjacent(QUADRANT_LAYOUT, 1, 1), false); +}); + +test("a spanning widget in both left slots becomes one double-height region", () => { + const regions = resolveGlanceRegions(QUADRANT_LAYOUT, ["terminal", "music", "terminal", "none"], spans); + assert.deepEqual(regions, [ + { choice: "terminal", rect: { x: 0, y: 0, width: 288, height: 288 }, slots: [0, 2] }, + { choice: "music", rect: { x: 288, y: 0, width: 288, height: 144 }, slots: [1] }, + ]); +}); + +test("a spanning widget in both right slots merges too, in slot order", () => { + const regions = resolveGlanceRegions(QUADRANT_LAYOUT, ["none", "calendar", "compass", "calendar"], spans); + assert.deepEqual(regions.map((region) => [region.choice, region.slots, region.rect.height]), [ + ["calendar", [1, 3], 288], + ["compass", [2], 144], + ]); +}); + +test("a non-spanning duplicate and a diagonal duplicate stay separate regions", () => { + const music = resolveGlanceRegions(QUADRANT_LAYOUT, ["music", "none", "music", "none"], spans); + assert.deepEqual(music.map((region) => region.slots), [[0], [2]]); + const diagonal = resolveGlanceRegions(QUADRANT_LAYOUT, ["terminal", "none", "none", "terminal"], spans); + assert.deepEqual(diagonal.map((region) => region.slots), [[0], [3]]); +}); + +test("empty slots produce no region", () => { + assert.deepEqual(resolveGlanceRegions(QUADRANT_LAYOUT, ["none", "none", "none", "none"], spans), []); +}); + +test("dividers: left edges of the right column, top edges of the bottom row, minus merged interiors", () => { + const { slotDividers } = require("../.test-build/app/apps/glanceboard/layout.js"); + const single = resolveGlanceRegions(QUADRANT_LAYOUT, ["music", "compass", "none", "none"], spans); + assert.deepEqual(slotDividers(QUADRANT_LAYOUT, single), [ + { x0: 288, y0: 0, x1: 288, y1: 143 }, + { x0: 0, y0: 144, x1: 287, y1: 144 }, + { x0: 288, y0: 144, x1: 288, y1: 287 }, + { x0: 288, y0: 144, x1: 575, y1: 144 }, + ]); + // A tall Terminal on the left drops the line across the left column only. + const tall = resolveGlanceRegions(QUADRANT_LAYOUT, ["terminal", "music", "terminal", "none"], spans); + assert.deepEqual(slotDividers(QUADRANT_LAYOUT, tall), [ + { x0: 288, y0: 0, x1: 288, y1: 143 }, + { x0: 288, y0: 144, x1: 288, y1: 287 }, + { x0: 288, y0: 144, x1: 575, y1: 144 }, + ]); +}); diff --git a/tests/music-settings.test.cjs b/tests/music-settings.test.cjs new file mode 100644 index 00000000..d09aeb88 --- /dev/null +++ b/tests/music-settings.test.cjs @@ -0,0 +1,231 @@ +const test = require('node:test'); +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const os = require('node:os'); +const path = require('node:path'); +const vm = require('node:vm'); +const { execFileSync } = require('node:child_process'); +const ts = require('typescript'); + +const source = (file) => fs.readFileSync(path.join(__dirname, '..', file), 'utf8'); +function load(file, requireModule, globals = {}) { + const context = { exports: {}, require: requireModule, console, ...globals }; + vm.runInNewContext(ts.transpileModule(source(file), { + compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 }, + }).outputText, context); + return context.exports; +} +function store(settings = new Map()) { + const listeners = []; + const storage = { + getStringSetting: (key, fallback) => settings.get(key) ?? fallback, + setStringSetting: (key, value) => { + settings.set(key, value); + for (const listener of listeners) listener(key); + }, + onSettingsStoreChanged: (listener) => { listeners.push(listener); return () => {}; }, + }; + return { prefs: load('app/native/media-apps.ts', () => storage), storage }; +} +const chrome = { packageName: 'com.android.chrome', appName: 'Chrome' }; +const player = { packageName: 'com.player', appName: 'Player' }; + +test('defaults apply before discovery; explicit choices survive restart, renames and rediscovery', () => { + const settings = new Map(); + let { prefs } = store(settings); + assert.equal(prefs.isMediaAppEnabled(chrome.packageName), false); + assert.equal(prefs.isMediaAppEnabled(player.packageName), true); + assert.equal(prefs.isMediaAppEnabled('com.android.chrome.music'), true); + prefs.rememberMediaApps([chrome, player, player, { packageName: '', appName: 'Invalid' }]); + assert.equal(prefs.readMediaApps().length, 2); + prefs.setMediaAppEnabled({ ...chrome, title: 'Do not store metadata' }, true); + prefs.setMediaAppEnabled(player, false); + ({ prefs } = store(settings)); + prefs.rememberMediaApps([{ ...player, appName: 'Renamed player' }, chrome]); + assert.equal(prefs.isMediaAppEnabled(chrome.packageName), true); + assert.equal(prefs.isMediaAppEnabled(player.packageName), false); + assert.equal(prefs.readMediaApps().find((a) => a.packageName === player.packageName).appName, 'Renamed player'); + assert.ok(!Array.from(settings.values()).join('').includes('Do not store metadata')); + prefs.rememberMediaApps([]); + assert.equal(prefs.readMediaApps().length, 2); + prefs.setMediaAppEnabled(player, true); + prefs.setMediaAppEnabled(chrome, false); + assert.equal(store(settings).prefs.isMediaAppEnabled(player.packageName), true); + assert.equal(store(settings).prefs.isMediaAppEnabled(chrome.packageName), false); +}); + +test('malformed saved entries preserve defaults, and discovery does not freeze defaults', () => { + for (const raw of ['invalid', '{}', '[null, {}, {"packageName": 1}]', + '[{"packageName":"com.android.chrome","enabled":"true"}]']) { + const { prefs } = store(new Map([['music.apps', raw]])); + assert.equal(prefs.isMediaAppEnabled(chrome.packageName), false); + assert.equal(prefs.isMediaAppEnabled(player.packageName), true); + } + const { prefs } = store(); + prefs.rememberMediaApps([chrome]); + assert.equal(prefs.readMediaApps()[0].enabled, undefined); +}); + +function bridges() { + const { prefs, storage } = store(); + let browserListener, controllerListener, ignored, queries = 0, disconnects = 0, plays = 0; + const browsable = [chrome, player].map((app) => ({ ...app, serviceClass: `${app.packageName}.Browser` })); + class NativeBrowser { + setListener(listener) { browserListener = listener; } + listBrowsableAppsJson() { queries++; return JSON.stringify(browsable); } + connect(id) { browserListener.onConnectResult(id, true, 'root', ''); } + disconnect() { disconnects++; } + playFromMediaId() { plays++; } + } + class NativeController { + setIgnoredPackagesJson(json) { ignored = JSON.parse(json); } + setListener(listener) { controllerListener = listener; } + start() { assert.ok(ignored.includes(chrome.packageName)); } + } + const dependencies = { + '@nativescript/core': { Utils: { android: { getApplicationContext: () => ({}) } } }, + './media-apps': prefs, + './settings-store': storage, + '../graphics/image': {}, + './image-files': {}, + }; + const globals = { global: { isAndroid: true }, com: { faceclaw: { app: { + FaceclawMediaBrowser: NativeBrowser, + FaceclawMediaBrowserListener: function(listener) { return listener; }, + FaceclawMediaController: NativeController, + FaceclawMediaControllerListener: function(listener) { return listener; }, + } } } }; + const requireModule = (name) => { assert.ok(name in dependencies, name); return dependencies[name]; }; + const browser = load('app/native/media-browser.ts', requireModule, globals).mediaBrowserBridge; + const controller = load('app/native/media-controller.ts', requireModule, globals).mediaControllerBridge; + return { prefs, browser, controller, browsable, queries: () => queries, disconnects: () => disconnects, + plays: () => plays, ignored: () => ignored, observed: (apps) => controllerListener.onSessionAppsChanged(JSON.stringify(apps)) }; +} + +test('browse discovery remembers ignored apps and cached results reflect toggles immediately', async () => { + const b = bridges(); + assert.deepEqual(Array.from(b.browser.listBrowsableApps(), (a) => a.packageName), [player.packageName]); + assert.equal(b.prefs.readMediaApps().length, 2); + b.prefs.setMediaAppEnabled(chrome, true); + assert.equal(b.browser.listBrowsableApps().length, 2); + assert.equal(b.queries(), 1); + await b.browser.connect(b.browsable[0]); + b.browser.playFromMediaId('song'); + assert.equal(b.plays(), 1); + b.prefs.setMediaAppEnabled(chrome, false); + assert.equal(b.disconnects(), 1); + b.browser.playFromMediaId('song'); + assert.equal(b.plays(), 1); + await assert.rejects(b.browser.connect(b.browsable[0]), /ignored/); + b.prefs.setMediaAppEnabled(player, false); + assert.equal(b.browser.listBrowsableApps().length, 0); +}); + +test('native controller gets defaults before start and records all session owners, retaining ended sessions', async () => { + const b = bridges(); + await b.controller.start(); + b.observed([chrome, player]); + b.observed([]); + assert.equal(b.prefs.readMediaApps().length, 2); + b.prefs.setMediaAppEnabled(chrome, true); + b.prefs.setMediaAppEnabled(player, false); + assert.ok(!b.ignored().includes(chrome.packageName)); + assert.ok(b.ignored().includes(player.packageName)); +}); + +test('Music settings keeps toggles and selection when a new app arrives and supports back', async () => { + const { prefs } = store(); + let refreshes = 0, closes = 0; + const textwrap = load('app/graphics/textwrap.ts'); + const graphics = load('app/graphics/image.ts', () => textwrap); + const { BdfFont } = load('app/graphics/bdffont.ts', () => ({})); + const font = BdfFont.parse(source('app/fonts/terminus/ter-u20n.bdf')); + class RecordingImage extends graphics.GrayImage { + texts = []; + drawText(font, x, y, text, value) { this.texts.push({ x, y, text }); super.drawText(font, x, y, text, value); } + } + const deps = { + '../graphics/image': { ...graphics, GrayImage: RecordingImage }, + '../graphics/textwrap': textwrap, + '../graphics/ui-fonts': { getDefaultSmallFont: () => font }, + '../util/numeric-util': { clamp: (n, lo, hi) => Math.max(lo, Math.min(hi, n)) }, + './metrics': load('app/ui/metrics.ts'), './gestures': {}, + }; + const menu = load('app/ui/menu.ts', (name) => deps[name]); + const uiDeps = { + '../../graphics/image': deps['../graphics/image'], + '../../graphics/textwrap': textwrap, + '../../graphics/ui-fonts': deps['../graphics/ui-fonts'], + '../../native/media-apps': prefs, + '../../native/media-browser': { mediaBrowserBridge: { listBrowsableApps: (refresh) => { + assert.equal(refresh, true); refreshes++; prefs.rememberMediaApps([player]); return []; + } } }, + '../../ui/menu': menu, + }; + const { MusicSettingsLayer } = load('app/apps/music/music-settings.ts', (name) => uiDeps[name]); + const layer = new MusicSettingsLayer(); + const ctx = { stack: { getBaseSize: () => ({ width: 540, height: 224 }), isFocused: () => true, pop: () => closes++ } }; + const paint = () => layer.paint(ctx, () => new RecordingImage(540, 224)); + const input = (type) => layer.handleInput({ type }, ctx); + assert.equal(refreshes, 1); + paint(); + await input('click'); + assert.equal(prefs.isMediaAppEnabled(player.packageName), false); + prefs.rememberMediaApps([{ packageName: 'com.alpha', appName: 'Alpha' }]); + const image = paint(); + assert.ok(image.texts.some(({ text }) => text === 'Player')); + assert.ok(image.texts.some(({ text }) => text === 'Alpha')); + assert.ok(image.texts.every(({ y }) => y >= 0 && y + font.lineHeight <= image.height)); + await input('click'); + assert.equal(prefs.isMediaAppEnabled(player.packageName), true); + await input('double-click'); + assert.equal(closes, 1); +}); + +test('native session selection skips ignored playing and idle apps, including the all-ignored case', () => { + // Execute the production selection method with lightweight media-session doubles. + const java = source('App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawMediaController.java'); + const method = java.slice(java.indexOf(' private MediaController chooseController('), + java.indexOf(' private void emitSessionAppsLocked(')); + const directory = fs.mkdtempSync(path.join(os.tmpdir(), 'faceclaw-media-java-')); + const javaBin = (name) => process.env.JAVA_HOME ? path.join(process.env.JAVA_HOME, 'bin', name) : name; + try { + const file = path.join(directory, 'MediaSelectionTest.java'); + fs.writeFileSync(file, `import java.util.*; +public class MediaSelectionTest { + Set ignoredPackages = new HashSet<>(); + static class PlaybackState { + static final int STATE_PLAYING = 3; + int state; PlaybackState(int state) { this.state = state; } int getState() { return state; } + } + static class MediaController { + String name; PlaybackState state; + MediaController(String name, int state) { this.name = name; this.state = new PlaybackState(state); } + String getPackageName() { return name; } PlaybackState getPlaybackState() { return state; } + } + ${method} + public static void main(String[] args) { + MediaSelectionTest test = new MediaSelectionTest(); + MediaController ignored = new MediaController("browser", 3); + MediaController paused = new MediaController("player", 2); + MediaController playing = new MediaController("music", 3); + test.ignoredPackages.add("browser"); + assert test.chooseController(Arrays.asList(ignored, paused)) == paused; + assert test.chooseController(Arrays.asList(ignored, paused, playing)) == playing; + assert test.chooseController(Arrays.asList(ignored)) == null; + ignored.state = null; + assert test.chooseController(Arrays.asList(ignored, paused)) == paused; + test.ignoredPackages.add("music"); + assert test.chooseController(Arrays.asList(ignored, paused, playing)) == paused; + test.ignoredPackages.remove("browser"); ignored.state = new PlaybackState(3); + assert test.chooseController(Arrays.asList(ignored, paused)) == ignored; + assert test.chooseController(null) == null; + assert test.chooseController(Collections.emptyList()) == null; + } +}`); + execFileSync(javaBin('javac'), ['-d', directory, file], { stdio: 'pipe' }); + execFileSync(javaBin('java'), ['-ea', '-cp', directory, 'MediaSelectionTest'], { stdio: 'pipe' }); + } finally { + fs.rmSync(directory, { recursive: true, force: true }); + } +}); diff --git a/tests/pinball.test.cjs b/tests/pinball.test.cjs new file mode 100644 index 00000000..cb80e062 --- /dev/null +++ b/tests/pinball.test.cjs @@ -0,0 +1,169 @@ +const test = require('node:test'); +const assert = require('node:assert/strict'); +const worker = require('./fixtures/pinball-worker.cjs'); + +function lane(h, index) { + h.w.ballX = h.ROLLOVERS[index].x; + h.w.ballY = h.ROLLOVERS[index].y; + h.checkRollovers(h.w); + h.w.ballY = 60; + h.checkRollovers(h.w); +} + +function target(h, index) { + const t = h.TARGETS[index]; + h.w.ballX = t.x + (index < 3 ? 7 : -7); + h.w.ballY = t.y; + h.w.ballVx = index < 3 ? -50 : 50; + h.checkTargets(h.w); +} + +test('skill shot awards only the marked first lane; rollovers debounce and raise multiplier to 5x', () => { + const h = worker(); + h.launchBall(h.w); + lane(h, 0); + assert.equal(h.w.score, 800); + lane(h, 0); + assert.equal(h.w.score, 800); + lane(h, 1); lane(h, 2); + assert.equal(h.w.score, 1400); + assert.equal(h.w.multiplier, 2); + for (let round = 0; round < 6; round++) for (let i = 0; i < 3; i++) lane(h, i); + assert.equal(h.w.multiplier, 5); + const missed = worker(); + missed.launchBall(missed.w); + lane(missed, 1); lane(missed, 0); + assert.equal(missed.w.score, 100); +}); + +test('six distinct drop targets light a repeatable, escalating center jackpot', () => { + const h = worker(); + h.launchBall(h.w); + for (let i = 0; i < 6; i++) { target(h, i); target(h, i); } + assert.equal(h.w.score, 1900); + assert.ok(h.w.targetsDown.every(Boolean)); + h.w.ballX = 121; h.w.ballY = 110; + h.collideBumpers(h.w); + assert.equal(h.w.score, 4000); + assert.equal(h.w.jackpots, 1); + assert.ok(h.w.targetsDown.every((value) => !value)); + for (let i = 0; i < 6; i++) target(h, i); + h.w.ballX = 121; h.w.ballY = 110; + h.collideBumpers(h.w); + assert.equal(h.w.score, 9000); + assert.equal(h.w.jackpots, 2); +}); + +test('ball saver preserves objectives once, then a drain pays multiplied bonus and resets the ball', () => { + const h = worker(); + h.launchBall(h.w); + target(h, 0); + h.w.multiplier = 3; + h.ballDrained(h.w); + assert.equal(h.w.ballsLeft, 3); + assert.equal(h.w.ballState, 'ready'); + assert.equal(h.w.targetsDown[0], true); + h.launchBall(h.w); + assert.equal(h.w.ballSaveRemaining, 0); + assert.equal(h.w.skillShotRemaining, 0); + h.ballDrained(h.w); + assert.equal(h.w.ballsLeft, 2); + assert.equal(h.w.lastBonus, 300); + assert.equal(h.w.score, 450); + assert.equal(h.highScore(), 450); + assert.equal(h.w.multiplier, 1); + assert.equal(h.w.skillLane, 1); + assert.ok(h.w.targetsDown.every((value) => !value)); + h.launchBall(h.w); + assert.equal(h.w.ballSaveRemaining, 8); +}); + +test('tilt disables awards, objective progress, saver and drain bonus', () => { + const h = worker(); + h.launchBall(h.w); target(h, 0); + h.nudge(h.w); h.nudge(h.w); h.nudge(h.w); + assert.equal(h.w.tilted, true); + lane(h, 0); target(h, 1); + h.w.ballX = 121; h.w.ballY = 110; h.collideBumpers(h.w); + assert.equal(h.w.score, 150); + assert.equal(h.w.targetsDown[1], false); + assert.ok(h.w.rolloverLit.every((value) => !value)); + h.ballDrained(h.w); + assert.equal(h.w.ballsLeft, 2); + assert.equal(h.w.lastBonus, 0); + assert.equal(h.w.score, 150); +}); + +test('pause, background, screen-off and menus preserve gameplay timers', () => { + for (const suspend of [ + (h) => h.input('double-click'), + (h) => h.input('short-then-long-press'), + (h) => h.message({ type: 'foreground', windowId: 'test', foreground: false, focused: false }), + (h) => h.message({ type: 'screen', on: false }), + ]) { + const h = worker(); h.launchBall(h.w); suspend(h); + h.elapse(60); h.tick(h.w); + assert.equal(h.w.ballSaveRemaining, 8); + assert.equal(h.w.skillShotRemaining, 8); + } +}); + +test('expired saver drains normally; final bonus is included in game over and restart keeps high score', () => { + const h = worker(); + for (let i = 0; i < 3; i++) { + h.launchBall(h.w); target(h, 0); + h.w.ballSaveRemaining = 0; + h.ballDrained(h.w); + } + assert.equal(h.w.phase, 'game-over'); + assert.equal(h.w.score, 750); + assert.equal(h.w.lastBonus, 100); + h.resetGame(h.w); + assert.equal(h.w.score, 0); + assert.equal(h.w.ballsLeft, 3); + assert.equal(h.w.lastBonus, 0); + assert.equal(h.w.highScore, 750); +}); + +test('live simulation consumes skill and save time; wall-clock pauses do not', () => { + const h = worker(); h.launchBall(h.w); + h.advance(0.25); + assert.ok(Math.abs(h.w.ballSaveRemaining - 7.75) < 0.001); + assert.ok(Math.abs(h.w.skillShotRemaining - 7.75) < 0.001); + h.input('double-click'); h.elapse(90); h.input('click'); + h.advance(0.25); + assert.ok(Math.abs(h.w.ballSaveRemaining - 7.5) < 0.001); + assert.ok(Math.abs(h.w.skillShotRemaining - 7.5) < 0.001); + h.w.skillShotRemaining = 0; + lane(h, 0); + assert.equal(h.w.score, 50); +}); + +test('production physics stays finite and within the table at every launch power', () => { + for (let power = 1; power <= 5; power++) { + const h = worker(); h.w.launchPower = power; h.launchBall(h.w); + let enteredPlayfield = false; + for (let step = 0; step < 120 * 30 && h.w.ballState === 'live'; step++) { + if (h.w.ballVy > 0 && h.w.ballY > 195) for (const f of h.w.flippers) h.flip(h.w, f); + h.advance(1 / 120); + assert.ok(Number.isFinite(h.w.ballX) && Number.isFinite(h.w.ballY)); + assert.ok(h.w.ballX >= 9 && h.w.ballX <= 261); + if (h.w.ballX < 226) enteredPlayfield = true; + } + assert.ok(enteredPlayfield, `power ${power} enters playfield`); + } +}); + +test('ready, live jackpot, paused and game-over frames render at the glasses viewport size', () => { + const h = worker(); + for (const phase of ['playing', 'paused', 'game-over']) { + h.w.phase = phase; + for (const lit of [false, true]) { + h.w.targetsDown.fill(lit); + const image = h.paintContent(h.w); + assert.equal(image.width, 576); + assert.equal(image.height, 260); + assert.ok(image.withDrawsBaked().pixels.some((p) => p > 0)); + } + } +}); diff --git a/tests/ring-battery-protocol.test.cjs b/tests/ring-battery-protocol.test.cjs new file mode 100644 index 00000000..eebaea03 --- /dev/null +++ b/tests/ring-battery-protocol.test.cjs @@ -0,0 +1,19 @@ +const test = require('node:test'); +const fs = require('node:fs'); +const os = require('node:os'); +const path = require('node:path'); +const { execFileSync } = require('node:child_process'); + +test('ring battery decodes valid, unavailable, legacy, and malformed reports', () => { + const directory = fs.mkdtempSync(path.join(os.tmpdir(), 'faceclaw-ring-java-')); + const javaBin = (name) => process.env.JAVA_HOME ? path.join(process.env.JAVA_HOME, 'bin', name) : name; + try { + execFileSync(javaBin('javac'), ['-d', directory, + path.join(__dirname, '../App_Resources/Android/src/main/java/com/faceclaw/app/g2protocol/BleProtocol.java'), + path.join(__dirname, '../App_Resources/Android/src/main/java/com/faceclaw/app/util/CollectionUtils.java'), + path.join(__dirname, 'fixtures/RingBatteryProtocolTest.java')], { stdio: 'pipe' }); + execFileSync(javaBin('java'), ['-ea', '-cp', directory, 'com.faceclaw.app.RingBatteryProtocolTest'], { stdio: 'pipe' }); + } finally { + fs.rmSync(directory, { recursive: true, force: true }); + } +}); diff --git a/tests/tsconfig.json b/tests/tsconfig.json index f59d85f9..b575de39 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -17,6 +17,8 @@ "../app/g2/even-advertisement.ts", "../app/g2/glasses-artwork.ts", "../app/g2/glasses-display-state.ts", + "../app/g2/glance-state.ts", + "../app/apps/glanceboard/layout.ts", "../app/g2/pairing-candidates.ts", "../app/apps/calculator/math/*.ts", "../app/apps/microphones/mic-protocol.ts", diff --git a/wear/PROTOCOL.md b/wear/PROTOCOL.md index b67647b1..43215491 100644 --- a/wear/PROTOCOL.md +++ b/wear/PROTOCOL.md @@ -18,7 +18,7 @@ answered on `/faceclaw/ack`. | Path | Payload | Effect | | --- | --- | --- | -| `/faceclaw/input` | `{gesture, steps?}` | A ring gesture through the same path as the phone UI's test buttons. `gesture` ∈ `click`, `double-click`, `scroll-up`, `scroll-down`, `long-press` (complete short hold), `long-press-start`, `long-press-release`, `short-then-long-press` (tap then hold: the app's context menu; a plain `long-press` is the glasses' system menu), `wakeword` ("Hey Even"), `swipe-up`, `swipe-down`, `swipe-left`, `swipe-right` (spatial input only a watch can produce: delivered to the glasses UI as `swipe-*` events for components that navigate spatially — launcher grid, settings columns, sidebar, Music — with a scroll / click / double-click fallback elsewhere). `steps` (1–12) repeats a scroll. Refused while the glasses are disconnected. The lock screen is honoured exactly as for the ring. While the display is off, only a double-click is accepted and it wakes the display. | +| `/faceclaw/input` | `{gesture, steps?}` | A ring gesture through the same path as the phone UI's test buttons. `gesture` ∈ `click`, `double-click`, `scroll-up`, `scroll-down`, `long-press` (complete short hold), `long-press-start`, `long-press-release`, `short-then-long-press` (tap then hold: the app's context menu; a plain `long-press` is the glasses' system menu), `wakeword` ("Hey Even"), `swipe-up`, `swipe-down`, `swipe-left`, `swipe-right` (spatial input only a watch can produce: delivered to the glasses UI as `swipe-*` events for components that navigate spatially — launcher grid, settings columns, sidebar, Music — with a scroll / click / double-click fallback elsewhere). `steps` (1–12) repeats a scroll. Refused while the glasses are disconnected. The lock screen is honoured exactly as for the ring. While the display is off, a double-click wakes the display, a `click` shows the phone's Glanceboard for a few seconds, and `long-press-start`/`long-press-release` hold it up; everything else is ignored. | | `/faceclaw/command` | `{command, …}` | `launch-app {appId}`, `focus-window {windowId}`, `close-window {windowId}`, `sidebar`, `wake`, `sleep`, `lock`, `unlock`, `connect`, `disconnect`, `close-assistant`, `display-mode {value}` (`value` ∈ `576x288`, `576x480`, `640x480`; sets the phone's Display > Display mode). Everything but connect/disconnect needs a connection; everything but lock/unlock is refused while locked; `unlock` also needs the phone's "Watch can unlock glasses" setting. | | `/faceclaw/assistant` | `{text}` | Send a query to the assistant (`shell.sendToAssistant`) — the reply shows on the glasses and streams back to the watch as events. | | `/faceclaw/text` | `{text}` | Type text into the foreground window (`receiveTextInput`, e.g. the terminal). Refused when the window doesn't take text. | diff --git a/wear/app/src/main/kotlin/com/faceclaw/wear/MainActivity.kt b/wear/app/src/main/kotlin/com/faceclaw/wear/MainActivity.kt index 41274bd9..98b88121 100644 --- a/wear/app/src/main/kotlin/com/faceclaw/wear/MainActivity.kt +++ b/wear/app/src/main/kotlin/com/faceclaw/wear/MainActivity.kt @@ -139,16 +139,13 @@ class MainActivity : ComponentActivity() { if (event.repeatCount == 0) { cancelStemHold() stemHoldSent = false - stemOneIgnored = glassesScreenIsOff() - if (stemOneIgnored) return true + // A dark display takes the stem too: a press shows the + // phone's Glanceboard, a hold keeps it up until release. + stemOneIgnored = false val runnable = Runnable { - if (glassesScreenIsOff()) { - stemOneIgnored = true - } else { - stemHoldSent = true - haptics.heavy() - link.sendGesture(Gesture.LONG_PRESS_START) - } + stemHoldSent = true + haptics.heavy() + link.sendGesture(Gesture.LONG_PRESS_START) } stemHoldRunnable = runnable stemHandler.postDelayed(runnable, STEM_HOLD_MS) @@ -184,7 +181,7 @@ class MainActivity : ComponentActivity() { stemHoldSent = false haptics.click() link.sendGesture(Gesture.LONG_PRESS_RELEASE) - } else if (!glassesScreenIsOff()) { + } else { haptics.click() link.sendGesture(Gesture.CLICK) } diff --git a/wear/app/src/main/kotlin/com/faceclaw/wear/ui/RemoteScreen.kt b/wear/app/src/main/kotlin/com/faceclaw/wear/ui/RemoteScreen.kt index 471fd45c..3f637f5f 100644 --- a/wear/app/src/main/kotlin/com/faceclaw/wear/ui/RemoteScreen.kt +++ b/wear/app/src/main/kotlin/com/faceclaw/wear/ui/RemoteScreen.kt @@ -143,8 +143,16 @@ fun RemoteScreen( fun glassesScreenIsOff(): Boolean = currentState?.connected == true && currentState?.screenOn == false + // A dark display still takes a double-click (wake), and a tap or a hold + // (the phone's Glanceboard: a tap shows it for a few seconds, a hold + // until released). Scrolls, swipes and the menu gesture mean nothing + // there, so they are dropped here without a buzz. fun gestureAllowed(gesture: Gesture): Boolean = - !glassesScreenIsOff() || gesture == Gesture.DOUBLE_CLICK + !glassesScreenIsOff() || + gesture == Gesture.DOUBLE_CLICK || + gesture == Gesture.CLICK || + gesture == Gesture.LONG_PRESS_START || + gesture == Gesture.LONG_PRESS_RELEASE fun scroll(gesture: Gesture, steps: Int) { if (!gestureAllowed(gesture)) return @@ -186,7 +194,7 @@ fun RemoteScreen( } }, onLongPressStart = { - longPressSent = !glassesScreenIsOff() + longPressSent = gestureAllowed(Gesture.LONG_PRESS_START) if (longPressSent) { haptics.heavy() link.sendGesture(Gesture.LONG_PRESS_START)