pptx-angular-viewer 4.24.3 → 4.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +65 -0
- package/README.md +9 -9
- package/ng-package.json +25 -0
- package/package.json +45 -20
- package/scripts/finalize-dist.mjs +24 -0
- package/scripts/inline-shared.mjs +43 -0
- package/tsconfig.lib.json +13 -0
- package/vitest-setup.ts +12 -0
- package/fesm2022/pptx-angular-viewer-bar-chart-3d-hit-test-B6eCwecE.mjs +0 -9855
- package/fesm2022/pptx-angular-viewer-bar-chart-3d-hit-test-B6eCwecE.mjs.map +0 -1
- package/fesm2022/pptx-angular-viewer-chart-3d-view-scene-IqColhvd.mjs +0 -1594
- package/fesm2022/pptx-angular-viewer-chart-3d-view-scene-IqColhvd.mjs.map +0 -1
- package/fesm2022/pptx-angular-viewer-chat-history-idb-7dzD77Ju.mjs +0 -73
- package/fesm2022/pptx-angular-viewer-chat-history-idb-7dzD77Ju.mjs.map +0 -1
- package/fesm2022/pptx-angular-viewer-chat-history-store-Ckeu-olx.mjs +0 -121
- package/fesm2022/pptx-angular-viewer-chat-history-store-Ckeu-olx.mjs.map +0 -1
- package/fesm2022/pptx-angular-viewer-view-overflow-BBD8nZlq.mjs +0 -1418
- package/fesm2022/pptx-angular-viewer-view-overflow-BBD8nZlq.mjs.map +0 -1
- package/fesm2022/pptx-angular-viewer-view-scene-htTUkvvA.mjs +0 -836
- package/fesm2022/pptx-angular-viewer-view-scene-htTUkvvA.mjs.map +0 -1
- package/fesm2022/pptx-angular-viewer.mjs +0 -169944
- package/fesm2022/pptx-angular-viewer.mjs.map +0 -1
- package/i18n/de.cjs +0 -4165
- package/i18n/de.d.cts +0 -3
- package/i18n/de.d.mts +0 -3
- package/i18n/de.mjs +0 -4138
- package/i18n/es.cjs +0 -4165
- package/i18n/es.d.cts +0 -3
- package/i18n/es.d.mts +0 -3
- package/i18n/es.mjs +0 -4138
- package/i18n/fr.cjs +0 -4165
- package/i18n/fr.d.cts +0 -3
- package/i18n/fr.d.mts +0 -3
- package/i18n/fr.mjs +0 -4138
- package/i18n/zh-CN.cjs +0 -4198
- package/i18n/zh-CN.d.cts +0 -3
- package/i18n/zh-CN.d.mts +0 -3
- package/i18n/zh-CN.mjs +0 -4171
- package/pptx-angular-viewer.css +0 -2
- package/types/pptx-angular-viewer.d.ts +0 -60042
- package/types/pptx-angular-viewer.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pptx-angular-viewer-view-scene-htTUkvvA.mjs","names":[],"sources":["../../src/internal/shared-src/render/smartart-3d-translucency.ts","../../src/internal/shared-src/smartart-3d/text-block-texture.ts","../../src/internal/shared-src/smartart-3d/flat-mesh-object.ts","../../src/internal/shared-src/render/smartart-3d-ring.ts","../../src/internal/shared-src/render/smartart-3d-bevel-profile.ts","../../src/internal/shared-src/render/smartart-3d-solid-geometry.ts","../../src/internal/shared-src/render/smartart-3d-text-extrusion.ts","../../src/internal/shared-src/smartart-3d/lit-text-object.ts","../../src/internal/shared-src/smartart-3d/lit-mesh-object.ts","../../src/internal/shared-src/smartart-3d/view-camera.ts","../../src/internal/shared-src/smartart-3d/view-overflow.ts","../../src/internal/shared-src/smartart-3d/view-scene.ts"],"sourcesContent":["/**\n * Translucent lit SmartArt solids (framework-agnostic, pure).\n *\n * Basic Venn caches its circles as `accent1` at `a:alpha 50000`, and every\n * bevel / scene quick style keeps that alpha on the solid. PowerPoint blends\n * each solid ONCE: a face-on circle of Polished, Brick or Sunset reads exactly\n * the 50% blend of the flat style (`#89afc0` over white, `gt/sa-076.webp`),\n * and an overlap reads two layers (75%). Painting every surface of the solid\n * translucently (front cap, back cap and bevel bands all stacked) read 75% on\n * a single circle, so the three.js layer culls the surfaces facing away from\n * the camera; {@link orientSmartArt3DTriangles} makes each triangle's winding\n * agree with its shading normal so that culling is by the normal the lighting\n * already uses.\n *\n * `clear` (`a:sp3d/@prstMaterial`, Venn's Cartoon and Metallic Scene) is a\n * glass: a face-on surface keeps a fifth of its fill's alpha (the Cartoon\n * export reads a 50% circle as a 10% blend, `#e8eef2`, and its overlap as the\n * 19% of two such layers), while a surface tilted away from the view grows\n * denser, up to past the fill's own alpha at the silhouette (the Cartoon\n * bevel band reads a 59-66% blend next to the outline).\n * {@link smartArt3DSurfaceAlpha} is that curve.\n *\n * @module render/smartart-3d-translucency\n */\nimport type { SmartArt3DLightModel } from './smartart-3d-lighting';\nimport type { SolidTriangles } from './smartart-3d-solid-geometry';\nimport type { SmartArt3DMesh, Vec3 } from './smartart-3d-types';\n\n/** Share of the fill alpha a face-on `clear` surface keeps. */\nconst CLEAR_FACE_ALPHA = 0.2;\n/** How much denser a `clear` surface gets as it turns edge-on. */\nconst CLEAR_EDGE_GAIN = 2;\n/** Falloff exponent of that growth in `1 - n.v`. */\nconst CLEAR_EDGE_EXPONENT = 1;\n\n/** Whether a material paints its fill as a see-through glass. */\nexport function isSmartArt3DGlassMaterial(material: string | undefined): boolean {\n\treturn material === 'clear';\n}\n\n/**\n * The alpha to paint a surface at.\n *\n * @param opacity - the fill's own alpha (1 for an opaque fill).\n * @param facing - cosine between the surface normal and the view direction\n * (1 face-on, 0 edge-on).\n */\nexport function smartArt3DSurfaceAlpha(\n\tmaterial: string | undefined,\n\topacity: number,\n\tfacing: number,\n): number {\n\tif (!isSmartArt3DGlassMaterial(material)) {\n\t\treturn opacity;\n\t}\n\tconst tilt = 1 - Math.max(0, Math.min(1, facing));\n\tconst share = CLEAR_FACE_ALPHA + CLEAR_EDGE_GAIN * tilt ** CLEAR_EDGE_EXPONENT;\n\treturn Math.max(0, Math.min(1, opacity * share));\n}\n\n/**\n * Per-vertex alphas for a triangle list, from each vertex normal against the\n * view (the direction to `eye` under a perspective camera, else `+z`).\n */\nexport function smartArt3DVertexAlphas(\n\tpositions: readonly number[],\n\tnormals: readonly number[],\n\tmaterial: string | undefined,\n\topacity: number,\n\teye?: Vec3,\n): Float32Array {\n\tconst out = new Float32Array(positions.length / 3);\n\tfor (let i = 0, v = 0; i < positions.length; i += 3, v++) {\n\t\tlet view: Vec3 = { x: 0, y: 0, z: 1 };\n\t\tif (eye) {\n\t\t\tconst dx = eye.x - positions[i];\n\t\t\tconst dy = eye.y - positions[i + 1];\n\t\t\tconst dz = eye.z - positions[i + 2];\n\t\t\tconst len = Math.hypot(dx, dy, dz) || 1;\n\t\t\tview = { x: dx / len, y: dy / len, z: dz / len };\n\t\t}\n\t\tconst facing = normals[i] * view.x + normals[i + 1] * view.y + normals[i + 2] * view.z;\n\t\tout[v] = smartArt3DSurfaceAlpha(material, opacity, facing);\n\t}\n\treturn out;\n}\n\n/**\n * Flip every triangle whose winding disagrees with its (averaged) shading\n * normal, in place, so counter-clockwise winding means \"faces along the\n * normal\" and back-face culling hides exactly the surfaces facing away.\n */\nexport function orientSmartArt3DTriangles(triangles: SolidTriangles): void {\n\tconst { positions: p, normals: n } = triangles;\n\tfor (let t = 0; t + 9 <= p.length; t += 9) {\n\t\tconst ux = p[t + 3] - p[t];\n\t\tconst uy = p[t + 4] - p[t + 1];\n\t\tconst uz = p[t + 5] - p[t + 2];\n\t\tconst vx = p[t + 6] - p[t];\n\t\tconst vy = p[t + 7] - p[t + 1];\n\t\tconst vz = p[t + 8] - p[t + 2];\n\t\tconst cx = uy * vz - uz * vy;\n\t\tconst cy = uz * vx - ux * vz;\n\t\tconst cz = ux * vy - uy * vx;\n\t\tconst nx = n[t] + n[t + 3] + n[t + 6];\n\t\tconst ny = n[t + 1] + n[t + 4] + n[t + 7];\n\t\tconst nz = n[t + 2] + n[t + 5] + n[t + 8];\n\t\tif (cx * nx + cy * ny + cz * nz < 0) {\n\t\t\tfor (const arr of [p, n]) {\n\t\t\t\tfor (let c = 0; c < 3; c++) {\n\t\t\t\t\tconst b = arr[t + 3 + c];\n\t\t\t\t\tarr[t + 3 + c] = arr[t + 6 + c];\n\t\t\t\t\tarr[t + 6 + c] = b;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Whether a lit mesh is see-through (a fill alpha below 1 or a glass material). */\nexport function isSmartArt3DTranslucentMesh(mesh: SmartArt3DMesh): boolean {\n\treturn !mesh.fillNone && (mesh.opacity < 1 || isSmartArt3DGlassMaterial(mesh.solid?.material));\n}\n\n/**\n * The light model a glass surface is painted with: its fill, unlit (only the\n * rig's face tint stays). The Cartoon export's bevel band is the plain fill\n * made denser toward the silhouette (`#456c7a` at the rim over white, the\n * fill at full alpha), with none of the brightening an opaque bevel band\n * gets from the key light; the alpha ramp alone draws it.\n */\nexport function smartArt3DGlassLightModel(model: SmartArt3DLightModel): SmartArt3DLightModel {\n\treturn { ...model, ambient: 1, diffuse: 0 };\n}\n","/**\n * Canvas texture for a `SmartArt3DTextBlock`, for the `<pptx-three-view>`\n * SmartArt scene (`view-scene.ts`).\n *\n * Unlike the legacy `smartart-3d/text-texture.ts` (which imports `three`\n * statically and re-wraps text itself), this draws the ALREADY wrapped/\n * positioned lines a `SmartArt3DTextBlock` carries (built from the same 2D\n * projection the SVG renderer uses), and takes the runtime `three` module as\n * a parameter so it stays out of the tsup-bundled `dist/index.mjs` (see the\n * \"no runtime `three` import\" rule in `three-view/types.ts`).\n *\n * @module smartart-3d/text-block-texture\n */\nimport type * as THREE from 'three';\n\nimport type { SmartArt3DTextBlock } from '../render/smartart-3d-types';\nimport type { ThreeModule } from '../three-view/types';\n\n/** Supersampling factor for crisp text at any zoom. */\nconst SUPERSAMPLE = 3;\n\n/** A built label texture plus the world-space plane size it should fill. */\nexport interface TextBlockTexture {\n\ttexture: THREE.CanvasTexture;\n\tworldWidth: number;\n\tworldHeight: number;\n}\n\n/** Build a canvas texture rendering `block`'s pre-wrapped lines, or `null` off-DOM. */\nexport function buildTextBlockTexture(\n\tthree: ThreeModule,\n\tblock: SmartArt3DTextBlock,\n): TextBlockTexture | null {\n\tif (typeof document === 'undefined' || block.lines.every((l) => l.text.length === 0)) {\n\t\treturn null;\n\t}\n\tconst worldWidth = Math.max(1, block.maxWidth);\n\tconst worldHeight = Math.max(1, block.maxHeight);\n\tconst canvas = document.createElement('canvas');\n\tcanvas.width = Math.max(8, Math.round(worldWidth * SUPERSAMPLE));\n\tcanvas.height = Math.max(8, Math.round(worldHeight * SUPERSAMPLE));\n\tconst ctx2d = canvas.getContext('2d');\n\tif (!ctx2d) {\n\t\treturn null;\n\t}\n\n\tconst weight = block.fontWeight ?? 400;\n\tconst italic = block.fontStyle === 'italic' ? 'italic ' : '';\n\tconst family = block.fontFamily\n\t\t? `${block.fontFamily}, system-ui, sans-serif`\n\t\t: 'system-ui, -apple-system, Segoe UI, Roboto, sans-serif';\n\tconst px = Math.max(6, block.fontSize) * SUPERSAMPLE;\n\n\tctx2d.clearRect(0, 0, canvas.width, canvas.height);\n\tctx2d.fillStyle = block.color;\n\tctx2d.textAlign = 'center';\n\t// `dy` places each line's CENTRE (as `centeredSvgTextLines` lays it out,\n\t// and the 2D renderers draw with `dominant-baseline: central`).\n\tctx2d.textBaseline = 'middle';\n\tctx2d.font = `${italic}${weight} ${px}px ${family}`;\n\tconst centerX = canvas.width / 2;\n\tconst centerY = canvas.height / 2;\n\tfor (const line of block.lines) {\n\t\tif (!line.text) {\n\t\t\tcontinue;\n\t\t}\n\t\t// `dy` is a y-up offset from the block centre; canvas y grows downward.\n\t\tctx2d.fillText(line.text, centerX, centerY - line.dy * SUPERSAMPLE);\n\t}\n\n\tconst texture = new three.CanvasTexture(canvas);\n\ttexture.colorSpace = three.SRGBColorSpace;\n\ttexture.minFilter = three.LinearFilter;\n\ttexture.magFilter = three.LinearFilter;\n\t// See `smartart-3d/text-texture.ts` for why flipY must stay false with a\n\t// compensating UV flip: WebGL2 forbids UNPACK_FLIP_Y_WEBGL for some texture\n\t// targets, and leaving it enabled pollutes global pixel-store state.\n\ttexture.flipY = false;\n\ttexture.premultiplyAlpha = false;\n\ttexture.wrapT = three.RepeatWrapping;\n\ttexture.repeat.set(1, -1);\n\ttexture.offset.set(0, 1);\n\ttexture.needsUpdate = true;\n\n\treturn { texture, worldWidth, worldHeight };\n}\n","/**\n * Build the three.js `Object3D` for one flat `SmartArt3DMesh` (fill + stroke\n * outline + text label), for `view-scene.ts`.\n *\n * @module smartart-3d/flat-mesh-object\n */\nimport type * as THREE from 'three';\n\nimport type { SmartArt3DMesh } from '../render/smartart-3d-types';\nimport type { ThreeModule } from '../three-view/types';\nimport { buildTextBlockTexture } from './text-block-texture';\n\n/** Anything the scene must call `.dispose()` on when unmounted. */\nexport interface Disposable {\n\tdispose: () => void;\n}\n\n/** The built pieces for one mesh: the group to add to the scene, plus disposables. */\nexport interface MeshObject {\n\tgroup: THREE.Group;\n\tdisposables: Disposable[];\n}\n\n/** z-lift of the stroke outline above its fill, so the two don't z-fight. */\nconst STROKE_Z_LIFT = 0.05;\n\nfunction buildShape(three: ThreeModule, mesh: SmartArt3DMesh): THREE.Shape {\n\tconst shape = new three.Shape(mesh.outline.map((p) => new three.Vector2(p.x, p.y)));\n\tfor (const hole of mesh.holes ?? []) {\n\t\tshape.holes.push(new three.Path(hole.map((p) => new three.Vector2(p.x, p.y))));\n\t}\n\treturn shape;\n}\n\n/** Build the fill mesh for a flat (zero-depth) `SmartArt3DMesh`. */\nfunction buildFlatFill(\n\tthree: ThreeModule,\n\tmesh: SmartArt3DMesh,\n\tshape: THREE.Shape,\n\tdisposables: Disposable[],\n): THREE.Mesh | null {\n\tif (mesh.fillNone) {\n\t\treturn null;\n\t}\n\tconst geometry = new three.ShapeGeometry(shape);\n\tconst material = new three.MeshBasicMaterial({\n\t\tcolor: mesh.fill,\n\t\tside: three.DoubleSide,\n\t\ttransparent: mesh.opacity < 1,\n\t\topacity: mesh.opacity,\n\t});\n\tdisposables.push(geometry, material);\n\treturn new three.Mesh(geometry, material);\n}\n\n/** Build the stroke outline (and hole outlines) as line loops. */\nexport function buildStrokeLines(\n\tthree: ThreeModule,\n\tmesh: SmartArt3DMesh,\n\tdisposables: Disposable[],\n): THREE.LineLoop[] {\n\tif (mesh.strokeWidth <= 0 || mesh.stroke === 'transparent') {\n\t\treturn [];\n\t}\n\tconst material = new three.LineBasicMaterial({ color: mesh.stroke });\n\tdisposables.push(material);\n\tconst loops = [mesh.outline, ...(mesh.holes ?? [])];\n\treturn loops.map((loop) => {\n\t\tconst geometry = new three.BufferGeometry().setFromPoints(\n\t\t\tloop.map((p) => new three.Vector3(p.x, p.y, STROKE_Z_LIFT)),\n\t\t);\n\t\tdisposables.push(geometry);\n\t\treturn new three.LineLoop(geometry, material);\n\t});\n}\n\n/** Build the text label plane, or `null` when the mesh has no text. */\nexport function buildTextPlane(\n\tthree: ThreeModule,\n\tmesh: SmartArt3DMesh,\n\tgroup: THREE.Group,\n\tdisposables: Disposable[],\n): void {\n\tif (!mesh.textBlock) {\n\t\treturn;\n\t}\n\tconst built = buildTextBlockTexture(three, mesh.textBlock);\n\tif (!built) {\n\t\treturn;\n\t}\n\tdisposables.push(built.texture);\n\tconst geometry = new three.PlaneGeometry(built.worldWidth, built.worldHeight);\n\tconst material = new three.MeshBasicMaterial({\n\t\tmap: built.texture,\n\t\ttransparent: true,\n\t\tdepthWrite: false,\n\t});\n\tdisposables.push(geometry, material);\n\tconst plane = new three.Mesh(geometry, material);\n\t// `textBlock` carries its own world position (already includes the\n\t// shape's rotation applied to its centre); the group itself is placed at\n\t// the shape's own centre, so offset back to absolute world space here.\n\tplane.position.set(\n\t\tmesh.textBlock.x - mesh.position.x,\n\t\tmesh.textBlock.y - mesh.position.y,\n\t\tmesh.textBlock.z - mesh.position.z,\n\t);\n\tgroup.add(plane);\n}\n\n/** Build the complete `Object3D` for one flat mesh. */\nexport function buildFlatMeshObject(three: ThreeModule, mesh: SmartArt3DMesh): MeshObject {\n\tconst disposables: Disposable[] = [];\n\tconst group = new three.Group();\n\tgroup.position.set(mesh.position.x, mesh.position.y, mesh.position.z);\n\n\tconst shape = buildShape(three, mesh);\n\tconst fill = buildFlatFill(three, mesh, shape, disposables);\n\tif (fill) {\n\t\tgroup.add(fill);\n\t}\n\tfor (const line of buildStrokeLines(three, mesh, disposables)) {\n\t\tgroup.add(line);\n\t}\n\tbuildTextPlane(three, mesh, group, disposables);\n\n\treturn { group, disposables };\n}\n","/**\n * Closed-polygon (\"ring\") helpers for the lit SmartArt 3D solids: clean-up,\n * orientation, per-edge normals and a mitred inward/outward offset\n * (framework-agnostic, pure).\n *\n * @module render/smartart-3d-ring\n */\nimport type { Point2 } from './smartart-3d-types';\n\n/** Points closer than this are treated as the same vertex. */\nconst EPSILON = 1e-6;\n/** Longest mitre, as a multiple of the offset distance (sharp spikes are clipped). */\nconst MITER_LIMIT = 4;\n\n/** Drop repeated consecutive points and the closing duplicate of the first point. */\nexport function cleanRing(points: readonly Point2[]): Point2[] {\n\tconst out: Point2[] = [];\n\tfor (const p of points) {\n\t\tconst last = out[out.length - 1];\n\t\tif (!last || Math.hypot(p.x - last.x, p.y - last.y) > EPSILON) {\n\t\t\tout.push({ x: p.x, y: p.y });\n\t\t}\n\t}\n\twhile (out.length > 1) {\n\t\tconst first = out[0];\n\t\tconst last = out[out.length - 1];\n\t\tif (Math.hypot(first.x - last.x, first.y - last.y) > EPSILON) {\n\t\t\tbreak;\n\t\t}\n\t\tout.pop();\n\t}\n\treturn out;\n}\n\n/** Shoelace signed area: positive for a counter-clockwise ring in y-up space. */\nexport function ringSignedArea(ring: readonly Point2[]): number {\n\tlet area = 0;\n\tfor (let i = 0; i < ring.length; i++) {\n\t\tconst a = ring[i];\n\t\tconst b = ring[(i + 1) % ring.length];\n\t\tarea += a.x * b.y - b.x * a.y;\n\t}\n\treturn area / 2;\n}\n\n/** A cleaned, counter-clockwise (y-up) copy of `points`. */\nexport function toCcwRing(points: readonly Point2[]): Point2[] {\n\tconst ring = cleanRing(points);\n\treturn ringSignedArea(ring) < 0 ? ring.reverse() : ring;\n}\n\n/**\n * Unit inward normal of every edge `i -> i + 1` of a counter-clockwise ring\n * (the interior is on the edge's left).\n */\nexport function ringEdgeNormals(ring: readonly Point2[]): Point2[] {\n\treturn ring.map((a, i) => {\n\t\tconst b = ring[(i + 1) % ring.length];\n\t\tconst dx = b.x - a.x;\n\t\tconst dy = b.y - a.y;\n\t\tconst len = Math.hypot(dx, dy) || 1;\n\t\treturn { x: -dy / len, y: dx / len };\n\t});\n}\n\n/**\n * Offset a counter-clockwise ring by `distance` along its inward normals\n * (negative grows it). Each vertex moves along its mitre, clipped at\n * {@link MITER_LIMIT} times the distance so a sharp spike stays bounded.\n */\nexport function offsetRing(ring: readonly Point2[], distance: number): Point2[] {\n\tif (distance === 0) {\n\t\treturn ring.map((p) => ({ x: p.x, y: p.y }));\n\t}\n\tconst normals = ringEdgeNormals(ring);\n\tconst n = ring.length;\n\treturn ring.map((p, i) => {\n\t\tconst prev = normals[(i - 1 + n) % n];\n\t\tconst next = normals[i];\n\t\tconst denom = Math.max(0.05, 1 + prev.x * next.x + prev.y * next.y);\n\t\tlet ox = ((prev.x + next.x) / denom) * distance;\n\t\tlet oy = ((prev.y + next.y) / denom) * distance;\n\t\tconst len = Math.hypot(ox, oy);\n\t\tconst max = Math.abs(distance) * MITER_LIMIT;\n\t\tif (len > max) {\n\t\t\tox = (ox / len) * max;\n\t\t\toy = (oy / len) * max;\n\t\t}\n\t\treturn { x: p.x + ox, y: p.y + oy };\n\t});\n}\n\n/**\n * The in-plane inward direction to shade each edge's two ends with.\n *\n * `result[i]` is `[atStart, atEnd]` for edge `i -> i + 1`. Where the ring\n * turns by less than `smoothDeg` (a curve's tessellation) the two edges share\n * the averaged normal, so a circle shades smoothly; at a real corner each\n * edge keeps its own normal, so a rectangle's sides shade flat.\n */\nexport function ringShadingNormals(\n\tring: readonly Point2[],\n\tsmoothDeg = 30,\n): Array<[Point2, Point2]> {\n\tconst normals = ringEdgeNormals(ring);\n\tconst n = ring.length;\n\tconst cosLimit = Math.cos((smoothDeg * Math.PI) / 180);\n\tconst vertexNormal = (own: Point2, other: Point2): Point2 => {\n\t\tif (own.x * other.x + own.y * other.y < cosLimit) {\n\t\t\treturn own;\n\t\t}\n\t\tconst x = own.x + other.x;\n\t\tconst y = own.y + other.y;\n\t\tconst len = Math.hypot(x, y) || 1;\n\t\treturn { x: x / len, y: y / len };\n\t};\n\treturn normals.map((own, i) => [\n\t\tvertexNormal(own, normals[(i - 1 + n) % n]),\n\t\tvertexNormal(own, normals[(i + 1) % n]),\n\t]);\n}\n","/**\n * `a:bevelT/@prst` cross-sections for the lit SmartArt 3D solids\n * (framework-agnostic, pure).\n *\n * A profile is a polyline from the shape's outline (`s = 0`, `t = 0`) to the\n * inner edge of the bevel (`s = 1`, `t = 1`): `s` is the inset as a fraction\n * of the bevel width, `t` the height as a fraction of the bevel height. The\n * shapes follow the ECMA-376 20.1.10.9 preset silhouettes, tuned against the\n * PowerPoint exports of the SmartArt bevel quick styles\n * (`e2e/fixtures/three-d-parity/gt`): `circle` (Polished) is a quarter round,\n * `relaxedInset` (Inset) dips into a groove before rising to the face, which\n * is what paints its dark outer line and bright inner ridge.\n *\n * @module render/smartart-3d-bevel-profile\n */\n\n/** One sample of a bevel cross-section. */\nexport interface BevelProfilePoint {\n\t/** Inset from the outline, as a fraction of the bevel width (0..1). */\n\ts: number;\n\t/** Height above the bevel's base, as a fraction of the bevel height. */\n\tt: number;\n}\n\n/** Samples used for the curved profiles. */\nconst CURVE_SEGMENTS = 8;\n\nfunction sampleCurve(fn: (u: number) => BevelProfilePoint): BevelProfilePoint[] {\n\tconst points: BevelProfilePoint[] = [];\n\tfor (let i = 0; i <= CURVE_SEGMENTS; i++) {\n\t\tpoints.push(fn(i / CURVE_SEGMENTS));\n\t}\n\treturn points;\n}\n\nconst QUARTER = Math.PI / 2;\n\nconst PROFILES: Record<string, () => BevelProfilePoint[]> = {\n\t// Quarter round: vertical at the outline, flat where it meets the face.\n\tcircle: () => sampleCurve((u) => ({ s: 1 - Math.cos(u * QUARTER), t: Math.sin(u * QUARTER) })),\n\t// Round, but reaching the outline at a slant instead of vertically.\n\tconvex: () => sampleCurve((u) => ({ s: u, t: Math.sin(u * QUARTER) })),\n\tsoftRound: () => sampleCurve((u) => ({ s: u, t: 1 - (1 - u) * (1 - u) })),\n\t// A groove next to the outline, then a rounded rise onto the face.\n\trelaxedInset: () =>\n\t\tsampleCurve((u) => ({\n\t\t\ts: u,\n\t\t\tt: u * u * (3 - 2 * u) - 0.3 * Math.sin(Math.PI * u) * (1 - u),\n\t\t})),\n\tdivot: () =>\n\t\tsampleCurve((u) => ({\n\t\t\ts: u,\n\t\t\tt: u - 0.5 * Math.sin(Math.PI * u),\n\t\t})),\n\tangle: () => [\n\t\t{ s: 0, t: 0 },\n\t\t{ s: 1, t: 1 },\n\t],\n\tslope: () => [\n\t\t{ s: 0, t: 0 },\n\t\t{ s: 1, t: 1 },\n\t],\n\tcoolSlant: () => [\n\t\t{ s: 0, t: 0 },\n\t\t{ s: 0.3, t: 0.75 },\n\t\t{ s: 1, t: 1 },\n\t],\n\thardEdge: () => [\n\t\t{ s: 0, t: 0 },\n\t\t{ s: 0.2, t: 0.9 },\n\t\t{ s: 1, t: 1 },\n\t],\n\tcross: () => [\n\t\t{ s: 0, t: 0 },\n\t\t{ s: 0.5, t: 1 },\n\t\t{ s: 1, t: 1 },\n\t],\n\triblet: () => [\n\t\t{ s: 0, t: 0 },\n\t\t{ s: 0.33, t: 1 },\n\t\t{ s: 0.66, t: 0.5 },\n\t\t{ s: 1, t: 1 },\n\t],\n\tartDeco: () => [\n\t\t{ s: 0, t: 0 },\n\t\t{ s: 0.25, t: 0.5 },\n\t\t{ s: 0.5, t: 0.5 },\n\t\t{ s: 0.75, t: 1 },\n\t\t{ s: 1, t: 1 },\n\t],\n};\n\n/**\n * The cross-section for a bevel preset token; unknown tokens fall back to\n * `circle` (the ECMA-376 default for an `a:bevelT` without `@prst`).\n */\nexport function getSmartArtBevelProfile(profile: string | undefined): BevelProfilePoint[] {\n\tconst build = (profile && PROFILES[profile]) || PROFILES.circle;\n\treturn build();\n}\n","/**\n * Geometry for one lit SmartArt 3D solid: bevel bands, extrusion walls,\n * contour rim and the caps to triangulate (framework-agnostic, pure; the\n * three.js layer only triangulates the caps and uploads the arrays).\n *\n * Layout along z (mesh-local, the front face at `z = 0`, facing +z):\n *\n * ```\n * 0 front cap (the outline inset by bevelT.w)\n * 0 .. -bevelT.h top bevel band, outline -> inset\n * .. -extrusion side walls on the outline\n * .. -bevelB.h bottom bevel band, outline -> inset (back cap)\n * ```\n *\n * The contour (`a:sp3d/@contourW`) is a flat rim `contourW` wide around the\n * outline, at the front shoulder and at the back: the Brick Scene export\n * shows it as a thin line along the front edge and along the far end of the\n * extrusion walls, with the walls themselves in the extrusion colour.\n *\n * @module render/smartart-3d-solid-geometry\n */\nimport type { BevelProfilePoint } from './smartart-3d-bevel-profile';\nimport { getSmartArtBevelProfile } from './smartart-3d-bevel-profile';\nimport { offsetRing, ringShadingNormals, toCcwRing } from './smartart-3d-ring';\nimport type { SmartArt3DBevel, SmartArt3DSolid } from './smartart-3d-solid-types';\nimport type { Point2 } from './smartart-3d-types';\n\n/** A triangle list: 9 floats (3 xyz vertices) per triangle, normals alike. */\nexport interface SolidTriangles {\n\tpositions: number[];\n\tnormals: number[];\n}\n\n/** A planar cap to triangulate (outer ring + holes) at depth `z`. */\nexport interface SolidCap {\n\tring: Point2[];\n\tholes: Point2[][];\n\tz: number;\n\t/** +1: faces the viewer (front), -1: faces away (back). */\n\tfacing: 1 | -1;\n}\n\n/** Everything the three.js layer needs to build one solid. */\nexport interface SmartArt3DSolidGeometry {\n\t/** Bevel bands, painted with the shape's fill. */\n\tbody: SolidTriangles;\n\t/** Extrusion walls, painted with the extrusion colour. */\n\tsides: SolidTriangles;\n\tfrontCap: SolidCap;\n\t/** Back cap (extrusion colour), when the solid has any depth. */\n\tbackCap?: SolidCap;\n\t/** Contour rims (front and back annuli, contour colour). */\n\tcontourCaps: SolidCap[];\n}\n\n/** Contour rims sit this far in front of the plane they ring, so they win the depth test. */\nconst CONTOUR_Z_LIFT = 0.05;\n/** Slope used for a vertical profile segment (an outward, horizontal normal). */\nconst VERTICAL_SLOPE = 1e3;\n\nfunction emptyTriangles(): SolidTriangles {\n\treturn { positions: [], normals: [] };\n}\n\nfunction pushVertex(out: SolidTriangles, p: Point2, z: number, n: [number, number, number]): void {\n\tout.positions.push(p.x, p.y, z);\n\tout.normals.push(n[0], n[1], n[2]);\n}\n\nfunction normalize(x: number, y: number, z: number): [number, number, number] {\n\tconst len = Math.hypot(x, y, z) || 1;\n\treturn [x / len, y / len, z / len];\n}\n\n/** Push the two triangles of quad `a b c d` (in order around the quad). */\nfunction pushQuad(\n\tout: SolidTriangles,\n\tcorners: Array<{ p: Point2; z: number; n: [number, number, number] }>,\n): void {\n\tconst [a, b, c, d] = corners;\n\tfor (const v of [a, b, c, a, c, d]) {\n\t\tpushVertex(out, v.p, v.z, v.n);\n\t}\n}\n\n/**\n * A bevel band from `ring` (at `zOuter`) inward to `ring` inset by the bevel\n * width, rising by the bevel height toward `facing` (+1 front, -1 back).\n * Returns the band's inner ring.\n */\nfunction addBand(\n\tout: SolidTriangles,\n\tring: Point2[],\n\tbevel: SmartArt3DBevel,\n\tzOuter: number,\n\tfacing: 1 | -1,\n): Point2[] {\n\tconst profile: BevelProfilePoint[] = getSmartArtBevelProfile(bevel.profile);\n\tconst rings = profile.map((pt) => offsetRing(ring, bevel.width * pt.s));\n\tconst shading = ringShadingNormals(ring);\n\tconst n = ring.length;\n\tfor (let k = 0; k < profile.length - 1; k++) {\n\t\tconst ds = profile[k + 1].s - profile[k].s;\n\t\tconst dt = profile[k + 1].t - profile[k].t;\n\t\tconst slope =\n\t\t\tMath.abs(ds) < 1e-6\n\t\t\t\t? Math.sign(dt || 1) * VERTICAL_SLOPE\n\t\t\t\t: (bevel.height * dt) / (bevel.width * ds);\n\t\tconst z0 = zOuter + facing * bevel.height * profile[k].t;\n\t\tconst z1 = zOuter + facing * bevel.height * profile[k + 1].t;\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tconst j = (i + 1) % n;\n\t\t\tconst [mi, mj] = shading[i];\n\t\t\tconst ni = normalize(-slope * mi.x, -slope * mi.y, facing);\n\t\t\tconst nj = normalize(-slope * mj.x, -slope * mj.y, facing);\n\t\t\tpushQuad(out, [\n\t\t\t\t{ p: rings[k][i], z: z0, n: ni },\n\t\t\t\t{ p: rings[k][j], z: z0, n: nj },\n\t\t\t\t{ p: rings[k + 1][j], z: z1, n: nj },\n\t\t\t\t{ p: rings[k + 1][i], z: z1, n: ni },\n\t\t\t]);\n\t\t}\n\t}\n\treturn rings[rings.length - 1];\n}\n\n/** Vertical walls around `ring` from `zTop` down to `zBottom`, facing outward. */\nfunction addWalls(out: SolidTriangles, ring: Point2[], zTop: number, zBottom: number): void {\n\tif (zTop - zBottom <= 0) {\n\t\treturn;\n\t}\n\tconst shading = ringShadingNormals(ring);\n\tconst n = ring.length;\n\tfor (let i = 0; i < n; i++) {\n\t\tconst j = (i + 1) % n;\n\t\tconst [mi, mj] = shading[i];\n\t\tconst ni = normalize(-mi.x, -mi.y, 0);\n\t\tconst nj = normalize(-mj.x, -mj.y, 0);\n\t\tpushQuad(out, [\n\t\t\t{ p: ring[i], z: zTop, n: ni },\n\t\t\t{ p: ring[j], z: zTop, n: nj },\n\t\t\t{ p: ring[j], z: zBottom, n: nj },\n\t\t\t{ p: ring[i], z: zBottom, n: ni },\n\t\t]);\n\t}\n}\n\n/**\n * Build the geometry for one solid from its mesh-local outline (and holes,\n * which are cut from the caps but not bevelled).\n */\nexport function buildSmartArt3DSolidGeometry(\n\toutline: readonly Point2[],\n\tholes: readonly Point2[][],\n\tsolid: SmartArt3DSolid,\n): SmartArt3DSolidGeometry {\n\tconst ring = toCcwRing(outline);\n\tconst body = emptyTriangles();\n\tconst sides = emptyTriangles();\n\tconst topHeight = solid.bevelTop?.height ?? 0;\n\tconst zShoulder = -topHeight;\n\tconst zBackShoulder = zShoulder - solid.extrusion;\n\tconst backHeight = solid.bevelBottom?.height ?? 0;\n\tconst zBack = zBackShoulder - backHeight;\n\tconst holeRings = holes.map((hole) => toCcwRing(hole)).filter((hole) => hole.length >= 3);\n\n\tconst frontRing = solid.bevelTop ? addBand(body, ring, solid.bevelTop, zShoulder, 1) : ring;\n\taddWalls(sides, ring, zShoulder, zBackShoulder);\n\tconst hasDepth = zBack < 0;\n\tconst backRing =\n\t\thasDepth && solid.bevelBottom\n\t\t\t? addBand(sides, ring, solid.bevelBottom, zBackShoulder, -1)\n\t\t\t: ring;\n\n\tconst contourCaps: SolidCap[] = [];\n\tif (solid.contourWidth > 0) {\n\t\tconst rim = offsetRing(ring, -solid.contourWidth);\n\t\tconst inner = [...ring].reverse();\n\t\tcontourCaps.push({ ring: rim, holes: [inner], z: zShoulder + CONTOUR_Z_LIFT, facing: 1 });\n\t\tif (hasDepth) {\n\t\t\tcontourCaps.push({ ring: rim, holes: [inner], z: zBack - CONTOUR_Z_LIFT, facing: -1 });\n\t\t}\n\t}\n\n\treturn {\n\t\tbody,\n\t\tsides,\n\t\tfrontCap: { ring: frontRing, holes: holeRings, z: 0, facing: 1 },\n\t\t...(hasDepth ? { backCap: { ring: backRing, holes: holeRings, z: zBack, facing: -1 } } : {}),\n\t\tcontourCaps,\n\t};\n}\n","/**\n * Extruded SmartArt labels (framework-agnostic, pure).\n *\n * A quick style can extrude the label text itself off the shape face\n * (`a:bodyPr/a:sp3d`, e.g. Bird's Eye Scene: `extrusionH=\"28000\"`). The\n * scene has glyph bitmaps, not glyph outlines, so it builds the letters'\n * solid from stacked copies of the label: side layers every\n * {@link TEXT_LAYER_STEP} px from the face up to the extrusion depth, drawn in\n * the shaded side colour, then the front copy on top at the full depth.\n * Under the diagram's camera the stack reads as the letters' walls.\n *\n * @module render/smartart-3d-text-extrusion\n */\nimport type { SmartArt3DTextBlock } from './smartart-3d-types';\n\n/** Depth between two side layers, layout px (fine enough to read as a wall). */\nexport const TEXT_LAYER_STEP = 0.4;\n\n/** Most side layers one label gets. */\nconst MAX_TEXT_LAYERS = 32;\n\n/**\n * sRGB factor on the side colour. Read off the Bird's Eye Scene export\n * (`gt/sa-014.webp`): white letters show walls around (164, 172, 175) under\n * a front face reading (245, 248, 249).\n */\nexport const TEXT_SIDE_SHADE = 0.69;\n\n/** Stacked planes for one label. */\nexport interface SmartArt3DTextLayers {\n\t/** z of each side layer, back to front (world units, absolute). */\n\tsideZ: number[];\n\t/** z of the front copy. */\n\tfrontZ: number;\n\t/** Side colour, `#rrggbb`. */\n\tsideColor: string;\n}\n\nfunction shadeHex(hex: string, factor: number): string {\n\tconst match = /^#?([0-9a-f]{6})$/iu.exec(hex.trim());\n\tif (!match) {\n\t\treturn hex;\n\t}\n\tconst n = Number.parseInt(match[1], 16);\n\tconst channel = (shift: number): string =>\n\t\tMath.round(((n >> shift) & 255) * factor)\n\t\t\t.toString(16)\n\t\t\t.padStart(2, '0');\n\treturn `#${channel(16)}${channel(8)}${channel(0)}`;\n}\n\n/**\n * The stacked layers for an extruded label, or `undefined` when the label is\n * flat (no `extrusion`).\n */\nexport function smartArt3DTextLayers(block: SmartArt3DTextBlock): SmartArt3DTextLayers | undefined {\n\tconst depth = block.extrusion ?? 0;\n\tif (!(depth > 0)) {\n\t\treturn undefined;\n\t}\n\tconst count = Math.max(1, Math.min(MAX_TEXT_LAYERS, Math.ceil(depth / TEXT_LAYER_STEP)));\n\tconst sideZ: number[] = [];\n\tfor (let i = 0; i < count; i++) {\n\t\tsideZ.push(block.z + (depth * i) / count);\n\t}\n\treturn {\n\t\tsideZ,\n\t\tfrontZ: block.z + depth,\n\t\tsideColor: shadeHex(block.extrusionColor ?? block.color, TEXT_SIDE_SHADE),\n\t};\n}\n","/**\n * The label of a lit SmartArt 3D mesh (bevel / scene quick styles): the same\n * canvas-texture plane the flat path draws, tinted by the light rig, and\n * stacked into a solid when the quick style extrudes the text itself\n * (`render/smartart-3d-text-extrusion.ts`).\n *\n * Must not import `three` at runtime (it takes the module as a parameter).\n *\n * @module smartart-3d/lit-text-object\n */\nimport type * as THREE from 'three';\n\nimport type { SmartArt3DLightModel } from '../render/smartart-3d-lighting';\nimport { smartArt3DTextLayers } from '../render/smartart-3d-text-extrusion';\nimport type { SmartArt3DMesh, SmartArt3DTextBlock } from '../render/smartart-3d-types';\nimport type { ThreeModule } from '../three-view/types';\nimport type { Disposable } from './flat-mesh-object';\nimport { buildTextBlockTexture } from './text-block-texture';\n\n/**\n * Planes showing `block` at each of `zs` (sharing one texture, geometry and\n * material).\n */\nfunction textPlanes(\n\tthree: ThreeModule,\n\tmesh: SmartArt3DMesh,\n\tblock: SmartArt3DTextBlock,\n\tzs: readonly number[],\n\tlight: SmartArt3DLightModel,\n\tdisposables: Disposable[],\n): THREE.Mesh[] {\n\tconst built = zs.length > 0 ? buildTextBlockTexture(three, block) : null;\n\tif (!built) {\n\t\treturn [];\n\t}\n\tconst geometry = new three.PlaneGeometry(built.worldWidth, built.worldHeight);\n\tconst material = new three.MeshBasicMaterial({\n\t\tmap: built.texture,\n\t\ttransparent: true,\n\t\tdepthWrite: false,\n\t});\n\t// The rig's tint is a linear factor, like the solids' vertex colours.\n\tmaterial.color.setRGB(light.tint[0], light.tint[1], light.tint[2]);\n\tdisposables.push(built.texture, geometry, material);\n\treturn zs.map((z) => {\n\t\tconst plane = new three.Mesh(geometry, material);\n\t\t// Text blocks carry world positions; the group sits at the mesh position.\n\t\tplane.position.set(block.x - mesh.position.x, block.y - mesh.position.y, z - mesh.position.z);\n\t\treturn plane;\n\t});\n}\n\n/** Add the lit label (flat or extruded) of `mesh` to `group`. */\nexport function buildLitTextObject(\n\tthree: ThreeModule,\n\tmesh: SmartArt3DMesh,\n\tgroup: THREE.Group,\n\tlight: SmartArt3DLightModel,\n\tdisposables: Disposable[],\n): void {\n\tconst block = mesh.textBlock;\n\tif (!block) {\n\t\treturn;\n\t}\n\tconst layers = smartArt3DTextLayers(block);\n\tconst planes = [\n\t\t...(layers\n\t\t\t? textPlanes(\n\t\t\t\t\tthree,\n\t\t\t\t\tmesh,\n\t\t\t\t\t{ ...block, color: layers.sideColor },\n\t\t\t\t\tlayers.sideZ,\n\t\t\t\t\tlight,\n\t\t\t\t\tdisposables,\n\t\t\t\t)\n\t\t\t: []),\n\t\t...textPlanes(three, mesh, block, [layers?.frontZ ?? block.z], light, disposables),\n\t];\n\tfor (const plane of planes) {\n\t\tgroup.add(plane);\n\t}\n}\n","/**\n * Build the three.js `Object3D` for one lit `SmartArt3DMesh` (bevel / scene\n * quick styles): the solid from `render/smartart-3d-solid-geometry.ts`,\n * shaded per vertex by `render/smartart-3d-vertex-shading.ts`, plus the same\n * stroke and text label the flat path draws.\n *\n * Must not import `three` at runtime (it takes the module as a parameter).\n *\n * @module smartart-3d/lit-mesh-object\n */\nimport type * as THREE from 'three';\n\nimport {\n\tsmartArt3DGradientColor,\n\tsmartArt3DGradientCoordinate,\n} from '../render/smartart-3d-drawing-solid';\nimport type { SmartArt3DLightModel } from '../render/smartart-3d-lighting';\nimport { toCcwRing } from '../render/smartart-3d-ring';\nimport type { SolidCap, SolidTriangles } from '../render/smartart-3d-solid-geometry';\nimport { buildSmartArt3DSolidGeometry } from '../render/smartart-3d-solid-geometry';\nimport type { SmartArt3DGradient } from '../render/smartart-3d-solid-types';\nimport {\n\tisSmartArt3DGlassMaterial,\n\torientSmartArt3DTriangles,\n\tsmartArt3DGlassLightModel,\n\tsmartArt3DVertexAlphas,\n} from '../render/smartart-3d-translucency';\nimport type { Point2, SmartArt3DMesh, Vec3 } from '../render/smartart-3d-types';\nimport type { Rgb } from '../render/smartart-3d-vertex-shading';\nimport { hexToRgb, shadeSmartArt3DVertices } from '../render/smartart-3d-vertex-shading';\nimport type { ThreeModule } from '../three-view/types';\nimport type { Disposable, MeshObject } from './flat-mesh-object';\nimport { buildStrokeLines } from './flat-mesh-object';\nimport { buildLitTextObject } from './lit-text-object';\n\n/** Render order of a label within its mesh group (after body, sides, contour). */\nconst LABEL_RENDER_ORDER = 3;\n\n/** Width of the 1D gradient lookup texture. */\nconst GRADIENT_TEXELS = 256;\n\n/** Append a triangulated planar cap to a triangle list. */\nfunction appendCap(three: ThreeModule, out: SolidTriangles, cap: SolidCap): void {\n\tif (cap.ring.length < 3) {\n\t\treturn;\n\t}\n\tconst contour = cap.ring.map((p) => new three.Vector2(p.x, p.y));\n\tconst holes = cap.holes.map((hole) => hole.map((p) => new three.Vector2(p.x, p.y)));\n\tconst all = [...contour, ...holes.flat()];\n\tfor (const face of three.ShapeUtils.triangulateShape(contour, holes)) {\n\t\tfor (const index of face) {\n\t\t\tconst p = all[index];\n\t\t\tout.positions.push(p.x, p.y, cap.z);\n\t\t\tout.normals.push(0, 0, cap.facing);\n\t\t}\n\t}\n}\n\nfunction buildGradientTexture(\n\tthree: ThreeModule,\n\tgradient: SmartArt3DGradient,\n): THREE.CanvasTexture | null {\n\tif (typeof document === 'undefined') {\n\t\treturn null;\n\t}\n\tconst canvas = document.createElement('canvas');\n\tcanvas.width = GRADIENT_TEXELS;\n\tcanvas.height = 1;\n\tconst ctx = canvas.getContext('2d');\n\tif (!ctx) {\n\t\treturn null;\n\t}\n\tconst paint = ctx.createLinearGradient(0, 0, GRADIENT_TEXELS, 0);\n\tfor (const stop of gradient.stops) {\n\t\tpaint.addColorStop(stop.offset, stop.color);\n\t}\n\tctx.fillStyle = paint;\n\tctx.fillRect(0, 0, GRADIENT_TEXELS, 1);\n\tconst texture = new three.CanvasTexture(canvas);\n\ttexture.colorSpace = three.SRGBColorSpace;\n\ttexture.wrapS = three.ClampToEdgeWrapping;\n\ttexture.needsUpdate = true;\n\treturn texture;\n}\n\ninterface PaintedPart {\n\ttriangles: SolidTriangles;\n\tcolor: string;\n\tgradient?: SmartArt3DGradient;\n\t/** The mesh's fill opacity (a Venn circle's 50% alpha); 1 when opaque. */\n\topacity: number;\n\t/** `a:sp3d/@prstMaterial` (a `clear` glass varies its alpha per vertex). */\n\tmaterial?: string;\n}\n\n/** Interleave linear RGB factors with per-vertex alphas (RGBA). */\nfunction withAlpha(rgb: Float32Array, alpha: Float32Array): Float32Array {\n\tconst out = new Float32Array(alpha.length * 4);\n\tfor (let v = 0; v < alpha.length; v++) {\n\t\tout.set(rgb.subarray(v * 3, v * 3 + 3), v * 4);\n\t\tout[v * 4 + 3] = alpha[v];\n\t}\n\treturn out;\n}\n\nfunction buildPart(\n\tthree: ThreeModule,\n\tpart: PaintedPart,\n\tlight: SmartArt3DLightModel,\n\teye: Vec3 | undefined,\n\tdisposables: Disposable[],\n): THREE.Mesh | null {\n\tif (part.triangles.positions.length === 0) {\n\t\treturn null;\n\t}\n\tconst glass = isSmartArt3DGlassMaterial(part.material);\n\t// A translucent solid is blended once: only its surfaces facing the camera\n\t// are drawn (render/smartart-3d-translucency.ts).\n\tconst translucent = part.opacity < 1 || glass;\n\tif (translucent) {\n\t\torientSmartArt3DTriangles(part.triangles);\n\t}\n\tconst { positions, normals } = part.triangles;\n\tconst gradient = part.gradient;\n\tconst flatColor = hexToRgb(part.color);\n\tconst baseAt = (p: Point2): Rgb => (gradient ? smartArt3DGradientColor(gradient, p) : flatColor);\n\tconst geometry = new three.BufferGeometry();\n\tgeometry.setAttribute('position', new three.Float32BufferAttribute(positions, 3));\n\tconst shading = shadeSmartArt3DVertices(\n\t\tpositions,\n\t\tnormals,\n\t\tbaseAt,\n\t\tglass ? smartArt3DGlassLightModel(light) : light,\n\t\teye,\n\t);\n\tgeometry.setAttribute(\n\t\t'color',\n\t\tglass\n\t\t\t? new three.BufferAttribute(\n\t\t\t\t\twithAlpha(\n\t\t\t\t\t\tshading,\n\t\t\t\t\t\tsmartArt3DVertexAlphas(positions, normals, part.material, part.opacity, eye),\n\t\t\t\t\t),\n\t\t\t\t\t4,\n\t\t\t\t)\n\t\t\t: new three.BufferAttribute(shading, 3),\n\t);\n\tconst texture = gradient ? buildGradientTexture(three, gradient) : null;\n\tif (gradient && texture) {\n\t\tconst uv: number[] = [];\n\t\tfor (let i = 0; i < positions.length; i += 3) {\n\t\t\tuv.push(\n\t\t\t\tsmartArt3DGradientCoordinate({ x: positions[i], y: positions[i + 1] }, gradient),\n\t\t\t\t0.5,\n\t\t\t);\n\t\t}\n\t\tgeometry.setAttribute('uv', new three.Float32BufferAttribute(uv, 2));\n\t\tdisposables.push(texture);\n\t}\n\tconst material = new three.MeshBasicMaterial({\n\t\tcolor: texture ? '#ffffff' : part.color,\n\t\tmap: texture,\n\t\tvertexColors: true,\n\t\tside: translucent ? three.FrontSide : three.DoubleSide,\n\t\ttransparent: translucent,\n\t\t// A glass carries its alpha per vertex; the material then stays at 1.\n\t\topacity: glass ? 1 : part.opacity,\n\t\t// Translucent solids are layered in paint order, like PowerPoint's\n\t\t// per-shape compositing, rather than hiding one another.\n\t\tdepthWrite: !translucent,\n\t});\n\tdisposables.push(geometry, material);\n\treturn new three.Mesh(geometry, material);\n}\n\n/**\n * Build the complete `Object3D` for one lit mesh (in diagram space; a scene\n * camera's rotation is applied by the caller's parent group).\n *\n * @param eye - a perspective scene camera's position in diagram space.\n */\nexport function buildLitMeshObject(\n\tthree: ThreeModule,\n\tmesh: SmartArt3DMesh,\n\tlight: SmartArt3DLightModel,\n\teye?: Vec3,\n): MeshObject {\n\tconst localEye = eye\n\t\t? { x: eye.x - mesh.position.x, y: eye.y - mesh.position.y, z: eye.z - mesh.position.z }\n\t\t: undefined;\n\tconst disposables: Disposable[] = [];\n\tconst group = new three.Group();\n\tgroup.position.set(mesh.position.x, mesh.position.y, mesh.position.z);\n\n\tif (!mesh.fillNone && mesh.outline.length >= 3) {\n\t\tconst holes = mesh.holes ?? [];\n\t\tconst geometry = mesh.solid\n\t\t\t? buildSmartArt3DSolidGeometry(mesh.outline, holes, mesh.solid)\n\t\t\t: undefined;\n\t\tconst body: SolidTriangles = geometry?.body ?? { positions: [], normals: [] };\n\t\tappendCap(\n\t\t\tthree,\n\t\t\tbody,\n\t\t\tgeometry?.frontCap ?? { ring: toCcwRing(mesh.outline), holes, z: 0, facing: 1 },\n\t\t);\n\t\tconst sides: SolidTriangles = geometry?.sides ?? { positions: [], normals: [] };\n\t\tif (geometry?.backCap) {\n\t\t\tappendCap(three, sides, geometry.backCap);\n\t\t}\n\t\tconst contour: SolidTriangles = { positions: [], normals: [] };\n\t\tfor (const cap of geometry?.contourCaps ?? []) {\n\t\t\tappendCap(three, contour, cap);\n\t\t}\n\t\tconst material = mesh.solid?.material;\n\t\tconst parts: PaintedPart[] = [\n\t\t\t{\n\t\t\t\ttriangles: body,\n\t\t\t\tcolor: mesh.fill,\n\t\t\t\tgradient: mesh.gradient,\n\t\t\t\topacity: mesh.opacity,\n\t\t\t\tmaterial,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttriangles: sides,\n\t\t\t\tcolor: mesh.solid?.extrusionColor ?? mesh.fill,\n\t\t\t\topacity: mesh.opacity,\n\t\t\t\tmaterial,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttriangles: contour,\n\t\t\t\tcolor: mesh.solid?.contourColor ?? mesh.fill,\n\t\t\t\topacity: mesh.opacity,\n\t\t\t},\n\t\t];\n\t\tparts.forEach((part, order) => {\n\t\t\tconst built = buildPart(three, part, light, localEye, disposables);\n\t\t\tif (built) {\n\t\t\t\tbuilt.renderOrder = order;\n\t\t\t\tgroup.add(built);\n\t\t\t}\n\t\t});\n\t}\n\tfor (const line of buildStrokeLines(three, mesh, disposables)) {\n\t\tgroup.add(line);\n\t}\n\tconst labelsFrom = group.children.length;\n\tbuildLitTextObject(three, mesh, group, light, disposables);\n\tfor (const label of group.children.slice(labelsFrom)) {\n\t\t// After the solid's own surfaces (see the parts' render order).\n\t\tlabel.renderOrder = LABEL_RENDER_ORDER;\n\t}\n\treturn { group, disposables };\n}\n","/**\n * Cameras for the `<pptx-three-view>` SmartArt scene: the face-on\n * orthographic framing every quick style starts from, and the whole-diagram\n * camera of a scene quick style (`SmartArt3DModel.camera`).\n *\n * Both frame the diagram's own bounds (letterboxed to the view's aspect) so\n * the z = 0 plane keeps the 2D layout's scale; a scene camera then turns the\n * diagram about its centre (see `render/smartart-3d-scene-camera.ts`) and, for\n * a perspective preset, looks at it from `distance` layout px away with a\n * field of view that still frames that plane at the same scale.\n *\n * Must not import `three` at runtime.\n *\n * @module smartart-3d/view-camera\n */\nimport type * as THREE from 'three';\n\nimport type { SmartArt3DBounds, SmartArt3DCamera } from '../render/smartart-3d-types';\nimport type { ThreeModule, ThreeViewSize } from '../three-view/types';\n\n/** Orthographic camera distance from the origin along +z (near/far only). */\nconst ORTHO_DISTANCE = 1000;\n\n/** Half-extents of the view frustum at z = 0, letterboxed to the view's aspect. */\nfunction frameHalfExtents(\n\tbounds: SmartArt3DBounds,\n\tsize: ThreeViewSize,\n): { halfW: number; halfH: number } {\n\tconst halfW = Math.max(1, bounds.width) / 2;\n\tconst halfH = Math.max(1, bounds.height) / 2;\n\tconst aspect = Math.max(1, size.pixelWidth) / Math.max(1, size.pixelHeight);\n\tconst fitHalfH = Math.max(halfH, halfW / aspect);\n\treturn { halfW: fitHalfH * aspect, halfH: fitHalfH };\n}\n\n/** The camera for a model, framed for `size`. */\nexport function buildSmartArtViewCamera(\n\tthree: ThreeModule,\n\tbounds: SmartArt3DBounds,\n\tsceneCamera: SmartArt3DCamera | undefined,\n\tsize: ThreeViewSize,\n): THREE.OrthographicCamera | THREE.PerspectiveCamera {\n\tlet camera: THREE.OrthographicCamera | THREE.PerspectiveCamera;\n\tif (sceneCamera?.projection === 'perspective') {\n\t\tconst distance = Math.max(1, sceneCamera.distance);\n\t\tcamera = new three.PerspectiveCamera(30, 1, distance / 20, distance * 20);\n\t\tcamera.position.set(0, 0, distance);\n\t} else {\n\t\tcamera = new three.OrthographicCamera(-1, 1, 1, -1, -ORTHO_DISTANCE * 2, ORTHO_DISTANCE * 2);\n\t\tcamera.position.set(0, 0, ORTHO_DISTANCE);\n\t}\n\tcamera.zoom = sceneCamera?.zoom ?? 1;\n\tcamera.lookAt(0, 0, 0);\n\tfitSmartArtViewCamera(camera, bounds, size);\n\treturn camera;\n}\n\n/** Re-frame a camera from {@link buildSmartArtViewCamera} for a new view size. */\nexport function fitSmartArtViewCamera(\n\tcamera: THREE.OrthographicCamera | THREE.PerspectiveCamera,\n\tbounds: SmartArt3DBounds,\n\tsize: ThreeViewSize,\n): void {\n\tconst { halfW, halfH } = frameHalfExtents(bounds, size);\n\tif ('isPerspectiveCamera' in camera && camera.isPerspectiveCamera) {\n\t\tcamera.aspect = halfW / halfH;\n\t\tcamera.fov = (2 * Math.atan(halfH / camera.position.length()) * 180) / Math.PI;\n\t} else {\n\t\tconst ortho = camera as THREE.OrthographicCamera;\n\t\tortho.left = -halfW;\n\t\tortho.right = halfW;\n\t\tortho.top = halfH;\n\t\tortho.bottom = -halfH;\n\t}\n\tcamera.updateProjectionMatrix();\n}\n","/**\n * How far a turned SmartArt diagram reaches past its element box, and the\n * camera framing that draws it there (see `three-view/view-overflow.ts`).\n *\n * Must not import `three` at runtime (it takes the module as a parameter).\n *\n * @module smartart-3d/view-overflow\n */\nimport type * as THREE from 'three';\n\nimport type { ThreeModule, ThreeViewOverflow, ThreeViewSize } from '../three-view/types';\nimport {\n\thasThreeViewOverflow,\n\tNO_THREE_VIEW_OVERFLOW,\n\toverflowViewOffset,\n\tthreeViewOverflowFromNdc,\n} from '../three-view/view-overflow';\n\ntype ViewCamera = THREE.OrthographicCamera | THREE.PerspectiveCamera;\n\n/**\n * Project the corners of every mesh's bounding box through `camera` (with no\n * view offset) and measure how far they reach past the element box.\n */\nfunction measureOverflow(\n\tthree: ThreeModule,\n\troot: THREE.Object3D,\n\tcamera: ViewCamera,\n): ThreeViewOverflow {\n\troot.updateMatrixWorld(true);\n\tcamera.updateMatrixWorld(true);\n\tconst points: { x: number; y: number }[] = [];\n\tconst corner = new three.Vector3();\n\troot.traverse((object) => {\n\t\tconst geometry = (object as THREE.Mesh).geometry as THREE.BufferGeometry | undefined;\n\t\tif (!geometry?.getAttribute?.('position')) {\n\t\t\treturn;\n\t\t}\n\t\tif (!geometry.boundingBox) {\n\t\t\tgeometry.computeBoundingBox();\n\t\t}\n\t\tconst box = geometry.boundingBox;\n\t\tif (!box || box.isEmpty()) {\n\t\t\treturn;\n\t\t}\n\t\tfor (let i = 0; i < 8; i++) {\n\t\t\tcorner\n\t\t\t\t.set(\n\t\t\t\t\ti & 1 ? box.max.x : box.min.x,\n\t\t\t\t\ti & 2 ? box.max.y : box.min.y,\n\t\t\t\t\ti & 4 ? box.max.z : box.min.z,\n\t\t\t\t)\n\t\t\t\t.applyMatrix4(object.matrixWorld)\n\t\t\t\t.project(camera);\n\t\t\tpoints.push({ x: corner.x, y: corner.y });\n\t\t}\n\t});\n\treturn threeViewOverflowFromNdc(points);\n}\n\n/**\n * Frame `camera` for the element box plus the diagram's overflow, and return\n * that overflow. `turned` is false for a face-on diagram, which always fits\n * its box (no overflow is measured).\n */\nexport function frameSmartArtOverflow(\n\tthree: ThreeModule,\n\troot: THREE.Object3D,\n\tcamera: ViewCamera,\n\tsize: ThreeViewSize,\n\tturned: boolean,\n): ThreeViewOverflow {\n\tcamera.clearViewOffset();\n\tif (!turned) {\n\t\treturn NO_THREE_VIEW_OVERFLOW;\n\t}\n\tconst overflow = measureOverflow(three, root, camera);\n\tif (hasThreeViewOverflow(overflow)) {\n\t\tconst offset = overflowViewOffset(size, overflow);\n\t\tcamera.setViewOffset(\n\t\t\toffset.fullWidth,\n\t\t\toffset.fullHeight,\n\t\t\toffset.x,\n\t\t\toffset.y,\n\t\t\toffset.width,\n\t\t\toffset.height,\n\t\t);\n\t}\n\treturn overflow;\n}\n","/**\n * `<pptx-three-view>` scene module for 3D SmartArt.\n *\n * Flat quick styles (Simple Fill, White Outline, Subtle, Moderate, Intense):\n * every mesh is a zero-depth `ShapeGeometry` face, unlit (`MeshBasicMaterial`),\n * under a fixed orthographic camera framing the diagram's own viewBox\n * (`model.bounds`) - the same geometry/fills/text the 2D SVG renderer draws,\n * built by `render/smartart-3d-drawing-model.ts`.\n *\n * Bevel and scene quick styles (`model.styleCategory` `'bevel'`/`'scene'`):\n * each mesh becomes a lit solid (`lit-mesh-object.ts`: bevel bands,\n * extrusion, contour, per-vertex shading from the model's light rig). A scene\n * style also turns the whole diagram by its quick-style camera\n * (`model.camera`, `view-camera.ts`).\n *\n * The camera is fixed (no orbit): PowerPoint never turns a SmartArt under the\n * pointer, and dragging the element to move it must not rotate the diagram.\n *\n * Must not import `three` at runtime (use `ctx.three`): this module is\n * reachable from the main barrel through the scene registry.\n *\n * @module smartart-3d/view-scene\n */\n\nimport { resolveSmartArt3DLightModel } from '../render/smartart-3d-lighting';\nimport { smartArt3DCameraMatrix, smartArt3DEyeInDiagram } from '../render/smartart-3d-scene-camera';\nimport { isSmartArt3DTranslucentMesh } from '../render/smartart-3d-translucency';\nimport type { SmartArt3DModel } from '../render/smartart-3d-types';\nimport type { ThreeViewContext, ThreeViewScene } from '../three-view/types';\nimport type { Disposable } from './flat-mesh-object';\nimport { buildFlatMeshObject } from './flat-mesh-object';\nimport { buildLitMeshObject } from './lit-mesh-object';\nimport { buildSmartArtViewCamera, fitSmartArtViewCamera } from './view-camera';\nimport { frameSmartArtOverflow } from './view-overflow';\n\nexport async function mountSmartArt3DView(\n\tmodel: SmartArt3DModel,\n\tctx: ThreeViewContext,\n): Promise<ThreeViewScene> {\n\tconst { three } = ctx;\n\tconst scene = new three.Scene();\n\tif (model.background) {\n\t\tscene.background = new three.Color(model.background);\n\t}\n\n\tconst disposables: Disposable[] = [];\n\tconst lit = model.styleCategory === 'bevel' || model.styleCategory === 'scene';\n\tconst view = model.camera ? smartArt3DCameraMatrix(model.camera) : undefined;\n\tconst eye = model.camera ? smartArt3DEyeInDiagram(model.camera) : undefined;\n\tconst root = new three.Group();\n\tif (view) {\n\t\troot.matrixAutoUpdate = false;\n\t\troot.matrix.set(\n\t\t\tview[0],\n\t\t\tview[1],\n\t\t\tview[2],\n\t\t\t0,\n\t\t\tview[3],\n\t\t\tview[4],\n\t\t\tview[5],\n\t\t\t0,\n\t\t\tview[6],\n\t\t\tview[7],\n\t\t\tview[8],\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t1,\n\t\t);\n\t}\n\tscene.add(root);\n\tmodel.meshes.forEach((mesh, index) => {\n\t\tconst built = lit\n\t\t\t? buildLitMeshObject(\n\t\t\t\t\tthree,\n\t\t\t\t\tmesh,\n\t\t\t\t\tresolveSmartArt3DLightModel(\n\t\t\t\t\t\tmodel.lighting,\n\t\t\t\t\t\tmesh.solid?.material,\n\t\t\t\t\t\teye !== undefined,\n\t\t\t\t\t\tmodel.camera !== undefined,\n\t\t\t\t\t),\n\t\t\t\t\teye,\n\t\t\t\t)\n\t\t\t: buildFlatMeshObject(three, mesh);\n\t\tif (lit && isSmartArt3DTranslucentMesh(mesh)) {\n\t\t\t// Translucent solids composite in paint order (lit-mesh-object.ts).\n\t\t\tbuilt.group.renderOrder = index + 1;\n\t\t}\n\t\troot.add(built.group);\n\t\tdisposables.push(...built.disposables);\n\t});\n\n\tconst camera = buildSmartArtViewCamera(three, model.bounds, model.camera, ctx.size);\n\t// A turned diagram draws past its box as PowerPoint does (view-overflow.ts).\n\tlet overflow = frameSmartArtOverflow(three, root, camera, ctx.size, Boolean(model.camera));\n\n\treturn {\n\t\trender(renderer) {\n\t\t\trenderer.render(scene, camera);\n\t\t},\n\t\tresize(size) {\n\t\t\tfitSmartArtViewCamera(camera, model.bounds, size);\n\t\t\toverflow = frameSmartArtOverflow(three, root, camera, size, Boolean(model.camera));\n\t\t},\n\t\toverflow() {\n\t\t\treturn overflow;\n\t\t},\n\t\tdispose() {\n\t\t\tfor (const d of disposables) {\n\t\t\t\td.dispose();\n\t\t\t}\n\t\t},\n\t};\n}\n"],"mappings":";AA6BA,MAAM,mBAAmB;AAEzB,MAAM,kBAAkB;AAExB,MAAM,sBAAsB;AAG5B,SAAgB,0BAA0B,UAA4B;CACrE,OAAO,aAAa;AACrB;AASA,SAAgB,uBACf,UACA,SACA,QAAc;CAEd,IAAI,CAAC,0BAA0B,QAAQ,GACtC,OAAO;CAER,MAAM,OAAO,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,MAAM,CAAC;CAChD,MAAM,QAAQ,mBAAmB,kBAAkB,QA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