{
  "version": 3,
  "sources": ["../../src/document/components/chrome/shared/PopoutWindow.tsx", "../../src/plugins/useStorage.ts", "../../src/document/components/chrome/shared/FloatingWindow.tsx", "../../src/document/components/chrome/shared/FloatingWindow.styles.ts", "../../src/document/components/chrome/shared/PopoutButton.tsx", "../../src/document/components/chrome/properties/utils/VariantOverrideContext.tsx", "../../src/document/components/chrome/shared/PopoutButton.styles.ts", "../../src/document/components/chrome/shared/PopoutContext.ts", "../../src/document/components/chrome/shared/PopoutPopover.tsx", "../../src/document/components/chrome/isModalInFrontOfPopover.ts", "../../src/document/components/chrome/useHasModalInFrontOfPopover.ts", "../../src/document/components/chrome/shared/PopoutNavigation.tsx", "../../src/document/components/chrome/shared/PopoutPopover.styles.ts", "../../src/document/components/chrome/shared/PopoutWindow.styles.ts", "../../src/document/components/chrome/shared/ResizeZone.tsx", "../../src/document/components/chrome/shared/chromeHitTargets.ts", "../../src/utils/isRepeaterDescendent.ts", "../../../../../node_modules/@framerjs/framer-events/lib/esm/generated/GridsCreate.js", "../../src/document/models/CanvasTree/traits/utils/addGridsToSelection.ts", "../../src/document/models/CanvasTree/traits/utils/pageEffects.ts", "../../src/document/models/CanvasTree/traits/utils/cssVariables.ts", "../../src/document/models/CanvasTree/utils/collectTextStyleForHandoff.ts", "../../src/document/models/CanvasTree/traits/utils/styleForNode.ts", "../../src/document/utils/isValidColorOrToken.ts", "../../src/document/utils/splitCSSValueList.ts", "../../src/utils/clipboard/helpers/embed.ts", "../../src/utils/clipboard/helpers/figma.ts", "../../src/prosemirror/richTextEditorAttributes.ts", "../../src/utils/clipboard/helpers/images.ts", "../../src/utils/clipboard/helpers/svg.ts", "../../src/document/components/canvas/addVideosToCanvas.ts", "../../src/utils/clipboard/helpers/videos.ts", "../../src/utils/showCopyFailToast.ts", "../../src/utils/clipboard/helpers/collections.ts", "../../src/document/models/CanvasTree/traits/utils/parseBorderFromStyle.ts", "../../src/document/models/CanvasTree/traits/utils/parseFillFromStyle.ts", "../../src/document/models/CanvasTree/traits/utils/parseOverflowFromStyle.ts", "../../src/document/models/CanvasTree/traits/utils/parseFiltersFromStyle.ts", "../../src/utils/clipboard/helpers/html/genericStyleFromCSS.ts", "../../src/document/models/CanvasTree/traits/utils/parsePaddingFromStyle.ts", "../../src/utils/clipboard/helpers/html/parseFont.ts", "../../src/utils/clipboard/helpers/html/richTextNodeFromElement.ts", "../../src/utils/clipboard/helpers/html/uploadImageAndReplacePlaceholder.ts", "../../src/utils/clipboard/helpers/html.ts", "../../src/utils/clipboard/helpers/plainText.ts", "../../src/document/models/CanvasTree/traits/utils/expandSelectionForShapeProperties.ts", "../../src/document/models/CanvasTree/traits/utils/reduceAspectRatio.ts", "../../src/document/models/CanvasTree/traits/utils/reduceBlending.ts", "../../src/document/models/CanvasTree/traits/utils/reduceBorder.ts", "../../src/document/models/CanvasTree/traits/utils/reduceFill.ts", "../../src/document/models/CanvasTree/traits/utils/reduceOpacity.ts", "../../src/document/models/CanvasTree/traits/utils/reducePins.ts", "../../src/document/models/CanvasTree/traits/utils/reduceStroke.ts", "../../src/document/models/CanvasTree/traits/utils/reduceTextTruncation.ts", "../../src/document/models/CanvasTree/traits/utils/reduceA11ySupport.ts", "../../src/document/models/CanvasTree/traits/utils/undefinedToEmptyString.ts", "../../src/document/models/CanvasTree/traits/utils/reduceAltText.ts", "../../src/document/models/CanvasTree/traits/utils/reduceAriaLabel.ts", "../../src/document/models/CanvasTree/traits/utils/reduceEffectTransition.ts", "../../src/document/models/CanvasTree/traits/utils/reduceBackdrop.ts", "../../src/document/models/CanvasTree/traits/utils/reduceCodeOverrides.ts", "../../src/document/models/CanvasTree/traits/utils/reduceCollectionOptions.ts", "../../src/document/models/controlProps/memoReducedControlProps.ts", "../../src/document/models/CanvasTree/traits/utils/reduceControlPropsWithIdentifier.ts", "../../src/document/models/CanvasTree/traits/utils/reduceControlProps.ts", "../../src/document/models/CanvasTree/traits/utils/reduceCurrentVariantSize.ts", "../../src/document/models/CanvasTree/traits/utils/reduceCursor.ts", "../../src/document/models/CanvasTree/traits/utils/reduceDataNosnippet.ts", "../../src/document/models/CanvasTree/traits/utils/reduceDataRepeaterArray.ts", "../../src/document/models/CanvasTree/traits/utils/reduceDataRepeaterOriginalId.ts", "../../src/document/models/CanvasTree/traits/utils/reduceDataSource.ts", "../../src/document/models/CanvasTree/traits/utils/reduceDragEffect.ts", "../../src/document/models/CanvasTree/traits/utils/reduceDraggable.ts", "../../src/document/models/CanvasTree/traits/utils/reduceEnabledVariableProperties.ts", "../../src/document/models/CanvasTree/traits/utils/reduceFillOpacity.ts", "../../src/document/models/CanvasTree/traits/utils/reduceFilters.ts", "../../src/document/models/CanvasTree/traits/utils/reduceFloatingPosition.ts", "../../src/document/models/CanvasTree/traits/utils/reduceFlowEffect.ts", "../../src/document/models/CanvasTree/traits/utils/reduceObjectProperty.ts", "../../src/document/models/CanvasTree/traits/utils/reduceFormBooleanInputType.ts", "../../src/document/models/CanvasTree/traits/utils/reduceFormContainer.ts", "../../src/document/models/CanvasTree/traits/utils/reduceFormInput.ts", "../../src/document/models/CanvasTree/traits/utils/reduceFormInputAutofillEnabled.ts", "../../src/document/models/CanvasTree/traits/utils/reduceFormInputIcon.ts", "../../src/document/models/CanvasTree/traits/utils/reduceFormInputInvalidStyles.ts", "../../src/document/models/CanvasTree/traits/utils/reduceFormInputPlaceholder.ts", "../../src/document/models/CanvasTree/traits/utils/reduceFormInputStep.ts", "../../src/document/models/CanvasTree/traits/utils/reduceFormSelect.ts", "../../src/document/models/CanvasTree/traits/utils/reduceFormTextInputType.ts", "../../src/document/models/CanvasTree/traits/utils/reduceGridItemLayout.ts", "../../src/document/models/CanvasTree/traits/utils/reduceGridItemSize.ts", "../../src/document/models/CanvasTree/traits/utils/reduceGrids.ts", "../../src/document/models/CanvasTree/traits/utils/reduceHTMLTags.ts", "../../src/document/models/CanvasTree/traits/utils/reduceHasOverlay.ts", "../../src/document/models/CanvasTree/traits/utils/reduceImageRendering.ts", "../../src/document/models/CanvasTree/traits/utils/NonDeterministic.ts", "../../src/document/models/CanvasTree/traits/utils/reduceLayout.ts", "../../src/document/models/CanvasTree/traits/utils/reduceLayoutTemplateControlProps.ts", "../../src/document/models/CanvasTree/traits/utils/reduceLightboxEffect.ts", "../../src/document/models/CanvasTree/traits/utils/reduceLink.ts", "../../src/document/models/CanvasTree/traits/utils/reduceLoopEffect.ts", "../../src/document/models/CanvasTree/traits/utils/reduceMasks.ts", "../../src/document/models/CanvasTree/traits/utils/reduceOverflow.ts", "../../src/document/models/CanvasTree/traits/utils/reduceOverlayTriggerEvent.ts", "../../src/document/models/CanvasTree/traits/utils/reduceOverscrollBehavior.ts", "../../src/document/models/CanvasTree/traits/utils/reducePadding.ts", "../../src/document/models/CanvasTree/traits/utils/reducePageEffect.ts", "../../src/document/models/CanvasTree/traits/utils/reduceParallax.ts", "../../src/document/models/CanvasTree/traits/utils/reducePointerEvents.ts", "../../src/document/models/CanvasTree/traits/utils/reduceRepeatArray.ts", "../../src/document/models/CanvasTree/traits/utils/reduceRepeatOriginalId.ts", "../../src/document/models/CanvasTree/traits/utils/reduceResizeToFitContentAction.ts", "../../src/document/models/CanvasTree/traits/utils/reduceRootFontSize.ts", "../../src/document/models/CanvasTree/traits/utils/reduceScrollTarget.ts", "../../src/document/models/CanvasTree/traits/utils/reduceScrollbars.ts", "../../src/document/components/chrome/properties/panels/utils/selectionProperties.ts", "../../src/document/models/CanvasTree/traits/utils/reduceSelectionProperties.ts", "../../src/document/models/CanvasTree/traits/utils/reduceShaderMouse.ts", "../../src/document/models/CanvasTree/traits/utils/reduceSize.ts", "../../src/document/models/CanvasTree/traits/utils/reduceSizeConstraints.ts", "../../src/document/models/CanvasTree/traits/utils/reduceStrokeEffect.ts", "../../src/document/models/CanvasTree/traits/utils/reduceStyleAppearEffect.ts", "../../src/document/models/CanvasTree/traits/utils/reduceStyleTransformEffect.ts", "../../src/document/models/CanvasTree/traits/utils/reduceTabIndex.ts", "../../src/document/models/CanvasTree/traits/utils/reduceTapHighlight.ts", "../../src/document/models/CanvasTree/traits/utils/reduceText.ts", "../../src/document/models/CanvasTree/traits/utils/reduceTextEffect.ts", "../../src/document/models/CanvasTree/traits/utils/reduceTextSelection.ts", "../../src/document/models/CanvasTree/traits/utils/reduceTickerEffect.ts", "../../src/document/models/CanvasTree/traits/utils/reduceTitleAndDescription.ts", "../../src/document/models/CanvasTree/traits/utils/reduceTrackingIdAIPrompt.ts", "../../src/document/models/CanvasTree/traits/utils/reduceTransforms.ts", "../../src/document/models/CanvasTree/traits/utils/reduceTransition.ts", "../../src/document/models/CanvasTree/traits/utils/reduceTriggerActions.ts", "../../src/document/models/CanvasTree/traits/utils/reduceUserSelect.ts", "../../src/document/models/CanvasTree/traits/utils/reduceVariableBinding.ts", "../../src/document/models/CanvasTree/traits/utils/reduceVariantAppearEffect.ts", "../../src/document/models/CanvasTree/traits/utils/reduceVariantOverrides.ts", "../../src/document/models/CanvasTree/traits/utils/reduceWhileHover.ts", "../../src/document/models/CanvasTree/traits/utils/reduceWhileTap.ts", "../../src/document/models/CanvasTree/traits/utils/reduceZIndex.ts", "../../src/document/models/CanvasTree/traits/utils/reduceProperties.ts", "../../src/utils/clipboard/helpers/styles.ts", "../../src/utils/clipboard/pasteInPlace.ts", "../../src/utils/clipboard/document.ts", "../../src/document/useEngineCallback.ts", "../../src/document/components/chrome/properties/rows/utils/stopPropagation.ts", "../../src/utils/richTextUtils.ts", "../../src/document/components/chrome/analytics/utils/openAnalytics.ts", "../../src/document/components/chrome/contentManagement/utils/fieldValidationHelpers.ts", "../../src/document/components/chrome/layers/AgentLayerIcons.tsx", "../../src/document/components/chrome/layers/IconAgentLayerGrid.tsx", "../../src/document/components/chrome/agentPanel/components/IconAgentCode.tsx", "../../src/document/components/chrome/agentPanel/components/IconAgentComponent.tsx", "../../src/document/components/chrome/agentPanel/components/IconAgentVideo.tsx", "../../src/document/components/chrome/PanelTooltip.tsx", "../../src/document/components/chrome/PanelTooltip.styles.ts"],
  "sourcesContent": ["import { NavigationStack } from \"@framerjs/fresco\"\nimport { cx } from \"@linaria/core\"\nimport { useBaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport { isVekterEngine } from \"document/useVekterEngine.ts\"\nimport React, { useCallback, useEffect } from \"react\"\nimport { isString } from \"utils/typeChecks.ts\"\nimport { useForceUpdate } from \"utils/useForceUpdate.ts\"\nimport type { FloatingWindowLeftOffset, FloatingWindowTopOffset } from \"./FloatingWindow.tsx\"\nimport { FloatingWindow, FloatingWindowDraggableArea } from \"./FloatingWindow.tsx\"\nimport { isPopoutButtonElement } from \"./PopoutButton.tsx\"\nimport { PopoutNavigation } from \"./PopoutNavigation.tsx\"\nimport * as styles from \"./PopoutWindow.styles.ts\"\nimport { isResizeZone } from \"./ResizeZone.tsx\"\nimport {\n\tdataIsAnalyticsSelector,\n\tdataIsCollectionLeftPanelSelector,\n\tdataIsCollectionTableSelector,\n\tdataIsEditorOverlaySelector,\n\tdataIsRightPanelSelector,\n} from \"./chromeHitTargets.ts\"\n\nconst dataIsPopoutWindowDataAttribute = \"data-is-popover-window\"\nexport const dataIsPopoutWindowSelector = `[${dataIsPopoutWindowDataAttribute}=\"true\"]`\n\nfunction getInitialWindowLeftOffset(triggerElement: HTMLElement, triggerBounds: DOMRect): FloatingWindowLeftOffset {\n\tif (triggerElement.closest(dataIsEditorOverlaySelector)) {\n\t\treturn \"100%\"\n\t}\n\n\treturn triggerBounds.left < window.innerWidth - triggerBounds.right ? \"0%\" : \"100%\"\n}\n\nclass PopoutWindow {\n\tnavigation: PopoutNavigation\n\tprivate floatingWindowRef = React.createRef<FloatingWindow>()\n\tprivate initialWindowTopOffset: FloatingWindowTopOffset = \"0px\"\n\tprivate initialWindowLeftOffset: FloatingWindowLeftOffset = \"100%\"\n\n\tconstructor() {\n\t\tthis.navigation = new PopoutNavigation({\n\t\t\ttriggerRender: this.rerender,\n\t\t\twillOpen: this.positionWindowNearElement,\n\t\t\twillPush: this.persistCurrentTopOffset,\n\t\t\twillPop: this.persistCurrentTopOffset,\n\t\t})\n\t}\n\n\tprivate positionWindowNearElement = (element: unknown) => {\n\t\tif (!(element instanceof HTMLElement)) return\n\t\tconst floatingWindow = this.floatingWindowRef.current\n\t\tconst elementBounds = element.getBoundingClientRect()\n\t\tconst topOffset = elementBounds.top - 9\n\t\tif (floatingWindow) {\n\t\t\tfloatingWindow.setPosition({ x: elementBounds.left, y: topOffset }, { snapToEdges: false })\n\t\t} else {\n\t\t\tthis.initialWindowTopOffset = `${topOffset}px`\n\t\t\tthis.initialWindowLeftOffset = getInitialWindowLeftOffset(element, elementBounds)\n\t\t}\n\t}\n\n\tprivate persistCurrentTopOffset = () => {\n\t\tconst floatingWindow = this.floatingWindowRef.current\n\t\tif (!floatingWindow) return\n\t\t// Keep the current fixed top offset if it has any\n\t\tif (floatingWindow.hasPersistedTopOffset()) return\n\t\tfloatingWindow.persistCurrentTopOffset()\n\t}\n\n\tisOpen = () => {\n\t\treturn this.navigation.isOpen()\n\t}\n\n\tclose = () => {\n\t\tthis.navigation.close()\n\t}\n\n\t// Rendering\n\n\tprivate _rerender: (() => void) | undefined\n\tprivate rerender = () => this._rerender?.()\n\n\tprivate navigationBarWrapper = (bar: React.ReactNode) => {\n\t\treturn <FloatingWindowDraggableArea>{bar}</FloatingWindowDraggableArea>\n\t}\n\n\t// FIXME: This pattern currently not supported by rules-of-hooks, see\n\t// https://github.com/facebook/react/pull/18341#issuecomment-749659456\n\t/* eslint-disable react-hooks/rules-of-hooks */\n\tComponent = React.memo(\n\t\t({\n\t\t\tzIndex,\n\t\t\tvisible,\n\t\t\trightInsetOverride,\n\t\t\trequiredContentWidth,\n\t\t\tonPointerDownCapture,\n\t\t}: {\n\t\t\tzIndex: number\n\t\t\tvisible: boolean\n\t\t\trightInsetOverride?: string\n\t\t\trequiredContentWidth?: string\n\t\t\tonPointerDownCapture: (event: React.PointerEvent) => void\n\t\t}) => {\n\t\t\tconst engine = useBaseEngine()\n\n\t\t\tconst forceUpdate = useForceUpdate()\n\n\t\t\tuseEffect(() => {\n\t\t\t\tthis._rerender = forceUpdate\n\t\t\t\treturn () => {\n\t\t\t\t\tthis._rerender = undefined\n\t\t\t\t}\n\t\t\t}, [forceUpdate])\n\n\t\t\tconst isOpen = this.navigation.isOpen()\n\n\t\t\tReact.useEffect(() => {\n\t\t\t\tif (!isOpen) return\n\n\t\t\t\tlet mouseDownWhileOpen = false\n\n\t\t\t\tconst handleMouseDown = () => {\n\t\t\t\t\tmouseDownWhileOpen = true\n\t\t\t\t}\n\n\t\t\t\tconst handleClick = (event: MouseEvent) => {\n\t\t\t\t\t// We only want to close the popout if the mouse down happened while the popout\n\t\t\t\t\t// was open, otherwise the popout can be closed within the same click that it\n\t\t\t\t\t// was opened.\n\t\t\t\t\tif (!mouseDownWhileOpen) return\n\t\t\t\t\tthis.closeIfClickedOutside(event)\n\t\t\t\t}\n\n\t\t\t\t// We use the capture phase for mouse down, because otherwise the mouse down event\n\t\t\t\t// can be seen that opened the popout. And we want to see a mouse down that's\n\t\t\t\t// unrelated to the one opening the popout.\n\t\t\t\tdocument.addEventListener(\"mousedown\", handleMouseDown, { capture: true })\n\t\t\t\tdocument.addEventListener(\"click\", handleClick)\n\t\t\t\treturn () => {\n\t\t\t\t\tdocument.removeEventListener(\"mousedown\", handleMouseDown, { capture: true })\n\t\t\t\t\tdocument.removeEventListener(\"click\", handleClick)\n\t\t\t\t}\n\t\t\t}, [isOpen])\n\n\t\t\tconst onKeyDown = useCallback((event: React.KeyboardEvent<HTMLElement>) => {\n\t\t\t\t// Forward modifier key state to engine store to ensure modifiers are updated in popouts\n\t\t\t\tif (isVekterEngine(engine)) {\n\t\t\t\t\tengine.stores.mouseStore.setModifiers(event.nativeEvent)\n\t\t\t\t}\n\n\t\t\t\tif (event.defaultPrevented) return\n\t\t\t\tif (event.key === \"Escape\") {\n\t\t\t\t\tthis.navigation.goBack(true)\n\t\t\t\t\tevent.stopPropagation()\n\t\t\t\t}\n\t\t\t}, [])\n\n\t\t\tconst onKeyUp = useCallback((event: React.KeyboardEvent<HTMLElement>) => {\n\t\t\t\t// Forward modifier key state to engine store to ensure modifiers are updated in popouts\n\t\t\t\tif (isVekterEngine(engine)) {\n\t\t\t\t\tengine.stores.mouseStore.setModifiers(event.nativeEvent)\n\t\t\t\t}\n\t\t\t}, [])\n\n\t\t\tif (!isOpen) return null\n\t\t\tconst currentItem = this.navigation.stack[this.navigation.currentStackIndex]\n\t\t\tif (!currentItem) return null\n\n\t\t\tconst dialogLabel = isString(currentItem.title) ? currentItem.title : undefined\n\n\t\t\treturn (\n\t\t\t\t<FloatingWindow\n\t\t\t\t\tref={this.floatingWindowRef}\n\t\t\t\t\tzIndex={zIndex}\n\t\t\t\t\tvisible={visible}\n\t\t\t\t\trightInsetOverride={rightInsetOverride}\n\t\t\t\t\trequiredContentWidth={requiredContentWidth}\n\t\t\t\t\tonPointerDownCapture={onPointerDownCapture}\n\t\t\t\t\tinitialTopOffset={this.initialWindowTopOffset}\n\t\t\t\t\tinitialLeftOffset={this.initialWindowLeftOffset}\n\t\t\t\t>\n\t\t\t\t\t{/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}\n\t\t\t\t\t<div\n\t\t\t\t\t\t// biome-ignore lint/a11y/useSemanticElements: would require risky css changes\n\t\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\t\taria-label={dialogLabel}\n\t\t\t\t\t\tclassName={cx(styles.window, this.navigation.stack[this.navigation.currentStackIndex]?.className)}\n\t\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\t\tonMouseUp={event => {\n\t\t\t\t\t\t\tif (isVekterEngine(engine)) {\n\t\t\t\t\t\t\t\tengine.stores.canvasMouseTarget.handleMouseUp(event)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t\t// biome-ignore lint/a11y/noNoninteractiveTabindex:\n\t\t\t\t\t\ttabIndex={0}\n\t\t\t\t\t\t{...{ [dataIsPopoutWindowDataAttribute]: true }}\n\t\t\t\t\t>\n\t\t\t\t\t\t<NavigationStack\n\t\t\t\t\t\t\tstack={this.navigation.stack}\n\t\t\t\t\t\t\tcurrentIndex={this.navigation.currentStackIndex}\n\t\t\t\t\t\t\tonBack={this.navigation.goBack}\n\t\t\t\t\t\t\tonClose={this.navigation.close}\n\t\t\t\t\t\t\trenderNavigationBarWrapper={this.navigationBarWrapper}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</FloatingWindow>\n\t\t\t)\n\t\t},\n\t)\n\t// FIXME (See top of function)\n\t/* eslint-enable react-hooks/rules-of-hooks */\n\n\t// Event handling\n\n\tprivate closeIfClickedOutside = ({ target }: MouseEvent) => {\n\t\tif (isResizeZone(target)) return\n\t\tif (isPopoutButtonElement(target)) return\n\n\t\tif (shouldClosePopoutForHitTarget(target)) {\n\t\t\tthis.navigation.close()\n\t\t}\n\t}\n}\n\nfunction shouldClosePopoutForHitTarget(target: EventTarget | null) {\n\tif (!(target instanceof HTMLElement)) return false\n\treturn (\n\t\t!!target.closest(dataIsRightPanelSelector) ||\n\t\t!!target.closest(dataIsAnalyticsSelector) ||\n\t\t!!target.closest(dataIsCollectionLeftPanelSelector) ||\n\t\t!!target.closest(dataIsCollectionTableSelector)\n\t)\n}\n\nexport const popoutWindow = new PopoutWindow()\n", "import { useCallback, useState } from \"react\"\nimport { isString } from \"utils/typeChecks.ts\"\n\nfunction parse(value: unknown): unknown {\n\ttry {\n\t\tif (!isString(value)) return null\n\t\treturn JSON.parse(value)\n\t} catch {\n\t\treturn null\n\t}\n}\n\nexport function getStoredValue<T>(key: string, isValid: (value: unknown) => value is T): T | null {\n\tconst rawLocalValue = localStorage.getItem(key)\n\tconst localValue = parse(rawLocalValue)\n\tif (isValid(localValue)) return localValue\n\n\treturn null\n}\n\n/**\n * Only returns initial values from storage, doesn't trigger re-renders so values get outdated.\n * Returns null if no valid values is found. The value is stored both in session storage as well as\n * local storage. This way different tabs don't fight each other during a session while the value\n * will still be restored at the start of a new session.\n */\nexport function useStorage<T>(\n\tkey: string,\n\tisValid: (value: unknown) => value is T,\n): readonly [T | null, (newValue: T) => void] {\n\tconst [value] = useState<T | null>(() => getStoredValue(key, isValid))\n\n\tconst setValue = useCallback(\n\t\t(newValue: T) => {\n\t\t\tconst stringified = JSON.stringify(newValue)\n\t\t\tlocalStorage.setItem(key, stringified)\n\t\t},\n\t\t[key],\n\t)\n\n\treturn [value, setValue] as const\n}\n", "import type { MouseTrackerEvent, MouseTrackerProps } from \"@framerjs/fresco\"\nimport { MouseTracker } from \"@framerjs/fresco\"\nimport { dimensions } from \"@framerjs/fresco/tokens\"\nimport { shouldBeNever } from \"@framerjs/shared\"\nimport { noop } from \"@framerjs/shared/src/noop.ts\"\nimport { cx } from \"@linaria/core\"\nimport { clamp } from \"framer-motion\"\nimport { Point } from \"library/render/types/Point.ts\"\nimport type { Rect } from \"library/render/types/Rect.ts\"\nimport type { Size } from \"library/render/types/Size.ts\"\nimport { getStoredValue } from \"plugins/useStorage.ts\"\nimport React from \"react\"\nimport { appPointerEvents } from \"utils/appPointerEvents.styles.ts\"\nimport { isNumber, isObject, isString, isUndefined } from \"utils/typeChecks.ts\"\nimport * as styles from \"./FloatingWindow.styles.ts\"\n\nconst overdragFactor = 0.1\n\n// A fixed top offset is achieved by setting the max height of the top spacer. We can't\n// conditionally apply this max height so we default to a really big number that basically means\n// \"top offset inactive\".\nconst megaMaxHeight = 9999999999999\n\n// Helpers\n\ninterface PositionConstraints {\n\tminX: number\n\tminY: number\n\tmaxX: number\n\tmaxY: number\n}\n\nfunction getWindowPositionConstraints(size: Size, constraintsRect: Rect): PositionConstraints {\n\tconst minY = 0\n\tconst minX = 0\n\tconst maxX = constraintsRect.width - size.width\n\tconst maxY = constraintsRect.height - size.height\n\treturn { minX, minY, maxX, maxY }\n}\n\nexport type FloatingWindowTopOffset = `${number}px` | `${number}%`\nexport type FloatingWindowLeftOffset = `${number}%`\n\nfunction parseIntAndUnit(value: string): { value: number; unit: \"px\" | \"%\" } | null {\n\tconst normalizedValue = value.trim()\n\tconst parsedValue = parseInt(normalizedValue)\n\tif (!isNumber(parsedValue)) return null\n\n\tif (normalizedValue.endsWith(\"%\")) return { value: parsedValue, unit: \"%\" }\n\tif (normalizedValue.endsWith(\"px\")) return { value: parsedValue, unit: \"px\" }\n\treturn null\n}\n\ninterface FloatingWindowProps {\n\tzIndex: number\n\tinitialTopOffset?: FloatingWindowTopOffset\n\tinitialLeftOffset?: FloatingWindowLeftOffset\n\t/** Overrides the default right inset for the floating window container. */\n\trightInsetOverride?: string\n\t/** Shrinks the left inset when needed to reserve this much content width if possible. */\n\trequiredContentWidth?: string\n\tchildren?: React.ReactNode\n\tcontentWrapperRef?: React.MutableRefObject<HTMLElement | null>\n\tcontainerRef?: React.MutableRefObject<HTMLElement | null>\n\tclassName?: React.HTMLAttributes<HTMLDivElement>[\"className\"]\n\tonDragEnd?: VoidFunction\n\tonPointerDownCapture?: (event: React.PointerEvent) => void\n\trestorationKey?: string\n\tvisible?: boolean\n\tconstraintBy?: \"app\" | \"canvas\"\n}\n\n/**\n * The floating window handles constraints and positioning and has no visual content or styles.\n * The constraints are set in CSS -- such that the browser window can be resized without requiring a re-render.\n * The size of the window depends on the rendered content.\n * The window is constrained to the bounds of the canvas.\n * The window attaches itself to the closest edge.\n */\nexport class FloatingWindow extends React.Component<FloatingWindowProps> {\n\tcontainerRef: React.MutableRefObject<HTMLDivElement | null> = React.createRef()\n\tcontentWrapperRef: React.MutableRefObject<HTMLDivElement | null> = React.createRef()\n\n\tstatic defaultProps: Partial<FloatingWindowProps> = {\n\t\tvisible: true,\n\t\tconstraintBy: \"canvas\",\n\t}\n\n\tprivate setContainerRefs = (element: HTMLDivElement | null) => {\n\t\tthis.containerRef.current = element\n\t\tconst { containerRef } = this.props\n\t\tif (containerRef) containerRef.current = element\n\t}\n\n\tprivate setContentWrapperRefs = (element: HTMLDivElement | null) => {\n\t\tthis.contentWrapperRef.current = element\n\t\tconst { contentWrapperRef } = this.props\n\t\tif (contentWrapperRef) contentWrapperRef.current = element\n\t}\n\n\toverride componentDidMount() {\n\t\tconst { restorationKey } = this.props\n\t\tif (!restorationKey) return\n\n\t\tconst storedData = getStoredValue(restorationKey, isRestoredWindowProperties)\n\t\tif (storedData) {\n\t\t\tthis.setFloatingWindowProperties(storedData)\n\t\t}\n\t}\n\n\toverride render() {\n\t\tconst {\n\t\t\tinitialTopOffset,\n\t\t\tinitialLeftOffset,\n\t\t\trightInsetOverride,\n\t\t\trequiredContentWidth,\n\t\t\tvisible,\n\t\t\tclassName,\n\t\t\tzIndex,\n\t\t\tconstraintBy,\n\t\t} = this.props\n\n\t\tlet defaultMaxTopOffset = megaMaxHeight\n\t\tlet defaultTopGrow = 0\n\t\tlet defaultBottomGrow = 1\n\t\tlet defaultLeftGrow = 0\n\t\tlet defaultRightGrow = 1\n\n\t\tif (isString(initialTopOffset)) {\n\t\t\tconst parsedTopOffset = parseIntAndUnit(initialTopOffset)\n\t\t\tif (parsedTopOffset) {\n\t\t\t\tif (parsedTopOffset.unit === \"%\") {\n\t\t\t\t\tconst max = 100\n\t\t\t\t\tdefaultTopGrow = clamp(0, max, parsedTopOffset.value)\n\t\t\t\t\tdefaultBottomGrow = max - parsedTopOffset.value\n\t\t\t\t} else if (parsedTopOffset.unit === \"px\") {\n\t\t\t\t\tdefaultMaxTopOffset = parsedTopOffset.value\n\t\t\t\t\tdefaultTopGrow = 1\n\t\t\t\t\tdefaultBottomGrow = 0\n\t\t\t\t} else {\n\t\t\t\t\tshouldBeNever(parsedTopOffset.unit)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (isString(initialLeftOffset)) {\n\t\t\tconst parsedLeftOffset = parseIntAndUnit(initialLeftOffset)\n\t\t\tif (parsedLeftOffset?.unit === \"%\") {\n\t\t\t\tconst max = 100\n\t\t\t\tdefaultLeftGrow = clamp(0, max, parsedLeftOffset.value)\n\t\t\t\tdefaultRightGrow = max - parsedLeftOffset.value\n\t\t\t}\n\t\t}\n\n\t\t// This value to be calculated with `--framerInternalUI-chromeMarginTop` because its value can change depending on the canvas scope\n\t\tconst constraintPadding = dimensions.css.panelPadding\n\t\tconst prefixTopVarValue = `calc(${defaultMaxTopOffset}px - var(--framerInternalUI-chromeMarginTop) - ${constraintPadding})`\n\t\tconst chromeLeftInset = constraintBy === \"app\" ? \"0px\" : \"var(--framerInternalUI-chromeMarginLeft)\"\n\t\tconst defaultRightInset = constraintBy === \"app\" ? \"0px\" : \"var(--framerInternalUI-chromeMarginRight)\"\n\t\tconst rightInset = rightInsetOverride ?? defaultRightInset\n\t\tconst horizontalPadding = `calc(${constraintPadding} * 2)`\n\t\tconst availableWidth = `calc(100vw - ${rightInset} - ${horizontalPadding})`\n\t\tconst leftInset = requiredContentWidth\n\t\t\t? `min(${chromeLeftInset}, max(0px, calc(${availableWidth} - ${requiredContentWidth})))`\n\t\t\t: chromeLeftInset\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t// Row\n\t\t\t\tref={this.setContainerRefs}\n\t\t\t\tclassName={cx(styles.noPointerEvents, className)}\n\t\t\t\tstyle={{\n\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\ttop: `calc(var(--framerInternalUI-chromeMarginTop) + ${constraintPadding})`,\n\t\t\t\t\tleft: `calc(${leftInset} + ${constraintPadding})`,\n\t\t\t\t\tright: `calc(${rightInset} + ${constraintPadding})`,\n\t\t\t\t\tbottom: `calc(var(--framerInternalUI-chromeMarginBottom) + ${constraintPadding})`,\n\t\t\t\t\tdisplay: \"flex\",\n\t\t\t\t\tvisibility: visible ? \"visible\" : \"hidden\",\n\t\t\t\t\tflexDirection: \"row\",\n\t\t\t\t\tzIndex,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\twidth: 0,\n\t\t\t\t\t\tflexGrow: `var(${PropertyKey.left}, ${defaultLeftGrow})`,\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\t<div\n\t\t\t\t\t// Column\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\twidth: \"auto\",\n\t\t\t\t\t\tdisplay: \"flex\",\n\t\t\t\t\t\tflexDirection: \"column\",\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\theight: 0,\n\t\t\t\t\t\t\tflexGrow: `var(${PropertyKey.top}, ${defaultTopGrow})`,\n\t\t\t\t\t\t\tmaxHeight: `var(${PropertyKey.fixedTop}, ${prefixTopVarValue})`,\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={this.setContentWrapperRefs}\n\t\t\t\t\t\tonPointerDownCapture={this.props.onPointerDownCapture}\n\t\t\t\t\t\tdraggable={false}\n\t\t\t\t\t\tclassName={cx(styles.pointerEvents, appPointerEvents)}\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tposition: \"relative\",\n\t\t\t\t\t\t\theight: \"auto\",\n\t\t\t\t\t\t\twidth: \"auto\",\n\t\t\t\t\t\t\tmaxHeight: \"100%\",\n\t\t\t\t\t\t\tflexShrink: 0,\n\t\t\t\t\t\t\ttransform: `translate(var(${PropertyKey.x}, 0px), var(${PropertyKey.y}, 0px))`,\n\t\t\t\t\t\t\ttransition: `var(${PropertyKey.transition})`,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ConstraintWindowContext.Provider value={this}>{this.props.children}</ConstraintWindowContext.Provider>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\theight: 0,\n\t\t\t\t\t\t\tflexGrow: `var(${PropertyKey.bottom}, ${defaultBottomGrow})`,\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\twidth: 0,\n\t\t\t\t\t\tflexGrow: `var(${PropertyKey.right}, ${defaultRightGrow})`,\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t)\n\t}\n\n\thasMoved = false\n\tdragStartRect: Rect | null = null\n\n\tgetConstraintsRect = (): Rect | null => {\n\t\tconst constraintsContainer = this.containerRef.current\n\t\tif (!constraintsContainer) return null\n\t\treturn constraintsContainer.getBoundingClientRect()\n\t}\n\n\tgetWindowRect = (): Rect | null => {\n\t\tconst constraintsRect = this.getConstraintsRect()\n\t\tif (!constraintsRect) return null\n\n\t\tconst contentWrapper = this.contentWrapperRef.current\n\t\tif (!contentWrapper) return null\n\t\tconst contentWrapperRect = contentWrapper.getBoundingClientRect()\n\n\t\treturn {\n\t\t\tx: contentWrapperRect.left - constraintsRect.x,\n\t\t\ty: contentWrapperRect.top - constraintsRect.y,\n\t\t\twidth: contentWrapperRect.width,\n\t\t\theight: contentWrapperRect.height,\n\t\t}\n\t}\n\n\tonDragStart = (_event: MouseTrackerEvent) => {\n\t\tthis.dragStartRect = this.getWindowRect()\n\t\tthis.hasMoved = false\n\t}\n\n\tonDrag = (event: MouseTrackerEvent) => {\n\t\tif (!this.dragStartRect) return\n\t\tconst windowRect = this.getWindowRect()\n\t\tif (!windowRect) return\n\t\tconst { width, height } = windowRect\n\n\t\tif (!this.hasMoved && event.offset.x === 0 && event.offset.y === 0) return\n\t\tthis.hasMoved = true\n\n\t\tthis.setRect(\n\t\t\t{ ...Point.add(event.offset, this.dragStartRect), width, height },\n\t\t\t{ rubberBandingEnabled: true, snapToEdges: true, fixedTop: false },\n\t\t)\n\t}\n\n\tonDragEnd = (_event: MouseTrackerEvent) => {\n\t\tif (!this.dragStartRect) return\n\t\tthis.dragStartRect = null\n\n\t\tif (!this.hasMoved) return\n\n\t\t// Animate back to the transform identity\n\t\tthis.setFloatingWindowProperties({ x: 0, y: 0, transition: \"transform 0.2s cubic-bezier(0.2, 0, 0, 1)\" })\n\n\t\tthis.props.onDragEnd?.()\n\t}\n\n\tsetPosition(point: Point, { snapToEdges }: { snapToEdges: boolean }) {\n\t\tconst constraintsRect = this.getConstraintsRect()\n\t\tconst windowRect = this.getWindowRect()\n\t\tif (!windowRect || !constraintsRect) return\n\n\t\tconst localPoint = Point.subtract(point, constraintsRect)\n\t\tthis.setRect(\n\t\t\t{ ...localPoint, width: windowRect.width, height: windowRect.height },\n\t\t\t{ rubberBandingEnabled: false, fixedTop: true, snapToEdges },\n\t\t)\n\t}\n\n\tsetRect(\n\t\trect: Rect,\n\t\t{\n\t\t\trubberBandingEnabled,\n\t\t\tsnapToEdges,\n\t\t\tfixedTop,\n\t\t}: { rubberBandingEnabled: boolean; snapToEdges: boolean; fixedTop: boolean },\n\t) {\n\t\tconst constraintsRect = this.getConstraintsRect()\n\t\tif (!constraintsRect) return\n\n\t\tconst { minX, minY, maxX, maxY } = getWindowPositionConstraints(rect, constraintsRect)\n\n\t\tlet left: number = rect.x\n\t\tlet top: number = rect.y\n\n\t\tif (snapToEdges) {\n\t\t\tconst minXDistance = Math.abs(left - minX)\n\t\t\tconst maxXDistance = Math.abs(left - maxX)\n\t\t\tconst minYDistance = Math.abs(top - minY)\n\t\t\tconst maxYDistance = Math.abs(top - maxY)\n\t\t\tif (minXDistance < 16) {\n\t\t\t\tleft = minX\n\t\t\t} else if (maxXDistance < 16) {\n\t\t\t\tleft = maxX\n\t\t\t}\n\t\t\tif (minYDistance < 16) {\n\t\t\t\ttop = minY\n\t\t\t} else if (maxYDistance < 16) {\n\t\t\t\ttop = maxY\n\t\t\t}\n\t\t}\n\n\t\tlet overdragX = 0\n\t\tlet overdragY = 0\n\n\t\tif (left <= minX) {\n\t\t\tleft = 0\n\t\t\toverdragX = rect.x - minX\n\t\t} else if (left >= maxX) {\n\t\t\toverdragX = rect.x - maxX\n\t\t}\n\n\t\tif (top < minY) {\n\t\t\ttop = minY\n\t\t\toverdragY = rect.y - minY\n\t\t} else if (top >= maxY) {\n\t\t\toverdragY = rect.y - maxY\n\t\t}\n\n\t\tlet x = 0\n\t\tlet y = 0\n\n\t\tif (rubberBandingEnabled) {\n\t\t\tx = overdragX * overdragFactor\n\t\t\ty = overdragY * overdragFactor\n\t\t}\n\n\t\tconst flex = getFlexGrow({ ...rect, x: left, y: top }, constraintsRect)\n\n\t\tthis.setFloatingWindowProperties({\n\t\t\ttop: fixedTop ? 1 : flex.top,\n\t\t\tbottom: fixedTop ? 0 : flex.bottom,\n\t\t\tfixedTop: fixedTop ? flex.top : undefined,\n\t\t\tright: flex.right,\n\t\t\tleft: flex.left,\n\t\t\tx,\n\t\t\ty,\n\t\t\ttransition: \"\",\n\t\t})\n\t}\n\n\tsetResizeRect({ top, right, bottom, left }: { top: number; right: number; bottom: number; left: number }) {\n\t\tthis.setFloatingWindowProperties({\n\t\t\ttop,\n\t\t\tright,\n\t\t\tbottom,\n\t\t\tleft,\n\t\t\tfixedTop: undefined,\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t\ttransition: \"\",\n\t\t})\n\t}\n\n\tpersistCurrentTopOffset = () => {\n\t\tconst windowRect = this.getWindowRect()\n\t\tif (!windowRect) return\n\t\tthis.setFloatingWindowProperties({ fixedTop: windowRect.y, top: 1, bottom: 0 })\n\t}\n\n\thasPersistedTopOffset = () => {\n\t\tconst topValue = this.containerRef.current?.style.getPropertyValue(PropertyKey.fixedTop)\n\t\tconst top = parseInt(topValue || \"\")\n\t\treturn isNumber(top) && top !== megaMaxHeight\n\t}\n\n\tprivate setFloatingWindowProperties(props: Partial<FloatingWindowProperties>) {\n\t\tconst container = this.containerRef.current\n\t\tif (!container) return\n\n\t\tconst properties: { [key: string]: string } = {}\n\n\t\tif (isNumber(props.top)) {\n\t\t\tproperties[PropertyKey.top] = props.top.toString()\n\t\t}\n\n\t\tif (isNumber(props.right)) {\n\t\t\tproperties[PropertyKey.right] = props.right.toString()\n\t\t}\n\n\t\tif (isNumber(props.bottom)) {\n\t\t\tproperties[PropertyKey.bottom] = props.bottom.toString()\n\t\t}\n\n\t\tif (isNumber(props.left)) {\n\t\t\tproperties[PropertyKey.left] = props.left.toString()\n\t\t}\n\n\t\tif (isNumber(props.fixedTop)) {\n\t\t\tproperties[PropertyKey.fixedTop] = `${props.fixedTop}px`\n\t\t} else {\n\t\t\tproperties[PropertyKey.fixedTop] = `${megaMaxHeight}px`\n\t\t}\n\n\t\tif (isNumber(props.x)) {\n\t\t\tproperties[PropertyKey.x] = `${props.x}px`\n\t\t}\n\n\t\tif (isNumber(props.y)) {\n\t\t\tproperties[PropertyKey.y] = `${props.y}px`\n\t\t}\n\n\t\tif (isString(props.transition)) {\n\t\t\tproperties[PropertyKey.transition] = props.transition\n\t\t}\n\n\t\tconst keys = Object.keys(properties)\n\t\tfor (const key of keys) {\n\t\t\t// biome-ignore lint/style/noNonNullAssertion: loop\n\t\t\tconst value = properties[key]!\n\t\t\tcontainer.style.setProperty(key, value)\n\t\t}\n\n\t\tconst { restorationKey } = this.props\n\t\tif (restorationKey && isRestoredWindowProperties(props, { strict: false })) {\n\t\t\tconst restorationData: RestoredWindowProperties = {\n\t\t\t\ttop: props.top,\n\t\t\t\tbottom: props.bottom,\n\t\t\t\tleft: props.left,\n\t\t\t\tright: props.right,\n\t\t\t\tfixedTop: props.fixedTop,\n\t\t\t}\n\t\t\tconst stringified = JSON.stringify(restorationData)\n\t\t\tlocalStorage.setItem(restorationKey, stringified)\n\t\t}\n\t}\n}\n\ninterface RestoredWindowProperties {\n\ttop: number\n\tbottom: number\n\tleft: number\n\tright: number\n\tfixedTop: number | undefined\n}\n\ninterface NonRestoredWindowProperties {\n\tx: number\n\ty: number\n\ttransition: string\n}\n\ntype FloatingWindowProperties = RestoredWindowProperties & NonRestoredWindowProperties\n\nconst topKey: keyof RestoredWindowProperties = \"top\"\nconst rightKey: keyof RestoredWindowProperties = \"right\"\nconst bottomKey: keyof RestoredWindowProperties = \"bottom\"\nconst leftKey: keyof RestoredWindowProperties = \"left\"\nconst fixedTopKey: keyof RestoredWindowProperties = \"fixedTop\"\n\nconst xKey: keyof NonRestoredWindowProperties = \"x\"\nconst yKey: keyof NonRestoredWindowProperties = \"y\"\nconst transitionKey: keyof NonRestoredWindowProperties = \"transition\"\n\nfunction isRestoredWindowProperties(\n\tvalue: unknown,\n\t{ strict }: { strict: boolean } = { strict: true },\n): value is RestoredWindowProperties {\n\tif (!isObject(value)) return false\n\n\t// These values should never be stored\n\tif (strict) {\n\t\tif (xKey in value) return false\n\t\tif (yKey in value) return false\n\t\tif (transitionKey in value) return false\n\t}\n\n\tif (!isNumber(value[topKey])) return false\n\tif (!isNumber(value[rightKey])) return false\n\tif (!isNumber(value[bottomKey])) return false\n\tif (!isNumber(value[leftKey])) return false\n\tconst fixedTop = value[fixedTopKey]\n\treturn isNumber(fixedTop) || isUndefined(fixedTop)\n}\n\nenum PropertyKey {\n\ttop = \"--floating-window-top\",\n\tright = \"--floating-window-right\",\n\tbottom = \"--floating-window-bottom\",\n\tleft = \"--floating-window-left\",\n\tfixedTop = \"--floating-window-fixed-top\",\n\t// For overdrag\n\tx = \"--floating-window-x\",\n\ty = \"--floating-window-y\",\n\ttransition = \"--floating-window-transform\",\n}\n\ninterface FloatingWindowContextProps {\n\tonDragStart: (event: MouseTrackerEvent) => void\n\tonDrag: (event: MouseTrackerEvent) => void\n\tonDragEnd: (event: MouseTrackerEvent) => void\n}\n\nconst ConstraintWindowContext = React.createContext<FloatingWindowContextProps | null>(null)\nConstraintWindowContext.displayName = \"ConstraintWindowContext\"\n\ntype FloatingWindowDraggableAreaProps = Omit<MouseTrackerProps, \"onDrag\" | \"onDragEnd\" | \"onDragStart\">\n\nexport const FloatingWindowDraggableArea = React.forwardRef<HTMLDivElement, FloatingWindowDraggableAreaProps>(\n\tfunction ConstraintWindowBar(props, forwardedRef) {\n\t\tconst windowContext = React.useContext(ConstraintWindowContext)\n\t\treturn (\n\t\t\t<MouseTracker\n\t\t\t\tref={forwardedRef}\n\t\t\t\t{...props}\n\t\t\t\tclassName={cx(props.className, styles.windowBarCursor, appPointerEvents)}\n\t\t\t\tonDragStart={windowContext?.onDragStart}\n\t\t\t\tonDrag={windowContext?.onDrag || noop}\n\t\t\t\tonDragEnd={windowContext?.onDragEnd}\n\t\t\t\tcursor=\"-webkit-grabbing\"\n\t\t\t/>\n\t\t)\n\t},\n)\n\nfunction getFlexGrow(rect: Rect, constraints: Rect): { top: number; bottom: number; left: number; right: number } {\n\tconst minY = rect.y\n\tconst maxY = minY + rect.height\n\n\tconst minX = rect.x\n\tconst maxX = minX + rect.width\n\n\tconst top = minY\n\tconst left = minX\n\tconst bottom = constraints.height - maxY\n\tconst right = constraints.width - maxX\n\n\treturn { top, bottom, left, right }\n}\n", "import \"FloatingWindow.styles_12w5r5x.wyw.css\"; export const windowBarCursor = \"windowBarCursor_wuk326o\";\nexport const noPointerEvents = \"noPointerEvents_n283lgw\";\nexport const pointerEvents = \"pointerEvents_pue1ity\";", "import type { ButtonProps } from \"@framerjs/fresco\"\nimport {\n\tButton,\n\tInputHashContext,\n\tNavigationStackItemContext,\n\tReadOnlyContext,\n\tWithinPopoverContext,\n\tuseInputHash,\n\tuseIsWithinPopover,\n\tuseReadOnly,\n} from \"@framerjs/fresco\"\nimport type { AttachmentEdge, AttachmentEdgePreferences } from \"@framerjs/fresco/src/components/Popover\"\nimport { cx } from \"@linaria/core\"\nimport { environment } from \"environment/index.ts\"\nimport type { Point } from \"library/render/types/Point.ts\"\nimport { isEqual } from \"library/render/utils/isEqual.ts\"\nimport { useStableCallback } from \"library/utils/useStableCallback.ts\"\nimport React from \"react\"\nimport { v4 as uuid } from \"uuid\"\nimport { VariantOverrideContextProvider, useVariantOverrideInfo } from \"../properties/utils/VariantOverrideContext.tsx\"\nimport * as styles from \"./PopoutButton.styles.ts\"\nimport { PopoutContext } from \"./PopoutContext.ts\"\nimport type { PopoutId } from \"./PopoutNavigation.tsx\"\nimport type { NavigationRef } from \"./PopoutPopover.tsx\"\nimport { PopoutPopover } from \"./PopoutPopover.tsx\"\n\ntype OverrideType<T, O extends object> = Omit<T, keyof O> & O\ntype ExtendButtonAttributes<T extends object> = OverrideType<React.HTMLAttributes<HTMLElement>, T>\n\nexport const popoutButtonDataAttribute = \"data-is-popout-button\"\n/**\n * Marks a popout button that opens field-level settings (e.g. renaming a field, toggling\n * whether it is required) rather than editing the field's value. Consumers that want to\n * programmatically open a value-editing popout should skip these buttons.\n */\nexport const fieldSettingsPopoutDataAttribute = \"data-is-field-settings-popout\"\nconst popoutButtonSelector = `[${popoutButtonDataAttribute}]`\nconst valuePopoutButtonSelector = `${popoutButtonSelector}:not([${fieldSettingsPopoutDataAttribute}])`\n\ninterface PopoutOptions {\n\tpopout: React.ReactNode\n\tnavigationTitle: React.ReactNode\n\tnavigationClassName?: string\n\t/** Replaces the close button in the navigation bar header. */\n\ttoolbarAction?: React.ReactNode\n\n\tid?: PopoutId\n\tenabled?: boolean\n\tdisplayDivider?: boolean\n\tdisplayInPopover?: boolean\n\tpopoverAttachmentEdge?: AttachmentEdge | AttachmentEdgePreferences\n\tfallbackToModalAppearance?: boolean\n\tautoFocusInside?: boolean\n\tshowArrow?: boolean\n\n\t// Can be used to prevent the popout from being presented.\n\tonBeforePresent?: () => boolean\n\tonPresent?: VoidFunction\n\tonDismiss?: VoidFunction\n\n\teducationTooltipId?: string\n\teducationText?: string\n\tonClickEducation?: VoidFunction\n\n\tenterAnimationDisabled?: boolean\n\ttogglePopoutEnabled?: boolean\n}\n\nexport interface UsePopoutOptions extends PopoutOptions {\n\tref?: React.RefObject<HTMLElement>\n}\n\ninterface PopoutResult {\n\tref: React.RefObject<any>\n\tpresent: VoidFunction\n\tdismiss: VoidFunction\n\tisPresenting: boolean\n}\n\nexport function usePopoutContent({\n\tpopout,\n\tnavigationTitle,\n\tnavigationClassName,\n\ttoolbarAction,\n\tid: externalId,\n\tenabled = true,\n\tdisplayDivider,\n\tonBeforePresent = () => true,\n\tonPresent = () => undefined,\n\tonDismiss = () => undefined,\n\tref: externalRef,\n\teducationTooltipId,\n\teducationText,\n\tonClickEducation,\n\tenterAnimationDisabled = false,\n\tautoFocusInside,\n\tdisplayInPopover,\n}: UsePopoutOptions): PopoutResult {\n\tconst id = useId(externalId)\n\tconst fallbackRef = React.useRef<any>(null)\n\tconst ref = externalRef ?? fallbackRef\n\tconst parent = React.useContext(NavigationStackItemContext)\n\tconst popoutNavigation = React.useContext(PopoutContext)\n\tconst [isPresenting, setIsPresenting] = React.useState(false)\n\tconst isReadOnly = useReadOnly()\n\tconst inputHash = useInputHash()\n\tconst overrideInfo = useVariantOverrideInfo()\n\tconst withinPopover = useIsWithinPopover(displayInPopover)\n\n\tconst memoizedPopout = useMemoReactNode(\n\t\t<WithinPopoverContext.Provider value={withinPopover}>\n\t\t\t<InputHashContext.Provider value={inputHash}>\n\t\t\t\t<ReadOnlyContext.Provider value={isReadOnly}>\n\t\t\t\t\t<VariantOverrideContextProvider\n\t\t\t\t\t\tvariantOverrideKeys={overrideInfo.variantOverrideKeys}\n\t\t\t\t\t\tvariantOverrideTraitTypes={overrideInfo.variantOverrideTraitTypes}\n\t\t\t\t\t>\n\t\t\t\t\t\t{popout}\n\t\t\t\t\t</VariantOverrideContextProvider>\n\t\t\t\t</ReadOnlyContext.Provider>\n\t\t\t</InputHashContext.Provider>\n\t\t</WithinPopoverContext.Provider>,\n\t)\n\tconst memoizedTitle = useMemoReactNode(navigationTitle)\n\tpopoutNavigation?.updatePopout(id, memoizedPopout, memoizedTitle, autoFocusInside)\n\n\tconst stableOnDismiss = useStableCallback(onDismiss)\n\tconst stableOnPresent = useStableCallback(onPresent)\n\n\tconst present = useStableCallback(() => {\n\t\tif (!popoutNavigation) return\n\n\t\tif (!enabled || !onBeforePresent()) {\n\t\t\tpopoutNavigation.close()\n\t\t\treturn\n\t\t}\n\n\t\tpopoutNavigation.present(id, memoizedPopout, {\n\t\t\tparent,\n\t\t\ttriggerRef: ref,\n\t\t\tdisplayDivider,\n\t\t\ttitle: memoizedTitle,\n\t\t\ttoolbarAction,\n\t\t\tclassName: navigationClassName,\n\t\t\tonDismiss: stableOnDismiss,\n\t\t\tonPresent: stableOnPresent,\n\t\t\teducationTooltipId,\n\t\t\teducationText,\n\t\t\tonClickEducation,\n\t\t\tenterAnimationDisabled,\n\t\t\tautoFocusInside,\n\t\t})\n\t})\n\n\tconst dismiss = useStableCallback(() => {\n\t\tpopoutNavigation?.dismiss(id)\n\t})\n\n\t// Mount and unmount registration\n\tReact.useEffect(() => {\n\t\tif (!enabled || !popoutNavigation) return\n\n\t\tconst handlePopoutChange = () => {\n\t\t\t// Not updating React state while tests are running because that results in a warning\n\t\t\tif (environment.isTest) return\n\t\t\tsetIsPresenting(popoutNavigation.isPresenting(id))\n\t\t}\n\n\t\tpopoutNavigation.addListener(handlePopoutChange)\n\t\tpopoutNavigation.registerPopout(id, present)\n\t\treturn () => {\n\t\t\tpopoutNavigation.removeListener(handlePopoutChange)\n\t\t\tpopoutNavigation.deregisterPopout(id)\n\t\t}\n\t}, [id, enabled, popoutNavigation])\n\n\treturn {\n\t\tpresent,\n\t\tdismiss,\n\t\tisPresenting,\n\t\tref,\n\t}\n}\n\nfunction useMemoReactNode(element: React.ReactNode) {\n\tconst latest = React.useRef(element)\n\n\tif (!isEqual(element, latest.current)) {\n\t\tlatest.current = element\n\t}\n\n\treturn latest.current\n}\n\nexport type PopoutButtonProps = ExtendButtonAttributes<PopoutOptions> & {\n\tlarge?: boolean\n\t/*  If set to true, we will render the popout button with the Fresco Button component,\n        otherwise we use a div. Set to false by default */\n\tuseFrescoButton?: boolean\n\tfrescoButtonProps?: ButtonProps\n\twithoutStyles?: boolean\n\tpopoverNavigationRef?: NavigationRef\n\tpopoverOffset?: Point\n\tnavigationClassName?: string\n\tonPopoverKeydown?: React.KeyboardEventHandler\n\tonPopoverCopy?: (event: ClipboardEvent) => void\n}\n\nexport function PopoutButton({\n\tpopoverNavigationRef,\n\tdisplayInPopover,\n\tpopoverAttachmentEdge,\n\tfallbackToModalAppearance,\n\tpopoverOffset,\n\tshowArrow,\n\tonPopoverKeydown,\n\tonPopoverCopy,\n\t...rest\n}: PopoutButtonProps) {\n\tconst ref = React.useRef<HTMLElement>(null)\n\tconst button = <PopoutButtonInner displayInPopover={displayInPopover} {...rest} ref={ref} />\n\n\tif (displayInPopover) {\n\t\treturn (\n\t\t\t<PopoutPopover\n\t\t\t\tnavigationRef={popoverNavigationRef}\n\t\t\t\tanchorRef={ref}\n\t\t\t\tattachTo={popoverAttachmentEdge}\n\t\t\t\tonKeydown={onPopoverKeydown}\n\t\t\t\tonCopy={onPopoverCopy}\n\t\t\t\toffset={popoverOffset}\n\t\t\t\tfallbackToModalAppearance={fallbackToModalAppearance}\n\t\t\t\tshowArrow={showArrow}\n\t\t\t>\n\t\t\t\t{button}\n\t\t\t</PopoutPopover>\n\t\t)\n\t} else {\n\t\treturn button\n\t}\n}\n\nconst PopoutButtonInner = React.forwardRef(function PopoutButtonInner(\n\t{\n\t\tid,\n\t\tlarge,\n\t\tpopout,\n\t\tdisplayDivider,\n\t\tnavigationTitle,\n\t\tnavigationClassName,\n\t\ttoolbarAction,\n\t\tclassName,\n\t\tonKeyDown,\n\t\tonClick,\n\t\ttabIndex = 0,\n\t\tenabled = true,\n\t\tuseFrescoButton = false,\n\t\twithoutStyles = false,\n\t\tfrescoButtonProps = {},\n\t\tonBeforePresent,\n\t\tonPresent,\n\t\tonDismiss,\n\t\teducationTooltipId,\n\t\teducationText,\n\t\tonClickEducation,\n\t\tautoFocusInside,\n\t\ttogglePopoutEnabled = false,\n\t\tdisplayInPopover,\n\t\t...rest\n\t}: PopoutButtonProps,\n\tforwardedRef: React.RefObject<HTMLElement>,\n) {\n\tconst { present, dismiss, isPresenting } = usePopoutContent({\n\t\tpopout,\n\t\tid,\n\t\tdisplayDivider,\n\t\tnavigationTitle,\n\t\tnavigationClassName,\n\t\ttoolbarAction,\n\t\tenabled,\n\t\tonBeforePresent,\n\t\tonPresent,\n\t\tonDismiss,\n\t\tref: forwardedRef,\n\t\teducationTooltipId,\n\t\teducationText,\n\t\tonClickEducation,\n\t\tautoFocusInside,\n\t\tdisplayInPopover,\n\t})\n\n\tconst keyDownHandler = (event: React.KeyboardEvent<HTMLElement>) => {\n\t\tswitch (event.key) {\n\t\t\tcase \"Enter\":\n\t\t\tcase \" \":\n\t\t\t\tpresent()\n\t\t\t\tevent.preventDefault()\n\t\t\t\tbreak\n\t\t\tcase \"Escape\":\n\t\t\t\tevent.currentTarget.blur()\n\t\t\t\tdismiss()\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\tconst isDisabled = enabled === false\n\tconst buttonProps: React.HTMLAttributes<HTMLElement> & {\n\t\t// We can be render either a (fresco) button or a div, so the ref can be either a HTMLButtonElement or HTMLDivElement\n\t\t// Typescript doesn't understand that HTMLElement is the super class of both\n\t\tref: React.RefObject<any>\n\t\t[popoutButtonDataAttribute]: boolean\n\t} = {\n\t\trole: \"button\",\n\t\tref: forwardedRef,\n\t\ttabIndex: isDisabled ? undefined : tabIndex,\n\t\t[\"aria-selected\"]: isPresenting ? \"true\" : \"false\",\n\t\tclassName: cx(\n\t\t\tclassName,\n\t\t\t!useFrescoButton &&\n\t\t\t\t!withoutStyles &&\n\t\t\t\tcx(styles.popoutButton, isDisabled && styles.popoutButtonDisabled, large && styles.popoutButtonLarge),\n\t\t),\n\t\tonKeyDown: wrapEventHandlers(keyDownHandler, onKeyDown),\n\t\t[popoutButtonDataAttribute]: true,\n\t\t...rest,\n\t}\n\n\tconst clickHandler = togglePopoutEnabled && isPresenting ? onClick : wrapEventHandlers(present, onClick)\n\n\treturn useFrescoButton ? (\n\t\t<Button enabled={enabled} {...frescoButtonProps} {...buttonProps} onClick={clickHandler} />\n\t) : (\n\t\t// Not using `useClickHandlers` for the popout button because opening the popout on mouse\n\t\t// down prevents the popout content from being focussed.\n\t\t<div id={id} {...buttonProps} onClick={clickHandler} />\n\t)\n})\n\nexport function isPopoutButtonElement(element: unknown): boolean {\n\tif (!(element instanceof HTMLElement)) return false\n\treturn !!element.closest(popoutButtonSelector)\n}\n\n/**\n * Returns the first popout button inside `element` that opens a value-editing popout.\n * Popout buttons marked with {@link fieldSettingsPopoutDataAttribute} are skipped, since\n * those open field-level settings rather than letting the user edit the value.\n */\nexport function getValuePopoutButtonElementWithin(element: HTMLElement): HTMLElement | null {\n\treturn element.querySelector(valuePopoutButtonSelector)\n}\n\nexport function getPopoutElementById(id: string): HTMLElement | null {\n\treturn document.getElementById(id)\n}\n\nfunction useId(id: PopoutId | undefined): PopoutId {\n\tconst idRef = React.useRef(id)\n\tif (id && idRef.current !== id) {\n\t\tidRef.current = id\n\t} else if (!idRef.current) {\n\t\tidRef.current = uuid()\n\t}\n\treturn idRef.current\n}\n\ntype EventHandler<T> = (event: T) => void\n\nfunction wrapEventHandlers<T>(handler: EventHandler<T>, optionalHandler: EventHandler<T> | undefined): EventHandler<T> {\n\tif (!optionalHandler) return handler\n\treturn (event: T) => {\n\t\thandler(event)\n\t\toptionalHandler(event)\n\t}\n}\n", "import type { TraitType } from \"document/models/CanvasTree/traits/TraitType.ts\"\nimport type { VariantOverrideInfo } from \"document/models/CanvasTree/traits/utils/VariantOverrides.ts\"\nimport type { PropsWithChildren } from \"react\"\nimport { createContext, useContext, useLayoutEffect, useMemo, useRef, useState } from \"react\"\n\ntype RemoveListener = () => void\ntype Listener = (info: VariantOverrideInfo) => void\ntype AddListener = (listener: Listener) => RemoveListener\n\nconst VariantOverrideContext = createContext<AddListener>(() => () => {})\n\n/**\n * The useIsOverridden hook can be used to determine if a set of trait types or trait type keys\n * are overridden for the current selection.\n */\nexport function useIsOverridden(\n\ttraitTypeKeys: readonly string[] | undefined,\n\ttraitTypes: readonly TraitType[] | undefined,\n): boolean {\n\tconst addListener = useContext(VariantOverrideContext)\n\n\tconst [isOverridden, setIsOverridden] = useState(false)\n\n\tuseLayoutEffect(() => {\n\t\treturn addListener((info: VariantOverrideInfo) => {\n\t\t\tsetIsOverridden(() => {\n\t\t\t\tif (traitTypeKeys) {\n\t\t\t\t\treturn traitTypeKeys.some(key => info.variantOverrideKeys.has(key))\n\t\t\t\t}\n\t\t\t\tif (traitTypes) {\n\t\t\t\t\treturn traitTypes.some(type => info.variantOverrideTraitTypes.has(type))\n\t\t\t\t}\n\t\t\t\treturn false\n\t\t\t})\n\t\t})\n\t}, [traitTypeKeys, traitTypes, addListener])\n\n\treturn isOverridden\n}\n\nexport function useVariantOverrideInfo(): VariantOverrideInfo {\n\tconst addListener = useContext(VariantOverrideContext)\n\n\tconst [info, setInfo] = useState<VariantOverrideInfo>({\n\t\tvariantOverrideKeys: new Set(),\n\t\tvariantOverrideTraitTypes: new Set(),\n\t})\n\n\tuseLayoutEffect(() => {\n\t\treturn addListener((newInfo: VariantOverrideInfo) => {\n\t\t\tsetInfo(newInfo)\n\t\t})\n\t}, [addListener, setInfo])\n\n\treturn info\n}\n\nexport function VariantOverrideContextProvider({\n\tchildren,\n\tvariantOverrideTraitTypes,\n\tvariantOverrideKeys,\n}: PropsWithChildren<VariantOverrideInfo>) {\n\tconst latestInfo = useRef<VariantOverrideInfo | null>()\n\n\tconst api = useMemo(() => {\n\t\tconst listeners = new Set<Listener>()\n\n\t\treturn {\n\t\t\tlisteners,\n\t\t\taddListener: (listener: Listener) => {\n\t\t\t\tlisteners.add(listener)\n\n\t\t\t\tconst info = latestInfo.current\n\t\t\t\tif (info) listener(info)\n\n\t\t\t\treturn () => {\n\t\t\t\t\tlisteners.delete(listener)\n\t\t\t\t}\n\t\t\t},\n\t\t}\n\t}, [])\n\n\tuseLayoutEffect(() => {\n\t\tconst info: VariantOverrideInfo = { variantOverrideTraitTypes, variantOverrideKeys }\n\t\tlatestInfo.current = info\n\t\tapi.listeners.forEach(listener => listener(info))\n\t}, [api, variantOverrideKeys, variantOverrideTraitTypes])\n\n\treturn <VariantOverrideContext.Provider value={api.addListener}>{children}</VariantOverrideContext.Provider>\n}\n", "import \"PopoutButton.styles_r2st5t.wyw.css\"; export const popoutButtonBorderWidth = 1;\nexport const popoutButton = \"popoutButton_pvjhuxd\";\nexport const popoutButtonDisabled = \"popoutButtonDisabled_pcpv5lz\";\nexport const popoutButtonLarge = \"popoutButtonLarge_p1awmd8\";", "import { createContext } from \"react\"\nimport type { PopoutNavigation } from \"./PopoutNavigation.tsx\"\n\nexport const PopoutContext = createContext<PopoutNavigation | null>(null)\n", "import { NavigationStack, Popover } from \"@framerjs/fresco\"\nimport type { AttachmentEdge, AttachmentEdgePreferences } from \"@framerjs/fresco/src/components/Popover\"\nimport { cx } from \"@linaria/core\"\nimport { useBaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport { isVekterEngine } from \"document/useVekterEngine.ts\"\nimport React, { useImperativeHandle } from \"react\"\nimport { useHasModalInFrontOfPopover } from \"../useHasModalInFrontOfPopover.ts\"\nimport { DarkOnDarkThemeOverride } from \"./DarkOnDarkThemeOverride.tsx\"\nimport { PopoutContext } from \"./PopoutContext.ts\"\nimport { PopoutNavigation } from \"./PopoutNavigation.tsx\"\nimport * as styles from \"./PopoutPopover.styles.ts\"\n\nexport type NavigationRef = React.MutableRefObject<PopoutNavigation | null> | React.RefCallback<PopoutNavigation | null>\n\ninterface Props {\n\tanchorRef: React.RefObject<HTMLElement>\n\tchildren: React.ReactNode\n\tattachTo?: AttachmentEdge | AttachmentEdgePreferences\n\tfallbackToModalAppearance?: boolean\n\tnavigationRef?: NavigationRef\n\t// overrides for default offset\n\toffset?: { x: number; y: number }\n\twithin?: React.ComponentProps<typeof Popover>[\"within\"]\n\tonKeydown?: React.KeyboardEventHandler\n\tonCopy?: (event: ClipboardEvent) => void\n\tautoFocusInside?: boolean\n\tshowArrow?: boolean\n\tthemeBehavior?: React.ComponentProps<typeof Popover>[\"themeBehavior\"]\n}\n\nconst defaultPopoutPopoverOffset = { x: 10, y: 0 }\n\nexport function PopoutPopover({\n\tnavigationRef,\n\tanchorRef,\n\tchildren,\n\tattachTo = \"right\",\n\toffset = defaultPopoutPopoverOffset,\n\twithin,\n\tonKeydown,\n\tonCopy,\n\tfallbackToModalAppearance,\n\tshowArrow = false,\n\tthemeBehavior,\n}: Props) {\n\tconst engine = useBaseEngine()\n\n\tconst onKeydownRef = React.useRef(onKeydown)\n\tonKeydownRef.current = onKeydown\n\n\tconst hasModalInFront = useHasModalInFrontOfPopover()\n\n\tconst [count, setCount] = React.useState(0)\n\tconst [navigation] = React.useState(() => new PopoutNavigation({ triggerRender: () => setCount(c => c + 1) }))\n\n\tconst isOpen = navigation.isOpen()\n\n\tconst handlePopoverKeyDown = React.useCallback(\n\t\t(event: React.KeyboardEvent) => {\n\t\t\tif (isVekterEngine(engine)) {\n\t\t\t\t// Forward modifier key state to engine store to ensure modifiers are updated in popouts\n\t\t\t\tengine.stores.mouseStore.setModifiers(event.nativeEvent)\n\t\t\t}\n\n\t\t\tif (event.key === \"Escape\") {\n\t\t\t\tnavigation.goBack(true)\n\t\t\t\tevent.stopPropagation()\n\t\t\t}\n\n\t\t\tonKeydownRef.current?.(event)\n\t\t},\n\t\t[navigation],\n\t)\n\n\tconst handlePopoverKeyUp = React.useCallback((event: React.KeyboardEvent) => {\n\t\tif (isVekterEngine(engine)) {\n\t\t\t// Forward modifier key state to engine store to ensure modifiers are updated in popouts\n\t\t\tengine.stores.mouseStore.setModifiers(event.nativeEvent)\n\t\t}\n\t}, [])\n\n\tuseImperativeHandle(navigationRef, () => navigation, [navigation])\n\n\tReact.useEffect(() => {\n\t\tif (!isOpen || !onCopy) return\n\n\t\tdocument.addEventListener(\"copy\", onCopy)\n\t\tdocument.addEventListener(\"cut\", onCopy)\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener(\"copy\", onCopy)\n\t\t\tdocument.removeEventListener(\"cut\", onCopy)\n\t\t}\n\t}, [isOpen, onCopy])\n\n\tconst computedOffset = React.useMemo(() => {\n\t\tvoid count // force re-render Popover when count changes (re-render was triggered by triggerRender())\n\t\treturn { ...offset }\n\t}, [count, offset])\n\n\treturn (\n\t\t<PopoutContext.Provider value={navigation}>\n\t\t\t{children}\n\t\t\t{isOpen && (\n\t\t\t\t<DarkOnDarkThemeOverride>\n\t\t\t\t\t<Popover\n\t\t\t\t\t\tanchor={anchorRef.current}\n\t\t\t\t\t\talignSelf=\"center\"\n\t\t\t\t\t\tattachTo={attachTo}\n\t\t\t\t\t\toffset={computedOffset}\n\t\t\t\t\t\twithin={within}\n\t\t\t\t\t\tonClose={navigation.close}\n\t\t\t\t\t\tclassName={styles.popover}\n\t\t\t\t\t\tonKeyDown={handlePopoverKeyDown}\n\t\t\t\t\t\tonKeyUp={handlePopoverKeyUp}\n\t\t\t\t\t\tfocusTrapEnabled={!hasModalInFront}\n\t\t\t\t\t\tshowArrow={showArrow}\n\t\t\t\t\t\tarrow={showArrow ? { anchor: anchorRef.current } : undefined}\n\t\t\t\t\t\tfallbackToModalAppearance={fallbackToModalAppearance}\n\t\t\t\t\t\tthemeBehavior={themeBehavior}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className={cx(styles.contentClip)}>\n\t\t\t\t\t\t\t<NavigationStack\n\t\t\t\t\t\t\t\tstack={navigation.stack}\n\t\t\t\t\t\t\t\tcurrentIndex={navigation.currentStackIndex}\n\t\t\t\t\t\t\t\tonBack={navigation.goBack}\n\t\t\t\t\t\t\t\tonClose={navigation.close}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Popover>\n\t\t\t\t</DarkOnDarkThemeOverride>\n\t\t\t)}\n\t\t</PopoutContext.Provider>\n\t)\n}\n", "import { ZIndex } from \"@framerjs/fresco/tokens\"\nimport { ModalType } from \"document/utils/ModalType.ts\"\n\nexport function isModalInFrontOfPopover(modalType: ModalType): boolean {\n\tswitch (modalType) {\n\t\tcase ModalType.Confirmation:\n\t\tcase ModalType.DeprecatedDrafts:\n\t\tcase ModalType.ImageCrop:\n\t\tcase ModalType.ImageFocalPoint:\n\t\tcase ModalType.QuickActions:\n\t\tcase ModalType.UpsellEnterprise:\n\t\tcase ModalType.UpsellFeature:\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nexport function getZIndexForModal(modalType: ModalType): number {\n\tif (modalType === ModalType.ConfirmationPlugin) return ZIndex.pluginModal\n\treturn isModalInFrontOfPopover(modalType) ? ZIndex.modalWithoutPopovers : ZIndex.modal\n}\n", "import { isEditorBar } from \"@framerjs/shared\"\nimport { useAndAssertVekterEngine } from \"document/useVekterEngine.ts\"\nimport { isModalInFrontOfPopover } from \"./isModalInFrontOfPopover.ts\"\n\nfunction useVekterModalInFrontOfPopover(): boolean {\n\tconst engine = useAndAssertVekterEngine()\n\n\tconst hasPluginModalInFront = engine.stores.pluginStore.useState(state => {\n\t\tif (!state.activePlugin) return false\n\t\treturn state.activePlugin.modeHandlers.mode !== \"canvas\"\n\t})\n\n\tconst hasRegularModalInFront = engine.stores.modalStore.useState(state => isModalInFrontOfPopover(state.active.type))\n\n\treturn hasPluginModalInFront || hasRegularModalInFront\n}\n\nfunction hasOnPageModalInFrontOfPopover(): boolean {\n\treturn false\n}\n\nexport const useHasModalInFrontOfPopover = isEditorBar()\n\t? hasOnPageModalInFrontOfPopover\n\t: useVekterModalInFrontOfPopover\n", "import type { NavigationStackItem } from \"@framerjs/fresco\"\nimport type React from \"react\"\nimport { isFunction } from \"utils/typeChecks.ts\"\n\nexport type PopoutId = string\n\ninterface PopoutMetadata extends Omit<NavigationStackItem, \"id\" | \"timestamp\" | \"centerTitle\" | \"element\"> {\n\tonDismiss?: () => void\n\tonPresent?: () => void\n\tclassName?: string\n}\n\ninterface PopoutNavigationItem extends PopoutMetadata, Pick<NavigationStackItem, \"timestamp\" | \"element\"> {\n\tid: PopoutId\n\t/** Whether this item has already been dismissed. */\n\tdismissed: boolean\n}\n\ninterface PopoutContentInfo extends PopoutMetadata {\n\tparent: PopoutId | null\n}\n\ninterface PopoutNavigationOptions {\n\ttriggerRender: () => void\n\twillOpen?: (element: unknown) => void\n\twillPush?: () => void\n\twillPop?: () => void\n}\n\nexport class PopoutNavigation {\n\t#stack: PopoutNavigationItem[] = []\n\t#currentStackIndex = -1\n\n\tget stack(): PopoutNavigationItem[] {\n\t\treturn this.#stack\n\t}\n\n\tget currentStackIndex(): number {\n\t\treturn this.#currentStackIndex\n\t}\n\n\treadonly triggerRender: () => void\n\tprivate willOpen?: (element?: unknown) => void\n\tprivate willPush?: () => void\n\tprivate willPop?: () => void\n\n\tconstructor({ triggerRender, willOpen, willPush, willPop }: PopoutNavigationOptions) {\n\t\tthis.triggerRender = triggerRender\n\t\tthis.willOpen = willOpen\n\t\tthis.willPush = willPush\n\t\tthis.willPop = willPop\n\t}\n\n\tpresent = (\n\t\tid: PopoutId,\n\t\telement: React.ReactNode,\n\t\t{\n\t\t\tparent,\n\t\t\ttriggerRef,\n\t\t\tdisplayDivider,\n\t\t\ttitle,\n\t\t\tclassName,\n\t\t\tonDismiss,\n\t\t\tonPresent,\n\t\t\teducationTooltipId,\n\t\t\teducationText,\n\t\t\tonClickEducation,\n\t\t\tenterAnimationDisabled,\n\t\t\ttoolbarAction,\n\t\t\tautoFocusInside,\n\t\t}: PopoutContentInfo,\n\t) => {\n\t\t// If the content is already presented, we toggle the presentation\n\t\tif (id && this.isPresenting(id, { atIndex: 0 })) {\n\t\t\tif (this.#currentStackIndex === 0) {\n\t\t\t\tthis.close()\n\t\t\t} else {\n\t\t\t\tthis.setStackIndex(0)\n\t\t\t\tthis.willOpen?.(triggerRef?.current)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tif (parent) {\n\t\t\tconst parentIndex = this.indexForItem(parent)\n\t\t\tif (parentIndex === -1) {\n\t\t\t\treturn null // parent item not found\n\t\t\t}\n\n\t\t\tthis.#stack = this.#stack.slice(0, parentIndex + 1)\n\t\t\tonPresent?.()\n\t\t\tthis.willPush?.()\n\t\t} else {\n\t\t\t// Clear the current stack before we create a new stack.\n\t\t\tthis.setStackIndex(-1)\n\t\t\tonPresent?.()\n\t\t\tthis.willOpen?.(triggerRef?.current)\n\t\t}\n\n\t\tthis.#stack.push({\n\t\t\tid,\n\t\t\ttimestamp: Date.now(),\n\t\t\telement,\n\t\t\ttriggerRef,\n\t\t\tdisplayDivider,\n\t\t\ttitle,\n\t\t\tclassName,\n\t\t\tonDismiss,\n\t\t\tonPresent,\n\t\t\tdismissed: false,\n\t\t\teducationTooltipId,\n\t\t\teducationText,\n\t\t\tonClickEducation,\n\t\t\tenterAnimationDisabled,\n\t\t\ttoolbarAction,\n\t\t\tautoFocusInside,\n\t\t})\n\t\tthis.setStackIndex(this.#currentStackIndex + 1)\n\t}\n\n\tupdatePopout = (id: PopoutId, element: React.ReactNode, title: React.ReactNode, autoFocusInside?: boolean) => {\n\t\tif (this.isClosed()) return\n\n\t\tconst itemIndex = this.indexForItem(id)\n\t\tif (itemIndex === -1) {\n\t\t\t// item not on the stack\n\t\t\treturn\n\t\t}\n\n\t\tconst currentItem = this.#stack[itemIndex]\n\t\tif (!currentItem) {\n\t\t\treturn\n\t\t}\n\n\t\tconst oldElement = currentItem.element\n\t\tconst oldTitle = currentItem.title\n\t\tconst oldAutofocusInside = currentItem.autoFocusInside\n\n\t\tif (oldElement === element && oldTitle === title && oldAutofocusInside === autoFocusInside) {\n\t\t\treturn\n\t\t}\n\n\t\tcurrentItem.element = element\n\t\tcurrentItem.title = title\n\t\tcurrentItem.autoFocusInside = autoFocusInside\n\n\t\tif (itemIndex <= this.#currentStackIndex) {\n\t\t\t// We request an animation frame to silence the following React warning:\n\t\t\t// \"Cannot update a component while rendering a different component\"\n\t\t\trequestAnimationFrame(this.triggerRender)\n\t\t}\n\t}\n\n\tisPresenting = (id: PopoutId, options?: { atIndex: number }): boolean => {\n\t\tif (this.isClosed()) return false\n\t\tconst itemIndex = this.indexForItem(id)\n\t\tif (itemIndex < 0) return false\n\t\tif (itemIndex > this.#currentStackIndex) return false\n\t\tif (options && options.atIndex !== itemIndex) return false\n\t\treturn true\n\t}\n\n\tisOpen = () => {\n\t\treturn this.#currentStackIndex > -1\n\t}\n\n\tisClosed = () => {\n\t\treturn !this.isOpen()\n\t}\n\n\tclose = () => {\n\t\tthis.setStackIndex(-1)\n\t}\n\n\tdismiss = (id: PopoutId) => {\n\t\tconst index = this.indexForItem(id)\n\n\t\tif (index !== -1 && this.#currentStackIndex >= index) {\n\t\t\tthis.willPop?.()\n\t\t\tthis.setStackIndex(index - 1)\n\t\t}\n\t}\n\n\t/**\n\t * Navigate back to the previous item.\n\t * @param focusTrigger Focus the button that initially triggered the navigation.\n\t */\n\tgoBack = (focusTrigger: boolean = false) => {\n\t\tconst firstStackItem = this.stack[0]\n\n\t\tthis.willPop?.()\n\t\tthis.setStackIndex(this.#currentStackIndex - 1)\n\n\t\tif (focusTrigger && this.currentStackIndex === -1) {\n\t\t\tconst button = firstStackItem?.triggerRef?.current\n\t\t\tif (button instanceof HTMLElement) button.focus()\n\t\t}\n\t}\n\n\tprivate indexForItem = (id: PopoutId): number => {\n\t\treturn this.#stack.findIndex(item => item.id === id)\n\t}\n\n\tprivate setStackIndex = (index: number) => {\n\t\tconst newStackIndex = Math.max(-1, index)\n\t\tif (this.#currentStackIndex === newStackIndex) return\n\n\t\t// Dismiss all items that are going to be removed\n\t\t// from the stack when we set the new index.\n\t\tthis.#stack.forEach((item, itemIndex) => {\n\t\t\tif (itemIndex <= index) return\n\t\t\tif (item.dismissed) return\n\n\t\t\titem.dismissed = true\n\t\t\titem.onDismiss?.()\n\t\t})\n\n\t\tthis.#currentStackIndex = newStackIndex\n\t\tif (newStackIndex < 0) {\n\t\t\tthis.#stack = []\n\t\t}\n\t\tthis.triggerRender()\n\t\tthis.listeners.forEach(callback => callback())\n\t}\n\n\t// Listeners\n\n\tprivate listeners: Set<() => void> = new Set()\n\n\t/** Listen for navigation stack changes: open / close / push / pop. */\n\taddListener(callback: () => void) {\n\t\tthis.listeners.add(callback)\n\t}\n\n\tremoveListener(callback: () => void) {\n\t\tthis.listeners.delete(callback)\n\t}\n\n\t// Registration\n\n\tprivate registeredPopouts: Record<PopoutId, () => void> = {}\n\tprivate shouldPresentPopoutIds: Set<PopoutId> = new Set()\n\n\tregisterPopout = (id: PopoutId, open: () => void) => {\n\t\tthis.registeredPopouts[id] = open\n\t\tif (this.shouldPresentPopoutIds.has(id)) {\n\t\t\topen()\n\t\t\tthis.shouldPresentPopoutIds.delete(id)\n\t\t}\n\t}\n\n\tderegisterPopout = (id: PopoutId) => {\n\t\tdelete this.registeredPopouts[id]\n\n\t\t// Remove from presentation stack\n\t\tconst itemIndex = this.indexForItem(id)\n\t\t// Item not on the stack, or already dismissed\n\t\tif (itemIndex === -1 || this.#currentStackIndex < itemIndex) return\n\n\t\tthis.setStackIndex(itemIndex - 1)\n\t}\n\n\tpopoutIsRegistered = (id: PopoutId) => {\n\t\treturn id in this.registeredPopouts\n\t}\n\n\t/** Presents mounted popout or tries to open popout on registration */\n\tpresentPopout = (id: PopoutId) => {\n\t\t// Only present if not already presenting, otherwise we toggle the presentation and it\n\t\t// actually closes the popout.\n\t\tif (this.isPresenting(id, { atIndex: 0 })) {\n\t\t\treturn\n\t\t}\n\n\t\tconst open = this.registeredPopouts[id]\n\t\tif (isFunction(open)) {\n\t\t\topen()\n\t\t} else {\n\t\t\tthis.presentPopoutOnRegistration(id)\n\t\t}\n\t}\n\n\t/** Will try to open popout after 100 ms */\n\tpresentPopoutOnRegistration = (id: PopoutId) => {\n\t\tif (this.shouldPresentPopoutIds.has(id)) return\n\n\t\tthis.shouldPresentPopoutIds.add(id)\n\t\tsetTimeout(() => {\n\t\t\tthis.shouldPresentPopoutIds.delete(id)\n\t\t}, 100)\n\t}\n}\n", "import \"PopoutPopover.styles_18dlrei.wyw.css\"; export const popover = \"popover_pjkind9\";\nexport const contentClip = \"contentClip_c1l0qpj8\";", "import \"PopoutWindow.styles_no5ebt.wyw.css\"; import { popoverInset } from \"@framerjs/fresco\";\nimport { cx } from \"@linaria/core\";\nexport const window = cx(popoverInset, \"window_wrgelve\");", "import type { MouseTrackerEvent } from \"@framerjs/fresco\"\nimport { MouseTracker } from \"@framerjs/fresco\"\nimport { ZIndex } from \"@framerjs/fresco/tokens\"\nimport { useExperimentIsOn } from \"app/experiments.ts\"\nimport React from \"react\"\nimport { isFunction } from \"utils/typeChecks.ts\"\n\ntype Side = \"left\" | \"right\" | \"top\"\n\ninterface Props {\n\tside: Side\n\tminSize: number\n\tmaxSize: number | (() => number)\n\tdefaultSize: number\n\tgetSize: () => number\n\tsetSize: (value: number) => void\n\tonResizeStart?: () => void\n\tonResizeEnd?: () => void\n}\n\nconst className = \"resize-zone\"\n\nexport const ResizeZone = React.memo(\n\t({ side, minSize, defaultSize, maxSize, getSize, setSize, onResizeStart, onResizeEnd }: Props) => {\n\t\tconst isPaneEdgeDoubleClickResetEnabled = useExperimentIsOn(\"paneEdgeDoubleClickReset\")\n\t\tconst [resizeCursor, setResizeCursor] = React.useState(\"ew-resize\")\n\n\t\tconst updateResizeCursor = React.useCallback(\n\t\t\t(size: number) => {\n\t\t\t\tconst max = isFunction(maxSize) ? maxSize() : maxSize\n\t\t\t\tconst newResizeCursor = resizeCursorForSize(size, minSize, max, side)\n\t\t\t\tsetResizeCursor(currentResizeCursor =>\n\t\t\t\t\tcurrentResizeCursor === newResizeCursor ? currentResizeCursor : newResizeCursor,\n\t\t\t\t)\n\t\t\t},\n\t\t\t[minSize, maxSize, side],\n\t\t)\n\n\t\t// biome-ignore lint/correctness/useExhaustiveDependencies: @TODO: Does this really not need exhaustive deps?\n\t\tReact.useEffect(() => {\n\t\t\t// The maxSize() function typically causes a forced style recalculation, which is expensive\n\t\t\t// (eg, in case of SplitView, it calls getBoundingClientRect()).\n\t\t\t// Delaying the initial cursor calculation until the next frame solves this issue\n\t\t\trequestAnimationFrame(() => {\n\t\t\t\tupdateResizeCursor(getSize())\n\t\t\t})\n\t\t}, [])\n\n\t\tconst dragSizeStartRef = React.useRef<number | undefined>()\n\n\t\tconst onDragStart = React.useCallback(() => {\n\t\t\tdragSizeStartRef.current = getSize()\n\n\t\t\tif (onResizeStart) onResizeStart()\n\t\t}, [getSize, onResizeStart])\n\n\t\tconst onDrag = React.useCallback(\n\t\t\t(event: MouseTrackerEvent) => {\n\t\t\t\tif (dragSizeStartRef.current === undefined) return\n\n\t\t\t\tconst direction = side === \"left\" ? -1 : 1\n\n\t\t\t\tconst offset = side === \"top\" ? event.offset.y : event.offset.x\n\t\t\t\tlet newSize = dragSizeStartRef.current + offset * direction\n\n\t\t\t\tif (Math.abs(newSize - defaultSize) < 10) {\n\t\t\t\t\tnewSize = defaultSize\n\t\t\t\t}\n\n\t\t\t\tsetSize(newSize)\n\t\t\t\tupdateResizeCursor(getSize())\n\t\t\t},\n\t\t\t[side, defaultSize, setSize, updateResizeCursor, getSize],\n\t\t)\n\n\t\tconst onDragEnd = React.useCallback(() => {\n\t\t\tdragSizeStartRef.current = undefined\n\t\t\tif (onResizeEnd) onResizeEnd()\n\t\t}, [onResizeEnd])\n\n\t\tconst onDoubleClick = React.useCallback(() => {\n\t\t\tsetSize(defaultSize)\n\t\t\tupdateResizeCursor(getSize())\n\t\t\tonResizeEnd?.()\n\t\t}, [defaultSize, setSize, updateResizeCursor, getSize, onResizeEnd])\n\n\t\treturn (\n\t\t\t<MouseTracker\n\t\t\t\tonDragStart={onDragStart}\n\t\t\t\tonDrag={onDrag}\n\t\t\t\tonDragEnd={onDragEnd}\n\t\t\t\tonDoubleClick={isPaneEdgeDoubleClickResetEnabled ? onDoubleClick : undefined}\n\t\t\t\tcursor={resizeCursor}\n\t\t\t\tclassName={className}\n\t\t\t\tstyle={{\n\t\t\t\t\tcursor: resizeCursor,\n\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\ttop: positionTop(side),\n\t\t\t\t\tbottom: 0,\n\t\t\t\t\tright: positionRight(side),\n\t\t\t\t\tleft: positionLeft(side),\n\t\t\t\t\twidth: side === \"top\" ? undefined : 6,\n\t\t\t\t\theight: side === \"top\" ? 6 : undefined,\n\t\t\t\t\tzIndex: ZIndex.resizeZone,\n\t\t\t\t\ttransform: \"translate3d(0, 0, 0)\",\n\t\t\t\t\topacity: 0.5,\n\t\t\t\t}}\n\t\t\t/>\n\t\t)\n\t},\n)\n\nfunction positionTop(side: Side) {\n\tswitch (side) {\n\t\tcase \"top\":\n\t\t\treturn -3\n\t\tdefault:\n\t\t\treturn 0\n\t}\n}\n\nfunction positionLeft(side: Side): number | undefined {\n\tswitch (side) {\n\t\tcase \"left\":\n\t\t\treturn -3\n\t\tcase \"top\":\n\t\t\treturn 0\n\t}\n}\n\nfunction positionRight(side: Side): number | undefined {\n\tswitch (side) {\n\t\tcase \"right\":\n\t\t\treturn -3\n\t\tcase \"top\":\n\t\t\treturn 0\n\t}\n}\n\nexport function isResizeZone(element: any) {\n\treturn element instanceof HTMLDivElement && element.classList.contains(className)\n}\n\n// TODO: would be nice if these used the native split view cursors (CSS spec only has col-resize and no bounded variations)\nfunction resizeCursorForSize(size: number, minSize: number, maxSize: number, side: Side) {\n\tif (side === \"top\") {\n\t\tswitch (size) {\n\t\t\tcase minSize:\n\t\t\t\treturn \"s-resize\"\n\t\t\tcase maxSize:\n\t\t\t\treturn \"n-resize\"\n\t\t\tdefault:\n\t\t\t\treturn \"ns-resize\"\n\t\t}\n\t}\n\n\tswitch (size) {\n\t\tcase minSize:\n\t\t\treturn side === \"right\" ? \"e-resize\" : \"w-resize\"\n\t\tcase maxSize:\n\t\t\treturn side === \"right\" ? \"w-resize\" : \"e-resize\"\n\t\tdefault:\n\t\t\treturn \"ew-resize\"\n\t}\n}\n", "export const dataIsProjectBarDataAttribute = \"data-is-project-bar\"\nexport const dataIsProjectBarSelector = `[${dataIsProjectBarDataAttribute}]`\n\nexport const dataIsLeftPanelDataAttribute = \"data-is-left-panel\"\nexport const dataIsLeftPanelSelector = `[${dataIsLeftPanelDataAttribute}]`\n\nexport const dataIsRightPanelDataAttribute = \"data-is-right-panel\"\nexport const dataIsRightPanelSelector = `[${dataIsRightPanelDataAttribute}]`\n\nexport const dataIsAnalyticsDataAttribute = \"data-is-analytics\"\nexport const dataIsAnalyticsSelector = `[${dataIsAnalyticsDataAttribute}]`\n\nexport const dataIsCollectionTableDataAttribute = \"data-is-collection-table\"\nexport const dataIsCollectionTableSelector = `[${dataIsCollectionTableDataAttribute}]`\n\nexport const dataIsCollectionLeftPanelDataAttribute = \"data-is-collection-left-panel\"\nexport const dataIsCollectionLeftPanelSelector = `[${dataIsCollectionLeftPanelDataAttribute}]`\n\nexport const dataIsAgentChatPanelDataAttribute = \"data-is-agent-chat-panel\"\nexport const dataIsAgentChatPanelSelector = `[${dataIsAgentChatPanelDataAttribute}]`\n\nexport const dataIsEditorOverlayDataAttribute = \"data-is-editor-overlay\"\nexport const dataIsEditorOverlaySelector = `[${dataIsEditorOverlayDataAttribute}]`\n", "import type { CanvasNode, CanvasTree } from \"document/models/CanvasTree/index.ts\"\nimport { isCollectionRepeater } from \"document/models/CanvasTree/nodes/utils/nodeCheck.ts\"\n\nexport function isRepeaterDescendent(node: CanvasNode): boolean {\n\treturn (node.cache.ancestorRepeaterIds?.length ?? 0) > 0\n}\n\nexport function isCollectionRepeaterDescendent(tree: CanvasTree, node: CanvasNode): boolean {\n\tconst { ancestorRepeaterIds } = node.cache\n\tif (!ancestorRepeaterIds) return false\n\n\tfor (const id of ancestorRepeaterIds) {\n\t\tconst repeater = tree.get(id)\n\t\tif (isCollectionRepeater(repeater)) return true\n\t}\n\n\treturn false\n}\n\n/**\n * Returns true when the given node sits inside one of the items produced by a collection repeater.\n *\n * Important: The \"item\" here is the descendant element that gets duplicated for every record, **not**\n * the repeater frame itself.  This distinction lets us target logic that should only run for nodes\n * inside the repeated content rather than on the repeater container.\n *\n * @param {CanvasTree} tree  The canvas tree to search in.\n * @param {CanvasNode} node  The node we want to test.\n */\nexport function isRepeatedCollectionItemDescendant(tree: CanvasTree, node: CanvasNode): boolean {\n\tconst { repeatedAncestorRepeaterIds } = node.cache\n\tif (!repeatedAncestorRepeaterIds) return false\n\n\tfor (const id of repeatedAncestorRepeaterIds) {\n\t\tconst repeater = tree.get(id)\n\t\tif (isCollectionRepeater(repeater)) return true\n\t}\n\n\treturn false\n}\n", "import { triggerEvent } from \"../listeners\";\nfunction createGridsCreateEvent(payload) {\n  console.warn(\"[DEPRECATED] Use triggerGridsCreateEvent instead of createGridsCreateEvent.\");\n  return {\n    ...payload,\n    event: \"grids_create\"\n  };\n}\nconst meta = {\n  track: true\n};\nfunction triggerGridsCreateEvent(payload) {\n  const event = {\n    ...payload,\n    event: \"grids_create\"\n  };\n  triggerEvent(event, meta);\n}\nexport {\n  createGridsCreateEvent,\n  triggerGridsCreateEvent\n};\n", "import { triggerGridsCreateEvent } from \"@framerjs/framer-events\"\nimport type { VekterEngine } from \"document/VekterEngine.ts\"\nimport { popoutWindow } from \"document/components/chrome/shared/PopoutWindow.tsx\"\nimport type { NodeID } from \"document/models/CanvasTree/index.ts\"\nimport type { OverlayGrid } from \"document/models/CanvasTree/traits/WithOverlayGrid.ts\"\nimport { defaultOverlayGrid, withOverlayGrid } from \"document/models/CanvasTree/traits/WithOverlayGrid.ts\"\nimport { v4 as uuid } from \"uuid\"\nimport { isFrameNode } from \"../../nodes/utils/nodeCheck.ts\"\n\nexport function addGridToSelection({\n\tengine,\n\tselection,\n\tsource,\n\topenPopout,\n\toverlayGrid,\n\tpreserveExisting,\n}: {\n\tengine: VekterEngine\n\tselection: NodeID[]\n\tsource: \"main_menu\" | \"zoom_menu\" | \"paste\"\n\topenPopout?: boolean\n\toverlayGrid?: OverlayGrid\n\tpreserveExisting?: boolean\n}) {\n\tconst nodes = engine.tree.withoutDescendants(engine.tree.getNodes(selection))\n\tconst updatedGroundNodes: Set<NodeID> = new Set()\n\n\tif (nodes.length === 0) return\n\t// Use the first nodes grid identifier for the popout\n\tconst firstNode = nodes[0]\n\tlet identifier = withOverlayGrid(firstNode) ? firstNode.overlayGrid?.identifier : undefined\n\n\tnodes.forEach(node => {\n\t\t// Grids are only visible on ground nodes. If a non ground node is selected, use it's ground node.\n\t\tconst groundNodeForSelection = engine.tree.getGroundNodeFor(node)\n\n\t\t// Don't perform unnecessary updates, while avoiding multiple loops.\n\t\tif (updatedGroundNodes.has(groundNodeForSelection.id)) return\n\t\tupdatedGroundNodes.add(groundNodeForSelection.id)\n\n\t\tif (!isFrameNode(groundNodeForSelection) || (preserveExisting && groundNodeForSelection.overlayGrid)) return\n\n\t\tconst grid = overlayGrid\n\t\t\t? {\n\t\t\t\t\t...overlayGrid,\n\t\t\t\t\tidentifier: uuid(),\n\t\t\t\t}\n\t\t\t: defaultOverlayGrid(groundNodeForSelection.width)\n\n\t\t// If the first node didn't have a grid, use it for the popout.\n\t\tif (!identifier) identifier = grid.identifier\n\n\t\ttriggerGridsCreateEvent({ gridId: grid.identifier, source })\n\t\tengine.tree.current(groundNodeForSelection)?.set({ overlayGrid: grid })\n\t})\n\n\tif (openPopout && identifier) popoutWindow.navigation.presentPopoutOnRegistration(identifier)\n}\n", "import type { RoutePageEffects } from \"library/router/pageEffects/types.ts\"\nimport { canReadClipboardWithoutPromptingUser } from \"utils/clipboard/clipboard.ts\"\nimport { clipboardReadType } from \"utils/clipboard/index.ts\"\nimport { isObject } from \"utils/typeChecks.ts\"\nimport type { CanvasTree } from \"../../CanvasTree.ts\"\nimport type { NodeID } from \"../../nodes/NodeID.ts\"\nimport { DEFAULT_PAGE_EFFECT_TOKEN, withPageEffects } from \"../WithPageEffects.ts\"\n\n/**\n * Given an object of any of our effect values, set only values for traits\n * supported by the target node.\n */\nexport function setPageEffects(tree: CanvasTree, selection: NodeID[], pageEffects: RoutePageEffects, routeId?: string) {\n\tfor (const nodeId of selection) {\n\t\tconst node = tree.get(nodeId)\n\n\t\tif (!node || !withPageEffects(node)) continue\n\n\t\t// If we're provided a routeId, we want to paste only into this route page effect.\n\t\tif (routeId) {\n\t\t\tconst [key] = Object.keys(pageEffects)\n\t\t\tif (!key) continue\n\t\t\tconst copiedEffect = pageEffects[key]\n\t\t\tif (!copiedEffect) continue\n\t\t\tnode.set({\n\t\t\t\tpageEffects: {\n\t\t\t\t\t...node.pageEffects,\n\t\t\t\t\t[routeId]: copiedEffect,\n\t\t\t\t},\n\t\t\t})\n\t\t\t// Otherwise merge all pasted page effects with existing page effects.\n\t\t} else {\n\t\t\tnode.set({\n\t\t\t\tpageEffects: { ...node.pageEffects, ...pageEffects },\n\t\t\t})\n\t\t}\n\t}\n}\n\nexport async function canPastePageEffects(tree: CanvasTree, selection: NodeID[], allowMultiple: boolean = true) {\n\t// In Safari we cannot access the clipboard on right-click, that's why we assume the\n\t// happy flow here, and enable pasting even if we cannot read the clipboard.\n\tif (!(await canReadClipboardWithoutPromptingUser())) return true\n\n\tconst pageEffects = await clipboardReadType(\"application/x-framer-page-effects\")\n\n\tif (!isObject(pageEffects)) return false\n\n\tconst numPageEffects = Object.keys(pageEffects).length\n\tif (!allowMultiple && numPageEffects > 1) return false\n\n\t// If the only clipboard data is for all routes, don't allow \"Paste all\"\n\tif (numPageEffects === 1 && pageEffects[DEFAULT_PAGE_EFFECT_TOKEN]) return false\n\n\tconst allNodesSupportPageEffects = selection.every(nodeId => {\n\t\tconst node = tree.get(nodeId)\n\t\treturn node ? withPageEffects(node) : true\n\t})\n\n\treturn allNodesSupportPageEffects\n}\n\nexport async function canPasteSinglePageEffect(tree: CanvasTree, selection: NodeID[]) {\n\treturn canPastePageEffects(tree, selection, false)\n}\n", "import { type CSSVarRange, parseCSSVarRange } from \"library/render/utils/parseCSSVariable.ts\"\nimport { safeName } from \"utils/names.ts\"\nimport type { CanvasTree } from \"../../CanvasTree.ts\"\nimport { findTokenNode } from \"../../utils/findTokenNode.ts\"\nimport { tokenIdFromCSSVarRange } from \"../../utils/tokens.ts\"\n\nexport function migrateTokenCSSVariableInValue(tree: CanvasTree, value: string) {\n\tconst range = parseCSSVarRange(value)\n\tif (!range) return value\n\treturn migrateCSSVariable(tree, value, range)\n}\n\nexport function migrateCSSVariable(tree: CanvasTree, value: string, range: CSSVarRange) {\n\tconst tokenId = tokenIdFromCSSVarRange(value, range)\n\tif (!tokenId) return value\n\tconst tokenNode = findTokenNode(tokenId, tree)\n\tif (!tokenNode) return value\n\treturn `var(--${safeName(tokenNode.name)}, ${tokenNode.light})`\n}\n", "import { assert } from \"@framerjs/shared\"\nimport { getFontStyleProperties } from \"text\"\nimport { isNumber, isUndefined } from \"utils/typeChecks.ts\"\nimport type { CanvasNode, RichTextNode, TextNode } from \"../index.ts\"\nimport { isAnyTextNode } from \"../nodes/utils/isAnyTextNode.ts\"\nimport { isRichTextNode } from \"../nodes/utils/nodeCheck.ts\"\nimport { isVariableReference } from \"../traits/VariableReference.ts\"\nimport { migrateLetterSpacing, textDecorationCSSDefaults, textStyleDefaults } from \"../traits/WithTextStyle.ts\"\nimport { createCSSDimension } from \"../traits/utils/CSSDimension.ts\"\nimport { migrateTokenCSSVariableInValue } from \"../traits/utils/cssVariables.ts\"\nimport { openTypeFeatureTagsToCSS } from \"./openType.ts\"\nimport { isTokenCSSVariable, stripMetadataFromCSSVariable } from \"./tokens.ts\"\nimport { variationAxesToCSS } from \"./variableFont.ts\"\n\nexport function collectTextStyleForHandoff(node: CanvasNode, style: React.CSSProperties) {\n\tif (isAnyTextNode(node)) {\n\t\tconst handoffStyles = isRichTextNode(node) ? richTextNodeStylesForHandoff(node) : textNdoeStylesForHandoff(node)\n\t\tObject.assign(style, handoffStyles)\n\t}\n}\n\nfunction richTextNodeStylesForHandoff(node: RichTextNode) {\n\tconst [font] = node.getFonts(false)\n\tconst [textColor] = node.getTextColors(false)\n\tconst [fontSize] = node.getFontSizes(false)\n\tconst [openTypeFontFeatures] = node.getOpenTypeFontFeatures(false)\n\tconst [fontVariationAxes] = node.getVariationAxes(false)\n\n\tconst styles: React.CSSProperties = {}\n\n\tif (!isUndefined(font)) {\n\t\tconst fontStyles = getFontStyleProperties(font)\n\t\tObject.assign(styles, fontStyles)\n\t}\n\n\tif (!isUndefined(textColor)) {\n\t\tlet colorValue: string = isVariableReference(textColor)\n\t\t\t? (node.cache.getVariableReferenceValue(textColor) as string)\n\t\t\t: textColor\n\t\tconst tree = node.tree()\n\t\tif (tree && isTokenCSSVariable(colorValue)) {\n\t\t\tcolorValue = migrateTokenCSSVariableInValue(tree, colorValue)\n\t\t}\n\t\tstyles.color = colorValue\n\t}\n\n\tif (isVariableReference(fontSize)) {\n\t\tconst value = node.cache.getVariableReferenceValue(fontSize)\n\t\tassert(isNumber(value), \"Font Size variable reference must resolve to a number\")\n\t\tstyles.fontSize = createCSSDimension(value, \"px\")\n\t} else if (!isUndefined(fontSize)) {\n\t\tstyles.fontSize = createCSSDimension(...fontSize)\n\t}\n\n\tsetCSSIfNotUndefinedOrDefault(styles, \"letterSpacing\", node.getLetterSpacings(false)[0]?.join(\"\"))\n\tsetCSSIfNotUndefinedOrDefault(styles, \"textTransform\", node.getTextTransforms(false)[0], \"none\")\n\tsetCSSIfNotUndefinedOrDefault(styles, \"textAlign\", node.getTextAlignments(false)[0], \"start\")\n\tsetCSSIfNotUndefinedOrDefault(styles, \"lineHeight\", node.getLineHeights(false)[0]?.join(\"\"))\n\tsetCSSIfNotUndefinedOrDefault(\n\t\tstyles,\n\t\t\"textDecoration\",\n\t\tnode.getTextDecorations(false)[0],\n\t\ttextDecorationCSSDefaults.textDecoration,\n\t)\n\tsetCSSIfNotUndefinedOrDefault(\n\t\tstyles,\n\t\t\"textDecorationColor\",\n\t\tnode.getTextDecorationColors(false)[0],\n\t\ttextDecorationCSSDefaults.textDecorationColor,\n\t)\n\tsetCSSIfNotUndefinedOrDefault(\n\t\tstyles,\n\t\t\"textDecorationThickness\",\n\t\tnode.getTextDecorationThicknesses(false)[0],\n\t\ttextDecorationCSSDefaults.textDecorationThickness,\n\t)\n\tsetCSSIfNotUndefinedOrDefault(\n\t\tstyles,\n\t\t\"textDecorationStyle\",\n\t\tnode.getTextDecorationStyles(false)[0],\n\t\ttextDecorationCSSDefaults.textDecorationStyle,\n\t)\n\tsetCSSIfNotUndefinedOrDefault(\n\t\tstyles,\n\t\t\"textDecorationSkipInk\",\n\t\tnode.getTextDecorationSkipInks(false)[0],\n\t\ttextDecorationCSSDefaults.textDecorationSkipInk,\n\t)\n\tsetCSSIfNotUndefinedOrDefault(\n\t\tstyles,\n\t\t\"textUnderlineOffset\",\n\t\tnode.getTextDecorationOffsets(false)[0],\n\t\ttextDecorationCSSDefaults.textDecorationOffset,\n\t)\n\n\tif (!isUndefined(openTypeFontFeatures)) {\n\t\tstyles.fontFeatureSettings = openTypeFeatureTagsToCSS(openTypeFontFeatures)\n\t}\n\n\tif (!isUndefined(fontVariationAxes)) {\n\t\tstyles.fontVariationSettings = variationAxesToCSS(fontVariationAxes)\n\t}\n\n\treturn styles\n}\n\nfunction setCSSIfNotUndefinedOrDefault<K extends keyof React.CSSProperties>(\n\tstyle: React.CSSProperties,\n\tkey: K,\n\tvalue: React.CSSProperties[K] | undefined,\n\tdefaultValue?: React.CSSProperties[K],\n) {\n\tif (!isUndefined(value) && value !== defaultValue) {\n\t\tstyle[key] = value\n\t}\n}\n\nfunction textNdoeStylesForHandoff(node: TextNode<unknown>) {\n\tconst [font] = node.getFonts(false)\n\tassert(font, \"TextNode must have at least one font\")\n\tconst [letterSpacing] = node.getLetterSpacings(false)\n\tconst [textTransform] = node.getTextTransforms(false)\n\tconst [textDecoration] = node.getTextDecorations(false)\n\tconst [lineHeight] = node.getLineHeights()\n\tconst [textAlignment] = node.getTextAlignments()\n\n\tlet [textColor] = node.getTextColors(false)\n\tlet [fontSize] = node.getFontSizes(false)\n\n\tif (isVariableReference(textColor)) {\n\t\ttextColor = node.cache.getVariableReferenceValue(textColor) as string\n\t}\n\tif (isTokenCSSVariable(textColor)) {\n\t\tconst strippedColor = stripMetadataFromCSSVariable(textColor)\n\t\tif (strippedColor) {\n\t\t\ttextColor = strippedColor\n\t\t}\n\t}\n\n\tif (isVariableReference(fontSize)) {\n\t\tfontSize = node.cache.getVariableReferenceValue(fontSize) as number\n\t}\n\n\tconst styles: React.CSSProperties = {\n\t\t...getFontStyleProperties(font),\n\t\tcolor: textColor,\n\t\tfontSize: fontSize + \"px\",\n\t\tletterSpacing: isUndefined(letterSpacing) ? undefined : migrateLetterSpacing(letterSpacing).join(\"\"),\n\t\tlineHeight: lineHeight.join(\"\"),\n\t\ttabSize: 4, // NOTE: This matches the value set in `draftContentStateToHTMLConverter`\n\t}\n\n\tif (textTransform !== textStyleDefaults.textTransform) {\n\t\tstyles.textTransform = textTransform\n\t}\n\n\tif (textDecoration !== textStyleDefaults.textDecoration) {\n\t\tstyles.textDecoration = textDecoration\n\t}\n\n\tif (textAlignment !== textStyleDefaults.textAlignment) {\n\t\tstyles.textAlign = textAlignment\n\t}\n\n\treturn styles\n}\n", "import type { AnyComponentLoader } from \"@framerjs/framer-runtime\"\nimport type { CollectorContext } from \"code-generation/utils/collector.ts\"\nimport { CSSExportType } from \"document/components/chrome/properties/panels/types.ts\"\nimport type { CanvasNode, CanvasTree } from \"document/models/CanvasTree/index.ts\"\nimport { isStackOrGridChild } from \"document/models/CanvasTree/nodes/utils/isStackOrGridChild.ts\"\nimport { withBorder } from \"document/models/CanvasTree/traits/WithBorder.ts\"\nimport { withDOMLayout } from \"document/models/CanvasTree/traits/WithDOMLayout.ts\"\nimport type { WithPadding } from \"document/models/CanvasTree/traits/WithPadding.ts\"\nimport { withPadding } from \"document/models/CanvasTree/traits/WithPadding.ts\"\nimport { needsMinSize } from \"document/models/CanvasTree/traits/utils/needsMinSize.ts\"\nimport { collectTextStyleForHandoff } from \"document/models/CanvasTree/utils/collectTextStyleForHandoff.ts\"\nimport type { StackDirection } from \"library/components/Stack/types.ts\"\nimport type { Size } from \"library/index.ts\"\nimport { cssBackgroundSize } from \"library/render/presentation/Frame/DeprecatedFrame.tsx\"\nimport { backgroundImageFromProps } from \"library/render/style/backgroundImageFromProps.ts\"\nimport { DimensionType } from \"library/render/types/Constraints.ts\"\nimport { parseCSSVarRange } from \"library/render/utils/parseCSSVariable.ts\"\nimport { isNumber } from \"utils/typeChecks.ts\"\nimport { isVectorNode } from \"../../nodes/TreeNode.ts\"\nimport { isCodeComponentNode, isFrameNode, isStackComponent } from \"../../nodes/utils/nodeCheck.ts\"\nimport { isTokenCSSVariable } from \"../../utils/tokens.ts\"\nimport type { NonDynamicValueRecord } from \"../DynamicValue.ts\"\nimport { isDynamicValue } from \"../DynamicValue.ts\"\nimport { hasActiveImageFill, withFill, withOptionalFill } from \"../WithFill.ts\"\nimport { isPinnable } from \"../WithPins.ts\"\nimport { withSize } from \"../WithSize.ts\"\nimport { collectBorder } from \"../collectStyles/collectBorder.ts\"\nimport { collectPosition } from \"../collectStyles/collectPosition.ts\"\nimport { collectStyle } from \"../collectStyles/collectStyle.ts\"\nimport { sizeValueToCSSValue } from \"./cssValues.ts\"\nimport { migrateCSSVariable, migrateTokenCSSVariableInValue } from \"./cssVariables.ts\"\nimport type { CSSComments, CSSDeclarationBlock } from \"./getCSSDeclarationBlock.ts\"\nimport { getCSSDeclarationBlock } from \"./getCSSDeclarationBlock.ts\"\nimport { isStylableNode } from \"./hardCodedCodeComponentIdentifierChecks.ts\"\n\nexport function copyCSSForNodeEnabled(node: CanvasNode | null): boolean {\n\tif (!node) return false\n\tif (isVectorNode(node)) return false\n\tif (!isStylableNode(node)) return false\n\treturn true\n}\n\nexport function getCSSTextForNode(\n\ttree: CanvasTree,\n\tcomponentLoader: AnyComponentLoader,\n\tnode: CanvasNode,\n\tcssType: CSSExportType = CSSExportType.CSS,\n) {\n\tconst declarationBlock = getCSSDeclarationBlockForNode(tree, componentLoader, node, cssType)\n\treturn createCSSBlock(declarationBlock)\n}\n\nfunction createCSSBlock(declarationBlock: CSSDeclarationBlock): string {\n\tconst result = declarationBlock.map(rule => {\n\t\treturn `${rule.prop}: ${rule.value};`\n\t})\n\n\treturn result.join(\"\\n\")\n}\n\nexport function getCSSDeclarationBlockForNode(\n\ttree: CanvasTree,\n\tcomponentLoader: AnyComponentLoader,\n\tnode: CanvasNode,\n\tcssType: CSSExportType,\n): CSSDeclarationBlock {\n\tconst { css, comments } = getCSSForNode(tree, componentLoader, node)\n\treturn getCSSDeclarationBlock(css, cssType, comments)\n}\n\nfunction getParentStackDirection(tree: CanvasTree, node: CanvasNode): StackDirection | null {\n\tconst parent = tree.getParent(node.id)\n\tif (!parent || !isStackComponent(parent)) return null\n\n\tconst direction: StackDirection | undefined = parent.resolveValue(\"stackDirection\")\n\treturn direction || null\n}\n\nconst paddingSizeFromEachSide = ({\n\tpaddingTop = 0,\n\tpaddingRight = 0,\n\tpaddingBottom = 0,\n\tpaddingLeft = 0,\n}: NonDynamicValueRecord<WithPadding>): Size => ({\n\twidth: paddingLeft + paddingRight,\n\theight: paddingTop + paddingBottom,\n})\n\nconst paddingSizeFromSingle = ({ padding = 0 }: NonDynamicValueRecord<WithPadding>) => ({\n\twidth: padding * 2,\n\theight: padding * 2,\n})\n\nconst calcPaddingSize = (props: NonDynamicValueRecord<WithPadding>): Size => {\n\treturn props.paddingPerSide ? paddingSizeFromEachSide(props) : paddingSizeFromSingle(props)\n}\n\nfunction shouldCollectBoxModel(node: CanvasNode) {\n\tif (withBorder(node) && node.borderEnabled && node.borderWidth) return true\n\tif (withPadding(node)) {\n\t\tif (isDynamicValue(node.padding)) return true\n\t\tconst paddingSize = calcPaddingSize({\n\t\t\tpadding: node.padding,\n\t\t\tpaddingPerSide: node.paddingPerSide,\n\t\t\tpaddingTop: node.paddingTop,\n\t\t\tpaddingRight: node.paddingRight,\n\t\t\tpaddingBottom: node.paddingBottom,\n\t\t\tpaddingLeft: node.paddingLeft,\n\t\t})\n\t\tif (paddingSize.width > 0 || paddingSize.height > 0) return true\n\t}\n\treturn false\n}\n\nexport function collectLayoutStyleForNode(\n\ttree: CanvasTree,\n\tnode: CanvasNode,\n\tcss: React.CSSProperties,\n\tcomments: CSSComments,\n) {\n\tif (!withSize(node)) return\n\n\t// Specify the box model when border or padding is applied\n\tif (shouldCollectBoxModel(node)) {\n\t\tcss.boxSizing = \"border-box\"\n\t}\n\n\tif (isStackOrGridChild(node)) {\n\t\tcss.flexShrink = 0\n\t}\n\n\tif (isPinnable(node)) {\n\t\tswitch (node.widthType) {\n\t\t\tcase DimensionType.FractionOfFreeSpace: {\n\t\t\t\tconst direction = getParentStackDirection(tree, node)\n\t\t\t\tif (direction) {\n\t\t\t\t\tconst isHorizontal = direction === \"horizontal\"\n\t\t\t\t\tif (isHorizontal) {\n\t\t\t\t\t\tcss.flex = node.width\n\t\t\t\t\t\tcss.width = \"1px\"\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcss.width = `${node.width * 100}%`\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcase DimensionType.Auto: {\n\t\t\t\tcss.width = \"auto\"\n\n\t\t\t\tconst domRect = withDOMLayout(node) && node.usesDOMRectCached() ? node.getDOMRect() : null\n\t\t\t\tif (domRect) {\n\t\t\t\t\tconst widthValue = sizeValueToCSSValue(domRect.width)\n\t\t\t\t\tcomments.width = widthValue\n\n\t\t\t\t\tif (needsMinSize(node)) {\n\t\t\t\t\t\tcss.minWidth = widthValue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcase DimensionType.FixedNumber:\n\t\t\t\tcss.width = sizeValueToCSSValue(node.width)\n\t\t\t\tbreak\n\t\t\tcase DimensionType.Percentage:\n\t\t\t\tcss.width = sizeValueToCSSValue(`${Math.round(node.width * 100)}%`)\n\t\t\t\tbreak\n\t\t}\n\n\t\tswitch (node.heightType) {\n\t\t\tcase DimensionType.FractionOfFreeSpace: {\n\t\t\t\tconst direction = getParentStackDirection(tree, node)\n\t\t\t\tif (direction) {\n\t\t\t\t\tconst isHorizontal = direction === \"horizontal\"\n\t\t\t\t\tif (isHorizontal) {\n\t\t\t\t\t\tcss.height = `${node.height * 100}%`\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcss.flex = node.height\n\t\t\t\t\t\tcss.height = \"1px\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcase DimensionType.Auto: {\n\t\t\t\tcss.height = \"auto\"\n\n\t\t\t\tconst domRect = withDOMLayout(node) && node.usesDOMRectCached() ? node.getDOMRect() : null\n\t\t\t\tif (domRect) {\n\t\t\t\t\tconst heightValue = sizeValueToCSSValue(domRect.height)\n\t\t\t\t\tcomments.height = heightValue\n\n\t\t\t\t\tif (needsMinSize(node)) {\n\t\t\t\t\t\tcss.minHeight = heightValue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcase DimensionType.FixedNumber:\n\t\t\t\tcss.height = sizeValueToCSSValue(node.height)\n\t\t\t\tbreak\n\t\t\tcase DimensionType.Percentage:\n\t\t\t\tcss.height = sizeValueToCSSValue(`${Math.round(node.height * 100)}%`)\n\t\t\t\tbreak\n\t\t}\n\t}\n}\n\nexport function getCSSForNode(\n\ttree: CanvasTree,\n\tcomponentLoader: AnyComponentLoader,\n\tnode: CanvasNode,\n): { css: React.CSSProperties; comments: CSSComments } {\n\tlet css: React.CSSProperties = {}\n\tconst comments: CSSComments = {}\n\tlet props = node.getProps(componentLoader)\n\n\tcollectLayoutStyleForNode(tree, node, css, comments)\n\n\tconst context: CollectorContext = { componentLoader }\n\n\tif (isFrameNode(node)) {\n\t\t// collect stack class-specific styles\n\t\tnode.collectCSS(css)\n\t}\n\n\tif (isCodeComponentNode(node)) {\n\t\t// collect all styles applied for code component nodes\n\t\tconst codeComponentProps = node.getStylingProps(componentLoader)\n\t\tconst codeProps = props as ReturnType<typeof node.getProps>\n\t\t// stuff like rotation is only available in the original node props,\n\t\t// we took them out from codeComponentProps to avoid applying them to the actual component again,\n\t\t// so here we merge two props to get all the styles\n\t\tprops = {\n\t\t\t...props,\n\t\t\t...codeComponentProps,\n\t\t\tstyle: { ...codeComponentProps.style, ...codeProps.style },\n\t\t}\n\t\tcss = { ...css, ...codeProps.style }\n\t} else {\n\t\tif (\"style\" in props) {\n\t\t\tcss = { ...css, ...(props.style as React.CSSProperties) }\n\t\t}\n\t\tcollectStyle(node, css, { componentLoader })\n\t\t// collect text rotation\n\t\tif (\"rotation\" in props && props.rotation) {\n\t\t\tcss.rotate = props.rotation as typeof css.rotate\n\t\t}\n\n\t\tcollectTextStyleForHandoff(node, css)\n\t}\n\t// Image background is ignored in collectVisualStyleFromProps\n\tcollectBackgroundImageFromPropsIfEnabled(node, props, css)\n\n\tif (\"_border\" in props && props._border) collectBorder(node, css, context)\n\n\t// Position isn't rendered on the canvas, so we must add it here.\n\tcollectPosition(node, css, context)\n\n\t// Filter out custom properties\n\tfor (const key in css) {\n\t\tif (key.startsWith(\"--\")) {\n\t\t\tdelete css[key as keyof typeof css]\n\t\t}\n\t}\n\n\treturn { css: migrateCSS(tree, css), comments }\n}\n\nfunction collectBackgroundImageFromPropsIfEnabled(node: CanvasNode, props: any, css: React.CSSProperties) {\n\tif (!withOptionalFill(node) || !node.fillEnabled) return\n\tif (!withFill(node)) return\n\tif (!hasActiveImageFill(node)) return\n\tif (!props) return\n\n\tconst image = backgroundImageFromProps(props)\n\tif (!image) return\n\n\tconst imageName = node.fillImageOriginalName || \"background-image.jpg\"\n\tcss.backgroundImage = `url(/* ${imageName} */)`\n\tcss.backgroundSize = cssBackgroundSize(image.fit)\n\tcss.backgroundRepeat = \"no-repeat\"\n\tcss.backgroundPosition = \"center\"\n}\n\nconst radiusKeys = [\"borderTopLeftRadius\", \"borderTopRightRadius\", \"borderBottomRightRadius\", \"borderBottomLeftRadius\"]\nconst borderWidthKeys = [\"borderTopWidth\", \"borderBottomWidth\", \"borderLeftWidth\", \"borderRightWidth\"]\nconst borderKeys = borderWidthKeys.concat([\"border\", \"borderStyle\", \"borderWidth\", \"borderColor\"])\n\nexport function migrateCSS(tree: CanvasTree, css: React.CSSProperties): { [key: string]: string | number } {\n\tconst result: Record<string, string | number> = {}\n\tlet includesRadius = false\n\tlet includesBorder = false\n\tfor (const originalKey of Object.keys(css)) {\n\t\tif (radiusKeys.includes(originalKey)) {\n\t\t\tincludesRadius = true\n\t\t\tcontinue\n\t\t}\n\t\tif (borderKeys.includes(originalKey)) {\n\t\t\tincludesBorder = true\n\t\t\tcontinue\n\t\t}\n\n\t\t// biome-ignore lint/style/noNonNullAssertion: Original key is guaranteed to be in the css object, because it's generated by Object.keys\n\t\tconst migratedCSS = migrateCSSKeyAndValue(originalKey, css[originalKey as keyof typeof css]!)\n\t\tif (!migratedCSS) continue\n\t\tconst { key, value } = migratedCSS\n\t\tresult[key] = value\n\t\tif (typeof value === \"string\") {\n\t\t\tlet migratedResult = value\n\t\t\tlet range = parseCSSVarRange(value)\n\t\t\twhile (range) {\n\t\t\t\tconst match = value.substring(range.start, range.end)\n\t\t\t\tconst migratedValue = migrateCSSVariable(tree, value, range)\n\t\t\t\tmigratedResult = migratedResult.replace(match, migratedValue)\n\t\t\t\trange = parseCSSVarRange(value, range.end)\n\t\t\t}\n\t\t\tresult[key] = migratedResult\n\t\t}\n\t}\n\n\t// framer-motion needs border-radius, and border-width to be split per property.\n\t// However, in Handoff, we want it to be a single property, so we migrate it here.\n\tif (includesRadius) migrateRadius(css, result)\n\tif (includesBorder) migrateBorder(tree, css, result)\n\n\treturn result\n}\n\nfunction migrateRadius(css: React.CSSProperties, style: { [key: string]: string | number }) {\n\tconst cssRecord = css as Record<string, unknown>\n\tif (css.borderTopLeftRadius && radiusKeys.every(key => cssRecord[key] === css.borderTopLeftRadius)) {\n\t\tstyle.borderRadius = sizeValueToCSSValue(css.borderTopLeftRadius)\n\t\treturn\n\t}\n\tconst [topLeft, topRight, bottomLeft, bottomRight] = radiusKeys.map(key =>\n\t\tsizeValueToCSSValue((cssRecord[key] ?? 0) as string | number),\n\t)\n\tstyle.borderRadius = `${topLeft} ${topRight} ${bottomLeft} ${bottomRight}`\n}\n\n/**\n * When generating CSS for a node, if all border width's have the same value,\n * collapse all border properties into the shorthand `border` css property.\n * We only do this in `migrateCSS` because framer-motion prefers these values as individual properties in every case.\n */\nfunction migrateBorder(tree: CanvasTree, css: React.CSSProperties, style: { [key: string]: string | number }) {\n\tconst cssRecord = css as Record<string, unknown>\n\tconst top = css.borderTopWidth\n\tlet borderColor = css.borderColor\n\tif (isTokenCSSVariable(borderColor)) {\n\t\tborderColor = migrateTokenCSSVariableInValue(tree, borderColor)\n\t}\n\tif (top !== undefined && borderWidthKeys.every(key => cssRecord[key] === top)) {\n\t\tstyle.border = `${sizeValueToCSSValue(top)} ${css.borderStyle} ${borderColor}`\n\t} else if (borderColor && css.borderStyle) {\n\t\tstyle.borderColor = borderColor\n\t\tstyle.borderStyle = css.borderStyle\n\t\tstyle.borderTopWidth = sizeValueToCSSValue(css.borderTopWidth ?? 0)\n\t\tstyle.borderBottomWidth = sizeValueToCSSValue(css.borderBottomWidth ?? 0)\n\t\tstyle.borderLeftWidth = sizeValueToCSSValue(css.borderLeftWidth ?? 0)\n\t\tstyle.borderRightWidth = sizeValueToCSSValue(css.borderRightWidth ?? 0)\n\t}\n}\n\nfunction migrateCSSKeyAndValue(key: string, value: string | number) {\n\tif (key === \"rotate\") {\n\t\tif (!value) return null\n\t\treturn { key: \"transform\", value: `rotate(${value}deg)` }\n\t}\n\tif (key === \"opacity\" && value === 1) return null\n\tif (key === \"WebkitTextFillColor\") return { key: \"color\", value }\n\n\tif (key === \"lineHeight\" && typeof value === \"string\") {\n\t\tif (value.includes(\"%\") || value.includes(\"px\")) return { key, value }\n\n\t\tconst newValue = parseFloat(value)\n\t\tif (isNumber(newValue)) return { key, value: newValue }\n\t}\n\n\treturn { key, value }\n}\n", "import { isTokenCSSVariable } from \"document/models/CanvasTree/utils/tokens.ts\"\nimport { Color, P3Color } from \"library/render/types/Color/Color.ts\"\nimport { isString } from \"utils/typeChecks.ts\"\n\nexport function isValidColorOrToken(value: unknown): boolean {\n\tif (!isString(value) || !value.length) return false\n\tif (P3Color.fromString(value)) return true\n\tif (Color(value).isValid === false && !isTokenCSSVariable(value)) return false\n\treturn true\n}\n", "/**\n * Splits a comma- or newline-separated CSS value list into its individual\n * tokens. Respects parentheses so values like `rgb(1, 2, 3)` or\n * `var(--token, #fff)` are not split at their internal commas \u2014 including\n * nested parens such as `var(--x, rgb(1, 2, 3))`.\n *\n * Tokens are trimmed and empty tokens are dropped. Tokens are not validated \u2014\n * callers should run their own validation.\n */\nexport function splitCSSValueList(text: string): string[] {\n\tconst tokens: string[] = []\n\tlet depth = 0\n\tlet start = 0\n\tfor (let i = 0; i < text.length; i++) {\n\t\tconst ch = text[i]\n\t\tif (ch === \"(\") {\n\t\t\tdepth++\n\t\t} else if (ch === \")\") {\n\t\t\tdepth = Math.max(0, depth - 1)\n\t\t} else if ((ch === \",\" || ch === \"\\n\") && depth === 0) {\n\t\t\tconst token = text.slice(start, i).trim()\n\t\t\tif (token) tokens.push(token)\n\t\t\tstart = i + 1\n\t\t}\n\t}\n\tconst last = text.slice(start).trim()\n\tif (last) tokens.push(last)\n\treturn tokens\n}\n", "import { getLogger, hostInfo } from \"@framerjs/shared\"\nimport type { VekterEngine } from \"document/VekterEngine.ts\"\nimport { embed } from \"document/components/chrome/insertSidebar/dataSources/items/embed.ts\"\nimport { isEditingText } from \"document/utils/isEditingText.ts\"\nimport type { Point } from \"library/index.ts\"\nimport { ControlType } from \"library/index.ts\"\nimport { toast } from \"web/lib/toaster.ts\"\nimport { insertModuleEntity } from \"./modules.ts\"\n\nconst log = getLogger(\"clipboard:embed\")\n\nexport async function embedClipboardHandler(\n\tengine: VekterEngine,\n\ttextClipboardData: string | undefined,\n\tposition: Point,\n): Promise<boolean> {\n\tif (!textClipboardData) return false\n\tif (!textClipboardData.startsWith(\"<iframe\") && !textClipboardData.endsWith(\"</iframe>\")) return false\n\tif (isEditingText() || hostInfo.isDevelopment) return true\n\tawait insertEmbedComponent(engine, textClipboardData, position)\n\treturn true\n}\n\n// Store the keys of the properties we're going to update in `insertEmbedComponent`.\nconst typePropertyKey = \"type\"\nconst htmlPropertyKey = \"html\"\n\nasync function insertEmbedComponent(engine: VekterEngine, textClipboardData: string, position: Point) {\n\tconst toastKey = \"import-embedded-component\"\n\ttoast({\n\t\ttype: \"add\",\n\t\tvariant: \"progress\",\n\t\tprimaryText: \"Inserting\",\n\t\tsecondaryText: \"embedded component\u2026\",\n\t\ticon: \"image\",\n\t\tkey: toastKey,\n\t})\n\ttry {\n\t\tawait insertModuleEntity({\n\t\t\tengine,\n\t\t\tmoduleURL: embed.moduleURL,\n\t\t\tposition,\n\t\t\tcenterInParent: true,\n\t\t\tupdate: component => {\n\t\t\t\tconst entity = engine.componentLoader.componentForIdentifier(component.codeComponentIdentifier)\n\t\t\t\tif (!entity?.properties) return\n\n\t\t\t\t// Since we're using the embed code component which can be updated independently from this repository,\n\t\t\t\t// we need to hardcode the the props we want to update.\n\t\t\t\t// If the prop keys or types change, the update won't succeed, so let's be thorough\n\t\t\t\t// and check that everything matches our expectation before triggering any updates.\n\t\t\t\tconst typeProperty = entity.properties[typePropertyKey]\n\t\t\t\tconst htmlProperty = entity.properties[htmlPropertyKey]\n\t\t\t\tif (!typeProperty || !htmlProperty) {\n\t\t\t\t\tthrow new Error(\"Embed component is missing required prop.\")\n\t\t\t\t}\n\t\t\t\tif (typeProperty.type !== ControlType.Enum || htmlProperty.type !== ControlType.String) {\n\t\t\t\t\tthrow new Error(\"Embed component expects different prop type.\")\n\t\t\t\t}\n\n\t\t\t\tcomponent.setControlProp(typePropertyKey, { type: typeProperty.type, value: \"html\" })\n\t\t\t\tcomponent.setControlProp(htmlPropertyKey, { type: htmlProperty.type, value: textClipboardData })\n\t\t\t},\n\t\t})\n\t\ttoast({\n\t\t\ttype: \"remove\",\n\t\t\tkey: toastKey,\n\t\t})\n\t} catch (err) {\n\t\tlog.error(err)\n\t\ttoast({\n\t\t\ttype: \"add\",\n\t\t\tvariant: \"info\",\n\t\t\tprimaryText: \"Please update\",\n\t\t\tsecondaryText: \"the embed component.\",\n\t\t\ticon: \"image\",\n\t\t\tkey: toastKey,\n\t\t})\n\t}\n}\n", "import { createAssetReferenceForImage, getAssetFilename } from \"@framerjs/assets\"\nimport type { ToasterAddAction } from \"@framerjs/fresco\"\nimport type { VekterEngine } from \"document/VekterEngine.ts\"\nimport { CanvasTree } from \"document/models/CanvasTree/index.ts\"\nimport { isWebPageNode } from \"document/models/CanvasTree/nodes/utils/nodeCheck.ts\"\nimport { ModalType } from \"document/utils/ModalType.ts\"\nimport type { Point } from \"library/index.ts\"\nimport { assert } from \"library/utils/assert.ts\"\nimport { isArray, isNumber, isObject, isString } from \"utils/typeChecks.ts\"\nimport { toast } from \"web/lib/toaster.ts\"\nimport { record } from \"web/lib/tracker.ts\"\nimport { percentRange } from \"../utils.ts\"\nimport type { PasteResult } from \"./tree.ts\"\nimport { emptyClipboardLayers, pasteTree } from \"./tree.ts\"\n\nconst SHOWED_FIGMA_IMPORT_TUTORIAL_MODAL = \"showedFigmaImportTutorialModal\"\n\nconst hasShownFigmaImportTutorial = () => window.localStorage.getItem(SHOWED_FIGMA_IMPORT_TUTORIAL_MODAL) === \"true\"\n\ninterface TreeNode {\n\t__class: string\n\tchildren?: TreeNode[]\n\t[key: string]: unknown\n}\ninterface ImageNode extends TreeNode {\n\tname: string\n\tfillImage: unknown\n}\n\nexport interface FigmaClipboardData {\n\tversion: number\n\troot: TreeNode & {\n\t\tid: string\n\t\tchildren: TreeNode[]\n\t}\n}\n\nfunction isImageNode(node: TreeNode): node is ImageNode {\n\tif (typeof node.name !== \"string\") return false\n\tif (typeof node.fillImage === \"undefined\") return false\n\treturn true\n}\n\nexport function isFigmaClipboardData(data: unknown): data is FigmaClipboardData {\n\treturn (\n\t\tisObject(data) &&\n\t\t\"version\" in data &&\n\t\tisNumber(data.version) &&\n\t\t\"root\" in data &&\n\t\tisObject(data.root) &&\n\t\t\"__class\" in data.root &&\n\t\tisString(data.root.__class) &&\n\t\t\"id\" in data.root &&\n\t\tisString(data.root.id) &&\n\t\t\"children\" in data.root &&\n\t\tisArray(data.root.children)\n\t)\n}\n\nexport async function figmaClipboardHandler(\n\tengine: VekterEngine,\n\tfigmaPluginClipboardData: FigmaClipboardData | undefined,\n\thtmlClipboardData: string | undefined,\n\tposition: Point,\n): Promise<boolean> {\n\t// Copy pasting from Figma without running the Figma plugin doesn't work\n\tif (htmlClipboardData?.includes(\"<!--(figma)\")) return true\n\n\tif (!figmaPluginClipboardData) return false\n\tconst { assetService } = engine.stores.assetStore\n\tif (!assetService) return false\n\n\tconst startTime = Date.now()\n\n\tconst action: ToasterAddAction = {\n\t\tkey: \"processFigmaClipboardData\",\n\t\ttype: \"add\",\n\t\tvariant: \"progress\",\n\t\ticon: \"image\",\n\t\ttext: \"Importing Figma layers\u2026\",\n\t\tduration: 10 * 1000,\n\t\tshowCloseButton: \"never\",\n\t}\n\n\ttoast({\n\t\t...action,\n\t\ttext: \"Uploading Figma images\u2026 5%\",\n\t})\n\n\tconst figmaTree = figmaPluginClipboardData\n\tconst imageNodes: ImageNode[] = []\n\n\tlet layerCount = 1\n\n\tfunction traverseNode(node: TreeNode) {\n\t\tif (typeof node !== \"object\") return\n\n\t\tlayerCount++\n\n\t\tif (isImageNode(node)) {\n\t\t\timageNodes.push(node)\n\t\t}\n\n\t\tfor (const child of node.children ?? []) {\n\t\t\ttraverseNode(child)\n\t\t}\n\t}\n\n\ttraverseNode(figmaTree.root)\n\n\tlet uploadedAmount = 0\n\n\tfunction reportProgress() {\n\t\tconst progress = ++uploadedAmount / imageNodes.length\n\t\tconst percent = percentRange(progress * 100, 5, 95)\n\n\t\ttoast({\n\t\t\t...action,\n\t\t\ttext: `Uploading Figma images\u2026 ${percent}%`,\n\t\t})\n\t}\n\n\tawait Promise.all(\n\t\timageNodes.map(async node => {\n\t\t\ttry {\n\t\t\t\tlet blob: Blob | undefined\n\n\t\t\t\tif (Array.isArray(node.fillImage)) {\n\t\t\t\t\tconst bytes = Uint8Array.from(node.fillImage)\n\t\t\t\t\tblob = new Blob([bytes])\n\t\t\t\t}\n\n\t\t\t\tif (blob === undefined) {\n\t\t\t\t\tthrow new Error(\"Failed to create file\")\n\t\t\t\t}\n\n\t\t\t\tconst file = new File([blob], node.name)\n\n\t\t\t\tconst asset = await assetService.uploadAsset(file)\n\n\t\t\t\tif (asset) {\n\t\t\t\t\tassert(asset.properties?.image, \"Asset should have image properties\")\n\t\t\t\t\tconst assetReference = createAssetReferenceForImage({\n\t\t\t\t\t\tidentifier: getAssetFilename(asset),\n\t\t\t\t\t\tintrinsicSize: {\n\t\t\t\t\t\t\twidth: asset.properties.image.width,\n\t\t\t\t\t\t\theight: asset.properties.image.height,\n\t\t\t\t\t\t},\n\t\t\t\t\t})\n\t\t\t\t\tnode.fillImage = assetReference\n\t\t\t\t} else {\n\t\t\t\t\tnode.fillImage = undefined\n\t\t\t\t}\n\n\t\t\t\treportProgress()\n\t\t\t} catch (error) {\n\t\t\t\tnode.fillImage = undefined\n\n\t\t\t\t// biome-ignore lint/suspicious/noConsole: <explanation>\n\t\t\t\tconsole.warn(\"Error uploading image\", error)\n\t\t\t}\n\t\t}),\n\t)\n\n\tconst pasteResult = await pasteFigma(engine, figmaTree, position)\n\n\tif (pasteResult) {\n\t\tengine.scheduler.processWhenReady(() => {\n\t\t\tengine.stores.scopeStore.insertNodes(pasteResult.newNodes)\n\t\t\tengine.stores.selectionStore.set(pasteResult.newSelection, { switchToLayers: true, switchToProperties: true })\n\t\t})\n\t}\n\n\tif (!hasShownFigmaImportTutorial()) {\n\t\tengine.stores.modalStore.set({ type: ModalType.FigmaImportTutorial, source: \"clipboard_paste\" })\n\t\twindow.localStorage.setItem(SHOWED_FIGMA_IMPORT_TUTORIAL_MODAL, \"true\")\n\t}\n\n\ttoast({\n\t\t...action,\n\t\tvariant: \"success\",\n\t\ticon: \"success\",\n\t\tduration: 2500,\n\t\ttext: undefined,\n\t\tprimaryText: \"Imported layers\",\n\t\tsecondaryText: \"from Figma.\",\n\t})\n\n\trecord(\"figma_plugin_import\", {\n\t\tlayers: layerCount,\n\t\tdurationMs: Date.now() - startTime,\n\t})\n\n\treturn true\n}\n\nasync function pasteFigma(\n\tengine: VekterEngine,\n\tfigmaTree: FigmaClipboardData,\n\tposition: Point,\n): Promise<PasteResult | null> {\n\tconst activeScreen = engine.stores.selectionStore.commonGroundNodeId\n\tlet selection = engine.stores.selectionStore.ids\n\tconst activeScope = engine.stores.scopeStore.active\n\tif (selection.length === 0) {\n\t\tconst primaryBreakpoint = isWebPageNode(activeScope) ? activeScope.getPrimaryVariant() : null\n\t\tif (primaryBreakpoint) {\n\t\t\tselection = [primaryBreakpoint.id]\n\t\t}\n\t}\n\ttry {\n\t\tconst copyTree = CanvasTree.fromJS(figmaTree, engine.componentLoader)\n\t\tif (copyTree === null) return null\n\t\tconst pasteInfo = await pasteTree(\n\t\t\tengine,\n\t\t\tcopyTree,\n\t\t\temptyClipboardLayers,\n\t\t\tactiveScope,\n\t\t\tposition,\n\t\t\tselection,\n\t\t\tactiveScreen,\n\t\t\tfalse,\n\t\t\tundefined,\n\t\t)\n\t\treturn pasteInfo\n\t} catch (error) {\n\t\t// biome-ignore lint/suspicious/noConsole: <explanation>\n\t\tconsole.warn(\"Error parsing Figma clipboard data:\", error)\n\t\treturn null\n\t}\n}\n", "const className = \"ProseMirror\"\n\nexport function isFramerRichTextEditorElement(node: Element | null | undefined): boolean {\n\treturn Boolean(node?.classList.contains(className))\n}\n", "import type { VekterEngine } from \"document/VekterEngine.ts\"\nimport { addImagesToCanvas } from \"document/components/canvas/addImagesToCanvas.ts\"\nimport { CONTENT_MANAGEMENT_ID } from \"document/models/CanvasTree/nodes/ContentManagementNode.ts\"\nimport type { Point } from \"library/index.ts\"\nimport { isFramerRichTextEditorElement } from \"prosemirror/richTextEditorAttributes.ts\"\n\nexport async function imagesClipboardHandler(\n\tengine: VekterEngine,\n\tclipboardFiles: FileList | File[] | undefined,\n\tposition: Point,\n\tevent?: ClipboardEvent,\n): Promise<boolean> {\n\tif (!clipboardFiles || clipboardFiles.length === 0) return false\n\tif (engine.stores.scopeStore.active.id === CONTENT_MANAGEMENT_ID) {\n\t\tif (!isFramerRichTextEditorElement(document.activeElement)) {\n\t\t\tevent?.preventDefault()\n\t\t}\n\t\treturn true\n\t}\n\n\tevent?.preventDefault()\n\tawait addImagesToCanvas(engine, clipboardFiles, position, \"paste\")\n\treturn true\n}\n", "import type { VekterEngine } from \"document/VekterEngine.ts\"\nimport { addImagesToCanvas } from \"document/components/canvas/addImagesToCanvas.ts\"\nimport type { Point } from \"library/index.ts\"\nimport { parseSVG } from \"web/pages/project/lib/svg.ts\"\n\nexport async function svgClipboardHandler(\n\tengine: VekterEngine,\n\ttextClipboardData: string | undefined,\n\tposition: Point,\n): Promise<boolean> {\n\tif (!textClipboardData) return false\n\tlet isSVG = false\n\tif (textClipboardData.startsWith(\"<svg\")) {\n\t\tisSVG = true\n\t} else if (textClipboardData.includes(\"</svg>\")) {\n\t\tisSVG = !!parseSVG(textClipboardData)\n\t}\n\n\tif (!isSVG) return false\n\n\tconst file = new File([textClipboardData], \"graphic.svg\", { type: \"image/svg+xml\" })\n\tawait addImagesToCanvas(engine, [file], position, \"paste\")\n\treturn true\n}\n", "import { createAssetReference } from \"@framerjs/assets\"\nimport type { ExternalModuleExportIdentifier } from \"@framerjs/shared\"\nimport { Dictionary } from \"app/dictionary.ts\"\nimport type { VekterEngine } from \"document/VekterEngine.ts\"\nimport { CodeComponentNode } from \"document/models/CanvasTree/index.ts\"\nimport { prefixControlProps } from \"document/models/controlProps/controlPropKey.ts\"\nimport type { Point } from \"library/render/types/Point.ts\"\nimport { ControlType } from \"library/render/types/PropertyControls.ts\"\nimport { BatchAssetUploader } from \"web/lib/BatchAssetUploader.ts\"\nimport type { VideoUploadResult } from \"web/pages/project/lib/UploadService.ts\"\nimport { isVideoUploadResult } from \"web/pages/project/lib/UploadService.ts\"\nimport { defaultGetVideoModuleIdentifier } from \"../chrome/insertSidebar/dataSources/items/mediaItems.ts\"\nimport { insertComponent } from \"../utils/insertComponent.ts\"\n\nexport async function addVideosToCanvas(\n\tengine: VekterEngine,\n\tfiles: FileList | File[],\n\tdestinationCoordinates: Point,\n\tsource: \"drop\" | \"menu\" | \"paste\",\n\tgetVideoModuleIdentifier: () => ExternalModuleExportIdentifier | undefined = defaultGetVideoModuleIdentifier,\n) {\n\tif (!files || files.length === 0) return\n\tconst uploader = new BatchAssetUploader(engine)\n\tfor (const file of files) {\n\t\tvoid uploader.add(file)\n\t}\n\tconst uploadedVideos = (await uploader.results()).filter(isVideoUploadResult)\n\tconst positions = getVideoPositions(destinationCoordinates, uploadedVideos)\n\tconst moduleIdentifier = getVideoModuleIdentifier()\n\tif (!moduleIdentifier) return\n\n\tlet selectedVideoId: string | null = null\n\tuploadedVideos.forEach((fileInfo, index) => {\n\t\tconst assetReference = createAssetReference(fileInfo.filename, null, fileInfo.originalFilename)\n\t\tconst videoComponent = new CodeComponentNode({\n\t\t\tcodeComponentIdentifier: moduleIdentifier.value,\n\t\t\twidth: fileInfo.dimensions.width / window.devicePixelRatio,\n\t\t\theight: fileInfo.dimensions.height / window.devicePixelRatio,\n\t\t\t...prefixControlProps({\n\t\t\t\tsrcFile: {\n\t\t\t\t\ttype: ControlType.File,\n\t\t\t\t\tvalue: assetReference,\n\t\t\t\t},\n\t\t\t\tsrcType: {\n\t\t\t\t\ttype: ControlType.Enum,\n\t\t\t\t\tvalue: Dictionary.Upload,\n\t\t\t\t},\n\t\t\t}),\n\t\t})\n\n\t\t// If we're adding multiple videos, select the first one\n\t\tif (uploadedVideos.length > 1 && index === 0) {\n\t\t\tselectedVideoId = videoComponent.id\n\t\t}\n\n\t\tengine.scheduler.processWhenReady(() =>\n\t\t\tinsertComponent({\n\t\t\t\tengine,\n\t\t\t\tcomponent: videoComponent,\n\t\t\t\tcanvasPoint: positions[index] ?? destinationCoordinates,\n\t\t\t\tsource: \"insert_panel\",\n\t\t\t\tnotDraggedOntoCanvas: source !== \"drop\",\n\t\t\t}),\n\t\t)\n\t})\n\tif (selectedVideoId) {\n\t\tengine.stores.selectionStore.set(selectedVideoId, { switchToProperties: true })\n\t}\n}\n\nfunction getVideoPositions(destinationPoint: Point, videos: VideoUploadResult[]): Point[] {\n\tlet destinationPointX = destinationPoint.x\n\tconst positions: Point[] = videos.map((video, index) => {\n\t\tconst videoWidth = video.dimensions.width / window.devicePixelRatio\n\t\tconst offset = index === 0 ? videoWidth / 2 : 0\n\t\tconst newDestination: Point = {\n\t\t\tx: destinationPointX + videoWidth / 2 - offset,\n\t\t\ty: destinationPoint.y,\n\t\t}\n\t\tdestinationPointX += videoWidth - offset\n\t\treturn newDestination\n\t})\n\treturn positions\n}\n", "import type { VekterEngine } from \"document/VekterEngine.ts\"\nimport { addVideosToCanvas } from \"document/components/canvas/addVideosToCanvas.ts\"\nimport { CONTENT_MANAGEMENT_ID } from \"document/models/CanvasTree/nodes/ContentManagementNode.ts\"\nimport type { Point } from \"library/index.ts\"\nimport { isFramerRichTextEditorElement } from \"prosemirror/richTextEditorAttributes.ts\"\n\nexport async function videosClipboardHandler(\n\tengine: VekterEngine,\n\tclipboardFiles: FileList | File[] | undefined,\n\tposition: Point,\n\tevent?: ClipboardEvent,\n): Promise<boolean> {\n\tif (!clipboardFiles || clipboardFiles.length === 0) return false\n\tif (engine.stores.scopeStore.active.id === CONTENT_MANAGEMENT_ID) {\n\t\tif (!isFramerRichTextEditorElement(document.activeElement)) {\n\t\t\tevent?.preventDefault()\n\t\t}\n\t\treturn true\n\t}\n\n\tevent?.preventDefault()\n\tawait addVideosToCanvas(engine, clipboardFiles, position, \"paste\")\n\treturn true\n}\n", "import { toast } from \"web/lib/toaster.ts\"\n\nexport function showCopyFailToast() {\n\ttoast({\n\t\ttype: \"add\",\n\t\tvariant: \"warning\",\n\t\ticon: \"warning\",\n\t\tkey: \"selected-layers-cannot-be-copied\",\n\t\tprimaryText: \"Selected layers\",\n\t\tsecondaryText: \"can\u2019t be copied.\",\n\t})\n}\n", "import type { ComponentLoader } from \"@framerjs/framer-runtime\"\nimport { isFirefox, isSafari } from \"@framerjs/shared\"\nimport type { VekterEngine } from \"document/VekterEngine.ts\"\nimport { CanvasTree } from \"document/models/CanvasTree/index.ts\"\nimport { isCollectionNode } from \"document/models/CanvasTree/nodes/utils/nodeCheck.ts\"\nimport { isObject } from \"utils/typeChecks.ts\"\nimport { clipboardRead } from \"../clipboard.ts\"\nimport { isFramerLayersClipboardData } from \"./isFramerLayersClipboardData.ts\"\nimport { framerLayersClipboardHandler } from \"./layers.ts\"\nimport type { FramerLayersClipboardData } from \"./types.ts\"\n\nfunction doesFramerLayersClipboardDataContainCollectionNode(\n\tcomponentLoader: ComponentLoader,\n\tdata: FramerLayersClipboardData,\n): boolean {\n\t// TODO: It would be better to distinguish CMS pasted data by having a new clipboard type,\n\t// eg: application/x-framer-contentmanagement. Then we can avoid this unnecessary double-parsing\n\t// if the layers tree.\n\tconst copyTree = CanvasTree.fromJS(data.layers.tree, componentLoader)\n\tif (!copyTree) return false\n\n\treturn copyTree.root.children.some(isCollectionNode)\n}\n\nexport async function framerCollectionsClipboardHandler(engine: VekterEngine, data: unknown): Promise<boolean> {\n\tif (!data) return false\n\tif (!isFramerLayersClipboardData(data)) return false\n\tif (!doesFramerLayersClipboardDataContainCollectionNode(engine.componentLoader, data)) return false\n\n\tconst position = engine.stores.canvasStore.getViewportCenterTakingOverlaysIntoAccount()\n\tawait framerLayersClipboardHandler({ engine, layersData: data, position })\n\n\treturn true\n}\n\nexport async function canPasteCollections(componentLoader: ComponentLoader): Promise<boolean> {\n\t// In Safari and Firefox we cannot access the clipboard on right-click. Normally we use\n\t// `canReadClipboard` to check this case, but in the context of the CMS the user may have\n\t// CSV in their clipboard which came from outside Framer. In this case Safari / Firefox will\n\t// display an OS native \"Paste\" popup in MacOS which we want to avoid as much as possible.\n\tif (isSafari()) return true\n\tif (isFirefox()) return true\n\n\tconst clipboardData = await clipboardRead([\"application/x-framer-layers\", \"text/plain\"])\n\tif (!isObject(clipboardData)) return false\n\n\tconst framerLayers = clipboardData[\"application/x-framer-layers\"]\n\tif (isFramerLayersClipboardData(framerLayers)) {\n\t\treturn doesFramerLayersClipboardDataContainCollectionNode(componentLoader, framerLayers)\n\t}\n\n\treturn false\n}\n", "import { parseNumberRounded } from \"@framerjs/shared\"\nimport { Color, isEqual } from \"library/index.ts\"\nimport type { BorderStyle } from \"library/render/style/BorderComponent.tsx\"\nimport { isString } from \"utils/typeChecks.ts\"\nimport type { WithBorder } from \"../WithBorder.ts\"\n\nconst supportedBorderStyles = new Set([\"solid\", \"dashed\", \"dotted\", \"double\"])\n\ninterface Border {\n\tstyle: BorderStyle\n\twidth: number\n\tcolor: string\n}\n\nfunction isBorderStyle(value: unknown): value is BorderStyle {\n\treturn isString(value) && supportedBorderStyles.has(value)\n}\n\n/**\n * When the value provided is the result of\n * getComputedStyle(el).border(Top|Right|Bottom|Left), this naive approach to\n * parsing is safe.\n */\nfunction parseBorder(value: string | undefined): Border | undefined {\n\tif (!value) return undefined\n\n\tconst [width, style = \"solid\", color = \"rgb(0, 0, 0)\"] = value.replaceAll(\", \", \",\").split(\" \", 3)\n\tconst parsedWidth = parseNumberRounded(width)\n\tif (!parsedWidth || parsedWidth === 0 || style === \"none\") return undefined\n\n\tconst parsedColor = Color(color)\n\tif (!parsedColor || parsedColor.a === 0) return undefined\n\n\treturn {\n\t\twidth: parsedWidth,\n\t\tcolor,\n\t\tstyle: isBorderStyle(style) ? style : \"solid\",\n\t}\n}\n\nfunction getBorderPerSideColorAndStyle(borders: (Border | undefined)[]) {\n\tfor (const border of borders) {\n\t\tif (border && border.width > 0) return border\n\t}\n}\n\nexport function parseBorderFromStyle(style: CSSStyleDeclaration): Partial<WithBorder> | undefined {\n\tconst values = [style.borderTop, style.borderRight, style.borderBottom, style.borderLeft]\n\n\tconst parsedValues = values.map(parseBorder)\n\n\tconst [top, ...rest] = parsedValues\n\n\tif (top && rest.every(border => isEqual(border, top))) {\n\t\treturn {\n\t\t\tborderEnabled: true,\n\t\t\tborderColor: top.color,\n\t\t\tborderWidth: top.width,\n\t\t\tborderStyle: top.style,\n\t\t}\n\t}\n\n\tconst firstVisibleBorder = getBorderPerSideColorAndStyle(parsedValues)\n\tif (!firstVisibleBorder) return\n\n\tconst { color: borderColor, style: borderStyle } = firstVisibleBorder\n\n\treturn {\n\t\tborderEnabled: true,\n\t\tborderPerSide: true,\n\t\tborderColor,\n\t\tborderStyle,\n\t\tborderTop: top?.width ?? 0,\n\t\tborderRight: parsedValues[1]?.width ?? 0,\n\t\tborderBottom: parsedValues[2]?.width ?? 0,\n\t\tborderLeft: parsedValues[3]?.width ?? 0,\n\t}\n}\n", "import { isConicGradient } from \"document/models/ConicGradientClass.ts\"\nimport { isLinearGradient } from \"document/models/LinearGradientClass.ts\"\nimport { isRadialGradient } from \"document/models/RadialGradientClass.ts\"\nimport { parseGradient } from \"document/utils/parseGradient.ts\"\nimport type { WithOptionalFill } from \"../WithFill.ts\"\n\nconst transparent = \"rgba(0, 0, 0, 0)\"\nexport function parseFillFromStyle(style: CSSStyleDeclaration): Partial<WithOptionalFill> | undefined {\n\tconst background = style.backgroundImage ?? style.background\n\tconst gradient = background ? parseGradient(background) : undefined\n\tif (isRadialGradient(gradient)) {\n\t\treturn {\n\t\t\tfillEnabled: true,\n\t\t\tfillType: \"radial-gradient\",\n\t\t\tfillRadialGradient: gradient,\n\t\t}\n\t}\n\n\tif (isLinearGradient(gradient)) {\n\t\treturn {\n\t\t\tfillEnabled: true,\n\t\t\tfillType: \"linear-gradient\",\n\t\t\tfillLinearGradient: gradient,\n\t\t}\n\t}\n\n\tif (isConicGradient(gradient)) {\n\t\treturn {\n\t\t\tfillEnabled: true,\n\t\t\tfillType: \"conic-gradient\",\n\t\t\tfillConicGradient: gradient,\n\t\t}\n\t}\n\n\tconst fillEnabled = style.backgroundColor && style.backgroundColor !== transparent\n\tif (!fillEnabled) return\n\n\tconst fill: Partial<WithOptionalFill> = {\n\t\tfillEnabled: true,\n\t\tfillType: \"color\",\n\t\tfillColor: style.backgroundColor,\n\t\tfillConicGradient: undefined,\n\t\tfillLinearGradient: undefined,\n\t\tfillRadialGradient: undefined,\n\t}\n\treturn fill\n}\n", "import type { Overflow } from \"../WithOverflow.ts\"\n\n// We can't use WithOverflow trait here because it includes DynamicValue, which\n// is not relevant for parsing the overflow.\ninterface OverflowParseResult {\n\toverflow: Overflow | undefined\n\toverflowX: Overflow | undefined\n\toverflowY: Overflow | undefined\n}\n\nexport function parseOverflowFromStyle(style: CSSStyleDeclaration): Partial<OverflowParseResult> | undefined {\n\tconst value = style.overflow\n\tif (!value) return undefined\n\n\tswitch (value) {\n\t\tcase \"hidden\":\n\t\t\treturn { overflow: \"hidden\" }\n\t\tcase \"clip\":\n\t\t\treturn { overflow: \"clip\" }\n\t\tcase \"visible\":\n\t\t\treturn { overflow: \"visible\" }\n\t\tcase \"auto\":\n\t\tcase \"scroll\":\n\t\t\treturn { overflow: \"auto\" }\n\t\tdefault:\n\t\t\treturn undefined\n\t}\n}\n", "import { parseNumberRounded } from \"@framerjs/shared\"\nimport { camelCaseCSS } from \"utils/parseStyleToJS.ts\"\nimport { isUndefined } from \"utils/typeChecks.ts\"\nimport type { WithFilters } from \"../WithFilters.ts\"\nimport { filterDefaults } from \"../WithFilters.ts\"\n\nconst percentFilters = new Set([\"brightness\", \"contrast\", \"grayscale\", \"invert\", \"saturate\", \"sepia\"])\n\nexport function parseFiltersFromStyle(style: CSSStyleDeclaration): Partial<WithFilters> | undefined {\n\tconst value = style.filter\n\tif (!value || value === \"none\") return\n\n\tconst values: Partial<WithFilters> = {}\n\tfor (const filter of style.filter.split(\" \")) {\n\t\tconst [key, value] = filter.split(\"(\", 2)\n\t\tconst parsed = parseNumberRounded(value)\n\t\tif (isUndefined(parsed)) continue\n\t\tconst camelCaseKey = camelCaseCSS(key)\n\t\tif (!(camelCaseKey in filterDefaults)) continue\n\n\t\tif (value?.endsWith(\"%)\") || !percentFilters.has(camelCaseKey)) {\n\t\t\tvalues[camelCaseKey] = parsed\n\t\t} else {\n\t\t\tvalues[camelCaseKey] = parsed * 100\n\t\t}\n\t}\n\n\treturn values\n}\n", "import { parseNumberRounded } from \"@framerjs/shared\"\nimport type { WithBlending } from \"document/models/CanvasTree/traits/WithBlending.ts\"\nimport { isBlendingModeValue } from \"document/models/CanvasTree/traits/WithBlending.ts\"\nimport type { WithCursor } from \"document/models/CanvasTree/traits/WithCursor.ts\"\nimport type { WithFilters } from \"document/models/CanvasTree/traits/WithFilters.ts\"\nimport { type WithImageRendering, isImageRenderingValue } from \"document/models/CanvasTree/traits/WithImageRendering.ts\"\nimport type { WithOpacity } from \"document/models/CanvasTree/traits/WithOpacity.ts\"\nimport type { WithPointerEvents } from \"document/models/CanvasTree/traits/WithPointerEvents.ts\"\nimport { isPointerEventsValue } from \"document/models/CanvasTree/traits/WithPointerEvents.ts\"\nimport type { WithUserSelect } from \"document/models/CanvasTree/traits/WithUserSelect.ts\"\nimport { isUserSelectValue } from \"document/models/CanvasTree/traits/WithUserSelect.ts\"\nimport type { WithZIndex } from \"document/models/CanvasTree/traits/WithZIndex.ts\"\nimport { parseFiltersFromStyle } from \"document/models/CanvasTree/traits/utils/parseFiltersFromStyle.ts\"\n\nexport function getStyleFromCSS(style: CSSStyleDeclaration) {\n\tconst properties: Partial<\n\t\tWithOpacity &\n\t\t\tWithZIndex &\n\t\t\tWithBlending &\n\t\t\tWithCursor &\n\t\t\tWithPointerEvents &\n\t\t\tWithUserSelect &\n\t\t\tWithFilters &\n\t\t\tWithImageRendering\n\t> = {\n\t\t...parseFiltersFromStyle(style),\n\t}\n\n\tif (style.opacity) {\n\t\tproperties.opacity = parseNumberRounded(style.opacity)\n\t}\n\n\tif (style.zIndex) {\n\t\tconst value = parseNumberRounded(style.zIndex)\n\t\tif (value) properties.zIndex = Math.max(Math.min(value, 10), -1)\n\t}\n\n\tif (isBlendingModeValue(style.mixBlendMode) && style.mixBlendMode !== \"normal\") {\n\t\tproperties.blendingMode = style.mixBlendMode\n\t}\n\n\tif (isPointerEventsValue(style.pointerEvents) && style.mixBlendMode !== \"auto\") {\n\t\tproperties.pointerEvents = style.pointerEvents\n\t}\n\n\tif (isUserSelectValue(style.userSelect) && style.mixBlendMode !== \"auto\") {\n\t\tproperties.userSelect = style.userSelect\n\t}\n\n\tif (isImageRenderingValue(style.imageRendering)) {\n\t\tproperties.imageRendering = style.imageRendering\n\t}\n\n\treturn properties\n}\n", "import { parsePaddingString } from \"library/components/utils/paddingFromProps.ts\"\nimport type { NonDynamicValueRecord } from \"../DynamicValue.ts\"\nimport type { WithPadding } from \"../WithPadding.ts\"\n\nexport function parsePaddingFromStyle(\n\tstyle: CSSStyleDeclaration,\n): Partial<NonDynamicValueRecord<WithPadding>> | undefined {\n\tconst padding = parsePaddingString(style.padding)\n\tif (padding === null) return\n\n\tconst allPaddingsEqual =\n\t\tpadding.top === padding.right && padding.right === padding.bottom && padding.bottom === padding.left\n\tif (allPaddingsEqual) {\n\t\tif (padding.top === 0) return\n\t\treturn {\n\t\t\tpadding: padding.top,\n\t\t}\n\t}\n\n\treturn {\n\t\tpaddingPerSide: true,\n\t\tpaddingTop: padding.top,\n\t\tpaddingRight: padding.right,\n\t\tpaddingBottom: padding.bottom,\n\t\tpaddingLeft: padding.left,\n\t}\n}\n", "import { REGULAR_FONT_WEIGHT } from \"@framerjs/app-shared\"\nimport { assert } from \"@framerjs/shared\"\nimport type { WebFontStore } from \"document/stores/WebFontStore.ts\"\n\nconst fontWeightNames = {\n\t\"100\": \"Thin\",\n\t\"200\": \"Extra Light\",\n\t\"300\": \"Light\",\n\t\"400\": \"Normal\",\n\t\"500\": \"Medium\",\n\t\"600\": \"Semi Bold\",\n\t\"700\": \"Bold\",\n\t\"800\": \"Extra Bold\",\n\t\"900\": \"Black\",\n}\n\nconst systemFonts = new Set([\n\t\"ui-sans-serif\",\n\t\"system-ui\",\n\t\"-apple-system\",\n\t\"Segoe UI\",\n\t\"SF Pro Display\",\n\t\"SF Pro Text\",\n\t\"sans-serif\",\n\t\"BlinkMacSystemFont\",\n\t\"Helvetica Neue\",\n\t\"Arial\",\n\t\"system-ui\",\n\t\"-apple-system\",\n\t\"BlinkMacSystemFont\",\n\t\"Segoe UI\",\n\t\"Roboto\",\n\t\"Oxygen\",\n\t\"Ubuntu\",\n\t\"Cantarell\",\n\t\"Fira Sans\",\n\t\"Droid Sans\",\n\t\"Helvetica Neue\",\n\t\"sans-serif\",\n])\n\nfunction normalizeFontFamily(fontFamily: string): string {\n\treturn fontFamily.toLowerCase().replaceAll(\"-\", \" \").replaceAll(\"_\", \" \")\n}\n\nconst fontMatchCache: Record<string, google.fonts.WebfontFamily> = {}\nasync function matchGoogleFontCached(webFontStore: WebFontStore, fontFamily: string) {\n\t// Return a cached result to avoid performing the same lookup repeatedly\n\t// against 2k fonts.\n\tif (fontMatchCache[fontFamily]) return fontMatchCache[fontFamily]\n\n\tconst candidate = normalizeFontFamily(fontFamily)\n\tconst oneWordCandidate = candidate.replaceAll(\" \", \"\")\n\tconst candidates: google.fonts.WebfontFamily[] = []\n\n\tconst googleWebFonts = webFontStore.googleWebFonts?.staticFonts\n\tassert(googleWebFonts, \"Google web fonts must be loaded\")\n\tfor (const font of googleWebFonts) {\n\t\tif (!font) continue\n\t\tconst family = font.family.toLowerCase()\n\t\tif (family === candidate) return (fontMatchCache[fontFamily] = font)\n\t\tif (family.startsWith(candidate)) candidates.push(font)\n\t\tconst oneWordFamily = family.replaceAll(\" \", \"\")\n\t\tif (oneWordFamily === oneWordCandidate || oneWordFamily.startsWith(oneWordCandidate)) {\n\t\t\tcandidates.push(font)\n\t\t}\n\t}\n\n\tconst [result] = candidates\n\tif (!result) return false\n\n\t// @TODO - If there are multiple candidates this doesn't return the best\n\t// match.\n\treturn (fontMatchCache[fontFamily] = result)\n}\n\nexport async function parseFontFromStyle(webFontStore: WebFontStore, style: CSSStyleDeclaration) {\n\tlet fontFamily = style.fontFamily.split(\",\")[0]?.replaceAll('\"', \"\") || style.fontFamily\n\tconst fontWeight = (style.fontWeight as keyof typeof fontWeightNames) || `${REGULAR_FONT_WEIGHT}`\n\tif (systemFonts.has(fontFamily)) {\n\t\tfontFamily = `__SystemDefault-${fontWeight}-normal__`\n\t} else {\n\t\t// remove quotes\n\t\tfontFamily = fontFamily.replace(/['\"]/gu, \"\")\n\t\tfontFamily = fontFamily.replaceAll(\"_\", \" \")\n\t\tfontFamily = fontFamily.trim()\n\t\tlet googleFont = await matchGoogleFontCached(webFontStore, fontFamily)\n\t\tconst fontWeightName = fontWeightNames[fontWeight] || fontWeight\n\n\t\tif (!googleFont) {\n\t\t\tif (style.fontFamily.endsWith(\"sans-serif\")) {\n\t\t\t\tgoogleFont = await matchGoogleFontCached(webFontStore, \"Inter\")\n\t\t\t} else if (style.fontFamily.endsWith(\"serif\")) {\n\t\t\t\tgoogleFont = await matchGoogleFontCached(webFontStore, \"Roboto Serif\")\n\t\t\t} else if (style.fontFamily.endsWith(\"monospace\")) {\n\t\t\t\tgoogleFont = await matchGoogleFontCached(webFontStore, \"Roboto Mono\")\n\t\t\t} else {\n\t\t\t\t// Always fallback to Inter.\n\t\t\t\tgoogleFont = await matchGoogleFontCached(webFontStore, \"Inter\")\n\t\t\t}\n\t\t}\n\n\t\tif (googleFont) {\n\t\t\tfontFamily = `GF;${googleFont.family}`\n\t\t\tif (googleFont.variants.includes(fontWeight)) {\n\t\t\t\tfontFamily = `GF;${googleFont.family}-${fontWeight}`\n\t\t\t} else if (googleFont.variants.includes(fontWeightName)) {\n\t\t\t\tfontFamily = `GF;${googleFont.family}-${fontWeightName}`\n\t\t\t} else if (googleFont.variants.includes(\"regular\")) {\n\t\t\t\tfontFamily = `GF;${googleFont.family}-regular`\n\t\t\t} else if (googleFont.variants.includes(\"normal\")) {\n\t\t\t\tfontFamily = `GF;${googleFont.family}-normal`\n\t\t\t}\n\t\t}\n\t}\n\n\treturn fontFamily\n}\n", "import { isNumber } from \"@framerjs/assets/src/utils.ts\"\nimport { isEmptyObject } from \"@framerjs/shared\"\nimport type { VekterEngine } from \"document/VekterEngine.ts\"\nimport { FrameNode, RichTextNode } from \"document/models/CanvasTree/index.ts\"\nimport type { WithLayout } from \"document/models/CanvasTree/traits/WithLayout.ts\"\nimport type { WithOverflow } from \"document/models/CanvasTree/traits/WithOverflow.ts\"\nimport type { WithPins } from \"document/models/CanvasTree/traits/WithPins.ts\"\nimport type { WithTextVerticalAlignment } from \"document/models/CanvasTree/traits/WithTextVerticalAlignment.ts\"\nimport { parseOverflowFromStyle } from \"document/models/CanvasTree/traits/utils/parseOverflowFromStyle.ts\"\nimport { parsePaddingFromStyle } from \"document/models/CanvasTree/traits/utils/parsePaddingFromStyle.ts\"\nimport { DimensionType } from \"library/index.ts\"\nimport { getStyleFromCSS } from \"./genericStyleFromCSS.ts\"\nimport { parseFontFromStyle } from \"./parseFont.ts\"\n\nconst alignItemsMap = {\n\t\"flex-start\": \"top\",\n\tstart: \"top\",\n\t\"flex-end\": \"bottom\",\n\tend: \"bottom\",\n\tcenter: \"center\",\n}\n\nfunction textVerticalAlignment(style: CSSStyleDeclaration): WithTextVerticalAlignment | undefined {\n\tif (!style.alignItems) return\n\tconst alignment = alignItemsMap[style.alignItems]\n\tif (alignment) return { textVerticalAlignment: alignment }\n}\n\nconst stackEnabledDefaults: Partial<WithLayout> = {\n\tlayout: \"stack\",\n\tstackAlignment: \"center\",\n\tstackDirection: \"vertical\",\n\tstackDistribution: \"center\",\n\tstackWrapEnabled: false,\n\tgap: 0,\n}\n\nconst allowedTags = new Set([\"p\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"])\n\nexport async function createTextNode(\n\tengine: VekterEngine,\n\telement: Element,\n\tproperties: Partial<FrameNode>,\n\tposition: Partial<WithPins & WithOverflow>,\n) {\n\tif (!element.innerHTML) return []\n\n\tconst style: CSSStyleDeclaration = (element as HTMLElement).style\n\n\tconst tag = element.tagName.toLowerCase()\n\tconst styleTag = allowedTags.has(tag) ? tag : \"p\"\n\n\tconst textNode = new RichTextNode({\n\t\thtml: `<${styleTag}>${element.innerHTML}</${styleTag}>`,\n\t\t...position,\n\t\theightType: DimensionType.Auto,\n\t\t...getStyleFromCSS(style),\n\t\t...textVerticalAlignment(style),\n\t})\n\n\tif (style.fontFamily) {\n\t\t// grab the first font family\n\t\tconst fontFamily = await parseFontFromStyle(engine.stores.webFontStore, style)\n\t\ttextNode.setFont(fontFamily, false)\n\t}\n\n\tif (style.color) {\n\t\ttextNode.setTextColor(style.color, false)\n\t}\n\n\tif (style.fontSize) {\n\t\tconst value = parseFloat(style.fontSize)\n\t\tif (isNumber(value)) textNode.setFontSize(value, false)\n\t}\n\n\tif (style.letterSpacing) {\n\t\tconst value = parseFloat(style.letterSpacing)\n\t\tif (isNumber(value)) textNode.setLetterSpacing([value, \"px\"], false)\n\t}\n\n\tif (style.textTransform) {\n\t\ttextNode.setTextTransform(style.textTransform as any, false)\n\t}\n\n\tif (style.textDecorationLine) {\n\t\ttextNode.setTextDecoration(style.textDecorationLine as any, false)\n\t}\n\n\tif (style.lineHeight) {\n\t\tconst value = parseFloat(style.lineHeight)\n\t\tif (isNumber(value)) textNode.setLineHeight([value, \"px\"], false)\n\t}\n\n\tif (style.textAlign) {\n\t\ttextNode.setTextAlignment(style.textAlign as any, false)\n\t}\n\n\t// If some layout properties are provided, we must wrap the RichTextNode in\n\t// a Frame, this allows styles like background-color or border-radius that\n\t// can be set on text in html to exist in Framer.\n\tif (!isEmptyObject(properties)) {\n\t\tconst padding = parsePaddingFromStyle(style)\n\t\tconst topPadding = padding?.padding ?? padding?.paddingTop ?? 0\n\t\tconst leftPadding = padding?.padding ?? padding?.paddingLeft ?? 0\n\t\tconst { top, left, width, height } = position\n\t\tconst frame = new FrameNode({\n\t\t\ttop: (top ?? 0) - topPadding,\n\t\t\tleft: (left ?? 0) - leftPadding,\n\t\t\twidthType: padding ? DimensionType.Auto : DimensionType.FixedNumber,\n\t\t\theightType: padding ? DimensionType.Auto : DimensionType.FixedNumber,\n\t\t\twidth,\n\t\t\theight,\n\t\t\tfillEnabled: false,\n\t\t\t...parseOverflowFromStyle(style),\n\t\t\t...padding,\n\t\t\t...(padding ? stackEnabledDefaults : undefined),\n\t\t\t...properties,\n\t\t})\n\t\ttextNode.set({ top: 0, left: 0 })\n\t\tframe.addChild(textNode)\n\t\treturn [frame]\n\t}\n\n\treturn [textNode]\n}\n", "import { assert } from \"@framerjs/document-migrations/src/utils/assert.ts\"\nimport { ResolvablePromise } from \"@framerjs/shared\"\nimport type { VekterEngine } from \"document/VekterEngine.ts\"\nimport { optimizeSVG } from \"document/components/canvas/addImagesToCanvas.ts\"\nimport { withIntrinsicSize } from \"document/components/chrome/insertSidebar/types.ts\"\nimport type { CanvasNode, FrameNode } from \"document/models/CanvasTree/index.ts\"\nimport { SVGNode } from \"document/models/CanvasTree/index.ts\"\nimport { fillImageFitFromObjectFit } from \"document/models/CanvasTree/traits/WithFill.ts\"\nimport type { WithPins } from \"document/models/CanvasTree/traits/WithPins.ts\"\nimport { isPinnable } from \"document/models/CanvasTree/traits/WithPins.ts\"\nimport { createAssetReferenceForUploadImageResult } from \"document/utils/createAssetReferenceFromImageUpload.ts\"\nimport type { CSSProperties } from \"react\"\nimport { isNumber } from \"utils/typeChecks.ts\"\nimport { BatchAssetUploader } from \"web/lib/BatchAssetUploader.ts\"\nimport { imageSizeToNonZero } from \"web/lib/images/image.ts\"\nimport { extensionsToMimeType } from \"web/lib/images/supportedFormats.ts\"\nimport { isImageUploadResult } from \"web/pages/project/lib/UploadService.ts\"\nimport { shouldUploadSvgAsImageFill } from \"web/pages/project/lib/svg.ts\"\n\nfunction isSVG(element: Element) {\n\treturn element.tagName === \"svg\"\n}\n\nfunction aspectRatioFromAttributes(attributes: any) {\n\tif (!withIntrinsicSize(attributes)) return null\n\tconst { intrinsicWidth, intrinsicHeight } = attributes\n\tif (!isNumber(intrinsicWidth) || !isNumber(intrinsicHeight)) return null\n\treturn intrinsicWidth / intrinsicHeight\n}\n\nexport async function uploadImageAndReplacePlaceholder(\n\tengine: VekterEngine,\n\telement: HTMLElement,\n\tplaceholder: CanvasNode,\n\tposition: Partial<WithPins>,\n) {\n\tconst promise = new ResolvablePromise<void>()\n\tconst uploader = new BatchAssetUploader(engine, { silent: true })\n\n\ttry {\n\t\tif (isSVG(element)) {\n\t\t\telement.setAttribute(\"style\", \"\")\n\t\t\tconst blob = new Blob([element.outerHTML], { type: extensionsToMimeType.get(\"svg\") })\n\t\t\tconst file = new File([blob], \"SVG\", { type: blob.type })\n\t\t\tconst svgText = await file.text()\n\n\t\t\t// If the SVG can be inlined, add the node. Otherwise fall\n\t\t\t// through the file upload and treat the SVG like an image.\n\t\t\tif (!shouldUploadSvgAsImageFill(svgText)) {\n\t\t\t\tconst svg = await optimizeSVG(blob)\n\n\t\t\t\tengine.scheduler.processWhenReady(() => {\n\t\t\t\t\tconst latest = engine.tree.get(placeholder.id)\n\t\t\t\t\tif (!latest) return\n\n\t\t\t\t\tassert(\n\t\t\t\t\t\tisPinnable(latest),\n\t\t\t\t\t\t\"uploadImageAndReplacePlaceholder: Placeholder must exist and be pinnable to replace with an SVG.\",\n\t\t\t\t\t)\n\n\t\t\t\t\tconst index = engine.tree.getIndex(placeholder)\n\t\t\t\t\tconst { width = 0, height = 0 } = position\n\t\t\t\t\tengine.tree.insertNode(\n\t\t\t\t\t\tnew SVGNode({\n\t\t\t\t\t\t\tleft: latest.left,\n\t\t\t\t\t\t\ttop: latest.top,\n\t\t\t\t\t\t\tright: latest.right,\n\t\t\t\t\t\t\twidth: latest.width,\n\t\t\t\t\t\t\theight: latest.height,\n\t\t\t\t\t\t\twidthType: latest.widthType,\n\t\t\t\t\t\t\theightType: latest.heightType,\n\t\t\t\t\t\t\tcenterAnchorX: latest.centerAnchorX,\n\t\t\t\t\t\t\tintrinsicHeight: height,\n\t\t\t\t\t\t\tintrinsicWidth: width,\n\t\t\t\t\t\t\tsvg,\n\t\t\t\t\t\t\taspectRatio: width / height,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tengine.tree.getParentId(placeholder),\n\t\t\t\t\t\tindex,\n\t\t\t\t\t)\n\t\t\t\t\tengine.tree.removeNode(placeholder)\n\t\t\t\t\tpromise.resolve()\n\t\t\t\t})\n\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvoid uploader.add(file)\n\t\t} else {\n\t\t\tconst src = element.getAttribute(\"src\")\n\t\t\tassert(src, \"uploadImageAndReplacePlaceholder: Must have a src string for an image.\")\n\t\t\tvoid uploader.add(src)\n\t\t}\n\n\t\tconst [imageUploadResult] = (await uploader.results()).filter(isImageUploadResult)\n\n\t\tassert(imageUploadResult, \"uploadImageAndReplacePlaceholder: Must be able to upload an image.\")\n\n\t\tconst { originalFilename, imageSize } = imageUploadResult\n\n\t\t// Non-zero as to have something visible\n\t\tconst { nonZeroNaturalWidth, nonZeroNaturalHeight } = imageSizeToNonZero(imageSize)\n\n\t\tconst elementStyle: CSSStyleDeclaration = element.style\n\n\t\tengine.scheduler.processWhenReady(() => {\n\t\t\tengine.tree.get<FrameNode>(placeholder.id)?.set({\n\t\t\t\taspectRatio: aspectRatioFromAttributes({\n\t\t\t\t\tintrinsicWidth: nonZeroNaturalWidth,\n\t\t\t\t\tintrinsicHeight: nonZeroNaturalHeight,\n\t\t\t\t}),\n\t\t\t\tfillImage: createAssetReferenceForUploadImageResult(imageUploadResult),\n\t\t\t\tfillImageOriginalName: originalFilename,\n\t\t\t\tfillEnabled: true,\n\t\t\t\tfillType: \"image\",\n\t\t\t\taltAttribute: element.getAttribute(\"alt\") || undefined,\n\t\t\t\tfillImageResize: fillImageFitFromObjectFit(elementStyle.objectFit as CSSProperties[\"objectFit\"]),\n\t\t\t\tintrinsicWidth: nonZeroNaturalWidth,\n\t\t\t\tintrinsicHeight: nonZeroNaturalHeight,\n\t\t\t\tfillImagePixelWidth: nonZeroNaturalWidth,\n\t\t\t\tfillImagePixelHeight: nonZeroNaturalHeight,\n\t\t\t})\n\t\t\tpromise.resolve()\n\t\t})\n\t} catch {\n\t\t// In the event we can't insert a valid image for *any* reason,\n\t\t// remove the placeholder.\n\t\tengine.scheduler.processWhenReady(() => {\n\t\t\tengine.tree.remove(placeholder.id)\n\t\t\tpromise.resolve()\n\t\t})\n\t}\n\n\treturn promise\n}\n", "import { parseNumberRounded } from \"@framerjs/shared\"\nimport type { VekterEngine } from \"document/VekterEngine.ts\"\nimport type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport { FrameNode } from \"document/models/CanvasTree/index.ts\"\nimport { isFrameNode, isRichTextNode, isSVGNode } from \"document/models/CanvasTree/nodes/utils/nodeCheck.ts\"\nimport { HTMLTag } from \"document/models/CanvasTree/traits/WithHTMLTag.ts\"\nimport type { Overflow } from \"document/models/CanvasTree/traits/WithOverflow.ts\"\nimport { isClippingOverflowValue } from \"document/models/CanvasTree/traits/WithOverflow.ts\"\nimport { isPinnable } from \"document/models/CanvasTree/traits/WithPins.ts\"\nimport { parseBorderFromStyle } from \"document/models/CanvasTree/traits/utils/parseBorderFromStyle.ts\"\nimport { parseBorderRadiusFromStyle } from \"document/models/CanvasTree/traits/utils/parseBorderRadiusFromStyle.ts\"\nimport { parseBoxShadowsFromStyle } from \"document/models/CanvasTree/traits/utils/parseBoxShadowFromStyle.ts\"\nimport { parseCornerShapeFromStyle } from \"document/models/CanvasTree/traits/utils/parseCornerShapeFromStyle.ts\"\nimport { parseFillFromStyle } from \"document/models/CanvasTree/traits/utils/parseFillFromStyle.ts\"\nimport { parseOverflowFromStyle } from \"document/models/CanvasTree/traits/utils/parseOverflowFromStyle.ts\"\nimport { getCanvasBoundingRectCached } from \"document/models/CanvasTree/utils/geometry.ts\"\nimport { ActiveContentPanelTab } from \"document/utils/ActiveEditorType.ts\"\nimport type { Point } from \"library/index.ts\"\nimport { DimensionType, Rect } from \"library/index.ts\"\nimport { isNumber, isUndefined } from \"utils/typeChecks.ts\"\nimport { toast } from \"web/lib/toaster.ts\"\nimport { record } from \"web/lib/tracker.ts\"\nimport { getStyleFromCSS } from \"./html/genericStyleFromCSS.ts\"\nimport { createTextNode } from \"./html/richTextNodeFromElement.ts\"\nimport { uploadImageAndReplacePlaceholder } from \"./html/uploadImageAndReplacePlaceholder.ts\"\n\n/**\n * Check if a Frame has meaningful style. This list is opinionated and\n * intentionally not complete, and instead prioritizes reducing unnecessary\n * frames from imports. For instance, pointer-events, or cursor are not included\n * here.\n */\nfunction isUnstyledFrame(node: FrameNode): boolean {\n\tif (node.fillEnabled) return false\n\tconst nodeBoxShadows = node.resolveValue(\"boxShadows\")\n\tif (nodeBoxShadows && nodeBoxShadows.length > 0) return false\n\tif (node.borderEnabled) return false\n\tif (node.opacity && node.opacity !== 1) return false\n\treturn true\n}\n\n/**\n * Often html wrapping divs are unstyled, have overflow: hidden, but don't\n * actually clip any content. We can detect this to decide if we need to keep\n * the frame or not.\n *\n * @FIXME technically the children could be inside the frame with overflow:\n * hidden, but some more-nested descendant could be outside the frame. It may be\n * worth checking this if it becomes an issue. The trick would be to merge a\n * rect of all descendants, excluding descendants of overflow-hidden\n * descendants.\n */\nfunction frameClipsChildren(engine: VekterEngine, node: CanvasNode, children: CanvasNode[]): boolean {\n\tif (!isFrameNode(node) || !isClippingOverflowValue(node.overflow)) return false\n\n\tconst rect = engine.tree.getRect(node)\n\tconst contentsRect = children.reduce(\n\t\t(childRect, child) => {\n\t\t\treturn Rect.merge(childRect, engine.tree.getRect(child))\n\t\t},\n\t\t{ x: 0, y: 0, width: 0, height: 0 },\n\t)\n\n\treturn !Rect.containsRect(rect, contentsRect)\n}\n\ntype ParentInfo = Partial<Pick<PositionAndSize, \"top\" | \"left\" | \"width\" | \"overflow\">>\n\nfunction nodeIsHiddenByParent(parentInfo: ParentInfo | undefined, style: CSSStyleDeclaration) {\n\t// If the parent doesn't clip its descendants, the node can't be hidden.\n\tif (!isClippingOverflowValue(parentInfo?.overflow) && parentInfo?.overflow !== \"auto\") {\n\t\treturn false\n\t}\n\n\tconst parentWidth = parentInfo?.width || 0\n\tconst parentLeft = parentInfo?.left || 0\n\tconst left = parseFloat(style.left) || 0\n\tconst width = parseFloat(style.width) || 0\n\n\t// Position is page relative, so to determine if the actual left is outside\n\t// of the parent, subtract the parent left from the element left, and check\n\t// if that is still a larger number than the parent width and completely outside of the clipping box.\n\tif (left - parentLeft > parentWidth) return true\n\t// Again, as position is page relative, if left + width is still less than\n\t// the parent left, the layer is completely outside of the parent's clipping\n\t// box.\n\tif (left + width < parentLeft) return true\n\n\treturn false\n}\n\nasync function htmlElementToCanvasNode(\n\tengine: VekterEngine,\n\ttasks: (() => Promise<void>)[],\n\telement: ElementWithStyle,\n\tparentInfo?: ParentInfo,\n): Promise<CanvasNode[]> {\n\tconst { style } = element\n\tif (style.display === \"none\" || (!style.width && !style.height) || nodeIsHiddenByParent(parentInfo, style)) {\n\t\treturn []\n\t}\n\n\tconst offsetTop = parentInfo?.top ?? 0\n\tconst offsetLeft = parentInfo?.left ?? 0\n\tconst top = (parseInt(style.top) || 0) - offsetTop\n\tconst left = (parseInt(style.left) || 0) - offsetLeft\n\tconst width = parseInt(style.width)\n\tconst height = parseInt(style.height)\n\n\tconst layout = {\n\t\t...parseBorderFromStyle(style),\n\t\t...parseBoxShadowsFromStyle(style),\n\t\t...parseBorderRadiusFromStyle(style),\n\t\t...parseCornerShapeFromStyle(style),\n\t\t...parseFillFromStyle(style),\n\t}\n\n\tconst overflow = parseOverflowFromStyle(style)\n\tconst positionAndSize: PositionAndSize = {\n\t\ttop,\n\t\tleft,\n\t\twidth,\n\t\twidthType: style.width === \"auto\" ? DimensionType.Auto : DimensionType.FixedNumber,\n\t\theight,\n\t\t...overflow,\n\t}\n\n\tif (isImage(element)) return createImage(engine, tasks, element, layout, positionAndSize)\n\tif (isText(element)) return createTextNode(engine, element, layout, positionAndSize)\n\n\tconst node = createLayout(element, layout, positionAndSize)\n\tconst offset: ParentInfo = { top: top + offsetTop, left: left + offsetLeft, width, ...overflow }\n\n\tconst children: CanvasNode[] = []\n\tfor (const child of element.children) {\n\t\tif (!isElementWithStyle(child)) continue\n\t\tconst nodeChildren = await htmlElementToCanvasNode(engine, tasks, child, offset)\n\t\tif (nodeChildren) children.push(...nodeChildren)\n\t}\n\n\t// If the frame is completely unstyled, we can drop it.\n\tif (isUnstyledFrame(node)) {\n\t\t// Without children, we can just drop the frame.\n\t\tif (children.length === 0) return []\n\n\t\t// If this isn't a root element copied from a site (we always keep\n\t\t// these) or the frame's overflow settings have no impact on the\n\t\t// clipping of its children, drop the frame returning only its children.\n\t\tif (parentInfo || !frameClipsChildren(engine, node, children)) {\n\t\t\treturn children.map(child => {\n\t\t\t\t// Offset the descendants to maintain their current position.\n\t\t\t\treturn isPinnable(child) ? child.set({ top: (child.top ?? 0) + top, left: (child.left ?? 0) + left }) : child\n\t\t\t})\n\t\t}\n\t}\n\n\tawait engine.scheduler.processWhenReadyAsync(() => children.forEach(child => node.addChild(child)))\n\n\treturn [node]\n}\n\nfunction isText(element: Element) {\n\tswitch (element.tagName) {\n\t\tcase \"P\":\n\t\tcase \"H1\":\n\t\tcase \"H2\":\n\t\tcase \"H3\":\n\t\tcase \"H4\":\n\t\tcase \"H5\":\n\t\tcase \"H6\":\n\t\tcase \"STRONG\":\n\t\tcase \"B\":\n\t\tcase \"I\":\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunction isImage(element: Element): element is HTMLImageElement {\n\treturn element.tagName === \"svg\" || !!element.getAttribute(\"src\")\n}\n\ninterface PositionAndSize {\n\ttop: number\n\tleft: number | null\n\twidth: number\n\twidthType: DimensionType\n\theight: number\n\tcenterAnchorX?: number\n\toverflow?: Overflow\n}\n\nasync function createImage(\n\tengine: VekterEngine,\n\ttasks: (() => Promise<void>)[],\n\telement: HTMLElement,\n\tproperties: Partial<FrameNode>,\n\tposition: PositionAndSize,\n) {\n\tconst placeholder = new FrameNode({\n\t\t...properties,\n\t\t...getStyleFromCSS(element.style),\n\t\t...position,\n\t\tfillImage: undefined,\n\t\tfillEnabled: true,\n\t\tfillType: \"image\",\n\t})\n\n\t// After adding the placeholder, queue a function to upload the image. We\n\t// queue this function rather than immediately invoke it to ensure that the\n\t// node's parent is confirmed, since the current parent at the time of\n\t// creating the placeholder may be dropped if its unstyled.\n\ttasks.push(() => uploadImageAndReplacePlaceholder(engine, element, placeholder, position))\n\n\treturn [placeholder]\n}\n\nfunction createLayout(element: ElementWithStyle, properties: Partial<FrameNode>, position: PositionAndSize) {\n\treturn new FrameNode({\n\t\t...position,\n\t\tfillEnabled: false,\n\t\thtmlTag: element.tagName === \"SECTION\" ? HTMLTag.section : undefined,\n\t\t...getStyleFromCSS(element.style),\n\t\t...properties,\n\t})\n}\n\ninterface Metadata {\n\twidth?: number\n\theight?: number\n\turl?: string\n}\n\nfunction getPageHeightFromMeta(body: HTMLElement): Metadata {\n\tconst metadataString = body.getAttribute(\"data-framer-html-import-extension\")\n\tif (!metadataString) return {}\n\tconst { width, height, url } = JSON.parse(metadataString)\n\n\treturn {\n\t\twidth: parseNumberRounded(width),\n\t\theight: parseNumberRounded(height),\n\t\turl,\n\t}\n}\n\n/**\n * Handle inserting html elements added to the clipboard by the\n * html-import-extension Chrome Extension. Elements will be inserted into the\n * active webpage at the position they were in the web page they were copied in.\n * The webpage breakpoint will be resized to the approximate height of the page\n * when the layers were copied to accommodate this.\n */\nexport async function htmlImportExtensionClipboardHandler(\n\tengine: VekterEngine,\n\tbody: HTMLElement | undefined,\n\t_position: Point,\n): Promise<boolean> {\n\tif (isUndefined(body)) return false\n\n\tconst anyWebPage = engine.stores.scopeStore.getTopMostWebPageNode()\n\tif (!anyWebPage) return false\n\n\tconst scope = (await anyWebPage.load())?.loaded\n\tif (!scope) return false\n\n\tconst page = scope.getPrimaryVariant()\n\tconst { width, url } = getPageHeightFromMeta(body)\n\tif (!url) return false\n\n\trecord(\"html_import_start\", { url })\n\n\tawait engine.scheduler.processWhenReadyAsync(() => {\n\t\tif (isNumber(width) && page.widthType === DimensionType.FixedNumber) {\n\t\t\tpage.set({ width, widthType: DimensionType.FixedNumber })\n\t\t}\n\n\t\ttoast({\n\t\t\tkey: \"paste-html\",\n\t\t\tvariant: \"progress\",\n\t\t\ttype: \"add\",\n\t\t\tprimaryText: \"Pasting\",\n\t\t\tsecondaryText: \"layers\u2026\",\n\t\t\tduration: Infinity,\n\t\t})\n\t})\n\n\tconst imageUploads: (() => Promise<void>)[] = []\n\tconst selection: CanvasNode[] = []\n\tconst nodes = await Promise.all(\n\t\t[...body.children]\n\t\t\t.filter(isElementWithStyle)\n\t\t\t.map(element => htmlElementToCanvasNode(engine, imageUploads, element)),\n\t)\n\n\tif (nodes.length === 0) {\n\t\trecord(\"html_import_fail\", { url })\n\t\ttoast({ type: \"remove\", key: \"paste-html\" })\n\t\treturn true\n\t}\n\n\tawait engine.scheduler.processWhenReadyAsync(() => {\n\t\tengine.beginUndoGroup()\n\t\tfor (const list of nodes) {\n\t\t\tif (!list) continue\n\t\t\tlist.forEach(node => {\n\t\t\t\tengine.stores.scopeStore.insertNode(node, page.id)\n\t\t\t\tselection.push(node)\n\t\t\t})\n\t\t}\n\t})\n\n\tif (selection.length === 0) {\n\t\tawait engine.scheduler.processWhenReadyAsync(() => {\n\t\t\tengine.endUndoGroup()\n\t\t\ttoast({\n\t\t\t\ttype: \"remove\",\n\t\t\t\tkey: \"paste-html\",\n\t\t\t})\n\t\t})\n\n\t\trecord(\"html_import_fail\", { url })\n\n\t\treturn true\n\t}\n\n\t// Do a pass over the final inserted layers to improve the responsiveness of\n\t// the layout, as well as gather metrics.\n\tconst metrics = { images: 0, frames: 0, text: 0 }\n\t// Create a rect of all the descendants so that we can set the page to the\n\t// total height.\n\tlet totalRect: Rect = { x: 0, y: 0, width: 0, height: 0 }\n\tawait engine.scheduler.processWhenReadyAsync(() => {\n\t\tfor (const root of selection) {\n\t\t\tfor (const node of root.walk()) {\n\t\t\t\tconst rect = engine.tree.getRect(node)\n\t\t\t\tconst parent = engine.tree.get(node.parentid)\n\n\t\t\t\ttotalRect = Rect.merge(totalRect, rect)\n\n\t\t\t\tif (isFrameNode(node)) {\n\t\t\t\t\tif (node.fillType === \"image\") {\n\t\t\t\t\t\tmetrics.images++\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmetrics.frames++\n\t\t\t\t\t}\n\t\t\t\t} else if (isSVGNode(node)) {\n\t\t\t\t\tmetrics.images++\n\t\t\t\t} else if (isRichTextNode(node)) {\n\t\t\t\t\tmetrics.text++\n\t\t\t\t}\n\n\t\t\t\tif (!parent || !isPinnable(node)) continue\n\t\t\t\tconst parentRect = engine.tree.getRect(parent)\n\t\t\t\tconst right = parentRect.width - (rect.x + rect.width)\n\n\t\t\t\tif (node.widthType !== DimensionType.Auto && rect.x === 0 && rect.width === parentRect.width) {\n\t\t\t\t\t// If the node is the same width as it's parent, and its not\n\t\t\t\t\t// auto width, set it to 100% as a slight improvement for\n\t\t\t\t\t// responsiveness.\n\t\t\t\t\tnode.set({ width: 1, widthType: DimensionType.Percentage })\n\t\t\t\t} else if (Math.floor(Math.abs(right - rect.x)) <= 2) {\n\t\t\t\t\t// If the node is roughly horizontally centered, actually\n\t\t\t\t\t// center it with pins it in its parent.\n\t\t\t\t\tnode.set({ left: null, right: null, centerAnchorX: 0.5 })\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (page.heightType === DimensionType.FixedNumber && totalRect.height > page.height) {\n\t\t\tpage.set({ height: totalRect.height })\n\t\t}\n\t})\n\n\tawait Promise.all(imageUploads.map(fn => fn()))\n\n\tawait engine.scheduler.processWhenReadyAsync(() => {\n\t\t// if the node is not visible, scroll to it\n\t\tconst selectionRect = selection.reduce(\n\t\t\t(rect, node) => Rect.merge(rect, getCanvasBoundingRectCached(engine.tree, node)),\n\t\t\t{ x: 0, y: 0, width: 0, height: 0 },\n\t\t)\n\n\t\tengine.stores.canvasStore.zoomToCenter(selectionRect)\n\t\tengine.stores.chromeStore.contentPanelTab = ActiveContentPanelTab.Layers\n\n\t\tengine.endUndoGroup()\n\n\t\trecord(\"html_import_success\", {\n\t\t\turl,\n\t\t\timages: metrics.images,\n\t\t\tframes: metrics.frames,\n\t\t\ttext: metrics.text,\n\t\t\tlayers: metrics.images + metrics.frames + metrics.text,\n\t\t})\n\n\t\ttoast({\n\t\t\ttype: \"remove\",\n\t\t\tkey: \"paste-html\",\n\t\t})\n\t})\n\n\treturn true\n}\n\ninterface ElementWithStyle extends Element {\n\tstyle: CSSStyleDeclaration\n}\n\nfunction isElementWithStyle(element: Element): element is ElementWithStyle {\n\treturn \"style\" in element && element.style instanceof CSSStyleDeclaration\n}\n", "import type { VekterEngine } from \"document/VekterEngine.ts\"\nimport { RichTextNode } from \"document/models/CanvasTree/nodes/RichTextNode.ts\"\nimport { getDefaultPresets } from \"document/models/CanvasTree/nodes/RichTextNode.utils.ts\"\nimport { insertNodeAccountingForReplicas } from \"document/models/CanvasTree/nodes/utils/insertNodeAccountingForReplicas.ts\"\nimport { hasAnyLayout } from \"document/models/CanvasTree/traits/WithLayout.ts\"\nimport { isEditingText } from \"document/utils/isEditingText.ts\"\nimport { DimensionType } from \"library/index.ts\"\nimport type { Point } from \"library/render/types/Point.ts\"\nimport { getIdIfSelectionCanBeParent } from \"utils/clipboard/helpers/tree.ts\"\n\n/**\n * Handles plain text clipboard data by creating a RichTextNode on the canvas.\n *\n * @param engine - The VekterEngine instance\n * @param textClipboardData - Plain text content from clipboard\n * @param position - The position where to insert the text node\n * @returns true if the handler processed the clipboard data, false otherwise\n */\nexport async function plainTextClipboardHandler(\n\tengine: VekterEngine,\n\ttextClipboardData: string | undefined,\n\tposition: Point,\n\tevent?: ClipboardEvent,\n): Promise<boolean> {\n\t// Don't handle if no text data or if user is editing text\n\tif (!textClipboardData || isEditingText()) return false\n\t// Don't handle empty text\n\tif (textClipboardData.trim().length === 0) return false\n\n\t// At this point we know that we are going to handle the clipboard data, so we can prevent the default behavior.\n\tevent?.preventDefault()\n\n\treturn engine.scheduler.processWhenReadyAsync(() => {\n\t\tconst { tree, stores } = engine\n\t\tconst { selectionStore, scopeStore } = stores\n\t\tconst activeScope = scopeStore.active\n\n\t\t// Determine the parent node based on the selected node(s).\n\t\tconst { maybeParentId, insertionIndex } = getIdIfSelectionCanBeParent(\n\t\t\tengine.componentLoader,\n\t\t\t[new RichTextNode()],\n\t\t\ttree,\n\t\t\tactiveScope,\n\t\t\tselectionStore.ids,\n\t\t\tselectionStore.commonGroundNodeId,\n\t\t)\n\t\t// If no parent is found, use the active scope\n\t\tconst parentId = maybeParentId || activeScope.id\n\n\t\t// Check if parent has a layout\n\t\tconst parentNode = engine.tree.getNode(parentId)\n\t\tconst parentHasLayout = Boolean(parentNode && hasAnyLayout(parentNode))\n\n\t\t// Get the default presets\n\t\tconst defaultPresets = getDefaultPresets(engine.tree)\n\n\t\t// If parent has a layout, set width to fill the free space, otherwise fit to content\n\t\tconst widthAttributes: Partial<RichTextNode> = { widthType: DimensionType.Auto }\n\t\tif (parentHasLayout) {\n\t\t\twidthAttributes.widthType = DimensionType.FractionOfFreeSpace\n\t\t\twidthAttributes.width = 1\n\t\t}\n\n\t\tconst positionAttributes: Partial<RichTextNode> = {}\n\t\tif (parentId === activeScope.id) {\n\t\t\t// When pasting in the active scope, position the text node at the paste position\n\t\t\tpositionAttributes.left = position.x\n\t\t\tpositionAttributes.top = position.y\n\t\t} else if (!parentHasLayout) {\n\t\t\t// Or if the parent doesn't have a layout, center the text node\n\t\t\tpositionAttributes.left = null\n\t\t\tpositionAttributes.top = null\n\t\t\tpositionAttributes.centerAnchorX = 0.5\n\t\t\tpositionAttributes.centerAnchorY = 0.5\n\t\t}\n\n\t\t// Convert plain text to simple HTML\n\t\tconst html = convertPlainTextToHTML(textClipboardData)\n\n\t\tconst nodeAttributes: Partial<RichTextNode> = {\n\t\t\t...defaultPresets,\n\t\t\t...widthAttributes,\n\t\t\t...positionAttributes,\n\t\t\theightType: DimensionType.Auto,\n\t\t\thtml,\n\t\t}\n\n\t\t// Use replica-aware insertion to properly handle breakpoints\n\t\tconst richTextNodeId = insertNodeAccountingForReplicas(\n\t\t\tengine.tree,\n\t\t\tparentId,\n\t\t\t(targetParentId, visibilityProps, _addingToReplica) => {\n\t\t\t\tconst richTextNode = engine.createNode(\n\t\t\t\t\tRichTextNode,\n\t\t\t\t\t{ ...nodeAttributes, ...visibilityProps },\n\t\t\t\t\ttargetParentId,\n\t\t\t\t\tundefined,\n\t\t\t\t\tinsertionIndex,\n\t\t\t\t)\n\n\t\t\t\treturn richTextNode.id\n\t\t\t},\n\t\t)\n\n\t\t// Select the newly created node\n\t\tengine.stores.selectionStore.set([richTextNodeId])\n\n\t\treturn true\n\t})\n}\n\n/**\n * Converts plain text to HTML by wrapping each line in paragraph tags.\n * Empty lines are converted to <br /> tags.\n *\n * @param text - The plain text to convert\n * @returns The HTML string with each line wrapped in paragraph tags\n */\nfunction convertPlainTextToHTML(text: string): string {\n\treturn text\n\t\t.split(\"\\n\")\n\t\t.map(line => {\n\t\t\tconst trimmedLine = line.trim()\n\t\t\treturn trimmedLine.length === 0 ? \"<br />\" : `<p>${escapeHTML(trimmedLine)}</p>`\n\t\t})\n\t\t.join(\"\")\n}\n\n/**\n * Escapes HTML special characters in plain text.\n *\n * @param text - The plain text to escape\n * @returns The escaped HTML string\n */\nfunction escapeHTML(text: string): string {\n\tconst div = document.createElement(\"div\")\n\tdiv.textContent = text\n\treturn div.innerHTML\n}\n", "import type { CanvasTree } from \"../../CanvasTree.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { NodeID } from \"../../nodes/NodeID.ts\"\nimport { isVectorNode } from \"../../nodes/TreeNode.ts\"\nimport { BooleanShapeNode } from \"../../nodes/shapes/BooleanShapeNode.ts\"\nimport { isBooleanShapeNode, isShapeGroupNode } from \"../../nodes/utils/nodeCheck.ts\"\n\nfunction addToResult(\n\tnodes: CanvasNode[],\n\tseenNodeIDs: Set<NodeID>,\n\tresult: CanvasNode[],\n\texcludeBooleanShapes: boolean = false,\n) {\n\tfor (const node of nodes) {\n\t\tif (seenNodeIDs.has(node.id)) {\n\t\t\tcontinue\n\t\t}\n\t\tseenNodeIDs.add(node.id)\n\t\tif (isShapeGroupNode(node)) {\n\t\t\tcontinue\n\t\t}\n\t\tif (excludeBooleanShapes && isBooleanShapeNode(node)) {\n\t\t\tcontinue\n\t\t}\n\t\tresult.push(node)\n\t}\n}\n\nexport function expandSelectionForShapeProperties(\n\ttree: CanvasTree,\n\tnodes: CanvasNode[],\n): [CanvasNode[], CanvasNode[], CanvasNode[]] {\n\tconst seenShapeStyleIds: Set<NodeID> = new Set()\n\tconst shapeStyleResult: CanvasNode[] = []\n\tconst seenShapeStyleRootIds: Set<NodeID> = new Set()\n\tconst shapeStyleRootsResult: CanvasNode[] = []\n\tconst seenShapeGeometryIds: Set<NodeID> = new Set()\n\tconst shapeGeometryResult: CanvasNode[] = []\n\n\taddToResult(nodes, seenShapeStyleIds, shapeStyleResult)\n\taddToResult(nodes, seenShapeGeometryIds, shapeGeometryResult, true)\n\n\tfor (const node of nodes) {\n\t\tlet subtreeStyleParent: CanvasNode | null = null\n\t\tlet subtreeGeometryParentId: NodeID | null = null\n\n\t\tif (isVectorNode(node)) {\n\t\t\tsubtreeStyleParent = tree.getAncestorOfType(node, BooleanShapeNode, true, true) || node\n\t\t\tsubtreeGeometryParentId = node.id\n\t\t} else {\n\t\t\taddToResult([node], seenShapeStyleRootIds, shapeStyleRootsResult)\n\t\t}\n\n\t\tif (subtreeStyleParent !== null) {\n\t\t\tconst subtreeNodes = tree.getSubtreeNodes(subtreeStyleParent.id)\n\t\t\taddToResult(subtreeNodes, seenShapeStyleIds, shapeStyleResult)\n\n\t\t\tif (isShapeGroupNode(subtreeStyleParent)) {\n\t\t\t\t// If the top level is a group, walk the tree down until we bump into booleans\n\t\t\t\t// (shape groups and booleans are the only vector nodes with children)\n\t\t\t\tconst styleRootNodes: CanvasNode[] = []\n\t\t\t\tfor (const vectorNode of subtreeStyleParent.walk()) {\n\t\t\t\t\tif (!isShapeGroupNode(vectorNode)) {\n\t\t\t\t\t\tstyleRootNodes.push(vectorNode)\n\t\t\t\t\t}\n\t\t\t\t\tif (isBooleanShapeNode(vectorNode)) {\n\t\t\t\t\t\tbreak // Done with this branch\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\taddToResult(styleRootNodes, seenShapeStyleRootIds, shapeStyleRootsResult)\n\t\t\t} else {\n\t\t\t\t// It\u2019s a boolean\n\t\t\t\taddToResult([subtreeStyleParent], seenShapeStyleRootIds, shapeStyleRootsResult)\n\t\t\t}\n\t\t}\n\n\t\tif (subtreeGeometryParentId !== null) {\n\t\t\tconst subtreeNodes = tree.getSubtreeNodes(subtreeGeometryParentId)\n\t\t\taddToResult(subtreeNodes, seenShapeGeometryIds, shapeGeometryResult, true)\n\t\t}\n\t}\n\n\treturn [shapeStyleResult, shapeStyleRootsResult, shapeGeometryResult]\n}\n", "import { Mixed } from \"@framerjs/shared\"\nimport type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport { isVectorInstance } from \"../../nodes/utils/nodeCheck.ts\"\nimport { withAspectRatio } from \"../WithAspectRatio.ts\"\nimport type { Reduced } from \"./Reduced.ts\"\nimport { isNotFound } from \"./Reduced.ts\"\nimport { hasLockedAspectRatio, layoutSupportsAspectRatio } from \"./layoutSupportsAspectRatio.ts\"\n\nexport interface ReducedAspectRatio {\n\taspectRatioEnabled: Reduced<boolean>\n\taspectRatioLocked: boolean\n}\n\nexport function reduceAspectRatio(node: CanvasNode, result: ReducedAspectRatio) {\n\tif (!withAspectRatio(node) || !layoutSupportsAspectRatio(node)) return\n\n\tconst aspectRatioEnabled = hasLockedAspectRatio(node)\n\n\tif (isNotFound(result.aspectRatioEnabled)) {\n\t\tresult.aspectRatioEnabled = aspectRatioEnabled\n\t} else if (result.aspectRatioEnabled !== Mixed && result.aspectRatioEnabled !== aspectRatioEnabled) {\n\t\tresult.aspectRatioEnabled = Mixed\n\t}\n\n\tif (isVectorInstance(node)) return\n\n\tresult.aspectRatioLocked = false\n}\n", "import type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport type { WithBlending } from \"document/models/CanvasTree/traits/WithBlending.ts\"\nimport { withBlending } from \"document/models/CanvasTree/traits/WithBlending.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport type ReducedBlending = ReducedRecord<WithBlending>\n\nexport function reduceBlending(node: CanvasNode, result: ReducedBlending) {\n\tif (!withBlending(node)) return\n\n\treduceProperty(\"blendingMode\", result, node)\n}\n", "import type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport type { BorderStyle } from \"library/index.ts\"\nimport type { NonUndefinedRecord } from \"utils/NonUndefined.ts\"\nimport type { WithBorder } from \"../WithBorder.ts\"\nimport { browserDefaultForBorderStyle, withBorder } from \"../WithBorder.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { NotFound } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedBorder extends ReducedRecord<NonUndefinedRecord<WithBorder>> {}\n\nexport function getReducedBorderDefaults(): ReducedBorder {\n\treturn {\n\t\tborderEnabled: NotFound,\n\t\tborderWidth: NotFound,\n\t\tborderColor: NotFound,\n\t\tborderPerSide: NotFound,\n\t\tborderTop: NotFound,\n\t\tborderRight: NotFound,\n\t\tborderBottom: NotFound,\n\t\tborderLeft: NotFound,\n\t\tborderStyle: NotFound,\n\t}\n}\n\nconst undefinedToSolidBorderStyle = (value: BorderStyle | undefined) => value ?? browserDefaultForBorderStyle\nconst undefinedToBlack = (value: string | undefined) => value ?? \"black\"\nconst undefinedToFalse = (value: boolean | undefined) => value ?? false\nfunction undefinedToNumber<T>(value: T | undefined): T | number {\n\treturn value ?? 1\n}\n\nexport function reduceBorder(node: CanvasNode, result: ReducedBorder) {\n\tif (!withBorder(node)) {\n\t\treturn\n\t}\n\n\treduceProperty(\"borderEnabled\", result, node, undefinedToFalse)\n\n\tif (!node.borderEnabled) return\n\n\treduceProperty(\"borderStyle\", result, node, undefinedToSolidBorderStyle)\n\treduceProperty(\"borderColor\", result, node, undefinedToBlack)\n\treduceProperty(\"borderWidth\", result, node, undefinedToNumber)\n\treduceProperty(\"borderPerSide\", result, node, undefinedToFalse)\n\treduceProperty(\"borderTop\", result, node, undefinedToNumber)\n\treduceProperty(\"borderRight\", result, node, undefinedToNumber)\n\treduceProperty(\"borderBottom\", result, node, undefinedToNumber)\n\treduceProperty(\"borderLeft\", result, node, undefinedToNumber)\n}\n", "import { Mixed, assertNever, isMixed } from \"@framerjs/shared\"\nimport { type CanvasNode, type CanvasTree, isVectorNode } from \"document/models/CanvasTree/index.ts\"\nimport type { ConicGradient } from \"document/models/ConicGradientClass.ts\"\nimport { LinearGradient } from \"document/models/LinearGradientClass.ts\"\nimport type { RadialGradient } from \"document/models/RadialGradientClass.ts\"\nimport type { ImageFit } from \"library/render/types/BackgroundImage.ts\"\nimport { isNumber, isString } from \"utils/typeChecks.ts\"\nimport { isShapeContainerNode } from \"../../nodes/utils/nodeCheck.ts\"\nimport { isDynamicValue } from \"../DynamicValue.ts\"\nimport { withColorable } from \"../WithColorable.ts\"\nimport type { FillImageAlt, FillImagePositionX, FillImagePositionY, WithFill, WithOptionalFill } from \"../WithFill.ts\"\nimport {\n\tisGradientFillType,\n\tsupportsFillImageAlts,\n\tsupportsGradient,\n\twithFill,\n\twithFillImageAlts,\n\twithOptionalFill,\n} from \"../WithFill.ts\"\nimport { hasTickerEffect } from \"../WithTickerEffect.ts\"\nimport { isVectorSetItem } from \"../WithVectorSetItem.ts\"\nimport { withFormInput } from \"../forms/WithFormInput.ts\"\nimport type { Reduced, ReducedRecord } from \"./Reduced.ts\"\nimport { NotFound, isNotFound } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedFillImageAlt {\n\tid: string\n\timage: Reduced<string>\n\talt: Reduced<string>\n}\n\nexport interface ReducedFill extends ReducedRecord<\n\tPick<WithOptionalFill, \"fillEnabled\" | \"fillType\" | \"fillColor\" | \"fillImage\">\n> {\n\tgradientFillSupported: boolean\n\tfillImageResize: Set<ImageFit>\n\tanyNodesWithFill: boolean\n\tanyNodesWithImageFill: boolean\n\tanyNodeWithNonOptionalFill: boolean\n\tonlyNodesSupportingImageFill: boolean\n\tonlyNodesSupportingFillImageAlts: boolean\n\tfillImages: Set<string>\n\tfillGradientCSS: Reduced<string | undefined>\n\tfillImagePositionX: Reduced<FillImagePositionX | undefined>\n\tfillImagePositionY: Reduced<FillImagePositionY | undefined>\n\tfillImageTileSize: Reduced<number | undefined>\n\tfillImageAlts: Reduced<ReducedFillImageAlt[] | undefined>\n}\n\nexport function getReducedFillDefaults(): ReducedFill {\n\treturn {\n\t\tfillEnabled: NotFound,\n\t\tfillType: NotFound,\n\t\tfillColor: NotFound,\n\t\tfillImage: NotFound,\n\t\tfillImagePositionX: NotFound,\n\t\tfillImagePositionY: NotFound,\n\t\tfillImageTileSize: NotFound,\n\t\tfillImageAlts: NotFound,\n\t\tfillGradientCSS: NotFound,\n\t\tgradientFillSupported: true,\n\t\tfillImageResize: new Set(),\n\t\tfillImages: new Set(),\n\t\tanyNodesWithFill: false,\n\t\tanyNodesWithImageFill: false,\n\t\tanyNodeWithNonOptionalFill: false,\n\t\tonlyNodesSupportingImageFill: true,\n\t\tonlyNodesSupportingFillImageAlts: true,\n\t}\n}\n\nfunction defaultToOne(value: unknown): number {\n\treturn isNumber(value) ? value : 1\n}\n\nexport function reduceFill(tree: CanvasTree, node: CanvasNode, result: ReducedFill) {\n\tif (!withFill(node)) return\n\tif (withColorable(node) && !node.colorable) return\n\n\tresult.anyNodesWithFill = true\n\n\tif (!supportsImageFill(node)) {\n\t\tresult.onlyNodesSupportingImageFill = false\n\t}\n\n\tif (result.onlyNodesSupportingFillImageAlts && !supportsFillImageAlts(tree, node)) {\n\t\tresult.onlyNodesSupportingFillImageAlts = false\n\t}\n\n\tif (node.fillType === \"image\") {\n\t\tresult.fillImageResize.add(node.fillImageResize ?? \"fill\")\n\n\t\tif (isString(node.fillImage)) {\n\t\t\tresult.fillImages.add(node.fillImage)\n\t\t}\n\n\t\tif (isString(node.fillImage) || isDynamicValue(node.fillImage)) {\n\t\t\tresult.anyNodesWithImageFill = true\n\t\t}\n\n\t\treduceProperty(\"fillImage\", result, node)\n\t\treduceProperty(\"fillImagePositionX\", result, node)\n\t\treduceProperty(\"fillImagePositionY\", result, node)\n\t\treduceProperty(\"fillImageTileSize\", result, node, defaultToOne)\n\n\t\tif (supportsFillImageAlts(tree, node) && withFillImageAlts(node)) {\n\t\t\tresult.fillImageAlts = reduceFillImageAlts(node.fillImageAlts, result.fillImageAlts)\n\t\t}\n\t}\n\n\tif (supportsGradient(node)) {\n\t\tlet fillGradientCSS: string | undefined\n\n\t\tif (isGradientFillType(node.fillType)) {\n\t\t\tswitch (node.fillType) {\n\t\t\t\tcase \"linear-gradient\": {\n\t\t\t\t\tfillGradientCSS = toDisplayCSS(node.fillLinearGradient)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase \"radial-gradient\": {\n\t\t\t\t\tfillGradientCSS = toDisplayCSS(node.fillRadialGradient)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase \"conic-gradient\": {\n\t\t\t\t\tfillGradientCSS = toDisplayCSS(node.fillConicGradient)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tassertNever(node.fillType)\n\t\t\t}\n\t\t}\n\n\t\tif (fillGradientCSS) {\n\t\t\tif (isNotFound(result.fillGradientCSS)) {\n\t\t\t\tresult.fillGradientCSS = fillGradientCSS\n\t\t\t} else if (result.fillGradientCSS !== fillGradientCSS) {\n\t\t\t\tresult.fillGradientCSS = Mixed\n\t\t\t}\n\t\t}\n\n\t\tconst skip = withOptionalFill(node) && !node.fillEnabled\n\t\tif (!skip) {\n\t\t\treduceProperty(\"fillType\", result, node)\n\t\t}\n\t} else {\n\t\tresult.gradientFillSupported = false\n\t}\n\n\tif (withOptionalFill(node)) {\n\t\treduceProperty(\"fillEnabled\", result, node)\n\t} else {\n\t\tresult.anyNodeWithNonOptionalFill = true\n\t}\n\n\treduceProperty(\"fillColor\", result, node)\n}\n\nfunction toDisplayCSS(gradient: LinearGradient | RadialGradient | ConicGradient | undefined) {\n\tif (!gradient) return\n\t// This is used to show the gradient in the gradient stop slider, which is always linear, and we\n\t// rotate it 90deg for a gradient from left to right.\n\treturn new LinearGradient({ stops: gradient.stops }).toCSS(90)\n}\n\nfunction supportsImageFill(node: CanvasNode & WithFill): boolean {\n\tif (withFormInput(node) || isVectorSetItem(node) || isShapeContainerNode(node) || hasTickerEffect(node)) {\n\t\treturn false\n\t}\n\tif (isVectorNode(node) && node.fillType !== \"image\") return false\n\n\treturn true\n}\n\nfunction reduceFillImageAlts(\n\tcurrent: readonly FillImageAlt[] | undefined,\n\treduced: Reduced<ReducedFillImageAlt[] | undefined>,\n): Reduced<ReducedFillImageAlt[] | undefined> {\n\tif (isMixed(reduced)) return reduced\n\n\tconst currentAlts = current ?? []\n\n\tif (isNotFound(reduced)) {\n\t\treturn currentAlts.map(alt => ({\n\t\t\tid: alt.id,\n\t\t\timage: alt.image,\n\t\t\talt: alt.alt,\n\t\t}))\n\t}\n\n\tconst reducedAlts = reduced ?? []\n\n\tif (currentAlts.length !== reducedAlts.length) return Mixed\n\n\treducedAlts.forEach((reducedAlt, i) => {\n\t\tconst currentAlt = currentAlts[i]\n\t\tif (!currentAlt) return\n\n\t\tif (reducedAlt.image !== currentAlt.image) reducedAlt.image = Mixed\n\t\tif (reducedAlt.alt !== currentAlt.alt) reducedAlt.alt = Mixed\n\t})\n\n\treturn reducedAlts\n}\n", "import type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport type { WithOpacity } from \"../WithOpacity.ts\"\nimport { withOpacity } from \"../WithOpacity.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport type ReducedOpacity = ReducedRecord<WithOpacity>\n\nexport function reduceOpacity(node: CanvasNode, result: ReducedOpacity) {\n\tif (!withOpacity(node)) return\n\n\treduceProperty(\"opacity\", result, node)\n}\n", "import { Mixed } from \"@framerjs/shared\"\nimport type { CanvasNode, CanvasTree } from \"document/models/CanvasTree/index.ts\"\nimport { isPositionRelative } from \"document/models/CanvasTree/traits/utils/positionTypeHelpers.ts\"\nimport { canSetConstraint, canSetPins } from \"document/models/ConstraintSolver.ts\"\nimport { DimensionType } from \"library/render/types/Constraints.ts\"\nimport { isNull, isNumber } from \"utils/typeChecks.ts\"\nimport { isPinnable } from \"../WithPins.ts\"\nimport type { Reduced } from \"./Reduced.ts\"\nimport { isNotFound } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedPinEdges {\n\tpinLeft: Reduced<boolean>\n\tpinRight: Reduced<boolean>\n\tpinTop: Reduced<boolean>\n\tpinBottom: Reduced<boolean>\n\tcanSetLeft: boolean\n\tcanSetTop: boolean\n\tcanSetBottom: boolean\n\tcanSetRight: boolean\n}\n\nexport interface ReducedPins extends ReducedPinEdges {\n\tconstraintsLocked: Reduced<boolean>\n\twidthFactor: Reduced<boolean>\n\theightFactor: Reduced<boolean>\n\tcanSetHorizontalPins: boolean\n\tcanSetVerticalPins: boolean\n}\n\nexport function reducePins(tree: CanvasTree, node: CanvasNode, result: ReducedPins) {\n\tif (!isPinnable(node)) return\n\tconst parent = tree.getParent(node.id)\n\tif (isPositionRelative(node, parent)) return\n\tif (isNull(parent)) return\n\n\treduceProperty(\"constraintsLocked\", result, node)\n\n\tif (result.pinLeft !== Mixed) {\n\t\tconst left = isNumber(node.left)\n\t\tif (isNotFound(result.pinLeft)) {\n\t\t\tresult.pinLeft = left\n\t\t} else if (result.pinLeft !== left) {\n\t\t\tresult.pinLeft = Mixed\n\t\t}\n\t}\n\tif (result.pinRight !== Mixed) {\n\t\tconst right = isNumber(node.right)\n\t\tif (isNotFound(result.pinRight)) {\n\t\t\tresult.pinRight = right\n\t\t} else if (result.pinRight !== right) {\n\t\t\tresult.pinRight = Mixed\n\t\t}\n\t}\n\tif (result.pinTop !== Mixed) {\n\t\tconst top = isNumber(node.top)\n\t\tif (isNotFound(result.pinTop)) {\n\t\t\tresult.pinTop = top\n\t\t} else if (result.pinTop !== top) {\n\t\t\tresult.pinTop = Mixed\n\t\t}\n\t}\n\tif (result.pinBottom !== Mixed) {\n\t\tconst bottom = isNumber(node.bottom)\n\t\tif (isNotFound(result.pinBottom)) {\n\t\t\tresult.pinBottom = bottom\n\t\t} else if (result.pinBottom !== bottom) {\n\t\t\tresult.pinBottom = Mixed\n\t\t}\n\t}\n\tif (result.widthFactor !== Mixed) {\n\t\tconst widthFactor = node.widthType === DimensionType.Percentage\n\t\tif (isNotFound(result.widthFactor)) {\n\t\t\tresult.widthFactor = widthFactor\n\t\t} else if (result.widthFactor !== widthFactor) {\n\t\t\tresult.widthFactor = Mixed\n\t\t}\n\t}\n\tif (result.heightFactor !== Mixed) {\n\t\tconst heightFactor = node.heightType === DimensionType.Percentage\n\t\tif (isNotFound(result.heightFactor)) {\n\t\t\tresult.heightFactor = heightFactor\n\t\t} else if (result.heightFactor !== heightFactor) {\n\t\t\tresult.heightFactor = Mixed\n\t\t}\n\t}\n\n\tconst constraints = node.constraints()\n\tif (result.canSetTop && !canSetConstraint(constraints, \"top\")) result.canSetTop = false\n\tif (result.canSetBottom && !canSetConstraint(constraints, \"bottom\")) result.canSetBottom = false\n\tif (result.canSetLeft && !canSetConstraint(constraints, \"left\")) result.canSetLeft = false\n\tif (result.canSetRight && !canSetConstraint(constraints, \"right\")) result.canSetRight = false\n\tif (result.canSetHorizontalPins && !canSetPins(node, [\"left\", \"right\"])) result.canSetHorizontalPins = false\n\tif (result.canSetVerticalPins && !canSetPins(node, [\"top\", \"bottom\"])) result.canSetVerticalPins = false\n}\n", "import { Mixed, isMixed } from \"@framerjs/shared\"\nimport type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport { Path } from \"document/models/Path.ts\"\nimport type { StrokeAlignment } from \"library/render/types/StrokeAlignment.ts\"\nimport { withShape } from \"../WithShape.ts\"\nimport type { WithStroke } from \"../WithStroke.ts\"\nimport { withStroke } from \"../WithStroke.ts\"\nimport type { Reduced, ReducedRecord } from \"./Reduced.ts\"\nimport { isNotFound } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedStroke extends ReducedRecord<Omit<WithStroke, \"strokeAlignment\">> {\n\tstrokeAlignmentValues: Set<StrokeAlignment>\n\tpathsAreClosed: Reduced<boolean>\n}\n\nexport function reduceStroke(node: CanvasNode, result: ReducedStroke) {\n\tif (!withStroke(node)) {\n\t\treturn\n\t}\n\n\treduceProperty(\"strokeEnabled\", result, node, Boolean)\n\n\tif (withShape(node)) {\n\t\tconst pathIsClosed = Path.isClosed(node.calculatedPaths())\n\n\t\tif (isNotFound(result.pathsAreClosed)) {\n\t\t\tresult.pathsAreClosed = pathIsClosed\n\t\t} else if (!isMixed(result.pathsAreClosed) && result.pathsAreClosed !== pathIsClosed) {\n\t\t\tresult.pathsAreClosed = Mixed\n\t\t}\n\n\t\t// Only take stroke alignment into account for closed shapes\n\t\tif (node.strokeAlignment && pathIsClosed) {\n\t\t\tresult.strokeAlignmentValues.add(node.strokeAlignment)\n\t\t}\n\t}\n\n\treduceProperty(\"lineJoin\", result, node)\n\treduceProperty(\"lineCap\", result, node)\n\treduceProperty(\"strokeColor\", result, node)\n\treduceProperty(\"strokeWidth\", result, node)\n\treduceProperty(\"strokeMiterLimit\", result, node)\n\treduceProperty(\"strokeDashArray\", result, node)\n\treduceProperty(\"strokeDashOffset\", result, node)\n}\n", "import type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport type { WithTextTruncation } from \"document/models/CanvasTree/traits/WithTextTruncation.ts\"\nimport { withTextTruncation } from \"document/models/CanvasTree/traits/WithTextTruncation.ts\"\nimport type { ReducedRecord } from \"document/models/CanvasTree/traits/utils/Reduced.ts\"\nimport { reduceProperty } from \"document/models/CanvasTree/traits/utils/reduceProperty.ts\"\n\nexport type ReducedTextTruncation = ReducedRecord<WithTextTruncation>\n\nexport function reduceTextTruncation(node: CanvasNode, result: ReducedTextTruncation): void {\n\tif (!withTextTruncation(node)) return\n\n\treduceProperty(\"textTruncation\", result, node)\n}\n", "import type { CanvasNode } from \"../../index.ts\"\nimport { withAriaLabel } from \"../WithAriaLabel.ts\"\nimport { withDataNosnippet } from \"../WithDataNosnippet.ts\"\nimport { withHTMLTag } from \"../WithHTMLTag.ts\"\nimport { withHTMLTextTag } from \"../WithHTMLTextTag.ts\"\nimport { withTabIndex } from \"../WithTabIndex.ts\"\nimport { withTitleAndDescription } from \"../WithTitleAndDescription.ts\"\nimport { isVectorSetItem } from \"../WithVectorSetItem.ts\"\n\nexport interface ReducedA11ySupport {\n\tanyNodesWithA11ySupport: boolean\n}\n\nexport function reduceAnyNodesWithA11ySupport(node: CanvasNode, result: ReducedA11ySupport) {\n\t// A Vector Set Item is an SVG. It uses its layer panel name as the aria-label to guarantee\n\t// accessible icon sets.\n\tif (isVectorSetItem(node)) return\n\n\tif (\n\t\twithAriaLabel(node) ||\n\t\twithHTMLTag(node) ||\n\t\twithHTMLTextTag(node) ||\n\t\twithTitleAndDescription(node) ||\n\t\twithTabIndex(node) ||\n\t\twithDataNosnippet(node)\n\t) {\n\t\tresult.anyNodesWithA11ySupport = true\n\t}\n}\n", "import { isUndefined } from \"utils/typeChecks.ts\"\n\nexport function undefinedToEmptyString<T>(value: T | undefined): T | string {\n\treturn isUndefined(value) ? \"\" : value\n}\n", "import type { CanvasNode } from \"../../index.ts\"\nimport { withAltText } from \"../WithAltText.ts\"\nimport type { Reduced } from \"./Reduced.ts\"\nimport { NotFound } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\nimport { undefinedToEmptyString } from \"./undefinedToEmptyString.ts\"\n\nexport interface ReducedAltText {\n\taltAttribute: Reduced<string>\n\tonlyNodesWithAltAttribute: boolean\n}\n\nexport function getReducedAltTextDefaults(): ReducedAltText {\n\treturn {\n\t\taltAttribute: NotFound,\n\t\tonlyNodesWithAltAttribute: true,\n\t}\n}\n\nexport function reduceAltText(node: CanvasNode, result: ReducedAltText): void {\n\tif (!withAltText(node)) {\n\t\tresult.onlyNodesWithAltAttribute = false\n\t\treturn\n\t}\n\n\t// An undefined alt text will result in an empty string being set.\n\treduceProperty(\"altAttribute\", result, node, undefinedToEmptyString)\n}\n", "import type { CanvasNode } from \"../../index.ts\"\nimport type { WithAriaLabel } from \"../WithAriaLabel.ts\"\nimport { withAriaLabel } from \"../WithAriaLabel.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedAriaLabel extends ReducedRecord<WithAriaLabel> {\n\tonlyNodesWithAriaLabel: boolean\n}\n\nexport function reduceAriaLabel(node: CanvasNode, result: ReducedAriaLabel) {\n\tif (!withAriaLabel(node)) {\n\t\tresult.onlyNodesWithAriaLabel = false\n\t\treturn\n\t}\n\n\treduceProperty(\"ariaLabel\", result, node)\n}\n", "import { Mixed, isMixed } from \"@framerjs/shared\"\nimport type { Transition } from \"document/models/Transition.ts\"\nimport { deepClone } from \"utils/deepClone.ts\"\nimport { isShallowArrayEqual } from \"utils/isShallowEqual.ts\"\nimport { isUndefined } from \"utils/typeChecks.ts\"\nimport { type Reduced, type ReducedSubPropertyRecord, isNotFound } from \"./Reduced.ts\"\nimport { valuesAreDifferent } from \"./reduceProperty.ts\"\n\nexport type ReducedEffectTransition = ReducedSubPropertyRecord<\n\tOmit<Transition, \"durationBasedSpring\" | \"bounce\" | \"stagger\">\n> &\n\tPartial<ReducedSubPropertyRecord<Pick<Transition, \"durationBasedSpring\" | \"bounce\" | \"stagger\">>>\nexport function reduceEffectTransition(transition: Transition, result: ReducedEffectTransition) {\n\treduceTransitionSubProperty(\"type\", result, transition)\n\treduceTransitionSubProperty(\"delay\", result, transition)\n\treduceTransitionSubProperty(\"stiffness\", result, transition)\n\treduceTransitionSubProperty(\"damping\", result, transition)\n\treduceTransitionSubProperty(\"mass\", result, transition)\n\treduceTransitionSubProperty(\"duration\", result, transition)\n\treduceTransitionSubProperty(\"bounce\", result, transition)\n\treduceTransitionSubProperty(\"durationBasedSpring\", result, transition)\n\treduceTransitionSubProperty(\"stagger\", result, transition)\n\n\tif (!isMixed(result.ease) && !isShallowArrayEqual(result.ease, transition.ease)) {\n\t\tresult.ease = Mixed\n\t}\n}\n\nexport function getReducedEffectTransition(\n\ttransition: Transition | undefined,\n\treduced: Reduced<ReducedEffectTransition | undefined>,\n): ReducedEffectTransition | Mixed | undefined {\n\tif (isNotFound(reduced)) return deepClone(transition)\n\tif (isMixed(reduced)) return Mixed\n\tif (isUndefined(transition) || isUndefined(reduced)) return transition !== reduced ? Mixed : undefined\n\n\treduceEffectTransition(transition, reduced)\n\treturn reduced\n}\n\nfunction reduceTransitionSubProperty<K extends keyof Transition>(\n\tkey: K,\n\tresult: ReducedEffectTransition,\n\ttransition: Transition,\n) {\n\tconst reducedValue = result[key]\n\tif (isMixed(reducedValue)) return\n\n\tconst value = transition[key]\n\tif (isNotFound(reducedValue)) {\n\t\tresult[key] = value\n\t} else if (valuesAreDifferent(value, reducedValue)) {\n\t\tresult[key] = Mixed\n\t}\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { WithBackdrop } from \"../WithBackdrop.ts\"\nimport { withBackdrop } from \"../WithBackdrop.ts\"\nimport type { Reduced, ReducedRecord } from \"./Reduced.ts\"\nimport { type ReducedEffectTransition, getReducedEffectTransition } from \"./reduceEffectTransition.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedBackdrop extends ReducedRecord<\n\tOmit<WithBackdrop, \"backdropEnterTransition\" | \"backdropExitTransition\">\n> {\n\tonlyNodesWithBackdrop: boolean\n\tbackdropEnterTransition: Reduced<ReducedEffectTransition | undefined>\n\tbackdropExitTransition: Reduced<ReducedEffectTransition | undefined>\n}\n\nexport function reduceBackdrop(node: CanvasNode, result: ReducedBackdrop) {\n\tif (!withBackdrop(node)) {\n\t\tresult.onlyNodesWithBackdrop = false\n\t\treturn\n\t}\n\n\treduceProperty(\"backdropFillEnabled\", result, node)\n\treduceProperty(\"backdropFill\", result, node)\n\treduceProperty(\"backdropDismissible\", result, node)\n\treduceProperty(\"backdropTransitionLocked\", result, node)\n\t// We block page scrolling by default before introducing the blockDocumentScrolling prop, so any undefined value is\n\t// considered true\n\treduceProperty(\n\t\t\"blockDocumentScrolling\",\n\t\tresult,\n\t\tnode,\n\t\tnodeblockDocumentScrolling => nodeblockDocumentScrolling ?? true,\n\t)\n\n\tresult.backdropEnterTransition = getReducedEffectTransition(\n\t\tnode.backdropEnterTransition,\n\t\tresult.backdropEnterTransition,\n\t)\n\tresult.backdropExitTransition = getReducedEffectTransition(node.backdropExitTransition, result.backdropExitTransition)\n}\n", "import type { CanvasNode } from \"../../index.ts\"\nimport type { WithCodeOverridesExperiment } from \"../WithCodeOverrides.ts\"\nimport { withCodeOverridesExperiment } from \"../WithCodeOverrides.ts\"\nexport interface ReducedCodeOverrides {\n\tcodeOverrides?: WithCodeOverridesExperiment[\"codeOverrides\"]\n\tonlyNodesWithCodeOverrides: boolean\n}\n\nexport function reduceCodeOverrides(nodes: CanvasNode[], result: ReducedCodeOverrides) {\n\tif (nodes.length !== 1) return\n\tconst node = nodes[0]\n\tif (!withCodeOverridesExperiment(node)) return\n\tresult.onlyNodesWithCodeOverrides = true\n\tresult.codeOverrides = node.codeOverrides\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { WithCollectionOptions } from \"../WithCollectionOptions.ts\"\nimport { withCollectionOptions } from \"../WithCollectionOptions.ts\"\n\nexport interface ReducedCollectionOptions {\n\tcollectionOptions?: WithCollectionOptions\n}\n\nexport function reduceCollectionOptions(nodes: CanvasNode[], result: ReducedCollectionOptions) {\n\t// We only reduce the value for single selections because of the large collection filter data structure\n\tif (nodes.length !== 1) return\n\tconst node = nodes[0]\n\n\tif (!node) return\n\n\tif (!withCollectionOptions(node)) return\n\n\tresult.collectionOptions = {\n\t\tcollectionFilters: node.collectionFilters,\n\t\tcollectionFiltersOperator: node.collectionFiltersOperator,\n\t\tcollectionOrder: node.collectionOrder,\n\t\tcollectionReverse: node.collectionReverse ?? false,\n\t\tcollectionStartOffset: node.collectionStartOffset,\n\t\tcollectionLimit: node.collectionLimit,\n\t\tcollectionPaginationPageSize: node.collectionPaginationPageSize,\n\t\tcollectionRepeatedItemId: node.collectionRepeatedItemId,\n\t\trepeatedItemId: node.repeatedItemId,\n\t}\n}\n", "import { assert } from \"@framerjs/shared\"\nimport { ControlType } from \"library/render/types/PropertyControls.ts\"\nimport { isEqual } from \"library/render/utils/isEqual.ts\"\nimport { useRef } from \"react\"\nimport { isShallowArrayEqual, isShallowObjectEqual } from \"utils/isShallowEqual.ts\"\nimport { isObject, isReadonlyArray } from \"utils/typeChecks.ts\"\nimport type { ReducedArrayItemControlProp, ReducedControlProp, ReducedControlProps } from \"./getReducedControlProps.ts\"\n\nfunction memoReducedControlProp<T extends ReducedControlProp>(currentControlProp: T, previousControlProp: T): T {\n\tif (\n\t\tcurrentControlProp.type === ControlType.Object &&\n\t\tpreviousControlProp.type === ControlType.Object &&\n\t\tisObject(currentControlProp.value) &&\n\t\tisObject(previousControlProp.value)\n\t) {\n\t\tconst controlProps = memoReducedControlProps(currentControlProp.value, previousControlProp.value)\n\n\t\tif (isShallowObjectEqual(controlProps, previousControlProp.value)) {\n\t\t\treturn previousControlProp\n\t\t}\n\n\t\t// We merge the current control prop so we also get the optional array item id\n\t\treturn { ...currentControlProp, value: controlProps }\n\t}\n\n\tif (\n\t\tcurrentControlProp.type === ControlType.Array &&\n\t\tpreviousControlProp.type === ControlType.Array &&\n\t\tisReadonlyArray(currentControlProp.value) &&\n\t\tisReadonlyArray(previousControlProp.value)\n\t) {\n\t\tconst previousList = previousControlProp.value\n\n\t\tconst list = currentControlProp.value.map((currentArrayItem, index): ReducedArrayItemControlProp => {\n\t\t\tconst previousArrayItem = previousList[index]\n\t\t\tif (!previousArrayItem) return currentArrayItem\n\t\t\treturn memoReducedControlProp(currentArrayItem, previousArrayItem)\n\t\t})\n\n\t\tif (isShallowArrayEqual(list, previousControlProp.value)) {\n\t\t\treturn previousControlProp\n\t\t}\n\n\t\treturn { ...currentControlProp, value: list }\n\t}\n\n\t// We merge the current control prop so we also get the optional array item id\n\tif (isEqual(currentControlProp, previousControlProp)) {\n\t\treturn previousControlProp\n\t}\n\n\treturn currentControlProp\n}\n\n/**\n * Reuses any reduced control prop that is equal to the previously reduced control props. This\n * includes checking for sub control props within objects and arrays.\n */\nexport function memoReducedControlProps<T extends ReducedControlProps>(current: T, previous: T): T {\n\tconst result = {} as T\n\n\tfor (const controlKey in current) {\n\t\tconst currentControlProp = current[controlKey]\n\t\tassert(currentControlProp)\n\t\tconst previousControlProp = previous[controlKey]\n\t\tif (!previousControlProp) {\n\t\t\tresult[controlKey] = currentControlProp\n\t\t\tcontinue\n\t\t}\n\t\tresult[controlKey] = memoReducedControlProp(currentControlProp, previousControlProp)\n\t}\n\n\tif (isShallowObjectEqual(result, previous)) {\n\t\treturn previous\n\t}\n\n\treturn result\n}\n\nexport function useMemoReducedControlProps(reducedControlProps: ReducedControlProps) {\n\tconst previousResult = useRef<ReducedControlProps | null>(null)\n\tconst previousReducedControlProps = previousResult.current\n\n\tif (!previousReducedControlProps) {\n\t\tpreviousResult.current = reducedControlProps\n\t\treturn reducedControlProps\n\t}\n\n\tconst result = memoReducedControlProps(reducedControlProps, previousReducedControlProps)\n\tpreviousResult.current = result\n\treturn result\n}\n", "import type {\n\tSerializedVerifiedPropertyControls,\n\tVerifiedPropertyControls,\n} from \"@framerjs/framer-runtime/sandbox/componentLoader/types\"\nimport type { ControlProps } from \"document/models/controlProps/ControlProp.ts\"\nimport type { RawControlProps } from \"document/models/controlProps/RawControlProp.ts\"\nimport {\n\ttype ReducedControlProps,\n\tgetReducedControlProps,\n} from \"document/models/controlProps/getReducedControlProps.ts\"\nimport { memoReducedControlProps } from \"document/models/controlProps/memoReducedControlProps.ts\"\nimport type { WithHiddenWhenUnset } from \"library/render/types/PropertyControls.ts\"\nimport { isShallowSetEqual } from \"utils/isShallowEqual.ts\"\n\nexport interface ReducedControlPropsWithIdentifier {\n\tcontrolPropsWithIdentifier?: {\n\t\tidentifier: string\n\t\tcontrolProps: ReducedControlProps\n\t\thiddenBecauseUnsetControlKeys: ReadonlySet<string>\n\t}\n}\n\nexport function reduceControlPropsWithIdentifier(\n\tidentifier: string,\n\trawControlPropsList: RawControlProps[],\n\tcontrolPropsList: ControlProps[],\n\tcontrols: SerializedVerifiedPropertyControls,\n\tresult: ReducedControlPropsWithIdentifier,\n\tlastResult: ReducedControlPropsWithIdentifier | undefined,\n) {\n\tresult.controlPropsWithIdentifier = {\n\t\tidentifier,\n\t\tcontrolProps: getReducedControlProps(controls, controlPropsList),\n\t\thiddenBecauseUnsetControlKeys: getHiddenBecauseUnsetControlKeys(rawControlPropsList, controls),\n\t}\n\n\t// Reuse previously reduced control props if they are equal\n\tif (\n\t\tlastResult?.controlPropsWithIdentifier &&\n\t\tresult.controlPropsWithIdentifier.identifier === lastResult.controlPropsWithIdentifier.identifier\n\t) {\n\t\tresult.controlPropsWithIdentifier.controlProps = memoReducedControlProps(\n\t\t\tresult.controlPropsWithIdentifier.controlProps,\n\t\t\tlastResult.controlPropsWithIdentifier.controlProps,\n\t\t)\n\n\t\tif (\n\t\t\tisShallowSetEqual(\n\t\t\t\tresult.controlPropsWithIdentifier.hiddenBecauseUnsetControlKeys,\n\t\t\t\tlastResult.controlPropsWithIdentifier.hiddenBecauseUnsetControlKeys,\n\t\t\t)\n\t\t) {\n\t\t\tresult.controlPropsWithIdentifier.hiddenBecauseUnsetControlKeys =\n\t\t\t\tlastResult.controlPropsWithIdentifier.hiddenBecauseUnsetControlKeys\n\t\t}\n\t}\n}\n\nfunction getHiddenBecauseUnsetControlKeys(\n\trawControlPropsList: RawControlProps[],\n\tcontrols: VerifiedPropertyControls,\n): Set<string> {\n\tconst result = new Set<string>()\n\n\tfor (const controlKey in controls) {\n\t\tconst control = controls[controlKey]\n\t\tif (!control) continue\n\n\t\tconst hiddenWhenUnsetKey = \"hiddenWhenUnset\" satisfies keyof WithHiddenWhenUnset\n\t\tconst isHiddenWhenUnset = hiddenWhenUnsetKey in control && control.hiddenWhenUnset === true\n\t\tif (!isHiddenWhenUnset) continue\n\n\t\tconst isKeySet = rawControlPropsList.some(rawControlProps => rawControlProps[controlKey])\n\t\tif (isKeySet) continue\n\n\t\tresult.add(controlKey)\n\t}\n\n\treturn result\n}\n", "import type { ComponentLoader, SerializedVerifiedPropertyControls } from \"@framerjs/framer-runtime\"\nimport { assert, assertNever } from \"@framerjs/shared\"\nimport type { ControlProps } from \"document/models/controlProps/ControlProp.ts\"\nimport type { RawControlProps } from \"document/models/controlProps/RawControlProp.ts\"\nimport type CodeComponentNode from \"../../nodes/CodeComponentNode.ts\"\nimport type ShaderNode from \"../../nodes/ShaderNode.ts\"\nimport { isCodeComponentNode, isShaderNode, isVectorInstance } from \"../../nodes/utils/nodeCheck.ts\"\nimport type { ReducedControlPropsWithIdentifier } from \"./reduceControlPropsWithIdentifier.ts\"\nimport { reduceControlPropsWithIdentifier } from \"./reduceControlPropsWithIdentifier.ts\"\n\nexport function reduceControlProps(\n\tcomponentLoader: ComponentLoader,\n\tnodes: (CodeComponentNode | ShaderNode)[],\n\tresult: ReducedControlPropsWithIdentifier,\n\tlastResult: ReducedControlPropsWithIdentifier | undefined,\n) {\n\tconst firstNode = nodes[0]\n\tassert(firstNode, \"Should have at least one node\")\n\n\tconst identifier = getIdentifier(firstNode)\n\n\tconst controls = getControls(firstNode, componentLoader)\n\tif (!controls) return\n\n\tconst rawControlPropsList: RawControlProps[] = []\n\tconst controlPropsList: ControlProps[] = []\n\n\tfor (const node of nodes) {\n\t\tif (!isVectorInstance(node)) {\n\t\t\tassert(identifier === getIdentifier(node), \"All nodes should have the same identifier\")\n\t\t}\n\n\t\trawControlPropsList.push(node.getRawControlProps())\n\t\tcontrolPropsList.push(node.getControlProps(controls))\n\t}\n\n\treduceControlPropsWithIdentifier(identifier, rawControlPropsList, controlPropsList, controls, result, lastResult)\n}\n\nfunction getIdentifier(node: CodeComponentNode | ShaderNode): string {\n\tif (isCodeComponentNode(node)) {\n\t\treturn node.codeComponentIdentifier\n\t}\n\tif (isShaderNode(node)) {\n\t\treturn node.shaderModuleIdentifier\n\t}\n\tassertNever(node)\n}\n\nfunction getControls(\n\tnode: CodeComponentNode | ShaderNode,\n\tcomponentLoader: ComponentLoader,\n): SerializedVerifiedPropertyControls | undefined {\n\tif (isCodeComponentNode(node)) {\n\t\treturn componentLoader.reactComponentForIdentifier(node.codeComponentIdentifier)?.properties\n\t}\n\tif (isShaderNode(node)) {\n\t\treturn componentLoader.shaderForIdentifier(node.shaderModuleIdentifier)?.properties\n\t}\n\tassertNever(node)\n}\n", "import type { ComponentLoader } from \"@framerjs/framer-runtime\"\nimport { Mixed } from \"@framerjs/shared\"\nimport type { DimensionType } from \"library/render/types/Constraints.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { isCodeComponentNode } from \"../../nodes/utils/nodeCheck.ts\"\nimport type { Reduced } from \"./Reduced.ts\"\nimport { isNotFound } from \"./Reduced.ts\"\n\nexport interface ReducedCurrentVariantSize {\n\tcurrentVariantWidthType: Reduced<DimensionType>\n\tcurrentVariantHeightType: Reduced<DimensionType>\n}\n\nexport function reduceCurrentVariantSize(\n\tnode: CanvasNode,\n\tcomponentLoader: ComponentLoader,\n\tresult: ReducedCurrentVariantSize,\n) {\n\tif (!isCodeComponentNode(node)) return\n\tconst variantSize = node.getCurrentVariantSize(componentLoader)\n\tif (!variantSize) return\n\tconst { widthType, heightType } = variantSize\n\tif (isNotFound(result.currentVariantWidthType)) {\n\t\tresult.currentVariantWidthType = widthType\n\t} else if (result.currentVariantWidthType !== widthType) {\n\t\tresult.currentVariantWidthType = Mixed\n\t}\n\tif (isNotFound(result.currentVariantHeightType)) {\n\t\tresult.currentVariantHeightType = heightType\n\t} else if (result.currentVariantHeightType !== heightType) {\n\t\tresult.currentVariantHeightType = Mixed\n\t}\n}\n", "import { Mixed } from \"@framerjs/shared\"\nimport type { CanvasTree } from \"../../CanvasTree.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { isSmartComponentNode } from \"../../nodes/utils/nodeCheck.ts\"\nimport type { NodeProvidingCursorComponent, WithCursor } from \"../WithCursor.ts\"\nimport {\n\tCustomCursorType,\n\tDEFAULT_CURSOR_OFFSET,\n\tisNodeProvidingCustomCursorComponent,\n\twithCursor,\n} from \"../WithCursor.ts\"\nimport type { FloatingPlacement } from \"../WithFloatingPosition.ts\"\nimport { DEFAULT_FLOATING_ALIGNMENT, DEFAULT_FLOATING_PLACEMENT } from \"../WithFloatingPosition.ts\"\nimport { isBreakpointWithLayoutTemplate } from \"../WithLayoutTemplate.ts\"\nimport type { Reduced, ReducedRecord } from \"./Reduced.ts\"\nimport { isNotFound } from \"./Reduced.ts\"\nimport { type ReducedEffectTransition, getReducedEffectTransition } from \"./reduceEffectTransition.ts\"\nimport { reduceProperty, valuesAreDifferent } from \"./reduceProperty.ts\"\n\nconst providesCustomCursorComponent =\n\t(tree: CanvasTree) =>\n\t(node: CanvasNode): node is NodeProvidingCursorComponent => {\n\t\treturn isNodeProvidingCustomCursorComponent(tree, node)\n\t}\n\n/**\n * Find the nearest ancestor of the provided node that provides a custom cursor\n * component.\n */\nexport function getAncestorProvidingCursorComponent(\n\ttree: CanvasTree,\n\tnode: CanvasNode,\n): NodeProvidingCursorComponent | null {\n\treturn tree.getAncestorThatMatches(node, providesCustomCursorComponent(tree))\n}\n\nexport interface ReducedCursor extends Omit<\n\tReducedRecord<WithCursor>,\n\t\"customCursorVariant\" | \"customCursorPlacement\" | \"customCursorTransition\"\n> {\n\tcustomCursorVariant: Set<string | undefined>\n\tcustomCursorPlacement: Set<FloatingPlacement>\n\tcustomCursorTransition: Reduced<ReducedEffectTransition | undefined>\n\tonlyNodesWithCursor: boolean\n}\n\nexport function reduceCursor(tree: CanvasTree, node: CanvasNode, result: ReducedCursor) {\n\tif (!withCursor(node) || isBreakpointWithLayoutTemplate(node)) {\n\t\tresult.onlyNodesWithCursor = false\n\t\treturn\n\t}\n\n\treduceProperty(\"cursor\", result, node)\n\treduceProperty(\"customCursorFollow\", result, node, v => v ?? false)\n\treduceProperty(\"customCursorTransitionEnabled\", result, node)\n\treduceProperty(\"customCursorOffsetX\", result, node, v => v ?? DEFAULT_CURSOR_OFFSET)\n\treduceProperty(\"customCursorOffsetY\", result, node, v => v ?? DEFAULT_CURSOR_OFFSET)\n\treduceProperty(\"customCursorAlignment\", result, node, v => v ?? DEFAULT_FLOATING_ALIGNMENT)\n\treduceProperty(\"customCursorType\", result, node)\n\n\tresult.customCursorTransition = getReducedEffectTransition(node.customCursorTransition, result.customCursorTransition)\n\n\t// Determine the default cursor variant from the custom cursor smart component.\n\tlet smartComponentId = node.customCursorSmartComponentId\n\tif (result.customCursorSmartComponentId !== Mixed && node.customCursorType === CustomCursorType.Variant) {\n\t\t// If the node set's the variant of an ancestor's component, and only\n\t\t// when the component is not Mixed, find the ancestor that provides the\n\t\t// custom cursor component smart component id. This check can be\n\t\t// expensive as it walks up the tree, so its key that it is only\n\t\t// performed when the results will be useful.\n\t\tsmartComponentId = getAncestorProvidingCursorComponent(tree, node)?.customCursorSmartComponentId\n\t}\n\n\tconst smartComponent = tree.get(smartComponentId)\n\tconst variant = isSmartComponentNode(smartComponent)\n\t\t? // Set the default variant so the UI reflects the code-generated result if\n\t\t\t// no variant is chosen.\n\t\t\t(node.customCursorVariant ?? smartComponent.getPossiblyNonLoadedBaseVariantId())\n\t\t: undefined\n\n\tresult.customCursorVariant.add(variant)\n\t// Set the default floating placement (bottom) so that the UI reflects what\n\t// will be code generated.\n\tresult.customCursorPlacement.add(node.customCursorPlacement ?? DEFAULT_FLOATING_PLACEMENT)\n\n\tif (isNotFound(result.customCursorSmartComponentId)) {\n\t\tresult.customCursorSmartComponentId = smartComponentId\n\t} else if (\n\t\tresult.customCursorSmartComponentId !== Mixed &&\n\t\tvaluesAreDifferent(result.customCursorSmartComponentId, smartComponentId)\n\t) {\n\t\tresult.customCursorSmartComponentId = Mixed\n\t}\n}\n", "import type { CanvasNode } from \"../../index.ts\"\nimport type { WithDataNosnippet } from \"../WithDataNosnippet.ts\"\nimport { withDataNosnippet } from \"../WithDataNosnippet.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedDataNosnippet extends ReducedRecord<WithDataNosnippet> {\n\tonlyNodesWithDataNosnippet: boolean\n}\n\nexport function reduceDataNosnippet(node: CanvasNode, result: ReducedDataNosnippet): void {\n\tif (!withDataNosnippet(node)) {\n\t\tresult.onlyNodesWithDataNosnippet = false\n\t\treturn\n\t}\n\n\treduceProperty(\"dataNosnippet\", result, node)\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { type WithDataRepeaterArray, withDataRepeaterArray } from \"../WithRepeaterDataSource.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport type ReducedDataRepeaterArray = ReducedRecord<Pick<WithDataRepeaterArray, \"dataRepeaterArray\">>\n\nexport function reduceDataRepeaterArray(node: CanvasNode, result: ReducedDataRepeaterArray) {\n\tif (withDataRepeaterArray(node)) {\n\t\treduceProperty(\"dataRepeaterArray\", result, node)\n\t}\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { NodeID } from \"../../nodes/NodeID.ts\"\nimport { isDataRepeater } from \"../../nodes/utils/nodeCheck.ts\"\nimport type { NotFound } from \"./Reduced.ts\"\n\nexport interface ReducedDataRepeaterId {\n\trepeaterId: NodeID | NotFound\n\trepeaterOriginalId: NodeID | NotFound\n}\n\nexport function reduceDataRepeaterId(nodes: CanvasNode[], result: ReducedDataRepeaterId) {\n\tif (nodes.length !== 1) return\n\tconst node = nodes[0]\n\tif (!isDataRepeater(node)) return\n\n\tresult.repeaterId = node.id\n\tresult.repeaterOriginalId = node.getPrimaryId()\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { WithCollectionDataSource } from \"../WithCollectionDataSource.ts\"\nimport { withCollectionDataSource } from \"../WithCollectionDataSource.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport type ReducedDataSource = ReducedRecord<Pick<WithCollectionDataSource, \"dataIdentifier\">>\n\nexport function reduceDataSource(node: CanvasNode, result: ReducedDataSource) {\n\tif (withCollectionDataSource(node)) {\n\t\treduceProperty(\"dataIdentifier\", result, node)\n\t}\n}\n", "import type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport { isFixedOrRelativeOverlay } from \"../../nodes/utils/overlayHelpers.ts\"\nimport type { WithDragEffect } from \"../WithDragEffect.ts\"\nimport { withDragEffect } from \"../WithDragEffect.ts\"\nimport type { Reduced, ReducedRecord } from \"./Reduced.ts\"\nimport { type ReducedEffectTransition, getReducedEffectTransition } from \"./reduceEffectTransition.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedDragEffect extends ReducedRecord<Omit<WithDragEffect, \"dragEffectTransition\">> {\n\tonlyNodesWithDragEffect: boolean\n\tdragEffectTransition: Reduced<ReducedEffectTransition | undefined>\n}\n\nexport function reduceDragEffect(node: CanvasNode, result: ReducedDragEffect) {\n\tif (!withDragEffect(node) || isFixedOrRelativeOverlay(node)) {\n\t\tresult.onlyNodesWithDragEffect = false\n\t\treturn\n\t}\n\n\treduceProperty(\"dragEffectEnabled\", result, node)\n\treduceProperty(\"dragEffectSnapBack\", result, node)\n\treduceProperty(\"dragEffectMomentum\", result, node)\n\treduceProperty(\"dragEffectFreeform\", result, node)\n\treduceProperty(\"dragEffectConstraintElement\", result, node)\n\treduceProperty(\"dragEffectConstraintItem\", result, node)\n\n\tresult.dragEffectTransition = getReducedEffectTransition(node.dragEffectTransition, result.dragEffectTransition)\n}\n", "import type { CanvasNode } from \"../../index.ts\"\nimport type { WithDraggable } from \"../WithDraggable.ts\"\nimport { withDraggable } from \"../WithDraggable.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedDraggable extends ReducedRecord<WithDraggable> {\n\tonlyNodesWithDraggable: boolean\n}\n\nexport function reduceDraggable(node: CanvasNode, result: ReducedDraggable) {\n\tif (!withDraggable(node)) {\n\t\tresult.onlyNodesWithDraggable = false\n\t\treturn\n\t}\n\n\treduceProperty(\"draggable\", result, node)\n}\n", "import { assertNever } from \"@framerjs/shared\"\nimport { type CanvasNode, isVectorNode } from \"document/models/CanvasTree/index.ts\"\nimport { ScopeType } from \"document/utils/scopeType.ts\"\nimport React from \"react\"\nimport type { KeysSupportingVariables } from \"../../utils/allVariableKeys.ts\"\nimport { allVariableKeys, allVariableKeysRecord } from \"../../utils/allVariableKeys.ts\"\n\nexport interface ReducedEnabledVariableProperties {\n\tpropertiesSupportingVariables: Record<KeysSupportingVariables, boolean>\n}\n\nexport function reduceEnabledVariableProperties(\n\tnode: CanvasNode,\n\tresult: ReducedEnabledVariableProperties,\n\tscopeType: ScopeType | undefined,\n) {\n\tfor (const key of allVariableKeys) {\n\t\tif (result.propertiesSupportingVariables[key] === false) continue\n\t\tresult.propertiesSupportingVariables[key] =\n\t\t\tnode.supportsDynamicValues() && nodeSupportsVariableInScope(node, key, scopeType)\n\t}\n}\n\nconst allVariableKeysDisabledRecord = Object.fromEntries(\n\tObject.keys(allVariableKeysRecord).map((key: KeysSupportingVariables) => [key, false]),\n) as Record<KeysSupportingVariables, boolean>\n\n// By default disable all keys, so if the UI is not wrapped in the context, it would not support variables.\nconst SupportedVariablePropertiesContext =\n\tReact.createContext<Record<KeysSupportingVariables, boolean>>(allVariableKeysDisabledRecord)\n\nSupportedVariablePropertiesContext.displayName = \"SupportedVariablePropertiesContext\"\nexport const SupportedVariablePropertiesProvider = SupportedVariablePropertiesContext.Provider\n\nexport const useSupportsVariable = (property: KeysSupportingVariables) =>\n\tReact.useContext(SupportedVariablePropertiesContext)[property]\n\nfunction nodeSupportsVariableInScope(node: CanvasNode, key: KeysSupportingVariables, scopeType: ScopeType | undefined) {\n\tswitch (key) {\n\t\tcase \"fillColor\":\n\t\tcase \"fillOpacity\":\n\t\tcase \"opacity\":\n\t\tcase \"strokeColor\":\n\t\tcase \"strokeWidth\":\n\t\t\tif (isVectorNode(node)) return scopeType === ScopeType.VectorSet\n\t\t\treturn true\n\t\tcase \"ariaLabel\":\n\t\tcase \"backdropDismissible\":\n\t\tcase \"backdropFill\":\n\t\tcase \"backgroundBlur\":\n\t\tcase \"blendingMode\":\n\t\tcase \"blur\":\n\t\tcase \"borderEnabled\":\n\t\tcase \"boxShadows\":\n\t\tcase \"brightness\":\n\t\tcase \"contrast\":\n\t\tcase \"cursor\":\n\t\tcase \"customCursorType\":\n\t\tcase \"dataRepeaterArray\":\n\t\tcase \"dragEffectConstraintItem\":\n\t\tcase \"draggable\":\n\t\tcase \"dynamicVectorSetIdentifier\":\n\t\tcase \"fillImage\":\n\t\tcase \"fontSize\":\n\t\tcase \"formBooleanInputValue\":\n\t\tcase \"formInputAutofillEnabled\":\n\t\tcase \"formInputAutoFocus\":\n\t\tcase \"formInputHidden\":\n\t\tcase \"formInputMaxLength\":\n\t\tcase \"formInputName\":\n\t\tcase \"formInputPlaceholder\":\n\t\tcase \"formInputRequired\":\n\t\tcase \"formInputStep\":\n\t\tcase \"formInputValue\":\n\t\tcase \"formOnSuccessRedirectUrl\":\n\t\tcase \"formSubmitTrackingId\":\n\t\tcase \"formTextAreaResizable\":\n\t\tcase \"formTextInputMaxNumber\":\n\t\tcase \"formTextInputMinNumber\":\n\t\tcase \"formTextInputType\":\n\t\tcase \"gap\":\n\t\tcase \"grayscale\":\n\t\tcase \"gridItemColumnSpan\":\n\t\tcase \"gridItemRowSpan\":\n\t\tcase \"hideScrollbars\":\n\t\tcase \"htmlContent\":\n\t\tcase \"hueRotate\":\n\t\tcase \"imageRendering\":\n\t\tcase \"invert\":\n\t\tcase \"lightboxEffectBackdrop\":\n\t\tcase \"link\":\n\t\tcase \"linkClickTrackingId\":\n\t\tcase \"linkOpenInNewTab\":\n\t\tcase \"linkPreserveParams\":\n\t\tcase \"linkRelValues\":\n\t\tcase \"linkSmoothScroll\":\n\t\tcase \"overflow\":\n\t\tcase \"overflowX\":\n\t\tcase \"overflowY\":\n\t\tcase \"overscrollBehavior\":\n\t\tcase \"padding\":\n\t\tcase \"perspective\":\n\t\tcase \"pointerEvents\":\n\t\tcase \"radius\":\n\t\tcase \"cornerShape\":\n\t\tcase \"repeatArray\":\n\t\tcase \"rotation\":\n\t\tcase \"saturate\":\n\t\tcase \"sepia\":\n\t\tcase \"stackAlignment\":\n\t\tcase \"stackDirection\":\n\t\tcase \"stackDistribution\":\n\t\tcase \"styleAppearEffectScrollTarget\":\n\t\tcase \"styleAppearEffectScrollTargetCollectionItem\":\n\t\tcase \"tabIndex\":\n\t\tcase \"tapHighlightColor\":\n\t\tcase \"textColor\":\n\t\tcase \"textBackgroundColor\":\n\t\tcase \"textContent\":\n\t\tcase \"textEffectScrollTarget\":\n\t\tcase \"textEffectScrollTargetCollectionItem\":\n\t\tcase \"textTruncation\":\n\t\tcase \"tickerEffectVelocity\":\n\t\tcase \"tickerEffectHoverModifier\":\n\t\tcase \"tickerEffectDirectionModifier\":\n\t\tcase \"tickerEffectDraggable\":\n\t\tcase \"transition\":\n\t\tcase \"userSelect\":\n\t\tcase \"variantTransition\":\n\t\tcase \"variableBinding\":\n\t\tcase \"visible\":\n\t\tcase \"zIndex\":\n\t\t\treturn !isVectorNode(node)\n\t\tdefault:\n\t\t\tassertNever(key)\n\t}\n}\n", "import type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport { type WithFillOpacity, withFillOpacity } from \"../WithFill.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport type ReducedFillOpacity = ReducedRecord<WithFillOpacity>\n\nexport function reduceFillOpacity(node: CanvasNode, result: ReducedFillOpacity) {\n\tif (!withFillOpacity(node)) return\n\n\treduceProperty(\"fillOpacity\", result, node)\n}\n", "import type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport type { WithFilters } from \"../WithFilters.ts\"\nimport { withFilters } from \"../WithFilters.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nconst filters: (keyof WithFilters)[] = [\n\t\"blur\",\n\t\"backgroundBlur\",\n\t\"brightness\",\n\t\"contrast\",\n\t\"grayscale\",\n\t\"hueRotate\",\n\t\"invert\",\n\t\"saturate\",\n\t\"sepia\",\n]\n\nexport type ReducedFilters = ReducedRecord<WithFilters> & { onlyNodesWithFilters: boolean }\n\nexport function reduceFilters(node: CanvasNode, result: ReducedFilters) {\n\tif (!withFilters(node)) {\n\t\tresult.onlyNodesWithFilters = false\n\t\treturn\n\t}\n\n\tfilters.forEach(filterKey => {\n\t\treduceProperty(filterKey, result, node)\n\t})\n}\n", "import type { CanvasTree } from \"../../CanvasTree.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { isValidOverlay } from \"../../nodes/utils/overlayHelpers.ts\"\nimport type { FloatingPlacement, WithFloatingPosition } from \"../WithFloatingPosition.ts\"\nimport {\n\tDEFAULT_FLOATING_COLLISION_PADDING,\n\tDEFAULT_FLOATING_PLACEMENT,\n\thasFloatingPosition,\n} from \"../WithFloatingPosition.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedFloatingPosition extends ReducedRecord<\n\tOmit<WithFloatingPosition, \"floatingPositionEnabled\" | \"floatingTransformOrigin\" | \"floatingPlacement\">\n> {\n\tonlyNodesWithFloatingPosition: boolean\n\tfloatingPlacement: Set<FloatingPlacement>\n}\n\nexport function reduceFloatingPosition(tree: CanvasTree, node: CanvasNode, result: ReducedFloatingPosition) {\n\tif (!hasFloatingPosition(node) || !isValidOverlay(node, tree)) {\n\t\tresult.onlyNodesWithFloatingPosition = false\n\t\treturn\n\t}\n\n\treduceProperty(\"floatingAlignment\", result, node)\n\treduceProperty(\"floatingOffsetX\", result, node)\n\treduceProperty(\"floatingOffsetY\", result, node)\n\treduceProperty(\"floatingCollisionDetection\", result, node, v => v ?? false)\n\treduceProperty(\"floatingSafeArea\", result, node, v => v ?? true)\n\n\t// Relative Overlays render with floating position defaults if the values\n\t// are not set. Ensure the UI reflects those defaults.\n\treduceProperty(\"floatingCollisionPadding\", result, node, v => v ?? DEFAULT_FLOATING_COLLISION_PADDING)\n\tresult.floatingPlacement.add(node.floatingPlacement ?? DEFAULT_FLOATING_PLACEMENT)\n}\n", "import type { CanvasNode, CanvasTree } from \"document/models/CanvasTree/index.ts\"\nimport type { Transition } from \"document/models/Transition.ts\"\nimport type { ScopeType } from \"document/utils/scopeType.ts\"\nimport { isFixedOrRelativeOverlay } from \"../../nodes/utils/overlayHelpers.ts\"\nimport type { WithFlowEffect } from \"../WithFlowEffect.ts\"\nimport { isFlowEffectSupportedScopeType, withFlowEffect } from \"../WithFlowEffect.ts\"\nimport type { Reduced, ReducedRecord } from \"./Reduced.ts\"\nimport { type ReducedEffectTransition, getReducedEffectTransition } from \"./reduceEffectTransition.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedFlowEffect extends ReducedRecord<Omit<WithFlowEffect, \"flowEffectTransition\">> {\n\tonlyNodesWithFlowEffect: boolean\n\tflowEffectTransition: Reduced<ReducedEffectTransition | undefined>\n}\n\nexport function reduceFlowEffect(\n\ttree: CanvasTree,\n\tnode: CanvasNode,\n\tresult: ReducedFlowEffect,\n\tscopeType: ScopeType | undefined,\n) {\n\tif (\n\t\t!withFlowEffect(node) ||\n\t\tisFixedOrRelativeOverlay(node) ||\n\t\t(scopeType && !isFlowEffectSupportedScopeType(scopeType))\n\t) {\n\t\tresult.onlyNodesWithFlowEffect = false\n\t\treturn\n\t}\n\n\treduceProperty(\"flowEffectEnabled\", result, node)\n\n\tconst transition = node.flowEffectTransition ?? getAncestorFlowEffectTransition(tree, node)\n\tresult.flowEffectTransition = getReducedEffectTransition(transition, result.flowEffectTransition)\n}\n\nfunction getAncestorFlowEffectTransition(tree: CanvasTree, node: CanvasNode): Transition | undefined {\n\tlet ancestorId = node.cache.flowEffectAncestorId\n\twhile (ancestorId) {\n\t\tconst ancestor = tree.get(ancestorId)\n\n\t\tif (!ancestor) return undefined\n\n\t\tif (withFlowEffect(ancestor)) {\n\t\t\treturn ancestor.flowEffectTransition\n\t\t}\n\n\t\tancestorId = ancestor.cache.flowEffectAncestorId\n\t}\n\treturn undefined\n}\n", "import { Mixed, isMixed } from \"@framerjs/shared\"\nimport { isEqual } from \"library/index.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { isDynamicValue, isDynamicValueEqual } from \"../DynamicValue.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { isNotFound } from \"./Reduced.ts\"\n\n/**\n * Given a property key, a collection target object, and a canvas node that\n * supports that property key (and the property key is an object type), reduce the\n * value into the collection target.\n * The value can optionally be transformed before comparing it to the reduced\n * result. This can for example be necessary when a value is optional but\n * being undefined resulting in a fallback being used.\n *\n * - If the collection target does not yet have a value for the property, the\n *   node's value will be set on the collection target.\n * - If the collection target has a value for the property, and it is different\n *   than the value on the node, the property will be set to Mixed on the\n *   collection target. We also support comparing dynamic values.\n * - If the collection target already has a Mixed value for the property,\n *   nothing will happen.\n */\nexport function reduceObjectProperty<N extends CanvasNode, K extends keyof N, T extends N[K]>(\n\tkey: K,\n\tresult: Pick<ReducedRecord<N>, K>,\n\tnode: N,\n\ttransform?: (currentValue: N[K]) => T | Mixed,\n) {\n\tconst reducedValue = result[key]\n\tif (isMixed(reducedValue)) return\n\n\tconst nodeValue = node[key]\n\tconst value = transform ? transform(nodeValue) : nodeValue\n\tif (isNotFound(reducedValue)) {\n\t\tresult[key] = value\n\t} else if (objectsAreDifferent(value, reducedValue)) {\n\t\tresult[key] = Mixed\n\t}\n}\n\n/**\n * Check if objects are different. Supporting both value and variable reference types.\n */\nexport function objectsAreDifferent(a: unknown, b: unknown): boolean {\n\tif (isDynamicValue(a)) return !isDynamicValueEqual(a, b)\n\tif (isDynamicValue(b)) return true\n\n\treturn !isEqual(a, b)\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { WithFormBooleanInputType } from \"../forms/WithFormBooleanInputType.ts\"\nimport { defaultBooleanInputType, withFormBooleanInputType } from \"../forms/WithFormBooleanInputType.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceObjectProperty } from \"./reduceObjectProperty.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\nimport type { ReducedShadowList } from \"./reduceShadows.ts\"\nimport { reduceShadowList } from \"./reduceShadows.ts\"\n\nexport interface ReducedFormBooleanInputType extends Omit<\n\tReducedRecord<WithFormBooleanInputType>,\n\t\"formBooleanInputCheckedBoxShadow\"\n> {\n\tonlyNodesWithBooleanInputType: boolean\n\tformBooleanInputCheckedBoxShadow: ReducedShadowList\n}\n\nexport function reduceFormBooleanInputType(node: CanvasNode, result: ReducedFormBooleanInputType) {\n\tif (!withFormBooleanInputType(node)) {\n\t\tresult.onlyNodesWithBooleanInputType = false\n\t\treturn\n\t}\n\n\treduceProperty(\"formBooleanInputType\", result, node, v => v ?? defaultBooleanInputType)\n\treduceProperty(\"formBooleanInputValue\", result, node)\n\treduceProperty(\"formBooleanInputCheckedBorderWidth\", result, node)\n\treduceProperty(\"formBooleanInputCheckedBorderColor\", result, node)\n\treduceProperty(\"formBooleanInputCheckedBorderStyle\", result, node)\n\treduceProperty(\"formBooleanInputCheckedFillColor\", result, node)\n\treduceObjectProperty(\"formBooleanInputCheckedTransition\", result, node)\n\n\tresult.formBooleanInputCheckedBoxShadow = reduceShadowList(\n\t\tnode.formBooleanInputCheckedBoxShadow,\n\t\tresult.formBooleanInputCheckedBoxShadow,\n\t)\n}\n", "import type { CanvasTree } from \"../../CanvasTree.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { WithFormContainer } from \"../forms/WithFormContainer.ts\"\nimport { isFormContainer } from \"../forms/WithFormContainer.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedFormContainer\n\textends\n\t\tReducedRecord<\n\t\t\tPick<\n\t\t\t\tWithFormContainer,\n\t\t\t\t\"formOnSuccessRedirectUrl\" | \"formSubmitTrackingId\" | \"formCaptchaProvider\" | \"formCaptchaSiteKey\"\n\t\t\t>\n\t\t>,\n\t\tPick<WithFormContainer, \"formSaveId\"> {\n\tonlyFormContainerNodes: boolean\n\tanyFormContainerNodes: boolean\n}\n\nexport function reduceFormContainer(tree: CanvasTree, node: CanvasNode, result: ReducedFormContainer) {\n\tif (!isFormContainer(node)) {\n\t\tresult.onlyFormContainerNodes = false\n\t\treturn\n\t}\n\n\tresult.anyFormContainerNodes = true\n\n\tconst originalNode = tree.get(node.getPrimaryId())\n\tif (!originalNode || originalNode.originalid || !isFormContainer(originalNode)) return\n\t// We don't reduce the formSaveId. We don't support multiselect for the form\n\t// panel, so we can always use the first saveId in the selection.\n\tresult.formSaveId = result.formSaveId ?? originalNode.formSaveId\n\n\treduceProperty(\"formOnSuccessRedirectUrl\", result, originalNode)\n\treduceProperty(\"formSubmitTrackingId\", result, originalNode)\n\treduceProperty(\"formCaptchaProvider\", result, originalNode)\n\treduceProperty(\"formCaptchaSiteKey\", result, originalNode)\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { withFormBooleanInputType } from \"../forms/WithFormBooleanInputType.ts\"\nimport type { WithFormInput } from \"../forms/WithFormInput.ts\"\nimport { withFormInput } from \"../forms/WithFormInput.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedFormInput extends ReducedRecord<WithFormInput> {\n\tonlyFormInputNodes: boolean\n\tanyFormInputNodes: boolean\n\tonlyNodesWithRequired: boolean\n\tanyRadioButton: boolean\n}\n\n/**\n * reduceFormInput reduces the properties that are common to all form element nodes.\n */\nexport function reduceFormInput(node: CanvasNode, result: ReducedFormInput) {\n\tif (!withFormInput(node)) {\n\t\tresult.onlyFormInputNodes = false\n\t\treturn\n\t}\n\n\tresult.anyFormInputNodes = true\n\n\t// Radio's don't support required.\n\tconst isRadioButton = withFormBooleanInputType(node) && node.formBooleanInputType === \"radio\"\n\tif (isRadioButton) {\n\t\tresult.onlyNodesWithRequired = false\n\t\tresult.anyRadioButton = true\n\t}\n\n\treduceProperty(\"formInputName\", result, node)\n\treduceProperty(\"formInputRequired\", result, node)\n\treduceProperty(\"formInputHidden\", result, node)\n\treduceProperty(\"formInputValue\", result, node)\n\treduceProperty(\"formInputAutoFocus\", result, node)\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { WithFormInputAutofillEnabled } from \"../forms/WithFormInputAutofillEnabled.ts\"\nimport { withFormInputAutofillEnabled } from \"../forms/WithFormInputAutofillEnabled.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedFormInputAutofillEnabled extends ReducedRecord<WithFormInputAutofillEnabled> {\n\tonlyNodesWithAutofillEnabled: boolean\n}\n\nexport function reduceFormInputAutofillEnabled(node: CanvasNode, result: ReducedFormInputAutofillEnabled) {\n\tif (!withFormInputAutofillEnabled(node)) {\n\t\tresult.onlyNodesWithAutofillEnabled = false\n\t\treturn\n\t}\n\n\treduceProperty(\"formInputAutofillEnabled\", result, node)\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { isFormBooleanInputNode } from \"../../nodes/utils/nodeCheck.ts\"\nimport { isDynamicValue } from \"../DynamicValue.ts\"\nimport type { WithFormInputIcon } from \"../forms/WithFormInputIcon.ts\"\nimport { withFormInputIcon } from \"../forms/WithFormInputIcon.ts\"\nimport { withFormTextInputType } from \"../forms/WithTextInputType.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { NotFound } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedFormInputIcon extends ReducedRecord<WithFormInputIcon> {\n\tonlyNodesWithInputIconRow: boolean\n}\n\nexport function reduceFormInputIcon(node: CanvasNode, result: ReducedFormInputIcon) {\n\tif (!withFormInputIcon(node)) {\n\t\t// Reset the value if we encounter a node that doesn't support the trait, so we won't render the UI.\n\t\tresult.formInputIconColor = NotFound\n\t\tresult.formInputIconImage = NotFound\n\t\treturn\n\t}\n\n\t// Boolean input nodes show the icon rows in the checked style popout. Any non-date/time inputs don't show the icon\n\t// row.\n\tif (result.onlyNodesWithInputIconRow) {\n\t\tresult.onlyNodesWithInputIconRow = nodeSupportsTopLevelInputIconRow(node)\n\t}\n\n\treduceProperty(\"formInputIconImage\", result, node)\n\treduceProperty(\"formInputIconColor\", result, node)\n}\n\nfunction nodeSupportsTopLevelInputIconRow(node: CanvasNode): boolean {\n\tif (isFormBooleanInputNode(node)) return false\n\tif (withFormTextInputType(node)) {\n\t\treturn (\n\t\t\tisDynamicValue(node.formTextInputType) ||\n\t\t\tnode.formTextInputType === \"date\" ||\n\t\t\tnode.formTextInputType === \"time\" ||\n\t\t\tnode.formTextInputType === \"text\"\n\t\t)\n\t}\n\treturn true\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { WithFormInputInvalidStyles } from \"../forms/WithFormInputInvalidStyles.ts\"\nimport { withFormInputInvalidStyles } from \"../forms/WithFormInputInvalidStyles.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedFormInputInvalidStyles extends ReducedRecord<WithFormInputInvalidStyles> {\n\tonlyNodesWithFormInputInvalidStyles: boolean\n}\n\nexport function reduceFormInputInvalidStyles(node: CanvasNode, result: ReducedFormInputInvalidStyles) {\n\tif (!withFormInputInvalidStyles(node)) {\n\t\tresult.onlyNodesWithFormInputInvalidStyles = false\n\t\treturn\n\t}\n\n\treduceProperty(\"formInputInvalidTextColor\", result, node)\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { WithFormInputPlaceholder } from \"../forms/WithFormInputPlaceholder.ts\"\nimport { inputSupportsPlaceholder, withFormInputPlaceholder } from \"../forms/WithFormInputPlaceholder.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedFormInputPlaceholder extends ReducedRecord<\n\tOmit<WithFormInputPlaceholder, \"formInputPlaceholderLocalized\">\n> {\n\tonlyFormInputNodesWithPlaceholder: boolean\n\tonlyFormInputNodesWithPlaceholderColor: boolean\n}\n\n/**\n * reduceFormInputPlaceholder only reduces nodes where\n * the corresponding HTML element being rendered\n * supports the HTML 'placeholder' attribute.\n */\nexport function reduceFormInputPlaceholder(node: CanvasNode, result: ReducedFormInputPlaceholder) {\n\tif (!withFormInputPlaceholder(node)) {\n\t\tresult.onlyFormInputNodesWithPlaceholder = false\n\t\tresult.onlyFormInputNodesWithPlaceholderColor = false\n\t\treturn\n\t}\n\n\tif (!inputSupportsPlaceholder(node)) {\n\t\tresult.onlyFormInputNodesWithPlaceholder = false\n\t} else {\n\t\treduceProperty(\"formInputPlaceholder\", result, node)\n\t}\n\n\treduceProperty(\"formInputPlaceholderColor\", result, node)\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { WithFormInputStep } from \"../forms/WithFormInputStep.ts\"\nimport { withFormInputStep } from \"../forms/WithFormInputStep.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedFormInputStep extends ReducedRecord<WithFormInputStep> {\n\tonlyNodesWithFormInputStep: boolean\n}\n\n/**\n * reduceFormInputType only reduces nodes where\n * the corresponding html element being rendered\n * supports the 'type' attribute. This is only\n * relevant for <input> elements.\n */\nexport function reduceFormInputStep(node: CanvasNode, result: ReducedFormInputStep) {\n\tif (!withFormInputStep(node)) {\n\t\tresult.onlyNodesWithFormInputStep = false\n\t\treturn\n\t}\n\treduceProperty(\"formInputStep\", result, node)\n}\n", "import { Mixed, isMixed } from \"@framerjs/shared\"\nimport { formSelectGenericOptionDefaults } from \"document/models/CanvasTree/traits/WithVariableBinding.ts\"\nimport { isUndefined } from \"utils/typeChecks.ts\"\nimport type { CanvasTree } from \"../../CanvasTree.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { isFormSelectNode } from \"../../nodes/utils/nodeCheck.ts\"\nimport type { FormSelectOption } from \"../forms/WithFormSelect.ts\"\nimport { withFormSelect } from \"../forms/WithFormSelect.ts\"\nimport type { Reduced } from \"./Reduced.ts\"\nimport { isFound, isNotFound } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\ntype ReducedFormSelectOptions = Reduced<FormSelectOption[]>\nexport interface ReducedFormSelect {\n\tonlyNodesWithSelect: boolean\n\tanyNodeWithSelect: boolean\n\tformSelectOptions: ReducedFormSelectOptions\n\tallItemsLabel: Reduced<string>\n\tbooleanTrueLabel: Reduced<string>\n\tbooleanFalseLabel: Reduced<string>\n}\n\nconst emptyOptions: readonly FormSelectOption[] = []\nexport function reduceFormSelect(tree: CanvasTree, node: CanvasNode, result: ReducedFormSelect) {\n\t// We don't allow select options override at the moment, reduce from the original node.\n\tconst originalNode = tree.get(node.getPrimaryId())\n\tif (!originalNode || originalNode.originalid || !withFormSelect(originalNode)) {\n\t\tresult.onlyNodesWithSelect = false\n\t\treturn\n\t}\n\n\tresult.anyNodeWithSelect = true\n\n\treduceFormSelectGenericOptionLabels(node, result)\n\n\tif (isMixed(result.formSelectOptions)) return\n\n\tconst selectOptions = originalNode.formSelectOptions ?? emptyOptions\n\tif (isNotFound(result.formSelectOptions)) {\n\t\tresult.formSelectOptions = [...selectOptions]\n\t\treturn\n\t}\n\n\t// @TODO: we could choose to do it like shadow where we merge the reduced result so that each individual prop can\n\t// be mixed, if it proves to boost productivity. But for now consider it mixed with multi-selection, we will not\n\t// render the row, as it's uncommon to have identical select options on mutliple selects.\n\tif (isFound(result.formSelectOptions)) {\n\t\tresult.formSelectOptions = Mixed\n\t}\n}\n\nfunction reduceFormSelectGenericOptionLabels(node: CanvasNode, result: ReducedFormSelect) {\n\tif (!isFormSelectNode(node)) return\n\n\treduceProperty(\"allItemsLabel\", result, node, value =>\n\t\tisUndefined(value) ? formSelectGenericOptionDefaults.allItemsLabel : value,\n\t)\n\treduceProperty(\"booleanTrueLabel\", result, node, value =>\n\t\tisUndefined(value) ? formSelectGenericOptionDefaults.booleanTrueLabel : value,\n\t)\n\treduceProperty(\"booleanFalseLabel\", result, node, value =>\n\t\tisUndefined(value) ? formSelectGenericOptionDefaults.booleanFalseLabel : value,\n\t)\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { WithFormTextInputType } from \"../forms/WithTextInputType.ts\"\nimport { isFormTextAreaInput, withFormTextInputType } from \"../forms/WithTextInputType.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedFormTextInputType extends ReducedRecord<WithFormTextInputType> {\n\tonlyNodesWithTextInputType: boolean\n\tonlyFormTextAreaNodes: boolean\n}\n\n/**\n * reduceFormInputType only reduces nodes where\n * the corresponding html element being rendered\n * supports the 'type' attribute. This is only\n * relevant for <input> elements.\n */\nexport function reduceFormTextInputType(node: CanvasNode, result: ReducedFormTextInputType) {\n\tif (!withFormTextInputType(node)) {\n\t\tresult.onlyNodesWithTextInputType = false\n\t\tresult.onlyFormTextAreaNodes = false\n\t\treturn\n\t}\n\n\tif (!isFormTextAreaInput(node)) result.onlyFormTextAreaNodes = false\n\n\treduceProperty(\"formTextInputType\", result, node, v => v ?? \"text\")\n\treduceProperty(\"formTextAreaResizable\", result, node)\n\treduceProperty(\"formTextInputMinNumber\", result, node)\n\treduceProperty(\"formTextInputMaxNumber\", result, node)\n\treduceProperty(\"formInputMaxLength\", result, node)\n}\n", "import { Mixed } from \"@framerjs/shared\"\nimport { isPositionRelative } from \"document/models/CanvasTree/traits/utils/positionTypeHelpers.ts\"\nimport { isNumber } from \"utils/typeChecks.ts\"\nimport type { CanvasTree } from \"../../CanvasTree.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { isGridComponent } from \"../../nodes/utils/nodeCheck.ts\"\nimport type { DynamicValue } from \"../DynamicValue.ts\"\nimport type { GridItemAlignment, GridItemColumnSpan, WithGridItemLayout } from \"../WithGridItemLayout.ts\"\nimport { withGridItemLayout } from \"../WithGridItemLayout.ts\"\nimport type { WithGridItemSize } from \"../WithGridItemSize.ts\"\nimport { hasColumnMasonryLayout } from \"../WithLayout.ts\"\nimport type { Reduced, ReducedRecord } from \"./Reduced.ts\"\nimport { isNotFound } from \"./Reduced.ts\"\nimport { reduceProperty, valuesAreDifferent } from \"./reduceProperty.ts\"\n\nexport interface ReducedGridItemLayout extends ReducedRecord<WithGridItemLayout & WithGridItemSize> {\n\tonlyGridItemNodes: boolean\n\tanyGridItemParentWithRowHeightFitContent: boolean\n\tanyGridItemParentWithMasonryLayout: boolean\n\tgridItemRowSpan: Reduced<number>\n\tgridItemColumnSpan: Reduced<GridItemColumnSpan | DynamicValue>\n}\n\nfunction defaultAlignment(value: GridItemAlignment | undefined): GridItemAlignment {\n\treturn value ?? \"start\"\n}\n\nfunction defaultGridColumnSpan(\n\tvalue: GridItemColumnSpan | DynamicValue | undefined,\n): GridItemColumnSpan | DynamicValue {\n\treturn value ?? 1\n}\n\nfunction defaultGridRowSpan(value: number | undefined): number {\n\treturn value ?? 1\n}\n\nexport function reduceGridItemLayout(tree: CanvasTree, node: CanvasNode, result: ReducedGridItemLayout) {\n\tif (!withGridItemLayout(node) || node.cache.parentDirected !== \"grid\" || !isPositionRelative(node)) {\n\t\tresult.onlyGridItemNodes = false\n\t\treturn\n\t}\n\n\treduceProperty(\"gridItemHorizontalAlignment\", result, node, defaultAlignment)\n\treduceProperty(\"gridItemVerticalAlignment\", result, node, defaultAlignment)\n\n\t// We don't have to take the row count into account because it auto adjusts\n\t// based on the contents.\n\treduceProperty(\"gridItemRowSpan\", result, node, defaultGridRowSpan)\n\n\tif (node.cache.parentDirectedRowHeightType === \"fit\") {\n\t\tresult.anyGridItemParentWithRowHeightFitContent = true\n\t}\n\n\t// Collect masonry flag once\n\tif (!result.anyGridItemParentWithMasonryLayout) {\n\t\tconst parent = tree.getParent(node.id)\n\t\tif (parent && hasColumnMasonryLayout(parent)) {\n\t\t\tresult.anyGridItemParentWithMasonryLayout = true\n\t\t}\n\t}\n\n\tconst currentResultValue = result.gridItemColumnSpan\n\tif (currentResultValue === Mixed) return\n\n\tlet gridItemColumnSpan = defaultGridColumnSpan(node.gridItemColumnSpan)\n\tif (isNumber(gridItemColumnSpan)) {\n\t\t// We never show a span larger than the current columns, if the column\n\t\t// count is fixed.\n\t\tconst parent = tree.getParent(node.id)\n\t\tif (parent && isGridComponent(parent) && isNumber(parent.gridColumnCount)) {\n\t\t\tgridItemColumnSpan = Math.min(gridItemColumnSpan, parent.gridColumnCount)\n\t\t}\n\t}\n\n\tif (isNotFound(currentResultValue)) {\n\t\tresult.gridItemColumnSpan = gridItemColumnSpan\n\t} else if (valuesAreDifferent(gridItemColumnSpan, currentResultValue)) {\n\t\tresult.gridItemColumnSpan = Mixed\n\t}\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { WithGridItemSize } from \"../WithGridItemSize.ts\"\nimport { withGridItemSize } from \"../WithGridItemSize.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport type ReducedGridItemSize = ReducedRecord<WithGridItemSize>\n\nexport function reduceGridItemSize(node: CanvasNode, result: ReducedGridItemSize) {\n\tif (!withGridItemSize(node) || node.cache.parentDirected !== \"grid\") {\n\t\treturn\n\t}\n\n\treduceProperty(\"gridItemFillCellWidth\", result, node)\n\treduceProperty(\"gridItemFillCellHeight\", result, node)\n}\n", "import { Mixed, isMixed } from \"@framerjs/shared\"\nimport type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport type { OverlayGrid } from \"document/models/CanvasTree/traits/WithOverlayGrid.ts\"\nimport { withOverlayGrid } from \"document/models/CanvasTree/traits/WithOverlayGrid.ts\"\nimport { isUndefined } from \"utils/typeChecks.ts\"\nimport type { Reduced, ReducedSubPropertyRecord } from \"./Reduced.ts\"\nimport { isNotFound } from \"./Reduced.ts\"\n\nexport type OverlayGridProperty = ReducedSubPropertyRecord<OverlayGrid>\n\nexport interface ReducedOverlayGrids {\n\toverlayGrid: Reduced<OverlayGridProperty | undefined>\n}\n\nexport function reduceOverlayGrids(node: CanvasNode, result: ReducedOverlayGrids, displayGrids?: boolean) {\n\tif (!displayGrids || !withOverlayGrid(node)) return\n\n\tconst overlayGrid = node.overlayGrid\n\n\tif (isNotFound(result.overlayGrid)) {\n\t\tresult.overlayGrid = overlayGrid\n\t\t\t? {\n\t\t\t\t\t// Making sure optional properties are always included in the reduced value.\n\t\t\t\t\tsize: undefined,\n\t\t\t\t\tmargin: undefined,\n\t\t\t\t\t...overlayGrid,\n\t\t\t\t}\n\t\t\t: undefined\n\t\treturn\n\t}\n\n\tif (isMixed(result.overlayGrid)) return\n\n\tif (isUndefined(result.overlayGrid) || isUndefined(overlayGrid)) {\n\t\tif (result.overlayGrid !== overlayGrid) {\n\t\t\tresult.overlayGrid = Mixed\n\t\t}\n\t\treturn\n\t}\n\n\t// For nodes with grids after the first, find equal values. Not that we are looping over the\n\t// reduced overlayGrid properties, that's because we don't want to skip optional properties.\n\tlet gridPropertyKey: keyof OverlayGrid\n\tfor (gridPropertyKey in result.overlayGrid) {\n\t\tif (gridPropertyKey === \"identifier\") continue\n\t\t// Mixed props are only set when there are unequal values, and don't need to be checked again.\n\t\tconst reducedValue = result.overlayGrid[gridPropertyKey]\n\t\tif (isMixed(reducedValue)) continue\n\n\t\t// If they are not equal, set the property to Mixed to represent unmatched values.\n\t\tif (reducedValue !== overlayGrid[gridPropertyKey]) {\n\t\t\tresult.overlayGrid[gridPropertyKey] = Mixed\n\t\t}\n\t}\n}\n", "import { getRelatedReplicaNodes } from \"code-generation/utils/isOnlyVisibleInCurrentVariant.ts\"\nimport type { CanvasNode, CanvasTree } from \"../../index.ts\"\nimport { isRichTextNode, isTextNode } from \"../../nodes/utils/nodeCheck.ts\"\nimport { isVariantFormButtonSource } from \"../WithFormVariants.ts\"\nimport type { HTMLTag } from \"../WithHTMLTag.ts\"\nimport { isHTMLTag, isListTag, withHTMLTag } from \"../WithHTMLTag.ts\"\nimport type { HTMLTextTag } from \"../WithHTMLTextTag.ts\"\nimport { withHTMLTextTag } from \"../WithHTMLTextTag.ts\"\nimport { hasLink } from \"../WithLink.ts\"\nimport { isReplicaOrReplicaChild } from \"../WithTemplate.ts\"\nimport { withTextContent } from \"../WithTextContent.ts\"\n\nexport interface ReducedHTMLTags {\n\thtmlTags: Set<HTMLTag | undefined>\n\thtmlTextTags: Set<HTMLTextTag | undefined>\n\tanyNodesWithLinks: boolean\n\tonlyNodesWithLinks: boolean\n\tonlyNodesWithListParents: boolean\n\tonlyNodesWithHTMLTag: boolean\n\tonlyNodesWithFormButton: boolean\n\tonlyNodesWithFormAncestor: boolean\n}\n\n/**\n * If any node has a link, we can't allow changing the tag because the  element must use an `<a/>`.\n */\nconst nodeOrRelatedVariantIsLink = (tree: CanvasTree, node: CanvasNode): boolean => {\n\t//  If the node has a link and it is a variable or non empty string all related variants are links.\n\tif (hasLink(node)) return true\n\tconst originalNode = isReplicaOrReplicaChild(node) ? tree.get(node.originalid) : node\n\tif (!originalNode) return false\n\t// We check if the primary node has a link.\n\tif (hasLink(originalNode)) return true\n\tconst info = getRelatedReplicaNodes(tree, originalNode)\n\n\t// We check if any of the replica nodes have a link.\n\treturn info.some(nodeInfo => hasLink(nodeInfo.relatedNode))\n}\n\nexport function reduceHTMLTags(tree: CanvasTree, node: CanvasNode, result: ReducedHTMLTags) {\n\tif (!isVariantFormButtonSource(tree, node)) {\n\t\tresult.onlyNodesWithFormButton = false\n\t}\n\n\tif (nodeOrRelatedVariantIsLink(tree, node)) {\n\t\tresult.anyNodesWithLinks = true\n\t} else {\n\t\t// If all nodes have links, we also can't allow changing the tag for the\n\t\t// same reason, however we can show `a` as the selected, but disabled,\n\t\t// option.\n\t\tresult.onlyNodesWithLinks = false\n\t}\n\n\tconst parent = tree.getParent(node.id)\n\tif (!parent || !withHTMLTag(parent) || !isListTag(parent.htmlTag)) {\n\t\tresult.onlyNodesWithListParents = false\n\t}\n\n\tif (withHTMLTag(node)) {\n\t\tif (isHTMLTag(node.htmlTag)) result.htmlTags.add(node.htmlTag)\n\t\t// Only nodes in a form container can be labels.\n\t\tif (!node.cache.formContainerAncestorId) result.onlyNodesWithFormAncestor = false\n\t} else {\n\t\tresult.onlyNodesWithHTMLTag = false\n\t}\n\n\tif (isRichTextNode(node)) {\n\t\tconst tags = node.getTextBlockTags(true)\n\t\tfor (const tag of tags) {\n\t\t\tresult.htmlTextTags.add(tag)\n\t\t}\n\t}\n\n\t// TextNodes supported HTMLTextTags. Though they can't be created anymore,\n\t// they can exist in old site projects and be pasted into new ones, so may\n\t// still need their value reduced.\n\tconst isTextNodeWithStringVariable = isTextNode(node) && withTextContent(node) && Boolean(node.textContent)\n\tif (withHTMLTextTag(node) && !isTextNodeWithStringVariable) {\n\t\tresult.htmlTextTags.add(node.htmlTextTag)\n\t}\n}\n", "import type { CanvasNode } from \"../../index.ts\"\nimport { isCodeComponentNode, isVectorInstance } from \"../../nodes/utils/nodeCheck.ts\"\nimport { nodeIsInOverlay } from \"../../nodes/utils/overlayHelpers.ts\"\nimport { withChildren } from \"../WithChildren.ts\"\nimport { hasFloatingPosition } from \"../WithFloatingPosition.ts\"\nimport { withFrameEvents } from \"../WithFrameEvents.ts\"\nimport { hasTickerEffect } from \"../WithTickerEffect.ts\"\n\nexport interface ReducedOverlayTriggerNodes {\n\tonlyNodesInAnOverlay: boolean\n\tonlyNodesSupportingOverlayTrigger: boolean\n}\nexport function reduceHasOverlay(node: CanvasNode, result: ReducedOverlayTriggerNodes) {\n\tif (!nodeIsInOverlay(node) && !hasFloatingPosition(node)) {\n\t\tresult.onlyNodesInAnOverlay = false\n\t}\n\n\tif (result.onlyNodesSupportingOverlayTrigger) {\n\t\tconst canHaveEvents = withFrameEvents(node) || isCodeComponentNode(node)\n\t\tif (!withChildren(node) || hasTickerEffect(node) || !canHaveEvents || isVectorInstance(node)) {\n\t\t\tresult.onlyNodesSupportingOverlayTrigger = false\n\t\t}\n\t}\n}\n", "import type { CanvasNode } from \"../../index.ts\"\nimport { type WithImageRendering, withImageRendering } from \"../WithImageRendering.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedImageRendering extends ReducedRecord<WithImageRendering> {\n\tonlyNodesWithImageRendering: boolean\n}\n\nexport function reduceImageRendering(node: CanvasNode, result: ReducedImageRendering): void {\n\tif (!withImageRendering(node)) {\n\t\tresult.onlyNodesWithImageRendering = false\n\t\treturn\n\t}\n\n\treduceProperty(\"imageRendering\", result, node)\n}\n", "/** Meant for reduced values which can't be determined. */\nexport const NonDeterministic = Symbol(\"NonDeterministic\")\n\n/** Meant for reduced values which can't be determined. */\nexport type NonDeterministic = typeof NonDeterministic\n\nexport function isNonDeterministic(value: unknown): value is NonDeterministic {\n\treturn value === NonDeterministic\n}\n", "import type { ComponentLoader } from \"@framerjs/framer-runtime\"\nimport { Mixed, isMixed, shouldBeNever } from \"@framerjs/shared\"\nimport { getGridFilledRowCount } from \"code-generation/simulatedDOM/grid.ts\"\nimport type { CanvasNode, CanvasTree } from \"document/models/CanvasTree/index.ts\"\nimport { isNumber, isUndefined } from \"utils/typeChecks.ts\"\nimport { isGridComponent } from \"../../nodes/utils/nodeCheck.ts\"\nimport { type DynamicValue, isDynamicValue } from \"../DynamicValue.ts\"\nimport {\n\ttype PixelNumber,\n\ttype TwoPixelNumberShorthand,\n\tgetNumericColumnGapFromShorthand,\n\tgetNumericRowGapFromShorthand,\n} from \"../NumberShorthand.ts\"\nimport type { HasGridLayout, HasStackLayout, LayoutType, WithLayout } from \"../WithLayout.ts\"\nimport { withLayout } from \"../WithLayout.ts\"\nimport { isBreakpointWithLayoutTemplate } from \"../WithLayoutTemplate.ts\"\nimport { NonDeterministic, isNonDeterministic } from \"./NonDeterministic.ts\"\nimport type { NotFound, Reduced, ReducedRecord } from \"./Reduced.ts\"\nimport { isNotFound } from \"./Reduced.ts\"\nimport { isGridRowCountNonDeterministic } from \"./isGridRowCountNonDeterministic.ts\"\nimport { reduceProperty, valuesAreDifferent } from \"./reduceProperty.ts\"\n\nfunction undefinedToZero<T>(value: T | undefined): T | 0 {\n\treturn isUndefined(value) ? 0 : value\n}\n\nfunction undefinedAndNumberToPixelNumber<T>(value: number | undefined | T): T | PixelNumber {\n\tif (isUndefined(value)) return \"0px\"\n\tif (isNumber(value)) return `${value}px`\n\treturn value\n}\n\nfunction columnCountDefault(value: WithLayout[\"gridColumnCount\"]): WithLayout[\"gridColumnCount\"] {\n\treturn value ?? 2\n}\nfunction rowCountDefault(value: WithLayout[\"gridRowCount\"]): WithLayout[\"gridRowCount\"] {\n\treturn value ?? 2\n}\n\nexport type GapAxis = \"both\" | \"x\" | \"y\"\n\nfunction reduceGapAxis(\n\tnode: CanvasNode & WithLayout,\n\tlayout: LayoutType,\n\tcurrent: GapAxis | NotFound,\n): GapAxis | NotFound {\n\tif (current === \"both\") return current\n\tif (layout === \"grid\") return \"both\"\n\n\tif (layout !== \"stack\") {\n\t\tshouldBeNever(layout)\n\t\treturn current\n\t}\n\n\tif (node.stackWrapEnabled === true) return \"both\"\n\n\tswitch (node.stackDirection) {\n\t\tcase \"vertical\":\n\t\t\treturn current === \"x\" ? \"both\" : \"y\"\n\t\tcase \"horizontal\":\n\t\t\treturn current === \"y\" ? \"both\" : \"x\"\n\t\tdefault:\n\t\t\treturn \"both\"\n\t}\n}\ninterface ReducedGap {\n\tgap: Reduced<TwoPixelNumberShorthand | DynamicValue>\n\tgapAxis: GapAxis | NotFound\n\tcolumnGap: Reduced<number>\n\trowGap: Reduced<number>\n}\n\nexport type ReducedGridLayout = ReducedRecord<\n\tOmit<HasGridLayout, \"layout\" | \"gap\"> & {\n\t\t/**\n\t\t * The row count is not deterministic if the grid is a data repeater, when the column count\n\t\t * is not a number, or if any of the children uses a dynamic column or row span.\n\t\t */\n\t\tcomputedRowCount: NonDeterministic | number | undefined\n\t}\n> &\n\tReducedGap\nexport type ReducedStackLayout = Omit<ReducedRecord<HasStackLayout>, \"layout\" | \"gap\"> & ReducedGap\n\nexport interface ReducedLayout\n\textends ReducedGridLayout, ReducedStackLayout, ReducedRecord<Pick<WithLayout, \"layout\">> {\n\tonlyNodesWithLayout: boolean\n}\n\nexport function reduceLayout(\n\ttree: CanvasTree,\n\tcomponentLoader: ComponentLoader,\n\tnode: CanvasNode,\n\tresult: ReducedLayout,\n) {\n\tif (!withLayout(node) || isBreakpointWithLayoutTemplate(node)) {\n\t\tresult.onlyNodesWithLayout = false\n\t\treturn\n\t}\n\n\treduceProperty(\"layout\", result, node)\n\n\tif (!node.layout) return\n\n\t// Grid layout enabled\n\treduceProperty(\"gridAlignment\", result, node)\n\treduceProperty(\"gridRowCount\", result, node, rowCountDefault)\n\treduceProperty(\"gridColumnCount\", result, node, columnCountDefault)\n\treduceProperty(\"gridColumnWidthType\", result, node)\n\treduceProperty(\"gridColumnWidth\", result, node)\n\treduceProperty(\"gridColumnMinWidth\", result, node, undefinedToZero)\n\treduceProperty(\"gridRowHeightType\", result, node)\n\treduceProperty(\"gridRowHeight\", result, node)\n\treduceProperty(\"gridType\", result, node)\n\treduceProperty(\"stackDirection\", result, node)\n\treduceProperty(\"stackDistribution\", result, node)\n\treduceProperty(\"stackAlignment\", result, node)\n\treduceProperty(\"stackWrapEnabled\", result, node, Boolean)\n\treduceProperty(\"gap\", result, node, undefinedAndNumberToPixelNumber)\n\tresult.gapAxis = reduceGapAxis(node, node.layout, result.gapAxis)\n\n\tif (!isMixed(result.columnGap)) {\n\t\tconst columnGap = isDynamicValue(node.gap) ? Mixed : getNumericColumnGapFromShorthand(node.gap)\n\t\tif (isNotFound(result.columnGap)) {\n\t\t\tresult.columnGap = columnGap\n\t\t} else if (valuesAreDifferent(columnGap, result.columnGap)) {\n\t\t\tresult.columnGap = Mixed\n\t\t}\n\t}\n\n\tif (!isMixed(result.rowGap)) {\n\t\tconst rowGap = isDynamicValue(node.gap) ? Mixed : getNumericRowGapFromShorthand(node.gap)\n\t\tif (isNotFound(result.rowGap)) {\n\t\t\tresult.rowGap = rowGap\n\t\t} else if (valuesAreDifferent(rowGap, result.rowGap)) {\n\t\t\tresult.rowGap = Mixed\n\t\t}\n\t}\n\n\tconst currentComputedRowCount = result.computedRowCount\n\tif (isNonDeterministic(currentComputedRowCount)) return\n\n\t// Only with a fixed column count, we can compute the number of rows. The number of rows is\n\t// based on the columns, children, and children column span values. Data repeaters don't support\n\t// a fixed amount of rows because the item count is dynamic. And if any of the children uses a\n\t// dynamic column or row span, we can't compute the row count either.\n\tif (isGridRowCountNonDeterministic(node)) {\n\t\tresult.computedRowCount = NonDeterministic\n\t\treturn\n\t}\n\n\tif (isMixed(currentComputedRowCount)) return\n\n\tif (result.computedRowCount === Mixed) return\n\tconst computedRowCount = isGridComponent(node) ? getGridFilledRowCount(node, tree, componentLoader) : Mixed\n\tif (isNotFound(currentComputedRowCount)) {\n\t\tresult.computedRowCount = computedRowCount\n\t} else if (valuesAreDifferent(computedRowCount, currentComputedRowCount)) {\n\t\tresult.computedRowCount = Mixed\n\t}\n}\n", "import type { ComponentLoader } from \"@framerjs/framer-runtime\"\nimport type { CanvasTree } from \"../../CanvasTree.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { withControlProps } from \"../WithControlProps.ts\"\nimport { hasLayoutTemplate } from \"../WithLayoutTemplate.ts\"\nimport { isBreakpointVariant } from \"../WithVariant.ts\"\nimport type { ReducedControlPropsWithIdentifier } from \"./reduceControlPropsWithIdentifier.ts\"\nimport { reduceControlPropsWithIdentifier } from \"./reduceControlPropsWithIdentifier.ts\"\n\nexport function reduceLayoutTemplateControlProps(\n\ttree: CanvasTree,\n\tcomponentLoader: ComponentLoader,\n\tnodes: CanvasNode[],\n\tresult: ReducedControlPropsWithIdentifier,\n\tlastResult: ReducedControlPropsWithIdentifier | undefined,\n) {\n\tif (nodes.length !== 1) return\n\tconst node = nodes[0]\n\n\tif (!node || !isBreakpointVariant(node)) return\n\n\tconst scope = tree.getScopeNodeFor(node)\n\tif (!hasLayoutTemplate(scope) || !withControlProps(scope)) return\n\n\tconst identifier = scope.layoutTemplateIdentifier\n\tconst component = componentLoader.reactComponentForIdentifier(identifier)\n\tif (!component) return\n\n\tconst rawControlPropsList = [scope.getRawControlProps()]\n\tconst controlPropsList = [scope.getControlProps(component.properties)]\n\tconst controls = component.properties\n\n\treduceControlPropsWithIdentifier(identifier, rawControlPropsList, controlPropsList, controls, result, lastResult)\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { type WithLightboxEffect, withLightboxEffect } from \"../WithLightboxEffect.ts\"\nimport type { Reduced, ReducedRecord } from \"./Reduced.ts\"\nimport { type ReducedEffectTransition, getReducedEffectTransition } from \"./reduceEffectTransition.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedLightboxEffect extends ReducedRecord<Omit<WithLightboxEffect, \"lightboxEffectTransition\">> {\n\tonlyNodesWithLightboxEffect: boolean\n\tlightboxEffectTransition: Reduced<ReducedEffectTransition | undefined>\n}\n\nexport function reduceLightboxEffect(node: CanvasNode, result: ReducedLightboxEffect) {\n\tif (!withLightboxEffect(node)) {\n\t\tresult.onlyNodesWithLightboxEffect = false\n\t\treturn\n\t}\n\n\treduceProperty(\"lightboxEffectEnabled\", result, node)\n\treduceProperty(\"lightboxEffectBackdrop\", result, node)\n\treduceProperty(\"lightboxEffectMaxWidth\", result, node)\n\treduceProperty(\"lightboxEffectZIndex\", result, node)\n\treduceProperty(\"lightboxEffectPadding\", result, node)\n\treduceProperty(\"lightboxEffectPaddingPerSide\", result, node)\n\treduceProperty(\"lightboxEffectPaddingTop\", result, node)\n\treduceProperty(\"lightboxEffectPaddingRight\", result, node)\n\treduceProperty(\"lightboxEffectPaddingBottom\", result, node)\n\treduceProperty(\"lightboxEffectPaddingLeft\", result, node)\n\n\tresult.lightboxEffectTransition = getReducedEffectTransition(\n\t\tnode.lightboxEffectTransition,\n\t\tresult.lightboxEffectTransition,\n\t)\n}\n", "import { Mixed, assertNever, isMixed } from \"@framerjs/shared\"\nimport { isUndefined } from \"utils/typeChecks.ts\"\nimport type { CanvasNode, CanvasTree, RichTextNode } from \"../../index.ts\"\nimport { isAnyTextNode } from \"../../nodes/utils/isAnyTextNode.ts\"\nimport { isRichTextNode, isTextNode } from \"../../nodes/utils/nodeCheck.ts\"\nimport type { DynamicValue } from \"../DynamicValue.ts\"\nimport { isDynamicValue } from \"../DynamicValue.ts\"\nimport { isVariableReference } from \"../VariableReference.ts\"\nimport { isVariantFormButtonSource } from \"../WithFormVariants.ts\"\nimport type { WithLink } from \"../WithLink.ts\"\nimport { shouldOpenLinkInNewTab, withLink } from \"../WithLink.ts\"\nimport { isVectorSetItem } from \"../WithVectorSetItem.ts\"\nimport { type Link, isLinkToURL, isLinkToWebPage } from \"./Link.ts\"\nimport type { Reduced, ReducedRecord } from \"./Reduced.ts\"\nimport { isNotFound } from \"./Reduced.ts\"\nimport { objectsAreDifferent, reduceObjectProperty } from \"./reduceObjectProperty.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedLink extends ReducedRecord<Omit<WithLink, \"getLink\" | \"link\" | \"linkLocalized\">> {\n\tlink: Reduced<Link | DynamicValue | undefined>\n\tonlyNodesWithLink: boolean\n\tonlyNodesWithLinkSupportingComputedValues: boolean\n\t/**\n\t * Only RichTextNodes and nodes WithLink (except TextNode) can have link options. If multiple nodes that support link options\n\t * are selected but one or more does not have a link then this will be false as we don't support link options for that state.\n\t */\n\tonlyNodesWithLinkOptions: boolean\n\t/**\n\t * If the reduced nodes contain any external links (or variables that could be external links) and could therefore\n\t * have external link options. This allows us to show the appropriate options for a selection that contains multiple links. */\n\tanyExternalLinks: boolean\n\t/**\n\t * If the reduced nodes contain any scroll targets (or variables that could contain scroll targets) and could\n\t * therefore have scroll target options. This allows us to show the appropriate options for a selection that contains\n\t * multiple scroll links. */\n\tanyScrollTargets: boolean\n}\n\nexport function reduceLink(tree: CanvasTree, node: CanvasNode, result: ReducedLink) {\n\tif (!isRichTextNode(node) && !withLink(node)) {\n\t\t// If the node is not a RichTextNode or WithLink, `onlyNodesWithLink`\n\t\t// can't be true anymore.\n\t\tresult.onlyNodesWithLink = false\n\t\tresult.onlyNodesWithLinkOptions = false\n\t\treturn\n\t}\n\n\tif (isVariantFormButtonSource(tree, node)) {\n\t\tresult.onlyNodesWithLink = false\n\t}\n\n\tif (isTextNode(node)) {\n\t\tresult.onlyNodesWithLinkOptions = false\n\t}\n\n\tif (isAnyTextNode(node)) {\n\t\tresult.onlyNodesWithLinkSupportingComputedValues = false\n\t}\n\n\tif (isVectorSetItem(node)) {\n\t\tresult.onlyNodesWithLink = false\n\t}\n\n\tif (isRichTextNode(node)) {\n\t\tif (isVariableReference(node.htmlContent)) {\n\t\t\tresult.onlyNodesWithLink = false\n\t\t} else {\n\t\t\treduceRichTextNodeLink(node, result)\n\t\t}\n\t} else if (withLink(node)) {\n\t\treduceWithLink(node, result)\n\t} else {\n\t\tassertNever(node)\n\t}\n}\n\nfunction toDefaultOpenInNewTab(value: WithLink[\"linkOpenInNewTab\"], link: Link | DynamicValue | undefined) {\n\tif (value !== undefined) return value\n\t/**\n\t * When the link is a variable, we can't infer the default openInNewTab\n\t * value because the link could be anything. In this case we keep it\n\t * undefined. That will render a intermediate state in the UI, until the\n\t * user set a value manually.\n\t */\n\tif (!link || isDynamicValue(link)) return undefined\n\n\treturn shouldOpenLinkInNewTab(link)\n}\n\nfunction reduceRichTextNodeLink(node: RichTextNode, result: ReducedLink) {\n\tconst links = node.getLinks(true)\n\tconst openInNewTabs = node.getLinkOpenInNewTabs(true)\n\tconst smoothScrolls = node.getLinkSmoothScroll(true)\n\tconst linkClickTrackingIds = node.getLinkClickTrackingId(true)\n\tconst linkRelValues = node.getLinkRelValues(true)\n\tconst linkPreserveParams = node.getLinkPreserveParams(true)\n\n\t// the link array is deduped but with a shallow equals so we use deep equals for any nested objects\n\tfor (let i = 0; i < links.length; i++) {\n\t\treduceLinkValue(result, links[i])\n\t}\n\n\t// attribute arrays are deduped sufficiently, so if there are multiple items then it must be Mixed\n\treduceValue(\"linkOpenInNewTab\", result, openInNewTabs.length > 1 ? Mixed : openInNewTabs[0])\n\treduceValue(\"linkSmoothScroll\", result, smoothScrolls.length > 1 ? Mixed : smoothScrolls[0])\n\treduceValue(\"linkClickTrackingId\", result, linkClickTrackingIds.length > 1 ? Mixed : linkClickTrackingIds[0])\n\treduceValue(\"linkRelValues\", result, linkRelValues.length > 1 ? Mixed : linkRelValues[0])\n\treduceValue(\"linkPreserveParams\", result, linkPreserveParams.length > 1 ? Mixed : linkPreserveParams[0])\n}\n\nfunction reduceWithLink(node: CanvasNode & WithLink, result: ReducedLink) {\n\treduceLinkValue(result, node.getLink())\n\n\treduceProperty(\"linkOpenInNewTab\", result, node, value => toDefaultOpenInNewTab(value, node.getLink()))\n\treduceProperty(\"linkSmoothScroll\", result, node)\n\treduceProperty(\"linkClickTrackingId\", result, node)\n\treduceObjectProperty(\"linkRelValues\", result, node)\n\treduceProperty(\"linkPreserveParams\", result, node)\n}\n\nfunction reduceLinkValue(result: ReducedLink, value: ReducedLink[\"link\"]) {\n\tconst prevReducedValue = result.link\n\treduceValue(\"link\", result, value)\n\n\tif (isDynamicValue(value)) {\n\t\tresult.anyExternalLinks = true\n\t\tresult.anyScrollTargets = true\n\t} else if (isLinkToURL(value)) {\n\t\tresult.anyExternalLinks = true\n\t} else if (isLinkToWebPage(value) && value.hash) {\n\t\tresult.anyScrollTargets = true\n\t}\n\n\t// if we have multiple nodes that support links but one or more does not have a link then we can't show or update\n\t// link options in the UI, so for this state we consider link options to not be supported\n\tif (isMixed(result.link) && (isUndefined(value) || isUndefined(prevReducedValue))) {\n\t\tresult.onlyNodesWithLinkOptions = false\n\t}\n}\n\nfunction reduceValue<K extends keyof Omit<ReducedLink, `only${string}` | `any${string}`>>(\n\tkey: K,\n\tresult: ReducedLink,\n\tvalue: ReducedLink[K],\n) {\n\tif (isNotFound(result[key])) {\n\t\tresult[key] = value\n\t} else if (objectsAreDifferent(value, result[key])) {\n\t\tresult[key] = Mixed\n\t}\n}\n", "import type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport { isFixedOrRelativeOverlay } from \"../../nodes/utils/overlayHelpers.ts\"\nimport type { WithLoopEffect } from \"../WithLoopEffect.ts\"\nimport { withLoopEffect } from \"../WithLoopEffect.ts\"\nimport type { Reduced, ReducedRecord } from \"./Reduced.ts\"\nimport { type ReducedEffectTransition, getReducedEffectTransition } from \"./reduceEffectTransition.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedLoopEffect extends ReducedRecord<Omit<WithLoopEffect, \"loopEffectTransition\">> {\n\tonlyNodesWithLoopEffect: boolean\n\tloopEffectTransition: Reduced<ReducedEffectTransition | undefined>\n}\n\nexport function reduceLoopEffect(node: CanvasNode, result: ReducedLoopEffect) {\n\tif (!withLoopEffect(node) || isFixedOrRelativeOverlay(node)) {\n\t\tresult.onlyNodesWithLoopEffect = false\n\t\treturn\n\t}\n\n\treduceProperty(\"loopEffectEnabled\", result, node)\n\treduceProperty(\"loopEffectOpacity\", result, node)\n\treduceProperty(\"loopEffectX\", result, node)\n\treduceProperty(\"loopEffectY\", result, node)\n\treduceProperty(\"loopEffectScale\", result, node)\n\treduceProperty(\"loopEffectRotate3d\", result, node)\n\treduceProperty(\"loopEffectRotate\", result, node)\n\treduceProperty(\"loopEffectRotateX\", result, node)\n\treduceProperty(\"loopEffectRotateY\", result, node)\n\treduceProperty(\"loopEffectSkewX\", result, node)\n\treduceProperty(\"loopEffectSkewY\", result, node)\n\treduceProperty(\"loopEffectRepeatDelay\", result, node)\n\treduceProperty(\"loopEffectRepeatType\", result, node)\n\treduceProperty(\"loopEffectPauseOffscreen\", result, node)\n\n\tresult.loopEffectTransition = getReducedEffectTransition(node.loopEffectTransition, result.loopEffectTransition)\n}\n", "import { Mixed, assertNever, isMixed } from \"@framerjs/shared\"\nimport { isEqual } from \"library/index.ts\"\nimport { isString, isUndefined } from \"utils/typeChecks.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { NodeID } from \"../../nodes/NodeID.ts\"\nimport type {\n\tMask,\n\tMaskComposite,\n\tMaskID,\n\tMaskMode,\n\tMaskPosition,\n\tMaskRepeat,\n\tMaskSize,\n\tMaskType,\n\tMaskValueTypeForMaskType,\n} from \"../WithMasks.ts\"\nimport { withMasks } from \"../WithMasks.ts\"\nimport type { Reduced, ReducedRecord } from \"./Reduced.ts\"\nimport { isFound, isNotFound } from \"./Reduced.ts\"\n\nexport type MasksByNodeId = Record<NodeID, MaskID>\n\nexport interface ReducedMask extends ReducedRecord<Pick<Mask, \"maskType\">> {\n\tmaskIds: MasksByNodeId\n\tmaskValue: Reduced<MaskValueTypeForMaskType>\n\tmaskType: Reduced<MaskType>\n\tmaskImages: Set<string>\n\tmaskImageResize: Set<MaskSize | undefined>\n\tmaskMode: Set<MaskMode | undefined>\n\tmaskRepeat: Set<MaskRepeat | undefined>\n\tmaskPosition: Set<MaskPosition | undefined>\n\tmaskComposite: Set<MaskComposite>\n}\n\nexport interface ReducedMasks {\n\tmasks: Reduced<ReducedMask[]>\n\tonlyNodesWithMask: boolean\n}\n\nconst noMasks: readonly Mask[] = []\n\nfunction reduceMasksList(\n\tvalue: Readonly<Mask[] | undefined>,\n\treduced: Reduced<ReducedMask[]>,\n\tnodeId: NodeID,\n): Reduced<ReducedMask[]> {\n\tif (isMixed(reduced)) return reduced\n\tconst masks = value ?? noMasks\n\n\tif (isNotFound(reduced)) {\n\t\treturn masks.map(mask => ({\n\t\t\tmaskIds: { [nodeId]: mask.id },\n\t\t\tmaskType: mask.maskType,\n\t\t\tmaskValue: getMaskValue(mask),\n\t\t\tmaskImages: mask.maskImage ? new Set([mask.maskImage]) : new Set(),\n\t\t\tmaskImageResize: mask.maskImageResize ? new Set([mask.maskImageResize]) : new Set(),\n\t\t\tmaskMode: mask.maskMode ? new Set([mask.maskMode]) : new Set(),\n\t\t\tmaskRepeat: mask.maskRepeat ? new Set([mask.maskRepeat]) : new Set(),\n\t\t\tmaskPosition: mask.maskPosition ? new Set([mask.maskPosition]) : new Set(),\n\t\t\tmaskComposite: mask.maskComposite ? new Set([mask.maskComposite]) : new Set(),\n\t\t}))\n\t}\n\n\tif (masks.length !== reduced.length) return Mixed\n\n\tmasks.forEach((mask, index) => {\n\t\tconst reducedMask: ReducedMask | undefined = reduced[index]\n\t\tif (!reducedMask) return\n\n\t\treducedMask.maskIds[nodeId] = mask.id\n\n\t\treducedMask.maskType =\n\t\t\tisFound(reducedMask.maskType) && !isEqual(mask.maskType, reducedMask.maskType) ? Mixed : mask.maskType\n\n\t\tswitch (mask.maskType) {\n\t\t\tcase \"linear-gradient\":\n\t\t\t\treducedMask.maskValue = maskIsMixed(reducedMask.maskValue, mask.maskLinearGradient)\n\t\t\t\t\t? Mixed\n\t\t\t\t\t: mask.maskLinearGradient\n\t\t\t\treducedMask.maskComposite.add(mask.maskComposite)\n\t\t\t\tbreak\n\t\t\tcase \"radial-gradient\":\n\t\t\t\treducedMask.maskValue = maskIsMixed(reducedMask.maskValue, mask.maskRadialGradient)\n\t\t\t\t\t? Mixed\n\t\t\t\t\t: mask.maskRadialGradient\n\t\t\t\treducedMask.maskComposite.add(mask.maskComposite)\n\t\t\t\tbreak\n\t\t\tcase \"conic-gradient\":\n\t\t\t\treducedMask.maskValue = maskIsMixed(reducedMask.maskValue, mask.maskConicGradient)\n\t\t\t\t\t? Mixed\n\t\t\t\t\t: mask.maskConicGradient\n\t\t\t\treducedMask.maskComposite.add(mask.maskComposite)\n\t\t\t\tbreak\n\t\t\tcase \"image\":\n\t\t\t\treducedMask.maskValue = maskIsMixed(reducedMask.maskValue, mask.maskImage) ? Mixed : mask.maskImage\n\t\t\t\treducedMask.maskImageResize.add(mask.maskImageResize)\n\t\t\t\treducedMask.maskMode.add(mask.maskMode)\n\t\t\t\treducedMask.maskRepeat.add(mask.maskRepeat)\n\t\t\t\treducedMask.maskPosition.add(mask.maskPosition)\n\t\t\t\treducedMask.maskComposite.add(mask.maskComposite)\n\t\t\t\tif (isString(mask.maskImage)) {\n\t\t\t\t\treducedMask.maskImages.add(mask.maskImage)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tassertNever(mask.maskType, \"Unsupported mask type\")\n\t\t}\n\t})\n\n\treturn reduced\n}\n\nexport function reduceMasks(node: CanvasNode, result: ReducedMasks) {\n\tif (!withMasks(node)) {\n\t\tresult.onlyNodesWithMask = false\n\t\treturn\n\t}\n\tif (isUndefined(node.masks)) return\n\n\tresult.masks = reduceMasksList(node.masks, result.masks, node.id)\n}\n\nfunction maskIsMixed(\n\tresultMaskValue: Reduced<MaskValueTypeForMaskType | undefined>,\n\tnodeMaskValue: MaskValueTypeForMaskType | undefined,\n) {\n\treturn isFound(resultMaskValue) && !isEqual(nodeMaskValue, resultMaskValue, true)\n}\n\nfunction getMaskValue(mask: Mask) {\n\tswitch (mask.maskType) {\n\t\tcase \"linear-gradient\":\n\t\t\treturn mask.maskLinearGradient\n\t\tcase \"radial-gradient\":\n\t\t\treturn mask.maskRadialGradient\n\t\tcase \"conic-gradient\":\n\t\t\treturn mask.maskConicGradient\n\t\tcase \"image\":\n\t\t\treturn mask.maskImage\n\t\tdefault:\n\t\t\treturn assertNever(mask.maskType, \"Unsupported mask type\")\n\t}\n}\n", "import { isAutoSizedOnBothDimensions } from \"document/models/CanvasTree/traits/utils/autoSizeHelpers.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { isTextNode } from \"../../nodes/utils/nodeCheck.ts\"\nimport type { WithOverflow } from \"../WithOverflow.ts\"\nimport { withOverflow } from \"../WithOverflow.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedOverflow extends ReducedRecord<WithOverflow> {\n\t/**\n\t * Denotes that the nodes all support the overflow property (not that its\n\t * necessarily set to a value other than undefined)\n\t */\n\tonlyNodesWithOverflow: boolean\n}\n\nexport function reduceOverflow(node: CanvasNode, result: ReducedOverflow): void {\n\tif (!withOverflow(node)) {\n\t\tresult.onlyNodesWithOverflow = false\n\t\treturn\n\t}\n\tif (isTextNode(node) && isAutoSizedOnBothDimensions(node)) return\n\n\treduceProperty(\"overflow\", result, node)\n\treduceProperty(\"overflowX\", result, node)\n\treduceProperty(\"overflowY\", result, node)\n}\n", "import type { ComponentLoader } from \"@framerjs/framer-runtime\"\nimport { Mixed, isMixed } from \"@framerjs/shared\"\nimport { findActionOnNode } from \"document/components/chrome/properties/utils/eventActions.ts\"\nimport { isShowOverlayActionWithId } from \"../../actions/overlayActions.ts\"\nimport type { CanvasNode, CanvasTree } from \"../../index.ts\"\nimport { isFixedOrRelativeOverlay } from \"../../nodes/utils/overlayHelpers.ts\"\nimport type { Reduced } from \"./Reduced.ts\"\nimport { isNotFound } from \"./Reduced.ts\"\n\nexport interface ReducedOverlayTriggerEvent {\n\toverlayTriggerEventKey: Reduced<string>\n}\n\nexport function reduceOverlayTriggerEvent<N extends CanvasNode>(\n\ttree: CanvasTree,\n\tcomponentLoader: ComponentLoader,\n\tnodes: N[],\n\tresult: ReducedOverlayTriggerEvent,\n) {\n\t// We intentionally hide the OverlayTriggerRow with multi-selection to avoid doing expensive lookup of the event\n\t// keys in the reducer\n\tif (nodes.length !== 1) return\n\tconst [node] = nodes\n\tif (!node) return\n\n\tif (!isFixedOrRelativeOverlay(node)) return\n\n\tif (isMixed(result.overlayTriggerEventKey)) return\n\tconst triggerNode = tree.getParent(node.id)\n\tif (!triggerNode) return\n\n\tconst overlayId = node.getPrimaryId()\n\tconst predicate = isShowOverlayActionWithId(overlayId)\n\tconst overlayAction = findActionOnNode(componentLoader, triggerNode, predicate)\n\n\tif (!overlayAction) return\n\tif (isNotFound(result.overlayTriggerEventKey)) {\n\t\tresult.overlayTriggerEventKey = overlayAction.eventKey\n\t} else if (result.overlayTriggerEventKey !== overlayAction.eventKey) {\n\t\tresult.overlayTriggerEventKey = Mixed\n\t}\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { isAnyOverflowAuto } from \"../WithOverflow.ts\"\nimport type { WithOverscrollBehavior } from \"../WithOverscrollBehavior.ts\"\nimport { withOverscrollBehavior } from \"../WithOverscrollBehavior.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedOverscrollBehavior extends ReducedRecord<WithOverscrollBehavior> {\n\tonlyNodesWithOverscrollBehavior: boolean\n}\n\nexport function reduceOverscrollBehavior(node: CanvasNode, result: ReducedOverscrollBehavior) {\n\tif (!withOverscrollBehavior(node) || !isAnyOverflowAuto(node)) {\n\t\tresult.onlyNodesWithOverscrollBehavior = false\n\t\treturn\n\t}\n\n\treduceProperty(\"overscrollBehavior\", result, node)\n}\n", "import type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport { isUndefined } from \"utils/typeChecks.ts\"\nimport type { DynamicValue } from \"../DynamicValue.ts\"\nimport { withPadding } from \"../WithPadding.ts\"\nimport { type Reduced, isFoundAndNotMixed } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedPadding {\n\tpadding: Reduced<number | DynamicValue>\n\tpaddingPerSide: Reduced<boolean>\n\tpaddingTop: Reduced<number>\n\tpaddingRight: Reduced<number>\n\tpaddingBottom: Reduced<number>\n\tpaddingLeft: Reduced<number>\n}\n\nfunction undefinedToZero<T>(value: T | undefined): T | number {\n\tif (isUndefined(value)) return 0\n\treturn value\n}\n\nfunction undefinedToFalse<T>(value: T | undefined): T | false {\n\tif (isUndefined(value)) return false\n\treturn value\n}\n\nexport function reducePadding(node: CanvasNode, result: ReducedPadding) {\n\tif (!withPadding(node)) return\n\n\treduceProperty(\"padding\", result, node, undefinedToZero)\n\treduceProperty(\"paddingPerSide\", result, node, undefinedToFalse)\n\treduceProperty(\"paddingTop\", result, node, undefinedToZero)\n\treduceProperty(\"paddingRight\", result, node, undefinedToZero)\n\treduceProperty(\"paddingBottom\", result, node, undefinedToZero)\n\treduceProperty(\"paddingLeft\", result, node, undefinedToZero)\n}\n\nexport function isPaddingFoundAndNotMixed({\n\tpadding,\n\tpaddingBottom,\n\tpaddingLeft,\n\tpaddingPerSide,\n\tpaddingRight,\n\tpaddingTop,\n}: ReducedPadding): boolean {\n\tif (!isFoundAndNotMixed(padding)) return false\n\tif (!isFoundAndNotMixed(paddingPerSide)) return false\n\tif (!isFoundAndNotMixed(paddingTop)) return false\n\tif (!isFoundAndNotMixed(paddingLeft)) return false\n\tif (!isFoundAndNotMixed(paddingRight)) return false\n\tif (!isFoundAndNotMixed(paddingBottom)) return false\n\tif (!isFoundAndNotMixed(paddingLeft)) return false\n\n\treturn true\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { WithPageEffects } from \"../WithPageEffects.ts\"\nimport { withPageEffects } from \"../WithPageEffects.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport type ReducedPageEffects = ReducedRecord<WithPageEffects>\n\nexport function reducePageEffects(node: CanvasNode, result: ReducedPageEffects) {\n\tif (!withPageEffects(node)) return\n\treduceProperty(\"pageEffects\", result, node)\n}\n", "import type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport { isFixedOrRelativeOverlay } from \"../../nodes/utils/overlayHelpers.ts\"\nimport type { WithParallax } from \"../WithParallax.ts\"\nimport { withParallax } from \"../WithParallax.ts\"\nimport { isVectorSetItem } from \"../WithVectorSetItem.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedParallax extends ReducedRecord<WithParallax> {\n\tonlyNodesWithParallax: boolean\n}\n\nexport function reduceParallax(node: CanvasNode, result: ReducedParallax) {\n\tif (!withParallax(node) || isFixedOrRelativeOverlay(node) || isVectorSetItem(node)) {\n\t\tresult.onlyNodesWithParallax = false\n\t\treturn\n\t}\n\n\treduceProperty(\"parallaxEnabled\", result, node, Boolean)\n\n\tif (!node.parallaxEnabled) return\n\n\treduceProperty(\"parallaxSpeed\", result, node)\n\treduceProperty(\"parallaxAdjustPosition\", result, node)\n\treduceProperty(\"parallaxOffset\", result, node)\n}\n", "import type { CanvasNode } from \"../../index.ts\"\nimport type { WithPointerEvents } from \"../WithPointerEvents.ts\"\nimport { withPointerEvents } from \"../WithPointerEvents.ts\"\nimport { isVariant } from \"../WithVariant.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedPointerEvents extends ReducedRecord<WithPointerEvents> {\n\tonlyNodesWithPointerEvents: boolean\n}\n\nexport function reducePointerEvents(node: CanvasNode, result: ReducedPointerEvents): void {\n\tif (!withPointerEvents(node) || isVariant(node)) {\n\t\tresult.onlyNodesWithPointerEvents = false\n\t\treturn\n\t}\n\n\treduceProperty(\"pointerEvents\", result, node)\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { type WithRepeatArray, withRepeatArray } from \"../WithRepeatArray.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport type ReducedRepeatArray = ReducedRecord<Pick<WithRepeatArray, \"repeatArray\">>\n\nexport function reduceRepeatArray(node: CanvasNode, result: ReducedRepeatArray) {\n\tif (withRepeatArray(node)) {\n\t\treduceProperty(\"repeatArray\", result, node)\n\t}\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { NodeID } from \"../../nodes/NodeID.ts\"\nimport { withRepeatArray } from \"../WithRepeatArray.ts\"\nimport type { NotFound } from \"./Reduced.ts\"\n\nexport interface ReducedRepeatId {\n\trepeatId: NodeID | NotFound\n\trepeatOriginalId: NodeID | NotFound\n}\n\nexport function reduceRepeatId(nodes: CanvasNode[], result: ReducedRepeatId) {\n\tif (nodes.length !== 1) return\n\tconst node = nodes[0]\n\tif (!withRepeatArray(node)) return\n\n\tresult.repeatId = node.id\n\tresult.repeatOriginalId = node.getPrimaryId()\n}\n", "import type { AnyComponentLoader } from \"@framerjs/framer-runtime\"\nimport type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport {\n\tsizeToFitContentAvailableForNode,\n\tsizeToFitContentEnabledForNode,\n} from \"document/models/CanvasTree/utils/sizeToFitContent.ts\"\n\nexport interface ReducedResizeToFitContentAction {\n\tresizeToFitContentActionAvailable: boolean\n\tresizeToFitContentActionEnabled: boolean\n}\n\nexport function reduceResizeToFitContentAction(\n\tnode: CanvasNode,\n\tcomponentLoader: AnyComponentLoader,\n\tresult: ReducedResizeToFitContentAction,\n) {\n\t// Both `available` and `enabled` default to `false`, and we'll only flip them to `true`\n\t// if at least one node matches the available/enabled criteria. Checking if they're already\n\t// enabled means we'll avoid even testing nodes beyond the first matched one.\n\tif (!result.resizeToFitContentActionAvailable && sizeToFitContentAvailableForNode(componentLoader, node)) {\n\t\tresult.resizeToFitContentActionAvailable = true\n\t}\n\n\tif (!result.resizeToFitContentActionEnabled && sizeToFitContentEnabledForNode(componentLoader, node)) {\n\t\tresult.resizeToFitContentActionEnabled = true\n\t}\n}\n", "import { isUndefined } from \"utils/typeChecks.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { DEFAULT_ROOT_FONT_SIZE, type WithRootFontSize, withRootFontSize } from \"../WithRootFontSize.ts\"\nimport type { Reduced } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedRootFontSize {\n\trootFontSize: Reduced<WithRootFontSize[\"rootFontSize\"]>\n}\n\nexport function reduceRootFontSize(node: CanvasNode, result: ReducedRootFontSize) {\n\tif (!withRootFontSize(node)) return\n\n\treduceProperty(\"rootFontSize\", result, node, v => (isUndefined(v) ? DEFAULT_ROOT_FONT_SIZE : v))\n}\n", "import { isArray } from \"utils/typeChecks.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { WithScrollTarget } from \"../WithScrollTarget.ts\"\nimport { withScrollTarget } from \"../WithScrollTarget.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedScrollTarget extends ReducedRecord<WithScrollTarget> {\n\tonlyNodesWithScrollTarget: boolean\n}\n\nexport function reduceScrollTarget(node: CanvasNode, result: ReducedScrollTarget) {\n\tconst ancestorRepeaterIds = node.cache.ancestorRepeaterIds\n\tconst ancestorRepeaterCount = isArray(ancestorRepeaterIds) ? ancestorRepeaterIds.length : 0\n\tif (!withScrollTarget(node) || ancestorRepeaterCount > 1) {\n\t\tresult.onlyNodesWithScrollTarget = false\n\t\treturn\n\t}\n\n\treduceProperty(\"scrollTargetEnabled\", result, node)\n\treduceProperty(\"elementId\", result, node)\n\treduceProperty(\"scrollMarginTop\", result, node)\n}\n", "import type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport type { WithScrollbars } from \"../WithScrollbars.ts\"\nimport { withScrollbars } from \"../WithScrollbars.ts\"\nimport { isBreakpointVariant } from \"../WithVariant.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport type ReducedScrollbars = ReducedRecord<WithScrollbars> & { onlyNodesWithScrollbars: boolean }\n\nexport function reduceScrollbars(node: CanvasNode, result: ReducedScrollbars) {\n\tif (isBreakpointVariant(node) || !withScrollbars(node)) {\n\t\tresult.onlyNodesWithScrollbars = false\n\t\treturn\n\t}\n\treduceProperty(\"hideScrollbars\", result, node)\n}\n", "import type { ComponentLoader } from \"@framerjs/framer-runtime\"\nimport { assert } from \"@framerjs/shared\"\nimport type { VekterEngine } from \"document/VekterEngine.ts\"\nimport { normalizeGradientStopPositions } from \"document/components/tools/gradient/utils.ts\"\nimport type { CanvasNode, CanvasTree, NodeID, RichTextNode } from \"document/models/CanvasTree/index.ts\"\nimport {\n\tisBooleanShapeNode,\n\tisCodeComponentNode,\n\tisRichTextNode,\n} from \"document/models/CanvasTree/nodes/utils/nodeCheck.ts\"\nimport {\n\ttype DynamicValue,\n\ttype NonDynamicValue,\n\tisDynamicValue,\n} from \"document/models/CanvasTree/traits/DynamicValue.ts\"\nimport { isVariableReference } from \"document/models/CanvasTree/traits/VariableReference.ts\"\nimport {\n\ttype BorderValues,\n\ttype WithBorder,\n\tisOptionalBorderVisible,\n\twithBorder,\n} from \"document/models/CanvasTree/traits/WithBorder.ts\"\nimport {\n\ttype WithFill,\n\thasFillEnabled,\n\tsupportsGradient,\n\tsupportsGradientProps,\n} from \"document/models/CanvasTree/traits/WithFill.ts\"\nimport { type WithStroke, withStroke } from \"document/models/CanvasTree/traits/WithStroke.ts\"\nimport type { WithTextStyle } from \"document/models/CanvasTree/traits/WithTextStyle.ts\"\nimport { isVectorSetItem } from \"document/models/CanvasTree/traits/WithVectorSetItem.ts\"\nimport { type WithWhileHover, withWhileHover } from \"document/models/CanvasTree/traits/WithWhileHover.ts\"\nimport { type WithWhileTap, withWhileTap } from \"document/models/CanvasTree/traits/WithWhileTap.ts\"\nimport {\n\tisTokenCSSVariable,\n\tstripMetadataFromCSSVariable,\n\ttokenIdFromCSSVariable,\n} from \"document/models/CanvasTree/utils/tokens.ts\"\nimport { isConicGradient } from \"document/models/ConicGradientClass.ts\"\nimport {\n\tconicGradientUpdate,\n\tgradientFillType,\n\tisGradient,\n\tlinearGradientUpdate,\n\tradialGradientUpdate,\n} from \"document/models/Gradient.ts\"\nimport { isLinearGradient } from \"document/models/LinearGradientClass.ts\"\nimport { isRadialGradient } from \"document/models/RadialGradientClass.ts\"\nimport { isBorderValues } from \"document/models/controlProps/BorderControlPropValue.ts\"\nimport type { ControlProp } from \"document/models/controlProps/ControlProp.ts\"\nimport { removeControlPropKeyPrefix, isPrefixedControlPropKey } from \"document/models/controlProps/controlPropKey.ts\"\nimport { type PrefixedControlPropKey, prefixControlPropKey } from \"document/models/controlProps/controlPropKey.ts\"\nimport { getControlProp } from \"document/models/controlProps/getControlProps.ts\"\nimport { Tools } from \"document/stores/ToolEnum.ts\"\nimport { supportedGradientColorRegex } from \"document/utils/parseGradient.ts\"\nimport { Color, type ColorHSLA, ControlType, type Gradient } from \"library/index.ts\"\nimport { P3Color } from \"library/render/types/Color/Color.ts\"\nimport { assertNever } from \"library/utils/assert.ts\"\nimport { memoizeOne } from \"utils/memoizeOne.ts\"\nimport { isString } from \"utils/typeChecks.ts\"\n\nconst tool = Tools.FillGradient\n\n/**\n * Represents a identifiable value of a property. It could be a color string, a gradient, a variable reference, a color style etc.\n */\ntype SelectionPropertyValueKey = string\n/** Can't use `WithControlProps` as we are storing only the color value from the prop, not the whole prop */\ntype ControlPropSelectionColorsTrait = { [key in PrefixedControlPropKey]: string | DynamicValue | undefined }\ntype SelectionColorsSupportedTraits = WithFill &\n\tWithBorder &\n\tWithStroke &\n\tWithWhileHover &\n\tWithWhileTap &\n\tWithTextStyle &\n\tControlPropSelectionColorsTrait\nexport type SelectionColorsSupportedProperty = keyof Pick<\n\tSelectionColorsSupportedTraits,\n\t| \"fillColor\"\n\t| \"fillLinearGradient\"\n\t| \"fillRadialGradient\"\n\t| \"fillConicGradient\"\n\t| \"borderColor\"\n\t| \"strokeColor\"\n\t| \"whileHoverBackgroundColor\"\n\t| \"whileTapBackgroundColor\"\n\t| \"textColor\"\n\t| \"textDecorationColor\"\n\t| \"textBackgroundColor\"\n\t| PrefixedControlPropKey\n>\nexport type SelectionColorsSupportedPropertyValue = NonDynamicValue<\n\tNonNullable<SelectionColorsSupportedTraits[SelectionColorsSupportedProperty]>\n>\n/** Map of NodeID to all properties with the same color value */\nexport type SelectionColorsNodeUpdateMap = Map<NodeID, SelectionColorsSupportedProperty[]>\nexport interface SelectionColorsMapValue {\n\t/** We have to cache the value because it isn't always easy to transform the key back to the value */\n\tvalue: SelectionColorsSupportedPropertyValue\n\tnodeUpdateMap: SelectionColorsNodeUpdateMap\n}\nexport type SelectionColorsMap = Map<SelectionPropertyValueKey, SelectionColorsMapValue>\nexport interface CachedSelectionProperties {\n\tupdate: number\n\tselectionColors: SelectionColorsMap\n}\n\ninterface UpdateSelectionColorInitialState {\n\tinitialValue: SelectionColorsSupportedPropertyValue\n\t/**\n\t * Text nodes can have multiple colors for different ranges and we should update only the ranges that have changed.\n\t * But when changing between colors or gradients the marks we are updating may change. In order to safely update\n\t * we cache the html of the node so we can reset it before we update the marks.\n\t */\n\ttext: Map<NodeID, string>\n}\n\nexport function getSelectionColorProperties(componentLoader: ComponentLoader, node: CanvasNode) {\n\tconst selectionColorProperties: SelectionColorsMap = new Map()\n\n\tfor (const { node: descendant, skipChildren } of node.walkWithSkipChildren()) {\n\t\tconst cachedSelectionProperties = getValidCachedSelectionProperties(descendant)\n\t\tif (cachedSelectionProperties) {\n\t\t\tmergeSelectionColorsMaps(selectionColorProperties, cachedSelectionProperties.selectionColors)\n\t\t\tskipChildren()\n\t\t\tcontinue\n\t\t}\n\n\t\tcollectFill(descendant, selectionColorProperties)\n\t\tcollectBorderColor(descendant, selectionColorProperties)\n\t\tcollectStrokeColor(descendant, selectionColorProperties)\n\t\tcollectEffectColors(descendant, selectionColorProperties)\n\t\tcollectTextColors(descendant, selectionColorProperties)\n\t\tcollectComponentInstanceColors(componentLoader, descendant, selectionColorProperties)\n\n\t\t// Older boolean shape nodes may have children with colors that differ from the parent, but only the parent colors are rendered\n\t\tif (isBooleanShapeNode(descendant)) {\n\t\t\tskipChildren()\n\t\t}\n\t}\n\n\treturn selectionColorProperties\n}\n\nexport function mergeSelectionColorsMaps(target: SelectionColorsMap, source: SelectionColorsMap) {\n\tfor (const [key, value] of source) {\n\t\tconst targetValue = target.get(key)\n\n\t\tif (!targetValue) {\n\t\t\tconst newNodeUpdateMap = new Map()\n\t\t\tmergeNodeUpdateMaps(newNodeUpdateMap, value.nodeUpdateMap)\n\t\t\ttarget.set(key, {\n\t\t\t\tvalue: value.value,\n\t\t\t\tnodeUpdateMap: newNodeUpdateMap,\n\t\t\t})\n\t\t} else {\n\t\t\tmergeNodeUpdateMaps(targetValue.nodeUpdateMap, value.nodeUpdateMap)\n\t\t}\n\t}\n}\n\nexport function updateSelectionColor(\n\ttree: CanvasTree,\n\tcomponentLoader: ComponentLoader,\n\tinitialState: UpdateSelectionColorInitialState,\n\tnodeUpdateMap: SelectionColorsNodeUpdateMap,\n\tvalue: SelectionColorsSupportedPropertyValue,\n) {\n\tfor (const [nodeId, properties] of nodeUpdateMap) {\n\t\tconst node = tree.get(nodeId)\n\t\tif (!node) continue\n\n\t\tfor (const propertyKey of properties) {\n\t\t\tif (isPrefixedControlPropKey(propertyKey)) {\n\t\t\t\tupdateComponentInstanceColor(componentLoader, node, value, propertyKey)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tswitch (propertyKey) {\n\t\t\t\tcase \"fillColor\":\n\t\t\t\tcase \"fillConicGradient\":\n\t\t\t\tcase \"fillLinearGradient\":\n\t\t\t\tcase \"fillRadialGradient\":\n\t\t\t\t\tupdateFill(node, value)\n\t\t\t\t\tbreak\n\t\t\t\tcase \"borderColor\":\n\t\t\t\t\tupdateBorderColor(node, value)\n\t\t\t\t\tbreak\n\t\t\t\tcase \"strokeColor\":\n\t\t\t\t\tupdateStrokeColor(node, value)\n\t\t\t\t\tbreak\n\t\t\t\tcase \"whileHoverBackgroundColor\":\n\t\t\t\tcase \"whileTapBackgroundColor\":\n\t\t\t\t\tupdateEffectColor(node, value, propertyKey)\n\t\t\t\t\tbreak\n\t\t\t\tcase \"textColor\":\n\t\t\t\t\tupdateTextColors(node, value, initialState)\n\t\t\t\t\tbreak\n\t\t\t\tcase \"textDecorationColor\":\n\t\t\t\t\tupdateTextDecorationColors(node, value, initialState)\n\t\t\t\t\tbreak\n\t\t\t\tcase \"textBackgroundColor\":\n\t\t\t\t\tupdateTextBackgroundColors(node, value, initialState)\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\tassertNever(propertyKey)\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function getUpdateSelectionColorInitialState(\n\ttree: CanvasTree,\n\tinitialValue: SelectionColorsSupportedPropertyValue,\n\tnodeUpdateMap: SelectionColorsNodeUpdateMap,\n): UpdateSelectionColorInitialState {\n\tconst text = new Map<NodeID, string>()\n\tfor (const [nodeId] of nodeUpdateMap) {\n\t\tconst node = tree.get(nodeId)\n\t\tif (!isRichTextNode(node)) continue\n\n\t\ttext.set(nodeId, node.html)\n\t}\n\n\treturn { text, initialValue }\n}\n\nfunction mergeNodeUpdateMaps(target: SelectionColorsNodeUpdateMap, source: SelectionColorsNodeUpdateMap) {\n\tfor (const [nodeId, properties] of source) {\n\t\tconst targetProperties = target.get(nodeId) ?? []\n\t\ttargetProperties.push(...properties)\n\t\ttarget.set(nodeId, targetProperties)\n\t}\n}\n\nfunction add(\n\ttarget: SelectionColorsMap,\n\tpropertyValue: SelectionColorsSupportedPropertyValue | DynamicValue | null | undefined,\n\tid: NodeID,\n\tproperty: SelectionColorsSupportedProperty,\n) {\n\tif (!propertyValue) return\n\tif (isDynamicValue(propertyValue)) return\n\n\tconst key = selectionColorsPropertyValueKey(propertyValue)\n\tif (!key) return\n\n\tconst mapValue: SelectionColorsMapValue = target.get(key) ?? {\n\t\tvalue: isString(propertyValue) ? key : propertyValue,\n\t\tnodeUpdateMap: new Map(),\n\t}\n\ttarget.set(key, mapValue)\n\n\tconst nodeUpdateMap = mapValue.nodeUpdateMap\n\tconst propertiesToUpdate = nodeUpdateMap.get(id) ?? []\n\tpropertiesToUpdate.push(property)\n\tnodeUpdateMap.set(id, propertiesToUpdate)\n}\n\nexport function selectionColorsPropertyValueKey(value: SelectionColorsSupportedPropertyValue): string | undefined {\n\tif (!isString(value)) {\n\t\treturn value.toCSS()\n\t}\n\n\tif (isTokenCSSVariable(value)) {\n\t\treturn stripMetadataFromCSSVariable(value) ?? value\n\t}\n\n\tif (Color.isP3String(value)) return value\n\n\t// Most color strings are like rgb(1,2,3) when alpha is 1 and rgb(1,2,3,0.5) when alpha is not 1\n\t// however there is no validation on this and there are certain places where defaults set the color string\n\t// to some other format like rgb(1,2,3,1) or \"white\". We have to normalise all of these to allow for reliable\n\t// grouping of colors.\n\t// Colors coming from the Color function are cached so this call is not expensive.\n\tconst color = Color(value)\n\tif (color.isValid === false) return undefined\n\treturn Color.toRgbString(color)\n}\n\nexport function getValidCachedSelectionProperties(node: CanvasNode): CachedSelectionProperties | undefined {\n\treturn node.cache.selectionProperties && node.cache.selectionProperties.update === node.update\n\t\t? node.cache.selectionProperties\n\t\t: undefined\n}\n\nconst propertiesWithGradient = new Set([\n\t\"fillColor\",\n\t\"textColor\",\n\t\"textDecorationColor\",\n\t\"fillLinearGradient\",\n\t\"fillRadialGradient\",\n\t\"fillConicGradient\",\n])\n\n/**\n * If any property of any node supports gradient then we support updating to a gradient. The update\n * function will ensure that gradients are only set on those nodes that support it.\n */\nexport function isGradientUpdateSupported(\n\ttree: CanvasTree,\n\tnodeUpdateMap: SelectionColorsMapValue[\"nodeUpdateMap\"],\n): boolean {\n\treturn Array.from(nodeUpdateMap.entries()).some(([nodeId, properties]) => {\n\t\tconst node = tree.get(nodeId)\n\t\tif (!node) return false\n\n\t\treturn supportsGradient(node) && properties.some(prop => propertiesWithGradient.has(prop))\n\t})\n}\n\nfunction collectFill(node: CanvasNode, selectionColorProperties: SelectionColorsMap) {\n\t// Vector Set items have a fill, but its just for the canvas, so is excluded from the Selection\n\t// Colors UI.\n\tif (!hasFillEnabled(node) || !node.fillType || isVectorSetItem(node)) return\n\n\tswitch (node.fillType) {\n\t\tcase \"linear-gradient\":\n\t\t\tadd(selectionColorProperties, node.fillLinearGradient, node.id, \"fillLinearGradient\")\n\t\t\tbreak\n\t\tcase \"radial-gradient\":\n\t\t\tadd(selectionColorProperties, node.fillRadialGradient, node.id, \"fillRadialGradient\")\n\t\t\tbreak\n\t\tcase \"conic-gradient\":\n\t\t\tadd(selectionColorProperties, node.fillConicGradient, node.id, \"fillConicGradient\")\n\t\t\tbreak\n\t\tcase \"color\":\n\t\t\tadd(selectionColorProperties, node.fillColor, node.id, \"fillColor\")\n\t\t\tbreak\n\t\tcase \"image\":\n\t\t\tbreak\n\t\tdefault:\n\t\t\tassertNever(node.fillType)\n\t}\n}\n\nfunction collectBorderColor(node: CanvasNode, selectionColorProperties: SelectionColorsMap) {\n\tif (!withBorder(node) || !isOptionalBorderVisible(node.borderEnabled)) return\n\n\tadd(selectionColorProperties, node.borderColor, node.id, \"borderColor\")\n}\n\nfunction collectStrokeColor(node: CanvasNode, selectionColorProperties: SelectionColorsMap) {\n\tif (!withStroke(node) || !node.strokeEnabled) return\n\n\tadd(selectionColorProperties, node.strokeColor, node.id, \"strokeColor\")\n}\n\nfunction collectEffectColors(node: CanvasNode, selectionColorProperties: SelectionColorsMap) {\n\tif (withWhileHover(node) && node.whileHoverEnabled) {\n\t\tadd(selectionColorProperties, node.whileHoverBackgroundColor, node.id, \"whileHoverBackgroundColor\")\n\t}\n\n\tif (withWhileTap(node) && node.whileTapEnabled) {\n\t\tadd(selectionColorProperties, node.whileTapBackgroundColor, node.id, \"whileTapBackgroundColor\")\n\t}\n}\n\nfunction collectTextColors(node: CanvasNode, selectionColorProperties: SelectionColorsMap) {\n\tif (!isRichTextNode(node)) return\n\tif (hasUncollectableTextColors(node)) return\n\t// the --framer-text-color property value which is not consumed by the text\n\tconst colors: (DynamicValue | SelectionColorsSupportedPropertyValue | undefined)[] = []\n\tconst fills = node.getFills()\n\n\t// Fills (gradients) are applied per node and not on ranges, so if there are fills then we ignore the text colors\n\t// as they are not currently rendered by the node. `getFills` returns an array but it should never have >1 item,\n\t// and if it has more than that we just ignore the rest because we can't update them\n\tif (fills[0]) {\n\t\tcolors.push(fills[0])\n\t} else {\n\t\tcolors.push(...node.getTextColors(false))\n\t}\n\n\tfor (const color of colors) {\n\t\tadd(selectionColorProperties, color, node.id, \"textColor\")\n\t}\n\n\t// Collect text decoration colors\n\tconst textDecorationColors = node.getTextDecorationColors(false, true)\n\tfor (const color of textDecorationColors) {\n\t\tif (color === \"currentColor\") continue\n\n\t\tadd(selectionColorProperties, color, node.id, \"textDecorationColor\")\n\t}\n\n\tfor (const backgroundColor of node.getTextBackgroundColors(false)) {\n\t\tadd(selectionColorProperties, backgroundColor, node.id, \"textBackgroundColor\")\n\t}\n}\n\nfunction collectComponentInstanceColors(\n\tcomponentLoader: ComponentLoader,\n\tnode: CanvasNode,\n\tselectionColorProperties: SelectionColorsMap,\n) {\n\tif (!isCodeComponentNode(node)) return\n\tconst component = componentLoader.reactComponentForIdentifier(node.codeComponentIdentifier)\n\n\tif (!component || !component.properties) return undefined\n\n\tconst controlProps = node.getControlProps(component.properties)\n\n\tfor (const key in controlProps) {\n\t\tconst controlProp = controlProps[key]\n\t\tif (!controlProp || isDynamicValue(controlProp.value) || !isSupportedControlType(controlProp.type)) continue\n\n\t\tswitch (controlProp.type) {\n\t\t\tcase ControlType.Color:\n\t\t\t\tadd(selectionColorProperties, controlProp.value, node.id, prefixControlPropKey(key))\n\t\t\t\tbreak\n\t\t\tcase ControlType.Border: {\n\t\t\t\tif (isBorderValues(controlProp.value)) {\n\t\t\t\t\tadd(selectionColorProperties, controlProp.value.borderColor, node.id, prefixControlPropKey(key))\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tassertNever(controlProp.type)\n\t\t}\n\t}\n}\n\ntype SupportedColorControlType = ControlType.Border | ControlType.Color\nfunction isSupportedControlType(controlType: ControlType | null): controlType is SupportedColorControlType {\n\tif (!controlType) return false\n\n\tswitch (controlType) {\n\t\tcase ControlType.Color:\n\t\tcase ControlType.Border:\n\t\t\treturn true\n\t\tcase ControlType.Gap:\n\t\tcase ControlType.BorderRadius:\n\t\tcase ControlType.Padding:\n\t\tcase ControlType.BoxShadow:\n\t\tcase ControlType.Font:\n\t\tcase ControlType.Array:\n\t\tcase ControlType.Boolean:\n\t\tcase ControlType.CollectionReference:\n\t\tcase ControlType.ComponentInstance:\n\t\tcase ControlType.Slot:\n\t\tcase ControlType.Cursor:\n\t\tcase ControlType.CustomCursor:\n\t\tcase ControlType.Date:\n\t\tcase ControlType.Enum:\n\t\tcase ControlType.EventHandler:\n\t\tcase ControlType.ChangeHandler:\n\t\tcase ControlType.File:\n\t\tcase ControlType.Link:\n\t\tcase ControlType.MultiCollectionReference:\n\t\tcase ControlType.Number:\n\t\tcase ControlType.Object:\n\t\tcase ControlType.PageScope:\n\t\tcase ControlType.RichText:\n\t\tcase ControlType.ScrollSectionRef:\n\t\tcase ControlType.String:\n\t\tcase ControlType.Transition:\n\t\tcase ControlType.TrackingId:\n\t\tcase ControlType.VectorSetItem:\n\t\tcase ControlType.ResponsiveImage:\n\t\tcase ControlType.FusedNumber:\n\t\tcase ControlType.Image:\n\t\tcase ControlType.SegmentedEnum:\n\t\tcase ControlType.LinkRelValues:\n\t\tcase ControlType.Location:\n\t\t\treturn false\n\t\tdefault:\n\t\t\tassertNever(controlType)\n\t}\n}\n\nfunction updateBorderColor(node: CanvasNode, value: SelectionColorsSupportedPropertyValue) {\n\tif (!withBorder(node) || !node.borderEnabled || isGradient(value)) return\n\n\tnode.set({ borderColor: value })\n}\n\nfunction updateStrokeColor(node: CanvasNode, value: SelectionColorsSupportedPropertyValue) {\n\tif (!withStroke(node) || !node.strokeEnabled || isGradient(value)) return\n\n\tnode.set({ strokeColor: value })\n}\n\nfunction updateFill(node: CanvasNode, value: SelectionColorsSupportedPropertyValue) {\n\tif (!hasFillEnabled(node)) return\n\n\tif (isString(value)) {\n\t\tnode.set({ fillType: \"color\", fillColor: value })\n\t\treturn\n\t}\n\n\tconst fillType = gradientFillType(value)\n\tif (!fillType || !supportsGradientProps(node)) return\n\n\t// If the current update is of that gradient type, the value will be directly used in the update. Otherwise, the\n\t// other unused, optional gradients will either be updated or created.\n\tconst linearGradient = isLinearGradient(value) ? value : linearGradientUpdate(node, { stops: value.stops }, tool)\n\tlet radialGradient = isRadialGradient(value) ? value : radialGradientUpdate(node, { stops: value.stops }, tool)\n\tlet conicGradient = isConicGradient(value) ? value : conicGradientUpdate(node, { stops: value.stops }, tool)\n\n\t// Handle position remapping for radial and conic gradients\n\tlet nextGradientToRemap: Gradient | undefined = undefined\n\tif (fillType === \"radial-gradient\") {\n\t\tnextGradientToRemap = radialGradient\n\t} else if (fillType === \"conic-gradient\") {\n\t\tnextGradientToRemap = conicGradient\n\t}\n\n\tif (isGradient(nextGradientToRemap)) {\n\t\tconst remappedGradientStops = normalizeGradientStopPositions(nextGradientToRemap)\n\t\tif (remappedGradientStops) {\n\t\t\tradialGradient = radialGradientUpdate(node, { stops: remappedGradientStops }, tool)\n\t\t\tconicGradient = conicGradientUpdate(node, { stops: remappedGradientStops }, tool)\n\t\t}\n\t}\n\n\tnode.set({\n\t\tfillType,\n\t\tfillLinearGradient: linearGradient,\n\t\tfillRadialGradient: radialGradient,\n\t\tfillConicGradient: conicGradient,\n\t})\n}\n\nfunction updateEffectColor(\n\tnode: CanvasNode,\n\tvalue: SelectionColorsSupportedPropertyValue,\n\tproperty: \"whileHoverBackgroundColor\" | \"whileTapBackgroundColor\",\n) {\n\tif (isGradient(value)) return\n\n\tif (property === \"whileHoverBackgroundColor\" && withWhileHover(node) && node.whileHoverEnabled) {\n\t\tnode.set({ whileHoverBackgroundColor: value })\n\t}\n\n\tif (property === \"whileTapBackgroundColor\" && withWhileTap(node) && node.whileTapEnabled) {\n\t\tnode.set({ whileTapBackgroundColor: value })\n\t}\n}\n\nfunction updateTextColors(\n\tnode: CanvasNode,\n\tvalue: SelectionColorsSupportedPropertyValue,\n\tinitialState: UpdateSelectionColorInitialState,\n) {\n\tif (!isRichTextNode(node) || !initialState.text.has(node.id)) return\n\tif (hasUncollectableTextColors(node)) return\n\n\tnode.set({ html: initialState.text.get(node.id) })\n\n\tif (isGradient(value)) {\n\t\tnode.draftOrCurrent().setFill(value)\n\t\treturn\n\t}\n\n\tif (isGradient(initialState.initialValue)) {\n\t\tnode.draftOrCurrent().setFill(undefined)\n\t\tnode.draftOrCurrent().setTextColor(value, false)\n\t\treturn\n\t}\n\n\tnode.draftOrCurrent().replaceTextColor(initialState.initialValue, value)\n}\n\nfunction updateTextDecorationColors(\n\tnode: CanvasNode,\n\tvalue: SelectionColorsSupportedPropertyValue,\n\tinitialState: UpdateSelectionColorInitialState,\n) {\n\tif (!isRichTextNode(node) || !initialState.text.has(node.id)) return\n\tif (hasUncollectableTextColors(node)) return\n\tif (isGradient(value) || isGradient(initialState.initialValue)) return\n\n\tnode.set({ html: initialState.text.get(node.id) })\n\n\tnode.draftOrCurrent().replaceTextDecorationColor(initialState.initialValue, value)\n}\n\nfunction updateTextBackgroundColors(\n\tnode: CanvasNode,\n\tvalue: SelectionColorsSupportedPropertyValue,\n\tinitialState: UpdateSelectionColorInitialState,\n) {\n\tif (!isRichTextNode(node) || !initialState.text.has(node.id)) return\n\tif (hasUncollectableTextColors(node)) return\n\tif (isGradient(initialState.initialValue) || isGradient(value)) return\n\n\tnode.set({ html: initialState.text.get(node.id) })\n\n\tnode.draftOrCurrent().replaceTextBackgroundColor(initialState.initialValue, value)\n}\n\nfunction updateComponentInstanceColor(\n\tcomponentLoader: ComponentLoader,\n\tnode: CanvasNode,\n\tvalue: SelectionColorsSupportedPropertyValue,\n\tpropertyKey: PrefixedControlPropKey,\n) {\n\tif (!isCodeComponentNode(node) || isGradient(value)) return\n\n\tconst propertyKeyWithoutPrefix = removeControlPropKeyPrefix(propertyKey)\n\tconst component = componentLoader.reactComponentForIdentifier(node.codeComponentIdentifier)\n\n\tif (!component || !component.properties) return undefined\n\n\tconst control = component.properties[propertyKeyWithoutPrefix]\n\tconst controlProp = node.getControlProps(component.properties)[propertyKeyWithoutPrefix]\n\n\tif (!control || !controlProp || !isSupportedControlType(controlProp.type)) return undefined\n\n\tlet updated: ControlProp | null = null\n\tswitch (controlProp.type) {\n\t\tcase ControlType.Color:\n\t\t\tupdated = getControlProp(control, { ...controlProp, value })\n\t\t\tbreak\n\t\tcase ControlType.Border:\n\t\t\t{\n\t\t\t\tif (!isBorderValues(controlProp.value)) return\n\n\t\t\t\tconst borderValues: BorderValues = { ...controlProp.value, borderColor: value }\n\t\t\t\tupdated = getControlProp(control, { ...controlProp, value: borderValues })\n\t\t\t}\n\t\t\tbreak\n\t}\n\n\tif (!updated) return\n\n\tnode.setControlProp(propertyKeyWithoutPrefix, updated)\n}\n\nfunction hasUncollectableTextColors(node: RichTextNode) {\n\t// text node has formatted text variable so the colors can't be collected or updated correctly\n\treturn isVariableReference(node.htmlContent)\n}\n\n/**\n * Sorts the entries of the map by the property key (token, color or gradient string).\n * The sorting results in the following order:\n * 1. Tokens sorted by name appear first\n * 2. Gradients appear next, using the color sorting algortihm on the gradient stops\n * 3. Colors are sorted into buckets of similar colours, then a basic calculation on the hsl is used to sort within each bucket\n *\n * The result is a sort which makes the colors feel sorted visually but it is mostly just vibes and not any mathematical sort.\n * There are some possible mathematical sorting options but the results are not pleasing to the eye https://www.alanzucconi.com/2015/09/30/colour-sorting/\n */\nexport function getSortedColorArray(engine: VekterEngine, colorMap: SelectionColorsMap) {\n\treturn [...colorMap.entries()].sort(([a], [b]) => {\n\t\tif (a === b) return 0\n\n\t\treturn sortTokens(engine, a, b) || sortGradients(a, b) || sortColors(a, b)\n\t})\n}\n\nfunction sortTokens(engine: VekterEngine, maybeTokenA: string, maybeTokenB: string) {\n\tconst isTokenA = isTokenCSSVariable(maybeTokenA)\n\tconst isTokenB = isTokenCSSVariable(maybeTokenB)\n\n\tif (!isTokenA && !isTokenB) return 0\n\tif (isTokenA !== isTokenB) return isTokenA ? -1 : 1\n\n\tconst aToken = engine.tree.get(tokenIdFromCSSVariable(maybeTokenA))\n\tconst bToken = engine.tree.get(tokenIdFromCSSVariable(maybeTokenB))\n\tconst aName = aToken?.resolveValue(\"name\")\n\tconst bName = bToken?.resolveValue(\"name\")\n\tif (aName && bName) {\n\t\treturn aName.localeCompare(bName)\n\t}\n\n\treturn 0\n}\n\nfunction sortGradients(a: string, b: string) {\n\tconst isAGradient = a.includes(\"gradient\")\n\tconst isBGradient = b.includes(\"gradient\")\n\n\tif (!isAGradient && !isBGradient) return 0\n\n\tif (isAGradient !== isBGradient) return isAGradient ? -1 : 1\n\n\tconst aStops = getGradientColorsFromString(a)\n\tconst bStops = getGradientColorsFromString(b)\n\n\tfor (let i = 0; i < aStops.length; i++) {\n\t\tconst aStop = aStops[i]\n\t\tconst bStop = bStops[i]\n\t\tif (!aStop || !bStop) return aStop ? -1 : 1\n\t\tif (aStop === bStop) continue\n\n\t\treturn sortColors(aStop, bStop)\n\t}\n}\n\nconst getColor = memoizeOne((color: string) => {\n\tif (Color.isP3String(color)) {\n\t\tconst parsed = P3Color.fromString(color)\n\t\tassert(parsed, \"Invalid P3 color\")\n\n\t\t// Pretend that the r, g, b channels of the P3 color are sRGB values for the purposes of\n\t\t// comparison and sorting.\n\t\treturn Color({\n\t\t\tr: parsed.r,\n\t\t\tg: parsed.g,\n\t\t\tb: parsed.b,\n\t\t\ta: parsed.a,\n\t\t})\n\t}\n\n\treturn Color(color)\n})\n\nfunction sortColors(a: string, b: string) {\n\tif (a === b) return 0\n\n\tconst aColor = Color.toHsl(getColor(a))\n\tconst bColor = Color.toHsl(getColor(b))\n\n\tconst aRank = getRankForHslColor(aColor)\n\tconst bRank = getRankForHslColor(bColor)\n\n\tif (aRank !== bRank) return aRank - bRank\n\n\tif (aColor.h === bColor.h && aColor.s === bColor.s && aColor.l === bColor.l) return bColor.a * 100 - aColor.a * 100\n\n\treturn getSubrankForHslColor(aColor) - getSubrankForHslColor(bColor)\n}\n\nfunction getRankForHslColor(color: ColorHSLA): number {\n\t// grayscale bucket goes last\n\tif (isGrayscale(color)) return 100\n\n\t// red - yellow bucket\n\tif (color.h < 60 || color.h >= 340) return 10\n\t// green bucket\n\tif (color.h >= 60 && color.h < 180) return 20\n\t// blue bucket\n\tif (color.h >= 180 && color.h < 260) return 30\n\t// purple - pink bucket\n\tif (color.h >= 260 && color.h < 340) return 40\n\n\treturn 50\n}\n\nfunction getSubrankForHslColor(color: ColorHSLA): number {\n\tif (isGrayscale(color)) return color.s + color.l\n\t// We rotate the hue if it is red because red is both the lower values and the higher values\n\tconst hue = (100 / color.h >= 340 ? 360 - color.h : color.h) * 100\n\tconst saturation = color.s * 10\n\t// at 0 colors are black and at 1 colors are white, so we want use the distance from 0.5\n\tconst lightness = (1 - Math.abs(0.5 - color.l)) * 10\n\n\treturn hue + saturation + lightness\n}\n\nfunction getGradientColorsFromString(gradient: string): string[] {\n\tconst matches = gradient.match(supportedGradientColorRegex)\n\tif (!matches) return []\n\n\treturn matches\n}\n\nfunction isGrayscale(color: ColorHSLA) {\n\treturn color.s < 0.2 || color.l < 0.2\n}\n", "import type { ComponentLoader } from \"@framerjs/framer-runtime\"\nimport {\n\ttype SelectionColorsMap,\n\tgetSelectionColorProperties,\n\tgetValidCachedSelectionProperties,\n\tmergeSelectionColorsMaps,\n} from \"document/components/chrome/properties/panels/utils/selectionProperties.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\n\nexport interface ReducedSelectionProperties {\n\tselectionColorProperties: SelectionColorsMap\n\t/** The selection properties were derived entirely from the cache, so we can reuse the last result to avoid rerenders */\n\tonlyCachedSelectionProperties: boolean\n}\n\nexport function reduceSelectionProperties(\n\tcomponentLoader: ComponentLoader,\n\tnode: CanvasNode,\n\tresult: ReducedSelectionProperties,\n\tresetCache: boolean,\n) {\n\tif (resetCache) {\n\t\tnode.cache.selectionProperties = undefined\n\t}\n\n\tconst cachedSelectionProperties = getValidCachedSelectionProperties(node)\n\tconst selectionColorProperties =\n\t\tcachedSelectionProperties?.selectionColors ?? getSelectionColorProperties(componentLoader, node)\n\n\tresult.onlyCachedSelectionProperties &&= Boolean(cachedSelectionProperties)\n\n\tif (!cachedSelectionProperties) {\n\t\tnode.cache.selectionProperties = {\n\t\t\tupdate: node.update,\n\t\t\tselectionColors: selectionColorProperties,\n\t\t}\n\t}\n\n\tmergeSelectionColorsMaps(result.selectionColorProperties, selectionColorProperties)\n}\n", "import type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport type { SpringOptions } from \"framer-motion\"\nimport { withShaderMouse } from \"../WithShaderMouse.ts\"\nimport type { Reduced } from \"./Reduced.ts\"\nimport { reduceObjectProperty } from \"./reduceObjectProperty.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedShaderMouse {\n\tshaderMouseEnabled: Reduced<boolean | undefined>\n\tshaderMouseSpringOptions: Reduced<SpringOptions | undefined>\n}\n\nexport function reduceShaderMouse(node: CanvasNode, result: ReducedShaderMouse) {\n\tif (!withShaderMouse(node)) return\n\n\treduceProperty(\"shaderMouseEnabled\", result, node)\n\treduceObjectProperty(\"shaderMouseSpringOptions\", result, node)\n}\n", "import type { ComponentLoader } from \"@framerjs/framer-runtime\"\nimport { Mixed, assertNever } from \"@framerjs/shared\"\nimport { roundWithPrecision } from \"canvas-sandbox/layout-measuring/roundWithPrecision.ts\"\nimport { isPinnable } from \"document/models/CanvasTree/traits/WithPins.ts\"\nimport { isPositionRelative } from \"document/models/CanvasTree/traits/utils/positionTypeHelpers.ts\"\nimport { checkDimensionEnabled } from \"document/utils/layoutHelpers.ts\"\nimport { DimensionType } from \"library/render/types/Constraints.ts\"\nimport type { Size } from \"library/render/types/Size.ts\"\nimport { roundedNumberString } from \"library/render/utils/roundedNumber.ts\"\nimport type { CanvasTree } from \"../../CanvasTree.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { isVectorNode } from \"../../nodes/TreeNode.ts\"\nimport { isCodeComponentNode } from \"../../nodes/utils/nodeCheck.ts\"\nimport { isGridChildFillingCellHeight, isGridChildFillingCellWidth } from \"../WithGridItemSize.ts\"\nimport { isBreakpointWithLayoutTemplate } from \"../WithLayoutTemplate.ts\"\nimport { withSize } from \"../WithSize.ts\"\nimport { viewportUnitForDimension } from \"../WithSizeDimensionType.ts\"\nimport type { Reduced } from \"./Reduced.ts\"\nimport { isNotFound } from \"./Reduced.ts\"\nimport { getSupportedDimensionType } from \"./getDimensionOrVariantDimensionType.ts\"\nimport type { ReducedPosition } from \"./reducePosition.ts\"\nimport { reducePosition } from \"./reducePosition.ts\"\n\nexport enum Orientation {\n\tLandscape,\n\tPortrait,\n}\n\nfunction getOrientation(size: Size): Orientation | Mixed {\n\tif (size.width > size.height) return Orientation.Landscape\n\tif (size.height > size.width) return Orientation.Portrait\n\treturn Mixed\n}\n\nexport interface CanSetSizeProps {\n\tcanSetWidthToFixed: boolean\n\tcanSetHeightToFixed: boolean\n\tcanSetWidthToPercentage: boolean\n\tcanSetWidthToFitImage: boolean\n\tcanSetHeightToPercentage: boolean\n\t// For stacks this means set to fraction, while for grids this means setting it to fill\n\tcanSetHeightToFillParent: boolean\n\tcanSetHeightToFitImage: boolean\n\tcanSetWidthToFillParent: boolean\n\tcanSetWidthToAuto: boolean\n\tcanSetHeightToAuto: boolean\n\tcanSetWidthToViewport: boolean\n\tcanSetHeightToViewport: boolean\n\tcanSetSizeToDefault: boolean\n}\n\nexport interface ReducedSizeProperties extends ReducedPosition, CanSetSizeProps {\n\twidth: Reduced<number | string>\n\theight: Reduced<number | string>\n\n\twidthTypes: Set<DimensionType>\n\theightTypes: Set<DimensionType>\n\n\torientation: Reduced<Orientation>\n\torientationEnabled: boolean\n}\n\nexport function reduceSize(\n\ttree: CanvasTree,\n\tcomponentLoader: ComponentLoader,\n\tnode: CanvasNode,\n\tresult: ReducedSizeProperties,\n) {\n\tconst rect = tree.getRect(node, true, true, componentLoader)\n\tconst dimensionEnabled = checkDimensionEnabled(tree, componentLoader, node)\n\n\tresult.canSetWidthToPercentage = dimensionEnabled.width[DimensionType.Percentage]\n\tresult.canSetHeightToPercentage = dimensionEnabled.height[DimensionType.Percentage]\n\n\tresult.canSetWidthToFillParent = dimensionEnabled.width[DimensionType.FractionOfFreeSpace]\n\tresult.canSetHeightToFillParent = dimensionEnabled.height[DimensionType.FractionOfFreeSpace]\n\n\tresult.canSetWidthToViewport = dimensionEnabled.width[DimensionType.Viewport]\n\tresult.canSetHeightToViewport = dimensionEnabled.height[DimensionType.Viewport]\n\n\tresult.canSetWidthToAuto = dimensionEnabled.width[DimensionType.Auto]\n\tresult.canSetHeightToAuto = dimensionEnabled.height[DimensionType.Auto]\n\n\tresult.canSetWidthToFixed = dimensionEnabled.width[DimensionType.FixedNumber]\n\tresult.canSetHeightToFixed = dimensionEnabled.height[DimensionType.FixedNumber]\n\n\tresult.canSetWidthToFitImage &&= dimensionEnabled.width[DimensionType.FitImage]\n\tresult.canSetHeightToFitImage &&= dimensionEnabled.height[DimensionType.FitImage]\n\n\tif (result.orientation !== Mixed) {\n\t\tconst orientation = getOrientation(rect)\n\t\tif (isNotFound(result.orientation)) {\n\t\t\tresult.orientation = orientation\n\t\t} else if (orientation !== result.orientation) {\n\t\t\tresult.orientation = Mixed\n\t\t}\n\t}\n\n\tresult.orientationEnabled = result.orientationEnabled || rect.width !== rect.height\n\n\tconst isCodeComponent = isCodeComponentNode(node)\n\n\t// Match the precision of SVG serialization. This prevents floating point precision issues from\n\t// being visible in the UI.\n\tlet width: number | string = isVectorNode(node) ? roundWithPrecision(rect.width, 3) : rect.width\n\tlet height: number | string = isVectorNode(node) ? roundWithPrecision(rect.height, 3) : rect.height\n\n\tif (isPinnable(node) && withSize(node)) {\n\t\tconst currentWidthType = isCodeComponent\n\t\t\t? getSupportedDimensionType(componentLoader, node, \"width\")\n\t\t\t: node.widthType\n\t\tconst currentHeightType = isCodeComponent\n\t\t\t? getSupportedDimensionType(componentLoader, node, \"height\")\n\t\t\t: node.heightType\n\n\t\tconst relativeUnit = \"%\"\n\t\tconst fractionUnit = \"fr\"\n\n\t\tlet widthType = node.widthType\n\t\tlet heightType = node.heightType\n\n\t\tif (isGridChildFillingCellWidth(node)) {\n\t\t\twidth = \"Auto\"\n\t\t\twidthType = DimensionType.FractionOfFreeSpace\n\t\t} else {\n\t\t\tswitch (currentWidthType) {\n\t\t\t\tcase DimensionType.Percentage:\n\t\t\t\t\twidth = `${Math.round(node.width * 100)}${relativeUnit}`\n\t\t\t\t\tbreak\n\t\t\t\tcase DimensionType.FractionOfFreeSpace:\n\t\t\t\t\twidth = `${roundedNumberString(node.width, 2)}${fractionUnit}`\n\t\t\t\t\tbreak\n\t\t\t\tcase DimensionType.Viewport:\n\t\t\t\t\twidth = `${Math.round(node.width * 100)}${viewportUnitForDimension(\"width\")}`\n\t\t\t\t\tbreak\n\t\t\t\tcase DimensionType.Auto:\n\t\t\t\tcase DimensionType.FixedNumber:\n\t\t\t\tcase DimensionType.FitImage:\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\tassertNever(currentWidthType)\n\t\t\t}\n\t\t}\n\n\t\tif (isGridChildFillingCellHeight(node)) {\n\t\t\theight = \"Auto\"\n\t\t\theightType = DimensionType.FractionOfFreeSpace\n\t\t} else if (isBreakpointWithLayoutTemplate(node)) {\n\t\t\theightType = DimensionType.Auto\n\t\t} else {\n\t\t\tswitch (currentHeightType) {\n\t\t\t\tcase DimensionType.Percentage:\n\t\t\t\t\theight = `${Math.round(node.height * 100)}${relativeUnit}`\n\t\t\t\t\tbreak\n\t\t\t\tcase DimensionType.FractionOfFreeSpace:\n\t\t\t\t\theight = `${roundedNumberString(node.height, 2)}${fractionUnit}`\n\t\t\t\t\tbreak\n\t\t\t\tcase DimensionType.Viewport:\n\t\t\t\t\theight = `${Math.round(node.height * 100)}${viewportUnitForDimension(\"height\")}`\n\t\t\t\t\tbreak\n\t\t\t\tcase DimensionType.Auto:\n\t\t\t\tcase DimensionType.FixedNumber:\n\t\t\t\tcase DimensionType.FitImage:\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\tassertNever(currentHeightType)\n\t\t\t}\n\t\t}\n\n\t\tresult.widthTypes.add(widthType)\n\t\tresult.heightTypes.add(heightType)\n\t}\n\n\tif (isNotFound(result.width)) {\n\t\tresult.width = width\n\t\tresult.height = height\n\t} else {\n\t\tif (result.width !== Mixed && result.width !== width) result.width = Mixed\n\t\tif (result.height !== Mixed && result.height !== height) result.height = Mixed\n\t}\n\n\tconst parent = tree.getParent(node.id)\n\n\tif (isPositionRelative(node, parent)) return\n\treducePosition(tree, node, rect, parent, result)\n}\n", "import { Mixed, assertNever } from \"@framerjs/shared\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { ConstraintUnit, WithSizeConstraints } from \"../WithSizeConstraints.ts\"\nimport { parseConstraintValue, supportsSizeConstraints } from \"../WithSizeConstraints.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { isNotFound } from \"./Reduced.ts\"\n\nexport interface ReducedSizeConstraints extends ReducedRecord<Record<keyof WithSizeConstraints, number | undefined>> {\n\tonlyNodesWithSizeConstraints: boolean\n\tmaxWidthUnits: Set<ConstraintUnit>\n\tmaxHeightUnits: Set<ConstraintUnit>\n\tminWidthUnits: Set<ConstraintUnit>\n\tminHeightUnits: Set<ConstraintUnit>\n}\n\nexport function reduceSizeConstraints(node: CanvasNode, result: ReducedSizeConstraints) {\n\tif (!supportsSizeConstraints(node)) {\n\t\tresult.onlyNodesWithSizeConstraints = false\n\t\treturn\n\t}\n\n\treduceSizeConstraint(\"maxWidth\", result, node)\n\treduceSizeConstraint(\"minWidth\", result, node)\n\treduceSizeConstraint(\"maxHeight\", result, node)\n\treduceSizeConstraint(\"minHeight\", result, node)\n}\n\nexport function getConstraintUnit<TKey extends keyof WithSizeConstraints>(key: TKey): `${TKey}Units` {\n\tswitch (key) {\n\t\tcase \"maxWidth\":\n\t\tcase \"minWidth\":\n\t\tcase \"maxHeight\":\n\t\tcase \"minHeight\":\n\t\t\treturn `${key}Units`\n\t\tdefault:\n\t\t\tassertNever(key)\n\t}\n}\n\nfunction reduceSizeConstraint(\n\tkey: keyof WithSizeConstraints,\n\tresult: ReducedSizeConstraints,\n\tnode: CanvasNode & WithSizeConstraints,\n) {\n\tconst currentResultValue = result[key]\n\n\tconst nodeValue = node[key]\n\tif (nodeValue === undefined) {\n\t\tif (isNotFound(currentResultValue)) {\n\t\t\tresult[key] = nodeValue\n\t\t} else if (nodeValue !== currentResultValue) {\n\t\t\tresult[key] = Mixed\n\t\t}\n\t\treturn\n\t}\n\n\tconst [value, unit] = parseConstraintValue(nodeValue)\n\n\tresult[getConstraintUnit(key)].add(unit)\n\n\tif (currentResultValue === Mixed) return\n\n\tif (isNotFound(currentResultValue)) {\n\t\tresult[key] = value\n\t} else if (value !== currentResultValue) {\n\t\tresult[key] = Mixed\n\t}\n}\n", "import type { CanvasNode, CanvasTree } from \"document/models/CanvasTree/index.ts\"\nimport type { WithStrokeEffect } from \"../WithStrokeEffect.ts\"\nimport { withStrokeEffect } from \"../WithStrokeEffect.ts\"\nimport { isVectorSetItem } from \"../WithVectorSetItem.ts\"\nimport type { Reduced, ReducedRecord } from \"./Reduced.ts\"\nimport { type ReducedEffectTransition, getReducedEffectTransition } from \"./reduceEffectTransition.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedStrokeEffect extends ReducedRecord<Omit<WithStrokeEffect, \"strokeEffectTransition\">> {\n\tonlyNodesWithStrokeEffect: boolean\n\tstrokeEffectTransition: Reduced<ReducedEffectTransition | undefined>\n}\n\nexport function reduceStrokeEffect(tree: CanvasTree, node: CanvasNode, result: ReducedStrokeEffect) {\n\tif (!withStrokeEffect(node)) {\n\t\tresult.onlyNodesWithStrokeEffect = false\n\t\treturn\n\t}\n\n\tconst groundNode = tree.getGroundNodeFor(node)\n\tif (!isVectorSetItem(groundNode)) {\n\t\tresult.onlyNodesWithStrokeEffect = false\n\t\treturn\n\t}\n\n\treduceProperty(\"strokeEffectEnabled\", result, node)\n\treduceProperty(\"strokeEffectLength\", result, node)\n\treduceProperty(\"strokeEffectGap\", result, node)\n\treduceProperty(\"strokeEffectOffset\", result, node)\n\treduceProperty(\"strokeEffectLoop\", result, node)\n\treduceProperty(\"strokeEffectLoopType\", result, node)\n\n\tresult.strokeEffectTransition = getReducedEffectTransition(node.strokeEffectTransition, result.strokeEffectTransition)\n}\n", "import { Mixed } from \"@framerjs/shared\"\nimport type { CanvasNode, NodeID } from \"document/models/CanvasTree/index.ts\"\nimport { isEqual } from \"library/index.ts\"\nimport type { ScrollDirection } from \"library/modules/createTransformInputRange.ts\"\nimport { isNumber, isUndefined } from \"utils/typeChecks.ts\"\nimport { isDynamicValue } from \"../DynamicValue.ts\"\nimport type { VariableReference } from \"../VariableReference.ts\"\nimport { withRotation } from \"../WithRotation.ts\"\nimport type { StyleAppearEffectTrigger, WithStyleAppearEffect } from \"../WithStyleAppearEffect.ts\"\nimport { withStyleAppearPageEffect } from \"../WithStyleAppearEffect.ts\"\nimport { EffectTrigger, effectTriggerStringToEnumMember } from \"./EffectTrigger.ts\"\nimport type { Reduced, ReducedRecord } from \"./Reduced.ts\"\nimport { isNotFound } from \"./Reduced.ts\"\nimport { type ReducedEffectTransition, getReducedEffectTransition } from \"./reduceEffectTransition.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nfunction undefinedToTrue<T>(value: T | undefined): T | true {\n\treturn isUndefined(value) ? true : value\n}\n\nfunction getScrollDirectionFallback(value: ScrollDirection | undefined): ScrollDirection {\n\treturn value ?? \"down\"\n}\n\nexport interface ReducedStyleAppearEffect extends ReducedRecord<\n\tOmit<\n\t\tWithStyleAppearEffect,\n\t\t| \"styleAppearEffectScrollTarget\"\n\t\t| \"styleAppearEffectTrigger\"\n\t\t| \"enterEffectRotateAdditiveDynamicValue\"\n\t\t| \"exitEffectRotateAdditiveDynamicValue\"\n\t\t| \"enterEffectPerspective\"\n\t\t| \"exitEffectPerspective\"\n\t\t| \"enterEffectTransition\"\n\t\t| \"exitEffectTransition\"\n\t\t| \"styleAppearEffectTransition\"\n\t>\n> {\n\tonlyNodesWithStyleAppearEffect: boolean\n\tstyleAppearEffectScrollTarget: Set<NodeID | VariableReference>\n\tstyleAppearEffectTrigger: Set<WithStyleAppearEffect[\"styleAppearEffectTrigger\"]>\n\tenterEffectTransition: Reduced<ReducedEffectTransition | undefined>\n\texitEffectTransition: Reduced<ReducedEffectTransition | undefined>\n\t/** @deprecated @see WithStyleAppearEffect.styleAppearEffectTransition */\n\tstyleAppearEffectTransition: Reduced<ReducedEffectTransition | undefined>\n}\n\nexport function reduceStyleAppearEffect(node: CanvasNode, result: ReducedStyleAppearEffect) {\n\tif (!withStyleAppearPageEffect(node)) {\n\t\tresult.onlyNodesWithStyleAppearEffect = false\n\t\treturn\n\t}\n\n\t// Settings\n\treduceProperty(\"styleAppearEffectLocked\", result, node, undefinedToTrue)\n\treduceProperty(\"styleAppearEffectEnabled\", result, node)\n\treduceProperty(\"styleAppearEffectThreshold\", result, node)\n\treduceProperty(\"styleAppearEffectAnimateOnce\", result, node)\n\treduceProperty(\"styleAppearEffectScrollDirection\", result, node, getScrollDirectionFallback)\n\n\t// Originally, styleAppearEffectTrigger did not exist, as the only trigger\n\t// was \"scroll\". We added \"appear\" later. To avoid a migration at that time\n\t// we made changes so that `undefined` would be assumed to be `scroll`. Here\n\t// we set the default value to `scroll` if undefined so that the UI reflects\n\t// this. A migration can resolve this.\n\tresult.styleAppearEffectTrigger.add(\n\t\tisUndefined(node.styleAppearEffectTrigger)\n\t\t\t? EffectTrigger.OnInView\n\t\t\t: (effectTriggerStringToEnumMember(node.styleAppearEffectTrigger) as StyleAppearEffectTrigger | undefined),\n\t)\n\n\tif (!isUndefined(node.styleAppearEffectScrollTarget)) {\n\t\tresult.styleAppearEffectScrollTarget.add(node.styleAppearEffectScrollTarget)\n\t}\n\n\treduceProperty(\"enterEffectEnabled\", result, node, undefinedToTrue)\n\treduceProperty(\"enterEffectOpacity\", result, node, v => (isUndefined(v) ? node.styleAppearEffectOpacity : v))\n\treduceProperty(\"enterEffectX\", result, node, v => (isUndefined(v) ? node.styleAppearEffectX : v))\n\treduceProperty(\"enterEffectY\", result, node, v => (isUndefined(v) ? node.styleAppearEffectY : v))\n\treduceProperty(\"enterEffectScale\", result, node, v => (isUndefined(v) ? node.styleAppearEffectScale : v))\n\treduceProperty(\"enterEffectRotate3d\", result, node, value => {\n\t\tif (!isUndefined(value)) return value\n\t\tconst rotateX = node.enterEffectRotateX\n\t\tconst rotateY = node.enterEffectRotateY\n\n\t\tif (isNumber(rotateX) && rotateX > 0) return true\n\t\tif (isNumber(rotateY) && rotateY > 0) return true\n\n\t\treturn false\n\t})\n\n\treduceProperty(\"enterEffectRotate\", result, node, v => {\n\t\tconst value = isUndefined(v) ? (node.styleAppearEffectRotate ?? 0) : (v ?? 0)\n\t\tif (withRotation(node) && isDynamicValue(node.rotation) && node.enterEffectRotateAdditiveDynamicValue) {\n\t\t\treturn node.resolveValue(\"rotation\") + (value ?? 0)\n\t\t}\n\t\treturn value\n\t})\n\treduceProperty(\"enterEffectRotateX\", result, node, v => (isUndefined(v) ? node.styleAppearEffectRotateX : v))\n\treduceProperty(\"enterEffectRotateY\", result, node, v => (isUndefined(v) ? node.styleAppearEffectRotateY : v))\n\treduceProperty(\"enterEffectSkewX\", result, node)\n\treduceProperty(\"enterEffectSkewY\", result, node)\n\n\treduceProperty(\"exitEffectEnabled\", result, node, undefinedToTrue)\n\treduceProperty(\"exitEffectOpacity\", result, node)\n\treduceProperty(\"exitEffectX\", result, node)\n\treduceProperty(\"exitEffectY\", result, node)\n\treduceProperty(\"exitEffectScale\", result, node)\n\treduceProperty(\"exitEffectRotate3d\", result, node, value => {\n\t\tif (!isUndefined(value)) return value\n\t\tconst rotateX = node.exitEffectRotateX\n\t\tconst rotateY = node.exitEffectRotateY\n\n\t\tif (isNumber(rotateX) && rotateX > 0) return true\n\t\tif (isNumber(rotateY) && rotateY > 0) return true\n\n\t\treturn false\n\t})\n\treduceProperty(\"exitEffectRotate\", result, node, v => {\n\t\tif (withRotation(node) && isDynamicValue(node.rotation) && node.exitEffectRotateAdditiveDynamicValue) {\n\t\t\treturn node.resolveValue(\"rotation\") + (v ?? 0)\n\t\t}\n\t\treturn v\n\t})\n\treduceProperty(\"exitEffectRotateX\", result, node)\n\treduceProperty(\"exitEffectRotateY\", result, node)\n\treduceProperty(\"exitEffectSkewX\", result, node)\n\treduceProperty(\"exitEffectSkewY\", result, node)\n\n\tresult.exitEffectTransition = getReducedEffectTransition(node.exitEffectTransition, result.exitEffectTransition)\n\tresult.enterEffectTransition = getReducedEffectTransition(node.enterEffectTransition, result.enterEffectTransition)\n\tresult.styleAppearEffectTransition = getReducedEffectTransition(\n\t\tnode.styleAppearEffectTransition,\n\t\tresult.styleAppearEffectTransition,\n\t)\n\n\tif (isNotFound(result.styleAppearEffectScrollTargetCollectionItem)) {\n\t\tresult.styleAppearEffectScrollTargetCollectionItem = node.styleAppearEffectScrollTargetCollectionItem\n\t} else if (\n\t\tresult.styleAppearEffectScrollTargetCollectionItem !== Mixed &&\n\t\t!isEqual(result.styleAppearEffectScrollTargetCollectionItem, node.styleAppearEffectScrollTargetCollectionItem)\n\t) {\n\t\tresult.styleAppearEffectScrollTargetCollectionItem = Mixed\n\t}\n}\n", "import { Mixed, isMixed } from \"@framerjs/shared\"\nimport type { CanvasNode, NodeID } from \"document/models/CanvasTree/index.ts\"\nimport { isNumber, isUndefined } from \"utils/typeChecks.ts\"\nimport { isFixedOrRelativeOverlay } from \"../../nodes/utils/overlayHelpers.ts\"\nimport type { EffectStyleScrollTarget, ScrollStyle, WithStyleTransformEffect } from \"../WithStyleTransformEffect.ts\"\nimport { withStyleTransformEffect } from \"../WithStyleTransformEffect.ts\"\nimport type { ReducedEffectScrollTarget } from \"./EffectScrollTarget.ts\"\nimport type { Reduced, ReducedRecord, ReducedSubPropertyRecord } from \"./Reduced.ts\"\nimport { NotFound, isNotFound } from \"./Reduced.ts\"\nimport { type ReducedEffectTransition, getReducedEffectTransition } from \"./reduceEffectTransition.ts\"\nimport { reduceProperty, valuesAreDifferent } from \"./reduceProperty.ts\"\n\nexport interface ReducedStyleTransformEffect extends ReducedRecord<\n\tOmit<\n\t\tWithStyleTransformEffect,\n\t\t\"styleTransformEffectTrigger\" | \"styleTransformEffectScrollTargets\" | \"styleTransformEffectTransition\"\n\t>\n> {\n\tonlyNodesWithStyleTransformEffect: boolean\n\tstyleTransformEffectTrigger: Set<WithStyleTransformEffect[\"styleTransformEffectTrigger\"]>\n\tstyleTransformEffectScrollTargets: ReducedEffectStyleScrollTarget[]\n\tstyleTransformEffectScrollTargetCount: Reduced<number>\n\tstyleTransformEffectTransition: Reduced<ReducedEffectTransition | undefined>\n}\nexport interface ReducedEffectStyleScrollTarget extends ReducedEffectScrollTarget {\n\tstyle: ReducedSubPropertyRecord<ScrollStyle>\n}\n\nexport function reduceStyleTransformEffect(node: CanvasNode, result: ReducedStyleTransformEffect) {\n\tif (!withStyleTransformEffect(node) || isFixedOrRelativeOverlay(node)) {\n\t\tresult.onlyNodesWithStyleTransformEffect = false\n\t\treturn\n\t}\n\n\treduceProperty(\"styleTransformEffectEnabled\", result, node)\n\n\tif (!node.styleTransformEffectEnabled) return\n\n\treduceProperty(\"styleTransformEffectViewportThreshold\", result, node)\n\treduceProperty(\"styleTransformEffectTransitionEnabled\", result, node)\n\n\tresult.styleTransformEffectTrigger.add(node.styleTransformEffectTrigger)\n\n\tresult.styleTransformEffectTransition = getReducedEffectTransition(\n\t\tnode.styleTransformEffectTransition,\n\t\tresult.styleTransformEffectTransition,\n\t)\n\n\tconst scrollTargetCount = node.styleTransformEffectScrollTargets?.length ?? 0\n\tif (isNotFound(result.styleTransformEffectScrollTargetCount)) {\n\t\tresult.styleTransformEffectScrollTargetCount = scrollTargetCount\n\t} else if (result.styleTransformEffectScrollTargetCount !== scrollTargetCount) {\n\t\tresult.styleTransformEffectScrollTargetCount = Mixed\n\t}\n\n\tnode.styleTransformEffectScrollTargets?.forEach((scrollTarget, idx) => {\n\t\tconst reducedTarget = result.styleTransformEffectScrollTargets?.[idx]\n\t\tif (reducedTarget) {\n\t\t\tcombine(reducedTarget, scrollTarget, node.id)\n\t\t} else {\n\t\t\tresult.styleTransformEffectScrollTargets.push({\n\t\t\t\ttargets: new Set([scrollTarget.target]),\n\t\t\t\tstyle: {\n\t\t\t\t\t// Making sure optional properties are always included in the reduced value.\n\t\t\t\t\tbackgroundColor: undefined,\n\t\t\t\t\tblur: undefined,\n\t\t\t\t\ttransformPerspective: undefined,\n\t\t\t\t\t...scrollTarget.style,\n\t\t\t\t},\n\t\t\t\tids: { [node.id]: scrollTarget.id },\n\t\t\t\tcollectionItem: scrollTarget.collectionItem ?? NotFound,\n\t\t\t})\n\t\t}\n\t})\n}\n\nfunction combine(reduced: ReducedEffectStyleScrollTarget, scrollTarget: EffectStyleScrollTarget, id: NodeID) {\n\treduced.targets.add(scrollTarget.target)\n\n\treduceStyle(\"x\", reduced.style, scrollTarget.style)\n\treduceStyle(\"y\", reduced.style, scrollTarget.style)\n\treduceStyle(\"opacity\", reduced.style, scrollTarget.style)\n\treduceStyle(\"scale\", reduced.style, scrollTarget.style)\n\treduceStyle(\"rotate3d\", reduced.style, scrollTarget.style, value => {\n\t\tif (!isUndefined(value)) return value\n\t\tconst rotateX = scrollTarget.style.rotateX\n\t\tconst rotateY = scrollTarget.style.rotateY\n\n\t\tif (isNumber(rotateX) && rotateX > 0) return true\n\t\tif (isNumber(rotateY) && rotateY > 0) return true\n\n\t\treturn false\n\t})\n\treduceStyle(\"rotate\", reduced.style, scrollTarget.style)\n\treduceStyle(\"rotateX\", reduced.style, scrollTarget.style)\n\treduceStyle(\"rotateY\", reduced.style, scrollTarget.style)\n\treduceStyle(\"skewX\", reduced.style, scrollTarget.style)\n\treduceStyle(\"skewY\", reduced.style, scrollTarget.style)\n\n\treduced.ids[id] = scrollTarget.id\n\n\tif (isMixed(reduced.collectionItem)) return\n\n\tif (isNotFound(reduced.collectionItem)) {\n\t\treduced.collectionItem = scrollTarget.collectionItem\n\t} else if (valuesAreDifferent(reduced.collectionItem, scrollTarget.collectionItem)) {\n\t\treduced.collectionItem = Mixed\n\t}\n}\n\nfunction reduceStyle<N extends EffectStyleScrollTarget[\"style\"], K extends keyof N, T extends N[K]>(\n\tkey: K,\n\tresult: Pick<ReducedRecord<N>, K>,\n\tnode: N,\n\ttransform?: (currentValue: N[K]) => T | Mixed,\n) {\n\tconst reducedValue = result[key]\n\tif (isMixed(reducedValue)) return\n\n\tconst value = transform ? transform(node[key]) : node[key]\n\tif (isNotFound(reducedValue)) {\n\t\tresult[key] = value\n\t} else if (valuesAreDifferent(value, reducedValue)) {\n\t\tresult[key] = Mixed\n\t}\n}\n", "import type { CanvasNode } from \"../../index.ts\"\nimport type { WithTabIndex } from \"../WithTabIndex.ts\"\nimport { withTabIndex } from \"../WithTabIndex.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedTabIndex extends ReducedRecord<WithTabIndex> {\n\tonlyNodesWithTabIndex: boolean\n}\n\nexport function reduceTabIndex(node: CanvasNode, result: ReducedTabIndex): void {\n\tif (!withTabIndex(node)) {\n\t\tresult.onlyNodesWithTabIndex = false\n\t\treturn\n\t}\n\n\treduceProperty(\"tabIndex\", result, node)\n}\n", "import type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport { type WithTapHighlight, withTapHighlight } from \"../WithTapHighlight.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedTapHighlight extends ReducedRecord<WithTapHighlight> {\n\tonlyNodesWithTapHighlight: boolean\n}\n\nexport function reduceTapHighlight(node: CanvasNode, result: ReducedTapHighlight) {\n\tif (!withTapHighlight(node)) {\n\t\tresult.onlyNodesWithTapHighlight = false\n\t\treturn\n\t}\n\n\treduceProperty(\"tapHighlightColor\", result, node)\n}\n", "import { Mixed, isMixed } from \"@framerjs/shared\"\nimport { isAutoSizedOnBothDimensions } from \"document/models/CanvasTree/traits/utils/autoSizeHelpers.ts\"\nimport type { Gradient } from \"document/models/Gradient.ts\"\nimport { isGradient } from \"document/models/Gradient.ts\"\nimport type { FontSelector } from \"library/index.ts\"\nimport type { TextVerticalAlignment } from \"library/render/presentation/Text.tsx\"\nimport { commonValue } from \"utils/commonValue.ts\"\nimport { getTagForStylePresetKey } from \"utils/stylePresetUtils.ts\"\nimport { isNumber, isObject, isUndefined } from \"utils/typeChecks.ts\"\nimport type { CanvasTree } from \"../../CanvasTree.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { isAnyTextNode } from \"../../nodes/utils/isAnyTextNode.ts\"\nimport { isRichTextNode } from \"../../nodes/utils/nodeCheck.ts\"\nimport type { OpenTypeFeatureTag } from \"../../utils/openType.ts\"\nimport { isOpenTypeFeatureTag } from \"../../utils/openType.ts\"\nimport type { VariationAxisTag } from \"../../utils/variableFont.ts\"\nimport { isRelativeDateComputedValue } from \"../ComputedValue.ts\"\nimport type { DynamicValue } from \"../DynamicValue.ts\"\nimport { isDynamicValue } from \"../DynamicValue.ts\"\nimport type { VariableReference } from \"../VariableReference.ts\"\nimport { isVariableReference } from \"../VariableReference.ts\"\nimport { type WithLinkStyle, withLinkStyle } from \"../WithLinkStyle.ts\"\nimport { textStylePresetKeys } from \"../WithStylePresets.ts\"\nimport type {\n\tLetterSpacingUnit,\n\tLineHeightUnit,\n\tRichTextFontSizeUnit,\n\tTextAlignment,\n\tTextStrokeColor,\n\tTextStrokeWidth,\n\tTextTransform,\n\tWithTextStyle,\n} from \"../WithTextStyle.ts\"\nimport { isFontSize, migrateLetterSpacing } from \"../WithTextStyle.ts\"\nimport { supportsVerticalAlignment } from \"../WithTextVerticalAlignment.ts\"\nimport { withTextWrapBalance } from \"../WithTextWrapBalance.ts\"\nimport type { Reduced } from \"./Reduced.ts\"\nimport { NotFound, isFoundAndNotMixed, isNotFound } from \"./Reduced.ts\"\nimport type { Properties } from \"./reduceProperties.ts\"\nimport { valuesAreDifferent } from \"./reduceProperty.ts\"\n\ntype ExtractValueFromSet<InputSet> = InputSet extends Set<infer Value> ? Value : never\n\nfunction mergeValuesIntoSet<InputSet extends Set<unknown>>(\n\tset: InputSet,\n\tvalues: Iterable<ExtractValueFromSet<InputSet>>,\n) {\n\tfor (const value of values) {\n\t\tset.add(value)\n\t}\n}\n\nexport interface TextPropertiesBase {\n\tonlyNodesWithHTMLContent: boolean\n\tonlyNodesWithTextFit: boolean\n\tonlyInEditor: boolean\n\tanyNodeWithParagraphSpacing: boolean\n\tanyNodesWithGradientFill: boolean\n\tanyNodesWithTextFit: boolean\n\tanyNodesWithRelativeDates: boolean\n\n\tautoSize: Reduced<boolean>\n\ttextContent: Reduced<string | DynamicValue>\n\tverticalAlignment: Reduced<TextVerticalAlignment>\n\tparagraphSpacing: Reduced<number | undefined>\n\tfills: Set<string | Gradient | undefined>\n\n\ttextStylePresets: Set<string | undefined>\n\tassignedTextStylePresets: Set<string>\n\tblockquoteStylePresets: Set<string | undefined>\n\thasAssignedBlockquoteStylePreset: boolean\n\ttableStylePresets: Set<string | undefined>\n\thasAssignedTableStylePreset: boolean\n\tlinkStylePresets: Set<string | undefined>\n\thasAssignedLinkStylePreset: boolean\n\tinlineCodeStylePresets: Set<string | undefined>\n\thasAssignedInlineCodeStylePreset: boolean\n\tanchorLinkStylePresets: Set<string | undefined>\n\thasAssignedAnchorLinkStylePreset: boolean\n\tanchorLinkOffsetY: Reduced<number | undefined>\n\n\tfonts: Set<string>\n\ttextColor: Reduced<string | VariableReference | undefined>\n\ttextBackgroundColor: Reduced<WithTextStyle[\"textBackgroundColor\"]>\n\ttextBackgroundRadius: Reduced<WithTextStyle[\"textBackgroundRadius\"]>\n\ttextBackgroundCornerShape: Reduced<WithTextStyle[\"textBackgroundCornerShape\"]>\n\ttextBackgroundPadding: Reduced<WithTextStyle[\"textBackgroundPadding\"]>\n\tfontSize: Reduced<number | VariableReference | undefined>\n\tfontSizeUnits: Set<RichTextFontSizeUnit>\n\tletterSpacingValue: Reduced<number | undefined>\n\tletterSpacingUnits: Set<LetterSpacingUnit | undefined>\n\ttextTransforms: Set<TextTransform | undefined>\n\ttextDecoration: Reduced<WithTextStyle[\"textDecoration\"]>\n\ttextDecorationStyle: Reduced<WithTextStyle[\"textDecorationStyle\"]>\n\ttextDecorationColor: Reduced<WithTextStyle[\"textDecorationColor\"]>\n\ttextDecorationThickness: Reduced<WithTextStyle[\"textDecorationThickness\"]>\n\ttextDecorationOffset: Reduced<WithTextStyle[\"textDecorationOffset\"]>\n\ttextDecorationSkipInk: Reduced<WithTextStyle[\"textDecorationSkipInk\"]>\n\ttextStrokeWidth: Reduced<TextStrokeWidth | undefined>\n\ttextStrokeColor: Reduced<TextStrokeColor | undefined>\n\tlineHeightValue: Reduced<number | undefined>\n\tlineHeightUnits: Set<LineHeightUnit | undefined>\n\ttextAlignment: Reduced<TextAlignment | undefined>\n\ttextFitScale: Reduced<number>\n\ttextWrapBalance: Reduced<boolean | undefined>\n\topenTypeFontFeatures: ReducedOpenTypeFontFeatures\n\tvariationAxes: ReducedFontVariationAxes\n}\n\nexport interface TextProperties extends TextPropertiesBase {\n\tlinkFont: Reduced<string | undefined>\n\tlinkTextColor: Reduced<string | undefined>\n\tlinkFontSize: Reduced<number | undefined>\n\tlinkTextTransform: Reduced<TextTransform | undefined>\n\tlinkTextDecoration: Reduced<WithLinkStyle[\"linkTextDecoration\"]>\n\tlinkTextDecorationStyle: Reduced<WithLinkStyle[\"linkTextDecorationStyle\"]>\n\tlinkTextDecorationColor: Reduced<WithLinkStyle[\"linkTextDecorationColor\"]>\n\tlinkTextDecorationThickness: Reduced<WithLinkStyle[\"linkTextDecorationThickness\"]>\n\tlinkTextDecorationOffset: Reduced<WithLinkStyle[\"linkTextDecorationOffset\"]>\n\tlinkTextDecorationSkipInk: Reduced<WithLinkStyle[\"linkTextDecorationSkipInk\"]>\n\n\tlinkHoverFont: Reduced<string | undefined>\n\tlinkHoverTextColor: Reduced<string | undefined>\n\tlinkHoverFontSize: Reduced<number | undefined>\n\tlinkHoverTextTransform: Reduced<TextTransform | undefined>\n\tlinkHoverTextDecoration: Reduced<WithLinkStyle[\"linkHoverTextDecoration\"]>\n\tlinkHoverTextDecorationStyle: Reduced<WithLinkStyle[\"linkHoverTextDecorationStyle\"]>\n\tlinkHoverTextDecorationColor: Reduced<WithLinkStyle[\"linkHoverTextDecorationColor\"]>\n\tlinkHoverTextDecorationThickness: Reduced<WithLinkStyle[\"linkHoverTextDecorationThickness\"]>\n\tlinkHoverTextDecorationOffset: Reduced<WithLinkStyle[\"linkHoverTextDecorationOffset\"]>\n\tlinkHoverTextDecorationSkipInk: Reduced<WithLinkStyle[\"linkHoverTextDecorationSkipInk\"]>\n\n\tlinkCurrentFont: Reduced<string | undefined>\n\tlinkCurrentTextColor: Reduced<string | undefined>\n\tlinkCurrentFontSize: Reduced<number | undefined>\n\tlinkCurrentTextTransform: Reduced<TextTransform | undefined>\n\tlinkCurrentTextDecoration: Reduced<WithLinkStyle[\"linkCurrentTextDecoration\"]>\n\tlinkCurrentTextDecorationStyle: Reduced<WithLinkStyle[\"linkCurrentTextDecorationStyle\"]>\n\tlinkCurrentTextDecorationColor: Reduced<WithLinkStyle[\"linkCurrentTextDecorationColor\"]>\n\tlinkCurrentTextDecorationThickness: Reduced<WithLinkStyle[\"linkCurrentTextDecorationThickness\"]>\n\tlinkCurrentTextDecorationOffset: Reduced<WithLinkStyle[\"linkCurrentTextDecorationOffset\"]>\n\tlinkCurrentTextDecorationSkipInk: Reduced<WithLinkStyle[\"linkCurrentTextDecorationSkipInk\"]>\n}\n\nexport type FontSelectors = Set<FontSelector>\n\nexport type ReducedOpenTypeFontFeatures = Partial<Record<OpenTypeFeatureTag, true | Mixed>>\nexport type ReducedFontVariationAxes = Partial<Record<VariationAxisTag, number | Mixed>>\n\nexport function reduceText(tree: CanvasTree, nodes: CanvasNode[], result: Properties) {\n\tif (!result.onlyAnyTextNodes) return null\n\n\tlet onlyNodesWithHTMLContent: boolean = true\n\tlet onlyNodesWithTextFit: boolean = true\n\tlet onlyInEditor = false\n\tlet anyNodeWithParagraphSpacing = false\n\tlet anyNodesWithGradientFill = false\n\tlet anyNodesWithTextFit = false\n\tlet anyNodesWithRelativeDates = false\n\n\tlet autoSize: Reduced<boolean> = NotFound\n\tlet textContent: Reduced<string | DynamicValue> = NotFound\n\tconst verticalAlignments: Set<TextVerticalAlignment> = new Set()\n\tlet paragraphSpacing: Reduced<number | undefined> = NotFound\n\tconst fills = new Set<string | Gradient | undefined>()\n\t// Track the raw css fills to avoid showing Mixed, when multi-selecting text\n\t// with identical Gradient class instances.\n\tconst cssFills = new Set<string | undefined>()\n\n\tconst textStylePresets = new Set<string | undefined>()\n\tconst assignedTextStylePresets = new Set<string>()\n\tconst linkStylePresets = new Set<string | undefined>()\n\tlet hasAssignedLinkStylePreset = false\n\tconst blockquoteStylePresets = new Set<string | undefined>()\n\tlet hasAssignedBlockquoteStylePreset = false\n\tconst tableStylePresets = new Set<string | undefined>()\n\tlet hasAssignedTableStylePreset = false\n\tconst inlineCodeStylePresets = new Set<string | undefined>()\n\tlet hasAssignedInlineCodeStylePreset = false\n\tconst imageStylePresets = new Set<string | undefined>()\n\tconst anchorLinkStylePresets = new Set<string | undefined>()\n\tlet hasAssignedAnchorLinkStylePreset = false\n\tconst anchorLinkOffsetYs: Set<number | undefined> = new Set()\n\n\tconst fonts = new Set<string>()\n\tlet textColor: Reduced<string | VariableReference | undefined> = NotFound\n\tlet fontSize: Reduced<number | VariableReference | undefined> = NotFound\n\tconst fontSizeUnits = new Set<RichTextFontSizeUnit>()\n\tconst textFitScale = new Set<number>()\n\tconst letterSpacingValues = new Set<number | undefined>()\n\tconst letterSpacingUnits = new Set<LetterSpacingUnit | undefined>()\n\tconst textTransforms = new Set<TextTransform | undefined>()\n\tconst textBackgroundColors = new Set<WithTextStyle[\"textBackgroundColor\"] | undefined>()\n\tconst textBackgroundRadius = new Set<WithTextStyle[\"textBackgroundRadius\"]>()\n\tconst textBackgroundCornerShape = new Set<WithTextStyle[\"textBackgroundCornerShape\"]>()\n\tconst textBackgroundPadding = new Set<WithTextStyle[\"textBackgroundPadding\"]>()\n\tconst textDecorations = new Set<WithTextStyle[\"textDecoration\"]>()\n\tconst textDecorationStyles = new Set<WithTextStyle[\"textDecorationStyle\"]>()\n\tconst textDecorationColors = new Set<WithTextStyle[\"textDecorationColor\"]>()\n\tconst textDecorationThicknesses = new Set<WithTextStyle[\"textDecorationThickness\"]>()\n\tconst textDecorationOffsets = new Set<WithTextStyle[\"textDecorationOffset\"]>()\n\tconst textDecorationSkipInks = new Set<WithTextStyle[\"textDecorationSkipInk\"]>()\n\tconst lineHeightValues = new Set<number | undefined>()\n\tconst lineHeightUnits = new Set<LineHeightUnit | undefined>()\n\tconst textAlignments = new Set<TextAlignment | undefined>()\n\tlet textStrokeWidth: Reduced<TextStrokeWidth | undefined> = NotFound\n\tlet textStrokeColor: Reduced<TextStrokeColor | undefined> = NotFound\n\tlet textWrapBalance: Reduced<boolean | undefined> = NotFound\n\tlet openTypeFontFeatures: ReducedOpenTypeFontFeatures | undefined = undefined\n\tconst variationAxes: ReducedFontVariationAxes = {}\n\n\tconst linkFonts = new Set<string | undefined>()\n\tconst linkTextColors = new Set<string | undefined>()\n\tconst linkFontSizes = new Set<number | undefined>()\n\tconst linkTextTransforms = new Set<TextTransform | undefined>()\n\tconst linkTextDecorations = new Set<WithLinkStyle[\"linkTextDecoration\"]>()\n\tconst linkTextDecorationStyles = new Set<WithLinkStyle[\"linkTextDecorationStyle\"]>()\n\tconst linkTextDecorationColors = new Set<WithLinkStyle[\"linkTextDecorationColor\"]>()\n\tconst linkTextDecorationThicknesses = new Set<WithLinkStyle[\"linkTextDecorationThickness\"]>()\n\tconst linkTextDecorationOffsets = new Set<WithLinkStyle[\"linkTextDecorationOffset\"]>()\n\tconst linkTextDecorationSkipInks = new Set<WithLinkStyle[\"linkTextDecorationSkipInk\"]>()\n\n\tconst linkHoverFonts = new Set<string | undefined>()\n\tconst linkHoverTextColors = new Set<string | undefined>()\n\tconst linkHoverFontSizes = new Set<number | undefined>()\n\tconst linkHoverTextTransforms = new Set<TextTransform | undefined>()\n\tconst linkHoverTextDecorations = new Set<WithLinkStyle[\"linkHoverTextDecoration\"]>()\n\tconst linkHoverTextDecorationStyles = new Set<WithLinkStyle[\"linkHoverTextDecorationStyle\"]>()\n\tconst linkHoverTextDecorationColors = new Set<WithLinkStyle[\"linkHoverTextDecorationColor\"]>()\n\tconst linkHoverTextDecorationThicknesses = new Set<WithLinkStyle[\"linkHoverTextDecorationThickness\"]>()\n\tconst linkHoverTextDecorationOffsets = new Set<WithLinkStyle[\"linkHoverTextDecorationOffset\"]>()\n\tconst linkHoverTextDecorationSkipInks = new Set<WithLinkStyle[\"linkHoverTextDecorationSkipInk\"]>()\n\n\tconst linkCurrentFonts = new Set<string | undefined>()\n\tconst linkCurrentTextColors = new Set<string | undefined>()\n\tconst linkCurrentFontSizes = new Set<number | undefined>()\n\tconst linkCurrentTextTransforms = new Set<TextTransform | undefined>()\n\tconst linkCurrentTextDecorations = new Set<WithLinkStyle[\"linkCurrentTextDecoration\"]>()\n\tconst linkCurrentTextDecorationStyles = new Set<WithLinkStyle[\"linkCurrentTextDecorationStyle\"]>()\n\tconst linkCurrentTextDecorationColors = new Set<WithLinkStyle[\"linkCurrentTextDecorationColor\"]>()\n\tconst linkCurrentTextDecorationThicknesses = new Set<WithLinkStyle[\"linkCurrentTextDecorationThickness\"]>()\n\tconst linkCurrentTextDecorationOffsets = new Set<WithLinkStyle[\"linkCurrentTextDecorationOffset\"]>()\n\tconst linkCurrentTextDecorationSkipInks = new Set<WithLinkStyle[\"linkCurrentTextDecorationSkipInk\"]>()\n\n\tfor (const node of nodes) {\n\t\tconst isAutoSized = isAutoSizedOnBothDimensions(node)\n\t\tif (isNotFound(autoSize)) {\n\t\t\tautoSize = isAutoSized\n\t\t} else if (!isMixed(autoSize) && isAutoSized !== autoSize) {\n\t\t\tautoSize = Mixed\n\t\t}\n\n\t\tif (supportsVerticalAlignment(node)) verticalAlignments.add(node.textVerticalAlignment)\n\n\t\t// This value is intentionally overwritten on each selection. You can\n\t\t// only select one RichTextNode at a time to enter editing mode. Let me\n\t\t// add a little comment for future developers.\n\t\tonlyInEditor = node.cache.isEditable\n\t\tif (isRichTextNode(node)) {\n\t\t\tfor (const fill of node.getFills()) {\n\t\t\t\tif (!isGradient(fill)) {\n\t\t\t\t\tfills.add(fill)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tanyNodesWithGradientFill = true\n\n\t\t\t\tconst css = fill.toCSS()\n\t\t\t\tif (cssFills.has(css)) continue\n\n\t\t\t\tcssFills.add(css)\n\t\t\t\tfills.add(fill)\n\t\t\t}\n\n\t\t\tanchorLinkOffsetYs.add(node.anchorLinkOffsetY)\n\n\t\t\tif (node.htmlContent) {\n\t\t\t\t// We add element presets only for nodes with\n\t\t\t\t// ControlType.RichText\n\t\t\t\tfor (const key of textStylePresetKeys) {\n\t\t\t\t\tconst presetId = node[key]\n\t\t\t\t\ttextStylePresets.add(tree.has(presetId) ? presetId : undefined)\n\t\t\t\t\tif (tree.has(presetId)) assignedTextStylePresets.add(getTagForStylePresetKey(key))\n\t\t\t\t}\n\n\t\t\t\tblockquoteStylePresets.add(tree.has(node.stylePresetBlockquote) ? node.stylePresetBlockquote : undefined)\n\t\t\t\tif (tree.has(node.stylePresetBlockquote)) hasAssignedBlockquoteStylePreset = true\n\n\t\t\t\ttableStylePresets.add(tree.has(node.stylePresetTable) ? node.stylePresetTable : undefined)\n\t\t\t\tif (tree.has(node.stylePresetTable)) hasAssignedTableStylePreset = true\n\n\t\t\t\tlinkStylePresets.add(tree.has(node.stylePresetLink) ? node.stylePresetLink : undefined)\n\t\t\t\tif (tree.has(node.stylePresetLink)) hasAssignedLinkStylePreset = true\n\n\t\t\t\tanchorLinkStylePresets.add(tree.has(node.stylePresetAnchorLink) ? node.stylePresetAnchorLink : undefined)\n\t\t\t\tif (tree.has(node.stylePresetAnchorLink)) hasAssignedAnchorLinkStylePreset = true\n\n\t\t\t\tinlineCodeStylePresets.add(tree.has(node.stylePresetInlineCode) ? node.stylePresetInlineCode : undefined)\n\t\t\t\tif (tree.has(node.stylePresetInlineCode)) hasAssignedInlineCodeStylePreset = true\n\n\t\t\t\timageStylePresets.add(node.stylePresetImage)\n\t\t\t} else {\n\t\t\t\tconst nodeTextStylePresets = node.getTextStylePresets(true)\n\t\t\t\tmergeValuesIntoSet(textStylePresets, nodeTextStylePresets)\n\n\t\t\t\tconst nodeLinkStylePresets = node.getLinkStylePresets(true)\n\t\t\t\tmergeValuesIntoSet(linkStylePresets, nodeLinkStylePresets)\n\n\t\t\t\tconst nodeInlineCodeStylePresets = node.getInlineCodeStylePresets(true)\n\t\t\t\tmergeValuesIntoSet(inlineCodeStylePresets, nodeInlineCodeStylePresets)\n\n\t\t\t\tif (isRelativeDateComputedValue(node.textContent)) {\n\t\t\t\t\tanyNodesWithRelativeDates = true\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// TextNodes don't support some properties\n\t\t\tfills.add(undefined)\n\t\t\ttextStylePresets.add(undefined)\n\t\t\tlinkStylePresets.add(undefined)\n\t\t\tanchorLinkStylePresets.add(undefined)\n\t\t}\n\n\t\tlet isNodeWithTextFit = false\n\t\tif (\n\t\t\tisRichTextNode(node) &&\n\t\t\tisUndefined(node.htmlContent) &&\n\t\t\tisUndefined(node.textContent) &&\n\t\t\t!node.getFontSizes(false).some(isVariableReference)\n\t\t) {\n\t\t\tif (isObject(node.textFitViewBoxSize)) {\n\t\t\t\ttextFitScale.add(isNumber(node.textFitScale) ? Math.round(node.textFitScale * 100) : 100)\n\t\t\t\tfontSizeUnits.add(\"auto\")\n\t\t\t\tanyNodesWithTextFit = true\n\t\t\t\tisNodeWithTextFit = true\n\t\t\t}\n\t\t} else {\n\t\t\tonlyNodesWithTextFit = false\n\t\t}\n\n\t\tif (isAnyTextNode(node)) {\n\t\t\t// Text content\n\t\t\tif (!isMixed(textContent)) {\n\t\t\t\tlet nodeTextString: string\n\t\t\t\tlet nodeTextContent: DynamicValue | string\n\t\t\t\tif (isRichTextNode(node)) {\n\t\t\t\t\tnodeTextString = node.getTextContent()\n\t\t\t\t\tnodeTextContent = isVariableReference(node.htmlContent)\n\t\t\t\t\t\t? node.htmlContent\n\t\t\t\t\t\t: (node.textContent ?? nodeTextString)\n\t\t\t\t} else {\n\t\t\t\t\tnodeTextString = node.text\n\t\t\t\t\tnodeTextContent = node.textContent ?? nodeTextString\n\t\t\t\t}\n\n\t\t\t\tif (isNotFound(textContent)) {\n\t\t\t\t\ttextContent = nodeTextContent\n\t\t\t\t} else if (valuesAreDifferent(textContent, nodeTextContent)) {\n\t\t\t\t\ttextContent = Mixed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Paragraph spacing\n\t\t\tif (isRichTextNode(node)) {\n\t\t\t\tanyNodeWithParagraphSpacing ||= isDynamicValue(node.htmlContent) || node.hasTextStylePresets(false)\n\t\t\t\tif (isNotFound(paragraphSpacing)) {\n\t\t\t\t\tparagraphSpacing = node.paragraphSpacing\n\t\t\t\t} else if (!isMixed(paragraphSpacing) && node.paragraphSpacing !== paragraphSpacing) {\n\t\t\t\t\tparagraphSpacing = Mixed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Rich text with html content variable doesn't use inline styles\n\t\t\tif (isRichTextNode(node) && node.htmlContent) {\n\t\t\t\t// To comply with the previous behavior, \"px\" must always be present if there is no text fit, and it\n\t\t\t\t// cannot derive the units from the inline styles.\n\t\t\t\tif (!isNodeWithTextFit) {\n\t\t\t\t\tfontSizeUnits.add(\"px\")\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tonlyNodesWithHTMLContent = false\n\n\t\t\t// Fonts\n\t\t\tconst nodeFonts = node.getFonts(true)\n\t\t\tmergeValuesIntoSet(fonts, nodeFonts)\n\n\t\t\t// Text colors\n\t\t\tif (textColor !== Mixed) {\n\t\t\t\tconst nodeTextColors = node.getTextColors(true)\n\n\t\t\t\tif (nodeTextColors.length > 1) {\n\t\t\t\t\ttextColor = Mixed\n\t\t\t\t} else {\n\t\t\t\t\tconst nodeTextColor = nodeTextColors[0]\n\n\t\t\t\t\tif (isNotFound(textColor)) {\n\t\t\t\t\t\ttextColor = nodeTextColor\n\t\t\t\t\t} else if (valuesAreDifferent(textColor, nodeTextColor)) {\n\t\t\t\t\t\ttextColor = Mixed\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Font sizes\n\t\t\tif (!isMixed(fontSize)) {\n\t\t\t\tconst nodeFontSizes = node.getFontSizes(true)\n\n\t\t\t\t// We must ensure that measured font size units are only added if the current\n\t\t\t\t// node is not using text fit. We must also do it outside of the fontSize\n\t\t\t\t// reducer as it intentionally does not go over every font size.\n\t\t\t\tif (!isNodeWithTextFit) {\n\t\t\t\t\tnodeFontSizes.forEach(size => {\n\t\t\t\t\t\tif (isFontSize(size)) {\n\t\t\t\t\t\t\tconst [_, unit] = size\n\t\t\t\t\t\t\tfontSizeUnits.add(unit)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// We treat number values & variable references as pixels.\n\t\t\t\t\t\t\tfontSizeUnits.add(\"px\")\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\tif (isRichTextNode(node) && nodeFontSizes.length === 0) {\n\t\t\t\t\t\tfontSizeUnits.add(\"px\")\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If the units are Mixed or Not Found, then we want `fontSize` to be Mixed,\n\t\t\t\t// since `1rem` should not be treated as the same as `1px`.\n\t\t\t\tconst commonFontSizeUnit = commonValue(fontSizeUnits)\n\t\t\t\tif (nodeFontSizes.length > 1 || !isFoundAndNotMixed(commonFontSizeUnit)) {\n\t\t\t\t\tfontSize = Mixed\n\t\t\t\t} else {\n\t\t\t\t\tconst nodeFontSize = nodeFontSizes[0]\n\n\t\t\t\t\tif (isNotFound(fontSize)) {\n\t\t\t\t\t\tif (isFontSize(nodeFontSize)) {\n\t\t\t\t\t\t\tconst [size] = nodeFontSize\n\t\t\t\t\t\t\tfontSize = size\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfontSize = nodeFontSize\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (valuesAreDifferent(fontSize, isFontSize(nodeFontSize) ? nodeFontSize[0] : nodeFontSize)) {\n\t\t\t\t\t\tfontSize = Mixed\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Text transforms\n\t\t\tconst nodeTextTransforms = node.getTextTransforms(true)\n\t\t\tmergeValuesIntoSet(textTransforms, nodeTextTransforms)\n\n\t\t\t// Text decorations\n\t\t\tmergeValuesIntoSet(textDecorations, node.getTextDecorations(true))\n\t\t\tif (isRichTextNode(node)) {\n\t\t\t\tmergeValuesIntoSet(textDecorationStyles, node.getTextDecorationStyles(true))\n\t\t\t\tmergeValuesIntoSet(textDecorationColors, node.getTextDecorationColors(true))\n\t\t\t\tmergeValuesIntoSet(textDecorationThicknesses, node.getTextDecorationThicknesses(true))\n\t\t\t\tmergeValuesIntoSet(textDecorationOffsets, node.getTextDecorationOffsets(true))\n\t\t\t\tmergeValuesIntoSet(textDecorationSkipInks, node.getTextDecorationSkipInks(true))\n\n\t\t\t\t// Text background styles\n\t\t\t\tmergeValuesIntoSet(textBackgroundColors, node.getTextBackgroundColors(true))\n\t\t\t\tmergeValuesIntoSet(textBackgroundRadius, node.getTextBackgroundRadiuses(true))\n\t\t\t\tmergeValuesIntoSet(textBackgroundCornerShape, node.getTextBackgroundCornerShapes(true))\n\t\t\t\tmergeValuesIntoSet(textBackgroundPadding, node.getTextBackgroundPaddings(true))\n\t\t\t}\n\n\t\t\t// Letter spacings\n\t\t\tconst nodeLetterSpacings = node.getLetterSpacings(true)\n\t\t\tfor (const letterSpacing of nodeLetterSpacings) {\n\t\t\t\tconst [value, unit] = isUndefined(letterSpacing) ? [] : migrateLetterSpacing(letterSpacing)\n\t\t\t\tletterSpacingValues.add(value)\n\t\t\t\tletterSpacingUnits.add(unit)\n\t\t\t}\n\n\t\t\t// Line height\n\t\t\tconst nodeLineHeights = node.getLineHeights(true)\n\t\t\tfor (const lineHeight of nodeLineHeights) {\n\t\t\t\tconst [value, unit] = lineHeight ?? []\n\t\t\t\tlineHeightValues.add(value)\n\t\t\t\tlineHeightUnits.add(unit)\n\t\t\t}\n\n\t\t\t// Text alignment\n\t\t\tconst nodeTextAlignments = node.getTextAlignments(true)\n\t\t\tmergeValuesIntoSet(textAlignments, nodeTextAlignments)\n\n\t\t\t// Text stroke\n\t\t\tif (isRichTextNode(node)) {\n\t\t\t\tconst nodeTextStrokeWidths = node.getTextStrokeWidths(true)\n\t\t\t\tfor (const strokeWidth of nodeTextStrokeWidths) {\n\t\t\t\t\tif (isNotFound(textStrokeWidth)) {\n\t\t\t\t\t\ttextStrokeWidth = strokeWidth\n\t\t\t\t\t} else if (!isMixed(textStrokeWidth) && valuesAreDifferent(strokeWidth, textStrokeWidth)) {\n\t\t\t\t\t\ttextStrokeWidth = Mixed\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst nodeTextStrokeColors = node.getTextStrokeColors(true)\n\t\t\t\tfor (const strokeColor of nodeTextStrokeColors) {\n\t\t\t\t\tif (isNotFound(textStrokeColor)) {\n\t\t\t\t\t\ttextStrokeColor = strokeColor\n\t\t\t\t\t} else if (!isMixed(textStrokeColor) && valuesAreDifferent(strokeColor, textStrokeColor)) {\n\t\t\t\t\t\ttextStrokeColor = Mixed\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst remainingVariationAxes = new Set(variationAxes ? Object.keys(variationAxes) : undefined)\n\t\t\t\tconst nodeVariationAxes = node.getVariationAxes(true)\n\t\t\t\tfor (const axes of nodeVariationAxes) {\n\t\t\t\t\tfor (const axisKey in axes) {\n\t\t\t\t\t\tconst currentValue = variationAxes[axisKey]\n\t\t\t\t\t\tremainingVariationAxes.delete(axisKey)\n\n\t\t\t\t\t\tif (isMixed(currentValue)) continue\n\t\t\t\t\t\tif (isUndefined(currentValue)) {\n\t\t\t\t\t\t\t// If this is the first node to record variation axes,\n\t\t\t\t\t\t\t// and the current value is undefined, we can enable the\n\t\t\t\t\t\t\t// feature.\n\t\t\t\t\t\t\tvariationAxes[axisKey] = axes[axisKey]\n\t\t\t\t\t\t} else if (currentValue !== axes[axisKey]) {\n\t\t\t\t\t\t\t// Otherwise we need to mark the feature as mixed.\n\t\t\t\t\t\t\tvariationAxes[axisKey] = Mixed\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If there are any features that were recorded by previous\n\t\t\t\t// nodes, but not this one, that means they are all Mixed.\n\t\t\t\tfor (const tag of remainingVariationAxes) {\n\t\t\t\t\tvariationAxes[tag] = Mixed\n\t\t\t\t}\n\n\t\t\t\tconst remainingOpenTypeFontFeatures = new Set(\n\t\t\t\t\topenTypeFontFeatures ? Object.keys(openTypeFontFeatures) : undefined,\n\t\t\t\t)\n\t\t\t\tconst nodeOpenTypeFontFeatures = node.getOpenTypeFontFeatures(true)\n\t\t\t\tfor (const openTypeFeatures of nodeOpenTypeFontFeatures) {\n\t\t\t\t\tconst features: ReducedOpenTypeFontFeatures = openTypeFontFeatures ?? {}\n\t\t\t\t\topenTypeFeatures?.forEach(feature => {\n\t\t\t\t\t\tconst currentValue = features[feature]\n\t\t\t\t\t\tremainingOpenTypeFontFeatures.delete(feature)\n\n\t\t\t\t\t\t// If the value is already mixed, we don't need to update the object.\n\t\t\t\t\t\tif (isMixed(currentValue)) return\n\n\t\t\t\t\t\tif (isUndefined(openTypeFontFeatures) && currentValue === undefined) {\n\t\t\t\t\t\t\tfeatures[feature] = true\n\t\t\t\t\t\t} else if (currentValue !== true) {\n\t\t\t\t\t\t\t// Otherwise we need to mark the feature as mixed.\n\t\t\t\t\t\t\tfeatures[feature] = Mixed\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\topenTypeFontFeatures = features\n\t\t\t\t}\n\n\t\t\t\t// If there are any features that were recorded by previous\n\t\t\t\t// nodes, but not this one, that means they are all Mixed.\n\t\t\t\tfor (const feature of remainingOpenTypeFontFeatures) {\n\t\t\t\t\tif (!isOpenTypeFeatureTag(feature)) continue\n\n\t\t\t\t\tif (isUndefined(openTypeFontFeatures)) openTypeFontFeatures = {}\n\t\t\t\t\topenTypeFontFeatures[feature] = Mixed\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Text wrap balance\n\t\t\tif (isRichTextNode(node) && withTextWrapBalance(node)) {\n\t\t\t\tif (isNotFound(textWrapBalance)) {\n\t\t\t\t\ttextWrapBalance = node.textWrapBalance\n\t\t\t\t} else if (!isMixed(textWrapBalance) && node.textWrapBalance !== textWrapBalance) {\n\t\t\t\t\ttextWrapBalance = Mixed\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (withLinkStyle(node)) {\n\t\t\t// Text links\n\t\t\tlinkFonts.add(node.linkFont)\n\t\t\tlinkTextColors.add(node.linkTextColor)\n\t\t\tlinkFontSizes.add(node.linkFontSize)\n\t\t\tlinkTextTransforms.add(node.linkTextTransform)\n\t\t\tlinkTextDecorations.add(node.linkTextDecoration)\n\t\t\tlinkTextDecorationStyles.add(node.linkTextDecorationStyle)\n\t\t\tlinkTextDecorationColors.add(node.linkTextDecorationColor)\n\t\t\tlinkTextDecorationThicknesses.add(node.linkTextDecorationThickness)\n\t\t\tlinkTextDecorationOffsets.add(node.linkTextDecorationOffset)\n\t\t\tlinkTextDecorationSkipInks.add(node.linkTextDecorationSkipInk)\n\n\t\t\tlinkHoverFonts.add(node.linkHoverFont)\n\t\t\tlinkHoverTextColors.add(node.linkHoverTextColor)\n\t\t\tlinkHoverFontSizes.add(node.linkHoverFontSize)\n\t\t\tlinkHoverTextTransforms.add(node.linkHoverTextTransform)\n\t\t\tlinkHoverTextDecorations.add(node.linkHoverTextDecoration)\n\t\t\tlinkHoverTextDecorationStyles.add(node.linkHoverTextDecorationStyle)\n\t\t\tlinkHoverTextDecorationColors.add(node.linkHoverTextDecorationColor)\n\t\t\tlinkHoverTextDecorationThicknesses.add(node.linkHoverTextDecorationThickness)\n\t\t\tlinkHoverTextDecorationOffsets.add(node.linkHoverTextDecorationOffset)\n\t\t\tlinkHoverTextDecorationSkipInks.add(node.linkHoverTextDecorationSkipInk)\n\n\t\t\tlinkCurrentFonts.add(node.linkCurrentFont)\n\t\t\tlinkCurrentTextColors.add(node.linkCurrentTextColor)\n\t\t\tlinkCurrentFontSizes.add(node.linkCurrentFontSize)\n\t\t\tlinkCurrentTextTransforms.add(node.linkCurrentTextTransform)\n\t\t\tlinkCurrentTextDecorations.add(node.linkCurrentTextDecoration)\n\t\t\tlinkCurrentTextDecorationStyles.add(node.linkCurrentTextDecorationStyle)\n\t\t\tlinkCurrentTextDecorationColors.add(node.linkCurrentTextDecorationColor)\n\t\t\tlinkCurrentTextDecorationThicknesses.add(node.linkCurrentTextDecorationThickness)\n\t\t\tlinkCurrentTextDecorationOffsets.add(node.linkCurrentTextDecorationOffset)\n\t\t\tlinkCurrentTextDecorationSkipInks.add(node.linkCurrentTextDecorationSkipInk)\n\t\t}\n\t}\n\n\tconst letterSpacingValue = commonValue(letterSpacingValues)\n\tconst lineHeightValue = commonValue(lineHeightValues)\n\tconst textAlignment = commonValue(textAlignments)\n\tconst verticalAlignment = commonValue(verticalAlignments)\n\tconst anchorLinkOffsetY = commonValue(anchorLinkOffsetYs)\n\n\tresult.textProperties = {\n\t\tonlyNodesWithHTMLContent,\n\t\tonlyNodesWithTextFit,\n\t\tonlyInEditor,\n\t\tanyNodeWithParagraphSpacing,\n\t\tanyNodesWithGradientFill,\n\t\tanyNodesWithTextFit,\n\t\tanyNodesWithRelativeDates,\n\n\t\tautoSize,\n\t\ttextContent,\n\t\tverticalAlignment,\n\t\tparagraphSpacing,\n\t\tfills,\n\n\t\ttextStylePresets,\n\t\tassignedTextStylePresets,\n\t\tlinkStylePresets,\n\t\thasAssignedLinkStylePreset,\n\t\tanchorLinkStylePresets,\n\t\thasAssignedAnchorLinkStylePreset,\n\t\tblockquoteStylePresets,\n\t\thasAssignedBlockquoteStylePreset,\n\t\ttableStylePresets,\n\t\thasAssignedTableStylePreset,\n\t\tinlineCodeStylePresets,\n\t\thasAssignedInlineCodeStylePreset,\n\t\tanchorLinkOffsetY,\n\n\t\tfonts,\n\t\ttextColor,\n\t\ttextBackgroundColor: commonValue(textBackgroundColors),\n\t\ttextBackgroundRadius: commonValue(textBackgroundRadius),\n\t\ttextBackgroundCornerShape: commonValue(textBackgroundCornerShape),\n\t\ttextBackgroundPadding: commonValue(textBackgroundPadding),\n\t\tfontSize,\n\t\tfontSizeUnits,\n\t\tletterSpacingValue,\n\t\tletterSpacingUnits,\n\t\ttextTransforms,\n\t\ttextDecoration: commonValue(textDecorations),\n\t\ttextDecorationStyle: commonValue(textDecorationStyles),\n\t\ttextDecorationColor: commonValue(textDecorationColors),\n\t\ttextDecorationThickness: commonValue(textDecorationThicknesses),\n\t\ttextDecorationOffset: commonValue(textDecorationOffsets),\n\t\ttextDecorationSkipInk: commonValue(textDecorationSkipInks),\n\t\tlineHeightValue,\n\t\tlineHeightUnits,\n\t\ttextAlignment,\n\t\ttextFitScale: commonValue(textFitScale),\n\t\ttextStrokeColor,\n\t\ttextStrokeWidth,\n\t\ttextWrapBalance,\n\t\topenTypeFontFeatures: openTypeFontFeatures ?? {},\n\n\t\tvariationAxes,\n\n\t\tlinkFont: commonValue(linkFonts),\n\t\tlinkTextColor: commonValue(linkTextColors),\n\t\tlinkFontSize: commonValue(linkFontSizes),\n\t\tlinkTextTransform: commonValue(linkTextTransforms),\n\t\tlinkTextDecoration: commonValue(linkTextDecorations),\n\t\tlinkTextDecorationStyle: commonValue(linkTextDecorationStyles),\n\t\tlinkTextDecorationColor: commonValue(linkTextDecorationColors),\n\t\tlinkTextDecorationThickness: commonValue(linkTextDecorationThicknesses),\n\t\tlinkTextDecorationOffset: commonValue(linkTextDecorationOffsets),\n\t\tlinkTextDecorationSkipInk: commonValue(linkTextDecorationSkipInks),\n\n\t\tlinkHoverFont: commonValue(linkHoverFonts),\n\t\tlinkHoverTextColor: commonValue(linkHoverTextColors),\n\t\tlinkHoverFontSize: commonValue(linkHoverFontSizes),\n\t\tlinkHoverTextTransform: commonValue(linkHoverTextTransforms),\n\t\tlinkHoverTextDecoration: commonValue(linkHoverTextDecorations),\n\t\tlinkHoverTextDecorationStyle: commonValue(linkHoverTextDecorationStyles),\n\t\tlinkHoverTextDecorationColor: commonValue(linkHoverTextDecorationColors),\n\t\tlinkHoverTextDecorationThickness: commonValue(linkHoverTextDecorationThicknesses),\n\t\tlinkHoverTextDecorationOffset: commonValue(linkHoverTextDecorationOffsets),\n\t\tlinkHoverTextDecorationSkipInk: commonValue(linkHoverTextDecorationSkipInks),\n\n\t\tlinkCurrentFont: commonValue(linkCurrentFonts),\n\t\tlinkCurrentTextColor: commonValue(linkCurrentTextColors),\n\t\tlinkCurrentFontSize: commonValue(linkCurrentFontSizes),\n\t\tlinkCurrentTextTransform: commonValue(linkCurrentTextTransforms),\n\t\tlinkCurrentTextDecoration: commonValue(linkCurrentTextDecorations),\n\t\tlinkCurrentTextDecorationStyle: commonValue(linkCurrentTextDecorationStyles),\n\t\tlinkCurrentTextDecorationColor: commonValue(linkCurrentTextDecorationColors),\n\t\tlinkCurrentTextDecorationThickness: commonValue(linkCurrentTextDecorationThicknesses),\n\t\tlinkCurrentTextDecorationOffset: commonValue(linkCurrentTextDecorationOffsets),\n\t\tlinkCurrentTextDecorationSkipInk: commonValue(linkCurrentTextDecorationSkipInks),\n\t}\n}\n", "import { Mixed } from \"@framerjs/shared\"\nimport { isEqual } from \"library/index.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { NodeID } from \"../../nodes/NodeID.ts\"\nimport type { VariableReference } from \"../VariableReference.ts\"\nimport type { TextEffectTrigger, WithTextEffect } from \"../WithTextEffect.ts\"\nimport { withTextEffect } from \"../WithTextEffect.ts\"\nimport type { Reduced, ReducedRecord } from \"./Reduced.ts\"\nimport { isNotFound } from \"./Reduced.ts\"\nimport { type ReducedEffectTransition, getReducedEffectTransition } from \"./reduceEffectTransition.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedTextEffect extends ReducedRecord<\n\tOmit<WithTextEffect, \"textEffectScrollTarget\" | \"textEffectTrigger\" | \"textEffectTransition\">\n> {\n\ttextEffectScrollTarget: Set<NodeID | VariableReference | undefined>\n\ttextEffectTrigger: Set<TextEffectTrigger | undefined>\n\ttextEffectTransition: Reduced<ReducedEffectTransition | undefined>\n\tonlyNodesWithTextEffect: boolean\n}\n\nexport function reduceTextEffect(node: CanvasNode, result: ReducedTextEffect): void {\n\tif (!withTextEffect(node)) {\n\t\tresult.onlyNodesWithTextEffect = false\n\t\treturn\n\t}\n\n\treduceProperty(\"textEffectEnabled\", result, node)\n\treduceProperty(\"textEffectType\", result, node)\n\treduceProperty(\"textEffectTokenization\", result, node)\n\treduceProperty(\"textEffectThreshold\", result, node, v => v ?? 0)\n\treduceProperty(\"textEffectScrollTargetCollectionItem\", result, node)\n\treduceProperty(\"textEffectReplay\", result, node, v => v ?? false)\n\treduceProperty(\"textEffectDelay\", result, node, v => v ?? 0)\n\n\tresult.textEffectScrollTarget.add(node.textEffectScrollTarget)\n\tresult.textEffectTrigger.add(node.textEffectTrigger)\n\n\treduceProperty(\"textEffectOpacity\", result, node)\n\treduceProperty(\"textEffectX\", result, node)\n\treduceProperty(\"textEffectY\", result, node)\n\treduceProperty(\"textEffectScale\", result, node)\n\treduceProperty(\"textEffectRotate3d\", result, node)\n\treduceProperty(\"textEffectRotate\", result, node)\n\treduceProperty(\"textEffectRotateX\", result, node)\n\treduceProperty(\"textEffectRotateY\", result, node)\n\treduceProperty(\"textEffectSkewX\", result, node)\n\treduceProperty(\"textEffectSkewY\", result, node)\n\treduceProperty(\"textEffectBlur\", result, node)\n\n\tresult.textEffectTransition = getReducedEffectTransition(node.textEffectTransition, result.textEffectTransition)\n\n\tif (isNotFound(result.textEffectScrollTargetCollectionItem)) {\n\t\tresult.textEffectScrollTargetCollectionItem = node.textEffectScrollTargetCollectionItem\n\t} else if (\n\t\tresult.textEffectScrollTargetCollectionItem !== Mixed &&\n\t\t!isEqual(result.textEffectScrollTargetCollectionItem, node.textEffectScrollTargetCollectionItem)\n\t) {\n\t\tresult.textEffectScrollTargetCollectionItem = Mixed\n\t}\n}\n", "import { Mixed, isMixed } from \"@framerjs/shared\"\nimport type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport { type TextSelection, isTextSelection, withTextSelection } from \"../WithTextSelection.ts\"\nimport { type Reduced, type ReducedSubPropertyRecord, isNotFound } from \"./Reduced.ts\"\n\nexport interface ReducedTextSelection {\n\tonlyNodesWithTextSelection: boolean\n\ttextSelection: Reduced<ReducedSubPropertyRecord<TextSelection> | undefined | null>\n}\n\nexport function reduceTextSelection(node: CanvasNode, result: ReducedTextSelection) {\n\tif (!withTextSelection(node)) {\n\t\tresult.onlyNodesWithTextSelection = false\n\t\treturn\n\t}\n\n\tif (isMixed(result.textSelection)) return\n\n\tif (isNotFound(result.textSelection)) {\n\t\tif (isTextSelection(node.textSelection)) {\n\t\t\tresult.textSelection = { ...node.textSelection }\n\t\t} else {\n\t\t\tresult.textSelection = node.textSelection\n\t\t}\n\t\treturn\n\t}\n\n\tif (!result.textSelection || !node.textSelection) {\n\t\tif (result.textSelection !== node.textSelection) {\n\t\t\tresult.textSelection = Mixed\n\t\t}\n\t\treturn\n\t}\n\n\tlet key: keyof TextSelection\n\tfor (key in result.textSelection) {\n\t\tconst reducedValue = result.textSelection[key]\n\t\tconst nodeValue = node.textSelection[key]\n\t\tif (reducedValue === nodeValue) continue\n\t\tresult.textSelection[key] = Mixed\n\t}\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { type WithTickerEffect, hasTickerEffect, isNodeInTickerEffect, withTickerEffect } from \"../WithTickerEffect.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedTickerEffect extends ReducedRecord<WithTickerEffect> {\n\tonlyNodesWithTickerEffect: boolean\n\tanyNodeWithTickerEffect: boolean\n\tanyNodeWithTickerEffectAncestor: boolean\n}\n\nexport function reduceTickerEffect(node: CanvasNode, result: ReducedTickerEffect) {\n\tresult.anyNodeWithTickerEffectAncestor ||= isNodeInTickerEffect(node)\n\t// we use valid ticker effect here because a variant could have a ticker effect but not render as a ticker\n\t// and we don't want to prevent them from being able to see the properties that are making the ticker invalid\n\tresult.anyNodeWithTickerEffect ||= hasTickerEffect(node)\n\n\tif (!withTickerEffect(node)) {\n\t\tresult.onlyNodesWithTickerEffect = false\n\t\treturn\n\t}\n\n\treduceProperty(\"tickerEffectEnabled\", result, node)\n\treduceProperty(\"tickerEffectVelocity\", result, node)\n\treduceProperty(\"tickerEffectHoverModifier\", result, node)\n\treduceProperty(\"tickerEffectDirectionModifier\", result, node)\n\treduceProperty(\"tickerEffectDraggable\", result, node)\n}\n", "import type { CanvasNode } from \"../../index.ts\"\nimport type { WithTitleAndDescription } from \"../WithTitleAndDescription.ts\"\nimport { withTitleAndDescription } from \"../WithTitleAndDescription.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedTitleAndDescription extends ReducedRecord<WithTitleAndDescription> {\n\tonlyNodesWithTitleAndDescription: boolean\n}\n\nexport function reduceTitleAndDescription(node: CanvasNode, result: ReducedTitleAndDescription): void {\n\tif (!withTitleAndDescription(node)) {\n\t\tresult.onlyNodesWithTitleAndDescription = false\n\t\treturn\n\t}\n\n\treduceProperty(\"title\", result, node)\n\treduceProperty(\"description\", result, node)\n}\n", "import { Mixed } from \"@framerjs/shared\"\nimport { type Link, isLink } from \"document/models/CanvasTree/traits/utils/Link.ts\"\nimport { ControlType } from \"library/index.ts\"\nimport { resolveLinkToURL } from \"utils/resolveLink.ts\"\nimport { isString } from \"utils/typeChecks.ts\"\nimport type { CanvasTree } from \"../../CanvasTree.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { isRichTextNode } from \"../../nodes/utils/nodeCheck.ts\"\nimport { NotFound, type Reduced } from \"./Reduced.ts\"\nimport type { ReducedControlPropsWithIdentifier } from \"./reduceControlPropsWithIdentifier.ts\"\nimport type { ReducedLink } from \"./reduceLink.ts\"\n\ninterface ReducedTrackingIdAIPromptInput extends ReducedControlPropsWithIdentifier, Pick<ReducedLink, \"link\"> {}\n\nexport interface ReducedTrackingIdAIPrompt extends ReducedTrackingIdAIPromptInput {\n\ttrackingIdAIPrompt: Reduced<string>\n}\n\nexport function reduceTrackingIdAIPrompt(tree: CanvasTree, nodes: CanvasNode[], result: ReducedTrackingIdAIPrompt) {\n\t// We only reduce the value for single selections\n\tif (nodes.length === 0) return\n\tif (nodes.length > 1) {\n\t\tresult.trackingIdAIPrompt = Mixed\n\t\treturn\n\t}\n\n\tconst node = nodes[0]\n\tif (!node) return\n\n\tif (isLink(result.link)) {\n\t\tconst prompt = makeAiPromptForLinkClickTrackingId(tree, {\n\t\t\tlink: result.link,\n\t\t\tlinkText: getNodeText(node),\n\t\t})\n\t\tresult.trackingIdAIPrompt = prompt || NotFound\n\t}\n\n\tif (result?.controlPropsWithIdentifier?.controlProps) {\n\t\tconst reducedControlProps = result.controlPropsWithIdentifier.controlProps\n\t\tlet link: Link | undefined = undefined\n\t\tlet linkText: string | undefined = undefined\n\t\tfor (const propKey in reducedControlProps) {\n\t\t\tconst value = reducedControlProps[propKey]\n\t\t\tif (!value) continue\n\n\t\t\tswitch (value.type) {\n\t\t\t\tcase ControlType.String:\n\t\t\t\tcase ControlType.RichText:\n\t\t\t\t\tif (isString(value.value)) {\n\t\t\t\t\t\tlinkText = value.value\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase ControlType.Link:\n\t\t\t\t\tif (isLink(value.value)) {\n\t\t\t\t\t\tlink = value.value\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tfor (const propKey in reducedControlProps) {\n\t\t\tconst value = reducedControlProps[propKey]\n\t\t\tif (!value || value.type !== ControlType.TrackingId) continue\n\t\t\tconst prompt = makeAiPromptForLinkClickTrackingId(tree, { link, linkText })\n\t\t\tvalue.trackingIdAIPrompt = prompt || NotFound\n\t\t}\n\t}\n}\n\nexport function makeAiPromptForLinkClickTrackingId(\n\ttree: CanvasTree,\n\t{ link, linkText, textContent }: { link?: Link; linkText?: string; textContent?: string },\n): string | undefined {\n\tconst href = link ? resolveLinkToURL(tree, link) : undefined\n\n\tif (!linkText && !textContent && !href) {\n\t\treturn\n\t}\n\n\tlet prompt =\n\t\t'Generate a short (up to 30 characters) tracking id as a verb in kebab-case (e.g. \"click-subscribe or click-login\") where the text is leading over the link'\n\n\tif (href) {\n\t\tprompt += ` to \"${href}\"`\n\t}\n\n\tif (linkText) {\n\t\tprompt += ` with the text \"${linkText.replace(/\"/gu, \"'\")}\"`\n\t}\n\n\tif (textContent) {\n\t\tprompt += ` that is a part of the following text \"${textContent.replace(/\"/gu, \"'\")}\"`\n\t}\n\n\treturn prompt\n}\n\nfunction getNodeText(node: CanvasNode): string {\n\tif (isRichTextNode(node)) {\n\t\treturn node.getTextContent()\n\t} else if (node.children) {\n\t\treturn node.children.map(getNodeText).join(\" \")\n\t}\n\treturn \"\"\n}\n", "import { isUndefined } from \"utils/typeChecks.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { hasFloatingPosition } from \"../WithFloatingPosition.ts\"\nimport type { WithTransforms } from \"../WithTransforms.ts\"\nimport { withTransforms } from \"../WithTransforms.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { getFallbackPerspective } from \"./getFallbackPerspective.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedTransforms extends ReducedRecord<WithTransforms> {\n\tanyNodesWithTransforms: boolean\n\tonlyNodesWithTransformOrigin: boolean\n}\n\nexport function reduceTransforms(node: CanvasNode, result: ReducedTransforms) {\n\tif (!withTransforms(node)) return\n\n\treduceProperty(\"perspective\", result, node, current => {\n\t\tif (isUndefined(current)) return getFallbackPerspective(node)\n\t\treturn current\n\t})\n\n\tresult.anyNodesWithTransforms = true\n\n\tif (hasFloatingPosition(node)) {\n\t\tresult.onlyNodesWithTransformOrigin = false\n\t}\n\n\treduceProperty(\"scale\", result, node)\n\treduceProperty(\"skewX\", result, node)\n\treduceProperty(\"skewY\", result, node)\n\treduceProperty(\"skewY\", result, node)\n\treduceProperty(\"rotateX\", result, node, v => v ?? 0)\n\treduceProperty(\"rotateY\", result, node, v => v ?? 0)\n\treduceProperty(\"rotate3d\", result, node, v => v ?? false)\n\treduceProperty(\"translateZ\", result, node)\n\n\treduceProperty(\"backfaceVisibility\", result, node)\n\treduceProperty(\"transformStylePreserve3d\", result, node)\n\n\treduceProperty(\"transformOriginX\", result, node)\n\treduceProperty(\"transformOriginY\", result, node)\n}\n", "import { Mixed } from \"@framerjs/shared\"\nimport type { Transition } from \"document/models/Transition.ts\"\nimport { fallbackPhysicsBasedSpringTransition } from \"document/models/Transition.ts\"\nimport { deepClone } from \"utils/deepClone.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { type DynamicValue, isDynamicValue, isDynamicValueEqual } from \"../DynamicValue.ts\"\nimport { type WithTransition, withTransition } from \"../WithTransition.ts\"\nimport { isVariant } from \"../WithVariant.ts\"\nimport { type ReducedRecord, isNotFound } from \"./Reduced.ts\"\nimport { type ReducedEffectTransition, getReducedEffectTransition } from \"./reduceEffectTransition.ts\"\n\nexport interface ReducedTransition {\n\ttransition: Exclude<ReducedRecord<WithTransition>[\"transition\"], Transition> | ReducedEffectTransition\n\tonlyNodesWithTransition: boolean\n}\n\nexport function reduceTransition(node: CanvasNode, result: ReducedTransition) {\n\tif (!withTransition(node)) {\n\t\tresult.onlyNodesWithTransition = false\n\t\treturn\n\t}\n\n\tlet value: Transition | DynamicValue | undefined\n\tif (isVariant(node)) {\n\t\tvalue = node.variantTransition ?? fallbackPhysicsBasedSpringTransition\n\t} else {\n\t\tvalue = node.transition\n\t}\n\n\tif (isNotFound(result.transition)) {\n\t\tresult.transition = deepClone(value)\n\t} else if (isDynamicValue(result.transition)) {\n\t\tresult.transition = isDynamicValueEqual(result.transition, value) ? result.transition : Mixed\n\t} else if (isDynamicValue(value)) {\n\t\tresult.transition = isDynamicValueEqual(value, result.transition) ? result.transition : Mixed\n\t} else {\n\t\tresult.transition = getReducedEffectTransition(value, result.transition)\n\t}\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { WithTriggerActions } from \"../WithTriggerActions.ts\"\nimport { withTriggerActions } from \"../WithTriggerActions.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedTriggerActions extends ReducedRecord<WithTriggerActions> {\n\tonlyNodesWithTriggerActions: boolean\n}\n\nexport function reduceTriggerActions(node: CanvasNode, result: ReducedTriggerActions) {\n\tif (!withTriggerActions(node)) {\n\t\tresult.onlyNodesWithTriggerActions = false\n\t\treturn\n\t}\n\n\treduceProperty(\"triggerActions\", result, node)\n}\n", "import type { CanvasNode } from \"../../index.ts\"\nimport type { WithUserSelect } from \"../WithUserSelect.ts\"\nimport { withUserSelect } from \"../WithUserSelect.ts\"\nimport { isVariant } from \"../WithVariant.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport interface ReducedUserSelect extends ReducedRecord<WithUserSelect> {\n\tonlyNodesWithUserSelect: boolean\n}\n\nexport function reduceUserSelect(node: CanvasNode, result: ReducedUserSelect): void {\n\tif (!withUserSelect(node) || isVariant(node)) {\n\t\tresult.onlyNodesWithUserSelect = false\n\t\treturn\n\t}\n\n\treduceProperty(\"userSelect\", result, node)\n}\n", "import type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type { WithVariableBinding } from \"../WithVariableBinding.ts\"\nimport { withVariableBinding } from \"../WithVariableBinding.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceObjectProperty } from \"./reduceObjectProperty.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport type ReducedVariableBinding = ReducedRecord<WithVariableBinding>\n\nexport function reduceVariableBinding(node: CanvasNode, result: ReducedVariableBinding) {\n\tif (!withVariableBinding(node)) return\n\n\treduceProperty(\"bindingType\", result, node)\n\treduceObjectProperty(\"variableBinding\", result, node)\n}\n", "import type { ComponentLoader } from \"@framerjs/framer-runtime\"\nimport { Mixed, isMixed } from \"@framerjs/shared\"\nimport type { CanvasNode, CanvasTree, NodeID } from \"document/models/CanvasTree/index.ts\"\nimport { isUndefined } from \"utils/typeChecks.ts\"\nimport { isFixedOrRelativeOverlay } from \"../../nodes/utils/overlayHelpers.ts\"\nimport { isSmartComponentInstance } from \"../../nodes/utils/smartComponentInstanceHelpers.ts\"\nimport type {\n\tEffectVariantScrollTarget,\n\tVariantAppearEffectTrigger,\n\tWithVariantAppearEffect,\n} from \"../WithVariantAppearEffect.ts\"\nimport { hasVariantControl, withVariantAppearPageEffect } from \"../WithVariantAppearEffect.ts\"\nimport type { ReducedEffectScrollTarget } from \"./EffectScrollTarget.ts\"\nimport { EffectTrigger, effectTriggerStringToEnumMember } from \"./EffectTrigger.ts\"\nimport type { Reduced, ReducedRecord } from \"./Reduced.ts\"\nimport { NotFound, isNotFound } from \"./Reduced.ts\"\nimport { reduceProperty, valuesAreDifferent } from \"./reduceProperty.ts\"\n\nexport interface ReducedVariantAppearEffect extends ReducedRecord<\n\tOmit<\n\t\tWithVariantAppearEffect,\n\t\t| \"appearEffectTrigger\"\n\t\t| \"appearEffectScrollTargets\"\n\t\t| \"appearEffectVisibleVariantId\"\n\t\t| \"appearEffectObscuredVariantId\"\n\t\t| \"appearEffectScrollDirectionTarget\"\n\t>\n> {\n\tonlyNodesWithVariantAppearEffect: boolean\n\tappearEffectTrigger: Set<WithVariantAppearEffect[\"appearEffectTrigger\"]>\n\tappearEffectScrollTargets: ReducedEffectVariantScrollTarget[]\n\tappearEffectScrollTargetCount: Reduced<number>\n\tappearEffectVisibleVariantId: Set<NodeID | undefined>\n\tappearEffectObscuredVariantId: Set<NodeID | undefined>\n\tappearEffectScrollDirectionTarget: Set<NodeID | undefined>\n}\n\nexport interface ReducedEffectVariantScrollTarget extends ReducedEffectScrollTarget {\n\tvariants: Set<NodeID | undefined>\n}\n\nexport function reduceVariantAppearEffect(\n\tnode: CanvasNode,\n\ttree: CanvasTree,\n\tcomponentLoader: ComponentLoader,\n\tresult: ReducedVariantAppearEffect,\n) {\n\tif (!withVariantAppearPageEffect(node) || isFixedOrRelativeOverlay(node)) {\n\t\tresult.onlyNodesWithVariantAppearEffect = false\n\t\treturn\n\t}\n\n\tif (!isSmartComponentInstance(tree, node)) {\n\t\tresult.onlyNodesWithVariantAppearEffect = false\n\t\treturn\n\t}\n\n\tconst componentDefinition = componentLoader.reactComponentForIdentifier(node.codeComponentIdentifier)\n\tif (!componentDefinition || !hasVariantControl(componentDefinition)) {\n\t\tresult.onlyNodesWithVariantAppearEffect = false\n\t\treturn\n\t}\n\n\treduceProperty(\"appearEffectEnabled\", result, node)\n\n\tif (!node.appearEffectEnabled) return\n\n\treduceProperty(\"appearEffectThreshold\", result, node)\n\treduceProperty(\"appearEffectAnimateOnce\", result, node)\n\treduceProperty(\"appearEffectScrollDirection\", result, node, direction => direction ?? \"down\")\n\n\tresult.appearEffectScrollDirectionTarget.add(node.appearEffectScrollDirectionTarget)\n\tresult.appearEffectVisibleVariantId.add(node.appearEffectVisibleVariantId)\n\tresult.appearEffectObscuredVariantId.add(node.appearEffectObscuredVariantId)\n\tresult.appearEffectTrigger.add(\n\t\tisUndefined(node.appearEffectTrigger)\n\t\t\t? EffectTrigger.OnInView\n\t\t\t: (effectTriggerStringToEnumMember(node.appearEffectTrigger) as VariantAppearEffectTrigger | undefined),\n\t)\n\n\tconst scrollTargetCount = node.appearEffectScrollTargets?.length ?? 0\n\tif (isNotFound(result.appearEffectScrollTargetCount)) {\n\t\tresult.appearEffectScrollTargetCount = scrollTargetCount\n\t} else if (result.appearEffectScrollTargetCount !== scrollTargetCount) {\n\t\tresult.appearEffectScrollTargetCount = Mixed\n\t}\n\n\tnode.appearEffectScrollTargets?.forEach((scrollTarget, idx) => {\n\t\tconst reducedTarget = result.appearEffectScrollTargets?.[idx]\n\t\tif (reducedTarget) {\n\t\t\tcombine(reducedTarget, scrollTarget, node.id)\n\t\t} else {\n\t\t\tresult.appearEffectScrollTargets.push({\n\t\t\t\ttargets: new Set([scrollTarget.target]),\n\t\t\t\tvariants: new Set([scrollTarget.variant]),\n\t\t\t\tids: { [node.id]: scrollTarget.id },\n\t\t\t\tcollectionItem: scrollTarget.collectionItem ?? NotFound,\n\t\t\t})\n\t\t}\n\t})\n}\n\nfunction combine(reduced: ReducedEffectVariantScrollTarget, scrollTarget: EffectVariantScrollTarget, id: NodeID) {\n\treduced.targets.add(scrollTarget.target)\n\treduced.variants.add(scrollTarget.variant)\n\treduced.ids[id] = scrollTarget.id\n\n\tif (isMixed(reduced.collectionItem)) return\n\tif (isNotFound(reduced.collectionItem)) {\n\t\treduced.collectionItem = scrollTarget.collectionItem\n\t} else if (valuesAreDifferent(reduced.collectionItem, scrollTarget.collectionItem)) {\n\t\treduced.collectionItem = Mixed\n\t}\n}\n", "import { isArray, isString } from \"utils/typeChecks.ts\"\nimport type { CanvasTree } from \"../../CanvasTree.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport { extractRichTextOverrideKeys } from \"../../nodes/utils/extractRichTextOverrideKeys.ts\"\nimport { isRichTextNode } from \"../../nodes/utils/nodeCheck.ts\"\nimport { TraitType, traitTypeMap } from \"../TraitType.ts\"\nimport type { WithRichText } from \"../WithRichText.ts\"\nimport type { ReplicaOverrides } from \"../WithTemplate.ts\"\nimport { isReplicaOrReplicaChild } from \"../WithTemplate.ts\"\nimport { isBreakpointVariant } from \"../WithVariant.ts\"\nimport type { Properties } from \"./reduceProperties.ts\"\n\nexport interface ReducedVariantOverrides extends Pick<\n\tProperties,\n\t\"onlyReplicasOrReplicaChildren\" | \"anyBreakpointNode\" | \"onlyRichTextNodes\"\n> {\n\t/**\n\t * variantOverrideKeys represents the individual property keys that have been overridden.\n\t */\n\tvariantOverrideKeys: Set<string>\n\n\t/**\n\t * We use variantOverrideTraitTypes to provide a quick way to determine which\n\t * groups of properties that will also need to be reset when we reset a particular\n\t * override. This is because some properties are logically dependent on others, and\n\t * will cause a broken / nonsensical experience if another dependent property has\n\t * been reset.\n\t */\n\tvariantOverrideTraitTypes: Set<TraitType>\n}\n\nconst deletedKey = \"_deleted\"\nconst htmlKey: keyof WithRichText = \"html\"\n\n/**\n * We currently only exclude size type properties from being shown as overrides in the UI\n * for breakpoints. We do this because the size properties are intrinsic to the breakpoint.\n */\nconst excludedBreakpointTraitTypes = toSet([TraitType.Size] as const)\n\n/**\n * reduceVariantOverrides calculates the reduced variant overrides for a selection of nodes.\n *\n * Some constraints:\n * - Will be a no-op if all of the selected nodes aren't replicas or children of replicas.\n * - If the node is a breakpoint variant, then some properties are excluded such as size properties\n * as these are intrinsic to the breakpoint.\n *\n * The result is populated with two properties:\n * - variantOverrideKeys: A set of property keys that have been overridden in the replica for the given nodes.\n * - variantOverrideTraitTypes: A set of traits that are affected by the overrides. For example, if the fill color has been overridden, then the 'Fill' trait type will be included in this set. Trait types encapsulate a group of properties that are logically related to each other, so that we can reset them in one go.\n */\nexport function reduceVariantOverrides(tree: CanvasTree, nodes: CanvasNode[], result: ReducedVariantOverrides) {\n\tif (!result.onlyReplicasOrReplicaChildren) return\n\n\tconst overrides = new Set<string>()\n\tconst traitTypes = new Set<TraitType>()\n\n\tfunction maybeAddOverride(property: string, nodeIsBreakpointVariant: boolean): void {\n\t\tconst traitType = traitTypeMap[property]\n\n\t\t// If the node is a breakpoint variant, we don't want to show overrides on some\n\t\t// property groups such as size type properties.\n\t\tif (nodeIsBreakpointVariant && excludedBreakpointTraitTypes.has(traitType)) return\n\n\t\tif (traitType) traitTypes.add(traitType)\n\t\toverrides.add(property)\n\t}\n\n\tfor (const node of nodes) {\n\t\t// nodeOverrides looks like this:\n\t\t// {\n\t\t//   \"aNodeID\": {\n\t\t//      \"width\": 100,\n\t\t//   },\n\t\t//   \"anotherNodeID\": {\n\t\t//      \"_deleted\": [\"fillColor\", \"borderRadius\"],\n\t\t//   }\n\t\t// }\n\t\tconst nodeOverrides = getNodeReplicaOverrides(tree, node)\n\t\tif (!nodeOverrides) continue\n\t\tif (!node.originalid) continue\n\t\tconst nodeIsBreakpointVariant = isBreakpointVariant(node)\n\n\t\t// replicaOverrides looks like this:\n\t\t// {\n\t\t//   \"width\": 100,\n\t\t//   \"height\": 100,\n\t\t//   \"_deleted\": [\"fillColor\", \"borderRadius\"],\n\t\t// }\n\t\tconst replicaOverrides = nodeOverrides[node.originalid]\n\n\t\tfor (const property in replicaOverrides) {\n\t\t\tconst propOverride = replicaOverrides[property]\n\n\t\t\t// We have a special _deleted property that contains an array of property keys that have been unset from the values set in the primary variant.\n\t\t\tif (property === deletedKey) {\n\t\t\t\tif (isArray(propOverride)) {\n\t\t\t\t\tfor (const deletedProperty of propOverride) {\n\t\t\t\t\t\tif (isString(deletedProperty)) maybeAddOverride(deletedProperty, nodeIsBreakpointVariant)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tresult.onlyRichTextNodes &&\n\t\t\t\tproperty === htmlKey &&\n\t\t\t\tisRichTextNode(node) &&\n\t\t\t\tisReplicaOrReplicaChild(node)\n\t\t\t) {\n\t\t\t\t// RichTextNode's store all of their property values within\n\t\t\t\t// a HTML string like so:\n\t\t\t\t// '<p style=\"--framer-text-color: rgb(176, 30, 30); --framer-text-alignment: center;\">ffffff</p>'\n\n\t\t\t\tconst overriddenRichTextKeys = extractRichTextOverrideKeys(tree, node)\n\t\t\t\toverriddenRichTextKeys.forEach(key => maybeAddOverride(key, nodeIsBreakpointVariant))\n\t\t\t} else {\n\t\t\t\tmaybeAddOverride(property, nodeIsBreakpointVariant)\n\t\t\t}\n\t\t}\n\t}\n\n\tresult.variantOverrideKeys = overrides\n\tresult.variantOverrideTraitTypes = traitTypes\n}\n\nfunction getNodeReplicaOverrides(tree: CanvasTree, node: CanvasNode): ReplicaOverrides | undefined {\n\t// Component variants store their overrides directly on the node.\n\tif (node.replicaInfo) {\n\t\treturn node.replicaInfo.overrides\n\t}\n\n\t// Otherwise, we need to find the top level node of the replica subtree\n\t// where the overrides are usually stored for the whole subtree.\n\t// The replicaAncestorId is persisted on each replica child so we can\n\t// find the top level node of the replica subtree where the override data\n\t// is stored.\n\tconst ancestor = tree.get(node.cache.replicaAncestorId)\n\tif (!ancestor) return\n\tconst replicaInfo = ancestor.replicaInfo\n\tif (!replicaInfo) return\n\n\treturn replicaInfo.overrides\n}\n\nfunction toSet<T>(arr: readonly T[]): ReadonlySet<T> {\n\treturn new Set(arr)\n}\n", "import { Mixed } from \"@framerjs/shared\"\nimport type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport { isUndefined } from \"utils/typeChecks.ts\"\nimport { isDynamicValue } from \"../DynamicValue.ts\"\nimport { withRotation } from \"../WithRotation.ts\"\nimport type { WithWhileHover } from \"../WithWhileHover.ts\"\nimport { withWhileHover } from \"../WithWhileHover.ts\"\nimport type { NotFound, Reduced, ReducedRecord } from \"./Reduced.ts\"\nimport { isNotFound } from \"./Reduced.ts\"\nimport { nodeSupportsGestureEffects } from \"./effects.ts\"\nimport { type ReducedEffectTransition, getReducedEffectTransition } from \"./reduceEffectTransition.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\nimport type { ReducedShadow } from \"./reduceShadows.ts\"\nimport { combineShadows } from \"./reduceShadows.ts\"\n\nexport interface ReducedHoverEffect extends Omit<\n\tReducedRecord<WithWhileHover>,\n\t\"whileHoverBoxShadow\" | \"whileHoverRotateAdditiveDynamicValue\" | \"whileHoverTransition\"\n> {\n\tonlyNodesWithWhileHover: boolean\n\twhileHoverBoxShadow: ReducedShadow | NotFound\n\twhileHoverBoxShadowCount: Reduced<number>\n\twhileHoverTransition: Reduced<ReducedEffectTransition | undefined>\n}\n\nexport function reduceHoverEffect(node: CanvasNode, result: ReducedHoverEffect) {\n\tif (!withWhileHover(node) || !nodeSupportsGestureEffects(node)) {\n\t\tresult.onlyNodesWithWhileHover = false\n\t\treturn\n\t}\n\n\treduceProperty(\"whileHoverEnabled\", result, node)\n\treduceProperty(\"whileHoverOpacity\", result, node)\n\treduceProperty(\"whileHoverX\", result, node)\n\treduceProperty(\"whileHoverY\", result, node)\n\treduceProperty(\"whileHoverScale\", result, node)\n\treduceProperty(\"whileHoverRotate3d\", result, node)\n\treduceProperty(\"whileHoverRotate\", result, node, v => {\n\t\tif (withRotation(node) && isDynamicValue(node.rotation) && node.whileHoverRotateAdditiveDynamicValue) {\n\t\t\treturn node.resolveValue(\"rotation\") + (v ?? 0)\n\t\t}\n\t\treturn v\n\t})\n\treduceProperty(\"whileHoverRotateX\", result, node)\n\treduceProperty(\"whileHoverRotateY\", result, node)\n\treduceProperty(\"whileHoverSkewX\", result, node)\n\treduceProperty(\"whileHoverSkewY\", result, node)\n\treduceProperty(\"whileHoverBackgroundColor\", result, node)\n\n\tresult.whileHoverTransition = getReducedEffectTransition(node.whileHoverTransition, result.whileHoverTransition)\n\n\tconst shadow = node.whileHoverBoxShadow\n\n\tif (isUndefined(shadow)) {\n\t\tresult.whileHoverBoxShadowCount = 0\n\t\treturn\n\t} else if (result.whileHoverBoxShadowCount === 0) {\n\t\tresult.whileHoverBoxShadowCount = Mixed\n\t} else {\n\t\tresult.whileHoverBoxShadowCount = 1\n\t}\n\n\tif (isNotFound(result.whileHoverBoxShadow)) {\n\t\tresult.whileHoverBoxShadow = {\n\t\t\tid: shadow.id,\n\t\t\ttype: shadow.type,\n\t\t\tcolor: shadow.color,\n\t\t\tx: shadow.x,\n\t\t\ty: shadow.y,\n\t\t\tblur: shadow.blur,\n\t\t\tinset: shadow.inset,\n\t\t\tspread: shadow.spread,\n\t\t\tdiffusion: shadow.diffusion,\n\t\t\tfocus: shadow.focus,\n\t\t}\n\t} else {\n\t\tcombineShadows(result.whileHoverBoxShadow, shadow)\n\t}\n}\n", "import { Mixed } from \"@framerjs/shared\"\nimport type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport { isUndefined } from \"utils/typeChecks.ts\"\nimport { isDynamicValue } from \"../DynamicValue.ts\"\nimport { withRotation } from \"../WithRotation.ts\"\nimport type { WithWhileTap } from \"../WithWhileTap.ts\"\nimport { withWhileTap } from \"../WithWhileTap.ts\"\nimport type { NotFound, Reduced, ReducedRecord } from \"./Reduced.ts\"\nimport { isNotFound } from \"./Reduced.ts\"\nimport { nodeSupportsGestureEffects } from \"./effects.ts\"\nimport { type ReducedEffectTransition, getReducedEffectTransition } from \"./reduceEffectTransition.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\nimport type { ReducedShadow } from \"./reduceShadows.ts\"\nimport { combineShadows } from \"./reduceShadows.ts\"\n\nexport interface ReducedPressEffect extends Omit<\n\tReducedRecord<WithWhileTap>,\n\t\"whileTapBoxShadow\" | \"whileTapRotateAdditiveDynamicValue\" | \"whileTapTransition\"\n> {\n\tonlyNodesWithWhileTap: boolean\n\twhileTapBoxShadow: ReducedShadow | NotFound\n\twhileTapBoxShadowCount: Reduced<number>\n\twhileTapTransition: Reduced<ReducedEffectTransition | undefined>\n}\n\nexport function reducePressEffect(node: CanvasNode, result: ReducedPressEffect) {\n\tif (!withWhileTap(node) || !nodeSupportsGestureEffects(node)) {\n\t\tresult.onlyNodesWithWhileTap = false\n\t\treturn\n\t}\n\n\treduceProperty(\"whileTapEnabled\", result, node)\n\treduceProperty(\"whileTapOpacity\", result, node)\n\treduceProperty(\"whileTapX\", result, node)\n\treduceProperty(\"whileTapY\", result, node)\n\treduceProperty(\"whileTapScale\", result, node)\n\treduceProperty(\"whileTapRotate3d\", result, node)\n\treduceProperty(\"whileTapRotate\", result, node, v => {\n\t\tif (withRotation(node) && isDynamicValue(node.rotation) && node.whileTapRotateAdditiveDynamicValue) {\n\t\t\treturn node.resolveValue(\"rotation\") + (v ?? 0)\n\t\t}\n\t\treturn v\n\t})\n\treduceProperty(\"whileTapRotateX\", result, node)\n\treduceProperty(\"whileTapRotateY\", result, node)\n\treduceProperty(\"whileTapSkewX\", result, node)\n\treduceProperty(\"whileTapSkewY\", result, node)\n\treduceProperty(\"whileTapBackgroundColor\", result, node)\n\n\tresult.whileTapTransition = getReducedEffectTransition(node.whileTapTransition, result.whileTapTransition)\n\n\tconst shadow = node.whileTapBoxShadow\n\n\tif (isUndefined(shadow)) {\n\t\tresult.whileTapBoxShadowCount = 0\n\t\treturn\n\t} else if (result.whileTapBoxShadowCount === 0) {\n\t\tresult.whileTapBoxShadowCount = Mixed\n\t} else {\n\t\tresult.whileTapBoxShadowCount = 1\n\t}\n\n\tif (isNotFound(result.whileTapBoxShadow)) {\n\t\tresult.whileTapBoxShadow = {\n\t\t\tid: shadow.id,\n\t\t\ttype: shadow.type,\n\t\t\tcolor: shadow.color,\n\t\t\tx: shadow.x,\n\t\t\ty: shadow.y,\n\t\t\tblur: shadow.blur,\n\t\t\tinset: shadow.inset,\n\t\t\tspread: shadow.spread,\n\t\t\tdiffusion: shadow.diffusion,\n\t\t\tfocus: shadow.focus,\n\t\t}\n\t} else {\n\t\tcombineShadows(result.whileTapBoxShadow, shadow)\n\t}\n}\n", "import type { CanvasNode } from \"../../index.ts\"\nimport { isVariant } from \"../WithVariant.ts\"\nimport type { WithZIndex } from \"../WithZIndex.ts\"\nimport { withZIndex } from \"../WithZIndex.ts\"\nimport type { ReducedRecord } from \"./Reduced.ts\"\nimport { reduceProperty } from \"./reduceProperty.ts\"\n\nexport type ReducedZIndex = ReducedRecord<WithZIndex>\n\nexport function reduceZIndex(node: CanvasNode, result: ReducedZIndex): void {\n\tif (!withZIndex(node) || isVariant(node)) return\n\n\treduceProperty(\"zIndex\", result, node)\n}\n", "import type { ComponentLoader } from \"@framerjs/framer-runtime\"\nimport type { ModuleExportIdentifierString } from \"@framerjs/shared\"\nimport { withAutoSize } from \"document/models/CanvasTree/traits/WithAutoSize.ts\"\nimport { reduceCodeComponents, withCodeComponent } from \"document/models/CanvasTree/traits/WithCodeComponent.ts\"\nimport type { ReducedOverrides } from \"document/models/CanvasTree/traits/WithCodeOverride.ts\"\nimport { reduceOverride } from \"document/models/CanvasTree/traits/WithCodeOverride.ts\"\nimport type { WithExport } from \"document/models/CanvasTree/traits/WithExport.ts\"\nimport type { ReducedPolygon } from \"document/models/CanvasTree/traits/WithPolygon.ts\"\nimport { reducePolygon } from \"document/models/CanvasTree/traits/WithPolygon.ts\"\nimport type { ReducedRadius } from \"document/models/CanvasTree/traits/WithRadius.ts\"\nimport {\n\tgetReducedRadiusDefaults,\n\treduceRadius,\n\twithRelativeRadius,\n} from \"document/models/CanvasTree/traits/WithRadius.ts\"\nimport type { ReducedRotation } from \"document/models/CanvasTree/traits/WithRotation.ts\"\nimport { reduceRotation } from \"document/models/CanvasTree/traits/WithRotation.ts\"\nimport { withShape } from \"document/models/CanvasTree/traits/WithShape.ts\"\nimport type { ReducedSizeToFit } from \"document/models/CanvasTree/traits/WithSizeToFit.ts\"\nimport { reduceSizeToFit } from \"document/models/CanvasTree/traits/WithSizeToFit.ts\"\nimport type { ReducedSpikes } from \"document/models/CanvasTree/traits/WithSpikes.ts\"\nimport { reduceSpikes } from \"document/models/CanvasTree/traits/WithSpikes.ts\"\nimport { isReplica, isReplicaChild } from \"document/models/CanvasTree/traits/WithTemplate.ts\"\nimport { isAutoSizedOnBothDimensions } from \"document/models/CanvasTree/traits/utils/autoSizeHelpers.ts\"\nimport { expandSelectionForShapeProperties } from \"document/models/CanvasTree/traits/utils/expandSelectionForShapeProperties.ts\"\nimport type { ReducedAspectRatio } from \"document/models/CanvasTree/traits/utils/reduceAspectRatio.ts\"\nimport { reduceAspectRatio } from \"document/models/CanvasTree/traits/utils/reduceAspectRatio.ts\"\nimport type { ReducedBlending } from \"document/models/CanvasTree/traits/utils/reduceBlending.ts\"\nimport { reduceBlending } from \"document/models/CanvasTree/traits/utils/reduceBlending.ts\"\nimport type { ReducedBorder } from \"document/models/CanvasTree/traits/utils/reduceBorder.ts\"\nimport { getReducedBorderDefaults, reduceBorder } from \"document/models/CanvasTree/traits/utils/reduceBorder.ts\"\nimport type { ReducedFill } from \"document/models/CanvasTree/traits/utils/reduceFill.ts\"\nimport { getReducedFillDefaults, reduceFill } from \"document/models/CanvasTree/traits/utils/reduceFill.ts\"\nimport type { ReducedOpacity } from \"document/models/CanvasTree/traits/utils/reduceOpacity.ts\"\nimport { reduceOpacity } from \"document/models/CanvasTree/traits/utils/reduceOpacity.ts\"\nimport type { ReducedPins } from \"document/models/CanvasTree/traits/utils/reducePins.ts\"\nimport { reducePins } from \"document/models/CanvasTree/traits/utils/reducePins.ts\"\nimport type { ReducedStroke } from \"document/models/CanvasTree/traits/utils/reduceStroke.ts\"\nimport { reduceStroke } from \"document/models/CanvasTree/traits/utils/reduceStroke.ts\"\nimport type { ReducedStrokeEffect } from \"document/models/CanvasTree/traits/utils/reduceStrokeEffect.ts\"\nimport {\n\ttype ReducedTextTruncation,\n\treduceTextTruncation,\n} from \"document/models/CanvasTree/traits/utils/reduceTextTruncation.ts\"\nimport type { ModulesStore } from \"document/stores/ModulesStore.ts\"\nimport type { ScopeType } from \"document/utils/scopeType.ts\"\nimport { isEqual } from \"library/index.ts\"\nimport { isUndefined } from \"library/utils/utils.ts\"\nimport { isCollectionRepeaterDescendent, isRepeatedCollectionItemDescendant } from \"utils/isRepeaterDescendent.ts\"\nimport { allVectorInstancesFromSameSet } from \"utils/vectorSets.ts\"\nimport type { CanvasTree } from \"../../index.ts\"\nimport { isVectorNode } from \"../../index.ts\"\nimport type { CanvasNode } from \"../../nodes/CanvasNode.ts\"\nimport type CodeComponentNode from \"../../nodes/CodeComponentNode.ts\"\nimport type { ExportOptions } from \"../../nodes/ExportOptions.ts\"\nimport type { NodeID } from \"../../nodes/NodeID.ts\"\nimport type ShaderNode from \"../../nodes/ShaderNode.ts\"\nimport { isInlineVectorNode } from \"../../nodes/TreeNode.ts\"\nimport { isAnyTextNode } from \"../../nodes/utils/isAnyTextNode.ts\"\nimport {\n\tisDataRepeater,\n\tisFrameNode,\n\tisRichTextNode,\n\tisShaderNode,\n\tisShapeContainerNode,\n\tisSlotPropertyNode,\n\tisTextNode,\n} from \"../../nodes/utils/nodeCheck.ts\"\nimport { allVariableKeysRecord } from \"../../utils/allVariableKeys.ts\"\nimport type { VariableReference } from \"../VariableReference.ts\"\nimport { type ReducedCornerShape, reduceCornerShape } from \"../WithCornerShape.ts\"\nimport type { ReducedCustomizations } from \"../WithCustomizations.ts\"\nimport { reduceCustomizations } from \"../WithCustomizations.ts\"\nimport type { ReducedDataLoaderVariants } from \"../WithDataLoaderVariants.ts\"\nimport { reduceDataLoaderVariants } from \"../WithDataLoaderVariants.ts\"\nimport { hasImageFill, supportsConicGradient } from \"../WithFill.ts\"\nimport type { ReducedFormVariants } from \"../WithFormVariants.ts\"\nimport { reduceFormVariants } from \"../WithFormVariants.ts\"\nimport type { ReducedFramePresets } from \"../WithFramePreset.ts\"\nimport { reduceFramePreset } from \"../WithFramePreset.ts\"\nimport { isBreakpointWithLayoutTemplate } from \"../WithLayoutTemplate.ts\"\nimport { withPositionType } from \"../WithPositionType.ts\"\nimport type { ReducedRadiusPerCorner } from \"../WithRadiusPerCorner.ts\"\nimport { getReducedRadiusPerCornerDefaults, reduceRadiusPerCorner } from \"../WithRadiusPerCorner.ts\"\nimport { isScreen } from \"../WithScreen.ts\"\nimport { reduceShaders } from \"../WithShader.ts\"\nimport {\n\tisBreakpointVariant,\n\tisGestureVariant,\n\tisReplicaVariantOrReplicaVariantChild,\n\tisVariant,\n} from \"../WithVariant.ts\"\nimport { type ReducedViewTransitionNone, reduceViewTransitionNone } from \"../WithViewTransitionNone.ts\"\nimport type { ReducedVisibility } from \"../WithVisibility.ts\"\nimport { reduceVisibility } from \"../WithVisibility.ts\"\nimport type { ReducedWhileOpenEffect } from \"../WithWhileOpenEffect.ts\"\nimport { reduceWhileOpenEffect } from \"../WithWhileOpenEffect.ts\"\nimport { NotFound, type Reduced } from \"./Reduced.ts\"\nimport { isStylableNode } from \"./hardCodedCodeComponentIdentifierChecks.ts\"\nimport type { ReducedA11ySupport } from \"./reduceA11ySupport.ts\"\nimport { reduceAnyNodesWithA11ySupport } from \"./reduceA11ySupport.ts\"\nimport type { ReducedAltText } from \"./reduceAltText.ts\"\nimport { getReducedAltTextDefaults, reduceAltText } from \"./reduceAltText.ts\"\nimport type { ReducedAriaLabel } from \"./reduceAriaLabel.ts\"\nimport { reduceAriaLabel } from \"./reduceAriaLabel.ts\"\nimport type { ReducedBackdrop } from \"./reduceBackdrop.ts\"\nimport { reduceBackdrop } from \"./reduceBackdrop.ts\"\nimport type { ReducedCodeOverrides } from \"./reduceCodeOverrides.ts\"\nimport { reduceCodeOverrides } from \"./reduceCodeOverrides.ts\"\nimport type { ReducedCollectionOptions } from \"./reduceCollectionOptions.ts\"\nimport { reduceCollectionOptions } from \"./reduceCollectionOptions.ts\"\nimport { reduceControlProps } from \"./reduceControlProps.ts\"\nimport type { ReducedControlPropsWithIdentifier } from \"./reduceControlPropsWithIdentifier.ts\"\nimport type { ReducedCurrentVariantSize } from \"./reduceCurrentVariantSize.ts\"\nimport { reduceCurrentVariantSize } from \"./reduceCurrentVariantSize.ts\"\nimport type { ReducedCursor } from \"./reduceCursor.ts\"\nimport { reduceCursor } from \"./reduceCursor.ts\"\nimport type { ReducedDataNosnippet } from \"./reduceDataNosnippet.ts\"\nimport { reduceDataNosnippet } from \"./reduceDataNosnippet.ts\"\nimport { type ReducedDataRepeaterArray, reduceDataRepeaterArray } from \"./reduceDataRepeaterArray.ts\"\nimport type { ReducedDataRepeaterId } from \"./reduceDataRepeaterOriginalId.ts\"\nimport { reduceDataRepeaterId } from \"./reduceDataRepeaterOriginalId.ts\"\nimport type { ReducedDataSource } from \"./reduceDataSource.ts\"\nimport { reduceDataSource } from \"./reduceDataSource.ts\"\nimport type { ReducedDragEffect } from \"./reduceDragEffect.ts\"\nimport { reduceDragEffect } from \"./reduceDragEffect.ts\"\nimport type { ReducedDraggable } from \"./reduceDraggable.ts\"\nimport { reduceDraggable } from \"./reduceDraggable.ts\"\nimport {\n\ttype ReducedEnabledVariableProperties,\n\treduceEnabledVariableProperties,\n} from \"./reduceEnabledVariableProperties.ts\"\nimport { type ReducedFillOpacity, reduceFillOpacity } from \"./reduceFillOpacity.ts\"\nimport type { ReducedFilters } from \"./reduceFilters.ts\"\nimport { reduceFilters } from \"./reduceFilters.ts\"\nimport type { ReducedFloatingPosition } from \"./reduceFloatingPosition.ts\"\nimport { reduceFloatingPosition } from \"./reduceFloatingPosition.ts\"\nimport type { ReducedFlowEffect } from \"./reduceFlowEffect.ts\"\nimport { reduceFlowEffect } from \"./reduceFlowEffect.ts\"\nimport type { ReducedFormBooleanInputType } from \"./reduceFormBooleanInputType.ts\"\nimport { reduceFormBooleanInputType } from \"./reduceFormBooleanInputType.ts\"\nimport type { ReducedFormContainer } from \"./reduceFormContainer.ts\"\nimport { reduceFormContainer } from \"./reduceFormContainer.ts\"\nimport type { ReducedFormInput } from \"./reduceFormInput.ts\"\nimport { reduceFormInput } from \"./reduceFormInput.ts\"\nimport type { ReducedFormInputAutofillEnabled } from \"./reduceFormInputAutofillEnabled.ts\"\nimport { reduceFormInputAutofillEnabled } from \"./reduceFormInputAutofillEnabled.ts\"\nimport type { ReducedFormInputFocusedStyles } from \"./reduceFormInputFocusedStyles.ts\"\nimport { reduceFormInputFocusedStyles } from \"./reduceFormInputFocusedStyles.ts\"\nimport type { ReducedFormInputIcon } from \"./reduceFormInputIcon.ts\"\nimport { reduceFormInputIcon } from \"./reduceFormInputIcon.ts\"\nimport type { ReducedFormInputInvalidStyles } from \"./reduceFormInputInvalidStyles.ts\"\nimport { reduceFormInputInvalidStyles } from \"./reduceFormInputInvalidStyles.ts\"\nimport type { ReducedFormInputPlaceholder } from \"./reduceFormInputPlaceholder.ts\"\nimport { reduceFormInputPlaceholder } from \"./reduceFormInputPlaceholder.ts\"\nimport type { ReducedFormInputStep } from \"./reduceFormInputStep.ts\"\nimport { reduceFormInputStep } from \"./reduceFormInputStep.ts\"\nimport type { ReducedFormInputFontStyles } from \"./reduceFormInputStyles.ts\"\nimport { reduceFormInputFontStyles } from \"./reduceFormInputStyles.ts\"\nimport type { ReducedFormSelect } from \"./reduceFormSelect.ts\"\nimport { reduceFormSelect } from \"./reduceFormSelect.ts\"\nimport type { ReducedFormTextInputType } from \"./reduceFormTextInputType.ts\"\nimport { reduceFormTextInputType } from \"./reduceFormTextInputType.ts\"\nimport type { ReducedGridItemLayout } from \"./reduceGridItemLayout.ts\"\nimport { reduceGridItemLayout } from \"./reduceGridItemLayout.ts\"\nimport type { ReducedGridItemSize } from \"./reduceGridItemSize.ts\"\nimport { reduceGridItemSize } from \"./reduceGridItemSize.ts\"\nimport type { ReducedOverlayGrids } from \"./reduceGrids.ts\"\nimport { reduceOverlayGrids } from \"./reduceGrids.ts\"\nimport type { ReducedHTMLTags } from \"./reduceHTMLTags.ts\"\nimport { reduceHTMLTags } from \"./reduceHTMLTags.ts\"\nimport type { ReducedOverlayTriggerNodes } from \"./reduceHasOverlay.ts\"\nimport { reduceHasOverlay } from \"./reduceHasOverlay.ts\"\nimport { type ReducedImageRendering, reduceImageRendering } from \"./reduceImageRendering.ts\"\nimport type { ReducedLayout } from \"./reduceLayout.ts\"\nimport { reduceLayout } from \"./reduceLayout.ts\"\nimport { reduceLayoutTemplateControlProps } from \"./reduceLayoutTemplateControlProps.ts\"\nimport type { ReducedLightboxEffect } from \"./reduceLightboxEffect.ts\"\nimport { reduceLightboxEffect } from \"./reduceLightboxEffect.ts\"\nimport type { ReducedLink } from \"./reduceLink.ts\"\nimport { reduceLink } from \"./reduceLink.ts\"\nimport type { ReducedLoopEffect } from \"./reduceLoopEffect.ts\"\nimport { reduceLoopEffect } from \"./reduceLoopEffect.ts\"\nimport type { ReducedMasks } from \"./reduceMasks.ts\"\nimport { reduceMasks } from \"./reduceMasks.ts\"\nimport type { ReducedOverflow } from \"./reduceOverflow.ts\"\nimport { reduceOverflow } from \"./reduceOverflow.ts\"\nimport type { ReducedOverlayTriggerEvent } from \"./reduceOverlayTriggerEvent.ts\"\nimport { reduceOverlayTriggerEvent } from \"./reduceOverlayTriggerEvent.ts\"\nimport type { ReducedOverscrollBehavior } from \"./reduceOverscrollBehavior.ts\"\nimport { reduceOverscrollBehavior } from \"./reduceOverscrollBehavior.ts\"\nimport type { ReducedPadding } from \"./reducePadding.ts\"\nimport { reducePadding } from \"./reducePadding.ts\"\nimport type { ReducedPageEffects } from \"./reducePageEffect.ts\"\nimport { reducePageEffects } from \"./reducePageEffect.ts\"\nimport type { ReducedParallax } from \"./reduceParallax.ts\"\nimport { reduceParallax } from \"./reduceParallax.ts\"\nimport type { ReducedPointerEvents } from \"./reducePointerEvents.ts\"\nimport { reducePointerEvents } from \"./reducePointerEvents.ts\"\nimport type { ReducedPositionType } from \"./reducePositionType.ts\"\nimport { reducePositionType } from \"./reducePositionType.ts\"\nimport { type ReducedRepeatArray, reduceRepeatArray } from \"./reduceRepeatArray.ts\"\nimport type { ReducedRepeatId } from \"./reduceRepeatOriginalId.ts\"\nimport { reduceRepeatId } from \"./reduceRepeatOriginalId.ts\"\nimport type { ReducedResizeToFitContentAction } from \"./reduceResizeToFitContentAction.ts\"\nimport { reduceResizeToFitContentAction } from \"./reduceResizeToFitContentAction.ts\"\nimport { type ReducedRootFontSize, reduceRootFontSize } from \"./reduceRootFontSize.ts\"\nimport type { ReducedScrollTarget } from \"./reduceScrollTarget.ts\"\nimport { reduceScrollTarget } from \"./reduceScrollTarget.ts\"\nimport type { ReducedScrollbars } from \"./reduceScrollbars.ts\"\nimport { reduceScrollbars } from \"./reduceScrollbars.ts\"\nimport { type ReducedSelectionProperties, reduceSelectionProperties } from \"./reduceSelectionProperties.ts\"\nimport type { ReducedShaderMouse } from \"./reduceShaderMouse.ts\"\nimport { reduceShaderMouse } from \"./reduceShaderMouse.ts\"\nimport type { ReducedShadows } from \"./reduceShadows.ts\"\nimport { reduceShadows } from \"./reduceShadows.ts\"\nimport type { ReducedSizeProperties } from \"./reduceSize.ts\"\nimport { reduceSize } from \"./reduceSize.ts\"\nimport type { ReducedSizeConstraints } from \"./reduceSizeConstraints.ts\"\nimport { reduceSizeConstraints } from \"./reduceSizeConstraints.ts\"\nimport { reduceStrokeEffect } from \"./reduceStrokeEffect.ts\"\nimport type { ReducedStyleAppearEffect } from \"./reduceStyleAppearEffect.ts\"\nimport { reduceStyleAppearEffect } from \"./reduceStyleAppearEffect.ts\"\nimport type { ReducedStyleTransformEffect } from \"./reduceStyleTransformEffect.ts\"\nimport { reduceStyleTransformEffect } from \"./reduceStyleTransformEffect.ts\"\nimport type { ReducedTabIndex } from \"./reduceTabIndex.ts\"\nimport { reduceTabIndex } from \"./reduceTabIndex.ts\"\nimport { type ReducedTapHighlight, reduceTapHighlight } from \"./reduceTapHighlight.ts\"\nimport type { TextProperties } from \"./reduceText.ts\"\nimport { reduceText } from \"./reduceText.ts\"\nimport type { ReducedTextEffect } from \"./reduceTextEffect.ts\"\nimport { reduceTextEffect } from \"./reduceTextEffect.ts\"\nimport { type ReducedTextSelection, reduceTextSelection } from \"./reduceTextSelection.ts\"\nimport { type ReducedTickerEffect, reduceTickerEffect } from \"./reduceTickerEffect.ts\"\nimport type { ReducedTitleAndDescription } from \"./reduceTitleAndDescription.ts\"\nimport { reduceTitleAndDescription } from \"./reduceTitleAndDescription.ts\"\nimport { type ReducedTrackingIdAIPrompt, reduceTrackingIdAIPrompt } from \"./reduceTrackingIdAIPrompt.ts\"\nimport type { ReducedTransforms } from \"./reduceTransforms.ts\"\nimport { reduceTransforms } from \"./reduceTransforms.ts\"\nimport type { ReducedTransition } from \"./reduceTransition.ts\"\nimport { reduceTransition } from \"./reduceTransition.ts\"\nimport { type ReducedTriggerActions, reduceTriggerActions } from \"./reduceTriggerActions.ts\"\nimport type { ReducedUserSelect } from \"./reduceUserSelect.ts\"\nimport { reduceUserSelect } from \"./reduceUserSelect.ts\"\nimport { type ReducedVariableBinding, reduceVariableBinding } from \"./reduceVariableBinding.ts\"\nimport type { ReducedVariantAppearEffect } from \"./reduceVariantAppearEffect.ts\"\nimport { reduceVariantAppearEffect } from \"./reduceVariantAppearEffect.ts\"\nimport type { ReducedVariantOverrides } from \"./reduceVariantOverrides.ts\"\nimport { reduceVariantOverrides } from \"./reduceVariantOverrides.ts\"\nimport type { ReducedHoverEffect } from \"./reduceWhileHover.ts\"\nimport { reduceHoverEffect } from \"./reduceWhileHover.ts\"\nimport type { ReducedPressEffect } from \"./reduceWhileTap.ts\"\nimport { reducePressEffect } from \"./reduceWhileTap.ts\"\nimport type { ReducedZIndex } from \"./reduceZIndex.ts\"\nimport { reduceZIndex } from \"./reduceZIndex.ts\"\n\n/**\n * Once each section in the properties panel did their own loop over all selected nodes to figure out what values to render. The amount\n * of loops became a performance issue as well as each section having to render before knowing if anything changed. This reducer is the\n * solution to that problem. Because all properties are reduced in one go, all UI can be memoized.\n *\n * In theory we only need a single loop over all selected nodes to know the values we have to render. There are very few exceptions to\n * this rule. Within this single loop we call trait reducer functions that receive a single node and the reducer result object. Most of the\n * reduced properties use the same key as the one of the trait. The value type can be of the trait property as well as NotFound or Mixed.\n * NotFound in this case means that none of the selected nodes have the trait, when all nodes share a common value the reduced value will\n * match the original type, and when different nodes have different values - the value becomes Mixed.\n *\n * Example 1:\n * selection: nodeA { opacity: 1 }, nodeB { opacity: 1 } (both have the opacity trait)\n * result: {opacity: 1}\n * rendering: input with the number 1\n *\n * Example 2:\n * selection: nodeA { }, nodeB { } (none has the opacity trait)\n * result: { opacity: NotFound }\n * rendering: no input because none of the selected nodes have opacity\n *\n * Example 3:\n * selection: nodeA { opacity: 1 }, nodeB { opacity: 0.5 } (both have the opacity trait)\n * result: { opacity: Mixed }\n * rendering: input without visible value\n */\n\nlet lastReducePropertiesResult: Readonly<Properties> | undefined\n\nexport function reduceProperties(\n\ttree: CanvasTree,\n\tdataTree: CanvasTree,\n\tcomponentLoader: ComponentLoader,\n\tnodes: CanvasNode[],\n\tscopeType?: ScopeType,\n\tdisplayGrids?: boolean,\n\tmodulesStore?: ModulesStore,\n): Readonly<Properties> {\n\tconst result = getPropertiesDefaults()\n\n\tif (nodes.length === 0) {\n\t\tresult.onlyBreakpointNodes = false\n\t\tresult.onlyGroundNodes = false\n\t\tresult.onlyTextNodes = false\n\t\tresult.onlyShapeNodes = false\n\t\tresult.onlyShapeAndGraphicNodes = false\n\t\tresult.onlyFrameNodes = false\n\t\tresult.onlyScreenNodes = false\n\t\tresult.onlyCanvasFrameNodes = false\n\t\tresult.onlyRelativeRadiusNodes = false\n\t\tresult.onlyNodesWithPositionType = false\n\t\tresult.onlyNodesWithCursor = false\n\t\tresult.onlyCodeComponentNodes = false\n\t\tresult.onlyShaderNodes = false\n\t\tresult.onlyShapeContainerNodes = false\n\t\tresult.onlySlotPropertyNodes = false\n\t\tresult.onlyReplicas = false\n\t\tresult.onlyReplicasOrReplicaChildren = false\n\t\tresult.onlyVariants = false\n\t\tresult.onlyNonGestureVariants = false\n\t\tresult.onlyNodesWithLayout = false\n\t\tresult.onlyNodesWithSpikes = false\n\t\tresult.onlyPolygonNodes = false\n\t\tresult.anyReplicaOrReplicaChild = false\n\t\tresult.onlyFormContainerNodes = false\n\t\tresult.onlyFormInputNodes = false\n\t\tresult.onlyNodesWithTextInputType = false\n\t\tresult.onlyNodesWithSelect = false\n\t\tresult.onlyFormInputNodesWithPlaceholder = false\n\t\tresult.onlyFormInputNodesWithPlaceholderColor = false\n\t\tresult.onlyNodesWithFormInputInvalidStyles = false\n\t\tresult.anyReplicaVariantOrReplicaVariantChild = false\n\t\tresult.onlyNodesInsideStackOrGrid = false\n\t\tresult.onlyGroundNodeDescendants = false\n\t\tresult.onlyNodesWithParallax = false\n\t\tresult.onlyNodesWithVariantAppearEffect = false\n\t\tresult.onlyNodesWithStyleAppearEffect = false\n\t\tresult.onlyNodesWithLinks = false\n\t\tresult.onlyNodesWithLinkSupportingComputedValues = false\n\t\tresult.onlyNodesWithLinkOptions = false\n\t\tresult.onlyGridItemNodes = false\n\t\tresult.onlyNodesSupportingConicGradient = false\n\t\tresult.onlyNodesSupportingShadowSpread = false\n\t\tresult.onlyNodesSupportingRealisticShadows = false\n\t\tresult.onlyNodesSupportingShadowInset = false\n\t\tresult.onlyNodesWithCustomizations = false\n\t\tresult.onlyNodesWithFloatingPosition = false\n\t\tresult.onlyNodesWithMask = false\n\t\tresult.anyFormInputNodes = false\n\t\tresult.onlyNodesSupportingOverlayTrigger = false\n\t\tresult.onlyNodesWithTapHighlight = false\n\t\tresult.onlyNodesWithTextSelection = false\n\t\tresult.onlyNodesWithImageRendering = false\n\t\tresult.onlyNodesWithTriggerActions = false\n\t}\n\n\t// We use for-loop instead of for-of because it is faster with large numbers. reduceProperties\n\t// can be called at 60fps, for example when the user is dragging a selection of nodes.\n\tfor (let i = 0, il = nodes.length; i < il; i++) {\n\t\tconst node = nodes[i]\n\t\tif (!node) continue\n\n\t\tresult.allNodeIds.push(node.id)\n\t\tresult.allOriginalIds.push(node.getPrimaryId())\n\n\t\treduceAriaLabel(node, result)\n\t\treduceLink(dataTree, node, result)\n\t\treduceLayout(tree, componentLoader, node, result)\n\t\treduceGridItemLayout(tree, node, result)\n\t\treduceGridItemSize(node, result)\n\t\treducePadding(node, result)\n\t\treducePageEffects(node, result)\n\t\treduceFramePreset(node, result)\n\t\treduceOverflow(node, result)\n\t\treduceOverscrollBehavior(node, result)\n\t\treduceInstanceTypes(tree, node, result)\n\t\treduceAspectRatio(node, result)\n\t\treduceOpacity(node, result)\n\t\treduceFillOpacity(node, result)\n\t\treduceBorder(node, result)\n\t\treduceFilters(node, result)\n\t\treduceFloatingPosition(tree, node, result)\n\n\t\t// Forms\n\t\treduceFormContainer(tree, node, result)\n\t\treduceFormInput(node, result)\n\t\treduceFormInputAutofillEnabled(node, result)\n\t\treduceFormInputInvalidStyles(node, result)\n\t\treduceFormInputPlaceholder(node, result)\n\t\treduceFormSelect(tree, node, result)\n\t\treduceFormTextInputType(node, result)\n\t\treduceFormInputIcon(node, result)\n\t\treduceFormInputFontStyles(node, result)\n\t\treduceFormInputFocusedStyles(node, result)\n\t\treduceFormInputStep(node, result)\n\t\treduceFormVariants(tree, node, result)\n\t\treduceFormBooleanInputType(node, result)\n\t\treduceVariableBinding(node, result)\n\n\t\treduceDataLoaderVariants(tree, componentLoader, node, result)\n\n\t\treduceBlending(node, result)\n\t\treduceCodeComponents(node, result)\n\t\treduceShaders(node, result)\n\t\treduceShaderMouse(node, result)\n\t\treduceCursor(tree, node, result)\n\t\treduceOverride(node, result)\n\t\treduceSizeToFit(node, result)\n\t\treduceResizeToFitContentAction(node, componentLoader, result)\n\t\treduceAutoSize(node, result)\n\t\treduceCurrentVariantSize(node, componentLoader, result)\n\t\treduceParallax(node, result)\n\t\treduceVariantAppearEffect(node, tree, componentLoader, result)\n\t\treduceStyleAppearEffect(node, result)\n\t\treduceTextEffect(node, result)\n\t\treduceStyleTransformEffect(node, result)\n\t\treduceSizeConstraints(node, result)\n\t\treduceScrollTarget(node, result)\n\t\treduceHTMLTags(dataTree, node, result)\n\t\treduceAltText(node, result)\n\t\treduceTitleAndDescription(node, result)\n\t\treduceTabIndex(node, result)\n\t\treduceDataNosnippet(node, result)\n\t\treduceUserSelect(node, result)\n\t\treduceZIndex(node, result)\n\t\treducePointerEvents(node, result)\n\t\treduceDataSource(node, result)\n\t\treduceDataRepeaterArray(node, result)\n\t\treduceRepeatArray(node, result)\n\t\treduceHasOverlay(node, result)\n\t\treduceBackdrop(node, result)\n\t\treducePositionType(tree, node, result)\n\t\treduceDragEffect(node, result)\n\t\treduceFlowEffect(tree, node, result, scopeType)\n\t\treduceLoopEffect(node, result)\n\t\treduceHoverEffect(node, result)\n\t\treducePressEffect(node, result)\n\t\treduceStrokeEffect(tree, node, result)\n\t\treduceScrollbars(node, result)\n\t\treduceCustomizations(tree, node, result)\n\t\treduceTransforms(node, result)\n\t\treduceTransition(node, result)\n\t\treduceWhileOpenEffect(node, result)\n\t\treduceAnyNodesWithA11ySupport(node, result)\n\t\treduceMasks(node, result)\n\t\treduceDraggable(node, result)\n\t\treduceTapHighlight(node, result)\n\t\treduceViewTransitionNone(tree, node, result)\n\t\treduceTextSelection(node, result)\n\t\treduceTextTruncation(node, result)\n\t\treduceImageRendering(node, result)\n\t\treduceRootFontSize(node, result)\n\t\treduceEnabledVariableProperties(node, result, scopeType)\n\t\treduceLightboxEffect(node, result)\n\t\treduceTickerEffect(node, result)\n\t\treduceTriggerActions(node, result)\n\n\t\tif (Boolean(node.cache.parentDirected) !== true) {\n\t\t\tresult.onlyNodesInsideStackOrGrid = false\n\t\t}\n\n\t\tif (!supportsConicGradient(node)) {\n\t\t\tresult.onlyNodesSupportingConicGradient = false\n\t\t}\n\n\t\tif (tree.isGroundNode(node)) {\n\t\t\tresult.onlyGroundNodeDescendants = false\n\t\t} else {\n\t\t\tresult.onlyGroundNodes = false\n\t\t}\n\n\t\tresult.anyBreakpointsWithLayoutTemplate ||= isBreakpointWithLayoutTemplate(node)\n\n\t\tif (result.onlyNodesInsideCollectionRepeater && !isCollectionRepeaterDescendent(tree, node)) {\n\t\t\tresult.onlyNodesInsideCollectionRepeater = false\n\t\t}\n\n\t\tif (result.onlyRepeatedNodes && !isRepeatedCollectionItemDescendant(tree, node)) {\n\t\t\tresult.onlyRepeatedNodes = false\n\t\t}\n\t}\n\n\treduceVariantOverrides(tree, nodes, result)\n\treduceCodeOverrides(nodes, result)\n\treduceOverlayTriggerEvent(tree, componentLoader, nodes, result)\n\n\tif (result.onlyBreakpointNodes) {\n\t\treduceLayoutTemplateControlProps(tree, componentLoader, nodes, result, lastReducePropertiesResult)\n\t}\n\n\tif (result.onlyCodeComponentNodes) {\n\t\t// Reduce code component props if a single type of code component is selected or if all selected nodes are vector instances from the same set\n\t\tif (\n\t\t\tresult.codeComponentIdentifiers.size === 1 ||\n\t\t\t(!isUndefined(modulesStore) && allVectorInstancesFromSameSet(tree, nodes, modulesStore))\n\t\t) {\n\t\t\treduceControlProps(componentLoader, nodes as CodeComponentNode[], result, lastReducePropertiesResult)\n\t\t}\n\n\t\tresult.canSetSizeToDefault = nodes.some((node: CodeComponentNode) => !node.hasPreferredSize(componentLoader))\n\t}\n\n\tif (result.onlyShaderNodes) {\n\t\tif (result.shaderModuleIdentifiers.size === 1) {\n\t\t\treduceControlProps(componentLoader, nodes as ShaderNode[], result, lastReducePropertiesResult)\n\t\t}\n\t}\n\n\treduceText(tree, nodes, result)\n\treduceCollectionOptions(nodes, result)\n\treduceDataRepeaterId(nodes, result)\n\treduceRepeatId(nodes, result)\n\treduceTrackingIdAIPrompt(tree, nodes, result)\n\n\tconst [expandedSelectionForShapeStyles, reducedSelectionForShapeStyles, expandedSelectionForShapeGeometry] =\n\t\texpandSelectionForShapeProperties(tree, nodes)\n\n\tfor (let i = 0, il = reducedSelectionForShapeStyles.length; i < il; i++) {\n\t\tconst node = reducedSelectionForShapeStyles[i]\n\t\tif (!node) continue\n\n\t\tif (!result.anyStyleableNode && isStylableNode(node)) {\n\t\t\tresult.anyStyleableNode = true\n\t\t}\n\t\treduceFill(tree, node, result)\n\t\treduceStroke(node, result)\n\t\treduceShadows(node, result)\n\t}\n\n\tfor (let i = 0, il = expandedSelectionForShapeGeometry.length; i < il; i++) {\n\t\tconst node = expandedSelectionForShapeGeometry[i]\n\t\tif (!node) continue\n\n\t\treduceRadius(node, result)\n\t\treduceRadiusPerCorner(node, result)\n\t\treduceCornerShape(node, result)\n\t\treduceSpikes(node, result)\n\t\treducePolygon(node, result)\n\t}\n\n\tresult.selectionHash = result.allNodeIds.join(\"\")\n\tconst withoutDescendants = tree.withoutDescendants(nodes)\n\tresult.expandedSelectionForShapeGeometryIds = expandedSelectionForShapeGeometry.map(n => n.id)\n\tresult.expandedSelectionForShapeStylesIds = expandedSelectionForShapeStyles.map(n => n.id)\n\tresult.onlyCanvasFrameNodes = result.onlyCanvasFrameNodes && withoutDescendants.length === nodes.length\n\n\tresult.onlyNodesWithPageEffects =\n\t\t!result.anyBreakpointsWithLayoutTemplate &&\n\t\t!result.anyBreakpointNode &&\n\t\t(result.onlyNodesWithParallax ||\n\t\t\tresult.onlyNodesWithVariantAppearEffect ||\n\t\t\tresult.onlyNodesWithStyleAppearEffect ||\n\t\t\tresult.onlyNodesWithStyleTransformEffect ||\n\t\t\tresult.onlyNodesWithDragEffect ||\n\t\t\tresult.onlyNodesWithWhileHover ||\n\t\t\tresult.onlyNodesWithWhileTap ||\n\t\t\tresult.onlyNodesWithLoopEffect ||\n\t\t\tresult.onlyNodesWithFlowEffect ||\n\t\t\tresult.onlyNodesWithStrokeEffect)\n\n\tfor (let i = 0, il = withoutDescendants.length; i < il; i++) {\n\t\tconst node = withoutDescendants[i]\n\t\tif (!node) continue\n\n\t\tresult.withoutDescendantIds.push(node.id)\n\t\tresult.onlyCanvasFrameNodes = result.onlyCanvasFrameNodes && isFrameNode(node) && tree.isGroundNode(node)\n\t\treduceVisibility(node, result)\n\t\treducePins(tree, node, result)\n\t\treduceSize(tree, componentLoader, node, result)\n\t\treduceRotation(node, result)\n\t\treduceOverlayGrids(node, result, displayGrids)\n\t\treduceSelectionProperties(\n\t\t\tcomponentLoader,\n\t\t\tnode,\n\t\t\tresult,\n\t\t\tresult.selectionHash !== lastReducePropertiesResult?.selectionHash,\n\t\t)\n\t}\n\n\tif (lastReducePropertiesResult) {\n\t\tresult.selectionDidChange = result.selectionHash !== lastReducePropertiesResult.selectionHash\n\n\t\tif (isEqual(result.allNodeIds, lastReducePropertiesResult.allNodeIds)) {\n\t\t\tresult.allNodeIds = lastReducePropertiesResult.allNodeIds\n\t\t}\n\t\tif (isEqual(result.allOriginalIds, lastReducePropertiesResult.allOriginalIds)) {\n\t\t\tresult.allOriginalIds = lastReducePropertiesResult.allOriginalIds\n\t\t}\n\t\tif (isEqual(result.withoutDescendantIds, lastReducePropertiesResult.withoutDescendantIds)) {\n\t\t\tresult.withoutDescendantIds = lastReducePropertiesResult.withoutDescendantIds\n\t\t}\n\t\tif (\n\t\t\tisEqual(\n\t\t\t\tresult.expandedSelectionForShapeGeometryIds,\n\t\t\t\tlastReducePropertiesResult.expandedSelectionForShapeGeometryIds,\n\t\t\t)\n\t\t) {\n\t\t\tresult.expandedSelectionForShapeGeometryIds = lastReducePropertiesResult.expandedSelectionForShapeGeometryIds\n\t\t}\n\n\t\tif (isEqual(result.pageEffects, lastReducePropertiesResult.pageEffects)) {\n\t\t\tresult.pageEffects = lastReducePropertiesResult.pageEffects\n\t\t}\n\n\t\tif (\n\t\t\tisEqual(result.expandedSelectionForShapeStylesIds, lastReducePropertiesResult.expandedSelectionForShapeStylesIds)\n\t\t) {\n\t\t\tresult.expandedSelectionForShapeStylesIds = lastReducePropertiesResult.expandedSelectionForShapeStylesIds\n\t\t}\n\t\tif (isEqual(result.codeComponentIdentifiers, lastReducePropertiesResult.codeComponentIdentifiers)) {\n\t\t\tresult.codeComponentIdentifiers = lastReducePropertiesResult.codeComponentIdentifiers\n\t\t}\n\t\tif (isEqual(result.shaderModuleIdentifiers, lastReducePropertiesResult.shaderModuleIdentifiers)) {\n\t\t\tresult.shaderModuleIdentifiers = lastReducePropertiesResult.shaderModuleIdentifiers\n\t\t}\n\t\tif (isEqual(result.widthTypes, lastReducePropertiesResult.widthTypes)) {\n\t\t\tresult.widthTypes = lastReducePropertiesResult.widthTypes\n\t\t}\n\t\tif (isEqual(result.heightTypes, lastReducePropertiesResult.heightTypes)) {\n\t\t\tresult.heightTypes = lastReducePropertiesResult.heightTypes\n\t\t}\n\t\tif (isEqual(result.framePresetsInSelection, lastReducePropertiesResult.framePresetsInSelection)) {\n\t\t\tresult.framePresetsInSelection = lastReducePropertiesResult.framePresetsInSelection\n\t\t}\n\t\tif (isEqual(result.htmlTags, lastReducePropertiesResult.htmlTags)) {\n\t\t\tresult.htmlTags = lastReducePropertiesResult.htmlTags\n\t\t}\n\t\tif (isEqual(result.htmlTextTags, lastReducePropertiesResult.htmlTextTags)) {\n\t\t\tresult.htmlTextTags = lastReducePropertiesResult.htmlTextTags\n\t\t}\n\t\tif (\n\t\t\tisEqual(result.codeOverrideBareModuleIdentifiers, lastReducePropertiesResult.codeOverrideBareModuleIdentifiers)\n\t\t) {\n\t\t\tresult.codeOverrideBareModuleIdentifiers = lastReducePropertiesResult.codeOverrideBareModuleIdentifiers\n\t\t}\n\t\tif (isEqual(result.codeOverrideModuleExportNames, lastReducePropertiesResult.codeOverrideModuleExportNames)) {\n\t\t\tresult.codeOverrideModuleExportNames = lastReducePropertiesResult.codeOverrideModuleExportNames\n\t\t}\n\t\tif (isEqual(result.codeOverrides, lastReducePropertiesResult.codeOverrides)) {\n\t\t\tresult.codeOverrides = lastReducePropertiesResult.codeOverrides\n\t\t}\n\t\tif (isEqual(result.overlayGrid, lastReducePropertiesResult.overlayGrid)) {\n\t\t\tresult.overlayGrid = lastReducePropertiesResult.overlayGrid\n\t\t}\n\t\tif (isEqual(result.shadows, lastReducePropertiesResult.shadows)) {\n\t\t\tresult.shadows = lastReducePropertiesResult.shadows\n\t\t}\n\t\tif (isEqual(result.masks, lastReducePropertiesResult.masks)) {\n\t\t\tresult.masks = lastReducePropertiesResult.masks\n\t\t}\n\t\tif (isEqual(result.fillImageResize, lastReducePropertiesResult.fillImageResize)) {\n\t\t\tresult.fillImageResize = lastReducePropertiesResult.fillImageResize\n\t\t}\n\t\tif (isEqual(result.fillImages, lastReducePropertiesResult.fillImages)) {\n\t\t\tresult.fillImages = lastReducePropertiesResult.fillImages\n\t\t}\n\t\tif (isEqual(result.strokeAlignmentValues, lastReducePropertiesResult.strokeAlignmentValues)) {\n\t\t\tresult.strokeAlignmentValues = lastReducePropertiesResult.strokeAlignmentValues\n\t\t}\n\t\tif (isEqual(result.userSelect, lastReducePropertiesResult.userSelect)) {\n\t\t\tresult.userSelect = lastReducePropertiesResult.userSelect\n\t\t}\n\t\tif (isEqual(result.overflow, lastReducePropertiesResult.overflow)) {\n\t\t\tresult.overflow = lastReducePropertiesResult.overflow\n\t\t}\n\t\tif (isEqual(result.overscrollBehavior, lastReducePropertiesResult.overscrollBehavior)) {\n\t\t\tresult.overscrollBehavior = lastReducePropertiesResult.overscrollBehavior\n\t\t}\n\t\tif (isEqual(result.overflowX, lastReducePropertiesResult.overflowX)) {\n\t\t\tresult.overflowX = lastReducePropertiesResult.overflowX\n\t\t}\n\t\tif (isEqual(result.overflowY, lastReducePropertiesResult.overflowY)) {\n\t\t\tresult.overflowY = lastReducePropertiesResult.overflowY\n\t\t}\n\t\tif (isEqual(result.pointerEvents, lastReducePropertiesResult.pointerEvents)) {\n\t\t\tresult.pointerEvents = lastReducePropertiesResult.pointerEvents\n\t\t}\n\t\tif (isEqual(result.maxWidthUnits, lastReducePropertiesResult.maxWidthUnits)) {\n\t\t\tresult.maxWidthUnits = lastReducePropertiesResult.maxWidthUnits\n\t\t}\n\t\tif (isEqual(result.minWidthUnits, lastReducePropertiesResult.minWidthUnits)) {\n\t\t\tresult.minWidthUnits = lastReducePropertiesResult.minWidthUnits\n\t\t}\n\t\tif (isEqual(result.maxHeightUnits, lastReducePropertiesResult.maxHeightUnits)) {\n\t\t\tresult.maxHeightUnits = lastReducePropertiesResult.maxHeightUnits\n\t\t}\n\t\tif (isEqual(result.minHeightUnits, lastReducePropertiesResult.minHeightUnits)) {\n\t\t\tresult.minHeightUnits = lastReducePropertiesResult.minHeightUnits\n\t\t}\n\t\tif (isEqual(result.positionTypes, lastReducePropertiesResult.positionTypes)) {\n\t\t\tresult.positionTypes = lastReducePropertiesResult.positionTypes\n\t\t}\n\t\tif (isEqual(result.appearEffectTrigger, lastReducePropertiesResult.appearEffectTrigger)) {\n\t\t\tresult.appearEffectTrigger = lastReducePropertiesResult.appearEffectTrigger\n\t\t}\n\t\tif (isEqual(result.styleAppearEffectTrigger, lastReducePropertiesResult.styleAppearEffectTrigger)) {\n\t\t\tresult.styleAppearEffectTrigger = lastReducePropertiesResult.styleAppearEffectTrigger\n\t\t}\n\t\tif (isEqual(result.appearEffectVisibleVariantId, lastReducePropertiesResult.appearEffectVisibleVariantId)) {\n\t\t\tresult.appearEffectVisibleVariantId = lastReducePropertiesResult.appearEffectVisibleVariantId\n\t\t}\n\t\tif (isEqual(result.appearEffectObscuredVariantId, lastReducePropertiesResult.appearEffectObscuredVariantId)) {\n\t\t\tresult.appearEffectObscuredVariantId = lastReducePropertiesResult.appearEffectObscuredVariantId\n\t\t}\n\t\tif (isEqual(result.styleAppearEffectScrollTarget, lastReducePropertiesResult.styleAppearEffectScrollTarget)) {\n\t\t\tresult.styleAppearEffectScrollTarget = lastReducePropertiesResult.styleAppearEffectScrollTarget\n\t\t}\n\t\tif (\n\t\t\tisEqual(result.appearEffectScrollDirectionTarget, lastReducePropertiesResult.appearEffectScrollDirectionTarget)\n\t\t) {\n\t\t\tresult.appearEffectScrollDirectionTarget = lastReducePropertiesResult.appearEffectScrollDirectionTarget\n\t\t}\n\t\tif (isEqual(result.styleTransformEffectTrigger, lastReducePropertiesResult.styleTransformEffectTrigger)) {\n\t\t\tresult.styleTransformEffectTrigger = lastReducePropertiesResult.styleTransformEffectTrigger\n\t\t}\n\t\tif (\n\t\t\tisEqual(\n\t\t\t\tresult.styleAppearEffectScrollTargetCollectionItem,\n\t\t\t\tlastReducePropertiesResult.styleAppearEffectScrollTargetCollectionItem,\n\t\t\t)\n\t\t) {\n\t\t\tresult.styleAppearEffectScrollTargetCollectionItem =\n\t\t\t\tlastReducePropertiesResult.styleAppearEffectScrollTargetCollectionItem\n\t\t}\n\t\tif (\n\t\t\tisEqual(result.styleTransformEffectScrollTargets, lastReducePropertiesResult.styleTransformEffectScrollTargets)\n\t\t) {\n\t\t\tresult.styleTransformEffectScrollTargets = lastReducePropertiesResult.styleTransformEffectScrollTargets\n\t\t}\n\n\t\tif (isEqual(result.dragEffectTransition, lastReducePropertiesResult.dragEffectTransition)) {\n\t\t\tresult.dragEffectTransition = lastReducePropertiesResult.dragEffectTransition\n\t\t}\n\t\tif (isEqual(result.loopEffectTransition, lastReducePropertiesResult.loopEffectTransition)) {\n\t\t\tresult.loopEffectTransition = lastReducePropertiesResult.loopEffectTransition\n\t\t}\n\t\tif (isEqual(result.whileHoverTransition, lastReducePropertiesResult.whileHoverTransition)) {\n\t\t\tresult.whileHoverTransition = lastReducePropertiesResult.whileHoverTransition\n\t\t}\n\t\tif (isEqual(result.whileTapTransition, lastReducePropertiesResult.whileTapTransition)) {\n\t\t\tresult.whileTapTransition = lastReducePropertiesResult.whileTapTransition\n\t\t}\n\t\tif (isEqual(result.styleTransformEffectTransition, lastReducePropertiesResult.styleTransformEffectTransition)) {\n\t\t\tresult.styleTransformEffectTransition = lastReducePropertiesResult.styleTransformEffectTransition\n\t\t}\n\t\tif (isEqual(result.enterEffectTransition, lastReducePropertiesResult.enterEffectTransition)) {\n\t\t\tresult.enterEffectTransition = lastReducePropertiesResult.enterEffectTransition\n\t\t}\n\t\tif (isEqual(result.exitEffectTransition, lastReducePropertiesResult.exitEffectTransition)) {\n\t\t\tresult.exitEffectTransition = lastReducePropertiesResult.exitEffectTransition\n\t\t}\n\t\tif (isEqual(result.textEffectTransition, lastReducePropertiesResult.textEffectTransition)) {\n\t\t\tresult.textEffectTransition = lastReducePropertiesResult.textEffectTransition\n\t\t}\n\t\tif (isEqual(result.backdropEnterTransition, lastReducePropertiesResult.backdropEnterTransition)) {\n\t\t\tresult.backdropEnterTransition = lastReducePropertiesResult.backdropEnterTransition\n\t\t}\n\t\tif (isEqual(result.backdropExitTransition, lastReducePropertiesResult.backdropExitTransition)) {\n\t\t\tresult.backdropExitTransition = lastReducePropertiesResult.backdropExitTransition\n\t\t}\n\t\tif (isEqual(result.whileTapBoxShadow, lastReducePropertiesResult.whileTapBoxShadow)) {\n\t\t\tresult.whileTapBoxShadow = lastReducePropertiesResult.whileTapBoxShadow\n\t\t}\n\t\tif (isEqual(result.whileHoverBoxShadow, lastReducePropertiesResult.whileHoverBoxShadow)) {\n\t\t\tresult.whileHoverBoxShadow = lastReducePropertiesResult.whileHoverBoxShadow\n\t\t}\n\t\tif (isEqual(result.dragEffectConstraintItem, lastReducePropertiesResult.dragEffectConstraintItem)) {\n\t\t\tresult.dragEffectConstraintItem = lastReducePropertiesResult.dragEffectConstraintItem\n\t\t}\n\t\tif (isEqual(result.transition, lastReducePropertiesResult.transition)) {\n\t\t\tresult.transition = lastReducePropertiesResult.transition\n\t\t}\n\t\tif (result.textProperties && lastReducePropertiesResult.textProperties) {\n\t\t\tif (isEqual(result.textProperties.fonts, lastReducePropertiesResult.textProperties.fonts)) {\n\t\t\t\tresult.textProperties.fonts = lastReducePropertiesResult.textProperties.fonts\n\t\t\t}\n\t\t}\n\t\tif (isEqual(result.link, lastReducePropertiesResult.link)) {\n\t\t\tresult.link = lastReducePropertiesResult.link\n\t\t}\n\t\tif (isEqual(result.whileOpenEffectVariant, lastReducePropertiesResult.whileOpenEffectVariant)) {\n\t\t\tresult.whileOpenEffectVariant = lastReducePropertiesResult.whileOpenEffectVariant\n\t\t}\n\t\tif (isEqual(result.floatingPlacement, lastReducePropertiesResult.floatingPlacement)) {\n\t\t\tresult.floatingPlacement = lastReducePropertiesResult.floatingPlacement\n\t\t}\n\t\tif (isEqual(result.customCursorVariant, lastReducePropertiesResult.customCursorVariant)) {\n\t\t\tresult.customCursorVariant = lastReducePropertiesResult.customCursorVariant\n\t\t}\n\t\tif (isEqual(result.customCursorTransition, lastReducePropertiesResult.customCursorTransition)) {\n\t\t\tresult.customCursorTransition = lastReducePropertiesResult.customCursorTransition\n\t\t}\n\t\tif (isEqual(result.customCursorPlacement, lastReducePropertiesResult.customCursorPlacement)) {\n\t\t\tresult.customCursorPlacement = lastReducePropertiesResult.customCursorPlacement\n\t\t}\n\t\tif (isEqual(result.variantOverrideKeys, lastReducePropertiesResult.variantOverrideKeys)) {\n\t\t\tresult.variantOverrideKeys = lastReducePropertiesResult.variantOverrideKeys\n\t\t}\n\t\tif (isEqual(result.variantOverrideTraitTypes, lastReducePropertiesResult.variantOverrideTraitTypes)) {\n\t\t\tresult.variantOverrideTraitTypes = lastReducePropertiesResult.variantOverrideTraitTypes\n\t\t}\n\t\tif (isEqual(result.formButtonSuccessVariant, lastReducePropertiesResult.formButtonSuccessVariant)) {\n\t\t\tresult.formButtonSuccessVariant = lastReducePropertiesResult.formButtonSuccessVariant\n\t\t}\n\t\tif (isEqual(result.formButtonPendingVariant, lastReducePropertiesResult.formButtonPendingVariant)) {\n\t\t\tresult.formButtonPendingVariant = lastReducePropertiesResult.formButtonPendingVariant\n\t\t}\n\t\tif (isEqual(result.formButtonErrorVariant, lastReducePropertiesResult.formButtonErrorVariant)) {\n\t\t\tresult.formButtonErrorVariant = lastReducePropertiesResult.formButtonErrorVariant\n\t\t}\n\t\tif (isEqual(result.formButtonIncompleteVariant, lastReducePropertiesResult.formButtonIncompleteVariant)) {\n\t\t\tresult.formButtonIncompleteVariant = lastReducePropertiesResult.formButtonIncompleteVariant\n\t\t}\n\t\tif (isEqual(result.formSelectOptions, lastReducePropertiesResult.formSelectOptions)) {\n\t\t\tresult.formSelectOptions = lastReducePropertiesResult.formSelectOptions\n\t\t}\n\t\tif (isEqual(result.dataLoaderLoadingVariant, lastReducePropertiesResult.dataLoaderLoadingVariant)) {\n\t\t\tresult.dataLoaderLoadingVariant = lastReducePropertiesResult.dataLoaderLoadingVariant\n\t\t}\n\t\tif (isEqual(result.dataLoaderDisabledVariant, lastReducePropertiesResult.dataLoaderDisabledVariant)) {\n\t\t\tresult.dataLoaderDisabledVariant = lastReducePropertiesResult.dataLoaderDisabledVariant\n\t\t}\n\n\t\tif (isEqual(result.textProperties, lastReducePropertiesResult.textProperties)) {\n\t\t\tresult.textProperties = lastReducePropertiesResult.textProperties\n\t\t}\n\n\t\tif (isEqual(result.formBooleanInputCheckedBoxShadow, lastReducePropertiesResult.formBooleanInputCheckedBoxShadow)) {\n\t\t\tresult.formBooleanInputCheckedBoxShadow = lastReducePropertiesResult.formBooleanInputCheckedBoxShadow\n\t\t}\n\t\tif (isEqual(result.textEffectTrigger, lastReducePropertiesResult.textEffectTrigger)) {\n\t\t\tresult.textEffectTrigger = lastReducePropertiesResult.textEffectTrigger\n\t\t}\n\t\tif (isEqual(result.textEffectScrollTarget, lastReducePropertiesResult.textEffectScrollTarget)) {\n\t\t\tresult.textEffectScrollTarget = lastReducePropertiesResult.textEffectScrollTarget\n\t\t}\n\t\tif (isEqual(result.formInputFontSelector, lastReducePropertiesResult.formInputFontSelector)) {\n\t\t\tresult.formInputFontSelector = lastReducePropertiesResult.formInputFontSelector\n\t\t}\n\t\tif (isEqual(result.formInputOpenTypeFontFeatures, lastReducePropertiesResult.formInputOpenTypeFontFeatures)) {\n\t\t\tresult.formInputOpenTypeFontFeatures = lastReducePropertiesResult.formInputOpenTypeFontFeatures\n\t\t}\n\t\tif (isEqual(result.formInputVariationAxes, lastReducePropertiesResult.formInputVariationAxes)) {\n\t\t\tresult.formInputVariationAxes = lastReducePropertiesResult.formInputVariationAxes\n\t\t}\n\t\tif (isEqual(result.tapHighlightColor, lastReducePropertiesResult.tapHighlightColor)) {\n\t\t\tresult.tapHighlightColor = lastReducePropertiesResult.tapHighlightColor\n\t\t}\n\t\tif (isEqual(result.textSelection, lastReducePropertiesResult.textSelection)) {\n\t\t\tresult.textSelection = lastReducePropertiesResult.textSelection\n\t\t}\n\t\tif (isEqual(result.strokeEffectTransition, lastReducePropertiesResult.strokeEffectTransition)) {\n\t\t\tresult.strokeEffectTransition = lastReducePropertiesResult.strokeEffectTransition\n\t\t}\n\t\tif (result.onlyCachedSelectionProperties && !result.selectionDidChange) {\n\t\t\tresult.selectionColorProperties = lastReducePropertiesResult.selectionColorProperties\n\t\t}\n\t\tif (isEqual(result.propertiesSupportingVariables, lastReducePropertiesResult.propertiesSupportingVariables)) {\n\t\t\tresult.propertiesSupportingVariables = lastReducePropertiesResult.propertiesSupportingVariables\n\t\t}\n\t\tif (isEqual(result.lightboxEffectTransition, lastReducePropertiesResult.lightboxEffectTransition)) {\n\t\t\tresult.lightboxEffectTransition = lastReducePropertiesResult.lightboxEffectTransition\n\t\t}\n\t\tif (isEqual(result.flowEffectTransition, lastReducePropertiesResult.flowEffectTransition)) {\n\t\t\tresult.flowEffectTransition = lastReducePropertiesResult.flowEffectTransition\n\t\t}\n\t\tif (isEqual(result.triggerActions, lastReducePropertiesResult.triggerActions)) {\n\t\t\tresult.triggerActions = lastReducePropertiesResult.triggerActions\n\t\t}\n\t}\n\n\tlastReducePropertiesResult = result\n\treturn result\n}\n\nfunction reduceAutoSize(node: CanvasNode, result: Properties) {\n\tif (result.anyAutoSizingNode) return\n\tresult.anyAutoSizingNode = (withAutoSize(node) && node.autoSize) || isAutoSizedOnBothDimensions(node)\n}\n\nfunction reduceInstanceTypes(tree: CanvasTree, node: CanvasNode, result: Properties) {\n\tconst isBreakpointNode = isBreakpointVariant(node)\n\n\tif (!result.anyShapeNode && isVectorNode(node)) result.anyShapeNode = true\n\tif (!result.anyBreakpointNode && isBreakpointNode) result.anyBreakpointNode = true\n\tif (result.onlyBreakpointNodes && !isBreakpointNode) result.onlyBreakpointNodes = false\n\tif (result.onlyFrameNodes && !isFrameNode(node)) result.onlyFrameNodes = false\n\tif (result.onlyTextNodes && !isTextNode(node)) result.onlyTextNodes = false\n\tif (result.onlyRichTextNodes && !isRichTextNode(node)) result.onlyRichTextNodes = false\n\tif (result.onlyAnyTextNodes && !isAnyTextNode(node)) result.onlyAnyTextNodes = false\n\tif (result.onlyShapeNodes && !withShape(node)) result.onlyShapeNodes = false\n\tif (result.onlyShapeAndGraphicNodes && !(isShapeContainerNode(node) || withShape(node))) {\n\t\tresult.onlyShapeAndGraphicNodes = false\n\t}\n\tif (result.onlySlotPropertyNodes && !isSlotPropertyNode(node)) result.onlySlotPropertyNodes = false\n\tif (result.onlyRelativeRadiusNodes && !(withRelativeRadius(node) && node.radiusIsRelative)) {\n\t\tresult.onlyRelativeRadiusNodes = false\n\t}\n\tif (result.onlyNodesWithPositionType && !withPositionType(node)) {\n\t\tresult.onlyNodesWithPositionType = false\n\t}\n\tif (result.onlyNodesWithPositionType && isVectorNode(node) && !isInlineVectorNode(tree, node)) {\n\t\tresult.onlyNodesWithPositionType = false\n\t}\n\tif (result.onlyCodeComponentNodes && !withCodeComponent(node)) result.onlyCodeComponentNodes = false\n\tif (result.onlyShapeContainerNodes && !isShapeContainerNode(node)) result.onlyShapeContainerNodes = false\n\tif (result.onlyScreenNodes && !isScreen(node)) result.onlyScreenNodes = false\n\tif (result.onlyShaderNodes && !isShaderNode(node)) result.onlyShaderNodes = false\n\n\tif (result.onlyNodesWithFillImage && !hasImageFill(node)) {\n\t\tresult.onlyNodesWithFillImage = false\n\t}\n\n\tif (isDataRepeater(node)) {\n\t\tresult.anyDataRepeater = true\n\t}\n\n\tconst replica = isReplica(node)\n\tif (result.onlyReplicas && !replica) result.onlyReplicas = false\n\tif (result.onlyReplicasOrReplicaChildren && !(isReplicaChild(node) || replica)) {\n\t\tresult.onlyReplicasOrReplicaChildren = false\n\t}\n\tif (result.onlyVariants && !isVariant(node)) result.onlyVariants = false\n\tif (result.onlyNonGestureVariants && isGestureVariant(node)) result.onlyNonGestureVariants = false\n\tif (!result.anyReplicaOrReplicaChild && (replica || isReplicaChild(node))) result.anyReplicaOrReplicaChild = true\n\tif (!result.anyReplicaVariantOrReplicaVariantChild && isReplicaVariantOrReplicaVariantChild(node)) {\n\t\tresult.anyReplicaVariantOrReplicaVariantChild = true\n\t}\n}\n\nexport function getPropertiesDefaults(): Properties {\n\treturn {\n\t\twidthTypes: new Set(),\n\t\theightTypes: new Set(),\n\t\tcanSetWidthToFixed: true,\n\t\tcanSetWidthToPercentage: true,\n\t\tcanSetHeightToAuto: true,\n\t\tcanSetHeightToFillParent: true,\n\t\tcanSetHeightToFixed: true,\n\t\tcanSetHeightToPercentage: true,\n\t\tcanSetWidthToAuto: true,\n\t\tcanSetWidthToFillParent: true,\n\t\tcanSetWidthToViewport: true,\n\t\tcanSetHeightToViewport: true,\n\t\tcanSetHeightToFitImage: true,\n\t\tcanSetWidthToFitImage: true,\n\t\tcanSetSizeToDefault: false,\n\t\torientationEnabled: false,\n\t\tallNodeIds: [],\n\t\tallOriginalIds: [],\n\t\tanyBreakpointsWithLayoutTemplate: false,\n\t\tanyFormContainerNodes: false,\n\t\tanyFormInputNodes: false,\n\t\tanyAutoSizingNode: false,\n\t\tanyBreakpointNode: false,\n\t\tanyNodesWithLinks: false,\n\t\tanyNodesWithShadows: false,\n\t\tanyReplicaOrReplicaChild: false,\n\t\tanyReplicaVariantOrReplicaVariantChild: false,\n\t\tanyDataRepeater: false,\n\t\tanyShapeNode: false,\n\t\tanyStyleableNode: false,\n\t\tanyGridItemParentWithRowHeightFitContent: false,\n\t\tanyGridItemParentWithMasonryLayout: false,\n\t\tanyNodesWithA11ySupport: false,\n\t\tanyNodeWithTickerEffect: false,\n\t\tanyNodeWithTickerEffectAncestor: false,\n\t\tanyNodesWithTransforms: false,\n\t\tcanSetBottom: true,\n\t\tcanSetHorizontalPins: true,\n\t\tcanSetLeft: true,\n\t\tcanSetRight: true,\n\t\tcanSetTop: true,\n\t\tcanSetVerticalPins: true,\n\t\tcodeComponentIdentifiers: new Set(),\n\t\tdynamicVectorSetIdentifier: NotFound,\n\t\tshaderModuleIdentifiers: new Set(),\n\t\tcodeOverrideBareModuleIdentifiers: new Set(),\n\t\tcodeOverrideModuleExportNames: new Set(),\n\t\texpandedSelectionForShapeGeometryIds: [],\n\t\texpandedSelectionForShapeStylesIds: [],\n\t\tframePresetsInSelection: [],\n\t\thtmlTags: new Set(),\n\t\thtmlTextTags: new Set(),\n\t\tmaxWidthUnits: new Set(),\n\t\tminWidthUnits: new Set(),\n\t\tmaxHeightUnits: new Set(),\n\t\tminHeightUnits: new Set(),\n\t\tonlyAnyTextNodes: true,\n\t\tonlyBreakpointNodes: true,\n\t\tonlyCanvasFrameNodes: true,\n\t\tonlyCodeComponentNodes: true,\n\t\tonlyShaderNodes: true,\n\t\tonlyFrameNodes: true,\n\t\tonlyGridItemNodes: true,\n\t\tonlyGroundNodeDescendants: true,\n\t\tonlyGroundNodes: true,\n\t\tonlyNodesWithMask: true,\n\t\tonlyNodesInsideStackOrGrid: true,\n\t\tonlyNodesSupportingConicGradient: true,\n\t\tonlyNodesSupportingShadowSpread: true,\n\t\tonlyNodesSupportingRealisticShadows: true,\n\t\tonlyNodesSupportingShadowInset: true,\n\t\tonlyNodesWithCursor: true,\n\t\tonlyNodesWithAriaLabel: true,\n\t\tonlyNodesWithFillImage: true,\n\t\tonlyFormContainerNodes: true,\n\t\tonlyFormInputNodes: true,\n\t\tonlyNodesWithTextInputType: true,\n\t\tonlyNodesWithSelect: true,\n\t\tanyNodeWithSelect: false,\n\t\tanyRadioButton: false,\n\t\tonlyFormInputNodesWithPlaceholder: true,\n\t\tonlyFormInputNodesWithPlaceholderColor: true,\n\t\tonlyNodesWithLink: true,\n\t\tonlyNodesWithTextEffect: true,\n\t\tonlyNodesWithLinks: true,\n\t\tonlyNodesWithLinkSupportingComputedValues: true,\n\t\tonlyNodesWithListParents: true,\n\t\tonlyNodesWithLinkOptions: true,\n\t\tonlyNodesWithPageEffects: true,\n\t\tonlyNodesWithParallax: true,\n\t\tonlyNodesWithPositionFixed: true,\n\t\tonlyNodesWithRotation: true,\n\t\tonlyNodesWithPointerEvents: true,\n\t\tonlyNodesWithOverflow: true,\n\t\tonlyNodesWithScrollTarget: true,\n\t\tonlyNodesWithScrollbars: true,\n\t\tonlyNodesWithSizeConstraints: true,\n\t\tonlyNodesWithSpikes: true,\n\t\tonlyNodesWithLayout: true,\n\t\tonlyNodesWithStyleAppearEffect: true,\n\t\tonlyNodesWithTabIndex: true,\n\t\tonlyNodesWithDataNosnippet: true,\n\t\tonlyNodesWithTitleAndDescription: true,\n\t\tonlyNodesWithUserSelect: true,\n\t\tonlyNodesWithDraggable: true,\n\t\tonlyNodesWithImageRendering: true,\n\t\tonlyNodesWithVariantAppearEffect: true,\n\t\tonlyNodesWithCodeOverrides: false,\n\t\tonlyNodesWithBackdrop: true,\n\t\tonlyNodesWithOverscrollBehavior: true,\n\t\tonlyNodesInAnOverlay: true,\n\t\tonlyNodesSupportingOverlayTrigger: true,\n\t\tonlyNodesWithTriggerActions: true,\n\t\tonlyNodesWithFilters: true,\n\t\tonlyNodesWithTransformOrigin: true,\n\t\tonlyNodesWithFormButton: true,\n\t\tonlyNodesWithFormAncestor: true,\n\t\tonlyNodesInsideCollectionRepeater: true,\n\t\tonlyRepeatedNodes: true,\n\t\tonlyNodesWithViewTransitionNone: true,\n\t\tonlyNodesWithTextSelection: true,\n\t\tonlyNodesWithStrokeEffect: true,\n\t\tonlyPolygonNodes: true,\n\t\tonlyRelativeRadiusNodes: true,\n\t\tonlyNodesWithPositionType: true,\n\t\tonlyReplicas: true,\n\t\tonlyReplicasOrReplicaChildren: true,\n\t\tonlyRichTextNodes: true,\n\t\tonlyScreenNodes: true,\n\t\tonlySlotPropertyNodes: true,\n\t\tonlyShapeAndGraphicNodes: true,\n\t\tonlyShapeContainerNodes: true,\n\t\tonlyShapeNodes: true,\n\t\tonlyTextNodes: true,\n\t\tonlyVariants: true,\n\t\tonlyNonGestureVariants: true,\n\t\tonlyNodesWithStyleTransformEffect: true,\n\t\tonlyNodesWithDragEffect: true,\n\t\tonlyNodesWithFloatingPosition: true,\n\t\tonlyFormTextAreaNodes: true,\n\t\tonlyNodesWithLoopEffect: true,\n\t\tonlyNodesWithFlowEffect: true,\n\t\tonlyNodesWithWhileHover: true,\n\t\tonlyNodesWithWhileTap: true,\n\t\tonlyNodesWithCustomizations: true,\n\t\tonlyNodesWithTransition: true,\n\t\tonlyNodesWithHTMLTag: true,\n\t\tonlyNodesWithFormVariants: true,\n\t\tonlyNodesWithFormInputStep: true,\n\t\tonlyNodesWithDataLoaderVariants: true,\n\t\tonlyNodesWithBooleanInputType: true,\n\t\tonlyNodesWithFormInputFontStyles: true,\n\t\tonlyNodesWithFormInputInvalidStyles: true,\n\t\tonlyNodesWithAutofillEnabled: true,\n\t\tonlyNodesWithRequired: true,\n\t\tonlyNodesWithTapHighlight: true,\n\t\tonlyNodesWithLightboxEffect: true,\n\t\tonlyNodesWithTickerEffect: true,\n\t\tresizeToFitContentActionAvailable: false,\n\t\tresizeToFitContentActionEnabled: false,\n\t\tselectionDidChange: false,\n\t\tselectionHash: \"\",\n\t\tstrokeAlignmentValues: new Set(),\n\t\twithoutDescendantIds: [],\n\t\tpositionTypes: new Set(),\n\t\tappearEffectTrigger: new Set(),\n\t\tappearEffectVisibleVariantId: new Set(),\n\t\tappearEffectObscuredVariantId: new Set(),\n\t\tappearEffectScrollTargets: [],\n\t\tappearEffectScrollDirectionTarget: new Set(),\n\t\tstyleAppearEffectScrollTarget: new Set(),\n\t\tstyleAppearEffectTrigger: new Set(),\n\t\tstyleTransformEffectTrigger: new Set(),\n\t\tstyleTransformEffectScrollTargets: [],\n\t\twhileOpenEffectVariant: new Set(),\n\t\tcustomCursorVariant: new Set(),\n\t\tcustomCursorPlacement: new Set(),\n\t\tfloatingPlacement: new Set(),\n\t\tvariantOverrideKeys: new Set(),\n\t\tvariantOverrideTraitTypes: new Set(),\n\t\ttextEffectScrollTarget: new Set(),\n\t\ttextEffectTrigger: new Set(),\n\t\tselectionColorProperties: new Map(),\n\t\tonlyCachedSelectionProperties: true,\n\n\t\t// WithFormVariants\n\t\tformButtonSuccessVariant: new Set(),\n\t\tformButtonErrorVariant: new Set(),\n\t\tformButtonPendingVariant: new Set(),\n\t\tformButtonIncompleteVariant: new Set(),\n\n\t\t// WithDataLoaderVariants\n\t\tdataLoaderDisabledVariant: new Set(),\n\t\tdataLoaderLoadingVariant: new Set(),\n\n\t\t// Reduced properties that start out as NotFound\n\t\tcurrentVariantWidthType: NotFound,\n\t\tcurrentVariantHeightType: NotFound,\n\t\tcursor: NotFound,\n\t\tcustomCursorSmartComponentId: NotFound,\n\t\tcustomCursorFollow: NotFound,\n\t\tcustomCursorOffsetX: NotFound,\n\t\tcustomCursorOffsetY: NotFound,\n\t\tcustomCursorType: NotFound,\n\t\tcustomCursorAlignment: NotFound,\n\t\tcustomCursorTransition: NotFound,\n\t\tcustomCursorTransitionEnabled: NotFound,\n\n\t\twidth: NotFound,\n\t\theight: NotFound,\n\t\tx: NotFound,\n\t\ty: NotFound,\n\t\tright: NotFound,\n\t\tbottom: NotFound,\n\t\torientation: NotFound,\n\t\toverlayGrid: NotFound,\n\t\tariaLabel: NotFound,\n\t\ttitle: NotFound,\n\t\tdescription: NotFound,\n\t\t...getReducedAltTextDefaults(),\n\t\tuserSelect: NotFound,\n\t\tdraggable: NotFound,\n\t\timageRendering: NotFound,\n\t\tpointerEvents: NotFound,\n\t\tzIndex: NotFound,\n\t\ttabIndex: NotFound,\n\t\tdataNosnippet: NotFound,\n\t\tlink: NotFound,\n\t\tlinkOpenInNewTab: NotFound,\n\t\tlinkSmoothScroll: NotFound,\n\t\tlinkClickTrackingId: NotFound,\n\t\tlinkRelValues: NotFound,\n\t\tlinkPreserveParams: NotFound,\n\t\tanyExternalLinks: false,\n\t\tanyScrollTargets: false,\n\t\ttrackingIdAIPrompt: NotFound,\n\t\tlayout: NotFound,\n\t\tstackDirection: NotFound,\n\t\tstackDistribution: NotFound,\n\t\tstackAlignment: NotFound,\n\t\tstackWrapEnabled: NotFound,\n\t\tgridColumnCount: NotFound,\n\t\tgridRowCount: NotFound,\n\t\tgridAlignment: NotFound,\n\t\tgridColumnWidthType: NotFound,\n\t\tgridColumnWidth: NotFound,\n\t\tgridColumnMinWidth: NotFound,\n\t\tgridRowHeightType: NotFound,\n\t\tgridRowHeight: NotFound,\n\t\tgridType: NotFound,\n\t\tgridItemHorizontalAlignment: NotFound,\n\t\tgridItemVerticalAlignment: NotFound,\n\t\tgridItemColumnSpan: NotFound,\n\t\tgridItemRowSpan: NotFound,\n\t\tgridItemFillCellWidth: NotFound,\n\t\tgridItemFillCellHeight: NotFound,\n\t\tpadding: NotFound,\n\t\tpaddingPerSide: NotFound,\n\t\tpaddingTop: NotFound,\n\t\tpaddingRight: NotFound,\n\t\tpaddingBottom: NotFound,\n\t\tpaddingLeft: NotFound,\n\t\taspectRatioEnabled: NotFound,\n\t\taspectRatioLocked: true,\n\t\tpageEffects: NotFound,\n\t\topacity: NotFound,\n\t\toverlayTriggerEventKey: NotFound,\n\t\t...getReducedBorderDefaults(),\n\t\tbrightness: NotFound,\n\t\tcontrast: NotFound,\n\t\tgrayscale: NotFound,\n\t\toverscrollBehavior: NotFound,\n\t\thueRotate: NotFound,\n\t\tinvert: NotFound,\n\t\tsaturate: NotFound,\n\t\tsepia: NotFound,\n\t\tblur: NotFound,\n\t\tbackgroundBlur: NotFound,\n\t\tblendingMode: NotFound,\n\t\tsizeToFit: NotFound,\n\t\tparallaxEnabled: NotFound,\n\t\tparallaxSpeed: NotFound,\n\t\tparallaxAdjustPosition: NotFound,\n\t\tparallaxOffset: NotFound,\n\t\tappearEffectEnabled: NotFound,\n\t\tappearEffectThreshold: NotFound,\n\t\tappearEffectAnimateOnce: NotFound,\n\t\tappearEffectScrollTargetCount: NotFound,\n\t\tappearEffectScrollDirection: NotFound,\n\t\texitEffectEnabled: NotFound,\n\t\texitEffectOpacity: NotFound,\n\t\texitEffectX: NotFound,\n\t\texitEffectY: NotFound,\n\t\texitEffectScale: NotFound,\n\t\texitEffectRotate3d: NotFound,\n\t\texitEffectRotate: NotFound,\n\t\texitEffectRotateX: NotFound,\n\t\texitEffectRotateY: NotFound,\n\t\texitEffectSkewX: NotFound,\n\t\texitEffectSkewY: NotFound,\n\t\texitEffectTransition: NotFound,\n\t\tenterEffectEnabled: NotFound,\n\t\tenterEffectOpacity: NotFound,\n\t\tenterEffectX: NotFound,\n\t\tenterEffectY: NotFound,\n\t\tenterEffectScale: NotFound,\n\t\tenterEffectRotate3d: NotFound,\n\t\tenterEffectRotate: NotFound,\n\t\tenterEffectRotateX: NotFound,\n\t\tenterEffectRotateY: NotFound,\n\t\tenterEffectSkewX: NotFound,\n\t\tenterEffectSkewY: NotFound,\n\t\tenterEffectTransition: NotFound,\n\t\tstyleAppearEffectEnabled: NotFound,\n\t\tstyleAppearEffectThreshold: NotFound,\n\t\tstyleAppearEffectAnimateOnce: NotFound,\n\t\tstyleAppearEffectLocked: NotFound,\n\t\tstyleAppearEffectOpacity: NotFound,\n\t\tstyleAppearEffectX: NotFound,\n\t\tstyleAppearEffectY: NotFound,\n\t\tstyleAppearEffectScale: NotFound,\n\t\tstyleAppearEffectRotate: NotFound,\n\t\tstyleAppearEffectRotateX: NotFound,\n\t\tstyleAppearEffectRotateY: NotFound,\n\t\tstyleAppearEffectPerspective: NotFound,\n\t\tstyleAppearEffectTransition: NotFound,\n\t\tstyleTransformEffectEnabled: NotFound,\n\t\tstyleTransformEffectViewportThreshold: NotFound,\n\t\tstyleTransformEffectTransition: NotFound,\n\t\tstyleTransformEffectTransitionEnabled: NotFound,\n\t\tstyleTransformEffectScrollTargetCount: NotFound,\n\t\tstyleAppearEffectScrollTargetCollectionItem: NotFound,\n\t\tstyleAppearEffectScrollDirection: NotFound,\n\t\tdragEffectEnabled: NotFound,\n\t\tdragEffectFreeform: NotFound,\n\t\tdragEffectMomentum: NotFound,\n\t\tdragEffectSnapBack: NotFound,\n\t\tdragEffectConstraintElement: NotFound,\n\t\tdragEffectConstraintItem: NotFound,\n\t\tdragEffectTransition: NotFound,\n\n\t\tshaderMouseEnabled: NotFound,\n\t\tshaderMouseSpringOptions: NotFound,\n\n\t\toverflow: NotFound,\n\t\toverflowX: NotFound,\n\t\toverflowY: NotFound,\n\n\t\tloopEffectEnabled: NotFound,\n\t\tloopEffectRepeatDelay: NotFound,\n\t\tloopEffectOpacity: NotFound,\n\t\tloopEffectX: NotFound,\n\t\tloopEffectY: NotFound,\n\t\tloopEffectScale: NotFound,\n\t\tloopEffectRotate3d: NotFound,\n\t\tloopEffectRotate: NotFound,\n\t\tloopEffectRotateX: NotFound,\n\t\tloopEffectRotateY: NotFound,\n\t\tloopEffectSkewX: NotFound,\n\t\tloopEffectSkewY: NotFound,\n\t\tloopEffectTransition: NotFound,\n\t\tloopEffectRepeatType: NotFound,\n\t\tloopEffectPauseOffscreen: NotFound,\n\n\t\twhileTapEnabled: NotFound,\n\t\twhileTapOpacity: NotFound,\n\t\twhileTapX: NotFound,\n\t\twhileTapY: NotFound,\n\t\twhileTapScale: NotFound,\n\t\twhileTapRotate3d: NotFound,\n\t\twhileTapRotate: NotFound,\n\t\twhileTapRotateX: NotFound,\n\t\twhileTapRotateY: NotFound,\n\t\twhileTapSkewX: NotFound,\n\t\twhileTapSkewY: NotFound,\n\t\twhileTapBoxShadow: NotFound,\n\t\twhileTapBoxShadowCount: NotFound,\n\t\twhileTapTransition: NotFound,\n\t\twhileTapBackgroundColor: NotFound,\n\n\t\twhileHoverEnabled: NotFound,\n\t\twhileHoverOpacity: NotFound,\n\t\twhileHoverX: NotFound,\n\t\twhileHoverY: NotFound,\n\t\twhileHoverScale: NotFound,\n\t\twhileHoverRotate3d: NotFound,\n\t\twhileHoverRotate: NotFound,\n\t\twhileHoverRotateX: NotFound,\n\t\twhileHoverRotateY: NotFound,\n\t\twhileHoverSkewX: NotFound,\n\t\twhileHoverSkewY: NotFound,\n\t\twhileHoverBoxShadowCount: NotFound,\n\t\twhileHoverBoxShadow: NotFound,\n\t\twhileHoverTransition: NotFound,\n\t\twhileHoverBackgroundColor: NotFound,\n\n\t\tmaxWidth: NotFound,\n\t\tminWidth: NotFound,\n\t\tmaxHeight: NotFound,\n\t\tminHeight: NotFound,\n\t\telementId: NotFound,\n\t\tscrollMarginTop: NotFound,\n\t\tscrollTargetEnabled: NotFound,\n\t\tdataIdentifier: NotFound,\n\t\tdataRepeaterArray: NotFound,\n\t\trepeatArray: NotFound,\n\t\tbackdropFillEnabled: NotFound,\n\t\tbackdropFill: NotFound,\n\t\tbackdropTransitionLocked: NotFound,\n\t\tbackdropEnterTransition: NotFound,\n\t\tbackdropExitTransition: NotFound,\n\t\tbackdropDismissible: NotFound,\n\t\tblockDocumentScrolling: NotFound,\n\n\t\tpositionStickyTop: NotFound,\n\t\tpositionStickyRight: NotFound,\n\t\tpositionStickyBottom: NotFound,\n\t\tpositionStickyLeft: NotFound,\n\n\t\tfloatingAlignment: NotFound,\n\t\tfloatingOffsetX: NotFound,\n\t\tfloatingOffsetY: NotFound,\n\t\tfloatingSafeArea: NotFound,\n\t\tfloatingCollisionDetection: NotFound,\n\t\tfloatingCollisionPadding: NotFound,\n\n\t\tshadows: NotFound,\n\n\t\tmasks: NotFound,\n\n\t\t...getReducedFillDefaults(),\n\t\tstrokeEnabled: NotFound,\n\t\tstrokeColor: NotFound,\n\t\tstrokeWidth: NotFound,\n\t\tstrokeDashOffset: NotFound,\n\t\tstrokeDashArray: NotFound,\n\t\tlineJoin: NotFound,\n\t\tlineCap: NotFound,\n\t\tstrokeMiterLimit: NotFound,\n\t\t...getReducedRadiusDefaults(),\n\t\t...getReducedRadiusPerCornerDefaults(),\n\t\tcornerShape: NotFound,\n\t\tspikeCount: NotFound,\n\t\tspikeDepth: NotFound,\n\t\tpolygonSides: NotFound,\n\t\tvisible: NotFound,\n\t\tpinLeft: NotFound,\n\t\tpinRight: NotFound,\n\t\tpinTop: NotFound,\n\t\tpinBottom: NotFound,\n\t\tconstraintsLocked: NotFound,\n\t\twidthFactor: NotFound,\n\t\theightFactor: NotFound,\n\t\trotation: NotFound,\n\t\tcodeOverrideEnabled: NotFound,\n\t\tgap: NotFound,\n\t\tgapAxis: NotFound,\n\t\trowGap: NotFound,\n\t\tcolumnGap: NotFound,\n\t\tcomputedRowCount: NotFound,\n\t\tpathsAreClosed: NotFound,\n\t\thideScrollbars: NotFound,\n\t\ttapHighlightColor: NotFound,\n\t\ttextSelection: NotFound,\n\n\t\tcustomizations: NotFound,\n\t\tcustomizationsDescription: NotFound,\n\t\tcustomizationsSectionId: NotFound,\n\t\tcustomizationsCategory: NotFound,\n\t\tcustomizationsRules: NotFound,\n\n\t\ttransition: NotFound,\n\n\t\twhileOpenEffectEnabled: NotFound,\n\n\t\ttransformOriginX: NotFound,\n\t\ttransformOriginY: NotFound,\n\n\t\tscale: NotFound,\n\t\tskewX: NotFound,\n\t\tskewY: NotFound,\n\t\trotate3d: NotFound,\n\t\trotateX: NotFound,\n\t\trotateY: NotFound,\n\t\ttranslateZ: NotFound,\n\n\t\tperspective: NotFound,\n\t\tbackfaceVisibility: NotFound,\n\t\ttransformStylePreserve3d: NotFound,\n\n\t\t// DataRepeater\n\t\trepeaterId: NotFound,\n\t\trepeaterOriginalId: NotFound,\n\n\t\t// Node level repeat\n\t\trepeatId: NotFound,\n\t\trepeatOriginalId: NotFound,\n\n\t\t// WithFormContainer\n\t\tformOnSuccessRedirectUrl: NotFound,\n\t\tformSaveId: undefined,\n\t\tformSubmitTrackingId: NotFound,\n\t\tformCaptchaProvider: NotFound,\n\t\tformCaptchaSiteKey: NotFound,\n\n\t\t// WithFormInputStyles\n\t\tformInputFontFamily: NotFound,\n\t\tformInputFontSize: NotFound,\n\t\tformInputFontSizeUnit: NotFound,\n\t\tformInputFontWeight: NotFound,\n\t\tformInputFontColor: NotFound,\n\t\tformInputFontSelector: NotFound,\n\t\tformInputFontStyle: NotFound,\n\t\tformInputFontLetterSpacing: NotFound,\n\t\tformInputFontLineHeight: NotFound,\n\t\tformInputFontLetterSpacingUnit: NotFound,\n\t\tformInputFontLineHeightUnit: NotFound,\n\t\tformInputFontTextAlignment: NotFound,\n\t\tformInputOpenTypeFontFeatures: NotFound,\n\t\tformInputVariationAxes: NotFound,\n\n\t\tformInputPlaceholderColor: NotFound,\n\t\tformTextAreaResizable: NotFound,\n\t\tformInputValue: NotFound,\n\t\tformInputFocusedBackgroundColor: NotFound,\n\t\tformInputFocusedBorderColor: NotFound,\n\t\tformInputFocusedBorderWidth: NotFound,\n\t\tformInputFocusedBorderStyle: NotFound,\n\t\tformInputFocusedBoxShadow: NotFound,\n\t\tformInputFocusedTransition: NotFound,\n\n\t\t// WithFormInputInvalidStyles\n\t\tformInputInvalidTextColor: NotFound,\n\n\t\t// WithFormInput\n\t\tformInputRequired: NotFound,\n\t\tformInputAutoFocus: NotFound,\n\t\tformInputName: NotFound,\n\t\tformInputHidden: NotFound,\n\t\tformTextInputType: NotFound,\n\t\tformInputPlaceholder: NotFound,\n\n\t\t// WithFormInputAutofillEnabled\n\t\tformInputAutofillEnabled: NotFound,\n\n\t\t// WithFormInputIcon\n\t\tonlyNodesWithInputIconRow: true,\n\t\tformInputIconImage: NotFound,\n\t\tformInputIconColor: NotFound,\n\n\t\t// WithFormTextInputType\n\t\tformTextInputMaxNumber: NotFound,\n\t\tformTextInputMinNumber: NotFound,\n\t\tformInputStep: NotFound,\n\t\tformInputMaxLength: NotFound,\n\n\t\t// WithFormVariants\n\t\tformButtonErrorVariantEnabled: NotFound,\n\t\tformButtonPendingVariantEnabled: NotFound,\n\t\tformButtonSuccessVariantEnabled: NotFound,\n\t\tformButtonIncompleteVariantEnabled: NotFound,\n\n\t\t// WithFormBooleanInputType\n\t\tformBooleanInputType: NotFound,\n\t\tformBooleanInputValue: NotFound,\n\t\tformBooleanInputCheckedBorderColor: NotFound,\n\t\tformBooleanInputCheckedBorderWidth: NotFound,\n\t\tformBooleanInputCheckedBorderStyle: NotFound,\n\t\tformBooleanInputCheckedFillColor: NotFound,\n\t\tformBooleanInputCheckedTransition: NotFound,\n\t\tformBooleanInputCheckedBoxShadow: NotFound,\n\n\t\t// WithVariableBinding\n\t\tbindingType: NotFound,\n\t\tvariableBinding: NotFound,\n\n\t\t// WithFormSelect\n\t\tformSelectOptions: NotFound,\n\n\t\tallItemsLabel: NotFound,\n\t\tbooleanTrueLabel: NotFound,\n\t\tbooleanFalseLabel: NotFound,\n\n\t\t// WithDataLoaderVariants\n\t\tdataLoaderLoadingVariantEnabled: NotFound,\n\t\tdataLoaderDisabledVariantEnabled: NotFound,\n\n\t\t// WithTextEffect\n\t\ttextEffectBlur: NotFound,\n\t\ttextEffectEnabled: NotFound,\n\t\ttextEffectOpacity: NotFound,\n\t\ttextEffectTokenization: NotFound,\n\t\ttextEffectReplay: NotFound,\n\t\ttextEffectDelay: NotFound,\n\t\ttextEffectRotate: NotFound,\n\t\ttextEffectRotate3d: NotFound,\n\t\ttextEffectRotateX: NotFound,\n\t\ttextEffectRotateY: NotFound,\n\t\ttextEffectScale: NotFound,\n\t\ttextEffectScrollTargetCollectionItem: NotFound,\n\t\ttextEffectSkewX: NotFound,\n\t\ttextEffectSkewY: NotFound,\n\t\ttextEffectThreshold: NotFound,\n\t\ttextEffectTransition: NotFound,\n\t\ttextEffectType: NotFound,\n\t\ttextEffectX: NotFound,\n\t\ttextEffectY: NotFound,\n\n\t\t// WithTextTruncation\n\t\ttextTruncation: NotFound,\n\n\t\t// WithViewTransitionNone\n\t\tviewTransitionNone: NotFound,\n\n\t\t// WithFillOpacity\n\t\tfillOpacity: NotFound,\n\n\t\t// WithRootFontSize\n\t\trootFontSize: NotFound,\n\n\t\t// WithStrokeEffect\n\t\tstrokeEffectEnabled: NotFound,\n\t\tstrokeEffectLength: NotFound,\n\t\tstrokeEffectGap: NotFound,\n\t\tstrokeEffectOffset: NotFound,\n\t\tstrokeEffectTransition: NotFound,\n\t\tstrokeEffectLoop: NotFound,\n\t\tstrokeEffectLoopType: NotFound,\n\n\t\t// WithLightboxEffect\n\t\tlightboxEffectEnabled: NotFound,\n\t\tlightboxEffectPadding: NotFound,\n\t\tlightboxEffectPaddingPerSide: NotFound,\n\t\tlightboxEffectPaddingTop: NotFound,\n\t\tlightboxEffectPaddingRight: NotFound,\n\t\tlightboxEffectPaddingBottom: NotFound,\n\t\tlightboxEffectPaddingLeft: NotFound,\n\t\tlightboxEffectMaxWidth: NotFound,\n\t\tlightboxEffectZIndex: NotFound,\n\t\tlightboxEffectBackdrop: NotFound,\n\t\tlightboxEffectTransition: NotFound,\n\n\t\t// WithTickerEffect\n\t\ttickerEffectEnabled: NotFound,\n\t\ttickerEffectVelocity: NotFound,\n\t\ttickerEffectHoverModifier: NotFound,\n\t\ttickerEffectDirectionModifier: NotFound,\n\t\ttickerEffectDraggable: NotFound,\n\n\t\t// WithFlowEffect\n\t\tflowEffectEnabled: NotFound,\n\t\tflowEffectTransition: NotFound,\n\n\t\t// WithTriggerActions\n\t\ttriggerActions: NotFound,\n\n\t\tpropertiesSupportingVariables: { ...allVariableKeysRecord },\n\t}\n}\n\nexport interface ExportPreviewNode {\n\texportOptions: readonly ExportOptions[]\n\tnode: CanvasNode & WithExport\n}\n\nexport interface Properties\n\textends\n\t\tReducedA11ySupport,\n\t\tReducedAltText,\n\t\tReducedAriaLabel,\n\t\tReducedAspectRatio,\n\t\tReducedBackdrop,\n\t\tReducedBlending,\n\t\tReducedBorder,\n\t\tReducedCodeOverrides,\n\t\tReducedCollectionOptions,\n\t\tReducedControlPropsWithIdentifier,\n\t\tReducedCurrentVariantSize,\n\t\tReducedCursor,\n\t\tReducedCustomizations,\n\t\tReducedDataLoaderVariants,\n\t\tReducedDataNosnippet,\n\t\tReducedDataRepeaterArray,\n\t\tReducedDataRepeaterId,\n\t\tReducedRepeatArray,\n\t\tReducedRepeatId,\n\t\tReducedDataSource,\n\t\tReducedDragEffect,\n\t\tReducedDraggable,\n\t\tReducedEnabledVariableProperties,\n\t\tReducedFill,\n\t\tReducedFillOpacity,\n\t\tReducedFilters,\n\t\tReducedFloatingPosition,\n\t\tReducedFormBooleanInputType,\n\t\tReducedFormContainer,\n\t\tReducedFormInput,\n\t\tReducedFormInputAutofillEnabled,\n\t\tReducedFormInputFocusedStyles,\n\t\tReducedFormInputFontStyles,\n\t\tReducedFormInputIcon,\n\t\tReducedFormInputInvalidStyles,\n\t\tReducedFormInputPlaceholder,\n\t\tReducedFormInputStep,\n\t\tReducedFormSelect,\n\t\tReducedFormTextInputType,\n\t\tReducedFormTextInputType,\n\t\tReducedFormVariants,\n\t\tReducedFramePresets,\n\t\tReducedGridItemLayout,\n\t\tReducedGridItemSize,\n\t\tReducedHoverEffect,\n\t\tReducedHTMLTags,\n\t\tReducedImageRendering,\n\t\tReducedLayout,\n\t\tReducedLightboxEffect,\n\t\tReducedLink,\n\t\tReducedFlowEffect,\n\t\tReducedLoopEffect,\n\t\tReducedMasks,\n\t\tReducedOpacity,\n\t\tReducedOverflow,\n\t\tReducedOverlayGrids,\n\t\tReducedOverlayTriggerEvent,\n\t\tReducedOverlayTriggerNodes,\n\t\tReducedOverrides,\n\t\tReducedOverscrollBehavior,\n\t\tReducedPadding,\n\t\tReducedPageEffects,\n\t\tReducedParallax,\n\t\tReducedPins,\n\t\tReducedPointerEvents,\n\t\tReducedPolygon,\n\t\tReducedPositionType,\n\t\tReducedPressEffect,\n\t\tReducedRadius,\n\t\tReducedRadiusPerCorner,\n\t\tReducedCornerShape,\n\t\tReducedResizeToFitContentAction,\n\t\tReducedRootFontSize,\n\t\tReducedRotation,\n\t\tReducedScrollbars,\n\t\tReducedScrollTarget,\n\t\tReducedSelectionProperties,\n\t\tReducedShaderMouse,\n\t\tReducedShadows,\n\t\tReducedSizeConstraints,\n\t\tReducedSizeProperties,\n\t\tReducedSizeToFit,\n\t\tReducedSpikes,\n\t\tReducedStroke,\n\t\tReducedStrokeEffect,\n\t\tReducedStyleAppearEffect,\n\t\tReducedStyleTransformEffect,\n\t\tReducedTabIndex,\n\t\tReducedTapHighlight,\n\t\tReducedTextEffect,\n\t\tReducedTextSelection,\n\t\tReducedTextTruncation,\n\t\tReducedTickerEffect,\n\t\tReducedTitleAndDescription,\n\t\tReducedTrackingIdAIPrompt,\n\t\tReducedTransforms,\n\t\tReducedTransition,\n\t\tReducedTriggerActions,\n\t\tReducedUserSelect,\n\t\tReducedVariableBinding,\n\t\tReducedVariantAppearEffect,\n\t\tReducedVariantOverrides,\n\t\tReducedViewTransitionNone,\n\t\tReducedVisibility,\n\t\tReducedWhileOpenEffect,\n\t\tReducedZIndex {\n\tallNodeIds: NodeID[]\n\tallOriginalIds: NodeID[]\n\tselectionHash: string\n\tselectionDidChange: boolean\n\twithoutDescendantIds: NodeID[]\n\texpandedSelectionForShapeStylesIds: NodeID[]\n\texpandedSelectionForShapeGeometryIds: NodeID[]\n\n\tonlyGroundNodes: boolean\n\tonlyFrameNodes: boolean\n\tonlyTextNodes: boolean\n\tonlyRichTextNodes: boolean\n\tonlyAnyTextNodes: boolean\n\tonlyBreakpointNodes: boolean\n\tonlyShapeNodes: boolean\n\tonlyShapeAndGraphicNodes: boolean\n\tonlyScreenNodes: boolean\n\tonlySlotPropertyNodes: boolean\n\tonlyCanvasFrameNodes: boolean\n\tonlyRelativeRadiusNodes: boolean\n\tonlyNodesWithPositionType: boolean\n\tonlyCodeComponentNodes: boolean\n\tonlyShaderNodes: boolean\n\tonlyShapeContainerNodes: boolean\n\tonlyVariants: boolean\n\tonlyNonGestureVariants: boolean\n\tonlyReplicas: boolean\n\tonlyReplicasOrReplicaChildren: boolean\n\tonlyNodesInsideStackOrGrid: boolean\n\tonlyGroundNodeDescendants: boolean\n\tonlyNodesSupportingConicGradient: boolean\n\tonlyNodesWithPageEffects: boolean\n\tonlyNodesWithFillImage: boolean\n\tonlyNodesWithBackdrop: boolean\n\tonlyNodesWithTransformOrigin: boolean\n\tonlyNodesWithMask: boolean\n\tonlyNodesInsideCollectionRepeater: boolean\n\tonlyRepeatedNodes: boolean\n\n\tanyBreakpointsWithLayoutTemplate: boolean\n\tanyStyleableNode: boolean\n\tanyShapeNode: boolean\n\tanyAutoSizingNode: boolean\n\tanyReplicaOrReplicaChild: boolean\n\tanyReplicaVariantOrReplicaVariantChild: boolean\n\tanyDataRepeater: boolean\n\tanyBreakpointNode: boolean\n\n\tcodeComponentIdentifiers: Set<ModuleExportIdentifierString>\n\tdynamicVectorSetIdentifier: Reduced<VariableReference | undefined>\n\tshaderModuleIdentifiers: Set<ModuleExportIdentifierString>\n\ttextProperties?: TextProperties\n}\n", "import { assert } from \"@framerjs/shared\"\nimport type { VekterEngine } from \"document/VekterEngine.ts\"\nimport type { CanvasNode, NodeID } from \"document/models/CanvasTree/index.ts\"\nimport { CanvasTree } from \"document/models/CanvasTree/index.ts\"\nimport { isAnyTextNode } from \"document/models/CanvasTree/nodes/utils/isAnyTextNode.ts\"\nimport {\n\tisLinkStylePresetNode,\n\tisRichTextNode,\n\tisShapeContainerNode,\n\tisTextNode,\n\tisTextStylePresetPrimaryNode,\n} from \"document/models/CanvasTree/nodes/utils/nodeCheck.ts\"\nimport { TraitType } from \"document/models/CanvasTree/traits/TraitType.ts\"\nimport { migrateLetterSpacing } from \"document/models/CanvasTree/traits/WithTextStyle.ts\"\nimport { reduceProperties } from \"document/models/CanvasTree/traits/utils/reduceProperties.ts\"\nimport { enableTextFit } from \"document/models/CanvasTree/traits/utils/textFitHelpers.ts\"\nimport { replaceEncodedAxesInSelector } from \"document/models/CanvasTree/utils/variableFont.ts\"\nimport { getCompatibleNodeProperties, shouldApplyUpdate } from \"document/utils/getCompatibleNodeProperties.ts\"\nimport { migrateTextToRichTextNode } from \"document/utils/migrateTextToRichTextNode.ts\"\nimport { isArray, isObject, isString, isUndefined } from \"utils/typeChecks.ts\"\nimport { wrapImportAssetsToast } from \"./layers.ts\"\n\nexport interface FramerStylesClipboardData {\n\ttree: object\n\tvariableValues: Record<string, unknown>\n\tassets: string[]\n\tsourceProjectId?: string\n\tlimitToTrait?: TraitType | TraitType[]\n}\n\nexport function isFramerStylesClipboardData(data: unknown): data is FramerStylesClipboardData {\n\treturn (\n\t\tisObject(data) &&\n\t\t\"tree\" in data &&\n\t\tisObject(data.tree) &&\n\t\t\"assets\" in data &&\n\t\tisArray(data.assets) &&\n\t\t\"sourceProjectId\" in data &&\n\t\tisString(data.sourceProjectId)\n\t)\n}\n\nexport async function framerStylesClipboardHandler(\n\tengine: VekterEngine,\n\tselection: NodeID[],\n\tstylesData: FramerStylesClipboardData,\n\t/**\n\t * Limit the traits allowed from the clipboard style data. This allows us to be more restrictive when pasting a style\n\t * than we were when copying the style, like Copy Style -> Paste Fill, but will not make it more permissive.\n\t */\n\tlimitPasteToTrait?: TraitType | TraitType[],\n): Promise<boolean> {\n\tif (!stylesData) return false\n\tif (engine.stores.chromeStore.isPreviewingLocaleOnCanvas) return false\n\tconst { assetService } = engine.stores.assetStore\n\tif (!assetService) return false\n\n\tconst { sourceProjectId, assets } = stylesData\n\tconst limitToTrait = getPasteableTraits(stylesData.limitToTrait, limitPasteToTrait)\n\n\tconst projectId = engine.stores.projectStore.projectId\n\tconst isFromAnotherProject = typeof sourceProjectId === \"string\" && sourceProjectId !== projectId\n\tif (isFromAnotherProject && Array.isArray(assets) && assets.length > 0) {\n\t\tawait wrapImportAssetsToast(async () => {\n\t\t\tawait assetService.duplicateAssets(assets, sourceProjectId)\n\t\t})\n\t}\n\tconst { tree, componentLoader } = engine\n\n\tif (!isObject(stylesData)) {\n\t\treturn false\n\t}\n\n\tconst styleTree = CanvasTree.fromJS(stylesData.tree, componentLoader)\n\tif (!styleTree) {\n\t\treturn false\n\t}\n\n\tconst variableValues = isObject(stylesData.variableValues) ? stylesData.variableValues : {}\n\n\tlet styleNode: CanvasNode = styleTree.root\n\tif (isShapeContainerNode(styleNode) && styleNode.children.length === 1) {\n\t\tconst child = styleNode.children.at(0)\n\t\tassert(child, \"ShapeContainerNode children must be defined\")\n\t\tstyleNode = child\n\t}\n\n\tconst nodes = tree.withoutDescendants(tree.getNodes(selection))\n\tconst properties = reduceProperties(tree, engine.stores.treeStore.getDataTreeOrPartialTree(), componentLoader, nodes)\n\n\tconst nodesToMeasure = new Set<NodeID>()\n\tawait engine.scheduler.processWhenReadyAsync(() => {\n\t\tengine.beginUndoGroup()\n\n\t\ttree.getNodes(properties.expandedSelectionForShapeGeometryIds).forEach(node => {\n\t\t\tnode = node.asDraft()\n\t\t\tconst parent = tree.getParent(node.id)\n\t\t\tconst update = getCompatibleNodeProperties(\n\t\t\t\ttree,\n\t\t\t\tcomponentLoader,\n\t\t\t\tstyleNode,\n\t\t\t\tnode,\n\t\t\t\tparent,\n\t\t\t\tvariableValues,\n\t\t\t\tlimitToTrait,\n\t\t\t)\n\t\t\tengine.tree.current(node)?.set(update)\n\n\t\t\t// Migrate any outdated text nodes that might be selected\n\n\t\t\tif (isTextNode(node)) {\n\t\t\t\tconst migrationInfo = migrateTextToRichTextNode(engine, node)\n\t\t\t\tif (migrationInfo) {\n\t\t\t\t\tnode = migrationInfo.richTextNode\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If the node has/will have text fit enabled, we must queue the\n\t\t\t// node to recalculate its view box.\n\t\t\tif (isRichTextNode(node) && (node.textFitViewBoxSize || update.textFitViewBoxSize)) {\n\t\t\t\tnodesToMeasure.add(node.id)\n\t\t\t}\n\n\t\t\tif (isAnyTextNode(styleNode) && isRichTextNode(node)) {\n\t\t\t\t// Clear all text styles presets. As last step, we copy the style presets if relevant.\n\t\t\t\tif (!limitToTrait) node.setTextStylePreset(undefined, true)\n\n\t\t\t\tif (shouldApplyUpdate(TraitType.Font, limitToTrait)) {\n\t\t\t\t\tconst [font] = styleNode.getFonts(false)\n\t\t\t\t\tif (!isUndefined(font)) {\n\t\t\t\t\t\tnode.setFont(font, true)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (shouldApplyUpdate(TraitType.TextColor, limitToTrait)) {\n\t\t\t\t\tconst [textColor] = styleNode.getTextColors(false)\n\t\t\t\t\tif (!isUndefined(textColor)) {\n\t\t\t\t\t\tnode.setTextColor(textColor, true)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (shouldApplyUpdate(TraitType.FontSize, limitToTrait)) {\n\t\t\t\t\tconst [fontSize] = styleNode.getFontSizes(false)\n\t\t\t\t\tif (!isUndefined(fontSize)) {\n\t\t\t\t\t\tnode.setFontSize(fontSize, true)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (shouldApplyUpdate(TraitType.LetterSpacing, limitToTrait)) {\n\t\t\t\t\tconst [letterSpacing] = styleNode.getLetterSpacings(false)\n\t\t\t\t\tif (!isUndefined(letterSpacing)) {\n\t\t\t\t\t\tnode.setLetterSpacing(migrateLetterSpacing(letterSpacing), true)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (shouldApplyUpdate(TraitType.TextTransform, limitToTrait)) {\n\t\t\t\t\tconst [textTransform] = styleNode.getTextTransforms(false)\n\t\t\t\t\tif (!isUndefined(textTransform)) {\n\t\t\t\t\t\tnode.setTextTransform(textTransform, true)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (shouldApplyUpdate(TraitType.TextDecoration, limitToTrait)) {\n\t\t\t\t\tconst [textDecoration] = styleNode.getTextDecorations(false)\n\t\t\t\t\tif (!isUndefined(textDecoration)) {\n\t\t\t\t\t\tnode.setTextDecoration(textDecoration, true)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (shouldApplyUpdate(TraitType.LineHeight, limitToTrait)) {\n\t\t\t\t\tconst [lineHeight] = styleNode.getLineHeights(false)\n\t\t\t\t\tif (!isUndefined(lineHeight)) {\n\t\t\t\t\t\tnode.setLineHeight(lineHeight, true)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (shouldApplyUpdate(TraitType.TextAlignment, limitToTrait)) {\n\t\t\t\t\tconst [textAlignment] = styleNode.getTextAlignments(false)\n\t\t\t\t\tif (!isUndefined(textAlignment)) {\n\t\t\t\t\t\tnode.setTextAlignment(textAlignment, true)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isRichTextNode(styleNode) && isRichTextNode(node)) {\n\t\t\t\tif (shouldApplyUpdate(TraitType.TextColor, limitToTrait)) {\n\t\t\t\t\tconst [fill] = styleNode.getFills()\n\t\t\t\t\tnode.setFill(fill)\n\t\t\t\t}\n\n\t\t\t\tif (shouldApplyUpdate(TraitType.TextStroke, limitToTrait)) {\n\t\t\t\t\tconst [textStrokeWidth] = styleNode.getTextStrokeWidths(false)\n\t\t\t\t\tif (!isUndefined(textStrokeWidth)) {\n\t\t\t\t\t\tnode.setTextStrokeWidth(textStrokeWidth, true)\n\t\t\t\t\t}\n\n\t\t\t\t\tconst [textStrokeColor] = styleNode.getTextStrokeColors(false)\n\t\t\t\t\tif (!isUndefined(textStrokeColor)) {\n\t\t\t\t\t\tnode.setTextStrokeColor(textStrokeColor, true)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (shouldApplyUpdate(TraitType.TextDecoration, limitToTrait)) {\n\t\t\t\t\tconst [textDecorationColor] = styleNode.getTextDecorationColors(false)\n\t\t\t\t\tif (!isUndefined(textDecorationColor)) {\n\t\t\t\t\t\tnode.setTextDecorationColor(textDecorationColor, true)\n\t\t\t\t\t}\n\n\t\t\t\t\tconst [textDecorationOffset] = styleNode.getTextDecorationOffsets(false)\n\t\t\t\t\tif (!isUndefined(textDecorationOffset)) {\n\t\t\t\t\t\tnode.setTextDecorationOffset(textDecorationOffset, true)\n\t\t\t\t\t}\n\n\t\t\t\t\tconst [textDecorationThickness] = styleNode.getTextDecorationThicknesses(false)\n\t\t\t\t\tif (!isUndefined(textDecorationThickness)) {\n\t\t\t\t\t\tnode.setTextDecorationThickness(textDecorationThickness, true)\n\t\t\t\t\t}\n\n\t\t\t\t\tconst [textDecorationStyle] = styleNode.getTextDecorationStyles(false)\n\t\t\t\t\tif (!isUndefined(textDecorationStyle)) {\n\t\t\t\t\t\tnode.setTextDecorationStyle(textDecorationStyle, true)\n\t\t\t\t\t}\n\n\t\t\t\t\tconst [textDecorationSkipInk] = styleNode.getTextDecorationSkipInks(false)\n\t\t\t\t\tif (!isUndefined(textDecorationSkipInk)) {\n\t\t\t\t\t\tnode.setTextDecorationSkipInk(textDecorationSkipInk, true)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (shouldApplyUpdate(TraitType.TextBackgroundColor, limitToTrait)) {\n\t\t\t\t\tconst [textBackgroundColor] = styleNode.getTextBackgroundColors(false)\n\t\t\t\t\tif (!isUndefined(textBackgroundColor)) {\n\t\t\t\t\t\tnode.setTextBackgroundColor(textBackgroundColor, true)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (shouldApplyUpdate(TraitType.OpenTypeFontFeatures, limitToTrait)) {\n\t\t\t\t\tconst [openTypeFontFeatures] = styleNode.getOpenTypeFontFeatures(false)\n\n\t\t\t\t\tif (!isUndefined(openTypeFontFeatures)) {\n\t\t\t\t\t\tnode.setOpenTypeFontFeatures(openTypeFontFeatures, true)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (shouldApplyUpdate(TraitType.Font, limitToTrait)) {\n\t\t\t\t\tconst [variationAxes] = styleNode.getVariationAxes(false)\n\t\t\t\t\tif (!isUndefined(variationAxes)) {\n\t\t\t\t\t\tconst [fontSelector] = styleNode.getFonts(false)\n\t\t\t\t\t\tif (!isUndefined(fontSelector)) {\n\t\t\t\t\t\t\tconst selectorWithNewAxes = replaceEncodedAxesInSelector(fontSelector, variationAxes)\n\t\t\t\t\t\t\tnode.setFont(selectorWithNewAxes, true)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!limitToTrait) {\n\t\t\t\t\t// Paste the preset of the first block as the preset for every block.\n\t\t\t\t\tconst [textStylePresetId] = styleNode.getTextStylePresets(false)\n\t\t\t\t\tconst textStylePresetNode = tree.get(textStylePresetId)\n\t\t\t\t\tif (isTextStylePresetPrimaryNode(textStylePresetNode)) {\n\t\t\t\t\t\tnode.setTextStylePreset(textStylePresetNode, true)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Paste the first link style we find onto all links.\n\t\t\t\t\tconst [linkStylePresetId] = styleNode.getLinkStylePresets(false)\n\t\t\t\t\tconst linkStylePresetNode = tree.get(linkStylePresetId)\n\t\t\t\t\tif (isLinkStylePresetNode(linkStylePresetNode)) {\n\t\t\t\t\t\tnode.setLinkStylePreset(linkStylePresetNode, true)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t})\n\n\ttry {\n\t\tawait enableTextFit(engine, Array.from(nodesToMeasure))\n\t} catch {\n\t\t// Swallow the error so that we always end the undo group.\n\t}\n\n\treturn engine.scheduler.processWhenReadyAsync(() => {\n\t\tengine.endUndoGroup()\n\t\treturn true\n\t})\n}\n\n/**\n * Gets the allowed trait limits based on the traits defined on the clipboard and the traits the paste action desires.\n * The final result cannot allow more traits than the clipboard is restricted to, but it can limit it further.\n */\nexport function getPasteableTraits(\n\tlimitToTraitFromClipboard: TraitType | TraitType[] | undefined,\n\tlimitToTraitFromPaste: TraitType | TraitType[] | undefined,\n): TraitType | TraitType[] | undefined {\n\tif (isUndefined(limitToTraitFromPaste)) return limitToTraitFromClipboard\n\tif (\n\t\tisUndefined(limitToTraitFromClipboard) ||\n\t\t(isArray(limitToTraitFromClipboard) && limitToTraitFromClipboard.length === 0)\n\t) {\n\t\treturn limitToTraitFromPaste\n\t}\n\t// If the traits for paste are not the same as the trait limit on the clipboard then we don't want to paste any traits\n\tif (isString(limitToTraitFromClipboard) && isString(limitToTraitFromPaste)) {\n\t\treturn limitToTraitFromPaste === limitToTraitFromClipboard ? limitToTraitFromClipboard : []\n\t}\n\n\tconst limitsFromClipboard = isArray(limitToTraitFromClipboard)\n\t\t? limitToTraitFromClipboard\n\t\t: [limitToTraitFromClipboard]\n\tconst limitsFromPaste = isArray(limitToTraitFromPaste) ? limitToTraitFromPaste : [limitToTraitFromPaste]\n\n\t// Return the intersection of the two sets\n\treturn limitsFromClipboard.filter(limit => limitsFromPaste.includes(limit))\n}\n", "import type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport {\n\tisCodeComponentNode,\n\tisFrameNode,\n\tisRichTextNode,\n\tisSVGNode,\n\tisShapeContainerNode,\n} from \"document/models/CanvasTree/nodes/utils/nodeCheck.ts\"\nimport { isReplicaOrReplicaChild } from \"document/models/CanvasTree/traits/WithTemplate.ts\"\nimport { isVariant } from \"document/models/CanvasTree/traits/WithVariant.ts\"\nimport { isNull } from \"utils/typeChecks.ts\"\n\nexport const canPasteInPlace = (selectedNode: CanvasNode | null) => {\n\tif (isNull(selectedNode)) return false\n\tif (isVariant(selectedNode)) return false\n\tif (isReplicaOrReplicaChild(selectedNode)) return false\n\treturn (\n\t\tisFrameNode(selectedNode) ||\n\t\tisSVGNode(selectedNode) ||\n\t\tisRichTextNode(selectedNode) ||\n\t\tisShapeContainerNode(selectedNode) ||\n\t\tisCodeComponentNode(selectedNode)\n\t)\n}\n", "import { createAbsoluteImageAssetURL, isAssetReference, parseAssetReference } from \"@framerjs/assets\"\nimport type { ComponentLoader } from \"@framerjs/framer-runtime\"\nimport type { VekterEngine } from \"document/VekterEngine.ts\"\nimport { collectImagesFromSubtree } from \"document/components/tools/utils/collectImages.ts\"\nimport { RenamedIds, updateNodeConnections } from \"document/components/tools/utils/updateNodeConnections.ts\"\nimport { ContextAction } from \"document/components/utils/contextActions.ts\"\nimport type { CanvasNode, NodeID } from \"document/models/CanvasTree/index.ts\"\nimport { CanvasTree } from \"document/models/CanvasTree/index.ts\"\nimport { CanvasChildList } from \"document/models/CanvasTree/nodes/ChildList.ts\"\nimport { isDynamicValue } from \"document/models/CanvasTree/traits/DynamicValue.ts\"\nimport type { TraitType } from \"document/models/CanvasTree/traits/TraitType.ts\"\nimport { withChildren } from \"document/models/CanvasTree/traits/WithChildren.ts\"\nimport type { WithCursor } from \"document/models/CanvasTree/traits/WithCursor.ts\"\nimport { cursorDefaults, withCursor } from \"document/models/CanvasTree/traits/WithCursor.ts\"\nimport {\n\tgetFloatingPositionProps,\n\thasFloatingPosition,\n\twithFloatingPosition,\n} from \"document/models/CanvasTree/traits/WithFloatingPosition.ts\"\nimport type { OverlayGrid } from \"document/models/CanvasTree/traits/WithOverlayGrid.ts\"\nimport { isPinnable } from \"document/models/CanvasTree/traits/WithPins.ts\"\nimport type { WithRotation } from \"document/models/CanvasTree/traits/WithRotation.ts\"\nimport { withRotation } from \"document/models/CanvasTree/traits/WithRotation.ts\"\nimport type { WithTransforms } from \"document/models/CanvasTree/traits/WithTransforms.ts\"\nimport { transformDefaults, withTransforms } from \"document/models/CanvasTree/traits/WithTransforms.ts\"\nimport { withZIndex } from \"document/models/CanvasTree/traits/WithZIndex.ts\"\nimport { addGridToSelection } from \"document/models/CanvasTree/traits/utils/addGridsToSelection.ts\"\nimport type { AllEffects } from \"document/models/CanvasTree/traits/utils/effects.ts\"\nimport { setEffects } from \"document/models/CanvasTree/traits/utils/effects.ts\"\nimport { setPageEffects } from \"document/models/CanvasTree/traits/utils/pageEffects.ts\"\nimport { getCSSTextForNode } from \"document/models/CanvasTree/traits/utils/styleForNode.ts\"\nimport { removeAllTokensFromNodeTree } from \"document/models/CanvasTree/utils/tokenMap.ts\"\nimport type { Transition } from \"document/models/Transition.ts\"\nimport { isPartialTransition, toVekterTransition } from \"document/models/Transition.ts\"\nimport { isEditingText } from \"document/utils/isEditingText.ts\"\nimport { isValidColorOrToken } from \"document/utils/isValidColorOrToken.ts\"\nimport { splitCSSValueList } from \"document/utils/splitCSSValueList.ts\"\nimport { wantsNativeTextActions } from \"document/utils/wantsNativeTextActions.ts\"\nimport type { Point } from \"library/index.ts\"\nimport type { RoutePageEffects } from \"library/router/pageEffects/types.ts\"\nimport { getFramerAssetSrc } from \"prosemirror/schema/image.ts\"\nimport type { FigmaClipboardData } from \"utils/clipboard/handlers.ts\"\nimport {\n\tembedClipboardHandler,\n\tfigmaClipboardHandler,\n\tframerLayersClipboardHandler,\n\timagesClipboardHandler,\n\tisFigmaClipboardData,\n\tmoduleClipboardHandler,\n\tsvgClipboardHandler,\n\tvideosClipboardHandler,\n} from \"utils/clipboard/handlers.ts\"\nimport { clipboardRead, clipboardReadType, clipboardWrite } from \"utils/clipboard/index.ts\"\nimport { getKeys } from \"utils/getKeys.ts\"\nimport { parseHTML } from \"utils/parseHTML.ts\"\nimport { showCopyFailToast } from \"utils/showCopyFailToast.ts\"\nimport { isArray, isNumber, isObject, isString } from \"utils/typeChecks.ts\"\nimport { forEachVariableReferenceOfNode } from \"utils/updateDynamicValues.ts\"\nimport { getIsViewOnly } from \"web/pages/project/permissions/isViewOnly.ts\"\nimport { getClipboardData } from \"./getClipboardData.ts\"\nimport { getCopiedAssets } from \"./getCopiedAssets.ts\"\nimport { framerCollectionsClipboardHandler } from \"./helpers/collections.ts\"\nimport { htmlImportExtensionClipboardHandler } from \"./helpers/html.ts\"\nimport { isFramerLayersClipboardData } from \"./helpers/isFramerLayersClipboardData.ts\"\nimport { plainTextClipboardHandler } from \"./helpers/plainText.ts\"\nimport type { FramerStylesClipboardData } from \"./helpers/styles.ts\"\nimport { framerStylesClipboardHandler, isFramerStylesClipboardData } from \"./helpers/styles.ts\"\nimport type { FramerLayersClipboardData } from \"./helpers/types.ts\"\nimport { canPasteInPlace } from \"./pasteInPlace.ts\"\n\nexport namespace Clipboard {\n\texport const cut = async (engine: VekterEngine, event?: ClipboardEvent) => {\n\t\tif (isEditingText()) return\n\t\tif (wantsNativeTextActions()) return\n\t\tif (engine.stores.chromeStore.overlay) return\n\t\tif (!engine.stores.toolStore.isDefaultToolActive) return\n\t\tconst selection = engine.stores.selectionStore.ids\n\t\tif (selection.length === 0) return\n\t\tawait Clipboard.copy(engine, event)\n\n\t\tconst nodes = engine.tree.getNodes(selection)\n\t\tif (!ContextAction.canDeleteOrHideNodes(engine, nodes)) {\n\t\t\treturn\n\t\t}\n\n\t\tengine.scheduler.process(() => {\n\t\t\tContextAction.deleteOrHideNodes(engine, nodes)\n\t\t})\n\t}\n\n\texport const copy = async (engine: VekterEngine, event?: ClipboardEvent, nodesToCopy?: NodeID[]) => {\n\t\tif (isEditingText()) return\n\t\tif (wantsNativeTextActions()) return\n\t\tif (engine.stores.chromeStore.overlay) return\n\t\tif (!engine.stores.toolStore.isDefaultToolActive) return\n\t\tconst nodeIds = nodesToCopy ?? engine.stores.selectionStore.ids\n\t\tif (nodeIds.length === 0) return\n\n\t\tif (!ContextAction.canCopyNodes(engine.tree.getNodes(nodeIds))) {\n\t\t\tshowCopyFailToast()\n\t\t\treturn\n\t\t}\n\n\t\tconst clipboardData = getClipboardData(engine, nodeIds)\n\n\t\t// I don't think this is necessary once we only use the new clipboard API's\n\t\tevent?.preventDefault()\n\n\t\tawait clipboardWrite({ \"application/x-framer-layers\": clipboardData }, event)\n\t}\n\n\texport const paste = async (\n\t\tengine: VekterEngine,\n\t\toptions: {\n\t\t\tposition: Point\n\t\t},\n\t\tevent?: ClipboardEvent,\n\t) => {\n\t\tif (getIsViewOnly(engine, \"canDesign\")) return\n\t\tif (!engine.stores.toolStore.isDefaultToolActive) return\n\t\tif (engine.stores.chromeStore.isPreviewingLocaleOnCanvas) return\n\t\tif (engine.stores.chromeStore.overlay) return\n\n\t\tconst clipboardData = await clipboardRead(\n\t\t\t[\n\t\t\t\t\"text/plain\",\n\t\t\t\t\"text/html\",\n\t\t\t\t\"image/*\",\n\t\t\t\t\"video/*\",\n\t\t\t\t\"application/x-framer-layers\",\n\t\t\t\t\"application/x-framer-figma-plugin\",\n\t\t\t\t\"application/x-framer-html-import-extension\",\n\t\t\t],\n\t\t\tevent,\n\t\t)\n\t\tif (!clipboardData) return\n\n\t\tconst textClipboardData = clipboardData[\"text/plain\"]?.trim()\n\t\tconst htmlClipboardData = clipboardData[\"text/html\"]\n\t\tconst imageFiles = clipboardData[\"image/*\"]\n\t\tconst videoFiles = clipboardData[\"video/*\"]\n\t\tlet figmaPluginClipboardData: FigmaClipboardData | undefined\n\t\tif (isFigmaClipboardData(clipboardData[\"application/x-framer-figma-plugin\"])) {\n\t\t\tfigmaPluginClipboardData = clipboardData[\"application/x-framer-figma-plugin\"]\n\t\t}\n\t\tlet layersData: FramerLayersClipboardData | undefined\n\t\tif (isFramerLayersClipboardData(clipboardData[\"application/x-framer-layers\"])) {\n\t\t\tlayersData = clipboardData[\"application/x-framer-layers\"]\n\t\t}\n\n\t\tlet importExtensionHTML: HTMLElement | undefined\n\t\tif (clipboardData[\"application/x-framer-html-import-extension\"] instanceof HTMLElement) {\n\t\t\timportExtensionHTML = clipboardData[\"application/x-framer-html-import-extension\"]\n\t\t}\n\n\t\tconst { position } = options\n\n\t\tif (await embedClipboardHandler(engine, textClipboardData, position)) {\n\t\t\t// eslint-disable-next-line framer-studio/async-preventdefault -- TODO: This is probably buggy but has been untouched since 2 years\n\t\t\tevent?.preventDefault()\n\t\t\treturn\n\t\t}\n\n\t\tif (await figmaClipboardHandler(engine, figmaPluginClipboardData, htmlClipboardData, position)) {\n\t\t\t// eslint-disable-next-line framer-studio/async-preventdefault -- TODO: This is probably buggy but has been untouched since 2 years\n\t\t\tevent?.preventDefault()\n\t\t\treturn\n\t\t}\n\n\t\tif (await imagesClipboardHandler(engine, imageFiles, position, event)) {\n\t\t\t// We do not do event.preventDefault here, because filesClipboardHandler already does that.\n\t\t\treturn\n\t\t}\n\n\t\tif (await videosClipboardHandler(engine, videoFiles, position, event)) {\n\t\t\t// We do not do event.preventDefault here, because filesClipboardHandler already does that.\n\t\t\treturn\n\t\t}\n\n\t\tif (await framerLayersClipboardHandler({ engine, layersData, position })) {\n\t\t\t// eslint-disable-next-line framer-studio/async-preventdefault -- TODO: This is probably buggy but has been untouched since 2 years\n\t\t\tevent?.preventDefault()\n\t\t\treturn\n\t\t}\n\n\t\tif (textClipboardData && isEditingText()) {\n\t\t\t// The user is editing text content or code, so don't paste this content to the canvas.\n\t\t\treturn\n\t\t}\n\n\t\tif (await moduleClipboardHandler(engine, textClipboardData, position)) {\n\t\t\t// eslint-disable-next-line framer-studio/async-preventdefault -- TODO: This is probably buggy but has been untouched since 2 years\n\t\t\tevent?.preventDefault()\n\t\t\treturn\n\t\t}\n\n\t\tif (await svgClipboardHandler(engine, textClipboardData, position)) {\n\t\t\t// eslint-disable-next-line framer-studio/async-preventdefault -- TODO: This is probably buggy but has been untouched since 2 years\n\t\t\tevent?.preventDefault()\n\t\t\treturn\n\t\t}\n\n\t\tif (await htmlImportExtensionClipboardHandler(engine, importExtensionHTML, position)) {\n\t\t\t// eslint-disable-next-line framer-studio/async-preventdefault -- TODO: This is probably buggy but has been untouched since 2 years\n\t\t\tevent?.preventDefault()\n\t\t\treturn\n\t\t}\n\n\t\t// TODO: handle pasted rich text formatting with html\n\n\t\tif (await plainTextClipboardHandler(engine, textClipboardData, position, event)) {\n\t\t\t// We do not do event.preventDefault here, because plainTextClipboardHandler already does that.\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Helpers\n\n\texport const copyStyle = async (\n\t\ttree: CanvasTree,\n\t\tcomponentLoader: ComponentLoader,\n\t\tnode: CanvasNode,\n\t\tsourceProjectId: string,\n\t\tlimitToTrait?: TraitType | TraitType[],\n\t) => {\n\t\t// Just copy the complete node over for now, use the tree as serialization format\n\t\tlet clone = node.clone()\n\t\tif (withChildren(clone)) {\n\t\t\tclone = clone.set({ children: new CanvasChildList() })\n\t\t}\n\t\tconst styleTree = CanvasTree.createByAdoptingRoot(clone)\n\n\t\tconst usedVariableValueMap: Record<string, any> = {}\n\n\t\tforEachVariableReferenceOfNode(tree, node, \"excludeInherited\", \"readsRawNodeData\", undefined, variableReference => {\n\t\t\tconst variableValue = node.cache.getVariableReferenceValue(variableReference)\n\t\t\tif (variableValue !== undefined) {\n\t\t\t\tusedVariableValueMap[variableReference.id] = variableValue\n\t\t\t}\n\t\t})\n\n\t\t// TODO this method is copied from the `Clipboard.copy`, we should find\n\t\t// a way to consolidate these.\n\t\tconst images = new Set<string>()\n\t\tcollectImagesFromSubtree(componentLoader, styleTree.root, images)\n\t\tconst assets = getCopiedAssets(Array.from(images))\n\n\t\tconst styleData: FramerStylesClipboardData = {\n\t\t\ttree: styleTree.toJS(),\n\t\t\tvariableValues: usedVariableValueMap,\n\t\t\tassets,\n\t\t\tsourceProjectId,\n\t\t\tlimitToTrait,\n\t\t}\n\n\t\tawait clipboardWrite({\n\t\t\t\"application/x-framer-style-v2\": styleData,\n\t\t})\n\t}\n\n\texport const copyAnimationTransition = async (transition: Transition & Record<string, any>) => {\n\t\tawait clipboardWrite({\n\t\t\t\"application/x-framer-animation-transition\": transition,\n\t\t})\n\t}\n\n\texport const getAnimationTransition = async (): Promise<Transition | undefined> => {\n\t\tconst transition = await clipboardReadType(\"application/x-framer-animation-transition\")\n\t\tif (isPartialTransition(transition)) {\n\t\t\treturn toVekterTransition(transition)\n\t\t}\n\t}\n\n\texport const copyGridOverlay = async (grid: OverlayGrid & Record<string, string | number | boolean | number[]>) => {\n\t\tawait clipboardWrite({\n\t\t\t\"application/x-framer-layout-grid\": grid,\n\t\t})\n\t}\n\n\texport const getGridOverlay = async (): Promise<OverlayGrid | undefined> => {\n\t\tconst grid = await clipboardReadType(\"application/x-framer-layout-grid\")\n\t\t// TODO: check the type\n\t\treturn grid as OverlayGrid\n\t}\n\n\texport const pasteGridOverlay = async (engine: VekterEngine, selection: NodeID[]) => {\n\t\tconst grid = await getGridOverlay()\n\t\tif (!grid) return\n\t\tengine.scheduler.process(() => {\n\t\t\taddGridToSelection({ engine, selection, source: \"paste\", overlayGrid: grid })\n\t\t})\n\t}\n\n\texport const copyEffects = async (effects: Partial<AllEffects>) => {\n\t\tawait clipboardWrite({\n\t\t\t\"application/x-framer-effects\": effects,\n\t\t})\n\t}\n\n\texport const copyPageEffects = async (pageEffects: RoutePageEffects) => {\n\t\tawait clipboardWrite({\n\t\t\t\"application/x-framer-page-effects\": pageEffects,\n\t\t})\n\t}\n\n\texport const pasteEffects = async (engine: VekterEngine, selection: NodeID[]) => {\n\t\tconst effects = await clipboardReadType(\"application/x-framer-effects\")\n\t\tif (!effects) return\n\t\tengine.scheduler.process(() => {\n\t\t\tsetEffects(engine.tree, selection, effects as Partial<AllEffects>)\n\t\t})\n\t}\n\n\texport const pastePageEffects = async (engine: VekterEngine, selection: NodeID[], routeId?: string) => {\n\t\tconst pageEffects = await clipboardReadType(\"application/x-framer-page-effects\")\n\t\tif (!pageEffects) return\n\n\t\tengine.scheduler.process(() => {\n\t\t\tsetPageEffects(engine.tree, selection, pageEffects as RoutePageEffects, routeId)\n\t\t})\n\t}\n\n\texport const copyCursors = async (cursors: Partial<WithCursor>) => {\n\t\tconst update: Partial<WithCursor> = {}\n\n\t\tfor (const key of getKeys(cursorDefaults)) {\n\t\t\tcollectValuesFromPartialSource(key, cursors, update)\n\t\t}\n\n\t\tawait clipboardWrite({\n\t\t\t\"application/x-framer-cursors\": update,\n\t\t})\n\t}\n\n\texport const pasteCursors = async (engine: VekterEngine, selection: NodeID[]) => {\n\t\tconst cursors = await clipboardReadType(\"application/x-framer-cursors\")\n\t\tif (!isObject(cursors)) return\n\n\t\tconst update: Partial<WithCursor> = {}\n\n\t\tfor (const key of getKeys(cursorDefaults)) {\n\t\t\tcollectValuesFromPartialSource(key, cursors, update)\n\t\t}\n\n\t\tengine.scheduler.process(() => {\n\t\t\tfor (const node of engine.tree.getNodesWithTrait(selection, withCursor)) {\n\t\t\t\tnode.set(update)\n\t\t\t}\n\t\t})\n\t}\n\n\texport const copyTransforms = async (node: CanvasNode & WithTransforms) => {\n\t\tconst update: Partial<WithTransforms & WithRotation> = {}\n\n\t\tfor (const key of getKeys(transformDefaults)) {\n\t\t\tcollectValuesFromPartialSource(key, node, update)\n\t\t}\n\n\t\tif (withRotation(node)) update.rotation = node.rotation\n\n\t\tawait clipboardWrite({\n\t\t\t\"application/x-framer-transforms\": update,\n\t\t})\n\t}\n\n\texport const pasteTransforms = async (engine: VekterEngine, selection: NodeID[]) => {\n\t\tconst data = await clipboardReadType(\"application/x-framer-transforms\")\n\t\tif (!isObject(data)) return\n\n\t\tconst transforms: Partial<WithTransforms> = {}\n\n\t\tfor (const key of getKeys(transformDefaults)) {\n\t\t\tcollectValuesFromPartialSource(key, data, transforms)\n\t\t}\n\n\t\tengine.scheduler.process(() => {\n\t\t\tfor (const node of engine.tree.getNodes(selection)) {\n\t\t\t\tif (withTransforms(node)) node.set(transforms)\n\t\t\t\tif (withRotation(node) && (isNumber(data.rotation) || isDynamicValue(data.rotation))) {\n\t\t\t\t\tnode.set({ rotation: data.rotation })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\texport const pasteInPlace = async (engine: VekterEngine) => {\n\t\t// 1) get the position of the selected layer\n\t\tconst selection = engine.stores.selectionStore.nodes\n\t\tconst selectedNode = selection.length === 1 ? selection[0] : null\n\n\t\tif (!selectedNode || !canPasteInPlace(selectedNode) || !isPinnable(selectedNode)) return\n\t\tconst selectedNodeRect = engine.tree.getRect(selectedNode)\n\t\tconst constraints = selectedNode.constraintValues()\n\t\tconst parentNode = engine.tree.getParent(selectedNode.id)\n\t\tconst parentSizeInfo = engine.tree.getParentSizeInfo(selectedNode)\n\t\tconst indexOfSelectedNode = parentNode\n\t\t\t? engine.tree.getParent(selectedNode.id)?.children?.indexOf(selectedNode)\n\t\t\t: undefined\n\n\t\tconst activeScopeNode = engine.stores.scopeStore.active\n\n\t\tconst clipboardData = await clipboardRead([\"application/x-framer-layers\"])\n\t\tif (!clipboardData) return\n\t\tconst layersData = clipboardData[\"application/x-framer-layers\"]\n\t\tif (!isFramerLayersClipboardData(layersData)) return\n\n\t\t// 2) insert the paste layers\n\t\tawait framerLayersClipboardHandler({\n\t\t\tengine,\n\t\t\tinsertTarget: { parentId: parentNode?.id ?? activeScopeNode.id },\n\t\t\tlayersData,\n\t\t\tonInsertNode: copiedNode => {\n\t\t\t\tif (!isPinnable(copiedNode)) return\n\t\t\t\tconst update = copiedNode.updateForRect({\n\t\t\t\t\trect: selectedNodeRect,\n\t\t\t\t\tparentSizeInfo,\n\t\t\t\t\tconstraintsLocked: false,\n\t\t\t\t\tshouldGuessPinToBottom: false,\n\t\t\t\t\tshouldGuessPinToRight: false,\n\t\t\t\t})\n\t\t\t\tcopiedNode.set({\n\t\t\t\t\t...constraints,\n\t\t\t\t\t...update,\n\t\t\t\t})\n\n\t\t\t\tif (hasFloatingPosition(selectedNode) && withFloatingPosition(copiedNode)) {\n\t\t\t\t\tcopiedNode.set(getFloatingPositionProps(selectedNode))\n\t\t\t\t\t// Prevent setting a lower z-index on a relative overlay.\n\t\t\t\t\tif (withZIndex(selectedNode) && withZIndex(copiedNode)) {\n\t\t\t\t\t\tcopiedNode.set({ zIndex: selectedNode.zIndex })\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (parentNode) {\n\t\t\t\t\tengine.tree.moveNode(copiedNode, parentNode.id, indexOfSelectedNode)\n\t\t\t\t\tupdateNodeConnections(\n\t\t\t\t\t\tengine.tree,\n\t\t\t\t\t\tengine.componentLoader,\n\t\t\t\t\t\tparentNode,\n\t\t\t\t\t\tnew RenamedIds([[selectedNode.id, copiedNode.id]]),\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t)\n\t\t\t\t}\n\n\t\t\t\t// 3) delete the selected layer. We must delete after inserting\n\t\t\t\t//    the new layer to ensure that any overlay actions are not\n\t\t\t\t//    cleaned up prematurely.\n\t\t\t\tengine.deleteNode(selectedNode.id)\n\t\t\t},\n\t\t\tposition: { x: 0, y: 0 },\n\t\t\treplace: true,\n\t\t})\n\t}\n\n\texport const copyText = async (text: string) => {\n\t\tawait clipboardWrite({\n\t\t\t\"text/plain\": text,\n\t\t})\n\t}\n\n\texport const copyCSS = async (css: string) => {\n\t\tawait clipboardWrite({\n\t\t\t\"text/plain\": css,\n\t\t\t\"text/css\": css,\n\t\t})\n\t}\n\n\texport const copyCSSForNode = async (node: CanvasNode, engine: VekterEngine) => {\n\t\tconst clone = removeAllTokensFromNodeTree(node, engine.tree, engine.stores.documentSettingsStore.hasDarkAppearance)\n\t\tconst css = getCSSTextForNode(engine.tree, engine.componentLoader, clone)\n\t\treturn Clipboard.copyCSS(css)\n\t}\n\n\texport const copySVG = async (svg: string) => {\n\t\tawait clipboardWrite({\n\t\t\t\"text/plain\": svg,\n\t\t})\n\t}\n\n\texport const copyColorArray = async (colors: string[]) => {\n\t\tif (colors.length === 0 || !colors.every(isValidColorOrToken)) return\n\t\tawait clipboardWrite({\n\t\t\t\"text/plain\": colors.join(\", \"),\n\t\t})\n\t}\n\n\texport const pasteColorArray = async (): Promise<string[] | null> => {\n\t\tconst text = await clipboardReadType(\"text/plain\")\n\t\tif (!isString(text)) return null\n\t\tconst tokens = splitCSSValueList(text)\n\t\tif (tokens.length === 0) return null\n\t\tif (!tokens.every(isValidColorOrToken)) return null\n\t\treturn tokens\n\t}\n\n\texport const copyImage = async (assetReference: string) => {\n\t\tif (!isAssetReference(assetReference)) return\n\t\tconst parsed = parseAssetReference(assetReference)\n\t\tif (!parsed) return\n\t\tconst absoluteURL = createAbsoluteImageAssetURL(parsed.identifier)\n\n\t\tconst img = document.createElement(\"img\")\n\t\t// Same attribute as in vekter/src/prosemirror/schema/image.ts. Helps to pull\n\t\t// an existing asset instead of uploading a new one.\n\t\timg.dataset.framerAsset = assetReference\n\t\timg.src = absoluteURL\n\n\t\tawait clipboardWrite({\n\t\t\t\"text/plain\": absoluteURL,\n\t\t\t\"text/html\": img.outerHTML,\n\t\t})\n\t}\n\n\texport type PastedImage = { type: \"asset-reference\"; reference: string } | { type: \"file\"; file: File }\n\n\texport const pasteImage = async (): Promise<PastedImage | null> => {\n\t\tconst html = await clipboardReadType(\"text/html\")\n\t\tif (isString(html)) {\n\t\t\tconst img = parseHTML(html).querySelector<HTMLImageElement>(\"img\")\n\t\t\tif (img) {\n\t\t\t\tconst src = getFramerAssetSrc(img)\n\t\t\t\tif (isAssetReference(src)) return { type: \"asset-reference\", reference: src }\n\t\t\t}\n\t\t}\n\t\tconst text = await clipboardReadType(\"text/plain\")\n\t\tif (isString(text) && isAssetReference(text)) return { type: \"asset-reference\", reference: text }\n\n\t\t// Fall back to uploading a raw image file from the clipboard when no asset reference is present\n\t\tconst files = await clipboardReadType(\"image/*\")\n\t\tconst file = isArray(files) ? files[0] : undefined\n\t\tif (!file) return null\n\n\t\tif (file instanceof File) return { type: \"file\", file }\n\n\t\treturn null\n\t}\n\n\texport const getStyleData = async (event: ClipboardEvent | undefined) => {\n\t\tconst stylesData = await clipboardReadType(\"application/x-framer-style-v2\", event)\n\t\treturn isFramerStylesClipboardData(stylesData) ? stylesData : undefined\n\t}\n\n\texport const pasteStyle = async (\n\t\tengine: VekterEngine,\n\t\tselection: NodeID[],\n\t\tevent: ClipboardEvent | undefined,\n\t\tlimitPasteToTrait?: TraitType | TraitType[],\n\t) => {\n\t\tconst stylesData = await getStyleData(event)\n\t\tif (!stylesData) return\n\t\tawait framerStylesClipboardHandler(engine, selection, stylesData, limitPasteToTrait)\n\t}\n\n\texport async function pasteCollections(engine: VekterEngine, event?: ClipboardEvent, selection?: NodeID) {\n\t\tconst clipboardData = await clipboardRead([\"application/x-framer-layers\", \"text/plain\"], event)\n\t\tif (!clipboardData) return\n\n\t\tconst collectionsData = clipboardData[\"application/x-framer-layers\"]\n\t\tif (await framerCollectionsClipboardHandler(engine, collectionsData)) {\n\t\t\t// eslint-disable-next-line framer-studio/async-preventdefault -- TODO: This is probably buggy but has been untouched since 2 years\n\t\t\tevent?.preventDefault()\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunction collectValuesFromPartialSource<T>(key: keyof T, source: Partial<T>, target: Partial<T>): void {\n\tif (key in source) {\n\t\ttarget[key] = source[key]\n\t}\n}\n", "import type { DependencyList } from \"react\"\nimport { useCallback } from \"react\"\nimport { useBaseEngine } from \"./base-engine/BaseEngine.ts\"\n\nexport function useEngineCallback<This, Args extends unknown[], Return>(\n\tcallback: (this: This, ...args: Args) => Return,\n\tdeps: DependencyList,\n) {\n\tconst engine = useBaseEngine()\n\treturn useCallback(engine.scheduler.wrapHandler(callback), deps)\n}\n", "export const stopPropagation = (event: React.MouseEvent) => event.stopPropagation()\n", "import type { CanvasNode } from \"document/models/CanvasTree/nodes/CanvasNode.ts\"\nimport { isRawControlProp } from \"document/models/controlProps/RawControlProp.ts\"\nimport { isPrefixedControlPropKey } from \"document/models/controlProps/controlPropKey.ts\"\nimport { ControlType } from \"library/render/types/PropertyControls.ts\"\nimport { isString } from \"./typeChecks.ts\"\n\nconst HTML_TAG_REGEX = /<([a-z1-9]+)/gi\n\nexport function getTagsFromRichText(html: string) {\n\tconst tags = new Set<string>()\n\textractTagsFromRichText(html, tags)\n\treturn tags\n}\n\nexport function extractTagsFromRichText(html: string, tags: Set<string>) {\n\tconst matches = html.matchAll(HTML_TAG_REGEX)\n\n\tfor (const [, tag] of matches) {\n\t\tif (tag) tags.add(tag)\n\t}\n\n\treturn tags\n}\n\nexport function extractTagsFromControlProps(props: Partial<CanvasNode>, tags: Set<string>) {\n\tconst entries = Object.entries(props)\n\n\tfor (const [key, prop] of entries) {\n\t\tif (!isPrefixedControlPropKey(key)) continue\n\t\tif (!isRawControlProp(prop)) continue\n\t\tif (prop.type !== ControlType.RichText) continue\n\t\tif (!isString(prop.value)) continue\n\t\textractTagsFromRichText(prop.value, tags)\n\t}\n\n\treturn tags\n}\n", "import type { VekterEngine } from \"document/VekterEngine.ts\"\nimport { getRawWebPagePath, getWebPagePath } from \"document/components/utils/getWebPagePath.ts\"\nimport { pagePathLabel } from \"document/components/utils/pathToName.ts\"\nimport type { AnyWebPageNode, CollectionItemNode, CollectionNode } from \"document/models/CanvasTree/index.ts\"\nimport { isCollectionItemNode, isWebPageNode } from \"document/models/CanvasTree/nodes/utils/nodeCheck.ts\"\nimport { AnalyticsTabNames } from \"document/stores/AnalyticsStore.ts\"\nimport { ActiveMainView } from \"document/utils/ActiveEditorType.ts\"\nimport {\n\tgetCollectionNodeFromStackElement,\n\tgetItemNodeFromStackElement,\n} from \"document/utils/contentManagementOverlayStack.ts\"\nimport { getCollectionItemName } from \"utils/collectionUtils.ts\"\nimport { getCollectionForIdentifier } from \"utils/getCollectionForIdentifier.ts\"\n\n/**\n * Opens the analytics view applying the `collectionItemId` filter\n */\nfunction openAnalyticsFromCMSItem(\n\tengine: VekterEngine,\n\tcollection: CollectionNode,\n\tcollectionItem: CollectionItemNode,\n) {\n\tconst label = getCollectionItemName(collection, collectionItem)\n\n\tengine.stores.analyticsStore.addFilter(\"collectionItemId\", collectionItem.id, label)\n\tengine.stores.analyticsStore.open({ tab: AnalyticsTabNames.overview })\n}\n\n/**\n * Opens the analytics view,\n * if the page is a CMS collection page, it will apply the `collectionItemId` filter,\n * otherwise it will apply the `routePath` filter.\n */\nexport function openAnalyticsFromWebPage(engine: VekterEngine, webPage: AnyWebPageNode) {\n\tconst data = getCollectionAndItemFromWebPage(engine, webPage)\n\tif (data) {\n\t\treturn openAnalyticsFromCMSItem(engine, data.collection, data.collectionItem)\n\t}\n\n\tconst path = getWebPagePath(engine.tree, webPage)\n\tconst rawPath = getRawWebPagePath(engine.tree, webPage)\n\tif (!path || !rawPath) return\n\n\tconst label = pagePathLabel(path)\n\tif (path !== \"/\") {\n\t\t// The trailing slash is removed here because there are cases where the path in the route has a trailing slash\n\t\t// while the query in tinybird is normalized to not have a trailing slash\n\t\tconst normalizedRawPath = rawPath !== \"/\" && rawPath.endsWith(\"/\") ? rawPath.slice(0, -1) : rawPath\n\t\tengine.stores.analyticsStore.addFilter(\"routePath\", normalizedRawPath, label)\n\t}\n\n\tengine.stores.analyticsStore.open({ tab: AnalyticsTabNames.overview })\n}\n\nfunction getCollectionAndItemFromWebPage(\n\tengine: VekterEngine,\n\twebPage: AnyWebPageNode,\n): { collection: CollectionNode; collectionItem: CollectionItemNode } | null {\n\tif (!webPage.dataIdentifier) return null\n\n\tconst collection = getCollectionForIdentifier(engine.tree, webPage.dataIdentifier)\n\tif (!collection) return null\n\n\t// If there's a selected collection item\n\tconst collectionItemId = engine.stores.scopeStore.getSelectedCollectionItemForWebPage(webPage)\n\tif (collectionItemId) {\n\t\tconst collectionItem = engine.tree.getNodeWithTrait(collectionItemId, isCollectionItemNode)\n\t\tif (!collectionItem) return null\n\n\t\treturn { collection, collectionItem }\n\t}\n\n\t// otherwise pick the first item\n\tconst firstItem = collection.getUnsortedChildren()[0]\n\tif (!firstItem) return null\n\n\treturn {\n\t\tcollection,\n\t\tcollectionItem: firstItem,\n\t}\n}\n\n/**\n * Opens the analytics view applying the currently selected item as a filter.\n * If the experiment is off, it will just open the analytics view without applying any filters.\n * If the CMS overlay is open with a selected collection item, it will open the analytics view applying the cms item filter.\n * If the site settings is open and the active tab is a page tab, it will open the analytics view applying the page filter.\n * Otherwise, it will try to get the active web page from the selection, and if the page is a CMS collection page, it will apply the `collectionItemId` filter otherwise it will apply the page filter.\n */\nexport function openAnalyticsFromCurrentlySelectedItem(engine: VekterEngine) {\n\tconst collectionAndItem = getSelectedCollectionAndItem(engine)\n\tif (collectionAndItem) {\n\t\treturn openAnalyticsFromCMSItem(engine, collectionAndItem.collection, collectionAndItem.collectionItem)\n\t}\n\n\tconst selectedWebPage = getSelectedWebPageFromSiteSettings(engine)\n\tif (selectedWebPage) {\n\t\tengine.stores.siteSettingsStore.close()\n\t\treturn openAnalyticsFromWebPage(engine, selectedWebPage)\n\t}\n\n\t// The site settings is open, but not in any of the page tabs\n\tif (engine.stores.siteSettingsStore.isOpen) {\n\t\tengine.stores.siteSettingsStore.close()\n\t\tengine.stores.analyticsStore.open({ tab: AnalyticsTabNames.overview })\n\t\treturn\n\t}\n\n\t// Otherwise, try to get the active web page from the selection\n\tconst activeWebPage = engine.stores.scopeStore.active\n\tif (!isWebPageNode(activeWebPage)) {\n\t\t// In this case, we may have the CMS overlay open without any selected collection item\n\t\t// which results in the active scope being a collection node\n\t\t// Also, it wouldn't be good to filter by the currently selected page, as it's in the canvas, not being visible at the moment\n\t\tengine.stores.analyticsStore.open({ tab: AnalyticsTabNames.overview })\n\t\treturn\n\t}\n\n\topenAnalyticsFromWebPage(engine, activeWebPage)\n}\n\nfunction getSelectedCollectionAndItem(\n\tengine: VekterEngine,\n): { collection: CollectionNode; collectionItem: CollectionItemNode } | undefined {\n\tconst { treeStore, chromeStore, contentManagementStore } = engine.stores\n\tconst { mainView, contentManagementOverlayStack } = chromeStore\n\tconst activeOverlayStackElement = contentManagementOverlayStack.at(-1)\n\n\t// If the CMS overlay is open with a selected collection item, open the analytics view applying the cms item filter\n\tif (mainView === ActiveMainView.ContentManagement && activeOverlayStackElement) {\n\t\tconst collection = getCollectionNodeFromStackElement({\n\t\t\tstackElement: activeOverlayStackElement,\n\t\t\ttree: engine.tree,\n\t\t})\n\t\tconst collectionItem = getItemNodeFromStackElement({\n\t\t\ttreeStore,\n\t\t\tcontentManagementStore,\n\t\t\tstackElement: activeOverlayStackElement,\n\t\t})\n\t\tif (!collection || !collectionItem) return\n\n\t\treturn { collection, collectionItem }\n\t}\n}\n\nfunction getSelectedWebPageFromSiteSettings(engine: VekterEngine): AnyWebPageNode | null {\n\tif (engine.stores.siteSettingsStore.isOpen && engine.stores.siteSettingsStore.active?.tab === \"page\") {\n\t\tconst pageId = engine.stores.siteSettingsStore.active.id\n\t\treturn engine.tree.getNodeWithTrait(pageId, isWebPageNode)\n\t}\n\n\treturn null\n}\n", "import type { ComponentLoader } from \"@framerjs/framer-runtime\"\nimport { hasDefaultAssetReference } from \"@framerjs/framer-runtime/sandbox\"\nimport { assert, assertNever } from \"@framerjs/shared\"\nimport type { CanvasTree, CollectionNode } from \"document/models/CanvasTree/index.ts\"\nimport type { CollectionItemNode } from \"document/models/CanvasTree/nodes/CollectionItemNode.ts\"\nimport { isComputedValue } from \"document/models/CanvasTree/traits/ComputedValue.ts\"\nimport { isDynamicValue } from \"document/models/CanvasTree/traits/DynamicValue.ts\"\nimport type {\n\tStringVariableDefinition,\n\tVariableDefinition,\n\tVariableType,\n\tVariablesAndDividers,\n} from \"document/models/CanvasTree/traits/WithVariables.ts\"\nimport {\n\tisArrayControlDescription,\n\tisRequiredVariable,\n\tisSlugVariableDefinition,\n\tisStringVariableDefinition,\n\twithMaxLength,\n} from \"document/models/CanvasTree/traits/WithVariables.ts\"\nimport type { CollectionControlDescription } from \"document/models/controlProps/CollectionControlDescription.ts\"\nimport { type ControlProp, isArrayControlPropValue } from \"document/models/controlProps/ControlProp.ts\"\nimport {\n\tgetArrayControlPropValue,\n\tgetCollectionReferenceControlPropValue,\n\tgetMultiCollectionReferenceControlPropValue,\n} from \"document/models/controlProps/getControlProps.ts\"\nimport { getPlainTextFromRichTextTreeValue } from \"document/models/richText/richTextStorageDocument.ts\"\nimport { ControlType } from \"library/render/types/PropertyControls.ts\"\nimport { slugify } from \"library/utils/slugify.ts\"\nimport { isEmptyRichTextValue } from \"utils/isEmptyRichTextValue.ts\"\nimport { isDefined, isNonEmptyString, isNumber, isString, isUndefined } from \"utils/typeChecks.ts\"\nimport type { TakenSlugs } from \"../useTakenSlugs.ts\"\nimport { getNonPlaceholderItems } from \"./arrayGalleryUtils.ts\"\nimport {\n\tgetMaxCountWarningMessage,\n\tgetMaxLengthWarningMessage,\n\tgetMinCountWarningMessage,\n\tgetRequiredFieldWarningMessage,\n\tslugTakenWarningMessage,\n} from \"./fieldWarningMessages.ts\"\nimport { getAssociatedVariableStringValue } from \"./getAssociatedVariableStringValue.ts\"\nimport { validateControlPropReference } from \"./validateControlPropReference.ts\"\n\nexport interface ValidationWarning {\n\ttype: \"required\" | \"max-length\" | \"slug-taken\" | \"min-count\" | \"max-count\"\n\tmessage?: string\n}\n\nexport function getValidationWarningForField(\n\tvariableType: VariableType,\n\tcontrol: CollectionControlDescription,\n\tcontrolProp: ControlProp | undefined,\n\tbasedOnVariableValue: string | undefined,\n\tfallbackValue: StringVariableDefinition[\"fallbackValue\"] | undefined,\n\trequired: boolean,\n\ttakenSlugs: ReadonlySet<string> | undefined,\n): ValidationWarning | undefined {\n\tif (fallbackValue === \"associatedVariable\" && variableType === ControlType.String) {\n\t\t// The control is set and we're not using the fallback value at all\n\t\tif (controlProp && isString(controlProp.value)) {\n\t\t\tif (required && controlProp.value === \"\") return { type: \"required\" }\n\t\t\treturn getExceedsMaxLengthErrorMessage(controlProp, control)\n\t\t}\n\n\t\tif (required && !basedOnVariableValue) return { type: \"required\" }\n\n\t\tif (!basedOnVariableValue || !withMaxLength(control)) return\n\n\t\tconst { maxLength } = control\n\t\tif (!isNumber(maxLength)) return\n\t\tconst exceedsMaxLength = basedOnVariableValue.length > maxLength\n\t\treturn exceedsMaxLength\n\t\t\t? { type: \"max-length\", message: getMaxLengthWarningMessage(basedOnVariableValue.length, maxLength) }\n\t\t\t: undefined\n\t}\n\n\tif (variableType === \"slug\") {\n\t\tlet slugValue: string | undefined\n\t\tif (controlProp && isNonEmptyString(controlProp.value)) {\n\t\t\tslugValue = slugify(controlProp.value)\n\t\t} else if (basedOnVariableValue) {\n\t\t\tslugValue = slugify(basedOnVariableValue)\n\t\t}\n\n\t\tif (!slugValue) {\n\t\t\treturn { type: \"required\" }\n\t\t}\n\n\t\tassert(takenSlugs, \"takenSlugs is required for slug fields\")\n\t\tconst slugIsTaken = takenSlugs.has(slugValue)\n\t\tif (slugIsTaken) {\n\t\t\treturn { type: \"slug-taken\", message: slugTakenWarningMessage }\n\t\t}\n\t}\n\n\tconst emptyFieldError = getRequiredAndMissingErrorMessage(controlProp, control, required)\n\tif (emptyFieldError) return emptyFieldError\n\n\tconst minAndMaxError = getArrayMinAndMaxErrorMessage(controlProp, control, required)\n\tif (minAndMaxError) return minAndMaxError\n\n\treturn getExceedsMaxLengthErrorMessage(controlProp, control)\n}\n\nexport function getMessageFromWarning(\n\twarning: ValidationWarning | undefined,\n\tcontrol: CollectionControlDescription,\n): string | undefined {\n\tif (!warning) return undefined\n\n\tif (warning.type === \"required\") {\n\t\treturn getRequiredFieldWarningMessage(control.title)\n\t}\n\n\treturn warning.message\n}\n\n/**\n *  Does not cover the case where a String field relies on associated variable value.\n *  If that's the case, use `getValidationErrorMessageForField` instead.\n */\nexport function getRequiredAndMissingErrorMessage(\n\tcontrolProp: ControlProp | undefined,\n\tcontrol: CollectionControlDescription,\n\trequired: boolean,\n): ValidationWarning | undefined {\n\tif (!required) return\n\tconst { type } = control\n\n\tswitch (type) {\n\t\tcase ControlType.Link: {\n\t\t\tif (!controlProp) return { type: \"required\" }\n\t\t\tassert(controlProp.type === ControlType.Link)\n\t\t\tconst isLinkEmpty = !controlProp.value || (controlProp.value.type === \"url\" && controlProp.value.url === \"\")\n\t\t\treturn isLinkEmpty ? { type: \"required\" } : undefined\n\t\t}\n\t\tcase ControlType.RichText: {\n\t\t\tif (!controlProp) return { type: \"required\" }\n\t\t\tassert(controlProp.type === ControlType.RichText)\n\t\t\tassert(!isDynamicValue(controlProp.value), \"Dynamic values are not supported within the CMS.\")\n\t\t\treturn isEmptyRichTextValue(controlProp.value) ? { type: \"required\" } : undefined\n\t\t}\n\t\tcase ControlType.Image:\n\t\tcase ControlType.ResponsiveImage: {\n\t\t\tif (!controlProp) {\n\t\t\t\treturn !hasDefaultAssetReference(control) || !control.__defaultAssetReference ? { type: \"required\" } : undefined\n\t\t\t}\n\t\t\tassert(controlProp.type === ControlType.Image)\n\t\t\treturn controlProp.value === \"\" ? { type: \"required\" } : undefined\n\t\t}\n\t\tcase ControlType.String: {\n\t\t\tif (!controlProp) {\n\t\t\t\treturn !control.defaultValue ? { type: \"required\" } : undefined\n\t\t\t}\n\t\t\tassert(control.type === ControlType.String)\n\t\t\tconst isStringEmpty = !isNonEmptyString(controlProp.value)\n\t\t\treturn isStringEmpty ? { type: \"required\" } : undefined\n\t\t}\n\t\tcase ControlType.CollectionReference: {\n\t\t\tconst value = getCollectionReferenceControlPropValue(control, controlProp)\n\t\t\tif (isUndefined(value)) return { type: \"required\" }\n\t\t\treturn undefined\n\t\t}\n\t\tcase ControlType.MultiCollectionReference: {\n\t\t\tconst value = getMultiCollectionReferenceControlPropValue(control, controlProp)\n\t\t\tif (isDynamicValue(value)) return\n\t\t\tif (isUndefined(value) || value.length === 0) return { type: \"required\" }\n\t\t\treturn\n\t\t}\n\t\tcase ControlType.File:\n\t\tcase ControlType.Date: {\n\t\t\tconst hasValue = controlProp?.type === type && Boolean(controlProp.value)\n\t\t\treturn hasValue ? undefined : { type: \"required\" }\n\t\t}\n\t\tcase ControlType.Array: {\n\t\t\tif (!controlProp) return { type: \"required\" }\n\t\t\tassert(controlProp.type === ControlType.Array)\n\n\t\t\tconst value = getArrayControlPropValue(control, controlProp)\n\t\t\tassert(!isDynamicValue(value), \"Dynamic values are not supported within the CMS.\")\n\t\t\t// The array is considered empty if it only contains placeholder items\n\t\t\tconst nonPlaceholderItems = getNonPlaceholderItems(value)\n\t\t\treturn nonPlaceholderItems.length === 0 ? { type: \"required\" } : undefined\n\t\t}\n\t\tdefault:\n\t\t\t// TODO: Make the types exhaustive so we can `assertNever`\n\t\t\t// This requires a refactor to make sure that the controlProp, control and variable types always match.\n\t\t\treturn\n\t}\n}\n\nexport function getExceedsMaxLengthErrorMessage(\n\tcontrolProp: ControlProp | undefined,\n\tcontrol: CollectionControlDescription,\n): ValidationWarning | undefined {\n\tif (!withMaxLength(control)) return\n\n\tconst { maxLength } = control\n\tif (!isNumber(maxLength)) return\n\n\tswitch (control.type) {\n\t\tcase ControlType.String: {\n\t\t\tassert(!controlProp || controlProp.type === ControlType.String)\n\n\t\t\tconst defaultValue = control.defaultValue ?? \"\"\n\t\t\tconst value = controlProp?.value && isString(controlProp.value) ? controlProp.value : defaultValue\n\n\t\t\tconst exceedsMaxLength: boolean = value.length > maxLength\n\t\t\treturn exceedsMaxLength\n\t\t\t\t? { type: \"max-length\", message: getMaxLengthWarningMessage(value.length, maxLength) }\n\t\t\t\t: undefined\n\t\t}\n\t\tcase ControlType.RichText: {\n\t\t\tif (!controlProp) return\n\t\t\tif (isDynamicValue(controlProp.value)) return\n\n\t\t\tconst textContent = getPlainTextFromRichTextTreeValue(controlProp.value)\n\t\t\tconst exceedsMaxLength = textContent.length > maxLength\n\t\t\treturn exceedsMaxLength\n\t\t\t\t? { type: \"max-length\", message: getMaxLengthWarningMessage(textContent.length, maxLength) }\n\t\t\t\t: undefined\n\t\t}\n\t\tdefault:\n\t\t\tassertNever(control)\n\t}\n}\n\nexport function getArrayMinAndMaxErrorMessage(\n\tcontrolProp: ControlProp | undefined,\n\tcontrol: CollectionControlDescription,\n\trequired: boolean,\n): ValidationWarning | undefined {\n\tif (!isArrayControlDescription(control)) return\n\tif (isDefined(controlProp?.value) && !isArrayControlPropValue(controlProp?.value)) return\n\tif (isComputedValue(controlProp?.value)) return\n\tconst nonPlaceholderItems = getNonPlaceholderItems(controlProp?.value)\n\n\tif (isNumber(control.minCount) && nonPlaceholderItems.length < control.minCount) {\n\t\tif (!required && nonPlaceholderItems.length === 0) return\n\t\treturn { type: \"min-count\", message: getMinCountWarningMessage(control) }\n\t}\n\tif (isNumber(control.maxCount) && nonPlaceholderItems.length > control.maxCount) {\n\t\treturn { type: \"max-count\", message: getMaxCountWarningMessage(control) }\n\t}\n\treturn undefined\n}\n\nexport function fieldHasValidationError(\n\ttree: CanvasTree,\n\tcollectionItem: CollectionItemNode,\n\tvariable: VariableDefinition,\n\tvariables: VariablesAndDividers,\n\tcontrol: CollectionControlDescription,\n\ttakenSlugs: TakenSlugs,\n) {\n\tconst controlProp = validateControlPropReference(tree, control, collectionItem.getControlProp(variable.id))\n\n\tlet basedOnVariableValue: string | undefined\n\tlet fallbackValue: StringVariableDefinition[\"fallbackValue\"] | undefined\n\n\tif (isStringVariableDefinition(variable) || isSlugVariableDefinition(variable)) {\n\t\tbasedOnVariableValue = getAssociatedVariableStringValue(variable, variables, collectionItem)\n\t}\n\tif (isStringVariableDefinition(variable)) {\n\t\tfallbackValue = variable.fallbackValue\n\t}\n\n\tconst warning = getValidationWarningForField(\n\t\tvariable.type,\n\t\tcontrol,\n\t\tcontrolProp,\n\t\tbasedOnVariableValue,\n\t\tfallbackValue,\n\t\tisRequiredVariable(variable),\n\t\ttakenSlugs.get(variable.id),\n\t)\n\n\treturn Boolean(warning)\n}\n\nexport function getCollectionItemVariables(collectionNode: CollectionNode): VariableDefinition[] {\n\treturn collectionNode.variables.filter(variable => variable.type !== \"divider\")\n}\n\nexport function getCollectionItemVariablesWithError(\n\ttree: CanvasTree,\n\tcomponentLoader: ComponentLoader,\n\tcollectionNode: CollectionNode,\n\tcollectionItemNode: CollectionItemNode,\n\ttakenSlugs: TakenSlugs,\n): VariableDefinition[] {\n\tconst propertyControls = collectionNode.getPropertyControls(tree, componentLoader)\n\tconst variables = getCollectionItemVariables(collectionNode)\n\n\treturn variables.filter(variable => {\n\t\tconst control = propertyControls[variable.id]\n\t\tif (!control) return false\n\n\t\treturn fieldHasValidationError(tree, collectionItemNode, variable, collectionNode.variables, control, takenSlugs)\n\t})\n}\n", "import { useId, type SVGProps } from \"react\"\n\nexport function IconAgentBreakpointLayoutTemplate(props: SVGProps<SVGSVGElement>) {\n\tconst clipPathId = `agent-breakpoint-layout-template-icon-${useId().replace(/:/g, \"\")}`\n\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<defs>\n\t\t\t\t<clipPath id={clipPathId}>\n\t\t\t\t\t<path d=\"M.5 3.5a3 3 0 0 1 3-3h5a3 3 0 0 1 3 3v5a3 3 0 0 1-3 3h-5a3 3 0 0 1-3-3Z\" />\n\t\t\t\t</clipPath>\n\t\t\t</defs>\n\t\t\t<path\n\t\t\t\td=\"M.5 3.5a3 3 0 0 1 3-3h5a3 3 0 0 1 3 3v5a3 3 0 0 1-3 3h-5a3 3 0 0 1-3-3Z\"\n\t\t\t\tfill=\"transparent\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"3\"\n\t\t\t\tclipPath={`url(#${clipPathId})`}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\td=\"M10 1.5H2.5l-1 1v2H11v-1Z\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerFrame(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M1.25 3.25a2 2 0 0 1 2-2h5.5a2 2 0 0 1 2 2v5.5a2 2 0 0 1-2 2h-5.5a2 2 0 0 1-2-2Z\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerText(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<g fill=\"transparent\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeMiterlimit=\"10\" strokeWidth=\"1.5\">\n\t\t\t\t<path d=\"M6.25 2.25V10M2 2.25h8.5\" />\n\t\t\t</g>\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerLink(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"transparent\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"m5 7 2-2M4.75 2.279A3.515 3.515 0 0 1 9.721 7.25M7.25 9.721A3.515 3.515 0 0 1 2.279 4.75\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerStackHorizontal(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M1.25 3.25a2 2 0 0 1 2-2h5.5a2 2 0 0 1 2 2v5.5a2 2 0 0 1-2 2h-5.5a2 2 0 0 1-2-2Z\"\n\t\t\t/>\n\t\t\t<path fill=\"transparent\" stroke=\"currentColor\" d=\"M6 2v8\" />\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerStackVertical(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M1.25 3.25a2 2 0 0 1 2-2h5.5a2 2 0 0 1 2 2v5.5a2 2 0 0 1-2 2h-5.5a2 2 0 0 1-2-2Z\"\n\t\t\t/>\n\t\t\t<path fill=\"transparent\" stroke=\"currentColor\" d=\"M1.5 6h9\" />\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerImage(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"transparent\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M1.25 3.25a2 2 0 0 1 2-2h5.5a2 2 0 0 1 2 2v5.5a2 2 0 0 1-2 2h-5.5a2 2 0 0 1-2-2Z\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M1.848 7.56a7 7 0 0 1 8.304 0l.598.44v.75a2 2 0 0 1-2 2h-5.5a2 2 0 0 1-2-2V8Z\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerShader(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M6 1a5 5 0 1 1-.001 10.001A5 5 0 0 1 6 1Z\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tfill=\"transparent\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M4 6a2 2 0 0 1 2-2\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerViewBox(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\td=\"M.75 3.75a3 3 0 0 1 3-3h4.5a3 3 0 0 1 3 3v4.5a3 3 0 0 1-3 3h-4.5a3 3 0 0 1-3-3Z\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tfill=\"transparent\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M1 4V3a2 2 0 0 1 2-2h1M10.75 4V3a2 2 0 0 0-2-2h-1M10.75 7.75v1a2 2 0 0 1-2 2h-1M1 7.75v1a2 2 0 0 0 2 2h1\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerRect(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M1.25 3.25a2 2 0 0 1 2-2h5.5a2 2 0 0 1 2 2v5.5a2 2 0 0 1-2 2h-5.5a2 2 0 0 1-2-2Z\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerRound(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M6 1a5 5 0 1 1-.001 10.001A5 5 0 0 1 6 1Z\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerVector(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M5.148 1.884a1 1 0 0 1 1.704 0l4.21 6.842a1 1 0 0 1-.852 1.524H1.79a1 1 0 0 1-.852-1.524Z\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerStar(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"m6 .775 1.94 2.83 3.291.971-2.093 2.719.095 3.43L6 9.575l-3.233 1.15.095-3.43L.769 4.576l3.291-.971Z\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerPolygon(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M5.293 1.05a1 1 0 0 1 1.414 0l4.243 4.243a1 1 0 0 1 0 1.414L6.707 10.95a1 1 0 0 1-1.414 0L1.05 6.707a1 1 0 0 1 0-1.414Z\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerPath(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M9 .75a2.25 2.25 0 1 1 0 4.5 2.25 2.25 0 0 1 0-4.5M3 6.75a2.25 2.25 0 1 1 0 4.5 2.25 2.25 0 0 1 0-4.5\"\n\t\t\t/>\n\t\t\t<path fill=\"transparent\" stroke=\"currentColor\" strokeWidth=\"1.5\" d=\"M4.5 7.5 6 6l1.5-1.5\" />\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerBoolean(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M4.25 2.25a1.5 1.5 0 0 1 1.5-1.5h4a1.5 1.5 0 0 1 1.5 1.5v4a1.5 1.5 0 0 1-1.5 1.5H8v2a1.5 1.5 0 0 1-1.5 1.5h-4A1.5 1.5 0 0 1 1 9.75v-4a1.5 1.5 0 0 1 1.5-1.5h1.75Z\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerMasonryStackWrapVertical(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M1.25 3.25a2 2 0 0 1 2-2h5.5a2 2 0 0 1 2 2v5.5a2 2 0 0 1-2 2h-5.5a2 2 0 0 1-2-2Z\"\n\t\t\t/>\n\t\t\t<path fill=\"transparent\" stroke=\"currentColor\" d=\"M6 2v8M2 5h3.5M6.5 7H10\" />\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerStackWrapHorizontal(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M1.25 3.25a2 2 0 0 1 2-2h5.5a2 2 0 0 1 2 2v5.5a2 2 0 0 1-2 2h-5.5a2 2 0 0 1-2-2Z\"\n\t\t\t/>\n\t\t\t<path fill=\"transparent\" stroke=\"currentColor\" d=\"M2 6h8M5 2v3.5M7 6.5V10\" />\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerForm(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M1.25 3.25a2 2 0 0 1 2-2h5.5a2 2 0 0 1 2 2v5.5a2 2 0 0 1-2 2h-5.5a2 2 0 0 1-2-2Z\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tfill=\"transparent\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\td=\"M4.5 4.5h3M4.5 7.5h3\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerFormLabel(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M1.25 3.25a2 2 0 0 1 2-2h5.5a2 2 0 0 1 2 2v5.5a2 2 0 0 1-2 2h-5.5a2 2 0 0 1-2-2Z\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tfill=\"transparent\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M4.25 4.25v3.5h3.5\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerFormInput(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M1.25 3.25a2 2 0 0 1 2-2h5.5a2 2 0 0 1 2 2v5.5a2 2 0 0 1-2 2h-5.5a2 2 0 0 1-2-2Z\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tfill=\"transparent\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M4.25 4.25v3.5\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerFormSelect(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"transparent\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"m1.25 4 3.439 3.439a1.5 1.5 0 0 0 2.122 0L10.25 4\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentLayerFormRadio(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M6 1a5 5 0 1 1-.001 10.001A5 5 0 0 1 6 1Z\"\n\t\t\t/>\n\t\t\t<path fill=\"currentColor\" d=\"M6 4.5a1.5 1.5 0 1 1-.001 3.001A1.5 1.5 0 0 1 6 4.5\" />\n\t\t</svg>\n\t)\n}\n", "import type { SVGProps } from \"react\"\n\nexport function IconAgentLayerGrid(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\" {...props}>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M1.25 3.25a2 2 0 0 1 2-2h5.5a2 2 0 0 1 2 2v5.5a2 2 0 0 1-2 2h-5.5a2 2 0 0 1-2-2Z\"\n\t\t\t/>\n\t\t\t<path fill=\"transparent\" stroke=\"currentColor\" d=\"M6 1.5v9M1.5 6h9\" />\n\t\t</svg>\n\t)\n}\n", "import type { SVGProps } from \"react\"\n\nexport function IconAgentCode(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg\n\t\t\trole=\"presentation\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\twidth=\"12\"\n\t\t\theight=\"12\"\n\t\t\tviewBox=\"0 0 12 12\"\n\t\t\tfill=\"none\"\n\t\t\taria-hidden=\"true\"\n\t\t\tfocusable=\"false\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\tfill=\"transparent\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M3.5 2.75 1.311 4.939a1.5 1.5 0 0 0 0 2.122L3.5 9.25M8.5 2.75l2.189 2.189a1.5 1.5 0 0 1 0 2.122L8.5 9.25\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n", "import type { SVGProps } from \"react\"\n\nexport function IconAgentComponent(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg\n\t\t\trole=\"presentation\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\twidth=\"12\"\n\t\t\theight=\"12\"\n\t\t\tviewBox=\"0 0 12 12\"\n\t\t\tfill=\"none\"\n\t\t\taria-hidden=\"true\"\n\t\t\tfocusable=\"false\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M4.586 1.354a2 2 0 0 1 2.828 0l3.232 3.232a2 2 0 0 1 0 2.828l-3.232 3.232a2 2 0 0 1-2.828 0L1.354 7.414a2 2 0 0 1 0-2.828Z\"\n\t\t\t/>\n\t\t\t<path fill=\"none\" stroke=\"currentColor\" d=\"m3 3 6 6M9 3 3 9\" />\n\t\t</svg>\n\t)\n}\n", "import type { SVGProps } from \"react\"\n\nexport function IconAgentVideo(props: SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg\n\t\t\trole=\"presentation\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\twidth=\"12\"\n\t\t\theight=\"12\"\n\t\t\tviewBox=\"0 0 12 12\"\n\t\t\tfill=\"none\"\n\t\t\taria-hidden=\"true\"\n\t\t\tfocusable=\"false\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillOpacity={0.2}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M2.25 2.31a1 1 0 0 1 1.532-.847l5.871 3.69a1 1 0 0 1 0 1.694l-5.871 3.69A1 1 0 0 1 2.25 9.69Z\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n", "import type { TooltipProps } from \"@framerjs/fresco\"\nimport { CenterChild, FixedPositionTooltip, Translatable as T, Text, useTooltip } from \"@framerjs/fresco\"\nimport { colors } from \"@framerjs/fresco/tokens\"\nimport { unhandledError } from \"@framerjs/shared\"\nimport { cx } from \"@linaria/core\"\nimport { useDimensionValue } from \"app/agent/hooks/useDimensionValue.ts\"\nimport React from \"react\"\nimport * as styles from \"./PanelTooltip.styles.ts\"\n\ninterface Props {\n\tdirection: \"left\" | \"right\" | \"top\"\n\tdelay?: \"long\" | \"short\"\n\ttriggerRef?: React.RefObject<HTMLDivElement>\n\ticon: React.ReactNode\n\tclassName?: string\n\tinteractive?: boolean\n\tinitialVisibility?: boolean\n}\n\ninterface TooltipContent {\n\ttitle: string\n\ttext: string\n\timage?: string\n\tactions?: React.ReactNode\n\tvariant?: \"education\" | \"layer\"\n}\n\n/**\n * Store a ref to the ancestor panel. This allows PanelTooltip to always render\n * relative to the panel.\n */\nexport const PanelContext = React.createContext<React.MutableRefObject<HTMLDivElement | null> | undefined>(undefined)\n\nexport function PanelTooltip({\n\tdelay,\n\tdirection,\n\tinteractive = true,\n\ticon,\n\tclassName,\n\tinitialVisibility,\n\t...content\n}: Props & TooltipContent) {\n\tconst ref = React.useRef<HTMLDivElement>(null)\n\tconst panelRef = React.useContext(PanelContext)\n\tconst isLayerVariant = content.variant === \"layer\"\n\n\tconst tooltipOffset = useDimensionValue(\"tooltipOffset\")\n\n\tconst { triggerProps, tooltipProps } = useTooltip({\n\t\tclassName: cx(styles.tooltip, isLayerVariant && styles.layerTooltip),\n\t\tdirection,\n\t\tinteractive,\n\t\toffset: tooltipOffset,\n\t\ttriggerRef: ref,\n\t\toffsetXRef: panelRef,\n\t\tdelay,\n\t\tinitialVisibility,\n\t\tshowArrow: false,\n\t})\n\n\treturn (\n\t\t<>\n\t\t\t<CenterChild {...triggerProps} className={className} ref={ref}>\n\t\t\t\t{icon}\n\t\t\t</CenterChild>\n\t\t\t<PanelTooltipWithoutTrigger {...content} {...tooltipProps} />\n\t\t</>\n\t)\n}\n\nexport function PanelTooltipWithoutTrigger(props: TooltipProps & TooltipContent) {\n\tconst { variant, ...tooltipProps } = props\n\tconst isLayerVariant = variant === \"layer\"\n\tconst isEducationVariant = variant === \"education\"\n\n\tReact.useEffect(() => {\n\t\t// Do a poor mans preload when the tooltip icon mounts, to prevent the\n\t\t// images from popping in when the portal renders.\n\t\tif (props.image) {\n\t\t\tconst image = new Image()\n\t\t\timage.src = props.image\n\t\t\timage.alt = props.title\n\t\t\t// image.decode is not available in the test environment.\n\t\t\timage.decode?.().catch(unhandledError)\n\t\t}\n\t}, [props.image, props.title])\n\treturn (\n\t\t<FixedPositionTooltip {...tooltipProps} tint={props.tint ?? colors.panelBackground}>\n\t\t\t<div\n\t\t\t\tclassName={cx(\n\t\t\t\t\tstyles.content,\n\t\t\t\t\tisEducationVariant && styles.educationContent,\n\t\t\t\t\tisLayerVariant && styles.layerContent,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{props.image && <img src={props.image} alt={props.title} className={styles.image} decoding=\"async\" />}\n\t\t\t\t{props.title &&\n\t\t\t\t\t(isLayerVariant ? (\n\t\t\t\t\t\t<div className={styles.layerHeader}>\n\t\t\t\t\t\t\t<Text className={cx(styles.tooltipTitle, styles.headingTooltipTitle)}>\n\t\t\t\t\t\t\t\t<T>{props.title}</T>\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div className={cx(isEducationVariant && styles.educationHeadingBlock)}>\n\t\t\t\t\t\t\t<Text className={cx(styles.tooltipTitle, styles.headingTooltipTitle)}>\n\t\t\t\t\t\t\t\t<T>{props.title}</T>\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\t\t\t\t<div className={cx(isEducationVariant && styles.educationCopyBlock)}>\n\t\t\t\t\t<Text>\n\t\t\t\t\t\t<T>{props.text}</T>\n\t\t\t\t\t</Text>\n\t\t\t\t</div>\n\t\t\t\t{props.actions}\n\t\t\t</div>\n\t\t</FixedPositionTooltip>\n\t)\n}\n", "import \"PanelTooltip.styles_1pgdl65.wyw.css\"; export const tooltip = \"tooltip_tzsvjdc\";\nexport const layerTooltip = \"layerTooltip_l1ehb6cn\";\nexport const content = \"content_c1ikreno\";\nexport const educationContent = \"educationContent_e1f47h4t\";\nexport const layerContent = \"layerContent_lgvo2dl\";\nexport const image = \"image_i1jg7ru0\";\nexport const layerHeader = \"layerHeader_ltyh0n7\";\nexport const tooltipTitle = \"tooltipTitle_t1ramr4k\";\nexport const headingTooltipTitle = \"headingTooltipTitle_hzt03rr\";\nexport const educationHeadingBlock = \"educationHeadingBlock_e1f6ct5n\";\nexport const educationCopyBlock = \"educationCopyBlock_eano5sa\";"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AA,cAAM,SAAS,8CAAC,SAAI,KAAK,MAAM,OAAO,KAAK,MAAM,OAAO,WAAkB,OAAO,UAAS,SAAQ;AAAA,QAClG,MAAM,UACL,iBACA,8CAAC,SAAI,WAAkB,aACtB,wDAAC,QAAK,WAAW,WAAU,cAAqB,mBAAmB,GAClE,wDAAC,gBAAG,gBAAM,OAAM,GACjB,GACD,IAEA,8CAAC,SAAI,WAAW,WAAG,sBAA6B,qBAAqB,GACpE,wDAAC,QAAK,WAAW,WAAU,cAAqB,mBAAmB,GAClE,wDAAC,gBAAG,gBAAM,OAAM,GACjB,GACD;AAAA,QAEF,8CAAC,SAAI,WAAW,WAAG,sBAA6B,kBAAkB,GACjE,wDAAC,QACA,wDAAC,gBAAG,gBAAM,MAAK,GAChB,GACD;AAAA,QACC,MAAM;AAAA;AAAA;AAAA,EACR,GACD;AAEF;",
  "names": ["import_react", "import_react", "isNumber", "React", "className", "isUndefined", "React", "import_react", "import_react", "import_jsx_runtime", "import_react", "import_react", "className", "import_jsx_runtime", "React", "import_jsx_runtime", "React", "PopoutButtonInner", "className", "window", "import_react", "import_jsx_runtime", "React", "import_jsx_runtime", "React", "window", "isUndefined", "isNumber", "image", "isNumber", "isNumber", "assert", "className", "isSVG", "value", "isUndefined", "isNumber", "assert", "isUndefined", "isNumber", "isNumber", "isNumber", "isUndefined", "isUndefined", "import_react", "import_react", "React", "isUndefined", "isNumber", "isUndefined", "isUndefined", "isNumber", "isUndefined", "isUndefined", "undefinedToZero", "isUndefined", "undefinedToFalse", "isUndefined", "assertNever", "colors", "isUndefined", "isNumber", "isUndefined", "isNumber", "isUndefined", "isNumber", "isUndefined", "isUndefined", "combine", "isUndefined", "isUndefined", "isUndefined", "Clipboard", "isNumber", "colors", "import_react", "isNumber", "isUndefined", "import_react", "import_jsx_runtime", "import_jsx_runtime", "import_jsx_runtime", "import_jsx_runtime", "import_jsx_runtime", "import_react", "import_jsx_runtime", "React", "className", "content", "image"]
}
