import { readFile } from 'node:fs/promises'
import { resolve } from 'node:path'

const root = resolve(new URL('..', import.meta.url).pathname)
const report = JSON.parse(await readFile(resolve(root, 'config/chrome-planegcs-verification.json'), 'utf8'))
if (report.schemaVersion !== 1 || report.browserId !== 'chrome' || report.executionContext !== 'dedicated-worker' || report.status !== 'pass' || report.crossOriginIsolated !== true || report.sharedArrayBuffer !== true) throw new Error('Chrome planegcs dedicated Worker, isolation, or browser verification is not passing.')
if (report.solve?.solveStatus > 1 || Math.abs(report.solve?.startY - report.solve?.endY) > 1e-7 || Math.abs(report.solve?.residual) > 1e-7 || Math.abs(Math.hypot(report.solve?.endX - report.solve?.startX, report.solve?.endY - report.solve?.startY) - 5) > 1e-7) throw new Error('Chrome planegcs solve evidence is invalid.')
if (report.verticalSolve?.solveStatus > 1 || Math.abs(report.verticalSolve?.startX - report.verticalSolve?.endX) > 1e-7 || Math.abs(report.verticalSolve?.residual) > 1e-7 || Math.abs(Math.hypot(report.verticalSolve?.endX - report.verticalSolve?.startX, report.verticalSolve?.endY - report.verticalSolve?.startY) - 5) > 1e-7) throw new Error('Chrome vertical planegcs solve evidence is invalid.')
if (report.distanceXSolve?.solveStatus > 1 || Math.abs(report.distanceXSolve?.endX - report.distanceXSolve?.startX - 6) > 1e-7 || Math.abs(report.distanceXSolve?.startY - report.distanceXSolve?.endY) > 1e-7 || Math.abs(report.distanceXSolve?.residual) > 1e-7) throw new Error('Chrome distanceX planegcs solve evidence is invalid.')
if (report.distanceYSolve?.solveStatus > 1 || Math.abs(report.distanceYSolve?.endY - report.distanceYSolve?.startY - 6) > 1e-7 || Math.abs(report.distanceYSolve?.startX - report.distanceYSolve?.endX) > 1e-7 || Math.abs(report.distanceYSolve?.residual) > 1e-7) throw new Error('Chrome distanceY planegcs solve evidence is invalid.')
if (report.angleSolve?.solveStatus > 1 || Math.abs(Math.hypot(report.angleSolve?.endX - report.angleSolve?.startX, report.angleSolve?.endY - report.angleSolve?.startY) - 5) > 1e-7 || Math.abs(Math.atan2(report.angleSolve?.endY - report.angleSolve?.startY, report.angleSolve?.endX - report.angleSolve?.startX) - report.angleSolve?.targetAngle) > 1e-7 || Math.abs(report.angleSolve?.lengthResidual) > 1e-7 || Math.abs(report.angleSolve?.residual) > 1e-7) throw new Error('Chrome angle planegcs solve evidence is invalid.')
if (report.circleRadiusSolve?.solveStatus > 1 || Math.abs(report.circleRadiusSolve?.centerX - 2) > 1e-7 || Math.abs(report.circleRadiusSolve?.centerY - 3) > 1e-7 || Math.abs(report.circleRadiusSolve?.radius - 4) > 1e-7 || Math.abs(report.circleRadiusSolve?.residual) > 1e-7) throw new Error('Chrome circle radius planegcs solve evidence is invalid.')
if (report.circleDiameterSolve?.solveStatus > 1 || Math.abs(report.circleDiameterSolve?.centerX - 2) > 1e-7 || Math.abs(report.circleDiameterSolve?.centerY - 3) > 1e-7 || Math.abs(report.circleDiameterSolve?.radius * 2 - 8) > 1e-7 || Math.abs(report.circleDiameterSolve?.residual) > 1e-7) throw new Error('Chrome circle diameter planegcs solve evidence is invalid.')
if (report.equalLinesSolve?.solveStatus > 1 || Math.abs(Math.hypot(report.equalLinesSolve?.firstEndX - report.equalLinesSolve?.firstStartX, report.equalLinesSolve?.firstEndY - report.equalLinesSolve?.firstStartY) - Math.hypot(report.equalLinesSolve?.secondEndX - report.equalLinesSolve?.secondStartX, report.equalLinesSolve?.secondEndY - report.equalLinesSolve?.secondStartY)) > 1e-7 || Math.abs(report.equalLinesSolve?.residual) > 1e-7) throw new Error('Chrome equal-length planegcs solve evidence is invalid.')
if (report.equalCirclesSolve?.solveStatus > 1 || Math.abs(report.equalCirclesSolve?.firstCenterX - 2) > 1e-7 || Math.abs(report.equalCirclesSolve?.firstCenterY - 3) > 1e-7 || Math.abs(report.equalCirclesSolve?.firstRadius - 4) > 1e-7 || Math.abs(report.equalCirclesSolve?.secondCenterX - 8) > 1e-7 || Math.abs(report.equalCirclesSolve?.secondCenterY - 9) > 1e-7 || Math.abs(report.equalCirclesSolve?.secondRadius - 4) > 1e-7 || Math.abs(report.equalCirclesSolve?.residual) > 1e-7) throw new Error('Chrome equal-radius planegcs solve evidence is invalid.')
if (report.tangentCirclesSolve?.solveStatus > 1 || Math.abs(report.tangentCirclesSolve?.firstCenterX - 2) > 1e-7 || Math.abs(report.tangentCirclesSolve?.firstCenterY - 3) > 1e-7 || Math.abs(report.tangentCirclesSolve?.firstRadius - 4) > 1e-7 || Math.abs(report.tangentCirclesSolve?.secondCenterX - 10) > 1e-7 || Math.abs(report.tangentCirclesSolve?.secondCenterY - 3) > 1e-7 || Math.abs(report.tangentCirclesSolve?.secondRadius - 4) > 1e-7 || Math.abs(report.tangentCirclesSolve?.residual) > 1e-7) throw new Error('Chrome tangent-circle planegcs solve evidence is invalid.')
if (report.pointSymmetrySolve?.solveStatus > 1 || Math.abs(report.pointSymmetrySolve?.firstX - 1) > 1e-7 || Math.abs(report.pointSymmetrySolve?.firstY - 2) > 1e-7 || Math.abs(report.pointSymmetrySolve?.secondX - 7) > 1e-7 || Math.abs(report.pointSymmetrySolve?.secondY - 10) > 1e-7 || Math.abs(report.pointSymmetrySolve?.centerX - 4) > 1e-7 || Math.abs(report.pointSymmetrySolve?.centerY - 6) > 1e-7 || Math.abs(report.pointSymmetrySolve?.residual) > 1e-7) throw new Error('Chrome point-symmetry planegcs solve evidence is invalid.')
if (report.pointOnLineSolve?.solveStatus > 1 || Math.abs(report.pointOnLineSolve?.pointX - 2) > 1e-7 || Math.abs(report.pointOnLineSolve?.pointY) > 1e-7 || Math.abs(report.pointOnLineSolve?.startX) > 1e-7 || Math.abs(report.pointOnLineSolve?.startY) > 1e-7 || Math.abs(report.pointOnLineSolve?.endX - 4) > 1e-7 || Math.abs(report.pointOnLineSolve?.endY) > 1e-7 || Math.abs(report.pointOnLineSolve?.residual) > 1e-7) throw new Error('Chrome point-on-line planegcs solve evidence is invalid.')
if (report.pointOnCircleSolve?.solveStatus > 1 || Math.abs(report.pointOnCircleSolve?.pointX - 4) > 1e-7 || Math.abs(report.pointOnCircleSolve?.pointY - 6.464101615137754) > 1e-7 || Math.abs(report.pointOnCircleSolve?.centerX - 2) > 1e-7 || Math.abs(report.pointOnCircleSolve?.centerY - 3) > 1e-7 || Math.abs(report.pointOnCircleSolve?.radius - 4) > 1e-7 || Math.abs(report.pointOnCircleSolve?.residual) > 1e-7) throw new Error('Chrome point-on-circle planegcs solve evidence is invalid.')
if (report.pointOnCircleProvider?.completed !== 'completed' || Math.abs(report.pointOnCircleProvider?.point?.x - 4) > 1e-7 || Math.abs(report.pointOnCircleProvider?.point?.y - 6.464101615137754) > 1e-7) throw new Error('Chrome point-on-circle planegcs provider evidence is invalid.')
if (report.pointOnArcSolve?.solveStatus > 1 || Math.abs(report.pointOnArcSolve?.pointX - 2) > 1e-7 || Math.abs(report.pointOnArcSolve?.pointY - 7) > 1e-7 || Math.abs(report.pointOnArcSolve?.centerX - 2) > 1e-7 || Math.abs(report.pointOnArcSolve?.centerY - 3) > 1e-7 || Math.abs(report.pointOnArcSolve?.radius - 4) > 1e-7 || Math.abs(report.pointOnArcSolve?.startAngle) > 1e-7 || Math.abs(report.pointOnArcSolve?.endAngle - Math.PI) > 1e-7 || Math.abs(report.pointOnArcSolve?.residual) > 1e-7) throw new Error('Chrome point-on-arc planegcs solve evidence is invalid.')
if (report.pointOnArcProvider?.completed !== 'completed' || Math.abs(report.pointOnArcProvider?.point?.x - 2) > 1e-7 || Math.abs(report.pointOnArcProvider?.point?.y - 7) > 1e-7 || Math.abs(report.pointOnArcProvider?.arc?.center?.x - 2) > 1e-7 || Math.abs(report.pointOnArcProvider?.arc?.center?.y - 3) > 1e-7 || Math.abs(report.pointOnArcProvider?.arc?.radius - 4) > 1e-7 || Math.abs(report.pointOnArcProvider?.arc?.startAngle) > 1e-7 || Math.abs(report.pointOnArcProvider?.arc?.endAngle - Math.PI) > 1e-7) throw new Error('Chrome point-on-arc planegcs provider evidence is invalid.')
if (report.pointOnEllipseSolve?.solveStatus > 1 || Math.abs(report.pointOnEllipseSolve?.pointX - 2) > 1e-7 || Math.abs(report.pointOnEllipseSolve?.pointY - 6) > 1e-7 || Math.abs(report.pointOnEllipseSolve?.centerX - 2) > 1e-7 || Math.abs(report.pointOnEllipseSolve?.centerY - 3) > 1e-7 || Math.abs(report.pointOnEllipseSolve?.focusX - 6) > 1e-7 || Math.abs(report.pointOnEllipseSolve?.focusY - 3) > 1e-7 || Math.abs(report.pointOnEllipseSolve?.minorRadius - 3) > 1e-7 || Math.abs(report.pointOnEllipseSolve?.residual) > 1e-7) throw new Error('Chrome point-on-ellipse planegcs solve evidence is invalid.')
if (report.pointOnEllipseProvider?.completed !== 'completed' || Math.abs(report.pointOnEllipseProvider?.point?.x - 2) > 1e-7 || Math.abs(report.pointOnEllipseProvider?.point?.y - 6) > 1e-7 || Math.abs(report.pointOnEllipseProvider?.ellipse?.center?.x - 2) > 1e-7 || Math.abs(report.pointOnEllipseProvider?.ellipse?.center?.y - 3) > 1e-7 || Math.abs(report.pointOnEllipseProvider?.ellipse?.majorRadius - 5) > 1e-7 || Math.abs(report.pointOnEllipseProvider?.ellipse?.minorRadius - 3) > 1e-7 || Math.abs(report.pointOnEllipseProvider?.ellipse?.rotation) > 1e-7) throw new Error('Chrome point-on-ellipse planegcs provider evidence is invalid.')
if (report.pointOnBsplineSolve?.solveStatus > 1 || Math.abs(report.pointOnBsplineSolve?.pointX - 2) > 1e-7 || Math.abs(report.pointOnBsplineSolve?.pointY - 1.5) > 1e-7 || Math.abs(report.pointOnBsplineSolve?.pointParameter - 0.5) > 1e-7 || Math.abs(report.pointOnBsplineSolve?.residualX) > 1e-7 || Math.abs(report.pointOnBsplineSolve?.residualY) > 1e-7) throw new Error('Chrome point-on-B-spline planegcs solve evidence is invalid.')
if (report.pointOnBsplineProvider?.completed !== 'completed' || Math.abs(report.pointOnBsplineProvider?.point?.x - 2) > 1e-7 || Math.abs(report.pointOnBsplineProvider?.point?.y - 1.5) > 1e-7 || report.pointOnBsplineProvider?.bspline?.degree !== 3 || report.pointOnBsplineProvider?.bspline?.controlPoints?.length !== 4 || report.pointOnBsplineProvider?.bspline?.periodic !== false) throw new Error('Chrome point-on-B-spline planegcs provider evidence is invalid.')
if (report.blockProvider?.completed !== 'completed' || report.blockProvider?.degreesOfFreedom !== 0 || report.blockProvider?.line?.start?.x !== 1 || report.blockProvider?.line?.start?.y !== 2 || report.blockProvider?.line?.end?.x !== 4 || report.blockProvider?.line?.end?.y !== 6) throw new Error('Chrome planegcs Block provider evidence is invalid.')
if (report.parallelSolve?.solveStatus > 1 || Math.abs(report.parallelSolve?.firstEndY - report.parallelSolve?.firstStartY) > 1e-7 || Math.abs(report.parallelSolve?.secondEndY - report.parallelSolve?.secondStartY) > 1e-7 || Math.abs(report.parallelSolve?.secondEndX - 5) > 1e-7 || Math.abs(report.parallelSolve?.residual) > 1e-7) throw new Error('Chrome parallel planegcs solve evidence is invalid.')
if (report.perpendicularSolve?.solveStatus > 1 || Math.abs(report.perpendicularSolve?.firstEndY - report.perpendicularSolve?.firstStartY) > 1e-7 || Math.abs(report.perpendicularSolve?.secondEndX - report.perpendicularSolve?.secondStartX) > 1e-7 || Math.abs(report.perpendicularSolve?.secondEndY - 7) > 1e-7 || Math.abs(report.perpendicularSolve?.residual) > 1e-7) throw new Error('Chrome perpendicular planegcs solve evidence is invalid.')
if (report.coincidentSolve?.solveStatus > 1 || Math.abs(report.coincidentSolve?.firstEndX - report.coincidentSolve?.secondStartX) > 1e-7 || Math.abs(report.coincidentSolve?.firstEndY - report.coincidentSolve?.secondStartY) > 1e-7 || Math.abs(report.coincidentSolve?.residual) > 1e-7) throw new Error('Chrome coincident planegcs solve evidence is invalid.')
const expectedCoincidentPairs = ['start:start', 'start:end', 'end:start', 'end:end']
const validateCoincidentEndpointEvidence = (entries, provider) => Array.isArray(entries) && entries.length === 4 && entries.every((entry, index) => `${entry.firstPoint}:${entry.secondPoint}` === expectedCoincidentPairs[index] && (!provider || entry.completed === 'completed') && (!provider || Number.isFinite(entry.secondLength)) && (provider || entry.solveStatus <= 1) && Math.abs(entry.first?.x - entry.second?.x) <= 1e-7 && Math.abs(entry.first?.y - entry.second?.y) <= 1e-7 && Math.abs(entry.secondLength - 5) <= 1e-7 && (provider || Math.abs(entry.residual) <= 1e-7))
if (!validateCoincidentEndpointEvidence(report.coincidentEndpointSolves, false)) throw new Error('Chrome selectable Coincident Embind endpoint evidence is invalid.')
if (!validateCoincidentEndpointEvidence(report.coincidentEndpointProviders, true)) throw new Error('Chrome selectable Coincident provider endpoint evidence is invalid.')
const snellsSolve = report.snellsLawSolve
if (snellsSolve?.solveStatus > 1 || Math.abs(snellsSolve?.firstStart?.x - snellsSolve?.secondStart?.x) > 1e-7 || Math.abs(snellsSolve?.firstStart?.y - snellsSolve?.secondStart?.y) > 1e-7 || Math.abs(Math.hypot(snellsSolve?.secondEnd?.x - snellsSolve?.secondStart?.x, snellsSolve?.secondEnd?.y - snellsSolve?.secondStart?.y) - 5) > 1e-7 || Math.abs(snellsSolve?.boundaryStart?.y) > 1e-7 || Math.abs(snellsSolve?.boundaryEnd?.y) > 1e-7 || snellsSolve?.ratio !== 1.5 || Math.abs(snellsSolve?.residual) > 1e-7) throw new Error('Chrome SnellsLaw Embind evidence is invalid.')
const snellsProvider = report.snellsLawProvider
if (snellsProvider?.completed !== 'completed' || snellsProvider?.degreesOfFreedom !== 8 || Math.abs(snellsProvider?.residual) > 1e-7 || Math.abs(snellsProvider?.first?.start?.x - snellsProvider?.second?.start?.x) > 1e-7 || Math.abs(snellsProvider?.first?.start?.y - snellsProvider?.second?.start?.y) > 1e-7 || Math.abs(Math.hypot(snellsProvider?.second?.end?.x - snellsProvider?.second?.start?.x, snellsProvider?.second?.end?.y - snellsProvider?.second?.start?.y) - 5) > 1e-7 || Math.abs(snellsProvider?.boundary?.start?.y) > 1e-7 || Math.abs(snellsProvider?.boundary?.end?.y) > 1e-7) throw new Error('Chrome SnellsLaw provider evidence is invalid.')
const ellipseAlignmentSolves = report.ellipseInternalAlignmentSolves
if (!Array.isArray(ellipseAlignmentSolves) || ellipseAlignmentSolves.length !== 4 || ellipseAlignmentSolves.some((entry, index) => entry.alignmentType !== index + 1 || entry.solveStatus > 1 || Math.abs(entry.center?.x - 2) > 1e-7 || Math.abs(entry.center?.y - 3) > 1e-7 || Math.abs(entry.minorRadius - 3) > 1e-7 || Math.abs(entry.helperError) > 1e-7 || Math.abs(entry.residual) > 1e-7)) throw new Error('Chrome Ellipse InternalAlignment Embind evidence is invalid.')
const ellipseAlignmentProvider = report.ellipseInternalAlignmentProvider
if (ellipseAlignmentProvider?.completed !== 'completed' || ellipseAlignmentProvider?.degreesOfFreedom !== 5 || Math.abs(ellipseAlignmentProvider?.residual) > 1e-7 || ellipseAlignmentProvider?.ellipse?.center?.x !== 2 || ellipseAlignmentProvider?.ellipse?.center?.y !== 3 || ellipseAlignmentProvider?.ellipse?.majorRadius !== 5 || ellipseAlignmentProvider?.ellipse?.minorRadius !== 3 || ellipseAlignmentProvider?.ellipse?.rotation !== 0.25) throw new Error('Chrome Ellipse InternalAlignment provider evidence is invalid.')
const bsplineWeightSolve = report.bsplineWeightSolve
if (bsplineWeightSolve?.solveStatus > 1 || bsplineWeightSolve?.weights?.length !== 4 || Math.abs(bsplineWeightSolve?.weights?.[0] - 1) > 1e-7 || Math.abs(bsplineWeightSolve?.weights?.[1] - 1.5) > 1e-7 || Math.abs(bsplineWeightSolve?.weights?.[2] - 1.25) > 1e-7 || Math.abs(bsplineWeightSolve?.weights?.[3] - 1) > 1e-7 || Math.abs(bsplineWeightSolve?.helper?.center?.x - 1) > 1e-7 || Math.abs(bsplineWeightSolve?.helper?.center?.y - 2) > 1e-7 || Math.abs(bsplineWeightSolve?.helper?.radius - 1.5) > 1e-7 || Math.abs(bsplineWeightSolve?.alignmentResidual) > 1e-7 || Math.abs(bsplineWeightSolve?.residual) > 1e-7) throw new Error('Chrome B-spline Weight Embind evidence is invalid.')
const bsplineWeightProvider = report.bsplineWeightProvider
if (bsplineWeightProvider?.completed !== 'completed' || bsplineWeightProvider?.degreesOfFreedom !== 11 || Math.abs(bsplineWeightProvider?.residual) > 1e-7 || bsplineWeightProvider?.bspline?.degree !== 3 || bsplineWeightProvider?.bspline?.weights?.length !== 4 || Math.abs(bsplineWeightProvider?.bspline?.weights?.[0] - 1) > 1e-7 || Math.abs(bsplineWeightProvider?.bspline?.weights?.[1] - 1.5) > 1e-7 || Math.abs(bsplineWeightProvider?.bspline?.weights?.[2] - 1.25) > 1e-7 || Math.abs(bsplineWeightProvider?.bspline?.weights?.[3] - 1) > 1e-7 || bsplineWeightProvider?.bspline?.periodic !== false) throw new Error('Chrome B-spline Weight provider evidence is invalid.')
const lifecycle = report.providerLifecycle
if (!lifecycle?.supportedGeometry?.includes('arc')) throw new Error('Chrome planegcs Arc capability evidence is invalid.')
if (!lifecycle?.supportedGeometry?.includes('ellipse')) throw new Error('Chrome planegcs Ellipse capability evidence is invalid.')
if (!lifecycle?.supportedGeometry?.includes('bspline')) throw new Error('Chrome planegcs B-spline capability evidence is invalid.')
if (!lifecycle?.supportedConstraints?.includes('block')) throw new Error('Chrome planegcs Block capability evidence is invalid.')
if (!lifecycle?.supportedConstraints?.includes('snellsLaw')) throw new Error('Chrome planegcs SnellsLaw capability evidence is invalid.')
if (!lifecycle?.supportedConstraints?.includes('internalAlignment')) throw new Error('Chrome planegcs InternalAlignment capability evidence is invalid.')
if (!lifecycle?.supportedConstraints?.includes('weight')) throw new Error('Chrome planegcs Weight capability evidence is invalid.')
if (lifecycle?.availability !== 'available' || lifecycle?.engine !== 'planegcs-wasm' || !lifecycle?.supportedGeometry?.includes('point') || !lifecycle?.supportedGeometry?.includes('circle') || !lifecycle?.supportedConstraints?.includes('vertical') || !lifecycle?.supportedConstraints?.includes('angle') || !lifecycle?.supportedConstraints?.includes('radius') || !lifecycle?.supportedConstraints?.includes('diameter') || !lifecycle?.supportedConstraints?.includes('equal') || !lifecycle?.supportedConstraints?.includes('tangent') || !lifecycle?.supportedConstraints?.includes('symmetric') || !lifecycle?.supportedConstraints?.includes('pointOnObject') || !lifecycle?.supportedConstraints?.includes('parallel') || !lifecycle?.supportedConstraints?.includes('perpendicular') || !lifecycle?.supportedConstraints?.includes('coincident') || lifecycle?.completed !== 'completed' || lifecycle?.verticalCompleted !== 'completed' || Math.abs(lifecycle?.verticalEnd?.x) > 1e-7 || Math.abs(lifecycle?.verticalEnd?.y - 5) > 1e-7 || lifecycle?.angleCompleted !== 'completed' || Math.abs(Math.hypot(lifecycle?.angleEnd?.x, lifecycle?.angleEnd?.y) - 5) > 1e-7 || Math.abs(Math.atan2(lifecycle?.angleEnd?.y, lifecycle?.angleEnd?.x) - Math.PI / 4) > 1e-7 || lifecycle?.circleRadiusCompleted !== 'completed' || Math.abs(lifecycle?.circleRadius?.center?.x - 2) > 1e-7 || Math.abs(lifecycle?.circleRadius?.center?.y - 3) > 1e-7 || Math.abs(lifecycle?.circleRadius?.radius - 4) > 1e-7 || lifecycle?.circleDiameterCompleted !== 'completed' || Math.abs(lifecycle?.circleDiameter?.center?.x - 2) > 1e-7 || Math.abs(lifecycle?.circleDiameter?.center?.y - 3) > 1e-7 || Math.abs(lifecycle?.circleDiameter?.radius * 2 - 8) > 1e-7 || lifecycle?.equalLinesCompleted !== 'completed' || Math.abs(Math.hypot(lifecycle?.equalLinesSecond?.end?.x - lifecycle?.equalLinesSecond?.start?.x, lifecycle?.equalLinesSecond?.end?.y - lifecycle?.equalLinesSecond?.start?.y) - 4) > 1e-7 || lifecycle?.equalCirclesCompleted !== 'completed' || Math.abs(lifecycle?.equalCirclesSecond?.center?.x - 8) > 1e-7 || Math.abs(lifecycle?.equalCirclesSecond?.center?.y - 9) > 1e-7 || Math.abs(lifecycle?.equalCirclesSecond?.radius - 4) > 1e-7 || lifecycle?.tangentCirclesCompleted !== 'completed' || Math.abs(lifecycle?.tangentCirclesSecond?.center?.x - 10) > 1e-7 || Math.abs(lifecycle?.tangentCirclesSecond?.center?.y - 3) > 1e-7 || Math.abs(lifecycle?.tangentCirclesSecond?.radius - 4) > 1e-7 || lifecycle?.pointSymmetryCompleted !== 'completed' || Math.abs(lifecycle?.pointSymmetrySecond?.x - 7) > 1e-7 || Math.abs(lifecycle?.pointSymmetrySecond?.y - 10) > 1e-7 || lifecycle?.pointOnLineCompleted !== 'completed' || Math.abs(lifecycle?.pointOnLinePoint?.x - 2) > 1e-7 || Math.abs(lifecycle?.pointOnLinePoint?.y) > 1e-7 || lifecycle?.pointOnLineCompleted !== 'completed' || Math.abs(lifecycle?.pointOnLinePoint?.x - 2) > 1e-7 || Math.abs(lifecycle?.pointOnLinePoint?.y) > 1e-7 || lifecycle?.parallelCompleted !== 'completed' || Math.abs(lifecycle?.parallelEnd?.y - 2) > 1e-7 || Math.abs(lifecycle?.parallelEnd?.x - 5) > 1e-7 || lifecycle?.perpendicularCompleted !== 'completed' || Math.abs(lifecycle?.perpendicularEnd?.x) > 1e-7 || Math.abs(lifecycle?.perpendicularEnd?.y - 7) > 1e-7 || lifecycle?.coincidentCompleted !== 'completed' || Math.abs(lifecycle?.coincidentStart?.x - 4) > 1e-7 || Math.abs(lifecycle?.coincidentStart?.y) > 1e-7 || lifecycle?.cancelled !== 'cancelled' || lifecycle?.recovered !== 'completed' || lifecycle?.stale !== 'stale' || Math.abs(lifecycle?.recoveredEnd?.x - 5) > 1e-7 || Math.abs(lifecycle?.recoveredEnd?.y) > 1e-7) throw new Error('Chrome planegcs Facade provider lifecycle evidence is invalid.')
console.log(JSON.stringify({ status: 'chrome-planegcs-verification-pass', browserId: report.browserId, solve: report.solve, verticalSolve: report.verticalSolve, distanceXSolve: report.distanceXSolve, distanceYSolve: report.distanceYSolve, angleSolve: report.angleSolve, circleRadiusSolve: report.circleRadiusSolve, circleDiameterSolve: report.circleDiameterSolve, equalLinesSolve: report.equalLinesSolve, equalCirclesSolve: report.equalCirclesSolve, tangentCirclesSolve: report.tangentCirclesSolve, pointSymmetrySolve: report.pointSymmetrySolve, pointOnLineSolve: report.pointOnLineSolve, pointOnCircleSolve: report.pointOnCircleSolve, pointOnCircleProvider: report.pointOnCircleProvider, pointOnEllipseSolve: report.pointOnEllipseSolve, pointOnEllipseProvider: report.pointOnEllipseProvider, parallelSolve: report.parallelSolve, perpendicularSolve: report.perpendicularSolve, coincidentSolve: report.coincidentSolve, providerLifecycle: lifecycle }, null, 2))
