{
  "version": 3,
  "sources": ["../../src/document/components/chrome/shared/ImagePluginPickerButtonContext.tsx", "../../src/document/components/chrome/properties/codeComponentRows/ControlPropRowContext.tsx", "../../src/document/components/chrome/contentManagement/useIsWithinCollectionItem.tsx", "../../src/document/components/chrome/properties/useVariableProviderInfo.ts", "../../src/document/components/chrome/properties/utils/doubleColumn.styles.ts", "../../src/document/components/chrome/shared/AgentCollectionItemIcons.tsx", "../../../../../node_modules/@framerjs/framer-events/lib/esm/generated/VariableReferenceDelete.js", "../../src/document/components/chrome/shared/VariableReferenceButton.tsx", "../../src/document/components/chrome/properties/utils/getNameForVariableProvider.ts", "../../src/document/components/chrome/shared/AgentComputedValueIcon.tsx", "../../src/document/components/chrome/shared/VariableReferenceButton.styles.ts", "../../src/document/components/chrome/shared/utils/iconForVariable.tsx", "../../src/document/components/chrome/properties/utils/selectedVariableIsNegated.ts", "../../src/app/EducationTooltip.tsx", "../../src/document/components/chrome/shared/BreadcrumbBar.styles.ts", "../../src/app/EducationTooltip.styles.ts", "../../src/document/components/chrome/properties/rows/PanelRow.tsx", "../../src/document/components/chrome/properties/codeComponentRows/ReorderControl.styles.ts", "../../src/document/components/chrome/properties/codeComponentRows/ReorderControl.tsx", "../../src/document/components/chrome/properties/utils/resetOverrides.ts", "../../src/document/components/chrome/properties/utils/useDisplayFetchDataMenuOptions.ts", "../../src/document/components/chrome/properties/utils/useDisplayVariableAssignmentOptions.ts", "../../src/document/components/chrome/shared/dynamicValueChainSections.ts", "../../src/document/components/chrome/shared/utils/applyTransformValuesToReplacement.ts", "../../src/document/components/chrome/properties/rows/PanelRowTitle.styles.ts", "../../src/document/components/chrome/properties/rows/PanelRowTitle.tsx", "../../src/document/components/chrome/properties/rows/PanelRowView.styles.ts", "../../src/document/components/chrome/properties/rows/PanelRowView.tsx", "../../src/document/components/chrome/properties/utils/useSubscribeToFillValue.ts", "../../src/document/components/chrome/shared/PopoutButtonBackgroundPreview.styles.ts", "../../src/document/components/chrome/shared/PopoutButtonBackgroundPreview.tsx", "../../src/document/components/chrome/shared/PopoutButtonPreviewIconWrapper.styles.ts", "../../src/document/components/chrome/shared/PopoutButtonPreviewIconWrapper.tsx", "../../src/document/components/chrome/properties/panels/icons/IconAgentEffect.tsx", "../../src/document/components/chrome/properties/panels/icons/IconAgentInteraction.tsx", "../../src/document/components/chrome/properties/panels/icons/IconAgentOverlayGrid.tsx", "../../src/document/components/chrome/shared/ButtonWithPreviewContent.styles.ts", "../../src/document/components/chrome/shared/CollectionContentIcons.tsx", "../../src/document/components/chrome/shared/PopoutButtonWithPreviewSuggestion.styles.ts", "../../src/document/components/chrome/shared/PopoutButtonWithPreviewSuggestion.tsx", "../../src/document/components/chrome/shared/ButtonWithPreviewContent.tsx", "../../src/document/components/chrome/shared/PopoutButtonWithPreview.styles.ts", "../../src/document/components/chrome/shared/PopoutButtonWithPreview.tsx", "../../src/web/pages/project/lib/useWindowEventListeners.ts", "../../src/document/components/chrome/shared/ColorPicker/p3.ts", "../../src/document/components/chrome/shared/ColorPicker/utils.ts", "../../src/document/components/chrome/properties/utils/useAssetMapHash.ts", "../../src/document/components/utils/resolveImage.ts", "../../src/document/components/utils/useResolvedImageThumbnail.ts", "../../src/document/preview/globalPreviewHandlers.ts", "../../src/document/models/CanvasTree/traits/utils/notFoundToUndefined.ts", "../../src/document/components/chrome/shared/ImagePopout.tsx", "../../src/document/components/chrome/shared/ImagePicker.tsx", "../../src/document/components/chrome/shared/ButtonWithPreview.tsx", "../../src/document/components/chrome/shared/ImagePicker.styles.ts", "../../src/document/components/chrome/contentManagement/utils/getUpdatedFieldControlProp.ts", "../../src/document/components/chrome/contentManagement/CollectionImagePopout.tsx", "../../src/utils/useItemToSlug.ts", "../../src/document/components/chrome/shared/ColorPicker/ColorPickerImage.tsx", "../../src/document/components/chrome/properties/rows/FillImagePatternPresetsRow/FillImagePatternPresetsRow.styles.ts", "../../src/document/components/chrome/properties/rows/FillImagePatternPresetsRow/FillImagePatternPresetsRow.tsx", "../../src/document/components/chrome/properties/rows/FillImagePositionRow.styles.ts", "../../src/document/components/chrome/properties/rows/FillImagePositionRow.tsx", "../../src/document/components/chrome/properties/rows/FillImageResizeRow.tsx", "../../src/document/components/chrome/properties/rows/FillImageTiledSizeRow.tsx", "../../src/document/components/chrome/shared/ColorPicker/ColorPickerInput.tsx", "../../src/document/components/chrome/shared/ColorPicker/ColorPickerInput.styles.ts", "../../src/document/components/chrome/shared/ColorPicker/ColorPickerMode.tsx", "../../src/document/components/chrome/shared/ColorPicker/ColorPickerP3.tsx", "../../src/document/components/chrome/shared/ColorPicker/ColorPickerP3.styles.ts", "../../src/document/components/chrome/shared/ColorPicker/ColorPickerSampler.styles.ts", "../../src/document/components/chrome/shared/ColorPicker/ColorPickerSampler.tsx", "../../src/document/components/chrome/shared/ColorPicker/HexColorPickerInput.tsx", "../../src/document/components/chrome/shared/ColorPicker/HslColorPickerInput.tsx", "../../src/document/components/chrome/shared/ColorPicker/RgbColorPickerInput.tsx", "../../src/document/components/chrome/shared/ColorPicker/ColorPickerPopoutContent.styles.ts", "../../src/document/components/chrome/shared/ColorPicker/OnPageColorPickerPopoutContent.tsx", "../../src/utils/getComponentsWithPresets.ts", "../../src/document/components/chrome/shared/ColorPicker/OnPageColorPickerPopout.tsx", "../../src/document/components/chrome/properties/codeComponentRows/DescriptionRow.tsx", "../../src/document/components/chrome/shared/InlineDocumentation.styles.ts", "../../src/document/components/chrome/shared/InlineDocumentation.tsx", "../../src/document/components/chrome/shared/utils/parseDescriptionMarkdown.tsx", "../../src/document/components/chrome/properties/codeComponentRows/DescriptionRow.styles.ts"],
  "sourcesContent": ["import { type ComponentType, type PropsWithChildren, createContext, useContext } from \"react\"\nimport type { ImagePickerPluginButtonProps } from \"./ImagePickerPluginButton.tsx\"\n\nexport type ImagePluginPickerButtonComponent = ComponentType<ImagePickerPluginButtonProps>\n\n/**\n * The Plugin button of the image picker is not implemented in On-Page Editing\n * because it has a lot of engine dependencies.\n *\n * This context allows the button component to be provided in Vekter only, and\n * not on-page. Once we support this on-page, we can get rid of the context.\n */\nconst ImagePluginPickerButtonContext = createContext<ImagePluginPickerButtonComponent | undefined>(undefined)\nImagePluginPickerButtonContext.displayName = \"ImagePluginPickerButtonContext\"\n\nexport function ImagePluginPickerButtonProvider({\n\tcomponent,\n\tchildren,\n}: PropsWithChildren<{\n\tcomponent: ComponentType<ImagePickerPluginButtonProps> | undefined\n}>) {\n\treturn <ImagePluginPickerButtonContext.Provider value={component}>{children}</ImagePluginPickerButtonContext.Provider>\n}\n\nexport function useImagePluginPickerButton() {\n\treturn useContext(ImagePluginPickerButtonContext)\n}\n", "import { createContext, useContext } from \"react\"\nimport type { ArrayControlPropRow } from \"./ArrayControlPropRow.tsx\"\nimport type { BooleanControlPropRow } from \"./BooleanControlPropRow.tsx\"\nimport type { BorderControlPropRow } from \"./BorderControlPropRow.tsx\"\nimport type { BorderRadiusControlPropRow } from \"./BorderRadiusControlPropRow.tsx\"\nimport type { BoxShadowControlPropRow } from \"./BoxShadowControlPropRow.tsx\"\nimport type { CanvasPageInstanceRow } from \"./CanvasPageInstanceRow.tsx\"\nimport type { CollectionReferenceControlPropRow } from \"./CollectionReferenceControlPropRow.tsx\"\nimport type { ColorArrayControlPropRow } from \"./ColorArrayControlPropRow.tsx\"\nimport type { ColorControlPropRow } from \"./ColorControlPropRow.tsx\"\nimport type { CursorControlPropRow } from \"./CursorControlPropRow.tsx\"\nimport type { CustomCursorControlPropRow } from \"./CustomCursorControlPropRow.tsx\"\nimport type { DateControlPropRow } from \"./DateControlPropRow.tsx\"\nimport type { EnumControlPropRow } from \"./EnumControlPropRow.tsx\"\nimport type { FileControlPropRow } from \"./FileControlPropRow.tsx\"\nimport type { FontControlPropRow } from \"./FontControlPropRow.tsx\"\nimport type { FusedNumberControlPropRow } from \"./FusedNumberControlPropRow.tsx\"\nimport type { GapControlPropRow } from \"./GapControlPropRow.tsx\"\nimport type { ImageControlPropRow } from \"./ImageControlPropRow.tsx\"\nimport type { LinkControlPropRow } from \"./LinkControlPropRow.tsx\"\nimport type { LinkRelValuesControlPropRow } from \"./LinkRelValuesControlPropRow.tsx\"\nimport type { LocationControlPropRow } from \"./LocationControlPropRow.tsx\"\nimport type { MultiCollectionReferenceControlPropRow } from \"./MultiCollectionReferenceControlPropRow.tsx\"\nimport type { NumberControlPropRow } from \"./NumberControlPropRow.tsx\"\nimport type { ObjectControlPropRow } from \"./ObjectControlPropRow.tsx\"\nimport type { PaddingControlPropRow } from \"./PaddingControlPropRow.tsx\"\nimport type { PageScopeControlPropRow } from \"./PageScopeControlPropRow.tsx\"\nimport type { RichTextControlPropRow } from \"./RichTextControlPropRow.tsx\"\nimport type { ScrollSectionRefControlPropRow } from \"./ScrollSectionRefControlPropRow.tsx\"\nimport type { SlotControlPropRow } from \"./SlotControlPropRow.tsx\"\nimport type { StringControlPropRow } from \"./StringControlPropRow.tsx\"\nimport type { TrackingIdControlPropRow } from \"./TrackingIdControlPropRow.tsx\"\nimport type { TransitionControlPropRow } from \"./TransitionControlPropRow.tsx\"\nimport type { VectorSetItemControlPropRow } from \"./VectorSetItemControlPropRow.tsx\"\n\n/**\n * Many control prop rows rely on the `VekterEngine`, which is not available during on-page editing.\n * Instead of refactoring each control prop row to remove this dependency, and since most are not\n * needed for on-page editing, we use dependency injection for the required control prop rows.\n */\nexport interface ControlPropRowContext {\n\tArrayControlPropRow?: typeof ArrayControlPropRow\n\tBooleanControlPropRow?: typeof BooleanControlPropRow\n\tBorderControlPropRow?: typeof BorderControlPropRow\n\tBorderRadiusControlPropRow?: typeof BorderRadiusControlPropRow\n\tBoxShadowControlPropRow?: typeof BoxShadowControlPropRow\n\tCanvasPageInstanceRow?: typeof CanvasPageInstanceRow\n\tCollectionReferenceControlPropRow?: typeof CollectionReferenceControlPropRow\n\tColorArrayControlPropRow?: typeof ColorArrayControlPropRow\n\tColorControlPropRow?: typeof ColorControlPropRow\n\tLocationControlPropRow?: typeof LocationControlPropRow\n\tCursorControlPropRow?: typeof CursorControlPropRow\n\tCustomCursorControlPropRow?: typeof CustomCursorControlPropRow\n\tDateControlPropRow?: typeof DateControlPropRow\n\tEnumControlPropRow?: typeof EnumControlPropRow\n\tFileControlPropRow?: typeof FileControlPropRow\n\tFontControlPropRow?: typeof FontControlPropRow\n\tFusedNumberControlPropRow?: typeof FusedNumberControlPropRow\n\tGapControlPropRow?: typeof GapControlPropRow\n\tImageControlPropRow?: typeof ImageControlPropRow\n\tLinkControlPropRow?: typeof LinkControlPropRow\n\tLinkRelValuesControlPropRow?: typeof LinkRelValuesControlPropRow\n\tMultiCollectionReferenceControlPropRow?: typeof MultiCollectionReferenceControlPropRow\n\tNumberControlPropRow?: typeof NumberControlPropRow\n\tObjectControlPropRow?: typeof ObjectControlPropRow\n\tPaddingControlPropRow?: typeof PaddingControlPropRow\n\tPageScopeControlPropRow?: typeof PageScopeControlPropRow\n\tRichTextControlPropRow?: typeof RichTextControlPropRow\n\tScrollSectionRefControlPropRow?: typeof ScrollSectionRefControlPropRow\n\tSlotControlPropRow?: typeof SlotControlPropRow\n\tStringControlPropRow?: typeof StringControlPropRow\n\tTrackingIdControlPropRow?: typeof TrackingIdControlPropRow\n\tTransitionControlPropRow?: typeof TransitionControlPropRow\n\tVectorSetItemControlPropRow?: typeof VectorSetItemControlPropRow\n}\n\nconst defaultContext: ControlPropRowContext = {}\n\nexport const ControlPropRowContext = createContext<ControlPropRowContext>(defaultContext)\nControlPropRowContext.displayName = \"ControlPropRowContext\"\n\nexport function useControlPropRows() {\n\tconst context = useContext(ControlPropRowContext)\n\n\tif (!context) {\n\t\tthrow new Error(\"useControlPropRows must be used within a ControlPropRowContext.Provider\")\n\t}\n\n\treturn context\n}\n", "import React from \"react\"\n\nconst collectionItemContext = React.createContext(false)\n\nexport const IsWithinCollectionItemProvider = collectionItemContext.Provider\n\nexport function useIsWithinCollectionItem() {\n\treturn React.useContext(collectionItemContext)\n}\n", "import { EngineChange } from \"document/EngineChanges.ts\"\nimport { useBaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport type { MaybeNodeID } from \"document/models/CanvasTree/index.ts\"\nimport type { VariableReference } from \"document/models/CanvasTree/traits/VariableReference.ts\"\nimport type { VariableDefinition } from \"document/models/CanvasTree/traits/WithVariables.ts\"\nimport { useEngineState } from \"document/useEngineState.ts\"\nimport { isVekterEngine } from \"document/useVekterEngine.ts\"\nimport type { VariableProviderInfo } from \"document/utils/VariableProviderInfo.ts\"\nimport { useIsWithinCollectionItem } from \"../contentManagement/useIsWithinCollectionItem.tsx\"\n\nexport function useVariableProviderInfo(supportsVariables: boolean = true) {\n\tconst engine = useBaseEngine()\n\tconst isWithinCollectionItem = useIsWithinCollectionItem()\n\n\treturn useEngineState(\n\t\t() => {\n\t\t\tif (!isVekterEngine(engine)) return null\n\t\t\tif (isWithinCollectionItem || !supportsVariables) return null\n\t\t\treturn engine.stores.treeStore.variableProviderInfo\n\t\t},\n\t\t[isWithinCollectionItem, supportsVariables],\n\t\tEngineChange.VariableProviderInfo,\n\t)\n}\n\nexport function getVariableAndProviderFromInfo(\n\tref: VariableReference,\n\tinfo: VariableProviderInfo | null,\n): { variable: VariableDefinition | undefined; providerId: MaybeNodeID } {\n\tconst { id, providerId = info?.fallbackProvider } = ref\n\tif (!info || !providerId) return { variable: undefined, providerId }\n\n\treturn { variable: info.combined.get(providerId)?.get(id), providerId }\n}\n\nexport function getVariableFromInfo(\n\tref: VariableReference,\n\tinfo: VariableProviderInfo | null,\n): VariableDefinition | undefined {\n\tconst { id, providerId = info?.fallbackProvider } = ref\n\tif (!info || !providerId) return undefined\n\n\treturn info.combined.get(providerId)?.get(id)\n}\n", "import \"doubleColumn.styles_141ausz.wyw.css\"; export const doubleColumnClass = \"doubleColumnClass_dt2vdl5\";\nexport const doubleColumnClassForSortable = \"doubleColumnClassForSortable_dc4gvpv\";\nexport const spanAllColumnClass = \"spanAllColumnClass_s1dpgfha\";", "import type React from \"react\"\n\ninterface AgentCollectionItemIconProps extends React.SVGProps<SVGSVGElement> {\n\tforeground?: string\n}\n\nexport function IconAgentCollectionItemNext({ foreground = \"white\", ...props }: AgentCollectionItemIconProps) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width={22} height={22} fill=\"none\" {...props}>\n\t\t\t<path fill=\"currentColor\" d=\"M0 4a4 4 0 0 1 4-4h14a4 4 0 0 1 4 4v14a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4Z\" />\n\t\t\t<path\n\t\t\t\tfill=\"transparent\"\n\t\t\t\tstroke={foreground}\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.25 6.5 3.793 3.793a1 1 0 0 1 0 1.414L9.25 15.5\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentCollectionItemPrevious({ foreground = \"white\", ...props }: AgentCollectionItemIconProps) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width={22} height={22} fill=\"none\" {...props}>\n\t\t\t<path fill=\"currentColor\" d=\"M0 4a4 4 0 0 1 4-4h14a4 4 0 0 1 4 4v14a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4Z\" />\n\t\t\t<path\n\t\t\t\tfill=\"transparent\"\n\t\t\t\tstroke={foreground}\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth={1.5}\n\t\t\t\td=\"m12.25 6.5-3.793 3.793a1 1 0 0 0 0 1.414L12.25 15.5\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n", "import { triggerEvent } from \"../listeners\";\nfunction createVariableReferenceDeleteEvent(payload) {\n  console.warn(\"[DEPRECATED] Use triggerVariableReferenceDeleteEvent instead of createVariableReferenceDeleteEvent.\");\n  return {\n    ...payload,\n    event: \"variable_reference_delete\"\n  };\n}\nconst meta = {\n  track: true\n};\nfunction triggerVariableReferenceDeleteEvent(payload) {\n  const event = {\n    ...payload,\n    event: \"variable_reference_delete\"\n  };\n  triggerEvent(event, meta);\n}\nexport {\n  createVariableReferenceDeleteEvent,\n  triggerVariableReferenceDeleteEvent\n};\n", "import { triggerVariableReferenceDeleteEvent } from \"@framerjs/framer-events\"\nimport type { ComponentLoader } from \"@framerjs/framer-runtime\"\nimport type { StackProps } from \"@framerjs/fresco\"\nimport {\n\tCenterChild,\n\tIconComputedValue,\n\tIconInputClose,\n\tIconInputDropdown,\n\tSpacer,\n\tStack,\n\ttruncateWithEllipsis,\n\tuseReadOnly,\n} from \"@framerjs/fresco\"\nimport { assert } from \"@framerjs/shared\"\nimport { cx } from \"@linaria/core\"\nimport { Dictionary } from \"app/dictionary.ts\"\nimport { useExperimentIsOn } from \"app/experiments.ts\"\nimport { useBaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport type { CanvasNode, CanvasTree, MaybeNodeID } from \"document/models/CanvasTree/index.ts\"\nimport type { DynamicValue } from \"document/models/CanvasTree/traits/DynamicValue.ts\"\nimport type { VariableReference } from \"document/models/CanvasTree/traits/VariableReference.ts\"\nimport type { HasCollectionDataSource } from \"document/models/CanvasTree/traits/WithCollectionDataSource.ts\"\nimport { hasCollectionDataSource } from \"document/models/CanvasTree/traits/WithCollectionDataSource.ts\"\nimport type { VariableDefinition, VariableType } from \"document/models/CanvasTree/traits/WithVariables.ts\"\nimport { isVekterEngine } from \"document/useVekterEngine.ts\"\nimport { repeaterItemIndexVariableId } from \"document/utils/RepeaterVariables.ts\"\nimport type { VariableProviderInfo } from \"document/utils/VariableProviderInfo.ts\"\nimport { ControlType } from \"library/render/types/PropertyControls.ts\"\nimport React from \"react\"\nimport { commonValue } from \"utils/commonValue.ts\"\nimport { editVariable } from \"utils/editVariable.ts\"\nimport { getNegatedLabel } from \"utils/getNegatedLabel.ts\"\nimport { isArray } from \"utils/typeChecks.ts\"\nimport { getSlugVariableName } from \"utils/variableMetadata.ts\"\nimport { getVariableAndProviderFromInfo, useVariableProviderInfo } from \"../properties/useVariableProviderInfo.ts\"\nimport { doubleColumnClass } from \"../properties/utils/doubleColumn.styles.ts\"\nimport { getNameForVariableProvider } from \"../properties/utils/getNameForVariableProvider.ts\"\nimport { IconAgentComputedValue } from \"./AgentComputedValueIcon.tsx\"\nimport * as styles from \"./VariableReferenceButton.styles.ts\"\nimport { iconForVariable, iconForVariableType } from \"./utils/iconForVariable.tsx\"\n\nfunction expectsBoolean(expectedType: VariableType | readonly VariableType[]): boolean {\n\tif (isArray(expectedType)) {\n\t\treturn commonValue(expectedType) === ControlType.Boolean\n\t}\n\treturn expectedType === ControlType.Boolean\n}\n\nfunction hasOtherProviderWithSameDataSource(\n\ttree: CanvasTree,\n\tprovider: CanvasNode & HasCollectionDataSource,\n\tvariableInfo: VariableProviderInfo,\n): boolean {\n\tif (variableInfo.combined.size <= 1) return false\n\n\tconst allProviderIds = variableInfo.combined.keys()\n\n\tfor (const otherProviderId of allProviderIds) {\n\t\tif (otherProviderId === provider.id) continue\n\n\t\tconst otherProvider = tree.getNode(otherProviderId)\n\t\tif (!hasCollectionDataSource(otherProvider)) continue\n\n\t\tif (otherProvider.dataIdentifier === provider.dataIdentifier) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\n/**\n * We only have to suffix the variable name with the provider if there is another provider that\n * provides exactly the same variables.\n */\nfunction getProviderSuffixIfNeeded(\n\ttree: CanvasTree,\n\tcomponentLoader: ComponentLoader,\n\tproviderId: MaybeNodeID,\n\tvariableInfo: VariableProviderInfo | null,\n): string | undefined {\n\tif (!providerId || !variableInfo) return\n\tif (variableInfo.combined.size <= 1) return\n\n\tconst providerNode = tree.get(providerId)\n\tif (!hasCollectionDataSource(providerNode)) return\n\tif (!hasOtherProviderWithSameDataSource(tree, providerNode, variableInfo)) return\n\n\t// We only suffix the variable name with the provider if it isn't provided by the closest\n\t// provider. For example within a collection list on a CMS detail page, only the variables\n\t// provided by the page will get the suffix.\n\tconst closestProviderId: string | undefined = variableInfo.combined.keys().next().value\n\tconst isClosestProvider = closestProviderId === providerId\n\tif (isClosestProvider) return\n\n\treturn \" (\" + getNameForVariableProvider(tree, componentLoader, providerId, \"type\") + \")\"\n}\n\nfunction getVariableName(variable: VariableDefinition): string {\n\tconst slugVariableName = getSlugVariableName(variable)\n\tif (slugVariableName) return slugVariableName\n\treturn variable.name || Dictionary.Unknown\n}\n\nfunction getTitle(\n\ttree: CanvasTree,\n\tcomponentLoader: ComponentLoader,\n\tvariable: VariableDefinition | undefined,\n\texpectedType: VariableType | readonly VariableType[],\n\tisComputedValue: boolean,\n\tisNegated: boolean,\n\tproviderId: MaybeNodeID,\n\tvariableInfo: VariableProviderInfo | null,\n): string {\n\tif (isComputedValue) {\n\t\treturn expectsBoolean(expectedType) ? Dictionary.Condition : Dictionary.Transform\n\t}\n\tif (!variable) return Dictionary.Missing\n\n\tconst variableName = getVariableName(variable)\n\tconst providerSuffix = getProviderSuffixIfNeeded(tree, componentLoader, providerId, variableInfo) ?? \"\"\n\n\tconst label = variableName + providerSuffix\n\treturn getNegatedLabel(label, isNegated)\n}\n\nfunction getIcon(\n\tvariable: VariableDefinition | undefined,\n\texpectedType: VariableType | readonly VariableType[],\n\tisComputedValue: boolean,\n\tagentExperimentEnabled: boolean,\n) {\n\tif (isComputedValue) {\n\t\tif (agentExperimentEnabled) return <IconAgentComputedValue />\n\t\treturn <IconComputedValue />\n\t}\n\tif (variable) {\n\t\treturn iconForVariable(variable, {\n\t\t\tcompactStringIcon: agentExperimentEnabled,\n\t\t\tagentExperimentEnabled,\n\t\t})\n\t}\n\tconst type = Array.isArray(expectedType) ? expectedType[0] : expectedType\n\tassert(type)\n\treturn iconForVariableType(type, {\n\t\tcompactStringIcon: agentExperimentEnabled,\n\t\tagentExperimentEnabled,\n\t})\n}\n\nexport interface VariableReferenceButtonProps extends StackProps {\n\texpectedType: VariableType | readonly VariableType[]\n\treference: VariableReference\n\tonRemove: ((dynamicValue: DynamicValue) => void) | undefined\n\thasError?: boolean\n\tbuttonTitle?: string\n\tisNegated?: boolean\n\tisComputedValue?: boolean\n\tonShowMenu?: (event: React.MouseEvent<HTMLDivElement>) => void\n\t/** 18 x 18 */\n\tpreview?: React.ReactNode\n}\n\nfunction isOnSelectUseable(variable: VariableDefinition | undefined) {\n\treturn variable?.id !== repeaterItemIndexVariableId\n}\n\nexport const VariableReferenceButton = React.memo(\n\tReact.forwardRef<HTMLDivElement, VariableReferenceButtonProps>(function VariableReferenceButton(props, forwardedRef) {\n\t\tconst engine = useBaseEngine()\n\t\tconst agentExperimentEnabled = useExperimentIsOn(\"agent\")\n\n\t\tconst {\n\t\t\texpectedType,\n\t\t\treference,\n\t\t\tonRemove,\n\t\t\tclassName,\n\t\t\tonClick,\n\t\t\thasError,\n\t\t\tisComputedValue = false,\n\t\t\tisNegated = false,\n\t\t\tbuttonTitle,\n\t\t\tonShowMenu,\n\t\t\tpreview,\n\t\t\t...stackProps\n\t\t} = props\n\n\t\tconst isReadonly = useReadOnly()\n\n\t\tconst variableInfo = useVariableProviderInfo()\n\t\tconst { variable, providerId } = getVariableAndProviderFromInfo(reference, variableInfo)\n\t\tconst onSelectIsUseable = isOnSelectUseable(variable)\n\n\t\tfunction onContextMenu(event: React.MouseEvent) {\n\t\t\tif (!onRemove) return\n\t\t\tengine.stores.contextMenuStore.show(\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: Dictionary.Remove,\n\t\t\t\t\t\tenabled: !isReadonly,\n\t\t\t\t\t\tclick: () => {\n\t\t\t\t\t\t\tonRemove(reference)\n\t\t\t\t\t\t\ttriggerVariableReferenceDeleteEvent({\n\t\t\t\t\t\t\t\tvariableId: variable?.id,\n\t\t\t\t\t\t\t\tvariableType: variable?.type,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\t{ location: { x: event.clientX, y: event.clientY } },\n\t\t\t)\n\t\t}\n\n\t\tconst onSelect = engine.scheduler.wrapHandler(() => {\n\t\t\tif (isVekterEngine(engine) && variable && providerId && onSelectIsUseable) {\n\t\t\t\teditVariable(engine, variable.id, providerId)\n\t\t\t}\n\t\t})\n\n\t\tconst onClickDelete = (event: React.MouseEvent) => {\n\t\t\tif (!onRemove || isReadonly) return\n\t\t\tevent.stopPropagation() // Cancel opening of the popout\n\t\t\tonRemove(reference)\n\t\t\ttriggerVariableReferenceDeleteEvent({ variableId: variable?.id, variableType: variable?.type })\n\t\t}\n\n\t\tconst title = getTitle(\n\t\t\tengine.tree,\n\t\t\tengine.componentLoader,\n\t\t\tvariable,\n\t\t\texpectedType,\n\t\t\tisComputedValue,\n\t\t\tisNegated,\n\t\t\tproviderId,\n\t\t\tvariableInfo,\n\t\t)\n\t\tconst iconOrPreview = preview ?? getIcon(variable, expectedType, isComputedValue, agentExperimentEnabled)\n\t\tconst menuButtonVisible = Boolean(onShowMenu) && !isReadonly\n\n\t\tconst mouseDownMenuHandler = (event: React.MouseEvent<HTMLDivElement>) => {\n\t\t\tif (isReadonly) return\n\t\t\tevent.stopPropagation()\n\t\t\tonShowMenu?.(event)\n\t\t}\n\n\t\treturn (\n\t\t\t<Stack\n\t\t\t\tref={forwardedRef}\n\t\t\t\trole=\"button\"\n\t\t\t\tdirection=\"row\"\n\t\t\t\talignItems=\"center\"\n\t\t\t\tclassName={cx(\n\t\t\t\t\tstyles.button,\n\t\t\t\t\tdoubleColumnClass,\n\t\t\t\t\tonClick || onSelectIsUseable || menuButtonVisible ? styles.clickableButton : undefined,\n\t\t\t\t\thasError && styles.buttonWithError,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\ttabIndex={0}\n\t\t\t\tonContextMenu={onContextMenu}\n\t\t\t\tpaddingLeft={4}\n\t\t\t\tgap={0}\n\t\t\t\tonClick={variable ? (onClick ?? onSelect) : undefined}\n\t\t\t\ttitle={buttonTitle ?? title}\n\t\t\t\t{...stackProps}\n\t\t\t>\n\t\t\t\t<CenterChild className={cx(styles.iconWrapper, agentExperimentEnabled && styles.iconWrapperAgent)}>\n\t\t\t\t\t{iconOrPreview}\n\t\t\t\t</CenterChild>\n\t\t\t\t<Spacer size={6} />\n\t\t\t\t<div className={cx(truncateWithEllipsis, styles.titleWrapper)}>{title}</div>\n\t\t\t\t{onRemove && !isReadonly && (\n\t\t\t\t\t<CenterChild\n\t\t\t\t\t\tclassName={styles.closeWrapper}\n\t\t\t\t\t\tonClick={onClickDelete}\n\t\t\t\t\t\tonMouseDown={stopPropagation}\n\t\t\t\t\t\ttitle={Dictionary.Remove}\n\t\t\t\t\t>\n\t\t\t\t\t\t<IconInputClose />\n\t\t\t\t\t</CenterChild>\n\t\t\t\t)}\n\t\t\t\t{menuButtonVisible && (\n\t\t\t\t\t<CenterChild className={styles.menuButton} onMouseDown={mouseDownMenuHandler} onClick={stopPropagation}>\n\t\t\t\t\t\t<IconInputDropdown />\n\t\t\t\t\t</CenterChild>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t)\n\t}),\n)\n\nfunction stopPropagation(event: React.MouseEvent) {\n\tevent.stopPropagation()\n}\n", "import type { ComponentLoader } from \"@framerjs/framer-runtime\"\nimport { Dictionary } from \"app/dictionary.ts\"\nimport { getDefaultName } from \"document/components/utils/nodes.ts\"\nimport type { CanvasNode, CanvasTree, NodeID } from \"document/models/CanvasTree/index.ts\"\nimport {\n\tisDataRepeater,\n\tisSmartComponentNode,\n\tisWebPageNode,\n} from \"document/models/CanvasTree/nodes/utils/nodeCheck.ts\"\nimport { withCollectionDataSource } from \"document/models/CanvasTree/traits/WithCollectionDataSource.ts\"\nimport { hasRepeatArray } from \"document/models/CanvasTree/traits/WithRepeatArray.ts\"\nimport { withVariables } from \"document/models/CanvasTree/traits/WithVariables.ts\"\nimport { localeProviderId } from \"document/utils/LocaleVariable.ts\"\nimport { titleCase } from \"utils/titleCase.ts\"\n\nfunction getRepeatArrayVariableName(tree: CanvasTree, node: CanvasNode): string | undefined {\n\tif (!hasRepeatArray(node) || !node.repeatArray.providerId) return\n\tconst arrayProvider = tree.getNodeWithTrait(node.repeatArray.providerId, withVariables)\n\treturn arrayProvider?.getVariable(node.repeatArray.id)?.name\n}\n\nfunction getVariableProviderName(tree: CanvasTree, componentLoader: ComponentLoader, node: CanvasNode): string {\n\tconst repeatArrayVariableName = getRepeatArrayVariableName(tree, node)\n\tif (repeatArrayVariableName) return repeatArrayVariableName\n\n\tif (isSmartComponentNode(node)) {\n\t\treturn node.resolveValue(\"name\") || \"Component\"\n\t}\n\tif (withCollectionDataSource(node) && node.dataIdentifier) {\n\t\tconst data = componentLoader.dataForIdentifier(node.dataIdentifier)\n\t\tif (data) return titleCase(data.name)\n\t}\n\treturn node.resolveValue(\"name\") || getDefaultName(componentLoader, node)\n}\n\nfunction getVariableProviderType(node: CanvasNode): string {\n\tif (isDataRepeater(node)) return \"List\"\n\tif (isWebPageNode(node)) return \"Page\"\n\tif (isSmartComponentNode(node)) return \"Component\"\n\treturn \"\"\n}\n\nexport function getNameForVariableProvider(\n\ttree: CanvasTree,\n\tcomponentLoader: ComponentLoader,\n\tproviderId: NodeID,\n\ttype: \"long\" | \"type\" = \"long\",\n): string {\n\tif (providerId === localeProviderId) {\n\t\treturn Dictionary.Localization\n\t}\n\n\tconst providerNode = tree.get(providerId)\n\tif (!providerNode) return Dictionary.Unknown\n\n\tconst providerName = getVariableProviderName(tree, componentLoader, providerNode)\n\tconst providerType = getVariableProviderType(providerNode)\n\tif (type === \"type\") return providerType\n\tif (!providerType) return providerName\n\n\tif (providerName === providerType) return providerName\n\treturn `${providerName} ${providerType}`\n}\n", "import type React from \"react\"\n\ninterface AgentComputedValueIconProps extends React.SVGProps<SVGSVGElement> {\n\tforeground?: string\n}\n\nexport function IconAgentComputedValue({ foreground = \"white\", ...props }: AgentComputedValueIconProps) {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width={22} height={22} fill=\"none\" {...props}>\n\t\t\t<path fill=\"currentColor\" d=\"M0 4a4 4 0 0 1 4-4h14a4 4 0 0 1 4 4v14a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4Z\" />\n\t\t\t<path\n\t\t\t\tfill=\"transparent\"\n\t\t\t\tstroke={foreground}\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth={1.5}\n\t\t\t\td=\"M12.75 9v4M9.25 8v6M5.75 6.5v9M16.25 10.5v1\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n", "import \"VariableReferenceButton.styles_14thnsv.wyw.css\"; export const button = \"button_by3f1yf\";\nexport const buttonWithError = \"buttonWithError_b1locfei\";\nexport const clickableButton = \"clickableButton_ck79ln6\";\nexport const iconWrapper = \"iconWrapper_ikobvuw\";\nexport const iconWrapperAgent = \"iconWrapperAgent_iz41s9a\";\nexport const titleWrapper = \"titleWrapper_t11k2f3d\";\nexport const closeWrapper = \"closeWrapper_c1wy3we0\";\nexport const menuButton = \"menuButton_m1vt2ra9\";", "import {\n\tIconCollectionItemNext,\n\tIconCollectionItemPrevious,\n\tIconVariableArray,\n\tLegacyIconVariableArray,\n\tIconVariableBoolean,\n\tLegacyIconVariableBoolean,\n\tIconVariableBorder,\n\tLegacyIconVariableBorder,\n\tIconVariableBorderRadius,\n\tLegacyIconVariableBorderRadius,\n\tIconVariableCollectionReference,\n\tLegacyIconVariableCollectionReference,\n\tIconVariableColor,\n\tLegacyIconVariableColor,\n\tIconVariableCursor,\n\tLegacyIconVariableCursor,\n\tIconVariableDate,\n\tLegacyIconVariableDate,\n\tIconVariableEnum,\n\tLegacyIconVariableEnum,\n\tIconVariableEventHandler,\n\tLegacyIconVariableEventHandler,\n\tIconVariableFile,\n\tLegacyIconVariableFile,\n\tIconVariableGallery,\n\tLegacyIconVariableGallery,\n\tIconVariableGap,\n\tIconVariableImage,\n\tLegacyIconVariableImage,\n\tIconVariableLink,\n\tLegacyIconVariableLink,\n\tIconVariableLinkRelValues,\n\tLegacyIconVariableLinkRelValues,\n\tIconVariableLocation,\n\tLegacyIconVariableLocation,\n\tIconVariableMultiCollectionReference,\n\tLegacyIconVariableMultiCollectionReference,\n\tIconVariableNumber,\n\tLegacyIconVariableNumber,\n\tIconVariablePadding,\n\tLegacyIconVariablePadding,\n\tIconVariableRichText,\n\tLegacyIconVariableRichText,\n\tIconVariableShadow,\n\tLegacyIconVariableShadow,\n\tIconVariableSlug,\n\tLegacyIconVariableSlug,\n\tIconVariableString,\n\tLegacyIconVariableString,\n\tIconVariableTrackingId,\n\tLegacyIconVariableTrackingId,\n\tIconVariableTransition,\n\tLegacyIconVariableTransition,\n\tIconVariableVector,\n\tLegacyIconVariableVector,\n} from \"@framerjs/fresco\"\nimport { assertNever } from \"@framerjs/shared\"\nimport type { VariableDefinition, VariableType } from \"document/models/CanvasTree/traits/WithVariables.ts\"\nimport { isArrayGalleryVariable } from \"document/models/CanvasTree/traits/WithVariables.ts\"\nimport { nextItemVariableId, previousItemVariableId } from \"document/utils/CollectionItemVariables.ts\"\nimport { ControlType } from \"library/render/types/PropertyControls.ts\"\nimport { getParentVariableId } from \"utils/collectionReferenceUtils.ts\"\nimport { isSlugVariable } from \"utils/variableMetadata.ts\"\nimport { IconAgentCollectionItemNext, IconAgentCollectionItemPrevious } from \"../AgentCollectionItemIcons.tsx\"\n\ninterface IconForVariableOptions {\n\tagentExperimentEnabled: boolean\n\tforeground?: string\n\tcompactStringIcon?: boolean\n}\n\n/**\n * @deprecated\n * Doesn't return the correct icon for control references, please use iconForVariable if possible.\n */\nexport function iconForVariableType(type: VariableType, options: IconForVariableOptions) {\n\tconst { foreground, agentExperimentEnabled, compactStringIcon = false } = options\n\n\tswitch (type) {\n\t\tcase ControlType.String:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableString foreground={foreground} />\n\t\t\treturn <IconVariableString foreground={foreground} compact={compactStringIcon} />\n\t\tcase ControlType.RichText:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableRichText foreground={foreground} />\n\t\t\treturn <IconVariableRichText foreground={foreground} />\n\t\tcase ControlType.Number:\n\t\tcase ControlType.ScrollSectionRef:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableNumber foreground={foreground} />\n\t\t\treturn <IconVariableNumber foreground={foreground} />\n\t\tcase ControlType.Gap:\n\t\t\tif (!agentExperimentEnabled) return <IconVariableGap foreground={foreground} />\n\t\t\treturn <IconVariableNumber foreground={foreground} />\n\t\tcase ControlType.Boolean:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableBoolean foreground={foreground} />\n\t\t\treturn <IconVariableBoolean foreground={foreground} />\n\t\tcase ControlType.Color:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableColor foreground={foreground} />\n\t\t\treturn <IconVariableColor foreground={foreground} />\n\t\tcase ControlType.Image:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableImage foreground={foreground} />\n\t\t\treturn <IconVariableImage foreground={foreground} />\n\t\tcase ControlType.EventHandler:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableEventHandler foreground={foreground} />\n\t\t\treturn <IconVariableEventHandler foreground={foreground} />\n\t\tcase \"controlReference\":\n\t\tcase \"nodePropertyControlReference\":\n\t\t\t// Might be wrong, we need to get the entire variable to know which type it is\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableEnum foreground={foreground} />\n\t\t\treturn <IconVariableEnum foreground={foreground} />\n\t\tcase ControlType.Link:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableLink foreground={foreground} />\n\t\t\treturn <IconVariableLink foreground={foreground} />\n\t\tcase ControlType.LinkRelValues:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableLinkRelValues foreground={foreground} />\n\t\t\treturn <IconVariableLinkRelValues foreground={foreground} />\n\t\tcase ControlType.Date:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableDate foreground={foreground} />\n\t\t\treturn <IconVariableDate foreground={foreground} />\n\t\tcase ControlType.Enum:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableEnum foreground={foreground} />\n\t\t\treturn <IconVariableEnum foreground={foreground} />\n\t\tcase ControlType.File:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableFile foreground={foreground} />\n\t\t\treturn <IconVariableFile foreground={foreground} />\n\t\tcase ControlType.CustomCursor:\n\t\tcase ControlType.Cursor:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableCursor foreground={foreground} />\n\t\t\treturn <IconVariableCursor foreground={foreground} />\n\t\tcase \"slug\":\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableSlug foreground={foreground} />\n\t\t\treturn <IconVariableSlug foreground={foreground} />\n\t\tcase ControlType.Transition:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableTransition foreground={foreground} />\n\t\t\treturn <IconVariableTransition foreground={foreground} />\n\t\tcase ControlType.Border:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableBorder foreground={foreground} />\n\t\t\treturn <IconVariableBorder foreground={foreground} />\n\t\tcase ControlType.BoxShadow:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableShadow foreground={foreground} />\n\t\t\treturn <IconVariableShadow foreground={foreground} />\n\t\tcase ControlType.Padding:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariablePadding foreground={foreground} />\n\t\t\treturn <IconVariablePadding foreground={foreground} />\n\t\tcase ControlType.BorderRadius:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableBorderRadius foreground={foreground} />\n\t\t\treturn <IconVariableBorderRadius foreground={foreground} />\n\t\tcase ControlType.CollectionReference:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableCollectionReference foreground={foreground} />\n\t\t\treturn <IconVariableCollectionReference foreground={foreground} />\n\t\tcase ControlType.MultiCollectionReference:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableMultiCollectionReference foreground={foreground} />\n\t\t\treturn <IconVariableMultiCollectionReference foreground={foreground} />\n\t\tcase ControlType.Array:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableArray foreground={foreground} />\n\t\t\treturn <IconVariableArray foreground={foreground} />\n\t\tcase ControlType.TrackingId:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableTrackingId foreground={foreground} />\n\t\t\treturn <IconVariableTrackingId foreground={foreground} />\n\t\tcase ControlType.VectorSetItem:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableVector foreground={foreground} />\n\t\t\treturn <IconVariableVector foreground={foreground} />\n\t\tcase ControlType.Location:\n\t\t\tif (!agentExperimentEnabled) return <LegacyIconVariableLocation foreground={foreground} />\n\t\t\treturn <IconVariableLocation foreground={foreground} />\n\t\tdefault:\n\t\t\treturn assertNever(type, \"Missing icon for variable type\")\n\t}\n}\n\nexport function iconForVariable(variable: VariableDefinition, options: IconForVariableOptions) {\n\tconst { foreground, compactStringIcon = false, agentExperimentEnabled } = options\n\n\tif (variable.id === previousItemVariableId) {\n\t\tif (agentExperimentEnabled) return <IconAgentCollectionItemPrevious foreground={foreground} />\n\t\treturn <IconCollectionItemPrevious isVariable foreground={foreground} />\n\t}\n\n\tif (variable.id === nextItemVariableId) {\n\t\tif (agentExperimentEnabled) return <IconAgentCollectionItemNext foreground={foreground} />\n\t\treturn <IconCollectionItemNext isVariable foreground={foreground} />\n\t}\n\n\tif (isArrayGalleryVariable(variable)) {\n\t\tif (agentExperimentEnabled) return <IconVariableGallery foreground={foreground} />\n\t\treturn <LegacyIconVariableGallery foreground={foreground} />\n\t}\n\n\tif (isSlugVariable(variable)) {\n\t\tconst parentVariableId = getParentVariableId(variable.id)\n\n\t\tif (parentVariableId === previousItemVariableId) {\n\t\t\tif (agentExperimentEnabled) return <IconAgentCollectionItemPrevious foreground={foreground} />\n\t\t\treturn <IconCollectionItemPrevious isVariable foreground={foreground} />\n\t\t}\n\n\t\tif (parentVariableId === nextItemVariableId) {\n\t\t\tif (agentExperimentEnabled) return <IconAgentCollectionItemNext foreground={foreground} />\n\t\t\treturn <IconCollectionItemNext isVariable foreground={foreground} />\n\t\t}\n\n\t\tif (agentExperimentEnabled) return <IconVariableSlug foreground={foreground} />\n\t\treturn <LegacyIconVariableSlug foreground={foreground} />\n\t}\n\n\tif (variable.type === \"controlReference\" || variable.type === \"nodePropertyControlReference\") {\n\t\tconst { expectedType } = variable\n\t\tswitch (expectedType) {\n\t\t\tcase ControlType.Enum:\n\t\t\tcase ControlType.SegmentedEnum:\n\t\t\t\tif (agentExperimentEnabled) return <IconVariableEnum foreground={foreground} />\n\t\t\t\treturn <LegacyIconVariableEnum foreground={foreground} />\n\t\t\tcase ControlType.File:\n\t\t\t\tif (agentExperimentEnabled) return <IconVariableFile foreground={foreground} />\n\t\t\t\treturn <LegacyIconVariableFile foreground={foreground} />\n\t\t\tdefault:\n\t\t\t\tassertNever(expectedType, `iconForVariable(), unsupported file reference type: ${expectedType}`)\n\t\t}\n\t}\n\n\treturn iconForVariableType(variable.type, { foreground, compactStringIcon, agentExperimentEnabled })\n}\n", "import { assert, assertNever } from \"@framerjs/shared\"\nimport type { ComputedValue } from \"document/models/CanvasTree/traits/ComputedValue.ts\"\nimport { isComputedValue, isComputedValueFromFetchData } from \"document/models/CanvasTree/traits/ComputedValue.ts\"\nimport type { DynamicValue } from \"document/models/CanvasTree/traits/DynamicValue.ts\"\nimport { isVariableReference } from \"document/models/CanvasTree/traits/VariableReference.ts\"\nimport type { VariableDefinition } from \"document/models/CanvasTree/traits/WithVariables.ts\"\nimport { ControlType } from \"library/index.ts\"\n\n/** Boolean variables can consume the first transform when it's negated. */\nexport function selectedVariableIsNegated(\n\tvalue: DynamicValue | null | undefined,\n\tvariable: VariableDefinition | undefined,\n): value is ComputedValue {\n\tif (!value || !variable) return false\n\tif (isVariableReference(value)) return false\n\tif (isComputedValueFromFetchData(value)) return false\n\tif (!isComputedValue(value)) assertNever(value)\n\tassert(value.startValue.id === variable.id)\n\treturn variable.type === ControlType.Boolean && value.transforms[0]?.name === \"negate\"\n}\n\n/** Negated boolean variables with only the one negate transform should not display the transform popout. */\nexport function selectedVariableIsNegatedWithoutOtherTransforms(\n\tvalue: DynamicValue | null | undefined,\n\tvariable: VariableDefinition | undefined,\n): boolean {\n\treturn selectedVariableIsNegated(value, variable) && value.transforms.length === 1\n}\n", "import { openNewTab } from \"@framerjs/app-shared\"\nimport { Button, CenterChild, CustomButton, IconEducation, IconInfo, useTooltip } from \"@framerjs/fresco\"\nimport { colors } from \"@framerjs/fresco/tokens\"\nimport { assertNever } from \"@framerjs/shared\"\nimport { useDimensionValue } from \"app/agent/hooks/useDimensionValue.ts\"\nimport { useExperimentIsOn } from \"app/experiments.ts\"\nimport { PanelTooltip, PanelTooltipWithoutTrigger } from \"document/components/chrome/PanelTooltip.tsx\"\nimport { useMemo, useRef } from \"react\"\nimport { isString } from \"utils/typeChecks.ts\"\nimport { Pages, record } from \"web/lib/tracker.ts\"\nimport { useDarkMode } from \"web/lib/useDarkMode.ts\"\nimport * as styles from \"./EducationTooltip.styles.ts\"\nimport a11y from \"./educationAssets/a11y.png\"\nimport remTypography from \"./educationAssets/rem-typography.jpg\"\nimport scrollTargets from \"./educationAssets/scroll-targets.jpg\"\n\n/** Copy we use for education in the app */\n\nexport enum EducationKey {\n\tAccessibility = \"accessibility\",\n\tREMTypography = \"remTypography\",\n\tScrollTargets = \"scrollTargets\",\n\t// Keep value stable to preserve existing analytics/event dashboards.\n\tDetailPage = \"templatePage\",\n}\n\ntype EducationInfo = Record<\n\tEducationKey,\n\t{\n\t\ttitle: string\n\t\tactionText?: string\n\t\timage?: string | { dark: string; light: string }\n\t\ttext: string\n\t\ttype: \"icon\" | \"button\"\n\t\t/**\n\t\t * The image should have an aspect ratio of roughly 195 / 95.5. We\n\t\t * provide this aspect ratio up front so that the tooltip doesn't resize\n\t\t * when the image is decoded. If this happens, the arrow is not pointing\n\t\t * at the correct target.\n\t\t */\n\t\thref?: string | undefined\n\t\tactions?: React.ReactNode\n\t\tinitialVisibility?: boolean\n\t}\n>\n\nconst onEducationClick = (tooltipId: EducationKey) => {\n\trecord(\"ui_interaction\", { page: Pages.educationTooltip, id: tooltipId })\n}\n\nconst educationInfo = (key: EducationKey): EducationInfo[EducationKey] => {\n\tswitch (key) {\n\t\tcase EducationKey.DetailPage:\n\t\t\treturn {\n\t\t\t\ttitle: \"Detail Page\",\n\t\t\t\tactionText: \"Watch Video\",\n\t\t\t\ttext: \"Layout changes made to this page apply to all pages of the selected CMS collection.\",\n\t\t\t\thref: \"https://www.framer.com/academy/lessons/cms-pages-dynamic-content\",\n\t\t\t\ttype: \"button\",\n\t\t\t}\n\t\tcase EducationKey.REMTypography:\n\t\t\treturn {\n\t\t\t\ttitle: \"REM Typography\",\n\t\t\t\tactionText: \"Watch Video\",\n\t\t\t\ttext: \"This is the base value per Breakpoint when using REM sizing in your typography.\",\n\t\t\t\timage: remTypography,\n\t\t\t\thref: \"https://youtu.be/DGPCFIKUDb8\",\n\t\t\t\ttype: \"icon\",\n\t\t\t}\n\t\tcase EducationKey.Accessibility:\n\t\t\treturn {\n\t\t\t\ttitle: \"Accessibility Tips\",\n\t\t\t\tactionText: \"Learn More\",\n\t\t\t\timage: a11y,\n\t\t\t\ttext: \"Learn about the tools Framer gives you to add meaning to the elements of your website.\",\n\t\t\t\thref: \"https://www.framer.com/learn/accessibility/\",\n\t\t\t\ttype: \"icon\",\n\t\t\t}\n\t\tcase EducationKey.ScrollTargets:\n\t\t\treturn {\n\t\t\t\ttitle: \"Scroll Sections\",\n\t\t\t\tactionText: \"Watch Video\",\n\t\t\t\thref: \"https://www.youtube.com/watch?v=AG1ZEij8Vcw\",\n\t\t\t\timage: scrollTargets,\n\t\t\t\ttext: \"Learn how to create links that smoothly scroll to a specific section within your page.\",\n\t\t\t\ttype: \"icon\",\n\t\t\t}\n\t\tdefault:\n\t\t\tassertNever(key)\n\t}\n}\n\ninterface EducationTooltipProps {\n\ttooltipId: EducationKey\n}\n\nfunction IconAgentEducationInfo() {\n\treturn (\n\t\t<svg role=\"presentation\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" fill=\"none\">\n\t\t\t<g stroke=\"currentColor\" strokeWidth=\"1.5\">\n\t\t\t\t<path fill=\"currentColor\" fillOpacity={0.2} d=\"M5.75 1a5 5 0 1 1-.001 10.001A5 5 0 0 1 5.75 1Z\" />\n\t\t\t\t<path fill=\"transparent\" strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5.75 8.25v-2\" />\n\t\t\t\t<path fill=\"transparent\" strokeLinecap=\"round\" d=\"M5.75 3.75h0\" />\n\t\t\t</g>\n\t\t</svg>\n\t)\n}\n\nfunction IconEducationTooltip({\n\thref,\n\tactionText,\n\ttooltipId,\n\tcontent,\n\timage,\n}: {\n\thref?: string\n\tactionText?: string\n\ttooltipId: EducationKey\n\tcontent: Omit<EducationInfo[EducationKey], \"type\">\n\timage?: string\n}) {\n\tconst isAgentExperimentOn = useExperimentIsOn(\"agent\")\n\n\treturn (\n\t\t<PanelTooltip\n\t\t\ticon={\n\t\t\t\t<CenterChild className={styles.icon} title=\"\">\n\t\t\t\t\t{isAgentExperimentOn ? <IconAgentEducationInfo /> : <IconEducation />}\n\t\t\t\t</CenterChild>\n\t\t\t}\n\t\t\tdirection=\"right\"\n\t\t\tactions={\n\t\t\t\thref ? (\n\t\t\t\t\t<CustomButton as=\"a\" href={href} target=\"_blank\" onClick={() => onEducationClick(tooltipId)}>\n\t\t\t\t\t\t{actionText}\n\t\t\t\t\t</CustomButton>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t\tvariant=\"education\"\n\t\t\t{...content}\n\t\t\timage={image}\n\t\t/>\n\t)\n}\n\nfunction ButtonEducationTooltip({\n\thref,\n\tactionText,\n\ttooltipId,\n\tcontent,\n\timage,\n}: {\n\thref: string\n\tactionText?: string\n\ttooltipId: EducationKey\n\tcontent: Omit<EducationInfo[EducationKey], \"type\">\n\timage?: string\n}) {\n\tconst buttonAnchorRef = useRef<HTMLButtonElement | null>(null)\n\tconst isAgentExperimentOn = useExperimentIsOn(\"agent\")\n\tconst tooltipOffset = useDimensionValue(\"tooltipOffset\")\n\tconst offset = useMemo(\n\t\t() => (isAgentExperimentOn ? { x: -tooltipOffset, y: tooltipOffset * 2 } : tooltipOffset),\n\t\t[isAgentExperimentOn, tooltipOffset],\n\t)\n\tconst { triggerProps, tooltipProps } = useTooltip({\n\t\tclassName: styles.buttonEducationTooltipContainer,\n\t\tdirection: \"top\",\n\t\tinteractive: true,\n\t\toffset,\n\t\ttriggerRef: buttonAnchorRef,\n\t\tdelay: \"short\",\n\t\tinitialVisibility: false,\n\t\ttint: colors.panelBackground,\n\t\talignSelf: \"right\",\n\t\tshowArrow: false,\n\t})\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tref={buttonAnchorRef}\n\t\t\t\tvariant=\"default\"\n\t\t\t\tenabled\n\t\t\t\tclassName={styles.educationButton}\n\t\t\t\taria-expanded={tooltipProps.visible}\n\t\t\t\tonClick={triggerProps.onPointerEnter}\n\t\t\t\t{...triggerProps}\n\t\t\t>\n\t\t\t\t{isAgentExperimentOn ? <IconAgentEducationInfo /> : <IconInfo />}\n\t\t\t\tDetail Page\n\t\t\t</Button>\n\t\t\t<PanelTooltipWithoutTrigger\n\t\t\t\ttitle={content.title}\n\t\t\t\ttext={content.text}\n\t\t\t\tvariant=\"layer\"\n\t\t\t\tactions={\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"default\"\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tonEducationClick(tooltipId)\n\t\t\t\t\t\t\topenNewTab(href)\n\t\t\t\t\t\t}}\n\t\t\t\t\t\taria-expanded={tooltipProps.visible}\n\t\t\t\t\t>\n\t\t\t\t\t\t{actionText}\n\t\t\t\t\t</Button>\n\t\t\t\t}\n\t\t\t\timage={image}\n\t\t\t\t{...tooltipProps}\n\t\t\t/>\n\t\t</>\n\t)\n}\n\nexport function EducationTooltip({ tooltipId }: EducationTooltipProps) {\n\tconst { isDarkMode } = useDarkMode()\n\n\tconst { actionText, href, type, ...content } = educationInfo(tooltipId)\n\n\tlet image: string | undefined\n\n\tif (isString(content.image)) {\n\t\timage = content.image\n\t} else if (content.image && \"dark\" in content.image && \"light\" in content.image) {\n\t\timage = isDarkMode ? content.image.dark : content.image.light\n\t}\n\n\tconst EducationComponent = type === \"icon\" ? IconEducationTooltip : ButtonEducationTooltip\n\n\treturn (\n\t\t<EducationComponent href={href} actionText={actionText} tooltipId={tooltipId} content={content} image={image} />\n\t)\n}\n", "import \"BreadcrumbBar.styles_1bhvkcz.wyw.css\"; import { cx } from \"@linaria/core\";\nconst textSizing = \"textSizing_tl8565r\";\nexport const barWrapper = \"barWrapper_bvc2uw9\";\nexport const bar = \"bar_b1k2nl76\";\nexport const barPaddingStyles = \"barPaddingStyles_b1i3g548\";\nexport const contentWrapper = \"contentWrapper_c77pepd\";\nexport const withCodeEditor = \"withCodeEditor_wnwbz2t\";\nexport const withCodeEditorPreview = \"withCodeEditorPreview_w16ew1wl\";\nexport const withCodeEditorAgent = \"withCodeEditorAgent_w16cr7hr\";\nexport const withCodeEditorPreviewAndAgent = \"withCodeEditorPreviewAndAgent_w1lo74ig\";\nexport const rulersVisible = \"rulersVisible_r1119pfk\";\nexport const breadcrumbWrapper = \"breadcrumbWrapper_b13iwexl\";\nexport const breadcrumb = \"breadcrumb_b1c7z6za\";\nexport const breadcrumbDisabled = \"breadcrumbDisabled_b1eca53j\";\nexport const preventShrinking = \"preventShrinking_p4sri9u\";\nexport const breadcrumbTitle = cx(textSizing, \"breadcrumbTitle_bs3azl6\");\nexport const codeFileEditedLabel = \"codeFileEditedLabel_c1qeto7i\";\nexport const breadcrumbSubLabelText = \"breadcrumbSubLabelText_b8y1dyl\";\nexport const breadcrumbSubLabelSeparator = \"breadcrumbSubLabelSeparator_bg2hdtb\";\nexport const menuInlineDraftBadge = \"menuInlineDraftBadge_m1ha7gxb\";\nexport const actions = \"actions_acukmgx\";\nexport const breadcrumbBarButton = cx(textSizing, breadcrumb, \"breadcrumbBarButton_b1sb4uyz\");\nexport const withTint = \"withTint_wcrz0ka\";\nexport const spinner = \"spinner_s1a5l89i\";\nexport const previewButton = \"previewButton_pb1yo5\";\nexport const previewIcon = \"previewIcon_pnvlffn\";\nexport const exitButton = \"exitButton_emy5mnq\";", "import \"EducationTooltip.styles_17528mh.wyw.css\"; import { cx } from \"@linaria/core\";\nimport { layerTooltip as panelLayerTooltip, tooltip as panelTooltipContainer } from \"document/components/chrome/PanelTooltip.styles.ts\";\nimport { breadcrumbBarButton } from \"document/components/chrome/shared/BreadcrumbBar.styles.ts\";\nexport const icon = \"icon_i7d4cn1\";\nexport const educationButton = cx(breadcrumbBarButton, \"educationButton_e1otabne\");\nexport const buttonEducationTooltipContainer = cx(panelTooltipContainer, panelLayerTooltip);", "import { useReadOnly } from \"@framerjs/fresco\"\nimport { Events } from \"@framerjs/fresco/layout-transitions\"\nimport { type EducationKey, EducationTooltip } from \"app/EducationTooltip.tsx\"\nimport { Dictionary } from \"app/dictionary.ts\"\nimport type { MenuItemOptions } from \"app/menu.ts\"\nimport { useBaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport type { TraitType } from \"document/models/CanvasTree/traits/TraitType.ts\"\nimport { isVekterEngine } from \"document/useVekterEngine.ts\"\nimport React, { createContext, useCallback, useContext, useImperativeHandle } from \"react\"\nimport { isFunction } from \"utils/typeChecks.ts\"\nimport { ReorderControl } from \"../codeComponentRows/ReorderControl.tsx\"\nimport { useIsOverridden } from \"../utils/VariantOverrideContext.tsx\"\nimport {\n\tcanResetReplicaOverrides,\n\tcheckOnlyReplicaAndReplicaChildren,\n\tonResetReplicaOverrides,\n} from \"../utils/resetOverrides.ts\"\nimport type { FetchDataValueOptions } from \"../utils/useDisplayFetchDataMenuOptions.ts\"\nimport { useGetFetchDataMenuOptions } from \"../utils/useDisplayFetchDataMenuOptions.ts\"\nimport type { VariableAssignmentOptions } from \"../utils/useDisplayVariableAssignmentOptions.ts\"\nimport { useGetVariableMenuItems } from \"../utils/useDisplayVariableAssignmentOptions.ts\"\nimport { PanelRowView, type PanelRowViewCommonProps } from \"./PanelRowView.tsx\"\n\nexport interface PanelRowResetReplicaOverridesOptions {\n\ttraitTypes?: readonly TraitType[]\n\ttraitTypeKeys?: readonly string[]\n}\n\n/**\n * Parents of <PanelRow/> can provide a ref which exposes an api to programmatically show the\n * variable assignment menu. This prevents duplicating useGetVariableMenuItems and its arguments,\n * and ensure we can keep arguments in sync.\n */\nexport interface PanelRowAPI {\n\tdisplayPrimaryMenu: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined\n}\n\ntype PanelRowProps = PanelRowViewCommonProps &\n\tVariableAssignmentOptions &\n\tFetchDataValueOptions &\n\tPanelRowResetReplicaOverridesOptions & {\n\t\tonAdd?: () => void\n\t\tonDelete?: () => void\n\t\tonCopy?: () => void\n\t\tonPaste?: () => void\n\t\tonResetToDefault?: () => void\n\t\tonSetAsDefault?: () => void\n\n\t\taddEnabled?: boolean\n\t\tdeleteEnabled?: boolean\n\t\t// the type on pasteEnabled here is different from the others. None of the other enabled callbacks are async. This is because we need to access the clipboard inside of the callback\n\t\tpasteEnabled?: boolean | (() => Promise<boolean>)\n\t\tcopyEnabled?: boolean | (() => boolean)\n\t\tresetToDefaultEnabled?: boolean\n\t\tsetAsDefaultVisible?: boolean\n\t\twithReorderControl?: boolean\n\n\t\tdeleteTitle?: string\n\t\tcopyTitle?: string\n\t\tpasteTitle?: () => Promise<string>\n\n\t\tpanelRowApiRef?: React.MutableRefObject<PanelRowAPI | null>\n\t\teducationTooltipId?: EducationKey\n\t}\n\n/**\n * A Panel Row with comprehensive logic, including context menus, variable\n * menus and fetch data menus. If you don't need to reuse any of this, you\n * should use {@link PanelRowView} directly.\n */\nexport function PanelRow({\n\tonContextMenu,\n\tchildren,\n\n\tonAdd,\n\tonDelete,\n\tonResetToDefault,\n\tonCopy,\n\tonPaste,\n\tonSetAsDefault,\n\tdeleteTitle,\n\tcopyTitle,\n\tpasteTitle,\n\taddEnabled = true,\n\tdeleteEnabled = true,\n\tpasteEnabled,\n\tcopyEnabled,\n\tresetToDefaultEnabled,\n\tsetAsDefaultVisible = false,\n\twithReorderControl = false,\n\n\ttraitTypes,\n\ttraitTypeKeys,\n\n\tvariableType,\n\tvariableCreationType,\n\tvariableReferenceType,\n\tvariableFilter = undefined,\n\tdynamicValue,\n\tonCreateVariable,\n\tonSelectVariable,\n\tonRemoveDynamicValue,\n\tsupportsVariables = false,\n\tcollectionReferenceDataIdentifier,\n\tvectorSetIdentifier,\n\tcontrolSourceIdentifier,\n\tcontrolKey,\n\tallowedFileTypes,\n\tsupportsComputedValues = false,\n\tonSelectComputedValue,\n\tdisplayTransformOptions,\n\tcomputedValuePopoutId,\n\n\tsupportsFetchDataValues,\n\tonSelectFetchDataValue,\n\teducationTooltipId,\n\tclassName,\n\tpanelRowApiRef,\n\t...rest\n}: PanelRowProps) {\n\tconst engine = useBaseEngine()\n\n\tconst readOnly = useReadOnly()\n\tconst isOverridden = useIsOverridden(traitTypeKeys, traitTypes)\n\tconst [primaryMenuIsOpen, setPrimaryMenuIsOpen] = React.useState(false)\n\tconst contextSupportsComputedValues = useComputedValuesSupported()\n\n\t// useGetVariableMenuItems returns undefined if variables are not available to\n\t// add / assign and therefore we should not display any variable menu items.\n\tconst getVariableMenuItems = useGetVariableMenuItems({\n\t\tvariableType,\n\t\tvariableCreationType,\n\t\tvariableReferenceType,\n\t\tdynamicValue,\n\t\tonCreateVariable,\n\t\tonSelectVariable,\n\t\tonRemoveDynamicValue,\n\t\tsupportsVariables,\n\t\tcollectionReferenceDataIdentifier,\n\t\tvectorSetIdentifier,\n\t\tcontrolSourceIdentifier,\n\t\tcontrolKey,\n\t\tallowedFileTypes,\n\t\tsupportsComputedValues: contextSupportsComputedValues && supportsComputedValues,\n\t\tonSelectComputedValue,\n\t\tdisplayTransformOptions,\n\t\tcomputedValuePopoutId,\n\t\tvariableFilter,\n\t})\n\n\tconst getFetchMenuOptions = useGetFetchDataMenuOptions({\n\t\tsupportsFetchDataValues: supportsFetchDataValues ?? false,\n\t\tonSelectFetchDataValue,\n\t})\n\n\tconst showVariablePlusIcon = Boolean(getVariableMenuItems) || Boolean(getFetchMenuOptions)\n\tconst canAdd = Boolean(onAdd && addEnabled && !readOnly)\n\tconst canDelete = Boolean(onDelete && deleteEnabled && !readOnly)\n\tconst resetToDefaultVisible = Boolean(onResetToDefault)\n\n\tconst displayContextMenu = useCallback(\n\t\tasync (event: React.MouseEvent) => {\n\t\t\tconst { clientX: x, clientY: y } = event\n\n\t\t\tconst shouldDisplayOptions = Boolean(\n\t\t\t\tcanAdd || canDelete || onCopy || onPaste || resetToDefaultVisible || (onSetAsDefault && setAsDefaultVisible),\n\t\t\t)\n\n\t\t\tif (!shouldDisplayOptions) return\n\n\t\t\tevent.preventDefault()\n\t\t\tengine.stores.contextMenuStore.show(\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: copyTitle || Dictionary.Copy,\n\t\t\t\t\t\tclick: onCopy,\n\t\t\t\t\t\tvisible: !!onCopy,\n\t\t\t\t\t\tenabled: isFunction(copyEnabled) ? copyEnabled() : copyEnabled,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: pasteTitle ? await pasteTitle() : Dictionary.Paste,\n\t\t\t\t\t\tclick: onPaste,\n\t\t\t\t\t\tvisible: !!onPaste,\n\t\t\t\t\t\tenabled: !readOnly && (isFunction(pasteEnabled) ? await pasteEnabled() : pasteEnabled),\n\t\t\t\t\t},\n\t\t\t\t\t{ type: \"separator\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: Dictionary.Add,\n\t\t\t\t\t\tclick: onAdd,\n\t\t\t\t\t\tvisible: canAdd,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: deleteTitle || Dictionary.Remove,\n\t\t\t\t\t\tclick: onDelete,\n\t\t\t\t\t\tvisible: canDelete,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"Reset to Default\",\n\t\t\t\t\t\tclick: onResetToDefault,\n\t\t\t\t\t\tenabled: !readOnly && resetToDefaultEnabled,\n\t\t\t\t\t\tvisible: !!onResetToDefault,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"Set as Default\",\n\t\t\t\t\t\tclick: onSetAsDefault,\n\t\t\t\t\t\tenabled: !readOnly && !!onSetAsDefault,\n\t\t\t\t\t\tvisible: !!onSetAsDefault && setAsDefaultVisible,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\t{ location: { x, y } },\n\t\t\t)\n\t\t},\n\t\t[\n\t\t\tcanAdd,\n\t\t\tcanDelete,\n\t\t\tonCopy,\n\t\t\tonPaste,\n\t\t\tresetToDefaultVisible,\n\t\t\tonSetAsDefault,\n\t\t\tsetAsDefaultVisible,\n\t\t\tcopyTitle,\n\t\t\tcopyEnabled,\n\t\t\tpasteTitle,\n\t\t\treadOnly,\n\t\t\tpasteEnabled,\n\t\t\tonAdd,\n\t\t\tdeleteTitle,\n\t\t\tonDelete,\n\t\t\tonResetToDefault,\n\t\t\tresetToDefaultEnabled,\n\t\t],\n\t)\n\n\tconst displayPrimaryMenu = useCallback(\n\t\tasync (event: React.MouseEvent<HTMLDivElement>, triggeredProgrammatically: boolean = false) => {\n\t\t\tconst { target, currentTarget } = event\n\n\t\t\tconst onlyReplicaAndReplicaChildren = isVekterEngine(engine) && checkOnlyReplicaAndReplicaChildren(engine)\n\t\t\tconst resetOverrideVisible = onlyReplicaAndReplicaChildren && Boolean(traitTypes || traitTypeKeys)\n\t\t\tif (!triggeredProgrammatically) {\n\t\t\t\t// If the button is right mouse button, then early return\n\t\t\t\t// as we want the event to be handled by displayContextMenu above.\n\t\t\t\tif (!Events.isLeftMouseClick(event)) return\n\t\t\t\tif (target !== currentTarget) return\n\t\t\t}\n\t\t\tconst variableMenuOptions = getVariableMenuItems?.()\n\n\t\t\tif (!getVariableMenuItems && !isOverridden && !getFetchMenuOptions) return\n\n\t\t\tconst allOptions: MenuItemOptions[] = []\n\n\t\t\tif (variableMenuOptions) {\n\t\t\t\tallOptions.push(...variableMenuOptions)\n\t\t\t}\n\n\t\t\tconst fetchMenuOptions = getFetchMenuOptions?.()\n\n\t\t\tif (fetchMenuOptions) {\n\t\t\t\tif (variableMenuOptions) {\n\t\t\t\t\tallOptions.push({\n\t\t\t\t\t\ttype: \"separator\",\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\tallOptions.push(...fetchMenuOptions)\n\t\t\t}\n\n\t\t\tallOptions.push(\n\t\t\t\t{ type: \"separator\" },\n\t\t\t\t{\n\t\t\t\t\tlabel: \"Reset Override\",\n\t\t\t\t\tclick() {\n\t\t\t\t\t\tif (isVekterEngine(engine)) {\n\t\t\t\t\t\t\tonResetReplicaOverrides(engine, traitTypes, traitTypeKeys)\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tenabled:\n\t\t\t\t\t\t!readOnly && onlyReplicaAndReplicaChildren && canResetReplicaOverrides(engine, traitTypes, traitTypeKeys),\n\t\t\t\t\tvisible: isVekterEngine(engine) && resetOverrideVisible,\n\t\t\t\t},\n\t\t\t)\n\n\t\t\tconst bounds = event.currentTarget.getBoundingClientRect()\n\t\t\tconst location = { x: bounds.left, y: bounds.bottom }\n\n\t\t\tsetPrimaryMenuIsOpen(true)\n\t\t\tengine.stores.contextMenuStore.show(allOptions, {\n\t\t\t\tlocation,\n\t\t\t\tonDone: () => setPrimaryMenuIsOpen(false),\n\t\t\t\tsubmenuPlacement: \"left-start\",\n\t\t\t})\n\t\t},\n\t\t[traitTypes, traitTypeKeys, getVariableMenuItems, isOverridden, getFetchMenuOptions, readOnly],\n\t)\n\n\t// Expose access to the `displayVariableAssignmentOptions` function to\n\t// parents of this component to allow programmatically showing the menu\n\t// without duplicating useDisplayVariableAssignmentOptions and all of its\n\t// arguments.\n\tuseImperativeHandle(\n\t\tpanelRowApiRef,\n\t\t() => ({\n\t\t\tdisplayPrimaryMenu: (event: React.MouseEvent<HTMLDivElement>) => displayPrimaryMenu(event, true),\n\t\t}),\n\t\t[displayPrimaryMenu],\n\t)\n\n\treturn (\n\t\t<PanelRowView\n\t\t\twithButtonCursor={isOverridden || showVariablePlusIcon}\n\t\t\tdisplayPlusIcon={showVariablePlusIcon}\n\t\t\tonMouseDown={displayPrimaryMenu}\n\t\t\tisOverridden={isOverridden}\n\t\t\tprimaryMenuIsOpen={primaryMenuIsOpen}\n\t\t\tonContextMenu={onContextMenu ?? displayContextMenu}\n\t\t\tReorderControl={withReorderControl ? ReorderControl : undefined}\n\t\t\teducationTooltip={educationTooltipId ? <EducationTooltip tooltipId={educationTooltipId} /> : undefined}\n\t\t\tclassName={className}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{children}\n\t\t</PanelRowView>\n\t)\n}\n\nconst ComputedValuesSupportedContext = createContext(false)\nComputedValuesSupportedContext.displayName = \"ComputedValuesSupportedContext\"\n\nexport const ComputedValuesSupportedProvider = ComputedValuesSupportedContext.Provider\n\nfunction useComputedValuesSupported() {\n\treturn useContext(ComputedValuesSupportedContext)\n}\n", "import \"ReorderControl.styles_ybl2js.wyw.css\"; export const iconWrapper = \"iconWrapper_ib75oye\";\nexport const disabled = \"disabled_dnxepni\";", "import { IconDragHandle, useReadOnly } from \"@framerjs/fresco\"\nimport { cx } from \"@linaria/core\"\nimport * as styles from \"./ReorderControl.styles.ts\"\n\nexport function ReorderControl() {\n\tconst isReadOnly = useReadOnly()\n\treturn (\n\t\t<div title=\"Drag to reorder or remove\" className={cx(styles.iconWrapper, isReadOnly && styles.disabled)}>\n\t\t\t<IconDragHandle />\n\t\t</div>\n\t)\n}\n", "import type { VekterEngine } from \"document/VekterEngine.ts\"\nimport { TemplateHelper } from \"document/models/CanvasTree/nodes/TemplateHelper.ts\"\nimport type { TraitType } from \"document/models/CanvasTree/traits/TraitType.ts\"\nimport { isReplicaOrReplicaChild } from \"document/models/CanvasTree/traits/WithTemplate.ts\"\nimport { hasReplicaOverrides } from \"document/models/CanvasTree/traits/utils/hasReplicaOverrides.ts\"\nimport { resetNodeOverrides } from \"./resetNodeOverrides.ts\"\n\nexport function checkOnlyReplicaAndReplicaChildren(engine: VekterEngine): boolean {\n\tconst selection = engine.tree.getNodes(engine.stores.selectionStore.ids)\n\treturn selection.every(isReplicaOrReplicaChild)\n}\n\nexport function canResetReplicaOverrides(\n\tengine: VekterEngine,\n\ttraitTypes: readonly TraitType[] | undefined,\n\tkeys: readonly string[] | undefined = undefined,\n) {\n\tif (!traitTypes && !keys) return false\n\tconst selection = engine.tree.getNodes(engine.stores.selectionStore.ids)\n\tconst overrideKeys = TemplateHelper.overrideKeys(engine.tree, selection, true)\n\treturn hasReplicaOverrides(overrideKeys, traitTypes, keys)\n}\n\nexport function onResetReplicaOverrides(\n\tengine: VekterEngine,\n\ttraitTypes: readonly TraitType[] | undefined,\n\tkeys: readonly string[] | undefined = undefined,\n) {\n\tresetNodeOverrides(engine.tree, engine.tree.getNodes(engine.stores.selectionStore.ids), traitTypes, keys)\n}\n", "import { useReadOnly } from \"@framerjs/fresco\"\nimport { assert } from \"@framerjs/shared\"\nimport type { MenuItemOptions } from \"app/menu.ts\"\nimport { useBaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport type { ComputedValueFromFetchDataValue } from \"document/models/CanvasTree/traits/ComputedValue.ts\"\nimport type { AllOrNothing } from \"document/models/CanvasTree/traits/utils/AllOrNothing.ts\"\nimport type { OptionalToUndefined } from \"document/models/CanvasTree/traits/utils/OptionalToUndefined.ts\"\nimport { isVekterEngine } from \"document/useVekterEngine.ts\"\nimport { useCallback } from \"react\"\nimport { record } from \"web/lib/tracker.ts\"\nimport { isStatusGestureVariantDescendant } from \"./gestureStatusVariant.ts\"\n\ninterface WithFetchDataValueOptions {\n\tsupportsFetchDataValues: boolean\n\tonSelectFetchDataValue: (() => ComputedValueFromFetchDataValue) | undefined\n}\n\nexport type FetchDataValueOptions = AllOrNothing<WithFetchDataValueOptions>\n\nexport function useGetFetchDataMenuOptions(\n\toptions: OptionalToUndefined<Partial<FetchDataValueOptions>>,\n): (() => MenuItemOptions[] | undefined) | undefined {\n\tconst engine = useBaseEngine()\n\n\tconst { supportsFetchDataValues, onSelectFetchDataValue } = options\n\tconst isReadOnly = useReadOnly()\n\n\tconst getMenuOptions = useCallback((): MenuItemOptions[] | undefined => {\n\t\tif (!supportsFetchDataValues) return\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tlabel: \"Add Fetch\",\n\t\t\t\tclick: () => {\n\t\t\t\t\tassert(onSelectFetchDataValue)\n\n\t\t\t\t\tconst computedValue = onSelectFetchDataValue()\n\t\t\t\t\trecord(\"fetch_computed_value_create\", {\n\t\t\t\t\t\toutputType: computedValue.outputType,\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tenabled:\n\t\t\t\t\t!isReadOnly &&\n\t\t\t\t\t!(isVekterEngine(engine) && isStatusGestureVariantDescendant(engine.tree, engine.stores.selectionStore.ids)),\n\t\t\t\tsubmenu: undefined,\n\t\t\t},\n\t\t]\n\t}, [onSelectFetchDataValue, isReadOnly, supportsFetchDataValues])\n\n\tif (!supportsFetchDataValues || !onSelectFetchDataValue) return undefined\n\n\treturn getMenuOptions\n}\n", "import { triggerVariableReferenceCreateEvent, triggerVariableReferenceDeleteEvent } from \"@framerjs/framer-events\"\nimport type { ComponentLoader } from \"@framerjs/framer-runtime\"\nimport { useReadOnly } from \"@framerjs/fresco\"\nimport type { GlobalModuleId, ModuleExportIdentifierString } from \"@framerjs/shared\"\nimport { assert, parseModuleIdentifier } from \"@framerjs/shared\"\nimport { Dictionary } from \"app/dictionary.ts\"\nimport type { MenuItemOptions } from \"app/menu.ts\"\nimport { type BaseEngine, useBaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport type { CanvasNode, MaybeNodeID, NodeID } from \"document/models/CanvasTree/index.ts\"\nimport { isWebPageNode } from \"document/models/CanvasTree/nodes/utils/nodeCheck.ts\"\nimport type { ComputedValue, ComputedValueOutputType } from \"document/models/CanvasTree/traits/ComputedValue.ts\"\nimport {\n\tcreateComputedValue,\n\tisComputedValue,\n\tisComputedValueFromFetchData,\n\tisComputedValueFromVariableReference,\n\tisComputedValueOutputType,\n} from \"document/models/CanvasTree/traits/ComputedValue.ts\"\nimport type { DynamicValue } from \"document/models/CanvasTree/traits/DynamicValue.ts\"\nimport type {\n\tValueTransform,\n\tValueTransformName,\n\tValueTransformType,\n} from \"document/models/CanvasTree/traits/ValueTransform.ts\"\nimport {\n\tgetEnabledValueTransformNames,\n\tgetInputTypesForValueTransformName,\n\tgetOutputTypeForValueTransform,\n\tgetOutputTypesForValueTransformName,\n\tgetValueTransformNamesForInputType,\n\tgetValueTransformNamesForOutputType,\n\tgetValueTransformTitle,\n\tinputTypeCanBeTransformed,\n\tvalueTransformConsumesNegated,\n\tvalueTransformsNotWantingNegatedInputVariable,\n} from \"document/models/CanvasTree/traits/ValueTransform.ts\"\nimport type { VariableProviderVariableMap } from \"document/models/CanvasTree/traits/VariableProvider.ts\"\nimport type { VariableReference } from \"document/models/CanvasTree/traits/VariableReference.ts\"\nimport { createVariableReference, isVariableReference } from \"document/models/CanvasTree/traits/VariableReference.ts\"\nimport type {\n\tEnumVariableDefinition,\n\tVariableDefinition,\n\tVariableID,\n\tVariableType,\n\tWithVariables,\n} from \"document/models/CanvasTree/traits/WithVariables.ts\"\nimport {\n\tisControlReferenceExpectedType,\n\tvariableTypeTitle,\n\twithVariables,\n} from \"document/models/CanvasTree/traits/WithVariables.ts\"\nimport type { AllOrNothing } from \"document/models/CanvasTree/traits/utils/AllOrNothing.ts\"\nimport type { OptionalToUndefined } from \"document/models/CanvasTree/traits/utils/OptionalToUndefined.ts\"\nimport { isVariableType } from \"document/models/CanvasTree/traits/utils/isVariableType.ts\"\nimport {\n\tcreateNegateTransform,\n\tcreateValueTransformWithName,\n} from \"document/models/CanvasTree/traits/utils/valueTransformUtils.ts\"\nimport {\n\tgetNodePropertyControlDescription,\n\tisNodePropertyControlKey,\n\tnodePropertyDefinitionEntityIdentifier,\n} from \"document/models/CanvasTree/utils/nodePropertyControlDefinitions.ts\"\nimport {\n\tisCollectionNavigationVariableId,\n\tnextItemVariableId,\n\tpreviousItemVariableId,\n} from \"document/utils/CollectionItemVariables.ts\"\nimport type { ProviderID, VariableProviderInfo } from \"document/utils/VariableProviderInfo.ts\"\nimport type { AllowedFileTypes, ControlDescription } from \"library/render/types/PropertyControls.ts\"\nimport { ControlType } from \"library/render/types/PropertyControls.ts\"\nimport { useCallback } from \"react\"\nimport {\n\tisIdVariableId,\n\tisNestedReferenceToVariableId,\n\tisNestedVariableSelected,\n\tsplitVariableId,\n} from \"utils/collectionReferenceUtils.ts\"\nimport { getNegatedLabel } from \"utils/getNegatedLabel.ts\"\nimport { isArray, isReadonlyArray, isString, isUndefined } from \"utils/typeChecks.ts\"\nimport { isSlugVariable } from \"utils/variableMetadata.ts\"\nimport { record } from \"web/lib/tracker.ts\"\nimport { getIsViewOnly } from \"web/pages/project/permissions/isViewOnly.ts\"\nimport { popoutWindow } from \"../../shared/PopoutWindow.tsx\"\nimport type { ValueTransformOption } from \"../../shared/dynamicValueChainSections.ts\"\nimport {\n\tcanReachOutputTypeWithTransforms,\n\tgetTransformChainSections,\n\tisTransformSection,\n\tmaxTransformCountToReachOutputType,\n\tsortValueTransformOptionsInPlace,\n} from \"../../shared/dynamicValueChainSections.ts\"\nimport { applyTransformValuesToReplacement } from \"../../shared/utils/applyTransformValuesToReplacement.ts\"\nimport { getVariableFromInfo, useVariableProviderInfo } from \"../useVariableProviderInfo.ts\"\nimport { isCompatibleFileControl } from \"./allowedFileTypes.ts\"\nimport { getNameForVariableProvider } from \"./getNameForVariableProvider.ts\"\nimport {\n\tselectedVariableIsNegated,\n\tselectedVariableIsNegatedWithoutOtherTransforms,\n} from \"./selectedVariableIsNegated.ts\"\n\nfunction canCreateVariableType(\n\tprovider: CanvasNode & WithVariables,\n\tvariableType: VariableType,\n\tvariableReferenceType: ControlType | readonly ControlType[] | undefined,\n\tentityIdentifier: string | undefined,\n): boolean {\n\tif (variableType !== \"controlReference\") {\n\t\treturn provider.canCreateVariable({ type: variableType })\n\t}\n\n\tif (!variableReferenceType || !entityIdentifier) return false\n\n\tconst referenceTypes: readonly ControlType[] = isReadonlyArray(variableReferenceType)\n\t\t? variableReferenceType\n\t\t: [variableReferenceType]\n\n\treturn referenceTypes.some(\n\t\texpectedType =>\n\t\t\tisControlReferenceExpectedType(expectedType) &&\n\t\t\tprovider.canCreateVariable({ type: \"controlReference\", expectedType, entityIdentifier }),\n\t)\n}\n\nfunction getCreationVariableTypes(\n\tvariableProviderNode: CanvasNode & WithVariables,\n\tvariableType: VariableType | readonly VariableType[],\n\tvariableReferenceType: ControlType | readonly ControlType[] | undefined,\n\tentityIdentifier: string | undefined,\n\tvariableCreationType?: VariableType,\n): readonly VariableType[] {\n\tif (\n\t\tvariableCreationType &&\n\t\tcanCreateVariableType(variableProviderNode, variableCreationType, variableReferenceType, entityIdentifier)\n\t) {\n\t\treturn [variableCreationType]\n\t}\n\n\tif (!isReadonlyArray(variableType)) {\n\t\tif (canCreateVariableType(variableProviderNode, variableType, variableReferenceType, entityIdentifier)) {\n\t\t\treturn [variableType]\n\t\t}\n\t\treturn []\n\t}\n\n\treturn variableType.filter(\n\t\ttype =>\n\t\t\tcanCreateVariableType(variableProviderNode, type, variableReferenceType, entityIdentifier) &&\n\t\t\ttype !== ControlType.Enum,\n\t)\n}\n\ntype VariableFilter = (variable: VariableDefinition, providerId: ProviderID) => boolean\n\ninterface WithComputedValueAssignment {\n\tcomputedValuePopoutId: string\n\tsupportsComputedValues: boolean\n\tonSelectComputedValue: (computedValue: ComputedValue) => void\n}\n\ntype WithVariableAssignment = AllOrNothing<WithComputedValueAssignment> & {\n\tsupportsVariables: boolean\n\tvariableType: VariableType | readonly VariableType[]\n\t/** In case you want to support multiple variable types but only create a specific one. */\n\tvariableCreationType?: VariableType\n\tvariableReferenceType?: ControlType | readonly ControlType[]\n\tdynamicValue: DynamicValue | null\n\n\tonCreateVariable: ((scopeId: NodeID, type: VariableType) => void) | undefined\n\tonSelectVariable: (variableRef: VariableReference, type: VariableType) => void\n\tonRemoveDynamicValue: (dynamicValue: DynamicValue) => void\n\n\t// For collection references we need to make sure the dataIdentifier\n\t// matches.\n\tcollectionReferenceDataIdentifier?: ModuleExportIdentifierString\n\n\t/**\n\t * ControlType.VectorSetItem variables can only be assigned to instance of the same Set.\n\t */\n\tvectorSetIdentifier?: GlobalModuleId\n\n\t// For variable references we need to make sure the enum is compatible,\n\t// for this we compare the code component identifier and prop\n\tcontrolSourceIdentifier?: string\n\tcontrolKey?: string\n\n\tallowedFileTypes?: AllowedFileTypes\n\n\t/** Override to hide transform options for variables that require a transform when assigned. */\n\tdisplayTransformOptions?: boolean\n\n\t/** Allow to filter variables */\n\tvariableFilter?: VariableFilter\n}\n\ntype GetVariableMenu = Omit<\n\tOptionalToUndefined<WithVariableAssignment>,\n\t\"dynamicValue\" | \"onSelectVariable\" | \"onRemoveDynamicValue\" | \"supportsVariables\"\n> & {\n\tengine: BaseEngine\n\tcanCreateVariable: boolean\n\tvariableInfo: VariableProviderInfo\n\tdisplayTransformOptions: boolean\n\tisReadOnly: boolean\n\tdynamicValue: DynamicValue | null | undefined\n\tonSelectVariable: WithVariableAssignment[\"onSelectVariable\"] | undefined\n\tonRemoveDynamicValue: WithVariableAssignment[\"onRemoveDynamicValue\"] | undefined\n}\n\nexport function getVariableMenu({\n\tengine,\n\tdynamicValue,\n\tcanCreateVariable,\n\tvariableType,\n\tvariableCreationType,\n\tvariableInfo,\n\tonCreateVariable,\n\tvariableReferenceType,\n\tsupportsComputedValues,\n\tcollectionReferenceDataIdentifier,\n\tcontrolSourceIdentifier,\n\tvectorSetIdentifier,\n\tisReadOnly: isContextReadOnly,\n\tcontrolKey,\n\tallowedFileTypes,\n\tdisplayTransformOptions,\n\tonSelectVariable,\n\tonSelectComputedValue,\n\tonRemoveDynamicValue,\n\tcomputedValuePopoutId,\n\tvariableFilter,\n}: GetVariableMenu) {\n\tconst menuOptions: MenuItemOptions[] = []\n\tconst isReadOnly = isContextReadOnly || getIsViewOnly(engine, \"canDesign\")\n\n\tif (canCreateVariable) {\n\t\tassert(variableInfo, \"variableInfo should be defined\")\n\n\t\tconst variableProviderNode = engine.tree.getNodeWithTrait(variableInfo.idOfMutableVariableProvider, withVariables)\n\t\tassert(variableProviderNode, \"variableProviderNode should exist when creating variables\")\n\n\t\tconst creationVariableTypes = getCreationVariableTypes(\n\t\t\tvariableProviderNode,\n\t\t\tvariableType,\n\t\t\tvariableReferenceType,\n\t\t\tcontrolSourceIdentifier,\n\t\t\tvariableCreationType,\n\t\t)\n\n\t\tif (creationVariableTypes.length === 1) {\n\t\t\tconst onlyVariableType = creationVariableTypes[0]\n\t\t\tassert(isVariableType(onlyVariableType), \"onlyVariableType should be defined\")\n\n\t\t\tmenuOptions.push({\n\t\t\t\tlabel: \"Create Variable\",\n\t\t\t\tenabled: !isReadOnly,\n\t\t\t\tclick: () => {\n\t\t\t\t\tassert(\n\t\t\t\t\t\tvariableInfo.idOfMutableVariableProvider,\n\t\t\t\t\t\t\"idOfMutableVariableProvider should exist when creating variables\",\n\t\t\t\t\t)\n\t\t\t\t\tassert(onCreateVariable, \"onCreateVariable should be defined\")\n\t\t\t\t\tonCreateVariable(variableProviderNode.id, onlyVariableType)\n\t\t\t\t},\n\t\t\t})\n\t\t} else if (creationVariableTypes.length > 1) {\n\t\t\tmenuOptions.push({\n\t\t\t\tlabel: \"Create Variable\",\n\t\t\t\tsubmenu: creationVariableTypes.map(type => ({\n\t\t\t\t\tlabel: variableTypeTitle(type),\n\t\t\t\t\tenabled: !isReadOnly,\n\t\t\t\t\tclick: () => {\n\t\t\t\t\t\tassert(\n\t\t\t\t\t\t\tvariableInfo.idOfMutableVariableProvider,\n\t\t\t\t\t\t\t\"idOfMutableVariableProvider should exist when creating variables\",\n\t\t\t\t\t\t)\n\t\t\t\t\t\tassert(onCreateVariable, \"onCreateVariable should be defined\")\n\t\t\t\t\t\tonCreateVariable(variableProviderNode.id, type)\n\t\t\t\t\t},\n\t\t\t\t})),\n\t\t\t})\n\t\t}\n\t}\n\n\tconst compatibleVariablesByProvider = getCompatibleVariablesByProvider(\n\t\tengine,\n\t\tvariableInfo,\n\t\tvariableType,\n\t\tvariableReferenceType,\n\t\tsupportsComputedValues,\n\t\tcollectionReferenceDataIdentifier,\n\t\tvectorSetIdentifier,\n\t\tcontrolSourceIdentifier,\n\t\tcontrolKey,\n\t\tallowedFileTypes,\n\t\tdisplayTransformOptions,\n\t\tvariableFilter,\n\t)\n\n\tconst assignmentOptions = getVariableAssignmentOptions({\n\t\tengine,\n\t\tvariableInfo,\n\t\tcompatibleVariablesByProvider,\n\t\tvariableType,\n\t\tdynamicValue,\n\t\tvariableReferenceType,\n\t\tcollectionReferenceDataIdentifier,\n\t\tvectorSetIdentifier,\n\t\tcontrolSourceIdentifier,\n\t\tcontrolKey,\n\t\tallowedFileTypes,\n\t\tsupportsComputedValues,\n\t\tonSelectVariable,\n\t\tonSelectComputedValue,\n\t\tonRemoveDynamicValue,\n\t\treadonly: isReadOnly,\n\t\tvariableFilter,\n\t})\n\n\tif (assignmentOptions.length > 0) {\n\t\tmenuOptions.push({ label: \"Set Variable\", submenu: assignmentOptions })\n\t}\n\n\tconst addTransformMenu = getAddTransformMenu({\n\t\tengine,\n\t\tvariableInfo,\n\t\tdynamicValue,\n\t\tvariableType,\n\t\tsupportsComputedValues,\n\t\tonSelectComputedValue,\n\t\tcomputedValuePopoutId,\n\t\tdisplayTransformOptions,\n\t\tcontrolSourceIdentifier,\n\t\tcontrolKey,\n\t\treadonly: isReadOnly,\n\t})\n\n\tif (addTransformMenu) {\n\t\tmenuOptions.push(addTransformMenu)\n\t}\n\n\treturn menuOptions\n}\n\nexport type VariableAssignmentOptions = AllOrNothing<WithVariableAssignment>\n\nexport function useGetVariableMenuItems(\n\toptions: OptionalToUndefined<Partial<VariableAssignmentOptions>>,\n): (() => MenuItemOptions[] | undefined) | undefined {\n\tconst engine = useBaseEngine()\n\n\tconst {\n\t\tvariableType,\n\t\tvariableCreationType,\n\t\tvariableReferenceType,\n\t\tdynamicValue,\n\t\tonCreateVariable,\n\t\tonSelectVariable,\n\t\tonRemoveDynamicValue,\n\t\tcollectionReferenceDataIdentifier,\n\t\tcontrolSourceIdentifier,\n\t\tvectorSetIdentifier,\n\t\tcontrolKey,\n\t\tallowedFileTypes,\n\t\tsupportsComputedValues,\n\t\tonSelectComputedValue,\n\t\tdisplayTransformOptions = true,\n\t\tcomputedValuePopoutId,\n\t\tvariableFilter,\n\t} = options\n\n\tconst variableInfo = useVariableProviderInfo()\n\n\tconst { canCreateVariable, canAssignVariable } = getVariableAssignmentTypes(engine, variableInfo, options)\n\n\tconst isReadOnly = useReadOnly()\n\n\tconst getVariableMenuItems = useCallback(() => {\n\t\tif (!variableInfo) return\n\t\tif (!variableType) return\n\n\t\treturn getVariableMenu({\n\t\t\tengine,\n\t\t\tvariableInfo,\n\t\t\tvariableType,\n\t\t\tvariableCreationType,\n\t\t\tvariableReferenceType,\n\t\t\tsupportsComputedValues,\n\t\t\tcollectionReferenceDataIdentifier,\n\t\t\tcontrolSourceIdentifier,\n\t\t\tvectorSetIdentifier,\n\t\t\tcontrolKey,\n\t\t\tallowedFileTypes,\n\t\t\tdisplayTransformOptions,\n\t\t\tdynamicValue,\n\t\t\tonSelectComputedValue,\n\t\t\tonSelectVariable,\n\t\t\tisReadOnly,\n\t\t\tonRemoveDynamicValue,\n\t\t\tonCreateVariable,\n\t\t\tcanCreateVariable,\n\t\t\tcomputedValuePopoutId,\n\t\t\tvariableFilter,\n\t\t})\n\t}, [\n\t\tallowedFileTypes,\n\t\tcanCreateVariable,\n\t\tcollectionReferenceDataIdentifier,\n\t\tcomputedValuePopoutId,\n\t\tcontrolKey,\n\t\tcontrolSourceIdentifier,\n\t\tdisplayTransformOptions,\n\t\tdynamicValue,\n\t\tisReadOnly,\n\t\tonCreateVariable,\n\t\tonRemoveDynamicValue,\n\t\tonSelectComputedValue,\n\t\tonSelectVariable,\n\t\tsupportsComputedValues,\n\t\tvariableCreationType,\n\t\tvariableInfo,\n\t\tvariableReferenceType,\n\t\tvariableType,\n\t\tvectorSetIdentifier,\n\t\tvariableFilter,\n\t])\n\n\treturn canAssignVariable ? getVariableMenuItems : undefined\n}\n\nexport function getVariableAssignmentTypes(\n\tengine: BaseEngine,\n\tvariableInfo: VariableProviderInfo | null,\n\toptions: Partial<VariableAssignmentOptions>,\n): {\n\tcanCreateVariable: boolean\n\tcanAssignVariable: boolean\n} {\n\tconst supportsVariables = Boolean(options.supportsVariables)\n\n\tconst variablesAvailable =\n\t\tsupportsVariables &&\n\t\thasVariablesAvailable(\n\t\t\tvariableInfo,\n\t\t\toptions.variableType,\n\t\t\toptions.variableReferenceType,\n\t\t\toptions.supportsComputedValues,\n\t\t\toptions.collectionReferenceDataIdentifier,\n\t\t\toptions.vectorSetIdentifier,\n\t\t\toptions.controlSourceIdentifier,\n\t\t\toptions.controlKey,\n\t\t\toptions.allowedFileTypes,\n\t\t\toptions.variableFilter,\n\t\t)\n\n\tconst mutableVariableProvider = engine.tree.getNodeWithTrait(variableInfo?.idOfMutableVariableProvider, withVariables)\n\n\tconst canMutateVariables = variableProviderSupportsVariableCreationType(mutableVariableProvider, options)\n\tconst canCreateVariable = canMutateVariables && Boolean(options.onCreateVariable)\n\tconst canChooseVariable = variablesAvailable && Boolean(options.onSelectVariable)\n\tconst canAssignVariable = canCreateVariable || canChooseVariable\n\n\treturn { canCreateVariable, canAssignVariable }\n}\n\nfunction variableProviderSupportsVariableCreationType(\n\tmutableVariableProvider: (CanvasNode & WithVariables) | null,\n\toptions: Partial<VariableAssignmentOptions>,\n) {\n\tif (!mutableVariableProvider) return false\n\tif (!options.supportsVariables) return false\n\tif (!options.variableType) return false\n\n\tif (options.variableCreationType) {\n\t\treturn canCreateVariableType(\n\t\t\tmutableVariableProvider,\n\t\t\toptions.variableCreationType,\n\t\t\toptions.variableReferenceType,\n\t\t\toptions.controlSourceIdentifier,\n\t\t)\n\t}\n\n\tif (!isReadonlyArray(options.variableType)) {\n\t\treturn canCreateVariableType(\n\t\t\tmutableVariableProvider,\n\t\t\toptions.variableType,\n\t\t\toptions.variableReferenceType,\n\t\t\toptions.controlSourceIdentifier,\n\t\t)\n\t}\n\n\tfor (const variableType of options.variableType) {\n\t\tif (\n\t\t\tcanCreateVariableType(\n\t\t\t\tmutableVariableProvider,\n\t\t\t\tvariableType,\n\t\t\t\toptions.variableReferenceType,\n\t\t\t\toptions.controlSourceIdentifier,\n\t\t\t)\n\t\t) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunction getVariableReferenceFromDynamicValue(value: unknown): VariableReference | null {\n\tif (isVariableReference(value)) return value\n\tif (isComputedValueFromVariableReference(value)) return value.startValue\n\treturn null\n}\n\nfunction isCompatibleControlReference(\n\tvariable: VariableDefinition,\n\tvariableReferenceType: ControlType | readonly ControlType[] | undefined,\n\tcodeComponentIdentifier: string | undefined,\n\tcodeComponentProp: string | undefined,\n): boolean {\n\tif (variable.type !== \"controlReference\" && variable.type !== \"nodePropertyControlReference\") return false\n\tconst { entityIdentifier, controlKey, expectedType } = variable\n\tif (entityIdentifier === nodePropertyDefinitionEntityIdentifier) {\n\t\treturn controlKey === codeComponentProp\n\t}\n\tif (!codeComponentIdentifier) return false\n\tif (!identifiersEqual(entityIdentifier, codeComponentIdentifier)) return false\n\tif (controlKey !== codeComponentProp) return false\n\treturn isArray(variableReferenceType)\n\t\t? variableReferenceType.includes(expectedType)\n\t\t: variableReferenceType === expectedType\n}\n\nfunction isCompatibleVectorSetItemControl(\n\tvariable: VariableDefinition,\n\tvectorSetIdentifier: GlobalModuleId | undefined,\n) {\n\tif (variable.type !== ControlType.VectorSetItem) return false\n\tif (!vectorSetIdentifier) return false\n\n\treturn variable.setModuleId === vectorSetIdentifier\n}\n\nfunction collectPossibleComputedValueInputTypesToReachOutputBFS(\n\toutputType: VariableType,\n\tpossibleInputTypes: Set<ValueTransformType>,\n) {\n\t// Using breadth first search, because we only allow to reach the output type via a certain\n\t// amount of transforms, the max depth also prevents infinite recursion, and super long chains\n\t// from being suggested.\n\tconst queue: { type: VariableType; depth: number }[] = [{ type: outputType, depth: 1 }]\n\n\twhile (queue.length > 0) {\n\t\t// biome-ignore lint/style/noNonNullAssertion: bounds are checked by while condition\n\t\tconst { type, depth } = queue.shift()!\n\t\tconst reachedMaxDepth = depth === maxTransformCountToReachOutputType\n\n\t\tconst transformNames = getValueTransformNamesForOutputType(type)\n\t\tif (!transformNames) continue\n\n\t\tfor (const transformName of transformNames) {\n\t\t\tconst transformInputTypes = getInputTypesForValueTransformName(transformName)\n\t\t\tif (!transformInputTypes) continue\n\n\t\t\tfor (const transformInputType of transformInputTypes) {\n\t\t\t\tif (possibleInputTypes.has(transformInputType)) continue\n\n\t\t\t\tpossibleInputTypes.add(transformInputType)\n\n\t\t\t\tif (!isVariableType(transformInputType)) continue\n\t\t\t\tif (reachedMaxDepth) continue\n\n\t\t\t\tqueue.push({ type: transformInputType, depth: depth + 1 })\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction getStableVariableTypeKey(type: VariableType | readonly VariableType[]): string {\n\tif (!isReadonlyArray(type)) return type\n\treturn Array.from(type).sort().join()\n}\n\n// This function is cached because it can be reused for all menu items each time the menu opens\nexport const getPossibleComputedValueInputTypesToReachOutput = (() => {\n\tconst cache: Map<string, ReadonlySet<ValueTransformType>> = new Map()\n\n\treturn (outputType: VariableType | readonly VariableType[]): ReadonlySet<ValueTransformType> => {\n\t\tconst cacheKey = getStableVariableTypeKey(outputType)\n\t\tconst cachedResult = cache.get(cacheKey)\n\t\tif (cachedResult) {\n\t\t\treturn cachedResult\n\t\t}\n\n\t\tconst possibleInputTypes: Set<ValueTransformType> = new Set()\n\n\t\tif (isReadonlyArray(outputType)) {\n\t\t\tfor (const outputTypeItem of outputType) {\n\t\t\t\tcollectPossibleComputedValueInputTypesToReachOutputBFS(outputTypeItem, possibleInputTypes)\n\t\t\t}\n\t\t} else {\n\t\t\tcollectPossibleComputedValueInputTypesToReachOutputBFS(outputType, possibleInputTypes)\n\t\t}\n\n\t\tcache.set(cacheKey, possibleInputTypes)\n\t\treturn possibleInputTypes\n\t}\n})()\n\nfunction getControlForKeyAndIdentifier(\n\tcomponentLoader: ComponentLoader,\n\tcontrolKey: string | undefined,\n\tcontrolSourceIdentifier: string | undefined,\n): ControlDescription | undefined {\n\tif (!controlKey || !controlSourceIdentifier) return\n\n\tif (controlSourceIdentifier === nodePropertyDefinitionEntityIdentifier) {\n\t\tassert(isNodePropertyControlKey(controlKey))\n\t\treturn getNodePropertyControlDescription(controlKey)\n\t}\n\n\tconst component = componentLoader.reactComponentForIdentifier(controlSourceIdentifier)\n\tif (!component) return\n\n\treturn component.properties[controlKey]\n}\n\nfunction getComputedValueTransformAndOutputType(\n\tcomponentLoader: ComponentLoader,\n\tinput: ControlDescription | ValueTransformType,\n\toutputType: ValueTransformType | readonly ValueTransformType[],\n\tcontrolKey: string | undefined,\n\tcontrolSourceIdentifier: string | undefined,\n): {\n\tvalueTransform: ValueTransform\n\toutputType: ComputedValueOutputType\n} | null {\n\tconst inputType = (isString(input) ? input : input.type) as ValueTransformType\n\n\tfor (const valueTransformName of getEnabledValueTransformNames()) {\n\t\tconst transformInputTypes = getInputTypesForValueTransformName(valueTransformName)\n\t\tif (!transformInputTypes || !transformInputTypes.includes(inputType)) continue\n\n\t\tconst transformOutputTypes = getOutputTypesForValueTransformName(valueTransformName)\n\t\tconst transformOutputType = isReadonlyArray(outputType)\n\t\t\t? outputType.find(type => transformOutputTypes.includes(type))\n\t\t\t: transformOutputTypes.find(type => type === outputType)\n\n\t\tif (!isComputedValueOutputType(transformOutputType)) continue\n\n\t\tconst outputControl = getControlForKeyAndIdentifier(componentLoader, controlKey, controlSourceIdentifier)\n\n\t\treturn {\n\t\t\toutputType: transformOutputType,\n\t\t\tvalueTransform: createValueTransformWithName({\n\t\t\t\tname: valueTransformName,\n\t\t\t\tinput,\n\t\t\t\toutput: outputControl?.type === transformOutputType ? outputControl : transformOutputType,\n\t\t\t}),\n\t\t}\n\t}\n\n\treturn null\n}\n\nexport function generateComputedValue(\n\tcomponentLoader: ComponentLoader,\n\tinput: ControlDescription | ValueTransformType,\n\toutputType: ValueTransformType | readonly ValueTransformType[],\n\tcontrolKey: string | undefined,\n\tcontrolSourceIdentifier: string | undefined,\n\tvariableRef: VariableReference,\n): ComputedValue {\n\tconst singleTransform = getComputedValueTransformAndOutputType(\n\t\tcomponentLoader,\n\t\tinput,\n\t\toutputType,\n\t\tcontrolKey,\n\t\tcontrolSourceIdentifier,\n\t)\n\tif (singleTransform) {\n\t\treturn createComputedValue(singleTransform.outputType, variableRef, [singleTransform.valueTransform])\n\t}\n\n\tconst transformToBoolean = getComputedValueTransformAndOutputType(\n\t\tcomponentLoader,\n\t\tinput,\n\t\tControlType.Boolean,\n\t\tcontrolKey,\n\t\tcontrolSourceIdentifier,\n\t)\n\tconst transformFromBoolean = getComputedValueTransformAndOutputType(\n\t\tcomponentLoader,\n\t\tControlType.Boolean,\n\t\toutputType,\n\t\tundefined,\n\t\tundefined,\n\t)\n\n\tif (transformToBoolean && transformFromBoolean) {\n\t\treturn createComputedValue(transformFromBoolean.outputType, variableRef, [\n\t\t\ttransformToBoolean.valueTransform,\n\t\t\ttransformFromBoolean.valueTransform,\n\t\t])\n\t}\n\n\tconst inputType = (isString(input) ? input : input.type) as ValueTransformType\n\tthrow new Error(\n\t\t`Could not generate computed value with input: ${inputType}, and output: ${\n\t\t\tisArray(outputType) ? outputType.join(\", \") : outputType\n\t\t}`,\n\t)\n}\n\nfunction setsIntersect(a: ReadonlySet<unknown>, b: ReadonlySet<unknown>): boolean {\n\tfor (const itemA of a) {\n\t\tif (b.has(itemA)) return true\n\t}\n\treturn false\n}\n\nfunction hasCompatibleVariable(\n\tvariableType: VariableType,\n\tvariableInfo: VariableProviderInfo,\n\tvariableReferenceType: ControlType | readonly ControlType[] | undefined,\n\tcollectionReferenceDataIdentifier: ModuleExportIdentifierString | undefined,\n\tvectorSetIdentifier: GlobalModuleId | undefined,\n\tcodeComponentIdentifier: string | undefined,\n\tcodeComponentProp: string | undefined,\n\tallowedFileTypes: AllowedFileTypes | undefined,\n\tvariableFilter: VariableFilter | undefined,\n) {\n\tif (variableType === ControlType.Enum) {\n\t\tif (!codeComponentIdentifier || !codeComponentProp) return false\n\t\treturn variableInfo.enums.some(({ variable, sourceIdentifier }) => {\n\t\t\treturn isCompatibleEnumVariable(variable, sourceIdentifier, codeComponentIdentifier, codeComponentProp)\n\t\t})\n\t}\n\n\tfor (const [providerId, variableMap] of variableInfo.combined) {\n\t\tconst variableDataSourceIdentifier = variableInfo.variableSourceIdentifiers[providerId]\n\n\t\tfor (const [, variable] of variableMap) {\n\t\t\tif (\n\t\t\t\tisCompatibleVariable(\n\t\t\t\t\tvariable,\n\t\t\t\t\tproviderId,\n\t\t\t\t\tvariableDataSourceIdentifier,\n\t\t\t\t\tvariableType,\n\t\t\t\t\tvariableReferenceType,\n\t\t\t\t\tcollectionReferenceDataIdentifier,\n\t\t\t\t\tvectorSetIdentifier,\n\t\t\t\t\tcodeComponentIdentifier,\n\t\t\t\t\tcodeComponentProp,\n\t\t\t\t\tallowedFileTypes,\n\t\t\t\t\tvariableFilter,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false\n}\n\nexport function hasVariablesAvailable(\n\tvariableInfo: VariableProviderInfo | null,\n\tvariableType: VariableType | readonly VariableType[] | undefined,\n\tvariableReferenceType: ControlType | readonly ControlType[] | undefined,\n\tsupportsComputedValues: boolean | undefined,\n\tcollectionReferenceDataIdentifier: ModuleExportIdentifierString | undefined,\n\tvectorSetIdentifier: GlobalModuleId | undefined,\n\tcodeComponentIdentifier: string | undefined,\n\tcodeComponentProp: string | undefined,\n\tallowedFileTypes: AllowedFileTypes | undefined,\n\tvariableFilter: VariableFilter | undefined,\n): boolean {\n\tif (!variableType || !variableInfo) {\n\t\treturn false\n\t}\n\n\tif (isReadonlyArray(variableType)) {\n\t\tconst hasMatchingVariable = variableType.some(type => {\n\t\t\treturn hasCompatibleVariable(\n\t\t\t\ttype,\n\t\t\t\tvariableInfo,\n\t\t\t\tvariableReferenceType,\n\t\t\t\tcollectionReferenceDataIdentifier,\n\t\t\t\tvectorSetIdentifier,\n\t\t\t\tcodeComponentIdentifier,\n\t\t\t\tcodeComponentProp,\n\t\t\t\tallowedFileTypes,\n\t\t\t\tvariableFilter,\n\t\t\t)\n\t\t})\n\t\tif (hasMatchingVariable) return true\n\t} else {\n\t\tconst hasMatchingVariable = hasCompatibleVariable(\n\t\t\tvariableType,\n\t\t\tvariableInfo,\n\t\t\tvariableReferenceType,\n\t\t\tcollectionReferenceDataIdentifier,\n\t\t\tvectorSetIdentifier,\n\t\t\tcodeComponentIdentifier,\n\t\t\tcodeComponentProp,\n\t\t\tallowedFileTypes,\n\t\t\tvariableFilter,\n\t\t)\n\t\tif (hasMatchingVariable) return true\n\t}\n\n\tif (supportsComputedValues) {\n\t\tconst typesOfVariablesInScope = variableInfo.types\n\t\tconst possibleInputTypes = getPossibleComputedValueInputTypesToReachOutput(variableType)\n\t\tif (possibleInputTypes && setsIntersect(possibleInputTypes, typesOfVariablesInScope)) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunction isCompatibleVariable(\n\tvariable: VariableDefinition,\n\tvariableProviderId: ProviderID,\n\tvariableDataSourceIdentifier: ModuleExportIdentifierString | undefined,\n\tvariableType: VariableType | readonly VariableType[] | undefined,\n\tvariableReferenceType: ControlType | readonly ControlType[] | undefined,\n\tcollectionReferenceDataIdentifier: ModuleExportIdentifierString | undefined,\n\tvectorSetIdentifier: GlobalModuleId | undefined,\n\tcontrolSourceIdentifier: string | undefined,\n\tcontrolKey: string | undefined,\n\tallowedFileTypes: AllowedFileTypes | undefined,\n\tvariableFilter: VariableFilter | undefined,\n): boolean {\n\tif (variableFilter && !variableFilter(variable, variableProviderId)) {\n\t\treturn false\n\t}\n\n\tif (isArray(variableType)) {\n\t\treturn variableType.some((type: VariableType) =>\n\t\t\tisCompatibleVariable(\n\t\t\t\tvariable,\n\t\t\t\tvariableProviderId,\n\t\t\t\tvariableDataSourceIdentifier,\n\t\t\t\ttype,\n\t\t\t\tvariableReferenceType,\n\t\t\t\tcollectionReferenceDataIdentifier,\n\t\t\t\tvectorSetIdentifier,\n\t\t\t\tcontrolSourceIdentifier,\n\t\t\t\tcontrolKey,\n\t\t\t\tallowedFileTypes,\n\t\t\t\tvariableFilter,\n\t\t\t),\n\t\t)\n\t}\n\n\tif (variableType === ControlType.CollectionReference) {\n\t\treturn (\n\t\t\tvariable.type === ControlType.CollectionReference && variable.dataIdentifier === collectionReferenceDataIdentifier\n\t\t)\n\t}\n\n\tif (variableType === ControlType.MultiCollectionReference) {\n\t\treturn (\n\t\t\tvariable.type === ControlType.MultiCollectionReference &&\n\t\t\tvariable.dataIdentifier === collectionReferenceDataIdentifier\n\t\t)\n\t}\n\n\tif (variableType === ControlType.VectorSetItem) {\n\t\treturn isCompatibleVectorSetItemControl(variable, vectorSetIdentifier)\n\t}\n\n\tif (variableType === ControlType.File) {\n\t\treturn isCompatibleFileControl(variable, allowedFileTypes)\n\t}\n\n\tif (variableType === \"controlReference\" || variable.type === \"nodePropertyControlReference\") {\n\t\treturn isCompatibleControlReference(variable, variableReferenceType, controlSourceIdentifier, controlKey)\n\t}\n\n\tif (variable.type === ControlType.Enum) {\n\t\treturn isCompatibleEnumVariable(variable, variableDataSourceIdentifier, controlSourceIdentifier, controlKey)\n\t}\n\n\treturn variable.type === variableType\n}\n\nfunction isCompatibleEnumVariable(\n\tvariable: EnumVariableDefinition,\n\tvariableDataSourceIdentifier: ModuleExportIdentifierString | undefined,\n\tcontrolSourceIdentifier: string | undefined,\n\tcontrolKey: string | undefined,\n) {\n\treturn variableDataSourceIdentifier === controlSourceIdentifier && variable.id === controlKey\n}\n\nfunction isCompatibleComputedValueInputVariable(\n\tinputVariable: VariableDefinition,\n\toutputType: VariableType | readonly VariableType[] | undefined,\n\tsupportsComputedValues: boolean | undefined,\n): boolean {\n\tif (!supportsComputedValues || !outputType) return false\n\n\tconst possibleComputedValueInputTypes = getPossibleComputedValueInputTypesToReachOutput(outputType)\n\n\treturn possibleComputedValueInputTypes?.has(inputVariable.type) ?? false\n}\n\ninterface CompatibleVariable {\n\tvariable: VariableDefinition\n\t/** Variable should get negate transform that it will consume. */\n\tisNegated: boolean\n\t/** Variables that require a transform should list them. */\n\ttransforms: ValueTransformOption[] | null\n\t/** Collection references should include all nested variables. */\n\tcompatibleNestedVariables?: CompatibleVariable[]\n}\n\ninterface CompatibleProviderVariables {\n\tproviderId: ProviderID\n\tproviderTitle: string\n\tcompatibleVariables: CompatibleVariable[]\n}\n\nexport interface VariableTree {\n\tvariable?: VariableDefinition\n\tchildren?: Record<VariableID, VariableTree>\n}\n\n// Turns a flat list of variables into a tree structure. The variable id is used\n// as the path to the variable in the tree.\nexport function getVariableTree(variableMap: VariableProviderVariableMap): VariableTree {\n\tconst tree: VariableTree = {\n\t\tchildren: {},\n\t}\n\n\tfor (const [variableId, variable] of variableMap) {\n\t\tconst path = splitVariableId(variableId)\n\n\t\tlet current = tree\n\t\tfor (const key of path) {\n\t\t\tcurrent.children ??= {}\n\t\t\tcurrent = current.children[key] ??= {}\n\t\t}\n\n\t\tcurrent.variable = variable\n\t}\n\n\treturn tree\n}\n\nexport function getCompatibleVariablesByProvider(\n\tengine: BaseEngine,\n\tvariableInfo: VariableProviderInfo,\n\tvariableType: VariableType | readonly VariableType[] | undefined,\n\tvariableReferenceType: ControlType | readonly ControlType[] | undefined,\n\tsupportsComputedValues: boolean | undefined,\n\tcollectionReferenceDataIdentifier: ModuleExportIdentifierString | undefined,\n\tvectorSetIdentifier: GlobalModuleId | undefined,\n\tcontrolSourceIdentifier: string | undefined,\n\tcontrolKey: string | undefined,\n\tallowedFileTypes: AllowedFileTypes | undefined,\n\tdisplayTransformOptions: boolean,\n\tvariableFilter: VariableFilter | undefined,\n): CompatibleProviderVariables[] {\n\tconst compatibleProviderVariables: CompatibleProviderVariables[] = []\n\n\tfunction getCompatibleVariables(\n\t\tproviderId: ProviderID,\n\t\tchildren: Record<VariableID, VariableTree>,\n\t\tvariableDataSourceIdentifier: ModuleExportIdentifierString,\n\t\tseenVariableIds: string[],\n\t\tparentVariableDataSourceIdentifiers: ModuleExportIdentifierString[],\n\t\tproviderNode: CanvasNode | null,\n\t) {\n\t\tconst compatibleVariables: CompatibleVariable[] = []\n\n\t\tconst isCircularReference =\n\t\t\tparentVariableDataSourceIdentifiers.includes(variableDataSourceIdentifier) &&\n\t\t\tparentVariableDataSourceIdentifiers.length > 1\n\t\tif (isCircularReference) return compatibleVariables\n\n\t\tfor (const childVariableId in children) {\n\t\t\tconst variableSubTree = children[childVariableId]\n\t\t\tif (!variableSubTree) continue\n\n\t\t\tconst { variable, children: nestedChildren } = variableSubTree\n\t\t\t// This shouldn't be possible because every variable should have a\n\t\t\t// parent variable.\n\t\t\tif (isUndefined(variable)) continue\n\n\t\t\tif (isCollectionNavigationVariableId(variable.id)) {\n\t\t\t\t// Only show previous/next on detail pages.\n\t\t\t\tif (!isWebPageNode(providerNode)) continue\n\t\t\t}\n\n\t\t\t// Don't show previous/next for nested variables.\n\t\t\tif (\n\t\t\t\tisNestedReferenceToVariableId(variable.id, previousItemVariableId) ||\n\t\t\t\tisNestedReferenceToVariableId(variable.id, nextItemVariableId)\n\t\t\t) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Variable can be assigned directly (by reference) because it\n\t\t\t// matches the property type.\n\t\t\tif (\n\t\t\t\tisCompatibleVariable(\n\t\t\t\t\tvariable,\n\t\t\t\t\tproviderId,\n\t\t\t\t\tvariableDataSourceIdentifier,\n\t\t\t\t\tvariableType,\n\t\t\t\t\tvariableReferenceType,\n\t\t\t\t\tcollectionReferenceDataIdentifier,\n\t\t\t\t\tvectorSetIdentifier,\n\t\t\t\t\tcontrolSourceIdentifier,\n\t\t\t\t\tcontrolKey,\n\t\t\t\t\tallowedFileTypes,\n\t\t\t\t\tvariableFilter,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tcompatibleVariables.push({\n\t\t\t\t\tvariable,\n\t\t\t\t\tisNegated: false,\n\t\t\t\t\ttransforms: null,\n\t\t\t\t})\n\n\t\t\t\tif (supportsComputedValues && variable.type === ControlType.Boolean) {\n\t\t\t\t\tcompatibleVariables.push({\n\t\t\t\t\t\tvariable,\n\t\t\t\t\t\tisNegated: true,\n\t\t\t\t\t\ttransforms: null,\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tlet compatibleNestedVariables: CompatibleVariable[] | undefined\n\n\t\t\tif (nestedChildren && variable.type === ControlType.CollectionReference) {\n\t\t\t\tconst nestedVariableDataSourceIdentifier = variable.dataIdentifier\n\n\t\t\t\tcompatibleNestedVariables = getCompatibleVariables(\n\t\t\t\t\tproviderId,\n\t\t\t\t\tnestedChildren,\n\t\t\t\t\tnestedVariableDataSourceIdentifier,\n\t\t\t\t\t[...seenVariableIds, variable.id],\n\t\t\t\t\t[...parentVariableDataSourceIdentifiers, variableDataSourceIdentifier],\n\t\t\t\t\tproviderNode,\n\t\t\t\t)\n\t\t\t}\n\n\t\t\t// As ID variables are nested within a parent reference variable\n\t\t\t// which already will be in the menu, we can just skip them.\n\t\t\tif (isIdVariableId(variable.id)) continue\n\n\t\t\t// Variable can be assigned using a transform.\n\t\t\tif (isCompatibleComputedValueInputVariable(variable, variableType, supportsComputedValues)) {\n\t\t\t\tconst valueTransformOptions = getValueTransformOptionsForVariable(variable, variableType)\n\n\t\t\t\t// We do not always want to list the transforms, for example\n\t\t\t\t// within the computed value popout, because that popout already\n\t\t\t\t// displays a dedicated dropdown for selecting transforms.\n\t\t\t\tif (!displayTransformOptions) {\n\t\t\t\t\tcompatibleVariables.push({\n\t\t\t\t\t\tvariable,\n\t\t\t\t\t\tisNegated: false,\n\t\t\t\t\t\ttransforms: null,\n\t\t\t\t\t})\n\n\t\t\t\t\tif (valueTransformOptions) {\n\t\t\t\t\t\tconst valueTransformOptionsForNegatedInput = valueTransformOptions.valueTransformOptions.filter(\n\t\t\t\t\t\t\ttransform => !valueTransformsNotWantingNegatedInputVariable.has(transform.name),\n\t\t\t\t\t\t)\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tsupportsComputedValues &&\n\t\t\t\t\t\t\tvariable.type === ControlType.Boolean &&\n\t\t\t\t\t\t\t// Only display negated version if there are any\n\t\t\t\t\t\t\t// value transform options to display. Some\n\t\t\t\t\t\t\t// transforms don't want a negated input variable\n\t\t\t\t\t\t\t// because they already handle negating within their\n\t\t\t\t\t\t\t// own UI.\n\t\t\t\t\t\t\tvalueTransformOptionsForNegatedInput.length > 0\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcompatibleVariables.push({\n\t\t\t\t\t\t\t\tvariable,\n\t\t\t\t\t\t\t\tisNegated: true,\n\t\t\t\t\t\t\t\ttransforms: null,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif (valueTransformOptions && valueTransformOptions.valueTransformOptions.length > 0) {\n\t\t\t\t\tcompatibleVariables.push({\n\t\t\t\t\t\tvariable,\n\t\t\t\t\t\tisNegated: false,\n\t\t\t\t\t\ttransforms: valueTransformOptions.valueTransformOptions,\n\t\t\t\t\t\tcompatibleNestedVariables,\n\t\t\t\t\t})\n\n\t\t\t\t\tconst valueTransformOptionsForNegatedInput = valueTransformOptions.valueTransformOptions.filter(\n\t\t\t\t\t\ttransform => !valueTransformsNotWantingNegatedInputVariable.has(transform.name),\n\t\t\t\t\t)\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tsupportsComputedValues &&\n\t\t\t\t\t\tvariable.type === ControlType.Boolean &&\n\t\t\t\t\t\tvalueTransformOptionsForNegatedInput.length > 0\n\t\t\t\t\t) {\n\t\t\t\t\t\tcompatibleVariables.push({\n\t\t\t\t\t\t\tvariable,\n\t\t\t\t\t\t\tisNegated: true,\n\t\t\t\t\t\t\ttransforms: valueTransformOptionsForNegatedInput,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif (compatibleNestedVariables) {\n\t\t\t\tcompatibleVariables.push({\n\t\t\t\t\tvariable,\n\t\t\t\t\tisNegated: false,\n\t\t\t\t\ttransforms: null,\n\t\t\t\t\tcompatibleNestedVariables,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\tif (compatibleVariables.length === 0) {\n\t\t\treturn\n\t\t}\n\n\t\treturn compatibleVariables\n\t}\n\n\tfor (const [providerId, variableMap] of variableInfo.combined) {\n\t\tconst { children } = getVariableTree(variableMap)\n\t\tassert(children, \"Variable tree should have children\")\n\n\t\tconst variableDataSourceIdentifier = variableInfo.variableSourceIdentifiers[providerId]\n\t\tif (!variableDataSourceIdentifier) continue\n\n\t\tconst providerNode = engine.tree.get(providerId)\n\n\t\tconst compatibleVariables = getCompatibleVariables(\n\t\t\tproviderId,\n\t\t\tchildren,\n\t\t\tvariableDataSourceIdentifier,\n\t\t\t[],\n\t\t\t[],\n\t\t\tproviderNode,\n\t\t)\n\n\t\tif (compatibleVariables) {\n\t\t\tcompatibleProviderVariables.push({\n\t\t\t\tproviderId,\n\t\t\t\tproviderTitle: getNameForVariableProvider(engine.tree, engine.componentLoader, providerId),\n\t\t\t\tcompatibleVariables,\n\t\t\t})\n\t\t}\n\t}\n\n\treturn compatibleProviderVariables\n}\n\nfunction getSelectedTransformOption(\n\tdynamicValue: DynamicValue | null | undefined,\n\tvariableType: VariableType | readonly VariableType[] | undefined,\n\tselectedVariable: VariableDefinition | undefined,\n\tisSelectedVariableIsNegated: boolean,\n\tinputControl: ControlDescription | undefined,\n): Omit<ValueTransformOption, \"outputType\"> | null {\n\tif (!isComputedValue(dynamicValue) || !selectedVariable || !variableType) return null\n\tconst sections = getTransformChainSections({\n\t\tmainInputType: selectedVariable.type,\n\t\tinputControl,\n\t\tvariableIsNegated: isSelectedVariableIsNegated,\n\t\ttransforms: isComputedValue(dynamicValue) ? dynamicValue.transforms : null,\n\t\texpectedType: variableType,\n\t\tpropName: undefined,\n\t})\n\tconst transformSection = sections.sections.find(isTransformSection)\n\tif (!transformSection) return null\n\treturn { name: transformSection.transform.name, isNegated: transformSection.isNegated }\n}\n\nfunction getFirstNonNegateTransform(computedValue: ComputedValue): ValueTransform | undefined {\n\treturn computedValue.transforms.find(transform => transform.name !== \"negate\")\n}\n\nfunction getInputControl(\n\tvariableInfo: VariableProviderInfo,\n\tselectedVariableReference: VariableReference | null,\n\tselectedVariable: VariableDefinition | undefined,\n): ControlDescription | undefined {\n\tif (!selectedVariableReference || !selectedVariable) return\n\tconst selectedVariableProvider = selectedVariableReference.providerId ?? variableInfo.fallbackProvider\n\tif (!selectedVariableProvider) return\n\tconst control = variableInfo.combinedControls.get(selectedVariableProvider)?.get(selectedVariableReference.id)\n\tif (!control) return\n\treturn control.type === selectedVariable.type ? control : undefined\n}\n\nfunction getVariableAssignmentOptions({\n\tengine,\n\tvariableInfo,\n\tcompatibleVariablesByProvider,\n\tvariableType,\n\tdynamicValue,\n\tvariableReferenceType,\n\tcollectionReferenceDataIdentifier,\n\tvectorSetIdentifier,\n\tcontrolSourceIdentifier,\n\tcontrolKey,\n\tallowedFileTypes,\n\tsupportsComputedValues,\n\tonSelectVariable,\n\tonSelectComputedValue,\n\tonRemoveDynamicValue,\n\treadonly,\n\tvariableFilter,\n}: {\n\tengine: BaseEngine\n\tvariableInfo: VariableProviderInfo\n\tcompatibleVariablesByProvider: CompatibleProviderVariables[]\n\tvariableType: VariableType | readonly VariableType[] | undefined\n\tdynamicValue: DynamicValue | null | undefined\n\tvariableReferenceType: ControlType | readonly ControlType[] | undefined\n\tcollectionReferenceDataIdentifier: ModuleExportIdentifierString | undefined\n\tvectorSetIdentifier: GlobalModuleId | undefined\n\tcontrolSourceIdentifier: string | undefined\n\tcontrolKey: string | undefined\n\tallowedFileTypes: AllowedFileTypes | undefined\n\tsupportsComputedValues: boolean | undefined\n\tonSelectVariable: ((variableRef: VariableReference, type: VariableType) => void) | undefined\n\tonSelectComputedValue: ((computedValue: ComputedValue) => void) | undefined\n\tonRemoveDynamicValue: ((dynamicValue: DynamicValue) => void) | undefined\n\treadonly: boolean\n\tvariableFilter: VariableFilter | undefined\n}): MenuItemOptions[] {\n\tconst menuOptions: MenuItemOptions[] = []\n\tconst fallbackProviderId = variableInfo.fallbackProvider\n\n\tconst selectedVariableReference = getVariableReferenceFromDynamicValue(dynamicValue)\n\tconst selectedVariable = selectedVariableReference\n\t\t? getVariableFromInfo(selectedVariableReference, variableInfo)\n\t\t: undefined\n\n\tconst isSelectedVariableNegated = selectedVariableIsNegated(dynamicValue, selectedVariable)\n\tconst selectedTransformOption = getSelectedTransformOption(\n\t\tdynamicValue,\n\t\tvariableType,\n\t\tselectedVariable,\n\t\tisSelectedVariableNegated,\n\t\tgetInputControl(variableInfo, selectedVariableReference, selectedVariable),\n\t)\n\n\tfunction getMenuOptions(\n\t\tcompatibleVariables: CompatibleVariable[],\n\t\tproviderId: string,\n\t\tvariableDataSourceIdentifier: ModuleExportIdentifierString,\n\t) {\n\t\treturn compatibleVariables.map((compatibleVariable): MenuItemOptions => {\n\t\t\tconst { variable, isNegated, transforms, compatibleNestedVariables } = compatibleVariable\n\n\t\t\tconst isVariableSelected = variableIsSelected(\n\t\t\t\tcompatibleVariable,\n\t\t\t\tproviderId,\n\t\t\t\tselectedVariableReference,\n\t\t\t\tisSelectedVariableNegated,\n\t\t\t\tfallbackProviderId,\n\t\t\t)\n\n\t\t\tconst transformsSubmenu = transforms?.map(\n\t\t\t\t(transformOption): MenuItemOptions => ({\n\t\t\t\t\tlabel: getValueTransformTitle(transformOption.name, transformOption.isNegated),\n\t\t\t\t\tenabled: !readonly,\n\t\t\t\t\tchecked:\n\t\t\t\t\t\tisVariableSelected &&\n\t\t\t\t\t\tselectedTransformOption?.name === transformOption.name &&\n\t\t\t\t\t\tselectedTransformOption.isNegated === transformOption.isNegated,\n\t\t\t\t\tclick: () => setVariable(transformOption),\n\t\t\t\t}),\n\t\t\t)\n\n\t\t\tif (compatibleNestedVariables) {\n\t\t\t\tassert(\n\t\t\t\t\tvariable.type === ControlType.CollectionReference || variable.type === ControlType.Array,\n\t\t\t\t\t\"Invalid variable type\",\n\t\t\t\t)\n\n\t\t\t\tconst nestedVariableDataSourceIdentifier =\n\t\t\t\t\tvariable.type === ControlType.CollectionReference\n\t\t\t\t\t\t? variable.dataIdentifier\n\t\t\t\t\t\t: // For ControlType.Array we set the variableSourceIdentifier to the\n\t\t\t\t\t\t\t// node which provides the data for the array. This may be a collection\n\t\t\t\t\t\t\t// repeater, WebPageNode, or SmartComponentNode. This future-proofs for\n\t\t\t\t\t\t\t// when arrays can contain any variable type, because enums depend on\n\t\t\t\t\t\t\t// being able to load the dataIdentifier of the collection which houses\n\t\t\t\t\t\t\t// them.\n\t\t\t\t\t\t\tvariableDataSourceIdentifier\n\n\t\t\t\tconst nestedMenuOptions = getMenuOptions(\n\t\t\t\t\tcompatibleNestedVariables,\n\t\t\t\t\tproviderId,\n\t\t\t\t\tnestedVariableDataSourceIdentifier,\n\t\t\t\t)\n\n\t\t\t\tconst isChecked =\n\t\t\t\t\tisVariableReference(selectedVariableReference) &&\n\t\t\t\t\t(selectedVariableReference.providerId ?? fallbackProviderId) === providerId &&\n\t\t\t\t\tisNestedVariableSelected(selectedVariableReference.id, variable.id)\n\n\t\t\t\t// People are confused by slugs, so if there is only a single slug variable sub\n\t\t\t\t// option we show it without a submenu.\n\t\t\t\tif (compatibleNestedVariables.length === 1 && nestedMenuOptions.length === 1) {\n\t\t\t\t\tconst compatibleNestedVariable = compatibleNestedVariables[0]\n\t\t\t\t\tconst nestedMenuOption = nestedMenuOptions[0]\n\t\t\t\t\tif (compatibleNestedVariable && isSlugVariable(compatibleNestedVariable.variable) && nestedMenuOption) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tlabel: variable.name,\n\t\t\t\t\t\t\tchecked: isChecked,\n\t\t\t\t\t\t\tclick: nestedMenuOption.click,\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (transformsSubmenu) {\n\t\t\t\t\tnestedMenuOptions.unshift(...transformsSubmenu, { type: \"separator\" })\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tlabel: variable.name,\n\t\t\t\t\tchecked: isChecked,\n\t\t\t\t\tsubmenu: nestedMenuOptions,\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction setVariable(transformOverride: ValueTransformOption | undefined = undefined) {\n\t\t\t\tif (isVariableSelected && !transformOverride) {\n\t\t\t\t\tif (dynamicValue) {\n\t\t\t\t\t\t// Unassign current value\n\t\t\t\t\t\tonRemoveDynamicValue?.(dynamicValue)\n\t\t\t\t\t}\n\n\t\t\t\t\ttriggerVariableReferenceDeleteEvent({\n\t\t\t\t\t\tvariableId: variable.id,\n\t\t\t\t\t\tvariableType: variable.type,\n\t\t\t\t\t})\n\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tconst variableRef = createVariableReference(variable.id, providerId)\n\n\t\t\t\t// If the variable type didn't change we can reuse the existing computed value transforms\n\t\t\t\tif (\n\t\t\t\t\tisComputedValue(dynamicValue) &&\n\t\t\t\t\tdynamicValue.transforms.length > 0 &&\n\t\t\t\t\tselectedVariable?.type === variable.type &&\n\t\t\t\t\t!selectedVariableIsNegatedWithoutOtherTransforms(dynamicValue, selectedVariable) &&\n\t\t\t\t\t!transformOverride\n\t\t\t\t) {\n\t\t\t\t\tconst updatedDynamicValue: ComputedValue = { ...dynamicValue, startValue: variableRef }\n\t\t\t\t\tif (isNegated !== isSelectedVariableNegated) {\n\t\t\t\t\t\tassert(variable.type === ControlType.Boolean)\n\t\t\t\t\t\tconst updatedTransforms = Array.from(updatedDynamicValue.transforms)\n\t\t\t\t\t\tupdatedDynamicValue.transforms = updatedTransforms\n\t\t\t\t\t\tif (isNegated) {\n\t\t\t\t\t\t\tupdatedTransforms.unshift(createNegateTransform())\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tassert(updatedTransforms[0]?.name === \"negate\")\n\t\t\t\t\t\t\tupdatedTransforms.shift()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tonSelectComputedValue?.(updatedDynamicValue)\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// Assign variable when it's compatible with the expected type\n\t\t\t\tif (\n\t\t\t\t\tisCompatibleVariable(\n\t\t\t\t\t\tvariable,\n\t\t\t\t\t\tproviderId,\n\t\t\t\t\t\tvariableDataSourceIdentifier,\n\t\t\t\t\t\tvariableType,\n\t\t\t\t\t\tvariableReferenceType,\n\t\t\t\t\t\tcollectionReferenceDataIdentifier,\n\t\t\t\t\t\tvectorSetIdentifier,\n\t\t\t\t\t\tcontrolSourceIdentifier,\n\t\t\t\t\t\tcontrolKey,\n\t\t\t\t\t\tallowedFileTypes,\n\t\t\t\t\t\tvariableFilter,\n\t\t\t\t\t) &&\n\t\t\t\t\t!transformOverride\n\t\t\t\t) {\n\t\t\t\t\tif (isNegated) {\n\t\t\t\t\t\tassert(variable.type === ControlType.Boolean)\n\t\t\t\t\t\tonSelectComputedValue?.(createComputedValue(ControlType.Boolean, variableRef, [createNegateTransform()]))\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tonSelectVariable?.(createVariableReference(variable.id, providerId), variable.type)\n\t\t\t\t\ttriggerVariableReferenceCreateEvent({\n\t\t\t\t\t\tvariableId: variable.id,\n\t\t\t\t\t\tvariableType: variable.type,\n\t\t\t\t\t})\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// Generate a computed value\n\t\t\t\tassert(\n\t\t\t\t\tisCompatibleComputedValueInputVariable(variable, variableType, supportsComputedValues),\n\t\t\t\t\t\"Selected variable should be assignable using a computed value\",\n\t\t\t\t)\n\t\t\t\tassert(variableType, \"Variable type should be defined\")\n\n\t\t\t\tconst input = getInputControl(variableInfo, variableRef, variable) ?? variable.type\n\n\t\t\t\tlet computedValue: ComputedValue | undefined\n\t\t\t\tif (transformOverride) {\n\t\t\t\t\tconst control = getControlForKeyAndIdentifier(engine.componentLoader, controlKey, controlSourceIdentifier)\n\t\t\t\t\tconst outputType = transformOverride.outputType\n\n\t\t\t\t\tconst transform = createValueTransformWithName({\n\t\t\t\t\t\tname: transformOverride.name,\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\toutput: control?.type === outputType ? control : outputType,\n\t\t\t\t\t})\n\t\t\t\t\tconst valueTransforms: ValueTransform[] = [transform]\n\t\t\t\t\tif (transformOverride.isNegated) valueTransforms.push(createNegateTransform())\n\n\t\t\t\t\tconst computedValueOutputType = isArray(variableType)\n\t\t\t\t\t\t? variableType.find(isComputedValueOutputType)\n\t\t\t\t\t\t: variableType\n\t\t\t\t\tassert(isComputedValueOutputType(computedValueOutputType))\n\n\t\t\t\t\t// Add a second transform to convert to the expected output type if needed\n\t\t\t\t\tif (transformOverride.outputType !== computedValueOutputType) {\n\t\t\t\t\t\tconst extraTransformToOutputType = getComputedValueTransformAndOutputType(\n\t\t\t\t\t\t\tengine.componentLoader,\n\t\t\t\t\t\t\ttransformOverride.outputType,\n\t\t\t\t\t\t\tcomputedValueOutputType,\n\t\t\t\t\t\t\tcontrolKey,\n\t\t\t\t\t\t\tcontrolSourceIdentifier,\n\t\t\t\t\t\t)\n\t\t\t\t\t\tif (extraTransformToOutputType) {\n\t\t\t\t\t\t\tvalueTransforms.push(extraTransformToOutputType.valueTransform)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcomputedValue = createComputedValue(computedValueOutputType, variableRef, valueTransforms)\n\t\t\t\t} else {\n\t\t\t\t\tcomputedValue = generateComputedValue(\n\t\t\t\t\t\tengine.componentLoader,\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tvariableType,\n\t\t\t\t\t\tcontrolKey,\n\t\t\t\t\t\tcontrolSourceIdentifier,\n\t\t\t\t\t\tvariableRef,\n\t\t\t\t\t)\n\t\t\t\t}\n\n\t\t\t\t// Reapply previous transform values to new transform if possible\n\t\t\t\tif (isComputedValue(dynamicValue)) {\n\t\t\t\t\tconst previousTransform = getFirstNonNegateTransform(dynamicValue)\n\t\t\t\t\tconst newTransform = getFirstNonNegateTransform(computedValue)\n\n\t\t\t\t\tif (previousTransform && newTransform) {\n\t\t\t\t\t\t// If the variable type didn't change we can reuse the initial\n\t\t\t\t\t\tif (selectedVariable?.type === variable.type) {\n\t\t\t\t\t\t\tapplyTransformValuesToReplacement(variable.type, previousTransform, newTransform)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst previousOutputType = getOutputTypeForValueTransform(previousTransform)\n\t\t\t\t\t\tconst currentOutputType = getOutputTypeForValueTransform(newTransform)\n\t\t\t\t\t\tif (previousOutputType === currentOutputType) {\n\t\t\t\t\t\t\tconst previousIndex = dynamicValue.transforms.findIndex(transform => transform === previousTransform)\n\t\t\t\t\t\t\tconst remainingTransforms = dynamicValue.transforms.slice(previousIndex + 1)\n\t\t\t\t\t\t\tif (remainingTransforms.length > 0) {\n\t\t\t\t\t\t\t\tconst newTransformIndex = computedValue.transforms.findIndex(transform => transform === newTransform)\n\t\t\t\t\t\t\t\tconst newTransforms = computedValue.transforms.slice(0, newTransformIndex + 1)\n\t\t\t\t\t\t\t\tnewTransforms.push(...remainingTransforms)\n\t\t\t\t\t\t\t\tcomputedValue.transforms = newTransforms\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (isNegated) {\n\t\t\t\t\tassert(variable.type === ControlType.Boolean)\n\t\t\t\t\tcomputedValue.transforms = [createNegateTransform(), ...computedValue.transforms]\n\t\t\t\t}\n\t\t\t\tonSelectComputedValue?.(computedValue)\n\t\t\t\trecord(\"computed_value_create\", {\n\t\t\t\t\tinitialTransformName: computedValue.transforms[0]?.name,\n\t\t\t\t\tinputType: variable.type,\n\t\t\t\t\toutputType: computedValue.outputType,\n\t\t\t\t\tsource: \"property_panel_row\",\n\t\t\t\t})\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tlabel: getNegatedLabel(variable.name || Dictionary.Unknown, isNegated),\n\t\t\t\tchecked: isVariableSelected,\n\t\t\t\tenabled: !readonly,\n\t\t\t\tclick: () => setVariable(),\n\t\t\t\tsubmenu: transformsSubmenu,\n\t\t\t}\n\t\t})\n\t}\n\n\tconst entries = compatibleVariablesByProvider.entries()\n\tfor (const [index, { providerId, providerTitle, compatibleVariables }] of entries) {\n\t\tconst variableDataSourceIdentifier = variableInfo.variableSourceIdentifiers[providerId]\n\t\tif (!variableDataSourceIdentifier) continue\n\n\t\tconst providerMenuOptions = getMenuOptions(compatibleVariables, providerId, variableDataSourceIdentifier)\n\n\t\tif (index === 0) {\n\t\t\tmenuOptions.push(...providerMenuOptions)\n\t\t} else {\n\t\t\tif (index === 1) {\n\t\t\t\tmenuOptions.push({ type: \"separator\" })\n\t\t\t}\n\n\t\t\tmenuOptions.push({\n\t\t\t\tlabel: providerTitle,\n\t\t\t\tsubmenu: providerMenuOptions,\n\t\t\t\tchecked:\n\t\t\t\t\tisVariableReference(selectedVariableReference) &&\n\t\t\t\t\t(selectedVariableReference.providerId ?? fallbackProviderId) === providerId,\n\t\t\t})\n\t\t}\n\t}\n\n\treturn menuOptions\n}\n\nfunction getValueTransformNamesThatCanReachOutputType(\n\tcurrentVariableType: VariableType,\n\toutputType: ComputedValueOutputType,\n): ReadonlyMap<ValueTransformName, ValueTransformType> {\n\tconst result = new Map<ValueTransformName, ValueTransformType>()\n\n\tconst valueTransformNames = getValueTransformNamesForInputType(currentVariableType)\n\tif (!valueTransformNames) return result\n\n\tfor (const valueTransformName of valueTransformNames) {\n\t\tconst canReachOutputType = canReachOutputTypeWithTransforms(valueTransformName, currentVariableType, outputType)\n\t\tif (!canReachOutputType) continue\n\n\t\tconst transformOutputTypes = getOutputTypesForValueTransformName(valueTransformName)\n\t\tconst transformOutputType = transformOutputTypes.includes(outputType) ? outputType : transformOutputTypes[0]\n\t\tresult.set(valueTransformName, transformOutputType)\n\t}\n\n\treturn result\n}\n\nconst getValueTransformOptionsToReachOutputType = (() => {\n\tconst cache = new Map<string, ValueTransformOptionsAndOutputType | undefined>()\n\treturn (\n\t\tcurrentVariableType: VariableType,\n\t\toutputType: ComputedValueOutputType,\n\t): ValueTransformOptionsAndOutputType | undefined => {\n\t\tconst cacheKey = currentVariableType + outputType\n\t\tif (cache.has(cacheKey)) {\n\t\t\treturn cache.get(cacheKey)\n\t\t}\n\n\t\tconst compatibleTransforms = getValueTransformNamesThatCanReachOutputType(currentVariableType, outputType)\n\n\t\tconst valueTransformOptions: ValueTransformOption[] = []\n\n\t\tfor (const [transformName, transformOutputType] of compatibleTransforms) {\n\t\t\t// Boolean variables consume negate\n\t\t\tif (transformName === \"negate\" && currentVariableType === ControlType.Boolean) continue\n\n\t\t\tvalueTransformOptions.push({ name: transformName, isNegated: false, outputType: transformOutputType })\n\n\t\t\tif (valueTransformConsumesNegated(transformName)) {\n\t\t\t\tvalueTransformOptions.push({ name: transformName, isNegated: true, outputType: transformOutputType })\n\t\t\t}\n\t\t}\n\n\t\tif (valueTransformOptions.length === 0) {\n\t\t\tcache.set(cacheKey, undefined)\n\t\t\treturn\n\t\t}\n\n\t\tsortValueTransformOptionsInPlace(valueTransformOptions, outputType)\n\n\t\tconst valueTransformOptionsAndOutputType: ValueTransformOptionsAndOutputType = {\n\t\t\tvalueTransformOptions,\n\t\t\toutputType,\n\t\t}\n\n\t\tcache.set(cacheKey, valueTransformOptionsAndOutputType)\n\t\treturn valueTransformOptionsAndOutputType\n\t}\n})()\n\ninterface ValueTransformOptionsAndOutputType {\n\tvalueTransformOptions: ValueTransformOption[]\n\toutputType: ComputedValueOutputType\n}\n\nexport function getValueTransformOptionsForVariable(\n\tcurrentVariable: VariableDefinition,\n\texpectedType: VariableType | readonly VariableType[] | undefined,\n): ValueTransformOptionsAndOutputType | undefined {\n\tif (!inputTypeCanBeTransformed(currentVariable.type)) return\n\n\t// It's kind of weird that we search the variable type instead of filtering, that only works\n\t// because currently all fields that support multiple variable types only have one that is\n\t// compatible with computed values.\n\tconst outputType = Array.isArray(expectedType) ? expectedType.find(isComputedValueOutputType) : expectedType\n\tif (!isComputedValueOutputType(outputType)) return\n\n\treturn getValueTransformOptionsToReachOutputType(currentVariable.type, outputType)\n}\n\n/**\n * Generate Add Transform menu for variables that are currently assigned by reference\n * but support transforms that result in the same type. For example a plain text\n * variable will display prefix and suffix transform options.\n */\nfunction getAddTransformMenu({\n\tengine,\n\tvariableInfo,\n\tdynamicValue,\n\tvariableType,\n\tsupportsComputedValues,\n\tonSelectComputedValue,\n\tcomputedValuePopoutId,\n\tdisplayTransformOptions,\n\tcontrolSourceIdentifier,\n\tcontrolKey,\n\treadonly,\n}: {\n\tengine: BaseEngine\n\tvariableInfo: VariableProviderInfo\n\tdynamicValue: DynamicValue | null | undefined\n\tvariableType: VariableType | readonly VariableType[] | undefined\n\tsupportsComputedValues: boolean | undefined\n\tonSelectComputedValue: ((computedValue: ComputedValue) => void) | undefined\n\tcomputedValuePopoutId: string | undefined\n\tdisplayTransformOptions: boolean\n\tcontrolSourceIdentifier: string | undefined\n\tcontrolKey: string | undefined\n\treadonly: boolean\n}): MenuItemOptions | undefined {\n\tif (!supportsComputedValues || !onSelectComputedValue || !variableType || !dynamicValue) return\n\t// We don't allow transforms on fetch data values yet but may in the future\n\tif (isComputedValueFromFetchData(dynamicValue)) return\n\n\tif (!displayTransformOptions) return\n\n\tconst variableReference = isVariableReference(dynamicValue) ? dynamicValue : dynamicValue.startValue\n\tconst currentVariable = getVariableFromInfo(variableReference, variableInfo)\n\tif (!currentVariable) return\n\n\tconst isNegatedVariableWithoutOtherTransforms = selectedVariableIsNegatedWithoutOtherTransforms(\n\t\tdynamicValue,\n\t\tcurrentVariable,\n\t)\n\n\tconst isBooleanProperty = variableType === ControlType.Boolean\n\n\tif (isComputedValue(dynamicValue) && !isNegatedVariableWithoutOtherTransforms) {\n\t\treturn {\n\t\t\tlabel: `Edit ${isBooleanProperty ? Dictionary.Condition : Dictionary.Transform}`,\n\t\t\tclick: () => {\n\t\t\t\tassert(computedValuePopoutId)\n\t\t\t\tpopoutWindow.navigation.presentPopout(computedValuePopoutId)\n\t\t\t},\n\t\t}\n\t}\n\n\tif (!isVariableReference(dynamicValue) && !isNegatedVariableWithoutOtherTransforms) {\n\t\treturn\n\t}\n\n\tconst options = getValueTransformOptionsForVariable(currentVariable, variableType)\n\tif (!options) return\n\n\tconst { valueTransformOptions, outputType } = options\n\n\treturn {\n\t\tlabel: `Add ${isBooleanProperty ? Dictionary.Condition : Dictionary.Transform}`,\n\t\tsubmenu: valueTransformOptions.map(valueTransformOption => {\n\t\t\treturn {\n\t\t\t\tlabel: getValueTransformTitle(valueTransformOption.name, valueTransformOption.isNegated),\n\t\t\t\tenabled: !readonly,\n\t\t\t\tclick: () => {\n\t\t\t\t\tconst transforms: ValueTransform[] = []\n\t\t\t\t\tif (isNegatedVariableWithoutOtherTransforms) {\n\t\t\t\t\t\ttransforms.push(createNegateTransform())\n\t\t\t\t\t}\n\t\t\t\t\tconst inputControl = getInputControl(variableInfo, variableReference, currentVariable)\n\t\t\t\t\tconst transform = createValueTransformWithName({\n\t\t\t\t\t\tname: valueTransformOption.name,\n\t\t\t\t\t\tinput: inputControl ?? currentVariable.type,\n\t\t\t\t\t\toutput: valueTransformOption.outputType,\n\t\t\t\t\t})\n\t\t\t\t\ttransforms.push(transform)\n\t\t\t\t\tif (valueTransformOption.isNegated) {\n\t\t\t\t\t\ttransforms.push(createNegateTransform())\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add a second transform to convert to the expected output type if needed\n\t\t\t\t\tif (isString(variableType) && valueTransformOption.outputType !== variableType) {\n\t\t\t\t\t\tconst extraTransformToOutputType = getComputedValueTransformAndOutputType(\n\t\t\t\t\t\t\tengine.componentLoader,\n\t\t\t\t\t\t\tvalueTransformOption.outputType,\n\t\t\t\t\t\t\tvariableType,\n\t\t\t\t\t\t\tcontrolKey,\n\t\t\t\t\t\t\tcontrolSourceIdentifier,\n\t\t\t\t\t\t)\n\t\t\t\t\t\tif (extraTransformToOutputType) {\n\t\t\t\t\t\t\ttransforms.push(extraTransformToOutputType.valueTransform)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tconst computedValue = createComputedValue(outputType, variableReference, transforms)\n\t\t\t\t\tonSelectComputedValue(computedValue)\n\t\t\t\t},\n\t\t\t}\n\t\t}),\n\t}\n}\n\nfunction variableIsSelected(\n\tcompatibleVariable: CompatibleVariable,\n\tproviderId: ProviderID,\n\tselectedVariable: VariableReference | null | undefined,\n\tisSelectedVariableNegated: boolean,\n\tfallbackProvider: MaybeNodeID,\n): boolean {\n\tif (!selectedVariable) return false\n\tif (selectedVariable.id !== compatibleVariable.variable.id) return false\n\tif (compatibleVariable.isNegated !== isSelectedVariableNegated) return false\n\tconst selectedVariableProviderId = selectedVariable.providerId || fallbackProvider\n\treturn selectedVariableProviderId === providerId\n}\n\n/** Determine if two code component identifiers are equal for variable purposes. */\nfunction identifiersEqual(a: string, b: string): boolean {\n\tif (a === b) return true\n\t// Unless both identifiers are external module identifiers with an export\n\t// specifier, just perform a string comparison.\n\tconst aParsed = parseModuleIdentifier(a)\n\tif (aParsed?.kind !== \"externalModuleExport\") return a === b\n\tconst bParsed = parseModuleIdentifier(b)\n\tif (bParsed?.kind !== \"externalModuleExport\") return a === b\n\t// Compare module id and export specifier, but not save id.\n\treturn aParsed.moduleId === bParsed.moduleId && aParsed.exportSpecifier === bParsed.exportSpecifier\n}\n", "import { assert } from \"@framerjs/shared\"\nimport { isComputedValueOutputType } from \"document/models/CanvasTree/traits/ComputedValue.ts\"\nimport type {\n\tValueTransform,\n\tValueTransformName,\n\tValueTransformNegate,\n\tValueTransformType,\n} from \"document/models/CanvasTree/traits/ValueTransform.ts\"\nimport {\n\tgetEnabledValueTransformNames,\n\tgetInputTypesForValueTransformName,\n\tgetOutputTypeForValueTransform,\n\tgetOutputTypesForValueTransformName,\n\tgetValueTransformNamesForInputType,\n\tgetValueTransformTitle,\n\tisKnownValueTransformName,\n\tisRepeatableValueTransform,\n\tvalueTransformConsumesNegated,\n\tvalueTransformOnlyAllowedIfItMatchesOutputType,\n} from \"document/models/CanvasTree/traits/ValueTransform.ts\"\nimport { createValueTransformWithName } from \"document/models/CanvasTree/traits/utils/valueTransformUtils.ts\"\nimport type { ControlDescription } from \"library/render/types/PropertyControls.ts\"\nimport { ControlType } from \"library/render/types/PropertyControls.ts\"\nimport type { Mutable } from \"utils/Mutable.ts\"\nimport { isArray, isBoolean, isReadonlyArray } from \"utils/typeChecks.ts\"\n\nexport interface ValueTransformOption {\n\tname: ValueTransformName\n\tisNegated: boolean\n\toutputType: ValueTransformType\n}\n\ninterface DynamicValueChain {\n\treadonly sections: DynamicValueChainSection[]\n\treadonly errorBefore: TypeErrorSection | null\n\treadonly errorAfter: TypeErrorSection | null\n\treadonly transformAdditionOptions: ValueTransformOption[]\n\treadonly variableIsNegated: boolean\n}\n\ntype DynamicValueChainSection = TransformSection | UnknownTransformSection | TypeErrorSectionWithKey\n\nexport interface TransformSection {\n\ttype: \"transform\"\n\ttransform: ValueTransform\n\tinputType: ValueTransformType\n\tconsumesNegated: boolean\n\t/** Some transforms consume follow-up negate transforms. E.g. Equals becoming Does not Equal */\n\tisNegated: boolean\n\treplaceOptions: readonly ValueTransformOption[] | null\n\tcanBeDeleted: boolean\n\t/**\n\t * Only the first transform receives the input control, follow-up transforms have already\n\t * transformed it.\n\t */\n\tinputControl: ControlDescription | undefined\n}\n\ninterface UnknownTransformSection {\n\ttype: \"unknownTransform\"\n\ttransform: ValueTransform\n}\n\nexport interface TypeErrorSection {\n\ttype: \"typeError\"\n\ttitle: string | undefined\n\texpected: ValueTransformType | readonly ValueTransformType[]\n\treceived: ValueTransformType\n\treplaceOptions: readonly ValueTransformOption[] | null\n}\n\nexport interface TypeErrorSectionWithKey extends TypeErrorSection {\n\ttitle: string\n\tkey: string // Should be stable, so based on previous and next transform\n\ttransformBefore: ValueTransform\n\ttransformAfter: ValueTransform\n}\n\nexport function isTransformSection(\n\tsection: DynamicValueChainSection | TypeErrorSection | undefined,\n): section is TransformSection {\n\treturn section?.type === \"transform\"\n}\n\nexport function isUnknownTransformSection(\n\tsection: DynamicValueChainSection | TypeErrorSection | undefined,\n): section is UnknownTransformSection {\n\treturn section?.type === \"unknownTransform\"\n}\n\nexport function isTypeErrorSection(\n\tsection: DynamicValueChainSection | TypeErrorSection | undefined,\n): section is TypeErrorSection | TypeErrorSectionWithKey {\n\treturn section?.type === \"typeError\"\n}\n\nexport function isTypeErrorSectionWithKey(\n\tsection: DynamicValueChainSection | TypeErrorSection | undefined,\n): section is TypeErrorSectionWithKey {\n\tconst typeErrorSectionWithKeyKey: keyof TypeErrorSectionWithKey = \"key\"\n\treturn isTypeErrorSection(section) && typeErrorSectionWithKeyKey in section\n}\n\nexport function matchesExpectedType(\n\tinput: ValueTransformType,\n\texpected: ValueTransformType | readonly ValueTransformType[],\n) {\n\treturn isArray(expected) ? expected.includes(input) : input === expected\n}\n\nfunction swapLessThanOrEqualWithLessThanIfNeeded(replaceOptions: ValueTransformOption[]) {\n\tlet lessThanOrEqualOptionIndex = -1\n\tlet lessThanOptionIndex = -1\n\n\tfor (let i = 0, il = replaceOptions.length; i < il; i++) {\n\t\tconst option = replaceOptions[i]\n\t\tif (!option) continue\n\n\t\tif (option.name === \"greaterThan\" && option.isNegated) {\n\t\t\tlessThanOrEqualOptionIndex = i\n\t\t} else if (option.name === \"lessThan\" && !option.isNegated) {\n\t\t\tlessThanOptionIndex = i\n\t\t}\n\t}\n\n\tif (lessThanOrEqualOptionIndex === -1 || lessThanOptionIndex === -1) return\n\n\tconst lessThenOrEqualOption = replaceOptions[lessThanOrEqualOptionIndex]\n\tassert(lessThenOrEqualOption)\n\n\tconst lessThanOption = replaceOptions[lessThanOptionIndex]\n\tassert(lessThanOption)\n\n\treplaceOptions[lessThanOrEqualOptionIndex] = lessThanOption\n\treplaceOptions[lessThanOptionIndex] = lessThenOrEqualOption\n}\n\n/**\n * Makes sure that options that result directly in the expected type are shown first. And also swaps\n * the position of some equality transforms so those are in a more sensible order.\n */\nexport function sortValueTransformOptionsInPlace(options: ValueTransformOption[], chainOutputType: ValueTransformType) {\n\toptions.sort((a, b) => {\n\t\tif (a.outputType === b.outputType) return 0\n\t\tif (a.outputType === chainOutputType) return -1\n\t\treturn 1\n\t})\n\n\tswapLessThanOrEqualWithLessThanIfNeeded(options)\n}\n\nexport function addTransformToReachOutputTypeIfPossible(\n\ttransforms: ValueTransform[],\n\toutputControl: ControlDescription | undefined,\n\texpectedType: ValueTransformType,\n) {\n\tconst lastTransform = transforms.at(-1)\n\tif (!lastTransform) return\n\n\tconst lastTransformOutputType = getOutputTypeForValueTransform(lastTransform)\n\tif (lastTransformOutputType === expectedType) return\n\n\tconst validFollowUpTransforms = getValueTransformNamesForInputType(lastTransformOutputType)\n\tif (!validFollowUpTransforms) return\n\n\tfor (const transformName of validFollowUpTransforms) {\n\t\tconst followUpTransformOutputTypes = getOutputTypesForValueTransformName(transformName)\n\t\tif (!followUpTransformOutputTypes) continue\n\n\t\tif (!followUpTransformOutputTypes.includes(expectedType)) continue\n\n\t\ttransforms.push(\n\t\t\tcreateValueTransformWithName({\n\t\t\t\tname: transformName,\n\t\t\t\tinput: lastTransformOutputType,\n\t\t\t\toutput: outputControl ?? expectedType,\n\t\t\t}),\n\t\t)\n\t\treturn\n\t}\n}\n\n/**\n * This is the maximum number of transforms that are automatically created to reach the output type.\n * This number is constrained to prevent very large chains from being created. And it also prevents\n * value chains that ping pong between two different types before reaching the output type.\n */\nexport const maxTransformCountToReachOutputType = 2\n\n/**\n * Expensive operation to find out if a value transform chain can reach the output type. Use\n * `canReachOutputTypeWithTransforms` instead because it caches the result.\n */\nfunction canReachOutputTypeWithTransformsBFS(\n\tinitialTransformName: ValueTransformName,\n\tinputType: ValueTransformType,\n\toutputType: ValueTransformType,\n): boolean {\n\tconst queue: {\n\t\ttransformName: ValueTransformName\n\t\tdepth: number\n\t}[] = [{ transformName: initialTransformName, depth: 1 }]\n\n\t// If we are already a boolean it doesn't make sense to go to another type via multiple\n\t// transforms, so we limit it to max 1 transform.\n\tconst booleanOutputAndMatchesInputType = outputType === ControlType.Boolean && inputType === outputType\n\tconst maxTransformCount = booleanOutputAndMatchesInputType ? 1 : maxTransformCountToReachOutputType\n\n\tconst seenValueTransformNames = new Set<ValueTransformName>()\n\n\twhile (queue.length > 0) {\n\t\t// biome-ignore lint/style/noNonNullAssertion: while condition ensures bounds\n\t\tconst { transformName, depth } = queue.shift()!\n\n\t\tif (seenValueTransformNames.has(transformName)) continue\n\t\tseenValueTransformNames.add(transformName)\n\n\t\tconst valueTransformOutputTypes = getOutputTypesForValueTransformName(transformName)\n\t\tif (!valueTransformOutputTypes) continue\n\n\t\tif (valueTransformOutputTypes.includes(outputType)) {\n\t\t\treturn true\n\t\t}\n\n\t\tif (maxTransformCount === depth) continue\n\t\tif (valueTransformOnlyAllowedIfItMatchesOutputType(transformName)) continue\n\n\t\tfor (const valueTransformOutputType of valueTransformOutputTypes) {\n\t\t\tconst nextTransformNames = getValueTransformNamesForInputType(valueTransformOutputType)\n\t\t\tif (!nextTransformNames) continue\n\n\t\t\tfor (const nextTransformName of nextTransformNames) {\n\t\t\t\tqueue.push({\n\t\t\t\t\ttransformName: nextTransformName,\n\t\t\t\t\tdepth: depth + 1,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false\n}\n\nexport const canReachOutputTypeWithTransforms = (() => {\n\tconst cache = new Map<string, boolean>()\n\n\treturn (\n\t\tinitialTransformName: ValueTransformName,\n\t\tinputType: ValueTransformType,\n\t\toutputType: ValueTransformType,\n\t): boolean => {\n\t\tconst cacheKey = initialTransformName + inputType + outputType\n\t\tconst cachedResult = cache.get(cacheKey)\n\t\tif (isBoolean(cachedResult)) {\n\t\t\treturn cachedResult\n\t\t}\n\n\t\tconst result = canReachOutputTypeWithTransformsBFS(initialTransformName, inputType, outputType)\n\t\tcache.set(cacheKey, result)\n\t\treturn result\n\t}\n})()\n\ninterface ValueTransformReplaceOptions {\n\tinput: ValueTransformType\n\toutput: ValueTransformType\n\tcurrentTransformOutput: ValueTransformType | null\n\tcurrentTransform: ValueTransformName | null\n\ttransformBefore: ValueTransformName | null\n\tvariableConsumesNegated: boolean\n\tsupportedTransformNames: readonly ValueTransformName[]\n}\n\nfunction getValueTransformReplaceOptions({\n\tinput,\n\toutput,\n\tcurrentTransform,\n\tcurrentTransformOutput,\n\ttransformBefore,\n\tvariableConsumesNegated,\n\tsupportedTransformNames,\n}: ValueTransformReplaceOptions): readonly ValueTransformOption[] | null {\n\tconst result: ValueTransformOption[] = []\n\n\tsupportedTransformNames.forEach(valueTransformName => {\n\t\tconst inputTypes = getInputTypesForValueTransformName(valueTransformName)\n\t\t// Only include value transforms that support the input type.\n\t\tif (!inputTypes || !inputTypes.includes(input)) {\n\t\t\t// Unless its already selected (to allow for deletion)\n\t\t\tif (valueTransformName !== currentTransform) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tconst transformOutputTypes = getOutputTypesForValueTransformName(valueTransformName)\n\n\t\tlet outputType: ValueTransformType\n\t\tif (transformOutputTypes.includes(output)) {\n\t\t\toutputType = output\n\t\t} else if (currentTransformOutput && transformOutputTypes.includes(currentTransformOutput)) {\n\t\t\toutputType = currentTransformOutput\n\t\t} else {\n\t\t\t// Check if the transform output type can be converted into the output type of the\n\t\t\t// chain, and if so also allow for it.\n\t\t\tconst canReachOutputType = canReachOutputTypeWithTransforms(valueTransformName, input, output)\n\n\t\t\t// Current transform can't be converted into the output type of the chain\n\t\t\tif (!canReachOutputType) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst outputTypes = getOutputTypesForValueTransformName(valueTransformName)\n\t\t\toutputType = outputTypes.includes(output) ? output : outputTypes[0]\n\t\t}\n\n\t\t// If the transform being replaced is equal to this transform, only include\n\t\t// it when the transform allows to be repeated. Also include it if it is\n\t\t// already repeated.\n\t\tif (\n\t\t\ttransformBefore === valueTransformName &&\n\t\t\tcurrentTransform !== valueTransformName &&\n\t\t\t!isRepeatableValueTransform(valueTransformName)\n\t\t) {\n\t\t\treturn\n\t\t}\n\n\t\t// Only include negate transform if the previous transform doesn't consume\n\t\t// negated, else the transform will immediately disappear.\n\t\tconst transformBeforeCanBeNegated = Boolean(transformBefore && valueTransformConsumesNegated(transformBefore))\n\t\tif (transformBeforeCanBeNegated && valueTransformName === \"negate\") return\n\t\t// The Is Set transform is only useful for checking optional variables, not for comparing\n\t\t// against a negatable transform, because that will always result in a non optional boolean.\n\t\tif (transformBeforeCanBeNegated && valueTransformName === \"isSet\") return\n\n\t\t// Only include negate transform if the selected variable doesn't consume it. For\n\t\t// example a boolean variable named _Featured_ will \"consume\" the first transform if\n\t\t// that transform is negate. By consuming that variable the negate transform isn't\n\t\t// visible to the user, but the variable is prefixed with _Not_ as in _Not Featured_.\n\t\tif (!transformBefore && variableConsumesNegated && valueTransformName === \"negate\") return\n\n\t\tresult.push({ name: valueTransformName, isNegated: false, outputType })\n\n\t\t// Also add negated version if the transform can be negated.\n\t\tif (valueTransformConsumesNegated(valueTransformName)) {\n\t\t\tresult.push({ name: valueTransformName, isNegated: true, outputType })\n\t\t}\n\t})\n\n\tsortValueTransformOptionsInPlace(result, output)\n\n\treturn result.length > 0 ? result : null\n}\n\n/** Some transforms consume follow-up negate transforms, this helper skips those and returns the visible transform. */\nfunction getPreviousTransformIgnoringConsumed(\n\ttransforms: readonly ValueTransform[],\n\tindex: number,\n\tvariableIsNegated: boolean,\n): ValueTransform | null {\n\tassert(index >= 0)\n\tif (index === 0) return null\n\tif (index === 1 && variableIsNegated) return null\n\n\tlet visitedNegateTransform: ValueTransformNegate | undefined\n\n\tconst minIndex = variableIsNegated ? 1 : 0\n\n\tfor (let i = index - 1; i >= minIndex; i--) {\n\t\tconst transform = transforms[i]\n\t\tassert(transform)\n\n\t\tif (transform.name === \"negate\") {\n\t\t\tvisitedNegateTransform = transform\n\t\t\tcontinue\n\t\t}\n\n\t\tif (visitedNegateTransform && !valueTransformConsumesNegated(transform.name)) {\n\t\t\treturn visitedNegateTransform\n\t\t}\n\n\t\treturn transform\n\t}\n\n\tassert(visitedNegateTransform)\n\treturn visitedNegateTransform\n}\n\nexport function getExpectedOutputType(\n\texpectedType: ValueTransformType | readonly ValueTransformType[],\n): ValueTransformType {\n\tif (!isReadonlyArray(expectedType)) return expectedType\n\n\tfor (const type of expectedType) {\n\t\tif (isComputedValueOutputType(type)) return type\n\t}\n\n\tthrow Error(\"Expected type must be a computed value type\")\n}\n\nexport interface TransformChainSectionProps {\n\tmainInputType: ValueTransformType\n\tinputControl: ControlDescription | undefined\n\tvariableIsNegated: boolean\n\ttransforms: readonly ValueTransform[] | null\n\texpectedType: ValueTransformType | readonly ValueTransformType[]\n\tpropName: string | undefined\n\tsupportedTransformNames?: readonly ValueTransformName[]\n}\n\nexport function getTransformChainSections({\n\tmainInputType,\n\tinputControl,\n\tvariableIsNegated,\n\ttransforms,\n\texpectedType,\n\tpropName,\n\tsupportedTransformNames = getEnabledValueTransformNames(),\n}: TransformChainSectionProps): DynamicValueChain {\n\tconst outputType = getExpectedOutputType(expectedType)\n\n\tconst variableConsumesNegated = mainInputType === ControlType.Boolean\n\n\tconst result: Mutable<DynamicValueChain> = {\n\t\tsections: [],\n\t\terrorBefore: null,\n\t\terrorAfter: null,\n\t\ttransformAdditionOptions: [],\n\t\tvariableIsNegated,\n\t}\n\n\tconst variableIsOfExpectedType = matchesExpectedType(mainInputType, expectedType)\n\n\tlet inputType: ValueTransformType = mainInputType\n\n\tif (transforms) {\n\t\tconst startIndex = variableIsNegated ? 1 : 0\n\t\tfor (let i = startIndex, il = transforms.length; i < il; i++) {\n\t\t\tconst transformBefore = getPreviousTransformIgnoringConsumed(transforms, i, variableIsNegated)\n\t\t\tconst transform = transforms[i]\n\t\t\tassert(transform)\n\n\t\t\tif (!isKnownValueTransformName(transform.name)) {\n\t\t\t\tresult.sections.push({ type: \"unknownTransform\", transform: transform })\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tconst transformExpectedTypes = getInputTypesForValueTransformName(transform.name)\n\t\t\tassert(transformExpectedTypes)\n\n\t\t\tif (!matchesExpectedType(inputType, transformExpectedTypes)) {\n\t\t\t\tconst title = getValueTransformTitle(transform.name, false)\n\t\t\t\tif (i === 0) {\n\t\t\t\t\tresult.errorBefore = {\n\t\t\t\t\t\ttype: \"typeError\",\n\t\t\t\t\t\ttitle,\n\t\t\t\t\t\texpected: transformExpectedTypes,\n\t\t\t\t\t\treceived: inputType,\n\t\t\t\t\t\treplaceOptions: getValueTransformReplaceOptions({\n\t\t\t\t\t\t\tinput: inputType,\n\t\t\t\t\t\t\toutput: outputType,\n\t\t\t\t\t\t\tcurrentTransformOutput: null,\n\t\t\t\t\t\t\tcurrentTransform: null,\n\t\t\t\t\t\t\ttransformBefore: null,\n\t\t\t\t\t\t\tvariableConsumesNegated,\n\t\t\t\t\t\t\tsupportedTransformNames,\n\t\t\t\t\t\t}),\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tassert(transformBefore)\n\t\t\t\t\tresult.sections.push({\n\t\t\t\t\t\ttype: \"typeError\",\n\t\t\t\t\t\tkey: `${transform.id}-error`,\n\t\t\t\t\t\ttitle,\n\t\t\t\t\t\texpected: transformExpectedTypes,\n\t\t\t\t\t\treceived: inputType,\n\t\t\t\t\t\treplaceOptions: getValueTransformReplaceOptions({\n\t\t\t\t\t\t\tinput: inputType,\n\t\t\t\t\t\t\toutput: outputType,\n\t\t\t\t\t\t\tcurrentTransformOutput: null,\n\t\t\t\t\t\t\tcurrentTransform: null,\n\t\t\t\t\t\t\ttransformBefore: transformBefore.name,\n\t\t\t\t\t\t\tvariableConsumesNegated,\n\t\t\t\t\t\t\tsupportedTransformNames,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\ttransformBefore,\n\t\t\t\t\t\ttransformAfter: transform,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst previousSection = result.sections[result.sections.length - 1]\n\n\t\t\tif (transform.name === \"negate\" && previousSection?.type === \"transform\" && previousSection.consumesNegated) {\n\t\t\t\t// Each negate transform flips isNegated when the last transform consumes negate transforms\n\t\t\t\tpreviousSection.isNegated = !previousSection.isNegated\n\t\t\t} else {\n\t\t\t\tconst currentTransformOutput = getOutputTypeForValueTransform(transform)\n\n\t\t\t\t// A section can be deleted when the variable matches the expected type, or when\n\t\t\t\t// there is an error before, or when there is already a transform resulting in the\n\t\t\t\t// expected type.\n\t\t\t\tconst noTransformNeeded = variableIsOfExpectedType && mainInputType !== ControlType.Enum\n\t\t\t\tconst isOfExpectedTypeOrHasErrorBefore = result.sections.some(section => {\n\t\t\t\t\tconst hasError = section.type !== \"transform\"\n\t\t\t\t\tif (hasError) return true\n\t\t\t\t\tconst transformOutputType = getOutputTypeForValueTransform(section.transform)\n\t\t\t\t\treturn matchesExpectedType(transformOutputType, expectedType)\n\t\t\t\t})\n\t\t\t\tconst canBeDeleted = noTransformNeeded || isOfExpectedTypeOrHasErrorBefore || Boolean(transformBefore)\n\n\t\t\t\tresult.sections.push({\n\t\t\t\t\ttype: \"transform\",\n\t\t\t\t\ttransform,\n\t\t\t\t\tinputType,\n\t\t\t\t\t// Only the first transform section receives the input control\n\t\t\t\t\tinputControl: startIndex === i ? inputControl : undefined,\n\t\t\t\t\tconsumesNegated: valueTransformConsumesNegated(transform.name),\n\t\t\t\t\tisNegated: false,\n\t\t\t\t\tcanBeDeleted,\n\t\t\t\t\treplaceOptions: getValueTransformReplaceOptions({\n\t\t\t\t\t\tinput: inputType,\n\t\t\t\t\t\toutput: outputType,\n\t\t\t\t\t\tcurrentTransformOutput,\n\t\t\t\t\t\tcurrentTransform: transform.name,\n\t\t\t\t\t\ttransformBefore: transformBefore?.name ?? null,\n\t\t\t\t\t\tvariableConsumesNegated,\n\t\t\t\t\t\tsupportedTransformNames,\n\t\t\t\t\t}),\n\t\t\t\t})\n\n\t\t\t\tinputType = currentTransformOutput\n\t\t\t}\n\t\t}\n\t}\n\n\tconst transformBefore = transforms\n\t\t? getPreviousTransformIgnoringConsumed(transforms, transforms.length, variableIsNegated)\n\t\t: null\n\n\tconst lastTransformName = transformBefore ? transformBefore.name : null\n\tconst lastTransformIsNegate = lastTransformName === \"negate\"\n\tconst lastTransformConsumesNegate = lastTransformName ? valueTransformConsumesNegated(lastTransformName) : false\n\n\tconst hasErrorAfter = !matchesExpectedType(inputType, expectedType)\n\tif (hasErrorAfter) {\n\t\tresult.errorAfter = {\n\t\t\ttype: \"typeError\",\n\t\t\ttitle: propName,\n\t\t\texpected: expectedType,\n\t\t\treceived: inputType,\n\t\t\treplaceOptions: getValueTransformReplaceOptions({\n\t\t\t\tinput: inputType,\n\t\t\t\toutput: outputType,\n\t\t\t\tcurrentTransformOutput: null,\n\t\t\t\tcurrentTransform: null,\n\t\t\t\ttransformBefore: lastTransformName,\n\t\t\t\tvariableConsumesNegated,\n\t\t\t\tsupportedTransformNames,\n\t\t\t}),\n\t\t}\n\t}\n\n\tconst displayAdditionOptions = shouldDisplayAdditionOptions(result, transformBefore, expectedType, hasErrorAfter)\n\n\tif (displayAdditionOptions) {\n\t\t// Calculate transforms that can be added\n\t\tsupportedTransformNames.forEach(transformName => {\n\t\t\tif (lastTransformName === transformName && !isRepeatableValueTransform(transformName)) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Boolean variables consume negate, so no need to show it when there are no transforms\n\t\t\tif (transformName === \"negate\" && (!transformBefore || lastTransformIsNegate || lastTransformConsumesNegate)) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst inputTypes = getInputTypesForValueTransformName(transformName)\n\t\t\tif (!inputTypes || !inputTypes.includes(inputType)) return\n\n\t\t\tconst outputTypes = getOutputTypesForValueTransformName(transformName)\n\t\t\tconst transformOutputType =\n\t\t\t\toutputTypes.find(output => matchesExpectedType(output, expectedType)) ?? outputTypes[0]\n\n\t\t\t// Exclude options that don't match the expected type when we are already at the expected type\n\t\t\tif (matchesExpectedType(inputType, expectedType)) {\n\t\t\t\tif (!matchesExpectedType(transformOutputType, expectedType)) return\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tvalueTransformOnlyAllowedIfItMatchesOutputType(transformName) &&\n\t\t\t\t!matchesExpectedType(transformOutputType, expectedType)\n\t\t\t) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tresult.transformAdditionOptions.push({\n\t\t\t\tname: transformName,\n\t\t\t\tisNegated: false,\n\t\t\t\toutputType: transformOutputType,\n\t\t\t})\n\t\t\tif (valueTransformConsumesNegated(transformName)) {\n\t\t\t\tresult.transformAdditionOptions.push({\n\t\t\t\t\tname: transformName,\n\t\t\t\t\tisNegated: true,\n\t\t\t\t\toutputType: transformOutputType,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\n\t\tsortValueTransformOptionsInPlace(result.transformAdditionOptions, outputType)\n\t}\n\n\treturn result\n}\n\nfunction shouldDisplayAdditionOptions(\n\tresult: Mutable<DynamicValueChain>,\n\tlastTransform: ValueTransform | null,\n\texpectedType: ValueTransformType | readonly ValueTransformType[],\n\thasErrorAfter: boolean,\n) {\n\t// If the current chain ends in an error, we always show the Add Transform button.\n\tif (hasErrorAfter) return true\n\n\tif (expectedType === ControlType.Boolean) {\n\t\t// When a boolean is expected we only show the Add Transform button if the last transform\n\t\t// isn't an equals transform. Because in that case additional transforms don't add value.\n\t\treturn lastTransform?.name !== \"equals\"\n\t}\n\n\t// When an enum is expected we don't show the Add Transform button if the current transform\n\t// already results in an enum.\n\tif (matchesExpectedType(ControlType.Enum, expectedType)) {\n\t\tif (!lastTransform || !lastTransform.name) return true\n\t\tconst currentOutputTypes = getOutputTypesForValueTransformName(lastTransform.name)\n\t\treturn !currentOutputTypes.includes(ControlType.Enum)\n\t}\n\n\treturn true\n}\n", "import type { ValueTransform, ValueTransformType } from \"document/models/CanvasTree/traits/ValueTransform.ts\"\nimport { isVariableReference } from \"document/models/CanvasTree/traits/VariableReference.ts\"\nimport { ControlType } from \"library/render/types/PropertyControls.ts\"\nimport { isArray, isNumber, isString } from \"utils/typeChecks.ts\"\nimport { isValidPropertyValueType } from \"../../properties/codeComponentRows/utils/isValidPropertyValue.ts\"\n\nexport function applyTransformValuesToReplacement(\n\tinputType: ValueTransformType,\n\tpreviousTransform: ValueTransform,\n\treplacement: ValueTransform,\n) {\n\tswitch (replacement.name) {\n\t\tcase \"equals\":\n\t\t\tswitch (previousTransform.name) {\n\t\t\t\tcase \"equals\":\n\t\t\t\tcase \"startsWith\":\n\t\t\t\tcase \"endsWith\":\n\t\t\t\tcase \"contains\":\n\t\t\t\tcase \"lessThan\":\n\t\t\t\tcase \"greaterThan\":\n\t\t\t\tcase \"isAfter\":\n\t\t\t\tcase \"isBefore\":\n\t\t\t\t\tswitch (inputType) {\n\t\t\t\t\t\tcase ControlType.String:\n\t\t\t\t\t\tcase ControlType.Boolean:\n\t\t\t\t\t\tcase ControlType.Number:\n\t\t\t\t\t\tcase ControlType.Enum:\n\t\t\t\t\t\tcase ControlType.Date:\n\t\t\t\t\t\tcase ControlType.CollectionReference:\n\t\t\t\t\t\t\tif (isValidPropertyValueType(inputType, previousTransform.value)) {\n\t\t\t\t\t\t\t\treplacement.value = previousTransform.value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t}\n\t\t\treturn\n\t\tcase \"isAfter\":\n\t\tcase \"isBefore\":\n\t\t\tswitch (previousTransform.name) {\n\t\t\t\tcase \"isBefore\":\n\t\t\t\tcase \"isAfter\":\n\t\t\t\tcase \"equals\":\n\t\t\t\t\tif (isString(previousTransform.value)) {\n\t\t\t\t\t\treplacement.value = previousTransform.value\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t\tbreak\n\t\tcase \"lessThan\":\n\t\tcase \"greaterThan\":\n\t\t\tswitch (previousTransform.name) {\n\t\t\t\tcase \"lessThan\":\n\t\t\t\tcase \"greaterThan\":\n\t\t\t\t\treplacement.value = previousTransform.value\n\t\t\t\t\tbreak\n\t\t\t\tcase \"equals\":\n\t\t\t\t\tif (isNumber(previousTransform.value)) {\n\t\t\t\t\t\treplacement.value = previousTransform.value\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t\tbreak\n\t\tcase \"startsWith\":\n\t\tcase \"endsWith\":\n\t\tcase \"contains\":\n\t\t\tswitch (previousTransform.name) {\n\t\t\t\tcase \"startsWith\":\n\t\t\t\tcase \"endsWith\":\n\t\t\t\tcase \"contains\":\n\t\t\t\tcase \"equals\":\n\t\t\t\t\tif (isString(previousTransform.value)) {\n\t\t\t\t\t\treplacement.value = previousTransform.value\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\tcase \"prefix\":\n\t\tcase \"suffix\":\n\t\t\tswitch (previousTransform.name) {\n\t\t\t\tcase \"prefix\":\n\t\t\t\tcase \"suffix\":\n\t\t\t\t\treplacement.value = previousTransform.value\n\t\t\t\t\treplacement.valueLocalized = previousTransform.valueLocalized\n\t\t\t}\n\t\t\tbreak\n\t\tcase \"isIncludedIn\":\n\t\t\tswitch (previousTransform.name) {\n\t\t\t\tcase \"isIncludedIn\":\n\t\t\t\t\tif (isArray(previousTransform.value) && previousTransform.value.every(isString)) {\n\t\t\t\t\t\treplacement.value = previousTransform.value\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\tcase \"containsAny\":\n\t\tcase \"containsAll\":\n\t\t\tswitch (previousTransform.name) {\n\t\t\t\tcase \"containsAny\":\n\t\t\t\tcase \"containsAll\":\n\t\t\t\t\tif (\n\t\t\t\t\t\tisVariableReference(previousTransform.value) ||\n\t\t\t\t\t\t(isArray(previousTransform.value) && previousTransform.value.every(isString))\n\t\t\t\t\t) {\n\t\t\t\t\t\treplacement.value = previousTransform.value\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t}\n}\n", "import \"PanelRowTitle.styles_ss5263.wyw.css\"; import { dimensions } from \"@framerjs/fresco/tokens\";\nconst panelTitleIconSize = 10;\nconst panelTitleIconOffset = 5;\nexport const titleWrapperLeftPadding = `calc(${panelTitleIconSize}px + ${dimensions.css.contentTitleIndentation} + ${panelTitleIconOffset}px)`;\nexport const titleWrapper = \"titleWrapper_t3p7r61\";\nexport const title = \"title_t1ih3ztb\";\nexport const withPlusIcon = \"withPlusIcon_wkaasce\";\nexport const withActivePlusIcon = \"withActivePlusIcon_w1vx93q9\";\nexport const withOverride = \"withOverride_wof63pb\";", "import { IconPlusEncircledSmall, Spacer, Translatable as T, truncateWithEllipsis } from \"@framerjs/fresco\"\nimport { dimensions } from \"@framerjs/fresco/tokens\"\nimport { cx } from \"@linaria/core\"\nimport type React from \"react\"\nimport * as classes from \"./PanelRowTitle.styles.ts\"\n\ninterface Props extends React.HTMLAttributes<HTMLDivElement> {\n\ttitle: string\n\tdisplayPlusIcon: boolean\n\tprimaryMenuIsOpen?: boolean\n\tdisableTitleTooltip?: boolean\n\ttitleTooltip?: string\n\teducationTooltip?: React.ReactNode\n\n\t/**\n\t * Indicates that the panel row property value is an override\n\t * of the value in the primary variant.\n\t */\n\toverridden?: boolean\n}\n\nexport function PanelRowTitle({\n\ttitle,\n\tclassName,\n\tdisplayPlusIcon,\n\tprimaryMenuIsOpen,\n\teducationTooltip,\n\tdisableTitleTooltip = false,\n\ttitleTooltip,\n\toverridden,\n\t...rest\n}: Props) {\n\treturn (\n\t\t<div\n\t\t\tclassName={cx(\n\t\t\t\tclasses.titleWrapper,\n\t\t\t\tdisplayPlusIcon && cx(classes.withPlusIcon, (primaryMenuIsOpen || overridden) && classes.withActivePlusIcon),\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\ttitle={\n\t\t\t\t// We use an empty space to leave the title area empty while pushing the inputs to the second and third column\n\t\t\t\t// In that case we don't want to display the native tooltip\n\t\t\t\ttitle === \" \" || disableTitleTooltip ? undefined : (titleTooltip ?? title)\n\t\t\t}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{displayPlusIcon && <IconPlusEncircledSmall />}\n\t\t\t<div className={cx(truncateWithEllipsis, classes.title, overridden && classes.withOverride)}>\n\t\t\t\t<T>{title}</T>\n\t\t\t</div>\n\t\t\t{educationTooltip && (\n\t\t\t\t<>\n\t\t\t\t\t<Spacer size={dimensions.css.inputSpacing} />\n\t\t\t\t\t{educationTooltip}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t)\n}\n", "import \"PanelRowView.styles_1toc34d.wyw.css\"; export const firstColumnWidth = \"1.5fr\";\nexport const panelRowView = \"panelRowView_p1oxlfbn\";\nexport const withReorderControl = \"withReorderControl_w1xpzgm5\";\nexport const withButtonCursor = \"withButtonCursor_w1chribc\";", "import { cx } from \"@linaria/core\"\nimport type React from \"react\"\nimport type { DetailedHTMLProps, HTMLAttributes } from \"react\"\nimport { isNumber } from \"utils/typeChecks.ts\"\nimport { PanelRowTitle } from \"./PanelRowTitle.tsx\"\nimport * as styles from \"./PanelRowView.styles.ts\"\n\nexport type PanelRowViewCommonProps = Omit<React.ComponentPropsWithRef<\"div\">, \"title\"> & {\n\ttitle?: string\n\ttitleClassName?: string\n\treorderColumnCount?: number\n\treorderControlHidden?: boolean\n\tdisableTitleTooltip?: boolean\n\ttitleTooltip?: string\n\tReorderControl?: React.ComponentType\n}\n\ntype PanelRowViewProps = PanelRowViewCommonProps & {\n\twithButtonCursor?: boolean\n\tdisplayPlusIcon?: boolean\n\tisOverridden?: boolean\n\tprimaryMenuIsOpen?: boolean\n\tonContextMenu?: React.ComponentPropsWithRef<\"div\">[\"onContextMenu\"]\n\teducationTooltip?: React.ReactNode\n}\n\n/**\n * A barebones Panel Row with minimal logic.\n * If you need comprehensive logic like context menus, variable menus or fetch\n * data menus, you should use {@link PanelRow}.\n */\nexport const PanelRowView = ({\n\ttitle,\n\ttitleClassName,\n\tchildren,\n\tclassName,\n\tstyle,\n\tdisableTitleTooltip = false,\n\ttitleTooltip,\n\n\treorderColumnCount,\n\treorderControlHidden,\n\n\twithButtonCursor = false,\n\tdisplayPlusIcon = false,\n\tisOverridden = false,\n\tprimaryMenuIsOpen = false,\n\tonMouseDown,\n\tonContextMenu,\n\tReorderControl,\n\teducationTooltip,\n\n\t...rest\n}: PanelRowViewProps) => {\n\tconst withReorderControl = ReorderControl !== undefined\n\n\tif (withReorderControl && isNumber(reorderColumnCount)) {\n\t\tstyle = { ...style, \"--reorder-column-count\": reorderColumnCount }\n\t}\n\n\tconst buttonProps: DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> = {}\n\n\tif (withButtonCursor) {\n\t\tbuttonProps.role = \"button\"\n\n\t\tif (title) {\n\t\t\tbuttonProps[\"aria-label\"] = title\n\t\t}\n\t}\n\n\tconst menuProps = onContextMenu ? { onContextMenu, ...buttonProps } : {}\n\tconst mouseDownProps = onMouseDown ? { onMouseDown, ...buttonProps } : {}\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cx(\n\t\t\t\tstyles.panelRowView,\n\t\t\t\twithReorderControl && styles.withReorderControl,\n\t\t\t\tclassName,\n\t\t\t\twithButtonCursor && styles.withButtonCursor,\n\t\t\t)}\n\t\t\tstyle={style}\n\t\t\ttabIndex={-1}\n\t\t\t{...menuProps}\n\t\t\t{...mouseDownProps}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{title && (\n\t\t\t\t<PanelRowTitle\n\t\t\t\t\toverridden={isOverridden}\n\t\t\t\t\ttitle={title}\n\t\t\t\t\tdisableTitleTooltip={disableTitleTooltip}\n\t\t\t\t\ttitleTooltip={titleTooltip}\n\t\t\t\t\tclassName={titleClassName}\n\t\t\t\t\tdisplayPlusIcon={displayPlusIcon}\n\t\t\t\t\teducationTooltip={educationTooltip}\n\t\t\t\t\tonMouseDown={onMouseDown}\n\t\t\t\t\tprimaryMenuIsOpen={primaryMenuIsOpen}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{children}\n\t\t\t{withReorderControl && !reorderControlHidden && <ReorderControl />}\n\t\t</div>\n\t)\n}\n", "import { EngineChange } from \"document/EngineChanges.ts\"\nimport { useBaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport { resolveGradientStopColors } from \"document/components/tools/gradient/utils.ts\"\nimport { ColorStyleTokenListNode } from \"document/models/CanvasTree/nodes/ColorStyleTokenListNode.ts\"\nimport { isColorStyleTokenNode } from \"document/models/CanvasTree/nodes/utils/nodeCheck.ts\"\nimport {\n\tisTokenCSSVariable,\n\ttokenIdFromCSSVariable,\n\ttokenToCSSCustomProperty,\n} from \"document/models/CanvasTree/utils/tokens.ts\"\nimport { isGradient } from \"document/models/Gradient.ts\"\nimport { useDeprecatedEngineState } from \"document/useDeprecatedEngineState.ts\"\nimport { useEngineState } from \"document/useEngineState.ts\"\nimport { useMemo } from \"react\"\nimport { useDarkMode } from \"web/lib/useDarkMode.ts\"\n\n/**\n * If we are rendering a value, and it is a css custom property reference, we\n * want to use the actual value of that token node inline, if it exists.\n *\n * This solves a performance problem -- particularly in Safari -- where using\n * css custom property references, and updating css custom property definitions\n * at the top of the document, incur a 20ms/frame cost on even an M1 Pro MacBook\n * Pro.\n *\n * To avoid this, we use a value based on the ColorStyleTokenNode. Since\n * ColorStyleTokenNodes can change without the value changing, the UI needs to\n * know to rerender to show the up-to-date value.\n *\n * In some cases, like when a color is rendered in the Property Panel, this will\n * be skipping the property reducer. We generally try to avoid that whenever\n * possible. However in this case, we decided its preferable to having to reduce\n * the tokenValue and tokenTitle for every single property that could use a\n * token. The downside is that this may create 1 extra rerender per rendered\n * color. However since this hook is used specifically in the color well\n * components which are a single div with no descendants, it does not have a\n * larger impact. Additionally since it is memo'd will only trigger a rerender\n * of the color well if the referenced Color Token Node actually changes.\n *\n * However in other cases, like in the Variables modal or the\n * CollectionItemTable components, we are not using a reducer, and do not even\n * know if we are rendering colors until we map through the items. There this\n * approach is preferred because we can isolate updates.\n *\n * We also reduce the impact of this hook by using a specific EngineChange flag\n * that will only evaluate if a ColorStyleTokenNode is updated, not the entire\n * tree.\n */\nexport function useSubscribeToFillValue(value: unknown): { name: string | undefined; value: string } | null {\n\tconst engine = useBaseEngine()\n\tconst { isDarkMode } = useDarkMode()\n\n\tconst info = useDeprecatedEngineState(\n\t\tEngineChange.ColorStyleTokens,\n\t\t() => {\n\t\t\tif (isGradient(value)) {\n\t\t\t\tconst stops = resolveGradientStopColors(engine.tree, value.stops, isDarkMode)\n\t\t\t\treturn {\n\t\t\t\t\tname: undefined,\n\t\t\t\t\tvalue: value.updated({ stops }).toCSS(),\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst tokenId = isTokenCSSVariable(value) ? tokenIdFromCSSVariable(value) : null\n\t\t\t\tif (!tokenId) return null\n\t\t\t\tconst localTokenNode = engine.tree.get(tokenId)\n\t\t\t\tif (!isColorStyleTokenNode(localTokenNode)) return null\n\t\t\t\treturn {\n\t\t\t\t\tname: localTokenNode.softDeleted ? undefined : localTokenNode.name,\n\t\t\t\t\tvalue: localTokenNode.colorForMode(isDarkMode),\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[value, isDarkMode],\n\t)\n\n\tconst name = info?.name\n\tconst tokenValue = info?.value\n\n\t// Memo the result based off of the strings to prevent recreating the same\n\t// object when unrelated tokens change, which would cause unnecessary\n\t// rerenders.\n\treturn useMemo(() => {\n\t\tif (!tokenValue) return null\n\t\treturn { name, value: tokenValue }\n\t}, [name, tokenValue])\n}\n\nexport function useSubscribeToColorStyles(): Record<string, string> | undefined {\n\tconst { isDarkMode } = useDarkMode()\n\tconst engine = useBaseEngine()\n\n\treturn useEngineState(\n\t\t() => {\n\t\t\tconst list = ColorStyleTokenListNode.get(engine.tree)\n\t\t\tif (!list) return\n\n\t\t\tconst styles: Record<string, string> = {}\n\t\t\tfor (const node of list.children) {\n\t\t\t\tstyles[tokenToCSSCustomProperty(node)] = node.colorForMode(isDarkMode)\n\t\t\t}\n\t\t\treturn styles\n\t\t},\n\t\t[isDarkMode],\n\t\t[EngineChange.ColorStyleTokens],\n\t\t{ deepEqual: true },\n\t)\n}\n", "import \"PopoutButtonBackgroundPreview.styles_1ft98bm.wyw.css\"; export const container = \"container_c1avmyds\";\nexport const largeContainerSites = \"largeContainerSites_lzm78je\";\nexport const ghostContainer = \"ghostContainer_gaoupms\";\nexport const checkerboard = \"checkerboard_c3vlae9\";\nexport const ghostCheckerboard = \"ghostCheckerboard_gyiuvk1\";\nexport const inner = \"inner_iefjm90\";\nexport const innerLarge = \"innerLarge_i1kl3pmw\";\nexport const ghostInner = \"ghostInner_g72moy1\";\nexport const round = \"round_r40dh02\";", "import type { InputVariant } from \"@framerjs/fresco/src/components/types.ts\"\nimport { colors } from \"@framerjs/fresco/tokens\"\nimport { cx } from \"@linaria/core\"\nimport type React from \"react\"\nimport { useSubscribeToFillValue } from \"../properties/utils/useSubscribeToFillValue.ts\"\nimport * as styles from \"./PopoutButtonBackgroundPreview.styles.ts\"\n\nfunction fill(\n\tbackground: string,\n\tbackgroundPositionX: React.CSSProperties[\"backgroundPositionX\"],\n\tbackgroundPositionY: React.CSSProperties[\"backgroundPositionY\"],\n\tborderColor = colors.swatchBorderPlaceholder,\n\tdefaultBackgroundColor = \"white\",\n): React.CSSProperties {\n\tconst backgroundStyles: React.CSSProperties = {\n\t\tboxShadow: `inset 0 0 0 1px ${borderColor}`,\n\t\tbackgroundColor: defaultBackgroundColor,\n\t}\n\n\tif (background.includes(\"gradient\") || background.includes(\"url\")) {\n\t\tbackgroundStyles.backgroundImage = background\n\t\tbackgroundStyles.backgroundRepeat = \"no-repeat\"\n\t\tbackgroundStyles.backgroundSize = \"cover\"\n\t\tbackgroundStyles.backgroundPositionX = backgroundPositionX ?? \"center\"\n\t\tbackgroundStyles.backgroundPositionY = backgroundPositionY ?? \"center\"\n\t} else {\n\t\tbackgroundStyles.backgroundColor = background\n\t}\n\n\treturn backgroundStyles\n}\n\ninterface Props {\n\tlarge?: boolean\n\tvariant?: InputVariant\n\tshape?: \"default\" | \"round\"\n\tbackground: string\n\tborderColor?: string\n\tbackgroundPositionX?: React.CSSProperties[\"backgroundPositionX\"]\n\tbackgroundPositionY?: React.CSSProperties[\"backgroundPositionY\"]\n\tdefaultBackgroundColor?: string\n}\n\nexport function PopoutButtonBackgroundPreview({\n\tlarge,\n\tvariant = \"default\",\n\tshape = \"default\",\n\tbackground,\n\tborderColor,\n\tbackgroundPositionX,\n\tbackgroundPositionY,\n\tdefaultBackgroundColor,\n}: Props) {\n\tconst localToken = useSubscribeToFillValue(background)\n\tconst value = localToken?.value ?? background\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cx(\n\t\t\t\tstyles.container,\n\t\t\t\tlarge && styles.largeContainerSites,\n\t\t\t\tvariant === \"ghost\" && styles.ghostContainer,\n\t\t\t\tshape === \"round\" && styles.round,\n\t\t\t)}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={cx(\n\t\t\t\t\tstyles.checkerboard,\n\t\t\t\t\tvariant === \"ghost\" && styles.ghostCheckerboard,\n\t\t\t\t\tshape === \"round\" && styles.round,\n\t\t\t\t)}\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tclassName={cx(\n\t\t\t\t\tstyles.inner,\n\t\t\t\t\tlarge && styles.innerLarge,\n\t\t\t\t\tvariant === \"ghost\" && styles.ghostInner,\n\t\t\t\t\tshape === \"round\" && styles.round,\n\t\t\t\t)}\n\t\t\t\tstyle={fill(value, backgroundPositionX, backgroundPositionY, borderColor, defaultBackgroundColor)}\n\t\t\t/>\n\t\t</div>\n\t)\n}\n", "import \"PopoutButtonPreviewIconWrapper.styles_b008zt.wyw.css\"; export const wrapper = \"wrapper_wkxdsnf\";\nexport const largeWrapper = \"largeWrapper_l2ga4t0\";\nexport const strokedIconWrapper = \"strokedIconWrapper_s1a71kdc\";", "import { CenterChild } from \"@framerjs/fresco\"\nimport { colors } from \"@framerjs/fresco/tokens\"\nimport { cx } from \"@linaria/core\"\nimport type React from \"react\"\nimport * as styles from \"./PopoutButtonPreviewIconWrapper.styles.ts\"\n\nexport interface PopoutButtonPreviewIconWrapperProps {\n\tlarge?: boolean\n\t/** Render at 21.5\u00D721.5 instead of the default 22\u00D722, for use with the new stroke-style T and + glyph icons. */\n\tstrokedIcon?: boolean\n\tcolor?: string\n\tbackground?: string\n\tborderColor?: string\n\tchildren?: React.ReactNode\n\tclassName?: string\n}\n\nexport function PopoutButtonPreviewIconWrapper({\n\tlarge,\n\tstrokedIcon,\n\tborderColor,\n\tbackground = colors.tint,\n\tcolor = \"#fff\",\n\tchildren,\n\tclassName,\n}: PopoutButtonPreviewIconWrapperProps) {\n\tconst boxShadow = borderColor ? `inset 0 0 0 1px ${borderColor}` : undefined\n\n\treturn (\n\t\t<CenterChild\n\t\t\tclassName={cx(styles.wrapper, large && styles.largeWrapper, strokedIcon && styles.strokedIconWrapper, className)}\n\t\t\tstyle={{\n\t\t\t\tbackground,\n\t\t\t\tcolor,\n\t\t\t\tboxShadow,\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</CenterChild>\n\t)\n}\n", "import type { SVGProps } from \"react\"\n\nexport function IconAgentEffect(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=\"16\"\n\t\t\theight=\"16\"\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\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M7.256 2.887c.266-.675 1.222-.675 1.488 0l1.108 2.81a.8.8 0 0 0 .451.451l2.81 1.108c.675.266.675 1.222 0 1.488l-2.81 1.108a.8.8 0 0 0-.451.451l-1.108 2.81c-.266.675-1.222.675-1.488 0l-1.108-2.81a.8.8 0 0 0-.451-.451l-2.81-1.108c-.675-.266-.675-1.222 0-1.488l2.81-1.108a.8.8 0 0 0 .451-.451Z\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n", "import type { SVGProps } from \"react\"\n\nexport function IconAgentInteraction(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=\"16\"\n\t\t\theight=\"16\"\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\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\td=\"M6.711 2.354c.408-.764 1.569-.427 1.504.436L8 5.65h4.255a.75.75 0 0 1 .663 1.101l-3.63 6.867c-.405.767-1.569.432-1.505-.433L8 10.25H3.75a.75.75 0 0 1-.662-1.103Z\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n", "import type { SVGProps } from \"react\"\n\nexport function IconAgentOverlayGridColumn(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\" strokeLinejoin=\"round\" strokeWidth=\"1.5\">\n\t\t\t\t<path d=\"M2.25 1.5v9M6.25 1.5v9M10.25 1.5v9\" />\n\t\t\t</g>\n\t\t</svg>\n\t)\n}\n\nexport function IconAgentOverlayGridRow(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\" strokeLinejoin=\"round\" strokeWidth=\"1.5\">\n\t\t\t\t<path d=\"M1.75 2.25h9M1.75 6.25h9M1.75 10.25h9\" />\n\t\t\t</g>\n\t\t</svg>\n\t)\n}\n", "import \"ButtonWithPreviewContent.styles_1qc320d.wyw.css\"; export const iconWrapperBase = \"iconWrapperBase_i1ab0gin\";\nexport const iconWrapperSurface = \"iconWrapperSurface_i19ygcxe\";\nexport const iconWrapperSurfaceStrokedIcon = \"iconWrapperSurfaceStrokedIcon_i1mqt5la\";\nexport const iconWrapperGhostSize = \"iconWrapperGhostSize_i1bkmsxp\";\nexport const iconWrapperGhostOffset = \"iconWrapperGhostOffset_i1vpcft3\";\nexport const largeIconWrapper = \"largeIconWrapper_luf63yr\";\nexport const iconWrapperDisabled = \"iconWrapperDisabled_i1hu2nje\";\nexport const titleWrapper = \"titleWrapper_teca1mf\";\nexport const titleWrapperGhost = \"titleWrapperGhost_t1ir7ssq\";\nexport const titleWrapperGhostWithoutPreview = \"titleWrapperGhostWithoutPreview_tojarwo\";\nexport const titleSpaceAfter = \"titleSpaceAfter_t13muhuh\";\nexport const titleSpaceAfterGhost = \"titleSpaceAfterGhost_t1st33qd\";\nexport const shortcutKey = \"shortcutKey_s1987j6i\";\nexport const deleteIconWrapper = \"deleteIconWrapper_ddq2za7\";\nexport const deleteIconWrapperGhost = \"deleteIconWrapperGhost_d1uunqnd\";\nexport const largeCloseWrapper = \"largeCloseWrapper_l3a42x0\";\nexport const disabled = \"disabled_d1c368t4\";\nexport const suggestion = \"suggestion_sh094ck\";", "import type React from \"react\"\n\nexport function IconCollectionFilters(props: React.SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg aria-hidden={true} 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=\"#fff\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tstrokeWidth={1.5}\n\t\t\t\td=\"M7.75 4v4M4.25 3v6M.75 1.5v9M11.25 5.5v1\"\n\t\t\t/>\n\t\t</svg>\n\t)\n}\n\nexport function IconCollectionSorting(props: React.SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg aria-hidden={true} xmlns=\"http://www.w3.org/2000/svg\" width={12} height={12} fill=\"none\" {...props}>\n\t\t\t<g fill=\"transparent\" stroke=\"#fff\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={1.5}>\n\t\t\t\t<path d=\"m1.25 7 3.439 3.439a1.5 1.5 0 0 0 2.122 0L10.25 7M5.75 10.5V1\" />\n\t\t\t</g>\n\t\t</svg>\n\t)\n}\n\nexport function IconCollectionPagination(props: React.SVGProps<SVGSVGElement>) {\n\treturn (\n\t\t<svg aria-hidden={true} xmlns=\"http://www.w3.org/2000/svg\" width={12} height={12} fill=\"none\" {...props}>\n\t\t\t<path fill=\"#fff\" d=\"M6 0a6 6 0 1 1 0 12A6 6 0 0 1 6 0M1.5 6a4.5 4.5 0 1 0 9 0 4.5 4.5 0 0 0-9 0\" opacity={0.4} />\n\t\t\t<path fill=\"#fff\" d=\"M0 6a6 6 0 0 1 6-6 .75.75 0 0 1 0 1.5 4.5 4.5 0 0 0 0 9A.75.75 0 0 1 6 12a6 6 0 0 1-6-6\" />\n\t\t</svg>\n\t)\n}\n", "import \"PopoutButtonWithPreviewSuggestion.styles_hepgjp.wyw.css\"; export const button = \"button_b11f2aom\";\nexport const readonly = \"readonly_r1ihmrto\";\nexport const title = \"title_t8942cu\";\nexport const actionIconWrapper = \"actionIconWrapper_a11ph0ck\";", "import {\n\tIconComputedValue,\n\tIconDots,\n\tIconEffect,\n\tIconFormAntispam,\n\tIconGridColumn,\n\tIconInteraction,\n\tIconLine,\n\tIconLoadMore,\n\tIconOrder,\n\tIconPlusBold,\n\tIconPopupButtonFormSelectOption,\n\tIconSizeConstraint,\n\tIconSpring,\n\tIconTextStylePreset,\n\tIconTween,\n\tIconVariableCursor,\n\tIconVariableEventHandler,\n\tIconVariableLinkRelValues,\n\tIconVariableNumber,\n\tLegacyIconVariableCursor,\n\tLegacyIconVariableEventHandler,\n\tLegacyIconVariableLinkRelValues,\n\tLegacyIconVariableNumber,\n\ttruncateWithEllipsis,\n\tuseReadOnly,\n} from \"@framerjs/fresco\"\nimport { IconTextSelection } from \"@framerjs/fresco/src/icons/IconTextSelection\"\nimport { colors } from \"@framerjs/fresco/tokens\"\nimport { assertNever } from \"@framerjs/shared\"\nimport { cx } from \"@linaria/core\"\nimport { Dictionary } from \"app/dictionary.ts\"\nimport { useExperimentIsOn } from \"app/experiments.ts\"\nimport { IconAgentEffect } from \"document/components/chrome/properties/panels/icons/IconAgentEffect.tsx\"\nimport { IconAgentInteraction } from \"document/components/chrome/properties/panels/icons/IconAgentInteraction.tsx\"\nimport { IconAgentOverlayGridColumn } from \"document/components/chrome/properties/panels/icons/IconAgentOverlayGrid.tsx\"\nimport type React from \"react\"\nimport { titleCase } from \"utils/titleCase.ts\"\nimport { doubleColumnClass } from \"../properties/utils/doubleColumn.styles.ts\"\nimport {\n\ticonWrapperBase,\n\ticonWrapperDisabled,\n\ticonWrapperSurface,\n\ticonWrapperSurfaceStrokedIcon,\n\ttitleWrapper,\n} from \"./ButtonWithPreviewContent.styles.ts\"\nimport { IconCollectionFilters, IconCollectionPagination, IconCollectionSorting } from \"./CollectionContentIcons.tsx\"\nimport { PopoutButtonBackgroundPreview } from \"./PopoutButtonBackgroundPreview.tsx\"\nimport { PopoutButtonPreviewIconWrapper } from \"./PopoutButtonPreviewIconWrapper.tsx\"\nimport * as styles from \"./PopoutButtonWithPreviewSuggestion.styles.ts\"\ninterface PopoutButtonWithPreviewSuggestionProps extends React.HTMLAttributes<HTMLDivElement> {\n\ttype:\n\t\t| \"action\"\n\t\t| \"border\"\n\t\t| \"collectionFilter\"\n\t\t| \"collectionOrder\"\n\t\t| \"collectionTableSorting\"\n\t\t| \"color\"\n\t\t| \"customCursor\"\n\t\t| \"effect\"\n\t\t| \"eventSuggestion\"\n\t\t| \"fill\"\n\t\t| \"font\"\n\t\t| \"formAntispam\"\n\t\t| \"formDestination\"\n\t\t| \"formSelectOption\"\n\t\t| \"grid-guides\"\n\t\t| \"icon\"\n\t\t| \"line\"\n\t\t| \"linkOptions\"\n\t\t| \"linkRelValues\"\n\t\t| \"mask\"\n\t\t| \"object\"\n\t\t| \"pageEffectExit\"\n\t\t| \"pagination\"\n\t\t| \"preset\"\n\t\t| \"scrollSection\"\n\t\t| \"shadow\"\n\t\t| \"sizeConstraint\"\n\t\t| \"spring\"\n\t\t| \"stringVariableOptions\"\n\t\t| \"stroke\"\n\t\t| \"textSelection\"\n\t\t| \"trigger\"\n\t\t| \"transition\"\n\t\t| \"tween\"\n\ticon?: React.ReactNode\n\ttooltipTitle?: string\n}\n\nfunction backgroundForType(type: PopoutButtonWithPreviewSuggestionProps[\"type\"]): string {\n\tswitch (type) {\n\t\tcase \"action\":\n\t\tcase \"border\":\n\t\tcase \"collectionFilter\":\n\t\tcase \"collectionOrder\":\n\t\tcase \"collectionTableSorting\":\n\t\tcase \"customCursor\":\n\t\tcase \"effect\":\n\t\tcase \"eventSuggestion\":\n\t\tcase \"font\":\n\t\tcase \"formAntispam\":\n\t\tcase \"formDestination\":\n\t\tcase \"formSelectOption\":\n\t\tcase \"grid-guides\":\n\t\tcase \"line\":\n\t\tcase \"linkOptions\":\n\t\tcase \"linkRelValues\":\n\t\tcase \"object\":\n\t\tcase \"pageEffectExit\":\n\t\tcase \"pagination\":\n\t\tcase \"preset\":\n\t\tcase \"scrollSection\":\n\t\tcase \"sizeConstraint\":\n\t\tcase \"spring\":\n\t\tcase \"stringVariableOptions\":\n\t\tcase \"textSelection\":\n\t\tcase \"transition\":\n\t\tcase \"trigger\":\n\t\tcase \"tween\":\n\t\t\treturn colors.invitePopoverSendButtonBackground\n\t\tcase \"fill\":\n\t\t\treturn colors.swatchBackgroundPlaceholderForFill\n\t\tcase \"color\":\n\t\tcase \"icon\":\n\t\tcase \"shadow\":\n\t\tcase \"stroke\":\n\t\t\treturn \"transparent\"\n\t\tcase \"mask\":\n\t\t\treturn `linear-gradient(180deg, ${colors.maskEmptyGradientStop1} 0%, ${colors.maskEmptyGradientStop2} 100%)`\n\t\tdefault:\n\t\t\tassertNever(type)\n\t}\n}\n\nfunction defaultBackgroundColorForType(type: PopoutButtonWithPreviewSuggestionProps[\"type\"]) {\n\tif (type === \"mask\") return \"transparent\"\n\treturn undefined\n}\n\nfunction title(type: PopoutButtonWithPreviewSuggestionProps[\"type\"]) {\n\tif (type === \"action\") return \"Reset\u2026\"\n\tif (type === \"pageEffectExit\") return \"Add Exit\u2026\"\n\treturn Dictionary.AddEllipsis\n}\n\nfunction getTooltipTitle(type: PopoutButtonWithPreviewSuggestionProps[\"type\"], tooltipTitle: string | undefined) {\n\tif (tooltipTitle) return tooltipTitle\n\tif (type === \"action\") return \"Reset Override\"\n\tif (type === \"eventSuggestion\") return \"Add Interaction\"\n\tif (type === \"formAntispam\") return \"Add Antispam\"\n\treturn `Add ${titleCase(type)}`\n}\n\nconst compactPreviewTypes = new Set<PopoutButtonWithPreviewSuggestionProps[\"type\"]>([\n\t\"collectionTableSorting\",\n\t\"font\",\n\t\"formDestination\",\n\t\"linkOptions\",\n\t\"stringVariableOptions\",\n])\n\nexport function PopoutButtonWithPreviewSuggestion({\n\ttype,\n\tclassName,\n\ticon,\n\ttooltipTitle,\n\t...rest\n}: PopoutButtonWithPreviewSuggestionProps) {\n\tconst isReadOnly = useReadOnly()\n\tconst agentExperimentEnabled = useExperimentIsOn(\"agent\")\n\tconst isCompactPreview = agentExperimentEnabled && compactPreviewTypes.has(type)\n\n\treturn (\n\t\t<div {...rest} className={cx(doubleColumnClass, className, isReadOnly && styles.readonly)}>\n\t\t\t<div className={styles.button} title={getTooltipTitle(type, tooltipTitle)}>\n\t\t\t\t<div\n\t\t\t\t\tclassName={cx(\n\t\t\t\t\t\ticonWrapperBase,\n\t\t\t\t\t\ticonWrapperSurface,\n\t\t\t\t\t\tisCompactPreview && iconWrapperSurfaceStrokedIcon,\n\t\t\t\t\t\tisReadOnly && iconWrapperDisabled,\n\t\t\t\t\t\t(type === \"action\" || type === \"eventSuggestion\") && styles.actionIconWrapper,\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t{icon ?? (\n\t\t\t\t\t\t<IconForType type={type} compact={isCompactPreview} agentExperimentEnabled={agentExperimentEnabled} />\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t\t<div className={cx(truncateWithEllipsis, titleWrapper, styles.title)}>{title(type)}</div>\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n\nfunction IconForType({\n\ttype,\n\tcompact,\n\tagentExperimentEnabled,\n}: Pick<PopoutButtonWithPreviewSuggestionProps, \"type\"> & { compact: boolean; agentExperimentEnabled: boolean }) {\n\tswitch (type) {\n\t\tcase \"action\":\n\t\tcase \"eventSuggestion\":\n\t\t\treturn agentExperimentEnabled ? <IconVariableEventHandler /> : <LegacyIconVariableEventHandler />\n\t\tcase \"effect\":\n\t\tcase \"pageEffectExit\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper background={backgroundForType(type)}>\n\t\t\t\t\t{agentExperimentEnabled ? <IconAgentEffect /> : <IconEffect />}\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tcase \"line\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper background={backgroundForType(type)}>\n\t\t\t\t\t<IconLine />\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tcase \"linkOptions\":\n\t\tcase \"stringVariableOptions\":\n\t\tcase \"collectionTableSorting\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper background={backgroundForType(type)} strokedIcon={compact}>\n\t\t\t\t\t<IconPlusBold compact={compact} />\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tcase \"linkRelValues\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper background={backgroundForType(type)}>\n\t\t\t\t\t{agentExperimentEnabled ? (\n\t\t\t\t\t\t<IconVariableLinkRelValues background=\"transparent\" />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<LegacyIconVariableLinkRelValues background=\"transparent\" />\n\t\t\t\t\t)}\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tcase \"grid-guides\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper background={backgroundForType(type)}>\n\t\t\t\t\t{agentExperimentEnabled ? <IconAgentOverlayGridColumn /> : <IconGridColumn />}\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tcase \"sizeConstraint\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper background={backgroundForType(type)}>\n\t\t\t\t\t<IconSizeConstraint />\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tcase \"pagination\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper background={backgroundForType(type)}>\n\t\t\t\t\t{agentExperimentEnabled ? <IconCollectionPagination /> : <IconLoadMore />}\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tcase \"collectionFilter\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper background={backgroundForType(type)} color=\"transparent\">\n\t\t\t\t\t{agentExperimentEnabled ? <IconCollectionFilters /> : <IconComputedValue />}\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tcase \"collectionOrder\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper background={backgroundForType(type)} color=\"transparent\">\n\t\t\t\t\t{agentExperimentEnabled ? <IconCollectionSorting /> : <IconOrder />}\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tcase \"spring\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper background={backgroundForType(type)}>\n\t\t\t\t\t<IconSpring />\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tcase \"tween\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper background={backgroundForType(type)}>\n\t\t\t\t\t<IconTween />\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tcase \"object\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper background={backgroundForType(type)}>\n\t\t\t\t\t<IconDots />\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tcase \"font\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper background={backgroundForType(type)} strokedIcon={compact}>\n\t\t\t\t\t<IconTextStylePreset compact={compact} />\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tcase \"scrollSection\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper color={backgroundForType(type)}>\n\t\t\t\t\t{agentExperimentEnabled ? <IconVariableNumber /> : <LegacyIconVariableNumber />}\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tcase \"customCursor\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper color={backgroundForType(type)}>\n\t\t\t\t\t{agentExperimentEnabled ? <IconVariableCursor /> : <LegacyIconVariableCursor />}\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tcase \"formDestination\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper background={backgroundForType(type)} strokedIcon={compact}>\n\t\t\t\t\t<IconPlusBold compact={compact} />\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tcase \"formAntispam\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper background={backgroundForType(type)}>\n\t\t\t\t\t<IconFormAntispam />\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tcase \"formSelectOption\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper background={backgroundForType(type)}>\n\t\t\t\t\t<IconPopupButtonFormSelectOption />\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tcase \"transition\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper background={backgroundForType(type)}>\n\t\t\t\t\t<IconTween />\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tcase \"textSelection\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper background={backgroundForType(type)}>\n\t\t\t\t\t<IconTextSelection />\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tcase \"trigger\":\n\t\t\treturn (\n\t\t\t\t<PopoutButtonPreviewIconWrapper background={backgroundForType(type)}>\n\t\t\t\t\t{agentExperimentEnabled ? <IconAgentInteraction /> : <IconInteraction />}\n\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t)\n\t\tdefault:\n\t\t\treturn (\n\t\t\t\t<PopoutButtonBackgroundPreview\n\t\t\t\t\tbackground={backgroundForType(type)}\n\t\t\t\t\tborderColor={colors.swatchBorderPlaceholder}\n\t\t\t\t\tdefaultBackgroundColor={defaultBackgroundColorForType(type)}\n\t\t\t\t/>\n\t\t\t)\n\t}\n}\n", "import { useClickHandlers } from \"@framerjs/app-shared/src/PreferMouseDown.tsx\"\nimport { IconInputClose, truncateWithEllipsis } from \"@framerjs/fresco\"\nimport type { InputVariant } from \"@framerjs/fresco/src/components/types.ts\"\nimport { cx } from \"@linaria/core\"\nimport { Dictionary } from \"app/dictionary.ts\"\nimport type React from \"react\"\nimport { useCallback, type MouseEventHandler } from \"react\"\nimport * as styles from \"./ButtonWithPreviewContent.styles.ts\"\n\nexport interface ButtonWithPreviewContentProps {\n\t/**\n\t * Content of the button.\n\t *\n\t * Note: string vs React.ReactNode have different behaviors; string gets wrapped with\n\t * `truncateWithEllipsis` automatically, but React.ReactNode does not. If you pass a\n\t * React.ReactNode, you\u2019re responsible for ensuring it\u2019s truncated correctly.\n\t */\n\ttitle: string | React.ReactNode\n\ttitleColor?: string\n\tdeleteIconColor?: string\n\tswatchBackgroundColor?: string\n\tpreview?: React.ReactNode\n\tpreviewWithoutWrapper?: boolean\n\tstrokedIconPreview?: boolean\n\tsuggestion?: boolean\n\tenabled?: boolean\n\tlarge?: boolean\n\tonDelete?: (event: React.MouseEvent | React.KeyboardEvent | undefined) => void\n\tdeleteTitle?: string\n\tshortcutKey?: string\n\tvariant?: InputVariant\n}\n\nexport const ButtonWithPreviewContent = ({\n\tenabled,\n\tlarge,\n\tvariant = \"default\",\n\ttitle,\n\ttitleColor,\n\tshortcutKey,\n\tpreview,\n\tpreviewWithoutWrapper = false,\n\tstrokedIconPreview,\n\tdeleteIconColor,\n\tswatchBackgroundColor,\n\tsuggestion,\n\tonDelete,\n\tdeleteTitle = Dictionary.Remove,\n}: ButtonWithPreviewContentProps) => {\n\tconst onClickDelete = useCallback(\n\t\t(event: React.MouseEvent) => {\n\t\t\tevent.stopPropagation() // Cancel opening of the popout\n\t\t\tonDelete?.(event)\n\t\t},\n\t\t[onDelete],\n\t)\n\tconst deleteClickHandlers = useClickHandlers(onClickDelete)\n\tconst handleDeleteMouseDown: MouseEventHandler<HTMLDivElement> = useCallback(\n\t\tevent => {\n\t\t\tevent.stopPropagation()\n\t\t\tdeleteClickHandlers.onMouseDown?.(event)\n\t\t},\n\t\t[deleteClickHandlers],\n\t)\n\tconst handleDeleteClick: MouseEventHandler<HTMLDivElement> = useCallback(\n\t\tevent => {\n\t\t\tevent.stopPropagation()\n\t\t\tdeleteClickHandlers.onClick?.(event)\n\t\t},\n\t\t[deleteClickHandlers],\n\t)\n\n\treturn (\n\t\t<>\n\t\t\t{!!preview && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={cx(\n\t\t\t\t\t\tstyles.iconWrapperBase,\n\t\t\t\t\t\t!previewWithoutWrapper && styles.iconWrapperSurface,\n\t\t\t\t\t\t!previewWithoutWrapper && strokedIconPreview && styles.iconWrapperSurfaceStrokedIcon,\n\t\t\t\t\t\t!previewWithoutWrapper && large && styles.largeIconWrapper,\n\t\t\t\t\t\tvariant === \"ghost\" && styles.iconWrapperGhostOffset,\n\t\t\t\t\t\tvariant === \"ghost\" && !previewWithoutWrapper && styles.iconWrapperGhostSize,\n\t\t\t\t\t\tenabled === false && styles.disabled,\n\t\t\t\t\t)}\n\t\t\t\t\tstyle={previewWithoutWrapper ? undefined : { backgroundColor: swatchBackgroundColor }}\n\t\t\t\t>\n\t\t\t\t\t{preview}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t<div\n\t\t\t\tclassName={cx(\n\t\t\t\t\tstyles.titleWrapper,\n\t\t\t\t\tvariant === \"ghost\" && styles.titleWrapperGhost,\n\t\t\t\t\t!preview && variant === \"ghost\" && styles.titleWrapperGhostWithoutPreview,\n\t\t\t\t\tenabled === false && styles.disabled,\n\t\t\t\t\tsuggestion && styles.suggestion,\n\t\t\t\t\t// When `onDelete` is defined, the delete icon plays a role of a spacer in the end of the button.\n\t\t\t\t\t// When it\u2019s not, we put a custom space after the title to prevent the content\n\t\t\t\t\t// from going all the way to the edge of the button.\n\t\t\t\t\t!onDelete && styles.titleSpaceAfter,\n\t\t\t\t\t!onDelete && variant === \"ghost\" && styles.titleSpaceAfterGhost,\n\t\t\t\t)}\n\t\t\t\tstyle={{ color: titleColor }}\n\t\t\t>\n\t\t\t\t{/* When the title is a string (the majority of cases), truncate it automatically.\n                    When it\u2019s not, assume the developer wants a more complex layout and knows what they\u2019re doing \u2013\n                    and inline the title as-is to preserve the titleWrapper\u2019s display: flex layout. */}\n\t\t\t\t{typeof title === \"string\" ? <span className={truncateWithEllipsis}>{title}</span> : title}\n\t\t\t\t{shortcutKey && <span className={styles.shortcutKey}>&nbsp;({shortcutKey})</span>}\n\t\t\t</div>\n\t\t\t{onDelete && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={cx(\n\t\t\t\t\t\tstyles.deleteIconWrapper,\n\t\t\t\t\t\tlarge && styles.largeCloseWrapper,\n\t\t\t\t\t\tvariant === \"ghost\" && styles.deleteIconWrapperGhost,\n\t\t\t\t\t)}\n\t\t\t\t\t{...{ onMouseDown: handleDeleteMouseDown, onClick: handleDeleteClick }}\n\t\t\t\t\tstyle={{ color: deleteIconColor }}\n\t\t\t\t\ttitle={deleteTitle}\n\t\t\t\t>\n\t\t\t\t\t<IconInputClose />\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</>\n\t)\n}\n", "import \"PopoutButtonWithPreview.styles_7dzgwa.wyw.css\"; export const button = \"button_bwfcdld\";\nexport const buttonLarge = \"buttonLarge_b4uva9g\";\nexport const buttonGhost = \"buttonGhost_b1xdslsy\";\nexport const disabled = \"disabled_dpa1954\";\nexport const disabledWrapper = \"disabledWrapper_d2o7xqw\";", "import { useReadOnly } from \"@framerjs/fresco\"\nimport type { AttachmentEdge, AttachmentEdgePreferences } from \"@framerjs/fresco/src/components/Popover\"\nimport type { InputVariant } from \"@framerjs/fresco/src/components/types.ts\"\nimport { cx } from \"@linaria/core\"\nimport type { Point } from \"library/render/types/Point.ts\"\nimport type React from \"react\"\nimport { doubleColumnClass, doubleColumnClassForSortable } from \"../properties/utils/doubleColumn.styles.ts\"\nimport type { ButtonWithPreviewContentProps } from \"./ButtonWithPreviewContent.tsx\"\nimport { ButtonWithPreviewContent } from \"./ButtonWithPreviewContent.tsx\"\nimport { PopoutButton } from \"./PopoutButton.tsx\"\nimport * as styles from \"./PopoutButtonWithPreview.styles.ts\"\nimport type { PopoutId } from \"./PopoutNavigation.tsx\"\n\nexport interface PopoutButtonWithPreviewProps extends ButtonWithPreviewContentProps {\n\tpopout: React.ReactElement\n\tnavigationTitle: React.ReactNode\n\n\tnavigationClassName?: string\n\tclassName?: string\n\tdoubleColumn?: boolean\n\tsortable?: boolean\n\n\tdisplayDivider?: boolean\n\tdisplayInPopover?: boolean\n\tautoFocusInside?: boolean\n\tpopoverAttachmentEdge?: AttachmentEdge | AttachmentEdgePreferences\n\tpopoverOffset?: Point\n\tfallbackToModalAppearance?: boolean\n\tshowArrow?: boolean\n\tid?: PopoutId\n\ttestId?: string\n\n\teducationTooltipId?: string\n\teducationText?: string\n\tonClickEducation?: () => void\n\tonContextMenu?: (event: React.MouseEvent) => void\n\n\tonBeforePresent?: () => boolean\n\tonPresent?: () => void\n\tonDismiss?: () => void\n\tvariant?: InputVariant\n}\n\nexport function PopoutButtonWithPreview({\n\tid,\n\ttestId,\n\tpopout,\n\tnavigationTitle,\n\tnavigationClassName,\n\tenabled,\n\tdisplayDivider,\n\tdisplayInPopover,\n\tpopoverAttachmentEdge,\n\tpopoverOffset,\n\tshowArrow,\n\tfallbackToModalAppearance,\n\ttitle,\n\tshortcutKey,\n\tpreview,\n\tpreviewWithoutWrapper,\n\tstrokedIconPreview,\n\tsuggestion,\n\tonDelete,\n\tonBeforePresent,\n\tonPresent,\n\tonDismiss,\n\tclassName,\n\tdoubleColumn = true,\n\tsortable = false,\n\tlarge = false,\n\tvariant = \"default\",\n\ttitleColor,\n\tdeleteTitle,\n\tdeleteIconColor,\n\tswatchBackgroundColor,\n\teducationTooltipId,\n\teducationText,\n\tonClickEducation,\n\tonContextMenu,\n\tautoFocusInside,\n}: PopoutButtonWithPreviewProps) {\n\tconst isReadOnly = useReadOnly()\n\n\tconst onKeyDown = (event: React.KeyboardEvent) => {\n\t\tif (event.key === \"Delete\") onDelete?.(event)\n\t}\n\n\treturn (\n\t\t<PopoutButton\n\t\t\tid={id}\n\t\t\tlarge={large}\n\t\t\tenabled={enabled}\n\t\t\tpopout={popout}\n\t\t\tnavigationTitle={navigationTitle}\n\t\t\tnavigationClassName={navigationClassName}\n\t\t\tdisplayDivider={displayDivider}\n\t\t\tdisplayInPopover={displayInPopover}\n\t\t\tautoFocusInside={autoFocusInside}\n\t\t\tpopoverAttachmentEdge={popoverAttachmentEdge}\n\t\t\tpopoverOffset={popoverOffset}\n\t\t\tshowArrow={showArrow}\n\t\t\tfallbackToModalAppearance={fallbackToModalAppearance}\n\t\t\tonBeforePresent={onBeforePresent}\n\t\t\tclassName={cx(\n\t\t\t\tstyles.button,\n\t\t\t\tlarge && styles.buttonLarge,\n\t\t\t\tvariant === \"ghost\" && styles.buttonGhost,\n\t\t\t\tdoubleColumn && doubleColumnClass,\n\t\t\t\tsortable && doubleColumnClassForSortable,\n\t\t\t\tenabled === false && styles.disabledWrapper,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tonContextMenu={onContextMenu}\n\t\t\tonKeyDown={onKeyDown}\n\t\t\tonPresent={onPresent}\n\t\t\tonDismiss={onDismiss}\n\t\t\teducationTooltipId={educationTooltipId}\n\t\t\teducationText={educationText}\n\t\t\tonClickEducation={onClickEducation}\n\t\t\tdata-testid={testId}\n\t\t>\n\t\t\t<ButtonWithPreviewContent\n\t\t\t\tvariant={variant}\n\t\t\t\ttitle={title}\n\t\t\t\ttitleColor={titleColor}\n\t\t\t\tdeleteIconColor={deleteIconColor}\n\t\t\t\tswatchBackgroundColor={swatchBackgroundColor}\n\t\t\t\tpreview={preview}\n\t\t\t\tpreviewWithoutWrapper={previewWithoutWrapper}\n\t\t\t\tstrokedIconPreview={strokedIconPreview}\n\t\t\t\tsuggestion={suggestion}\n\t\t\t\tenabled={enabled}\n\t\t\t\tlarge={large}\n\t\t\t\tshortcutKey={shortcutKey}\n\t\t\t\tdeleteTitle={deleteTitle}\n\t\t\t\tonDelete={isReadOnly ? undefined : onDelete}\n\t\t\t/>\n\t\t</PopoutButton>\n\t)\n}\n", "import type { AppAction } from \"app/AppActions.ts\"\nimport { dispatchAction } from \"document/components/actions/ActionResponder.tsx\"\nimport { useCallback, useEffect } from \"react\"\nimport { isCopyTextEvent } from \"utils/clipboard/index.ts\"\nimport { record } from \"web/lib/tracker.ts\"\nimport type { KeyBindings } from \"./KeyBindings.ts\"\nimport { keyboardEventToBrowserAccelerator } from \"./KeyBindings.ts\"\n\ninterface Parameters {\n\tglobalKeyBindings: KeyBindings\n}\n\ntype PasteHandler = (event: ClipboardEvent) => Promise<void>\ntype CopyAndCutHandler = (event: ClipboardEvent) => Promise<void>\n// \u201CStack\u201D of overrides, last one wins and is the first element in the array\nlet pasteHandlerOverrides: PasteHandler[] = []\nlet copyAndCutHandlerOverrides: CopyAndCutHandler[] = []\n\n/**\n * Inject a paste handler into the global handlers. Multiple handlers can be\n * active and will be tried in reverse order of how they were added.\n *\n * @param handler If a handler calls `event.preventDefault()` processing will stop, else all will be tried\n */\nexport function usePasteHandler(handler: PasteHandler) {\n\tuseEffect(() => {\n\t\tpasteHandlerOverrides = [handler, ...pasteHandlerOverrides]\n\t\treturn () => {\n\t\t\tpasteHandlerOverrides = pasteHandlerOverrides.filter(h => h !== handler)\n\t\t}\n\t}, [handler])\n}\n\n/**\n * Inject a copy / cut handler into the global handlers. Multiple handlers can be active and will\n * be tried in reverse order of how they were added.\n *\n * @param handler If a handler calls `event.preventDefault()` processing will stop, else all will be tried\n */\nexport function useCopyAndCutHandler(handler: CopyAndCutHandler) {\n\tuseEffect(() => {\n\t\tcopyAndCutHandlerOverrides = [handler, ...copyAndCutHandlerOverrides]\n\t\treturn () => {\n\t\t\tcopyAndCutHandlerOverrides = copyAndCutHandlerOverrides.filter(h => h !== handler)\n\t\t}\n\t}, [handler])\n}\n\nexport function useWindowEventListeners({ globalKeyBindings }: Parameters) {\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent) => {\n\t\t\tconst entry = globalKeyBindings.get(event)\n\t\t\tif (!entry) return\n\t\t\trecord(\"keyboard_shortcut\", { shortcut: keyboardEventToBrowserAccelerator(event) })\n\t\t\tentry.action(event)\n\t\t},\n\t\t[globalKeyBindings],\n\t)\n\n\tconst handleCopyAndCut = useCallback(async (event: ClipboardEvent) => {\n\t\tif (isCopyTextEvent(event)) return\n\t\tif (!event.clipboardData) return\n\n\t\tfor (const handler of copyAndCutHandlerOverrides) {\n\t\t\tawait handler(event)\n\t\t\tif (event.defaultPrevented) return\n\t\t}\n\n\t\tdispatchAction(event.type as AppAction, { event })\n\t}, [])\n\n\tconst handlePaste = useCallback(async (event: ClipboardEvent) => {\n\t\tif (event.defaultPrevented) return\n\n\t\tfor (const handler of pasteHandlerOverrides) {\n\t\t\tawait handler(event)\n\t\t\tif (event.defaultPrevented) return\n\t\t}\n\n\t\tdispatchAction(event.type as AppAction, { event })\n\t}, [])\n\n\tuseEffect(() => {\n\t\twindow.addEventListener(\"keydown\", handleKeyDown)\n\t\twindow.addEventListener(\"copy\", handleCopyAndCut, true)\n\t\twindow.addEventListener(\"cut\", handleCopyAndCut, true)\n\t\twindow.addEventListener(\"paste\", handlePaste, true)\n\t\twindow.addEventListener(\"wheel\", preventBrowserWheelZoom, { passive: false })\n\t\twindow.addEventListener(\"touchmove\", preventBrowserZoom, { passive: false })\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener(\"keydown\", handleKeyDown)\n\t\t\twindow.removeEventListener(\"copy\", handleCopyAndCut, true)\n\t\t\twindow.removeEventListener(\"cut\", handleCopyAndCut, true)\n\t\t\twindow.removeEventListener(\"paste\", handlePaste, true)\n\t\t\twindow.removeEventListener(\"wheel\", preventBrowserWheelZoom)\n\t\t\twindow.removeEventListener(\"touchmove\", preventBrowserZoom)\n\t\t}\n\t}, [handleKeyDown, handlePaste, handleCopyAndCut])\n}\n\n// Utility functions\n\nfunction preventBrowserZoom(e: TouchEvent) {\n\t/* eslint-disable framer-studio/tscompat -- The error is a 'gray-positive', because it's not supported by Safari desktop (but is by Safari on iOS) -- doesn't matter here. */\n\tif (e.touches.length > 1) {\n\t\te.preventDefault()\n\t\te.stopPropagation()\n\t}\n\t/* eslint-enable framer-studio/tscompat */\n}\n\n/** Prevent browser pinch zoom in Chrome/Firefox. In Safari, pinch zooming on the chrome propagates to the canvas. */\nfunction preventBrowserWheelZoom(event: WheelEvent) {\n\tif (!event.defaultPrevented && event.ctrlKey) event.preventDefault()\n}\n", "import type { P3Color } from \"library/render/types/Color/Color.ts\"\n\nconst leadingZeroRegex = /^0(?=\\.)/u\nfunction p3ChannelString(value: number) {\n\t// Turn 0 into 0, 1 into 1, 0.01 into .01, 0.5 into .5, etc.\n\treturn (Math.trunc(value * 100) / 100).toString().replace(leadingZeroRegex, \"\")\n}\n\nexport function p3AlphaString(value: number = 1) {\n\tif (value === 0) return \"0\"\n\tif (value === 1) return \"1.0\"\n\tconst percentage = value * 100\n\t// Include trailing zeros for visual balance.\n\tif (percentage % 10 === 0) return `.${percentage}`\n\treturn p3ChannelString(value)\n}\n\nexport function p3TitleString(color: P3Color) {\n\tconst r = p3ChannelString(color.r)\n\tconst g = p3ChannelString(color.g)\n\tconst b = p3ChannelString(color.b)\n\treturn `${r}, ${g}, ${b}`\n}\n", "import { Dictionary } from \"app/dictionary.ts\"\nimport type { BaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport type { Reduced } from \"document/models/CanvasTree/traits/utils/Reduced.ts\"\nimport { isNotFound } from \"document/models/CanvasTree/traits/utils/Reduced.ts\"\nimport { findTokenNode } from \"document/models/CanvasTree/utils/findTokenNode.ts\"\nimport {\n\tfallbackValueFromCSSVariable,\n\tisTokenCSSVariable,\n\ttokenIdFromCSSVariable,\n} from \"document/models/CanvasTree/utils/tokens.ts\"\nimport { isConicGradient } from \"document/models/ConicGradientClass.ts\"\nimport { isLinearGradient } from \"document/models/LinearGradientClass.ts\"\nimport { isRadialGradient } from \"document/models/RadialGradientClass.ts\"\nimport { clamp } from \"framer-motion\"\nimport type { LinearGradient, RadialGradient } from \"library/index.ts\"\nimport { P3Color } from \"library/render/types/Color/Color.ts\"\nimport { Color } from \"library/render/types/Color/index.ts\"\nimport { isString, isUndefined } from \"utils/typeChecks.ts\"\nimport { toast } from \"web/lib/toaster.ts\"\nimport { p3AlphaString, p3TitleString } from \"./p3.ts\"\n\nexport function matchTokenName(tokenName: string, searchTerm: string) {\n\tif (!searchTerm) return true\n\n\tconst normalizedTokenName = tokenName.toLocaleLowerCase()\n\tconst normalizedSearchTermParts = searchTerm.trim().toLocaleLowerCase().split(\" \")\n\n\tfor (const part of normalizedSearchTermParts) {\n\t\tif (!normalizedTokenName.includes(part)) return false\n\t}\n\treturn true\n}\n\nexport const decimalToRoundedAndClampedPercentage = (value: number) => {\n\treturn clamp(0, 100, Math.round(value * 100))\n}\n\nexport const showOpacityWarningToast = () => {\n\ttoast({\n\t\ttype: \"add\",\n\t\tvariant: \"info\",\n\t\ticon: \"color-wheel\",\n\t\tprimaryText: \"Increase color opacity\",\n\t\tsecondaryText: \"to see changes.\",\n\t\tkey: \"color-change-null-opacity\",\n\t\tduration: 300,\n\t})\n}\n\nexport function colorFillDisplayValue(\n\tvalue: Reduced<string | LinearGradient | RadialGradient | undefined>,\n\tengine: BaseEngine,\n\temptyLabel?: string,\n): { title: string; alpha?: number | string } {\n\tif (isNotFound(value) || isUndefined(value)) return { title: emptyLabel || Dictionary.AddEllipsis }\n\tif (isLinearGradient(value)) return { title: Dictionary.Linear }\n\tif (isRadialGradient(value)) return { title: Dictionary.Radial }\n\tif (isConicGradient(value)) return { title: Dictionary.Conic }\n\tif (!isString(value) || value === \"\") return { title: Dictionary.Mixed }\n\n\tif (isTokenCSSVariable(value)) {\n\t\tconst tokenId = tokenIdFromCSSVariable(value)\n\t\tconst token = tokenId ? findTokenNode(tokenId, engine.tree) : null\n\t\tif (token && !token.softDeleted) {\n\t\t\treturn { title: token.name }\n\t\t} else {\n\t\t\tconst fallbackValue = token?.light ?? fallbackValueFromCSSVariable(value)\n\t\t\tif (!fallbackValue) return { title: Dictionary.Unknown }\n\t\t\tvalue = fallbackValue\n\t\t}\n\t}\n\n\tif (Color.isP3String(value)) {\n\t\tconst color = P3Color.fromString(value)\n\t\tif (!color) return { title: Dictionary.Unknown }\n\t\treturn { title: p3TitleString(color), alpha: p3AlphaString(color.a) }\n\t}\n\n\tconst color = typeof value === \"string\" ? Color(value) : null\n\tif (color) return { title: Color.toHex(color).toUpperCase(), alpha: color.a ?? 1 }\n\n\treturn { title: Dictionary.Unknown }\n}\n", "import { EngineChange } from \"document/EngineChanges.ts\"\nimport { useBaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport { useDeprecatedEngineState } from \"document/useDeprecatedEngineState.ts\"\n\n/**\n * Changes whenever new assets become available from the asset service.\n * Can be used to trigger re-renders of images in the UI.\n */\nexport function useAssetMapHash(): number {\n\tconst engine = useBaseEngine()\n\n\treturn useDeprecatedEngineState([EngineChange.AssetMap], () => {\n\t\treturn engine.stores.assetStore.assetMap.hash\n\t})\n}\n", "import { getAssetResolver } from \"renderer/getAssetResolver.ts\"\n\nexport function resolveImage(identifier: string): string {\n\tconst assetResolver = getAssetResolver()\n\tif (!assetResolver) return identifier\n\t// Use the smallest available preview size\n\tconst resolvedAsset = assetResolver(identifier, { preferredSize: \"small\" })\n\tif (!resolvedAsset) return identifier\n\treturn resolvedAsset\n}\n", "import { useAssetMapHash } from \"../chrome/properties/utils/useAssetMapHash.ts\"\nimport { resolveImage } from \"./resolveImage.ts\"\n\ntype MaybeString = string | undefined\n\nexport function useResolvedImageThumbnailUrl<Value extends MaybeString, Fallback>(\n\tidentifier: Value,\n\tfallback: Fallback,\n): Value extends string ? string : Fallback\nexport function useResolvedImageThumbnailUrl<Value extends MaybeString>(\n\tidentifier: Value,\n): Value extends string ? string : undefined\nexport function useResolvedImageThumbnailUrl<Value extends MaybeString, Fallback = undefined>(\n\tidentifier: Value,\n\tfallback?: Fallback,\n): MaybeString | Fallback {\n\t// Force re-render when asset update comes in\n\tuseAssetMapHash()\n\treturn identifier ? resolveImage(identifier) : fallback\n}\n\nexport function useResolvedImageThumbnail<Value extends MaybeString, Fallback>(\n\tidentifier: Value,\n\tfallback: Fallback,\n): Value extends string ? string : Fallback\nexport function useResolvedImageThumbnail<Value extends MaybeString>(\n\tidentifier: Value,\n): Value extends string ? string : undefined\nexport function useResolvedImageThumbnail<Value extends MaybeString, Fallback = undefined>(\n\tidentifier: Value,\n\tfallback?: Fallback,\n): MaybeString | Fallback {\n\tconst imageUrl = useResolvedImageThumbnailUrl(identifier)\n\treturn imageUrl ? `url(\"${imageUrl}\")` : fallback\n}\n", "import { getLogger } from \"@framerjs/shared\"\nimport React from \"react\"\n\n// Hack to expose the preview iframe's API globally for use in keyboard\n// shortcuts and other components which don't have easy access to the preview\n// iframe (e.g., the project bar).\n\nexport interface GlobalPreviewHandlers {\n\treload(): void\n\ttoggleConsole(): void\n\topenFullScreen(): void\n}\n\nlet globalPreviewHandlersOverrides: Partial<GlobalPreviewHandlers> | null = null\n\nconst log = getLogger(\"globalPreviewHandlers\")\nfunction warn(handler: string) {\n\tlog.warn(\"Missing handler\", handler)\n}\n\nconst globalPreviewHandlers: GlobalPreviewHandlers = {\n\treload: () => {\n\t\tif (globalPreviewHandlersOverrides?.reload) {\n\t\t\tglobalPreviewHandlersOverrides.reload()\n\t\t} else {\n\t\t\twarn(\"reload\")\n\t\t}\n\t},\n\ttoggleConsole: () => {\n\t\tif (globalPreviewHandlersOverrides?.toggleConsole) {\n\t\t\tglobalPreviewHandlersOverrides.toggleConsole()\n\t\t} else {\n\t\t\twarn(\"toggleConsole\")\n\t\t}\n\t},\n\topenFullScreen: () => {\n\t\tif (globalPreviewHandlersOverrides?.openFullScreen) {\n\t\t\tglobalPreviewHandlersOverrides.openFullScreen()\n\t\t} else {\n\t\t\twarn(\"openFullScreen\")\n\t\t}\n\t},\n}\n\nfunction setGlobalPreviewHandlers(obj: Partial<GlobalPreviewHandlers> | null) {\n\tif (obj === null) {\n\t\tglobalPreviewHandlersOverrides = obj\n\t\treturn\n\t}\n\tglobalPreviewHandlersOverrides ??= {}\n\tObject.assign(globalPreviewHandlersOverrides, obj)\n}\n\nexport function getGlobalPreviewHandlers(): GlobalPreviewHandlers {\n\treturn globalPreviewHandlers\n}\n\nexport function useGlobalPreviewHandlers({ reload, toggleConsole, openFullScreen }: Partial<GlobalPreviewHandlers>) {\n\tReact.useEffect(() => {\n\t\tsetGlobalPreviewHandlers({\n\t\t\treload,\n\t\t\ttoggleConsole,\n\t\t\topenFullScreen,\n\t\t})\n\t\treturn () => setGlobalPreviewHandlers(null)\n\t}, [reload, toggleConsole, openFullScreen])\n}\n", "import type { NotFound } from \"./Reduced.ts\"\nimport { isNotFound } from \"./Reduced.ts\"\n\nexport function notFoundToUndefined<T>(value: T | NotFound): T | undefined {\n\treturn isNotFound(value) ? undefined : value\n}\n", "import type { AssetSize } from \"@framerjs/assets\"\nimport { Stack } from \"@framerjs/fresco\"\nimport { dimensions } from \"@framerjs/fresco/tokens\"\nimport { useBaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport type { AllOrNothing } from \"document/models/CanvasTree/traits/utils/AllOrNothing.ts\"\nimport { NotFound } from \"document/models/CanvasTree/traits/utils/Reduced.ts\"\nimport type { WithControlFocalPoint } from \"document/models/controlProps/WithControlFocalPoint.ts\"\nimport { ModalType } from \"document/utils/ModalType.ts\"\nimport type { RelativeNumber } from \"library/index.ts\"\nimport { useCallback, useMemo } from \"react\"\nimport { batchUploadImages } from \"web/lib/batchUploaderUtils.tsx\"\nimport type { ImageUploadResult } from \"web/pages/project/lib/UploadService.ts\"\nimport type { AltTextProps } from \"./ImagePicker.tsx\"\nimport { ImagePicker } from \"./ImagePicker.tsx\"\n\nexport type ImagePopoutProps = AllOrNothing<AltTextProps> &\n\tWithControlFocalPoint & {\n\t\taltTextPlaceholder?: string\n\t\timageReference: string | undefined\n\t\tonChange: (imageUpload: Promise<ImageUploadResult[]>) => void\n\t\tonChangeAssetSize: (size: AssetSize) => void\n\t\tonRemoveImage?: () => void\n\t\tmultiple?: boolean\n\t\tmaxExtraImages?: number\n\t\tonChangeFocalPosition?: (focalPointX: RelativeNumber | undefined, focalPointY: RelativeNumber | undefined) => void\n\t\tenableFooter?: boolean\n\t}\n\nexport function ImagePopout({\n\tmultiple = false,\n\timageReference,\n\tonChange,\n\tonChangeAssetSize,\n\taltText = NotFound,\n\taltTextPlaceholder,\n\tonChangeAltText,\n\tonRemoveImage,\n\tpositionX,\n\tpositionY,\n\tonChangeFocalPosition,\n\tmaxExtraImages,\n\tenableFooter = true,\n}: ImagePopoutProps) {\n\tconst engine = useBaseEngine()\n\n\tconst onImageBatchUpload = useCallback(\n\t\t(files: FileList | File[], maxUploads?: number) => batchUploadImages(engine, files, maxUploads),\n\t\t[],\n\t)\n\tconst onCropClick = useCallback(\n\t\t(image: string) => {\n\t\t\tengine.stores.modalStore.push({\n\t\t\t\ttype: ModalType.ImageCrop,\n\t\t\t\tinitialImage: image,\n\t\t\t\tonChange: onChange,\n\t\t\t\tsource: \"image_picker\",\n\t\t\t})\n\t\t},\n\t\t[onChange],\n\t)\n\tconst onEditFocalPoint = useMemo(() => {\n\t\tif (!onChangeFocalPosition) return undefined\n\n\t\treturn (\n\t\t\timage: string,\n\t\t\tcurrentPositionX: RelativeNumber | undefined,\n\t\t\tcurrentPositionY: RelativeNumber | undefined,\n\t\t) => {\n\t\t\tengine.stores.modalStore.push({\n\t\t\t\ttype: ModalType.ImageFocalPoint,\n\t\t\t\timage,\n\t\t\t\tpositionX: currentPositionX,\n\t\t\t\tpositionY: currentPositionY,\n\t\t\t\tonChange: onChangeFocalPosition,\n\t\t\t\tsource: \"properties\",\n\t\t\t})\n\t\t}\n\t}, [onChangeFocalPosition])\n\n\tconst clearFocalPoint = useMemo(() => {\n\t\tif (!onChangeFocalPosition) return undefined\n\n\t\treturn () => {\n\t\t\tonChangeFocalPosition(undefined, undefined)\n\t\t}\n\t}, [onChangeFocalPosition])\n\n\treturn (\n\t\t<Stack padding={`0 ${dimensions.css.popoverPadding} ${dimensions.css.popoverPadding}`}>\n\t\t\t<ImagePicker\n\t\t\t\tmultiple={multiple}\n\t\t\t\tmaxExtraImages={maxExtraImages}\n\t\t\t\timageReferences={imageReference ? [imageReference] : []}\n\t\t\t\tonChangeImages={onChange}\n\t\t\t\tonChangeAssetSize={onChangeAssetSize}\n\t\t\t\taltText={altText}\n\t\t\t\taltTextPlaceholder={altTextPlaceholder}\n\t\t\t\tonChangeAltText={onChangeAltText}\n\t\t\t\tonRemoveImage={onRemoveImage}\n\t\t\t\tpositionX={positionX}\n\t\t\t\tpositionY={positionY}\n\t\t\t\tonImageBatchUpload={onImageBatchUpload}\n\t\t\t\tonCropClick={onCropClick}\n\t\t\t\tonEditFocalPoint={onEditFocalPoint}\n\t\t\t\tclearFocalPoint={clearFocalPoint}\n\t\t\t\tenableFooter={enableFooter}\n\t\t\t/>\n\t\t</Stack>\n\t)\n}\n", "import type { AssetSize } from \"@framerjs/assets\"\nimport { parseAssetReference, splitExtension } from \"@framerjs/assets\"\nimport {\n\tButton,\n\tFileDropZone,\n\tIconFocalPoint,\n\tPopupButton,\n\tPopupButtonItem,\n\tStack,\n\tTextInput,\n\tuseReadOnly,\n} from \"@framerjs/fresco\"\nimport { colors } from \"@framerjs/fresco/src/tokens\"\nimport { assert, isMixed } from \"@framerjs/shared\"\nimport { noop } from \"@framerjs/shared/src/noop.ts\"\nimport { cx } from \"@linaria/core\"\nimport { Dictionary } from \"app/dictionary.ts\"\nimport { useBaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport { resolveImage } from \"document/components/utils/resolveImage.ts\"\nimport type { AllOrNothing } from \"document/models/CanvasTree/traits/utils/AllOrNothing.ts\"\nimport type { Reduced } from \"document/models/CanvasTree/traits/utils/Reduced.ts\"\nimport { NotFound, isFound } from \"document/models/CanvasTree/traits/utils/Reduced.ts\"\nimport type { WithControlFocalPoint } from \"document/models/controlProps/WithControlFocalPoint.ts\"\nimport type { RelativeNumber } from \"library/render/types/RelativeNumber.ts\"\nimport { isRelativeNumber } from \"library/render/types/RelativeNumber.ts\"\nimport React from \"react\"\nimport { commonValue } from \"utils/commonValue.ts\"\nimport { isNumber, isString, isUndefined } from \"utils/typeChecks.ts\"\nimport { record } from \"web/lib/tracker.ts\"\nimport { chooseFileService } from \"web/pages/project/lib/ChooseFileService.ts\"\nimport type { ImageUploadResult, ImageUploadResultWithOptionalAssetSize } from \"web/pages/project/lib/UploadService.ts\"\nimport { usePasteHandler } from \"web/pages/project/lib/useWindowEventListeners.ts\"\nimport { PanelRowView } from \"../properties/rows/PanelRowView.tsx\"\nimport { stopPropagation } from \"../properties/rows/utils/stopPropagation.ts\"\nimport { doubleColumnClass } from \"../properties/utils/doubleColumn.styles.ts\"\nimport { ButtonWithPreview } from \"./ButtonWithPreview.tsx\"\nimport * as styles from \"./ImagePicker.styles.ts\"\nimport { useImagePluginPickerButton } from \"./ImagePluginPickerButtonContext.tsx\"\nimport { PopoutButtonPreviewIconWrapper } from \"./PopoutButtonPreviewIconWrapper.tsx\"\n\n/** Alt text input only visible when altText and onChangeAltText are defined. */\nexport interface AltTextProps {\n\taltText: Reduced<string>\n\tonChangeAltText: ((altText: string) => void) | undefined\n}\n\ntype OnChangeImages = (imageUpload: Promise<ImageUploadResultWithOptionalAssetSize[]>) => void\n\ntype Props = AllOrNothing<AltTextProps> &\n\tWithControlFocalPoint & {\n\t\taltTextPlaceholder?: string\n\t\timageReferences: string[]\n\t\tonChangeImages: OnChangeImages\n\t\tonRemoveImage?: () => void\n\t\tonChangeAssetSize?: (assetSize: AssetSize) => void\n\t\t/** Inserted between image size and image upload options */\n\t\textraControls?: JSX.Element\n\t\tenableFooter?: boolean\n\t\tmultiple?: boolean\n\t\tmaxExtraImages?: number\n\t\tonEditFocalPoint?: (\n\t\t\timageReference: string,\n\t\t\tcurrentFocalPointX: RelativeNumber | undefined,\n\t\t\tcurrentFocalPointY: RelativeNumber | undefined,\n\t\t) => void\n\t\tclearFocalPoint?: () => void\n\t\tonCropClick?: (imageReference: string, onChange: OnChangeImages) => void\n\t\tonImageBatchUpload: (files: FileList | File[], maxUploads?: number) => Promise<ImageUploadResult[]>\n\t}\n\nconst preferredSizeOptions: AssetSize[] = [\"auto\", \"lossless\", \"small\", \"medium\", \"large\", \"full\"]\nconst preferredSizeTitles: Record<AssetSize, string> = {\n\tauto: Dictionary.Auto,\n\tlossless: \"Auto (Lossless)\",\n\tsmall: \"Small\",\n\tmedium: \"Medium\",\n\tlarge: \"Large\",\n\tfull: \"Full\",\n}\n\nexport function ImagePicker({\n\tmultiple = false,\n\timageReferences,\n\tonChangeImages,\n\tonRemoveImage,\n\tonChangeAssetSize,\n\textraControls,\n\taltText = NotFound,\n\taltTextPlaceholder,\n\tonChangeAltText,\n\tpositionX,\n\tpositionY,\n\tenableFooter = true,\n\tmaxExtraImages,\n\tonEditFocalPoint,\n\tclearFocalPoint,\n\tonCropClick,\n\tonImageBatchUpload,\n}: Props) {\n\tconst engine = useBaseEngine()\n\tconst PluginPickerButton = useImagePluginPickerButton()\n\n\tconst isReadOnly = useReadOnly()\n\tconst maxUploads = isNumber(maxExtraImages) ? maxExtraImages + 1 : undefined\n\n\tconst [dragOver, setDragOver] = React.useState(false)\n\tconst pasteElementRef = React.useRef<HTMLDivElement>(null)\n\n\tconst onChooseImage = React.useCallback(() => {\n\t\tif (isReadOnly) return\n\t\tonChangeImages(chooseFileService.pickAndUploadImage({ multiple, maxUploads }).then(track(\"upload\")))\n\t}, [onChangeImages, isReadOnly, multiple, maxUploads])\n\n\tconst onKeyDown = React.useCallback(\n\t\t(event: React.KeyboardEvent) => {\n\t\t\tif ((event.key === \"Backspace\" || event.key === \"Delete\") && !isReadOnly) {\n\t\t\t\tonRemoveImage?.()\n\t\t\t}\n\t\t},\n\t\t[onRemoveImage, isReadOnly],\n\t)\n\n\tconst onDrop = React.useCallback(\n\t\t(event: DragEvent) => {\n\t\t\tif (isReadOnly) return\n\t\t\tif (!event.dataTransfer) return\n\t\t\tif (!onImageBatchUpload) return\n\n\t\t\tonChangeImages(onImageBatchUpload(event.dataTransfer.files, maxUploads).then(track(\"drop\")))\n\t\t},\n\t\t[onChangeImages, isReadOnly, maxUploads, onImageBatchUpload],\n\t)\n\n\tconst onContextMenu = React.useCallback(\n\t\t(event: React.MouseEvent) => {\n\t\t\tevent.preventDefault()\n\n\t\t\tif (!onRemoveImage) return\n\n\t\t\tengine.stores.contextMenuStore.show(\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: Dictionary.Delete,\n\t\t\t\t\t\tenabled: !isReadOnly,\n\t\t\t\t\t\tclick: onRemoveImage,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\t{ location: { x: event.clientX, y: event.clientY } },\n\t\t\t)\n\t\t},\n\t\t[isReadOnly, onRemoveImage],\n\t)\n\n\tconst pasteHandler = React.useCallback(\n\t\tasync (event: ClipboardEvent) => {\n\t\t\tif (isReadOnly) return\n\n\t\t\tconst pasteElement = pasteElementRef.current\n\t\t\tif (!pasteElement || document.activeElement !== pasteElement) return\n\t\t\tevent.preventDefault()\n\t\t\tconst clipboardData = event.clipboardData\n\t\t\tif (!clipboardData) return\n\n\t\t\tonChangeImages(chooseFileService.addImages(clipboardData.files))\n\t\t},\n\t\t[onChangeImages, isReadOnly],\n\t)\n\tusePasteHandler(pasteHandler)\n\n\tconst onDragEnter = React.useCallback(() => {\n\t\tsetDragOver(true)\n\t}, [])\n\n\tconst onDragLeave = React.useCallback(() => {\n\t\tsetDragOver(false)\n\t}, [])\n\n\tconst firstReference = imageReferences[0]\n\tconst { fileExtensions, preferredSizes } = reduceImageReferences(imageReferences)\n\tconst hasAnyImage = imageReferences.length > 0\n\tconst commonImageReference = commonValue(imageReferences)\n\tconst hasCommonImage = isString(commonImageReference) && commonImageReference.length > 0\n\tconst hasFocalPoint = !isUndefined(positionX) && !isUndefined(positionY)\n\tconst hasAnyVectorExtension = fileExtensions.has(\"svg\")\n\tconst resolutionEnabled = hasAnyImage && preferredSizes.size > 0 && !hasAnyVectorExtension\n\n\tconst onCropClickInternal = React.useCallback(() => {\n\t\tif (!firstReference) return\n\t\tonCropClick?.(firstReference, onChangeImages)\n\t}, [firstReference, onChangeImages, onCropClick])\n\n\tconst showFocalPointModal = () => {\n\t\tassert(isString(commonImageReference) && commonImageReference.length > 0)\n\t\tonEditFocalPoint?.(\n\t\t\tcommonImageReference,\n\t\t\tisRelativeNumber(positionX) ? positionX : undefined,\n\t\t\tisRelativeNumber(positionY) ? positionY : undefined,\n\t\t)\n\t}\n\n\tconst resolvedImage = firstReference && resolveImage(firstReference)\n\n\treturn (\n\t\t<Stack direction=\"column\">\n\t\t\t<FileDropZone\n\t\t\t\tkey={firstReference}\n\t\t\t\tclassName={cx(styles.preview, firstReference && styles.showButtonOnHover)}\n\t\t\t\tonDrop={onDrop}\n\t\t\t\tonDragEnter={onDragEnter}\n\t\t\t\tonDragLeave={onDragLeave}\n\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\tonDoubleClick={onChooseImage}\n\t\t\t\tonContextMenu={onContextMenu}\n\t\t\t>\n\t\t\t\t{/* biome-ignore lint/a11y/noNoninteractiveTabindex: native handlers are used for this */}\n\t\t\t\t<div ref={pasteElementRef} tabIndex={0} className={containerClassName(dragOver)}>\n\t\t\t\t\t<img src={resolvedImage} alt=\"\" decoding=\"async\" />\n\t\t\t\t</div>\n\t\t\t\t{!isReadOnly && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"clean\"\n\t\t\t\t\t\ttitle={multiple ? \"Choose Images\u2026\" : \"Choose Image\u2026\"}\n\t\t\t\t\t\tonClick={onChooseImage}\n\t\t\t\t\t\tonDoubleClick={stopPropagation}\n\t\t\t\t\t\tclassName={styles.chooseImageButton}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</FileDropZone>\n\t\t\t<Stack direction=\"column\" gap={0}>\n\t\t\t\t{!isUndefined(onChangeAssetSize) && (\n\t\t\t\t\t<PanelRowView title=\"Resolution\">\n\t\t\t\t\t\t<PopupButton enabled={resolutionEnabled} wrapperClassName={doubleColumnClass}>\n\t\t\t\t\t\t\t<PopupButtonItem\n\t\t\t\t\t\t\t\ttitle={fileExtensions.size > 1 ? Dictionary.Mixed : Dictionary.Auto}\n\t\t\t\t\t\t\t\tselected={true}\n\t\t\t\t\t\t\t\tonSelect={noop}\n\t\t\t\t\t\t\t\tenabled={false}\n\t\t\t\t\t\t\t\tvisible={hasAnyVectorExtension}\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t{!hasAnyVectorExtension &&\n\t\t\t\t\t\t\t\t!isUndefined(onChangeAssetSize) &&\n\t\t\t\t\t\t\t\tpreferredSizeOptions.map(sizeOption => (\n\t\t\t\t\t\t\t\t\t<PopupButtonItem\n\t\t\t\t\t\t\t\t\t\tkey={sizeOption}\n\t\t\t\t\t\t\t\t\t\ttitle={preferredSizeTitles[sizeOption]}\n\t\t\t\t\t\t\t\t\t\tidentifier={sizeOption}\n\t\t\t\t\t\t\t\t\t\tselected={preferredSizes.has(sizeOption)}\n\t\t\t\t\t\t\t\t\t\tonSelect={onChangeAssetSize}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</PopupButton>\n\t\t\t\t\t</PanelRowView>\n\t\t\t\t)}\n\t\t\t\t{extraControls}\n\t\t\t\t{isFound(altText) && !isUndefined(onChangeAltText) && (\n\t\t\t\t\t<PanelRowView title=\"Alt Text\">\n\t\t\t\t\t\t<TextInput\n\t\t\t\t\t\t\tvalue={isString(altText) ? altText : \"\"}\n\t\t\t\t\t\t\tonChange={onChangeAltText}\n\t\t\t\t\t\t\tclassName={doubleColumnClass}\n\t\t\t\t\t\t\tplaceholder={altTextPlaceholder ?? (isMixed(commonImageReference) ? Dictionary.Mixed : \"Describe Image\u2026\")}\n\t\t\t\t\t\t\tenabled={\n\t\t\t\t\t\t\t\t// It might be useful to give different images the same alt text, or\n\t\t\t\t\t\t\t\t// to delete the alt text of a large selection.\n\t\t\t\t\t\t\t\thasAnyImage\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelRowView>\n\t\t\t\t)}\n\t\t\t\t{!isUndefined(onEditFocalPoint) && !isUndefined(clearFocalPoint) && (\n\t\t\t\t\t<PanelRowView title=\"Focal Point\">\n\t\t\t\t\t\t<ButtonWithPreview\n\t\t\t\t\t\t\tdoubleColumn\n\t\t\t\t\t\t\tonPresent={showFocalPointModal}\n\t\t\t\t\t\t\tenabled={hasCommonImage && !isReadOnly}\n\t\t\t\t\t\t\tonDelete={hasFocalPoint ? clearFocalPoint : undefined}\n\t\t\t\t\t\t\ttitle={hasFocalPoint ? Dictionary.Custom : Dictionary.AddEllipsis}\n\t\t\t\t\t\t\ttitleColor={hasFocalPoint ? undefined : colors.inputLabel}\n\t\t\t\t\t\t\ttooltip={hasFocalPoint ? \"Edit Focal Point\" : \"Add Focal Point\"}\n\t\t\t\t\t\t\tpreview={\n\t\t\t\t\t\t\t\t<PopoutButtonPreviewIconWrapper\n\t\t\t\t\t\t\t\t\tcolor={colors.popupButtonPreviewIconPrimary}\n\t\t\t\t\t\t\t\t\tbackground={colors.popupButtonPreviewIconBackground}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<IconFocalPoint />\n\t\t\t\t\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelRowView>\n\t\t\t\t)}\n\t\t\t\t{enableFooter && (\n\t\t\t\t\t<Stack direction=\"row\" className={styles.footerSeparator}>\n\t\t\t\t\t\t<div className={styles.fullWidth}>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\ttitle=\"Crop\"\n\t\t\t\t\t\t\t\tenabled={!isReadOnly && Boolean(firstReference)}\n\t\t\t\t\t\t\t\tonClick={onCropClickInternal}\n\t\t\t\t\t\t\t\tclassName={styles.fullWidth}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{PluginPickerButton && (\n\t\t\t\t\t\t\t<PluginPickerButton\n\t\t\t\t\t\t\t\tcommonImageReference={commonImageReference}\n\t\t\t\t\t\t\t\tonChangeImages={onChangeImages}\n\t\t\t\t\t\t\t\taltText={altText}\n\t\t\t\t\t\t\t\tonChangeAltText={onChangeAltText}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Stack>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</Stack>\n\t)\n}\n\nfunction containerClassName(dragOver: boolean) {\n\tconst imageContainerStyles = cx(styles.imageContainer)\n\tconst dragOverStyles = cx(imageContainerStyles, styles.imageContainerDragOver)\n\tconst main = dragOver ? dragOverStyles : imageContainerStyles\n\treturn cx(main, \"wantsNativeTextAction\")\n}\n\nfunction track(type: \"drop\" | \"upload\"): (result: ImageUploadResult[]) => ImageUploadResult[] {\n\treturn result => {\n\t\tconst imageExtension = result[0] ? splitExtension(result[0].filename)[1].toLowerCase() : \"\"\n\t\trecord(\"insert_image\", { imageExtension, source: `picker_${type}` })\n\t\treturn result\n\t}\n}\n\nexport function reduceImageReferences(imageReferences: string[]): {\n\tfileExtensions: Set<string | null>\n\tpreferredSizes: Set<AssetSize>\n} {\n\tconst preferredSizes: Set<AssetSize> = new Set()\n\tconst fileExtensions: Set<string | null> = new Set()\n\n\timageReferences.forEach(imageReference => {\n\t\tconst assetReference = parseAssetReference(imageReference)\n\n\t\tif (!assetReference) return\n\n\t\tpreferredSizes.add(assetReference.preferredSize || \"auto\")\n\t\tfileExtensions.add(assetReference.fileExtension)\n\t})\n\n\treturn { preferredSizes, fileExtensions }\n}\n", "import { useReadOnly } from \"@framerjs/fresco\"\nimport { cx } from \"@linaria/core\"\nimport { Dictionary } from \"app/dictionary.ts\"\nimport { useBaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport type React from \"react\"\nimport { doubleColumnClass, doubleColumnClassForSortable } from \"../properties/utils/doubleColumn.styles.ts\"\nimport type { ButtonWithPreviewContentProps } from \"./ButtonWithPreviewContent.tsx\"\nimport { ButtonWithPreviewContent } from \"./ButtonWithPreviewContent.tsx\"\nimport * as buttonStyles from \"./PopoutButton.styles.ts\"\nimport * as styles from \"./PopoutButtonWithPreview.styles.ts\"\n\ntype Props = ButtonWithPreviewContentProps & {\n\tdoubleColumn?: boolean\n\tsortable?: boolean\n\ttabIndex?: number\n\ttooltip?: string\n\tonCopy?: () => void\n\tonDuplicate?: () => void\n\tonPresent?: () => void\n\tclassName?: string\n}\n\nexport const ButtonWithPreview = (props: Props) => {\n\tconst engine = useBaseEngine()\n\n\tconst isReadOnly = useReadOnly()\n\n\tconst {\n\t\tdoubleColumn,\n\t\tsortable,\n\t\ttooltip,\n\t\ttabIndex = 0,\n\t\tonDuplicate,\n\t\tonDelete,\n\t\tonPresent,\n\t\tonCopy,\n\t\tclassName,\n\t\tshortcutKey,\n\t\t...rest\n\t} = props\n\n\tfunction onContextMenu(event: React.MouseEvent) {\n\t\tengine.stores.contextMenuStore.show(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tlabel: Dictionary.Duplicate,\n\t\t\t\t\tclick: onDuplicate,\n\t\t\t\t\tenabled: !isReadOnly,\n\t\t\t\t\tvisible: !!onDuplicate,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: Dictionary.Copy,\n\t\t\t\t\tclick: onCopy,\n\t\t\t\t\tvisible: !!onCopy,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: Dictionary.Remove,\n\t\t\t\t\tclick: () => onDelete?.(undefined),\n\t\t\t\t\tenabled: !isReadOnly,\n\t\t\t\t\tvisible: !!onDelete,\n\t\t\t\t},\n\t\t\t],\n\t\t\t{ location: { x: event.clientX, y: event.clientY } },\n\t\t)\n\t}\n\n\tconst onKeyDown = (event: React.KeyboardEvent) => {\n\t\tif (event.key === \"Delete\") onDelete?.(event)\n\t}\n\n\treturn (\n\t\t<div\n\t\t\trole=\"button\"\n\t\t\ttitle={tooltip}\n\t\t\tonContextMenu={onContextMenu}\n\t\t\tonClick={onPresent}\n\t\t\tonKeyDown={onKeyDown}\n\t\t\ttabIndex={props.enabled === false ? -1 : tabIndex}\n\t\t\tclassName={cx(\n\t\t\t\tstyles.button,\n\t\t\t\tprops.enabled === false && styles.disabled,\n\t\t\t\tdoubleColumn && doubleColumnClass,\n\t\t\t\tsortable && doubleColumnClassForSortable,\n\t\t\t\tbuttonStyles.popoutButton,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<ButtonWithPreviewContent {...rest} onDelete={isReadOnly ? undefined : onDelete} />\n\t\t</div>\n\t)\n}\n", "import \"ImagePicker.styles_11208us.wyw.css\"; export const imageContainer = \"imageContainer_i1oxwf0f\";\nexport const imageContainerDragOver = \"imageContainerDragOver_ivz66j7\";\nexport const fullWidth = \"fullWidth_fjd4qd2\";\nexport const footerSeparator = \"footerSeparator_f1gixrvj\";\nexport const emptyLabel = \"emptyLabel_ekax85b\";\nexport const preview = \"preview_p1oi602g\";\nexport const showButtonOnHover = \"showButtonOnHover_s1rsxqtn\";\nexport const chooseImageButton = \"chooseImageButton_c17esauc\";", "import type { ModuleExportIdentifierString } from \"@framerjs/shared\"\nimport type { Link } from \"document/models/CanvasTree/traits/utils/Link.ts\"\nimport type {\n\tBooleanControlProp,\n\tCollectionReferenceControlProp,\n\tColorControlProp,\n\tControlProp,\n\tDateControlProp,\n\tEnumControlProp,\n\tFileControlProp,\n\tImageControlProp,\n\tLinkControlProp,\n\tMultiCollectionReferenceControlProp,\n\tNumberControlProp,\n\tRichTextControlProp,\n\tStringControlProp,\n\tVectorSetItemControlProp,\n} from \"document/models/controlProps/ControlProp.ts\"\nimport { withLocalizableControlPropValue } from \"document/models/controlProps/ControlProp.ts\"\nimport { hasControlAltLocalized, withControlAltText } from \"document/models/controlProps/WithControlAltText.ts\"\nimport { getControlFocalPosition } from \"document/models/controlProps/WithControlFocalPoint.ts\"\nimport {\n\tgetCanonicalRichTextTreeValueHash,\n\tgetRichTextTreeValueHash,\n\tgetRichTextTreeValueStorageMigrationHash,\n\tgetRichTextTreeValueStorageFormat,\n} from \"document/models/richText/richTextHash.ts\"\nimport { isRichTextTreeValue, type RichTextTreeValue } from \"document/models/richText/richTextStorage.ts\"\nimport { ControlType } from \"library/render/types/PropertyControls.ts\"\nimport { isString } from \"utils/typeChecks.ts\"\n\nexport function getUpdatedStringControlProp(\n\tcurrentControlProp: ControlProp | undefined,\n\tvalue: string,\n): StringControlProp {\n\tconst nextControlProp: StringControlProp = { type: ControlType.String, value }\n\n\tif (currentControlProp?.type === ControlType.String && currentControlProp.valueLocalized) {\n\t\tnextControlProp.valueLocalized = currentControlProp.valueLocalized\n\t}\n\n\treturn nextControlProp\n}\n\nexport function getUpdatedLinkControlProp(currentControlProp: ControlProp | undefined, value: Link): LinkControlProp {\n\tconst nextControlProp: LinkControlProp = { type: ControlType.Link, value }\n\n\tif (currentControlProp?.type === ControlType.Link && currentControlProp.valueLocalized) {\n\t\tnextControlProp.valueLocalized = currentControlProp.valueLocalized\n\t}\n\n\treturn nextControlProp\n}\n\nexport function getUpdatedRichTextControlProp(\n\tcurrentControlProp: ControlProp | undefined,\n\tvalue: RichTextTreeValue,\n): RichTextControlProp {\n\tconst nextControlProp: RichTextControlProp = { type: ControlType.RichText, value }\n\n\tif (currentControlProp?.type === ControlType.RichText && currentControlProp.valueLocalized) {\n\t\tconst previousValue = currentControlProp.value\n\t\tif (!isRichTextTreeValue(previousValue)) {\n\t\t\tnextControlProp.valueLocalized = currentControlProp.valueLocalized\n\t\t\treturn nextControlProp\n\t\t}\n\n\t\tconst previousFormat = getRichTextTreeValueStorageFormat(previousValue)\n\t\tconst nextFormat = getRichTextTreeValueStorageFormat(value)\n\n\t\tif (previousFormat === nextFormat) {\n\t\t\tnextControlProp.valueLocalized = currentControlProp.valueLocalized\n\t\t\treturn nextControlProp\n\t\t}\n\n\t\tconst previousCanonicalHash = getCanonicalRichTextTreeValueHash(previousValue, \"collectionControlProp\")\n\t\tconst nextCanonicalHash = getCanonicalRichTextTreeValueHash(value, \"collectionControlProp\")\n\t\tconst previousHash = getRichTextTreeValueHash(previousValue)\n\t\t// If only the storage format changed, move localized hashes to the new base hash.\n\t\t// If the base content changed, keep tracking the previous base content, but hash it\n\t\t// in the new storage format so comparisons still happen in one format.\n\t\tconst migratedHash =\n\t\t\tpreviousCanonicalHash === nextCanonicalHash\n\t\t\t\t? getRichTextTreeValueHash(value)\n\t\t\t\t: getRichTextTreeValueStorageMigrationHash(previousValue, nextFormat, \"collectionControlProp\")\n\n\t\tnextControlProp.valueLocalized = Object.fromEntries(\n\t\t\tObject.entries(currentControlProp.valueLocalized).map(([localeId, localizedValue]) => {\n\t\t\t\tconst matchesPreviousHash = localizedValue.hash === previousHash || localizedValue.hash === String(previousHash)\n\t\t\t\tif (!matchesPreviousHash) return [localeId, localizedValue]\n\t\t\t\treturn [localeId, { ...localizedValue, hash: migratedHash }]\n\t\t\t}),\n\t\t)\n\t}\n\n\treturn nextControlProp\n}\n\nexport function getUpdatedBooleanControlProp(value: boolean): BooleanControlProp {\n\treturn { type: ControlType.Boolean, value }\n}\n\nexport function getUpdatedColorControlProp(value: string): ColorControlProp {\n\treturn { type: ControlType.Color, value }\n}\n\nexport function getUpdatedDateControlProp(value: string | undefined): DateControlProp {\n\treturn { type: ControlType.Date, value }\n}\n\nexport function getUpdatedEnumControlProp(value: string): EnumControlProp {\n\treturn { type: ControlType.Enum, value }\n}\n\nexport function getUpdatedFileControlProp(value: string): FileControlProp {\n\treturn { type: ControlType.File, value }\n}\n\nexport function getUpdatedNumberControlProp(value: number): NumberControlProp {\n\treturn { type: ControlType.Number, value }\n}\n\nexport function getUpdatedCollectionReferenceControlProp(value: string | undefined): CollectionReferenceControlProp {\n\treturn { type: ControlType.CollectionReference, value }\n}\n\nexport function getUpdatedMultiCollectionReferenceControlProp(\n\tvalue: readonly string[] | undefined,\n): MultiCollectionReferenceControlProp {\n\treturn { type: ControlType.MultiCollectionReference, value }\n}\n\nexport function getUpdatedVectorSetItemControlProp(value: ModuleExportIdentifierString): VectorSetItemControlProp {\n\treturn { type: ControlType.VectorSetItem, value }\n}\n\nexport function getUpdatedImageControlProp(\n\tcurrentControlProp: ControlProp | undefined,\n\tupdate: Partial<ImageControlProp>,\n): ImageControlProp {\n\tconst imageControlProp: ImageControlProp = { type: ControlType.Image, value: undefined }\n\n\tif (currentControlProp && isString(currentControlProp.value)) {\n\t\timageControlProp.value = currentControlProp.value\n\t}\n\n\tif (withLocalizableControlPropValue(currentControlProp)) {\n\t\timageControlProp.valueLocalized = currentControlProp.valueLocalized\n\t}\n\n\tif (withControlAltText(currentControlProp)) {\n\t\timageControlProp.alt = currentControlProp.alt\n\t}\n\n\tif (hasControlAltLocalized(currentControlProp)) {\n\t\timageControlProp.altLocalized = currentControlProp.altLocalized\n\t}\n\n\tconst focalPosition = getControlFocalPosition(currentControlProp)\n\tif (isString(focalPosition.positionX)) imageControlProp.positionX = focalPosition.positionX\n\tif (isString(focalPosition.positionY)) imageControlProp.positionY = focalPosition.positionY\n\n\tObject.assign(imageControlProp, update)\n\n\treturn imageControlProp\n}\n", "import type { AssetReferenceParseResult, AssetSize } from \"@framerjs/assets\"\nimport { parseAssetReference, updateAssetReferencePreferredSize } from \"@framerjs/assets\"\nimport { assert, unhandledError } from \"@framerjs/shared\"\nimport { fallbackAltText } from \"document/models/CanvasTree/traits/WithAltText.ts\"\nimport { NotFound, type Reduced } from \"document/models/CanvasTree/traits/utils/Reduced.ts\"\nimport type { ImageControlProp } from \"document/models/controlProps/ControlProp.ts\"\nimport type {\n\tReducedImageControlProp,\n\tReducedResponsiveImageControlProp,\n} from \"document/models/controlProps/getReducedControlProps.ts\"\nimport { createAssetReferenceForUploadImageResult } from \"document/utils/createAssetReferenceFromImageUpload.ts\"\nimport { ControlType } from \"library/render/types/PropertyControls.ts\"\nimport type { RelativeNumber } from \"library/render/types/RelativeNumber.ts\"\nimport { useMemo } from \"react\"\nimport { isString } from \"utils/typeChecks.ts\"\nimport type { ImageUploadResultWithOptionalAssetSize } from \"web/pages/project/lib/UploadService.ts\"\nimport { ImagePopout, type ImagePopoutProps } from \"../shared/ImagePopout.tsx\"\nimport { getUpdatedImageControlProp } from \"./utils/getUpdatedFieldControlProp.ts\"\n\ninterface CollectionImagePopoutProps {\n\tcontrolProp: ReducedImageControlProp | ReducedResponsiveImageControlProp\n\tonChange(getUpdate: (value: ImageControlProp | undefined) => ImageControlProp, extraImages?: ImageControlProp[]): void\n\tonRemove?(): void\n\tmultiple?: boolean\n\tmaxExtraImages?: number\n}\n\ninterface ResponsiveCollectionImagePopoutProps extends Omit<CollectionImagePopoutProps, \"controlProp\"> {\n\tcontrolProp: ReducedResponsiveImageControlProp\n}\n\nexport function CollectionImagePopout({\n\tcontrolProp,\n\tonChange,\n\tonRemove,\n\tmultiple = false,\n\tmaxExtraImages,\n}: CollectionImagePopoutProps) {\n\tconst imagePopoutProps = useCollectionImagePopoutProps({\n\t\tcontrolProp,\n\t\tonChange,\n\t\tonRemove,\n\t\tmultiple,\n\t\tmaxExtraImages,\n\t})\n\n\treturn <ImagePopout {...imagePopoutProps} />\n}\n\nexport function ResponsiveCollectionImagePopout({\n\tcontrolProp,\n\tonChange,\n\tonRemove,\n\tmultiple = false,\n\tmaxExtraImages,\n}: ResponsiveCollectionImagePopoutProps) {\n\tconst imagePopoutProps = useResponsiveCollectionImagePopoutProps({\n\t\tcontrolProp,\n\t\tonChange,\n\t\tonRemove,\n\t\tmultiple,\n\t\tmaxExtraImages,\n\t})\n\n\treturn <ImagePopout {...imagePopoutProps} />\n}\n\nfunction useCollectionImagePopoutProps({\n\tcontrolProp,\n\tonChange,\n\tonRemove,\n\tmultiple = false,\n\tmaxExtraImages,\n}: CollectionImagePopoutProps): ImagePopoutProps {\n\tconst assetReference = isString(controlProp.value) ? controlProp.value : undefined\n\n\tlet altText: Reduced<string> | undefined\n\tlet positionX: RelativeNumber | undefined\n\tlet positionY: RelativeNumber | undefined\n\n\tconst isResponsiveImage = controlProp.type === ControlType.ResponsiveImage\n\tif (isResponsiveImage) {\n\t\taltText = controlProp.alt\n\t\tpositionX = isString(controlProp.positionX) ? controlProp.positionX : undefined\n\t\tpositionY = isString(controlProp.positionY) ? controlProp.positionY : undefined\n\t}\n\n\tconst parsedAssetReference = useMemo(() => {\n\t\tif (!assetReference) return undefined\n\t\treturn parseAssetReference(assetReference)\n\t}, [assetReference])\n\n\tfunction updateImage(update: Partial<ImageControlProp>, extraImages?: ImageControlProp[]) {\n\t\tonChange(\n\t\t\t(currentControlProp: ImageControlProp | undefined) => getUpdatedImageControlProp(currentControlProp, update),\n\t\t\textraImages,\n\t\t)\n\t}\n\n\tasync function changeImage(upload: Promise<readonly ImageUploadResultWithOptionalAssetSize[]>) {\n\t\ttry {\n\t\t\tconst rawImages = await upload\n\n\t\t\tif (rawImages.length === 0) return\n\t\t\tconst imagesWithFileNames = rawImages.filter(imageUpload => imageUpload.filename !== \"\")\n\n\t\t\tconst [firstImage, ...extraImages] = imagesWithFileNames\n\t\t\tif (!firstImage) return\n\n\t\t\tlet extraImageControlProps: ImageControlProp[] | undefined\n\n\t\t\tif (multiple && extraImages.length > 0) {\n\t\t\t\textraImageControlProps = extraImages.map(image => ({\n\t\t\t\t\ttype: ControlType.Image,\n\t\t\t\t\tvalue: createAssetReferenceForUploadImageResult(image),\n\t\t\t\t}))\n\t\t\t}\n\n\t\t\tconst imageControlProp = imageControlPropWithClearedFocalPoint(firstImage, parsedAssetReference)\n\n\t\t\tupdateImage(imageControlProp, extraImageControlProps)\n\t\t} catch (error) {\n\t\t\tunhandledError(error)\n\t\t}\n\t}\n\n\tfunction changeAssetSize(size: AssetSize) {\n\t\tif (!assetReference) return\n\t\tconst newAssetReference = updateAssetReferencePreferredSize(assetReference, size)\n\t\tupdateImage({ value: newAssetReference })\n\t}\n\n\tfunction changeAltText(alt: string) {\n\t\tupdateImage({ alt })\n\t}\n\n\tfunction changeFocalPosition(\n\t\tnewFocalPositionX: RelativeNumber | undefined,\n\t\tnewFocalPositionY: RelativeNumber | undefined,\n\t) {\n\t\tupdateImage({ positionX: newFocalPositionX, positionY: newFocalPositionY })\n\t}\n\n\treturn {\n\t\tmultiple,\n\t\tmaxExtraImages,\n\t\timageReference: assetReference,\n\t\tonChange: changeImage,\n\t\tonChangeAssetSize: changeAssetSize,\n\t\tonChangeAltText: changeAltText,\n\t\tonRemoveImage: onRemove,\n\t\tpositionX,\n\t\tpositionY,\n\t\taltText: altText ?? NotFound,\n\t\tonChangeFocalPosition: isResponsiveImage ? changeFocalPosition : undefined,\n\t}\n}\n\nexport function useResponsiveCollectionImagePopoutProps({\n\tcontrolProp,\n\tonChange,\n\tonRemove,\n\tmultiple = false,\n\tmaxExtraImages,\n}: ResponsiveCollectionImagePopoutProps): ImagePopoutProps {\n\tassert(controlProp.type === ControlType.ResponsiveImage, \"Expected a responsive image control prop.\")\n\n\tconst imagePopoutProps = useCollectionImagePopoutProps({\n\t\tcontrolProp,\n\t\tonChange,\n\t\tonRemove,\n\t\tmultiple,\n\t\tmaxExtraImages,\n\t})\n\n\treturn {\n\t\t...imagePopoutProps,\n\t\taltText: isString(controlProp.alt) ? controlProp.alt : fallbackAltText,\n\t}\n}\n\nfunction imageControlPropWithClearedFocalPoint(\n\timage: ImageUploadResultWithOptionalAssetSize,\n\tparsedAssetReference: AssetReferenceParseResult | undefined,\n): ImageControlProp {\n\treturn {\n\t\ttype: ControlType.Image,\n\t\tvalue: createAssetReferenceForUploadImageResult(image, image.preferredSize ?? parsedAssetReference?.preferredSize),\n\t\t// Clear focal point because it will no longer make sense in the new image.\n\t\tpositionX: undefined,\n\t\tpositionY: undefined,\n\t}\n}\n", "import type { ItemToSlug } from \"@framerjs/framer-runtime/crossorigin\"\nimport type { ModuleExportIdentifierString } from \"@framerjs/shared\"\nimport { EngineChange } from \"document/EngineChanges.ts\"\nimport { useBaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport { defaultLocaleId } from \"document/models/CanvasTree/traits/WithLocales.ts\"\nimport { useDeprecatedEngineState } from \"document/useDeprecatedEngineState.ts\"\nimport { getItemToSlug } from \"./collectionSlugUtils.ts\"\n\nexport function useItemToSlug(\n\tdataIdentifier: ModuleExportIdentifierString | undefined,\n\tlocaleId = defaultLocaleId,\n): ItemToSlug | undefined {\n\tconst engine = useBaseEngine()\n\n\treturn useDeprecatedEngineState(\n\t\t[EngineChange.Tree, EngineChange.ActiveBundle],\n\t\t() => getItemToSlug(engine.tree, engine.componentLoader, dataIdentifier, localeId),\n\t\t[dataIdentifier, localeId],\n\t)\n}\n", "import type { AssetSize } from \"@framerjs/assets\"\nimport { Stack } from \"@framerjs/fresco\"\nimport { dimensions } from \"@framerjs/fresco/tokens\"\nimport { useBaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport type { FillImagePositionX, FillImagePositionY } from \"document/models/CanvasTree/traits/WithFill.ts\"\nimport type { Reduced } from \"document/models/CanvasTree/traits/utils/Reduced.ts\"\nimport { isFoundAndNotMixed } from \"document/models/CanvasTree/traits/utils/Reduced.ts\"\nimport { ModalType } from \"document/utils/ModalType.ts\"\nimport { useCallback } from \"react\"\nimport { commonValue } from \"utils/commonValue.ts\"\nimport { isUndefined } from \"utils/typeChecks.ts\"\nimport { batchUploadImages } from \"web/lib/batchUploaderUtils.tsx\"\nimport type { ImageUploadResult } from \"web/pages/project/lib/UploadService.ts\"\nimport { FillImagePatternPresetsRow } from \"../../properties/rows/FillImagePatternPresetsRow/FillImagePatternPresetsRow.tsx\"\nimport type { TilingBackgroundPatternPreset } from \"../../properties/rows/FillImagePatternPresetsRow/presetOptions.ts\"\nimport { getFillImagePreset } from \"../../properties/rows/FillImagePatternPresetsRow/presetOptions.ts\"\nimport type { OptionalFillImagePositionRowProps } from \"../../properties/rows/FillImagePositionRow.tsx\"\nimport { FillImagePositionRow } from \"../../properties/rows/FillImagePositionRow.tsx\"\nimport type { FillImageResizeRowProps } from \"../../properties/rows/FillImageResizeRow.tsx\"\nimport { FillImageResizeRow } from \"../../properties/rows/FillImageResizeRow.tsx\"\nimport { FillImageTiledSizeRow } from \"../../properties/rows/FillImageTiledSizeRow.tsx\"\nimport type { AltTextProps } from \"../ImagePicker.tsx\"\nimport { ImagePicker } from \"../ImagePicker.tsx\"\n\ninterface Props\n\textends\n\t\tAltTextProps,\n\t\tPartial<Pick<FillImageResizeRowProps, \"fillImageResize\" | \"onChangeImageResize\">>,\n\t\tOptionalFillImagePositionRowProps {\n\timageReferences: Set<string>\n\tonChangeImages: (imageUpload: Promise<ImageUploadResult[]>) => void\n\tonRemoveImage?: () => void\n\tonChangeAssetSize?: (size: AssetSize) => void\n\tonChangeImagePosition?: (\n\t\tfillImagePositionX: FillImagePositionX | undefined,\n\t\tfillImagePositionY: FillImagePositionY | undefined,\n\t) => void\n\tfillImageTileSize: Reduced<number | undefined>\n\tonChangeFillImageSize?: (fillImageTileSize: number) => void\n\tonSelectTilePatternPreset?: (pattern: TilingBackgroundPatternPreset) => void\n}\n\nexport function ColorPickerImage({\n\timageReferences,\n\tfillImageResize,\n\tonChangeImages,\n\tonRemoveImage,\n\tonChangeImageResize,\n\tonChangeAssetSize,\n\taltText,\n\tonChangeAltText,\n\tfillImagePositionX,\n\tfillImagePositionY,\n\tonChangeImagePosition,\n\tfillImageTileSize,\n\tonChangeFillImageSize,\n\tonSelectTilePatternPreset,\n}: Props) {\n\tconst engine = useBaseEngine()\n\n\tconst commonImage = commonValue(imageReferences)\n\n\t// If the fill image is set to tile mode, then try and resolve the asset preset if one was used.\n\tconst selectedPreset =\n\t\tfillImageResize && commonValue(fillImageResize) === \"tile\" && isFoundAndNotMixed(commonImage)\n\t\t\t? getFillImagePreset(commonImage)\n\t\t\t: undefined\n\n\tconst onImageBatchUpload = useCallback(\n\t\t(files: FileList | File[], maxUploads?: number) => batchUploadImages(engine, files, maxUploads),\n\t\t[],\n\t)\n\tconst onCropClick = useCallback(\n\t\t(image: string) => {\n\t\t\tengine.stores.modalStore.push({\n\t\t\t\ttype: ModalType.ImageCrop,\n\t\t\t\tinitialImage: image,\n\t\t\t\tonChange: onChangeImages,\n\t\t\t\tsource: \"image_picker\",\n\t\t\t})\n\t\t},\n\t\t[onChangeImages],\n\t)\n\n\treturn (\n\t\t<Stack direction=\"column\" padding={`0 ${dimensions.css.popoverPadding} ${dimensions.css.popoverPadding}`}>\n\t\t\t<ImagePicker\n\t\t\t\timageReferences={Array.from(imageReferences)}\n\t\t\t\tonChangeImages={onChangeImages}\n\t\t\t\tonRemoveImage={imageReferences.size > 0 ? onRemoveImage : undefined}\n\t\t\t\tonChangeAssetSize={onChangeAssetSize}\n\t\t\t\taltText={altText}\n\t\t\t\tonChangeAltText={onChangeAltText}\n\t\t\t\tonImageBatchUpload={onImageBatchUpload}\n\t\t\t\tonCropClick={onCropClick}\n\t\t\t\textraControls={\n\t\t\t\t\tfillImageResize && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{!isUndefined(onChangeImageResize) && (\n\t\t\t\t\t\t\t\t<FillImageResizeRow\n\t\t\t\t\t\t\t\t\ttitle=\"Type\"\n\t\t\t\t\t\t\t\t\tenabled\n\t\t\t\t\t\t\t\t\tfillImageResize={fillImageResize}\n\t\t\t\t\t\t\t\t\tonChangeImageResize={onChangeImageResize}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{!isUndefined(onSelectTilePatternPreset) && commonValue(fillImageResize) === \"tile\" && (\n\t\t\t\t\t\t\t\t<FillImagePatternPresetsRow\n\t\t\t\t\t\t\t\t\tselectedPreset={selectedPreset}\n\t\t\t\t\t\t\t\t\tonSelectPreset={onSelectTilePatternPreset}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{!isUndefined(onChangeFillImageSize) && commonValue(fillImageResize) === \"tile\" && (\n\t\t\t\t\t\t\t\t<FillImageTiledSizeRow\n\t\t\t\t\t\t\t\t\ttitle=\"Scale\"\n\t\t\t\t\t\t\t\t\tvalue={fillImageTileSize}\n\t\t\t\t\t\t\t\t\tonChange={onChangeFillImageSize}\n\t\t\t\t\t\t\t\t\tenabled={imageReferences.size > 0}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{!isUndefined(onChangeImagePosition) && (\n\t\t\t\t\t\t\t\t<FillImagePositionRow\n\t\t\t\t\t\t\t\t\ttitle=\"Position\"\n\t\t\t\t\t\t\t\t\timageReferences={imageReferences}\n\t\t\t\t\t\t\t\t\tenabled={imageReferences.size > 0}\n\t\t\t\t\t\t\t\t\tfillImageResize={fillImageResize}\n\t\t\t\t\t\t\t\t\tfillImagePositionX={fillImagePositionX}\n\t\t\t\t\t\t\t\t\tfillImagePositionY={fillImagePositionY}\n\t\t\t\t\t\t\t\t\tonChangeImagePosition={onChangeImagePosition}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t/>\n\t\t</Stack>\n\t)\n}\n", "import \"FillImagePatternPresetsRow.styles_1jodgsl.wyw.css\"; export const presetsContainer = \"presetsContainer_p4b05eq\";\nexport const presetPreview = \"presetPreview_prqiyvj\";\nexport const presetPreviewContainer = \"presetPreviewContainer_p1c81r2w\";\nexport const presetPreviewContainerSelected = \"presetPreviewContainerSelected_p1ln12j8\";", "import { cx } from \"@linaria/core\"\nimport { useDarkMode } from \"web/lib/useDarkMode.ts\"\nimport { PanelRow } from \"../PanelRow.tsx\"\nimport * as styles from \"./FillImagePatternPresetsRow.styles.ts\"\nimport type { TilingBackgroundPatternPreset } from \"./presetOptions.ts\"\nimport { presetOptions } from \"./presetOptions.ts\"\n\ninterface PresetProps {\n\tpreset: TilingBackgroundPatternPreset\n\tonSelect: (preset: TilingBackgroundPatternPreset) => void\n\tselected: boolean\n}\n\nconst Preset = ({ preset, onSelect, selected }: PresetProps) => {\n\tconst { isDarkMode } = useDarkMode()\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tonClick={() => onSelect(preset)}\n\t\t\tclassName={cx(styles.presetPreviewContainer, selected && styles.presetPreviewContainerSelected)}\n\t\t>\n\t\t\t<img\n\t\t\t\talt={preset.name}\n\t\t\t\tclassName={cx(styles.presetPreview)}\n\t\t\t\tsrc={isDarkMode ? preset.previewImageDark : preset.previewImageLight}\n\t\t\t\tdecoding=\"async\"\n\t\t\t/>\n\t\t</button>\n\t)\n}\n\ninterface FillImagePatternPresetsRowProps {\n\tonSelectPreset: (preset: TilingBackgroundPatternPreset) => void\n\tselectedPreset?: TilingBackgroundPatternPreset\n}\n\nexport const FillImagePatternPresetsRow = ({ selectedPreset, onSelectPreset }: FillImagePatternPresetsRowProps) => {\n\treturn (\n\t\t<PanelRow title=\"Preset\">\n\t\t\t<div className={cx(styles.presetsContainer)}>\n\t\t\t\t{presetOptions.map(preset => (\n\t\t\t\t\t<Preset\n\t\t\t\t\t\tkey={preset.name}\n\t\t\t\t\t\tpreset={preset}\n\t\t\t\t\t\tonSelect={onSelectPreset}\n\t\t\t\t\t\tselected={(selectedPreset && selectedPreset.name === preset.name) || false}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</div>\n\t\t</PanelRow>\n\t)\n}\n", "import \"FillImagePositionRow.styles_tl7dws.wyw.css\"; export const disabledIconWrapper = \"disabledIconWrapper_dl1ddfs\";", "import { IconFocalPoint, PopupButton, PopupButtonItem } from \"@framerjs/fresco\"\nimport { colors } from \"@framerjs/fresco/tokens\"\nimport { assert, Mixed, isMixed } from \"@framerjs/shared\"\nimport { cx } from \"@linaria/core\"\nimport { Dictionary } from \"app/dictionary.ts\"\nimport { useBaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport type { FillImagePositionX, FillImagePositionY } from \"document/models/CanvasTree/traits/WithFill.ts\"\nimport { NotFound, isFound } from \"document/models/CanvasTree/traits/utils/Reduced.ts\"\nimport type { ReducedFill } from \"document/models/CanvasTree/traits/utils/reduceFill.ts\"\nimport { ModalType } from \"document/utils/ModalType.ts\"\nimport type { ImageFit } from \"library/render/types/BackgroundImage.ts\"\nimport { isRelativeNumber } from \"library/render/types/RelativeNumber.ts\"\nimport { commonValue } from \"utils/commonValue.ts\"\nimport { isString, isUndefined } from \"utils/typeChecks.ts\"\nimport { ButtonWithPreview } from \"../../shared/ButtonWithPreview.tsx\"\nimport { PopoutButtonPreviewIconWrapper } from \"../../shared/PopoutButtonPreviewIconWrapper.tsx\"\nimport { doubleColumnClass } from \"../utils/doubleColumn.styles.ts\"\nimport * as styles from \"./FillImagePositionRow.styles.ts\"\nimport { PanelRow } from \"./PanelRow.tsx\"\n\nconst options = [\n\t\"Focal Point\",\n\t\"Top Left\",\n\t\"Top Center\",\n\t\"Top Right\",\n\t\"Left\",\n\t\"Center\",\n\t\"Right\",\n\t\"Bottom Left\",\n\t\"Bottom Center\",\n\t\"Bottom Right\",\n] as const\n\ntype Option = (typeof options)[number]\n\nfunction getOptionForPosition(\n\tfillImagePositionX: ReducedFill[\"fillImagePositionX\"],\n\tfillImagePositionY: ReducedFill[\"fillImagePositionY\"],\n\thasImageVariable: boolean,\n): Option | Mixed {\n\tassert(isFound(fillImagePositionX))\n\tassert(isFound(fillImagePositionY))\n\n\tif (isMixed(fillImagePositionX) || isMixed(fillImagePositionY)) return Mixed\n\n\tif (isRelativeNumber(fillImagePositionX) || isRelativeNumber(fillImagePositionY)) {\n\t\tif (hasImageVariable) return \"Center\"\n\t\treturn \"Focal Point\"\n\t}\n\tif (hasImageVariable && isUndefined(fillImagePositionX) && isUndefined(fillImagePositionY)) return \"Focal Point\"\n\n\tif (fillImagePositionY === \"top\") {\n\t\tif (fillImagePositionX === \"left\") return \"Top Left\"\n\t\tif (fillImagePositionX === \"right\") return \"Top Right\"\n\t\treturn \"Top Center\"\n\t}\n\n\tif (fillImagePositionY === \"bottom\") {\n\t\tif (fillImagePositionX === \"left\") return \"Bottom Left\"\n\t\tif (fillImagePositionX === \"right\") return \"Bottom Right\"\n\t\treturn \"Bottom Center\"\n\t}\n\n\tif (fillImagePositionX === \"left\") return \"Left\"\n\tif (fillImagePositionX === \"right\") return \"Right\"\n\treturn \"Center\"\n}\n\nfunction getPositionXForOption(option: Option): FillImagePositionX {\n\tif (option.includes(\"Left\")) return \"left\"\n\tif (option.includes(\"Right\")) return \"right\"\n\treturn \"center\"\n}\n\nfunction getPositionYForOption(option: Option): FillImagePositionY {\n\tif (option.includes(\"Top\")) return \"top\"\n\tif (option.includes(\"Bottom\")) return \"bottom\"\n\treturn \"center\"\n}\n\nfunction imageCanBePositioned(fillImageResize: Set<ImageFit>): boolean {\n\tif (fillImageResize.size > 1) return true\n\treturn !fillImageResize.has(\"stretch\")\n}\n\nexport type OptionalFillImagePositionRowProps = Partial<\n\tPick<FillImagePositionRowProps, \"fillImagePositionX\" | \"fillImagePositionY\" | \"onChangeImagePosition\">\n>\n\ninterface FillImagePositionRowProps extends Pick<ReducedFill, \"fillImagePositionX\" | \"fillImagePositionY\"> {\n\tonChangeImagePosition: (\n\t\tfillImagePositionX: FillImagePositionX | undefined,\n\t\tfillImagePositionY: FillImagePositionY | undefined,\n\t) => void\n\tfillImageResize: Set<ImageFit>\n\ttitle?: string\n\tenabled?: boolean\n\thasImageVariable?: boolean\n\t/** Used for custom focal point */\n\timageReferences?: Set<string>\n}\n\nexport function FillImagePositionRow({\n\ttitle = \"\",\n\tenabled = true,\n\thasImageVariable = false,\n\timageReferences,\n\tonChangeImagePosition,\n\tfillImagePositionX,\n\tfillImagePositionY,\n\tfillImageResize,\n}: FillImagePositionRowProps) {\n\tconst engine = useBaseEngine()\n\n\tif (!imageCanBePositioned(fillImageResize)) return null\n\n\tconst commonFillImageResize = commonValue(fillImageResize)\n\tconst supportsCustomFocalPoint = commonFillImageResize === \"fill\"\n\n\tif (!supportsCustomFocalPoint) {\n\t\tif (isUndefined(fillImagePositionX) || isRelativeNumber(fillImagePositionX)) {\n\t\t\tfillImagePositionX = commonFillImageResize === \"tile\" ? \"left\" : \"center\"\n\t\t}\n\t\tif (isUndefined(fillImagePositionY) || isRelativeNumber(fillImagePositionY)) {\n\t\t\tfillImagePositionY = commonFillImageResize === \"tile\" ? \"top\" : \"center\"\n\t\t}\n\t}\n\n\tconst selectedOption = getOptionForPosition(fillImagePositionX, fillImagePositionY, hasImageVariable)\n\tconst isFocalPointSelected = selectedOption === \"Focal Point\"\n\n\tconst commonImage = imageReferences ? commonValue(imageReferences) : NotFound\n\n\tfunction editCustomFocalPoint() {\n\t\tassert(isString(commonImage))\n\t\tengine.stores.modalStore.push({\n\t\t\ttype: ModalType.ImageFocalPoint,\n\t\t\timage: commonImage,\n\t\t\tpositionX: isRelativeNumber(fillImagePositionX) ? fillImagePositionX : undefined,\n\t\t\tpositionY: isRelativeNumber(fillImagePositionY) ? fillImagePositionY : undefined,\n\t\t\tonChange: onChangeImagePosition,\n\t\t\tsource: \"properties\",\n\t\t})\n\t}\n\n\tconst update = (option: Option) => {\n\t\tif (option === \"Focal Point\") {\n\t\t\tif (hasImageVariable) {\n\t\t\t\t// Setting position to undefined makes it inherit the focal point from the variable.\n\t\t\t\tonChangeImagePosition(undefined, undefined)\n\t\t\t} else {\n\t\t\t\teditCustomFocalPoint()\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tconst positionX = getPositionXForOption(option)\n\t\tconst positionY = getPositionYForOption(option)\n\t\tonChangeImagePosition(positionX, positionY)\n\t}\n\n\tconst canSetCustomFocalPoint = isString(commonImage)\n\n\tconst items: React.ReactNode[] = []\n\n\tif (isMixed(selectedOption)) {\n\t\titems.push(<PopupButtonItem key=\"mixed\" selected title={Dictionary.Mixed} />)\n\t\titems.push(<PopupButtonItem key=\"mixed-divider\" type=\"divider\" />)\n\t}\n\n\toptions.forEach((option, index) => {\n\t\tif (option === \"Focal Point\") {\n\t\t\tif (!supportsCustomFocalPoint) return\n\t\t\tif (!hasImageVariable && !canSetCustomFocalPoint && !isFocalPointSelected) return\n\t\t}\n\n\t\titems.push(\n\t\t\t<PopupButtonItem\n\t\t\t\tkey={index}\n\t\t\t\ttitle={option}\n\t\t\t\tonSelect={update}\n\t\t\t\tidentifier={option}\n\t\t\t\tselected={selectedOption === option}\n\t\t\t/>,\n\t\t)\n\n\t\tif (index % 3 === 0) {\n\t\t\titems.push(<PopupButtonItem key={index + \"divider\"} type=\"divider\" />)\n\t\t}\n\t})\n\n\treturn (\n\t\t<PanelRow title={title}>\n\t\t\t{!hasImageVariable && isFocalPointSelected && canSetCustomFocalPoint ? (\n\t\t\t\t<>\n\t\t\t\t\t<ButtonWithPreview\n\t\t\t\t\t\tdoubleColumn\n\t\t\t\t\t\tenabled={enabled}\n\t\t\t\t\t\ttitle=\"Focal Point\"\n\t\t\t\t\t\ttooltip=\"Edit Focal Point\"\n\t\t\t\t\t\tonPresent={editCustomFocalPoint}\n\t\t\t\t\t\tonDelete={() => update(\"Center\")}\n\t\t\t\t\t\tpreview={\n\t\t\t\t\t\t\t<PopoutButtonPreviewIconWrapper\n\t\t\t\t\t\t\t\tclassName={cx(!enabled && styles.disabledIconWrapper)}\n\t\t\t\t\t\t\t\tcolor={colors.popupButtonPreviewIconPrimary}\n\t\t\t\t\t\t\t\tbackground={colors.popupButtonPreviewIconBackground}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<IconFocalPoint />\n\t\t\t\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<PopupButton\n\t\t\t\t\tenabled={enabled}\n\t\t\t\t\twrapperClassName={doubleColumnClass}\n\t\t\t\t\tpreview={\n\t\t\t\t\t\t<PopoutButtonPreviewIconWrapper\n\t\t\t\t\t\t\tclassName={cx(!enabled && styles.disabledIconWrapper)}\n\t\t\t\t\t\t\tcolor={selectedOption === \"Focal Point\" ? colors.popupButtonPreviewIconPrimary : undefined}\n\t\t\t\t\t\t\tbackground={colors.popupButtonPreviewIconBackground}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{selectedOption === \"Focal Point\" ? (\n\t\t\t\t\t\t\t\t<IconFocalPoint />\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<IconPosition selectedOption={selectedOption} optionItems={options} firstPositionKey=\"Top Left\" />\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</PopoutButtonPreviewIconWrapper>\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{items}\n\t\t\t\t</PopupButton>\n\t\t\t)}\n\t\t</PanelRow>\n\t)\n}\n\ninterface IconPositionProps<T> {\n\tselectedOption: T | Mixed\n\toptionItems: readonly T[]\n\tfirstPositionKey: T\n}\n\nexport function IconPosition<T>({ selectedOption, optionItems, firstPositionKey }: IconPositionProps<T>) {\n\tconst firstPositionIndex = optionItems.indexOf(firstPositionKey)\n\tassert(firstPositionIndex !== -1)\n\tconst selectedIndex = isString(selectedOption) ? optionItems.indexOf(selectedOption) - firstPositionIndex : -1\n\treturn (\n\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"22\" height=\"22\">\n\t\t\t{Array(3)\n\t\t\t\t.fill(null)\n\t\t\t\t.map((_, rowIndex) => (\n\t\t\t\t\t<g key={rowIndex} transform={`translate(3 ${3 + 6.5 * rowIndex})`}>\n\t\t\t\t\t\t<path\n\t\t\t\t\t\t\td=\"M 1.5 0 C 2.328 0 3 0.672 3 1.5 C 3 2.328 2.328 3 1.5 3 C 0.672 3 0 2.328 0 1.5 C 0 0.672 0.672 0 1.5 0 Z\"\n\t\t\t\t\t\t\tfill={\n\t\t\t\t\t\t\t\tselectedIndex === rowIndex * 3\n\t\t\t\t\t\t\t\t\t? colors.popupButtonPreviewIconPrimary\n\t\t\t\t\t\t\t\t\t: colors.popupButtonPreviewIconSecondary\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<path\n\t\t\t\t\t\t\td=\"M 8 0 C 8.828 0 9.5 0.672 9.5 1.5 C 9.5 2.328 8.828 3 8 3 C 7.172 3 6.5 2.328 6.5 1.5 C 6.5 0.672 7.172 0 8 0 Z\"\n\t\t\t\t\t\t\tfill={\n\t\t\t\t\t\t\t\tselectedIndex === 1 + rowIndex * 3\n\t\t\t\t\t\t\t\t\t? colors.popupButtonPreviewIconPrimary\n\t\t\t\t\t\t\t\t\t: colors.popupButtonPreviewIconSecondary\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<path\n\t\t\t\t\t\t\td=\"M 14.5 0 C 15.328 0 16 0.672 16 1.5 C 16 2.328 15.328 3 14.5 3 C 13.672 3 13 2.328 13 1.5 C 13 0.672 13.672 0 14.5 0 Z\"\n\t\t\t\t\t\t\tfill={\n\t\t\t\t\t\t\t\tselectedIndex === 2 + rowIndex * 3\n\t\t\t\t\t\t\t\t\t? colors.popupButtonPreviewIconPrimary\n\t\t\t\t\t\t\t\t\t: colors.popupButtonPreviewIconSecondary\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</g>\n\t\t\t\t))}\n\t\t</svg>\n\t)\n}\n", "import { PopupButton, PopupButtonItem } from \"@framerjs/fresco\"\nimport type { ReducedFill } from \"document/models/CanvasTree/traits/utils/reduceFill.ts\"\nimport type { ImageFit } from \"library/render/types/BackgroundImage.ts\"\nimport { capitalizeFirstLetter } from \"utils/capitalizeFirstLetter.ts\"\nimport { doubleColumnClass } from \"../utils/doubleColumn.styles.ts\"\nimport { PanelRow } from \"./PanelRow.tsx\"\n\nexport interface FillImageResizeRowProps extends Pick<ReducedFill, \"fillImageResize\"> {\n\tonChangeImageResize: (size: ImageFit) => void\n\ttitle?: string\n\tenabled?: boolean\n}\nconst imageResizeOptions: ImageFit[] = [\"fill\", \"fit\", \"stretch\", \"tile\"]\n\nexport function FillImageResizeRow({\n\ttitle = \"\",\n\tenabled = true,\n\tfillImageResize,\n\tonChangeImageResize,\n}: FillImageResizeRowProps) {\n\treturn (\n\t\t<PanelRow title={title}>\n\t\t\t<PopupButton enabled={enabled} wrapperClassName={doubleColumnClass}>\n\t\t\t\t{imageResizeOptions.map(resizeOption => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<PopupButtonItem\n\t\t\t\t\t\t\tkey={resizeOption}\n\t\t\t\t\t\t\tidentifier={resizeOption}\n\t\t\t\t\t\t\ttitle={capitalizeFirstLetter}\n\t\t\t\t\t\t\tselected={fillImageResize.has(resizeOption)}\n\t\t\t\t\t\t\tonSelect={onChangeImageResize}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t})}\n\t\t\t</PopupButton>\n\t\t</PanelRow>\n\t)\n}\n", "import { NumberInputWithTicker, Slider } from \"@framerjs/fresco\"\nimport type { Reduced } from \"document/models/CanvasTree/traits/utils/Reduced.ts\"\nimport { notFoundToUndefined } from \"document/models/CanvasTree/traits/utils/notFoundToUndefined.ts\"\nimport { roundedNumber } from \"library/index.ts\"\nimport { useCallback } from \"react\"\nimport { isNumber } from \"utils/typeChecks.ts\"\nimport { PanelRow } from \"./PanelRow.tsx\"\n\n// Converts a floating point percentage to a integer percentage\nconst displayValue = (size: Reduced<number | undefined>) => {\n\tconst value = notFoundToUndefined(size)\n\tif (!isNumber(value)) return value\n\n\treturn Math.round(value * 100)\n}\n\ninterface Props {\n\ttitle: string\n\tenabled: boolean\n\tvalue: Reduced<number | undefined>\n\tonChange(value: number): void\n}\n\nexport function FillImageTiledSizeRow({ onChange, value, enabled, title }: Props) {\n\tconst size = displayValue(value)\n\n\tconst onChangeHandler = useCallback(\n\t\t(v: number) => {\n\t\t\tonChange(roundedNumber(v / 100, 2))\n\t\t},\n\t\t[onChange],\n\t)\n\treturn (\n\t\t<PanelRow title={title}>\n\t\t\t<NumberInputWithTicker\n\t\t\t\tenabled={enabled}\n\t\t\t\tprecision={0}\n\t\t\t\tvalue={size}\n\t\t\t\tunit=\"%\"\n\t\t\t\tonChange={onChangeHandler}\n\t\t\t\tmin={1}\n\t\t\t\tstep={1}\n\t\t\t/>\n\t\t\t<Slider enabled={enabled} value={size} min={1} max={200} step={1} onChange={onChangeHandler} />\n\t\t</PanelRow>\n\t)\n}\n", "import type { MouseTrackerEvent } from \"@framerjs/fresco\"\nimport { MouseTracker, ReadOnlyContext, useReadOnly } from \"@framerjs/fresco\"\nimport { cursors, dimensions } from \"@framerjs/fresco/tokens\"\nimport { assert, isMacOS } from \"@framerjs/shared\"\nimport { cx } from \"@linaria/core\"\nimport type { BaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport type { ColorHSVA } from \"library/index.ts\"\nimport { ColorFormat } from \"library/index.ts\"\nimport { P3Color } from \"library/render/types/Color/Color.ts\"\nimport { Color, ConvertColor } from \"library/render/types/Color/index.ts\"\nimport type { Point } from \"library/render/types/Point.ts\"\nimport React from \"react\"\nimport { checkerboard8 } from \"../CheckerboardURLs/index.ts\"\nimport * as styles from \"./ColorPickerInput.styles.ts\"\nimport { ColorPickerMode } from \"./ColorPickerMode.tsx\"\nimport { ColorPickerP3 } from \"./ColorPickerP3.tsx\"\nimport { ColorPickerSampler } from \"./ColorPickerSampler.tsx\"\nimport { HexColorPickerInput } from \"./HexColorPickerInput.tsx\"\nimport { HslColorPickerInput } from \"./HslColorPickerInput.tsx\"\nimport { RgbColorPickerInput } from \"./RgbColorPickerInput.tsx\"\nimport type { ColorModel } from \"./types.ts\"\nimport { showOpacityWarningToast } from \"./utils.ts\"\n\ninterface Props {\n\tcolor: string\n\tonChange: (color: string, final: boolean) => void\n\tcolorModel: ColorModel\n\tclassName?: string\n\tsampleColor: () => void\n\tengine: BaseEngine\n\tallowP3?: boolean\n}\n\ninterface State {\n\tdragging: boolean\n}\n\nfunction hsvToFormatString(color: ColorHSVA, format: ColorFormat): string {\n\tswitch (format) {\n\t\tcase ColorFormat.HSL:\n\t\t\treturn ConvertColor.hsvToHSLString(color)\n\t\tdefault:\n\t\t\treturn ConvertColor.hsvToRgbString(color)\n\t}\n}\n\nexport class ColorPickerInput extends React.Component<Props, State> {\n\toverride state: State = {\n\t\tdragging: false,\n\t}\n\n\tinputRef = React.createRef<HTMLInputElement>()\n\n\t// we need to keep track of the latest hue value because this info gets lost when a color is fully desaturated or with 0 brightness\n\tcurrentHue: number | null = null\n\tdragPosition: null | Point = null\n\n\t// Events\n\tonSaturationBrightnessDrag = (event: MouseTrackerEvent) => {\n\t\tconst { progress } = event\n\t\tconst a = ConvertColor.getAlpha(this.props.color)\n\t\tconst newColor = { h: this.currentHue || 0, s: progress.x, v: 1 - progress.y, a }\n\t\tconst format = Color(this.props.color).format\n\t\tconst result = hsvToFormatString(newColor, format)\n\n\t\tthis.dragPosition = progress\n\n\t\tif (result) {\n\t\t\tthis.onChange(result, false)\n\t\t}\n\t\tif (a === 0) {\n\t\t\tshowOpacityWarningToast()\n\t\t}\n\t}\n\n\tsetColorModel = this.props.engine.scheduler.wrapHandler((nextColorModel: ColorModel) => {\n\t\tswitch (nextColorModel) {\n\t\t\tcase \"P3\": {\n\t\t\t\tif (Color.isP3String(this.props.color)) break\n\t\t\t\tconst color = P3Color.fromRGBString(this.props.color)?.toString()\n\t\t\t\tassert(color, \"Invalid color \" + this.props.color)\n\t\t\t\tthis.onChange(color, true)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tif (!Color.isP3String(this.props.color)) break\n\t\t\t\tconst color = P3Color.fromString(this.props.color)?.toString(\"srgb\")\n\t\t\t\tassert(color, \"Invalid color \" + this.props.color)\n\t\t\t\tthis.onChange(color, true)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tthis.props.engine.stores.persistedUserDefaults.colorModel = nextColorModel\n\t})\n\n\tonSaturationBrightnessDragEnd = this.props.engine.scheduler.wrapHandler(() => {\n\t\tthis.onDragEnd()\n\t})\n\n\tonHueDrag = this.props.engine.scheduler.wrapHandler((event: MouseTrackerEvent) => {\n\t\tconst color: Color = Color(this.props.color)\n\n\t\tconst hsv = ConvertColor.toHSV(this.props.color)\n\t\tthis.currentHue = event.progress.x * 360\n\t\thsv.h = this.currentHue\n\n\t\t// because the color value doesn't update if the color is grayscale\n\t\tif (hsv.s === 0) {\n\t\t\tthis.forceUpdate()\n\t\t}\n\n\t\tconst result = hsvToFormatString(hsv, color.format)\n\t\tif (result) {\n\t\t\tthis.onChange(result, false)\n\t\t}\n\n\t\tif (hsv.a === 0) {\n\t\t\tshowOpacityWarningToast()\n\t\t}\n\t})\n\n\tonOpacityDrag = this.props.engine.scheduler.wrapHandler((event: MouseTrackerEvent) => {\n\t\tconst hsv = ConvertColor.toHSV(this.props.color)\n\t\thsv.a = event.progress.x\n\t\tconst result = hsvToFormatString(hsv, Color(this.props.color).format)\n\t\tif (result) this.onChange(result, false)\n\t})\n\n\tonChange = (color: string, final?: boolean) => {\n\t\tthis.props.onChange(color, final ?? !this.state.dragging)\n\t}\n\n\tonDragStart = this.props.engine.scheduler.wrapHandler(() => {\n\t\tthis.setState({ dragging: true })\n\t\tthis.props.engine.beginUndoGroup()\n\t})\n\n\tonDragEnd = this.props.engine.scheduler.wrapHandler(() => {\n\t\tthis.props.engine.endUndoGroup()\n\t\tthis.setState({ dragging: false })\n\t\tthis.props.onChange(this.props.color, true)\n\t})\n\n\toverride render() {\n\t\t// If the color is a P3 string, we need to use the P3 color picker. The following Color /\n\t\t// ConvertColor conversions for the sRGB picker cannot handle wide gamut color ranges.\n\t\t// Adding support would add unnecessary bundle-size to the library we ship to sites.\n\t\t//\n\t\t// NOTE: When allowP3 is false (e.g. shader color props) but the current value is P3\n\t\t// (from a token), we still render the P3 picker so the actual color is visible, but\n\t\t// in a read-only state to prevent editing into a color space the consumer can't use.\n\t\tif (Color.isP3String(this.props.color)) {\n\t\t\treturn (\n\t\t\t\t<ColorPickerP3\n\t\t\t\t\tcolorString={this.props.color}\n\t\t\t\t\tclassName={this.props.className}\n\t\t\t\t\tstyle={style}\n\t\t\t\t\tonChange={this.props.onChange}\n\t\t\t\t\tonChangeColorModel={this.setColorModel}\n\t\t\t\t\tallowP3={this.props.allowP3}\n\t\t\t\t\tdisabled={this.props.allowP3 === false}\n\t\t\t\t/>\n\t\t\t)\n\t\t}\n\n\t\tconst { color, className } = this.props\n\t\tconst hsv = ConvertColor.toHSV(color)\n\n\t\tif (!this.currentHue) {\n\t\t\tthis.currentHue = Math.round(hsv.h)\n\t\t} else if (hsv.s !== 0 && hsv.v !== 0 && !(hsv.h === 0 && this.currentHue === 360) && !this.state.dragging) {\n\t\t\tthis.currentHue = Math.round(hsv.h)\n\t\t}\n\n\t\tconst currentHue = this.currentHue\n\n\t\tlet v = 1 - hsv.v\n\t\tlet s = hsv.s\n\n\t\tif (this.dragPosition !== null) {\n\t\t\tv = this.dragPosition.y\n\t\t\ts = this.dragPosition.x\n\t\t}\n\n\t\tif (!this.state.dragging && this.dragPosition !== null) {\n\t\t\tthis.dragPosition = null\n\t\t}\n\n\t\treturn (\n\t\t\t<ReadOnlyContext.Consumer>\n\t\t\t\t{isReadOnly => (\n\t\t\t\t\t<div className={className} style={style}>\n\t\t\t\t\t\t<div className={cx(styles.square, isReadOnly && styles.readOnly)} style={squareColor(currentHue)}>\n\t\t\t\t\t\t\t<MouseTracker\n\t\t\t\t\t\t\t\tonDragStart={this.onDragStart}\n\t\t\t\t\t\t\t\tonDrag={this.onSaturationBrightnessDrag}\n\t\t\t\t\t\t\t\tonDragEnd={this.onSaturationBrightnessDragEnd}\n\t\t\t\t\t\t\t\tstyle={squareInset}\n\t\t\t\t\t\t\t\tenabled={!isReadOnly}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div style={indicatorStyle(s, v, isReadOnly)} />\n\t\t\t\t\t\t\t</MouseTracker>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\twidth: \"100%\",\n\t\t\t\t\t\t\t\tdisplay: \"flex\",\n\t\t\t\t\t\t\t\tmargin: `${dimensions.css.inputSpacing} 0`,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={cx(isReadOnly && styles.readOnly)}\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tdisplay: \"flex\",\n\t\t\t\t\t\t\t\t\tflexDirection: \"column\",\n\t\t\t\t\t\t\t\t\tflexGrow: 1,\n\t\t\t\t\t\t\t\t\tjustifyContent: \"center\",\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<MouseTracker\n\t\t\t\t\t\t\t\t\tonDragStart={this.onDragStart}\n\t\t\t\t\t\t\t\t\tonDrag={this.onHueDrag}\n\t\t\t\t\t\t\t\t\tonDragEnd={this.onDragEnd}\n\t\t\t\t\t\t\t\t\tenabled={!isReadOnly}\n\t\t\t\t\t\t\t\t\tstyle={hueSlider}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div style={indicatorOffset}>\n\t\t\t\t\t\t\t\t\t\t<div style={indicatorStyle(currentHue / 360, undefined, isReadOnly)} />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</MouseTracker>\n\t\t\t\t\t\t\t\t<MouseTracker\n\t\t\t\t\t\t\t\t\tonDragStart={this.onDragStart}\n\t\t\t\t\t\t\t\t\tonDrag={this.onOpacityDrag}\n\t\t\t\t\t\t\t\t\tonDragEnd={this.onDragEnd}\n\t\t\t\t\t\t\t\t\tenabled={!isReadOnly}\n\t\t\t\t\t\t\t\t\tstyle={opacitySliderStyle(color)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div style={checkerboardPattern} />\n\t\t\t\t\t\t\t\t\t<div style={indicatorOffset}>\n\t\t\t\t\t\t\t\t\t\t<div style={indicatorStyle(hsv.a, undefined, isReadOnly)} />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</MouseTracker>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<ColorPickerInputs\n\t\t\t\t\t\t\tcolorModel={this.props.colorModel}\n\t\t\t\t\t\t\tcolorString={this.props.color}\n\t\t\t\t\t\t\tonChange={this.onChange}\n\t\t\t\t\t\t\tsampleColor={this.props.sampleColor}\n\t\t\t\t\t\t\tsetColorModel={this.setColorModel}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<div className={styles.inputContainer}>\n\t\t\t\t\t\t\t<ColorPickerMode\n\t\t\t\t\t\t\t\tcolorModel={this.props.colorModel === \"P3\" ? \"RGB\" : this.props.colorModel}\n\t\t\t\t\t\t\t\tonChangeColorModel={this.setColorModel}\n\t\t\t\t\t\t\t\tallowP3={this.props.allowP3}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{isMacOS() || \"EyeDropper\" in window ? (\n\t\t\t\t\t\t\t\t<ColorPickerSampler onChange={this.onChange} enabled={!isReadOnly} className={styles.sampler} />\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</ReadOnlyContext.Consumer>\n\t\t)\n\t}\n}\n\nfunction ColorPickerInputs({\n\tcolorModel,\n\tcolorString,\n\tonChange,\n\tsampleColor,\n\tsetColorModel,\n}: {\n\tcolorModel: ColorModel\n\tcolorString: string\n\tonChange: (color: string) => void\n\tsampleColor: () => void\n\tsetColorModel: (colorModel: ColorModel) => void\n}) {\n\tconst readOnly = useReadOnly()\n\tswitch (colorModel) {\n\t\tcase \"HSL\":\n\t\t\treturn <HslColorPickerInput value={ConvertColor.toHSL(colorString)} onChange={onChange} enabled={!readOnly} />\n\t\tcase \"HEX\":\n\t\t\treturn (\n\t\t\t\t<HexColorPickerInput\n\t\t\t\t\tvalue={ConvertColor.toRgb(colorString)}\n\t\t\t\t\tonChange={onChange}\n\t\t\t\t\tsampleColor={sampleColor}\n\t\t\t\t\tsetColorModel={setColorModel}\n\t\t\t\t\tenabled={!readOnly}\n\t\t\t\t/>\n\t\t\t)\n\t\t// P3 Colors have a separate picker so should never be rendered here and can be ignored.\n\t\tdefault:\n\t\t\treturn <RgbColorPickerInput value={ConvertColor.toRgb(colorString)} onChange={onChange} enabled={!readOnly} />\n\t}\n}\n\n// CSS\n\nfunction squareColor(currentHue: number): React.CSSProperties {\n\treturn {\n\t\tbackgroundColor: `${ConvertColor.toColorPickerSquare(currentHue)}`,\n\t}\n}\n\nconst squareInset: React.CSSProperties = {\n\tposition: \"absolute\",\n\ttop: 1,\n\tright: 1,\n\tbottom: 1,\n\tleft: 1,\n}\n\nconst style: React.CSSProperties = {\n\tposition: \"relative\",\n}\n\nconst horizontalSlider: React.CSSProperties = {\n\tposition: \"relative\",\n\twidth: \"100%\",\n\theight: 8,\n\toverflow: \"visible\",\n\tborderRadius: 6,\n}\n\nconst hueSlider: React.CSSProperties = {\n\t...horizontalSlider,\n\tmarginBottom: 8,\n\tbackgroundImage:\n\t\t\"linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)\",\n}\n\nfunction opacitySliderStyle(color: string): React.CSSProperties {\n\treturn {\n\t\t...horizontalSlider,\n\t\tbackgroundImage: `linear-gradient(to right, ${ConvertColor.setAlpha(color, 0)}, ${ConvertColor.setAlpha(\n\t\t\tcolor,\n\t\t\t1,\n\t\t)})`,\n\t\tbackgroundRepeat: \"no-repeat\",\n\t}\n}\n\nconst indicatorOffset: React.CSSProperties = { position: \"absolute\", height: \"100%\", top: 0, left: 4, right: 4 }\n\nconst indicator: React.CSSProperties = {\n\tposition: \"absolute\",\n\twidth: 14,\n\theight: 14,\n\ttop: \"50%\",\n\ttransform: \"translateX(-50%) translateY(-50%)\",\n\tborderRadius: \"50%\",\n\tboxShadow: \"inset 0 0 0 3px white, inset 0 0 0 4px rgba(0,0,0,.1), 0 0 0 1px rgba(0,0,0,.1)\",\n\tcursor: cursors.button,\n}\n\nfunction indicatorStyle(x: number, y: number = 0.5, readonly: boolean): React.CSSProperties {\n\treturn { ...indicator, left: `${x * 100}%`, top: `${y * 100}%`, pointerEvents: readonly ? \"none\" : undefined }\n}\n\nconst checkerboardPattern: React.CSSProperties = {\n\tposition: \"absolute\",\n\twidth: \"100%\",\n\theight: \"100%\",\n\tbackgroundImage: `url(${checkerboard8})`,\n\tbackgroundRepeat: \"repeat\",\n\tborderRadius: 10,\n\tzIndex: -1, // we want the checkerboard to be behind the color gradient\n}\n", "import \"ColorPickerInput.styles_1fb6rar.wyw.css\"; export const colorPickerRectHeight = 125;\nexport const colorPickerRectWidth = 230;\nexport const square = \"square_s1e2z0bv\";\nexport const readOnly = \"readOnly_rb8k8h9\";\nexport const inputContainer = \"inputContainer_iihdl0y\";\nexport const splitInputContainer = \"splitInputContainer_swsq73a\";\nexport const twoValuesSplitInput = \"twoValuesSplitInput_t1ecuz16\";\nexport const fourValuesEvenSplitInput = \"fourValuesEvenSplitInput_f10aiog9\";\nexport const input = \"input_i19bkgmo\";\nexport const hexInput = \"hexInput_hqo5o69\";\nexport const leftSplitInput = \"leftSplitInput_l7n5mtt\";\nexport const centerSplitInput = \"centerSplitInput_c1424kp4\";\nexport const rightSplitInput = \"rightSplitInput_r1k5sn29\";\nexport const sampler = \"sampler_s1hh4y0v\";", "import { PopupButton, PopupButtonItem, ReadOnlyContext, useReadOnly } from \"@framerjs/fresco\"\nimport { type ColorModel, allColorModels } from \"./types.ts\"\n\nexport function ColorPickerMode({\n\tcolorModel,\n\tonChangeColorModel,\n\tallowP3 = true,\n}: {\n\tcolorModel: ColorModel\n\tonChangeColorModel: (colorModel: ColorModel) => void\n\tallowP3?: boolean\n}) {\n\tconst readonly = useReadOnly()\n\treturn (\n\t\t// Even when the app is in read-only mode, we want to allow the user to change the color\n\t\t// model to see the value in different formats.\n\t\t<ReadOnlyContext.Provider value={false}>\n\t\t\t<PopupButton>\n\t\t\t\t{allColorModels.map(option => {\n\t\t\t\t\tconst isP3 = option === \"P3\"\n\t\t\t\t\t// Switching to/from P3 requires updating the value in the tree, so is\n\t\t\t\t\t// not allowed in read-only mode. P3 is also disabled when allowP3 is false\n\t\t\t\t\t// (e.g. shader color controls which only support sRGB).\n\t\t\t\t\tlet enabled = colorModel === \"P3\" || isP3 ? !readonly : true\n\t\t\t\t\tif (isP3 && !allowP3) enabled = false\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<PopupButtonItem\n\t\t\t\t\t\t\tkey={option}\n\t\t\t\t\t\t\ttitle={option}\n\t\t\t\t\t\t\tidentifier={option}\n\t\t\t\t\t\t\tselected={option === colorModel}\n\t\t\t\t\t\t\tonSelect={onChangeColorModel}\n\t\t\t\t\t\t\tenabled={enabled}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t})}\n\t\t\t</PopupButton>\n\t\t</ReadOnlyContext.Provider>\n\t)\n}\n", "import { MouseTracker, type MouseTrackerEvent, NumberInputWithTicker, useReadOnly } from \"@framerjs/fresco\"\nimport { assert, isMacOS } from \"@framerjs/shared\"\nimport { cx } from \"@linaria/core\"\nimport { useBaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport { useEngineCallback } from \"document/useEngineCallback.ts\"\nimport { interpolate } from \"framer-motion\"\nimport type { ColorRGBA, Point } from \"library/index.ts\"\nimport { P3Color } from \"library/render/types/Color/Color.ts\"\nimport React from \"react\"\nimport { useForceUpdate } from \"utils/useForceUpdate.ts\"\nimport { colorPickerRectHeight, colorPickerRectWidth } from \"./ColorPickerInput.styles.ts\"\nimport * as inputStyles from \"./ColorPickerInput.styles.ts\"\nimport { ColorPickerMode } from \"./ColorPickerMode.tsx\"\nimport * as styles from \"./ColorPickerP3.styles.ts\"\nimport { ColorPickerSampler } from \"./ColorPickerSampler.tsx\"\nimport type { ColorModel } from \"./types.ts\"\nimport { decimalToRoundedAndClampedPercentage, showOpacityWarningToast } from \"./utils.ts\"\n\ntype Props = React.PropsWithChildren<{\n\tcolorString: string\n\tclassName?: string\n\tstyle?: React.CSSProperties\n\tonChange: (color: string, final: boolean) => void\n\tonChangeColorModel: (colorModel: ColorModel) => void\n\tallowP3?: boolean\n\tdisabled?: boolean\n}>\n\nfunction clamp(value: number) {\n\treturn Math.max(0, Math.min(value, 1))\n}\n\n/**\n * A traditional rectangular color picker manipulates color in the HSV syntax, however P3 is stored\n * in RGBA channels.\n *\n * To manipulate the P3 color using an HSV color picker, we can convert the P3 color into an HSV\n * format, but not into an sRGB color space.\n *\n * This let's us manipulate the P3 color by modifying HSV values, then convert it back to P3,\n * without clamping it into the sRGB color space.\n */\nfunction useP3HSV(colorString: string) {\n\treturn React.useMemo(() => {\n\t\tconst p3 = P3Color.fromString(colorString)\n\t\tassert(p3, \"Invalid color \" + colorString)\n\t\treturn { hsv: p3.hsv(), p3 }\n\t}, [colorString])\n}\n\nexport const ColorPickerP3 = React.memo(function ColorPickerInputP3({\n\tclassName,\n\tstyle,\n\tcolorString,\n\tonChange,\n\tonChangeColorModel,\n\tallowP3,\n\tdisabled,\n}: Props) {\n\tconst engine = useBaseEngine()\n\tconst readOnly = useReadOnly() || !!disabled\n\tconst { hsv, p3 } = useP3HSV(colorString)\n\tconst { h, s, v, a } = hsv\n\tconst dragging = React.useRef(false)\n\tconst position = React.useRef<Point | undefined>(undefined)\n\tconst hue = React.useRef<number>(h)\n\tconst forceUpdate = useForceUpdate()\n\n\tconst onDragStart = useEngineCallback(() => {\n\t\tengine.beginUndoGroup()\n\t}, [])\n\n\tconst onDragEnd = useEngineCallback(() => {\n\t\tengine.endUndoGroup()\n\t}, [])\n\n\tconst onOpacityDrag = useEngineCallback(\n\t\t(event: MouseTrackerEvent) => {\n\t\t\tconst value = P3Color.fromString(colorString)?.toString(\"p3\", { a: clamp(event.progress.x ?? 1) })\n\t\t\tassert(value, \"Invalid color \" + colorString)\n\t\t\tonChange(value, false)\n\t\t},\n\t\t[colorString, onChange],\n\t)\n\n\tconst onHueDrag = useEngineCallback(\n\t\t(event: MouseTrackerEvent) => {\n\t\t\tconst nextHue = event.progress.x * 360\n\t\t\tconst value = P3Color.fromHSV({ h: nextHue, s, v, a }).toString()\n\t\t\tonChange(value, false)\n\t\t\thue.current = nextHue\n\t\t\tif (a === 0) showOpacityWarningToast()\n\t\t\t// The color string doesn't change if the color is black, but we want to rerender with\n\t\t\t// the local hue value.\n\t\t\tif (s === 0) forceUpdate()\n\t\t},\n\t\t[s, v, a, onChange, forceUpdate],\n\t)\n\n\tconst onSaturationBrightnessDrag = useEngineCallback(\n\t\t(event: MouseTrackerEvent) => {\n\t\t\tconst { progress } = event\n\t\t\tdragging.current = true\n\t\t\tposition.current = progress\n\t\t\tconst value = P3Color.fromHSV({ h: hue.current, s: progress.x, v: 1 - progress.y, a }).toString()\n\t\t\tonChange(value, true)\n\t\t\tif (a === 0) showOpacityWarningToast()\n\t\t\tif (progress.x === 0 || 1 - progress.y === 0) forceUpdate()\n\t\t},\n\t\t[a, onChange, forceUpdate],\n\t)\n\n\tconst onSaturationBrightnessDragEnd = useEngineCallback(() => {\n\t\tdragging.current = false\n\t\tposition.current = undefined\n\t\tonDragEnd()\n\t}, [])\n\n\tconst onChangeInput = React.useCallback(\n\t\t(value: string) => {\n\t\t\tonChange(value, true)\n\t\t},\n\t\t[onChange],\n\t)\n\n\t// When we are dragging the saturation/value sliders, we don't want to lose the current hue when\n\t// we hit pure white or pure black, so we use the last hue in memory for rendering. When the\n\t// saturation/value become non-zero again, we restore the hue from the colorString to ensure we\n\t// are rendering an accurate color, for example when the color is being changed by the number\n\t// inputs.\n\tif (s !== 0 && v !== 0 && !(h === 0 && hue.current === 360) && !dragging.current) {\n\t\thue.current = h\n\t}\n\n\tconst color = P3Color.fromHSV({ h: hue.current, s: 1, v: 1, a: 1 })\n\tconst hueColorString = color.toString()\n\tconst hueColorStringRGB = color.toString(\"srgb\")\n\n\tconst square: React.CSSProperties = {\n\t\t// To render the Saturation/Brightness square, as well as the Alpha slider, we need to be\n\t\t// able to fallback to the sRGB version of the max saturation/value color for browsers that\n\t\t// don't support the P3 color syntax. Simply using the RGB values of the HSV color works\n\t\t// fine here.\n\t\t\"--hue\": hueColorStringRGB,\n\t\t\"--hue-p3\": hueColorString,\n\t}\n\n\tconst slider: React.CSSProperties = {\n\t\t// We use rgba and multiply by 255 instead of color(srgb 1 1 1) here because we are\n\t\t// specifically handling devices that don't support the color() syntax.\n\t\t\"--slider-alpha-0\": color.toString(\"srgb\", { a: 0 }),\n\t\t\"--slider-alpha-1\": hueColorStringRGB,\n\t\t\"--slider-p3-alpha-0\": color.toString(\"p3\", { a: 0 }),\n\t\t\"--slider-p3-alpha-1\": hueColorString,\n\t}\n\n\tconst saturation = position.current?.x ?? s\n\tconst value = position.current?.y ?? 1 - v\n\tif (!dragging.current) position.current = undefined\n\n\treturn (\n\t\t<div className={className} style={style}>\n\t\t\t<div className={cx(styles.square, readOnly && styles.readOnly)} style={square}>\n\t\t\t\t<MouseTracker\n\t\t\t\t\tonDragStart={onDragStart}\n\t\t\t\t\tonDrag={onSaturationBrightnessDrag}\n\t\t\t\t\tonDragEnd={onSaturationBrightnessDragEnd}\n\t\t\t\t\tclassName={styles.squareInset}\n\t\t\t\t\tenabled={!readOnly}\n\t\t\t\t>\n\t\t\t\t\t<div className={styles.indicator} style={indicatorPositionStyle(saturation, value, readOnly)} />\n\t\t\t\t\t<P3BoundaryPolyline hue={hue.current} />\n\t\t\t\t</MouseTracker>\n\t\t\t</div>\n\t\t\t<div className={styles.controls}>\n\t\t\t\t<div className={cx(readOnly && styles.readOnly, styles.hueOpacityGroup)}>\n\t\t\t\t\t<MouseTracker\n\t\t\t\t\t\tonDragStart={onDragStart}\n\t\t\t\t\t\tonDrag={onHueDrag}\n\t\t\t\t\t\tonDragEnd={onDragEnd}\n\t\t\t\t\t\tenabled={!readOnly}\n\t\t\t\t\t\tclassName={styles.hueSlider}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className={styles.indicatorOffset}>\n\t\t\t\t\t\t\t<div className={styles.indicator} style={indicatorPositionStyle(hue.current / 360, 0.5, readOnly)} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</MouseTracker>\n\t\t\t\t\t<MouseTracker\n\t\t\t\t\t\tonDragStart={onDragStart}\n\t\t\t\t\t\tonDrag={onOpacityDrag}\n\t\t\t\t\t\tonDragEnd={onDragEnd}\n\t\t\t\t\t\tenabled={!readOnly}\n\t\t\t\t\t\tstyle={slider}\n\t\t\t\t\t\tclassName={styles.opacitySlider}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className={styles.checkerboard} />\n\t\t\t\t\t\t<div className={styles.indicatorOffset}>\n\t\t\t\t\t\t\t<div className={styles.indicator} style={indicatorPositionStyle(a, 0.5, readOnly)} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</MouseTracker>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<P3ColorPickerInput value={p3} onChange={onChangeInput} enabled={!readOnly} />\n\t\t\t<div className={styles.inputContainer}>\n\t\t\t\t<ColorPickerMode colorModel=\"P3\" onChangeColorModel={onChangeColorModel} allowP3={allowP3} />\n\t\t\t\t{isMacOS() || \"EyeDropper\" in window ? (\n\t\t\t\t\t<ColorPickerSampler onChange={onChangeInput} enabled={!readOnly} className={styles.sampler} />\n\t\t\t\t) : null}\n\t\t\t</div>\n\t\t</div>\n\t)\n})\n\nfunction indicatorPositionStyle(x: number, y: number, readonly: boolean): React.CSSProperties {\n\treturn {\n\t\tleft: `${x * 100}%`,\n\t\ttop: `${y * 100}%`,\n\t\tpointerEvents: readonly ? \"none\" : undefined,\n\t}\n}\n\nfunction range(start: number, end: number, step: number) {\n\tconst length = Math.max(Math.ceil((end - start) / (step || 1)), 0)\n\tconst result: number[] = []\n\tfor (let index = 0; index < length; index++) {\n\t\tresult[index] = start\n\t\tstart += step\n\t}\n\treturn result\n}\n\n// To calculate the points for the boundary polygon that shows how far outside of the sRGB color\n// gamut a P3 color is, we calculate the saturation and value points for the sRGB color gamut in P3\n// based on the current hue. These points will be < 1 and represent the difference between the max\n// values achievable in p3 and the max values available in srgb.\nconst saturationRange = range(0, 1, 0.01)\nconst valueRange = range(1, 0, -0.01)\n\nfunction getSaturationPoints(hue: number): [number, number][] {\n\treturn saturationRange.map((sat: number) => {\n\t\tconst { s, v } = P3Color.fromHSV({ h: hue, s: sat, v: 1, a: 1 }, \"srgb\").hsv()\n\t\treturn [s, v]\n\t})\n}\nfunction getValuePoints(hue: number): [number, number][] {\n\treturn valueRange.map((value: number) => {\n\t\tconst { s, v } = P3Color.fromHSV({ h: hue, s: 1, v: value, a: 1 }, \"srgb\").hsv()\n\t\treturn [s, v]\n\t})\n}\n\nconst transformX = interpolate([0, 1], [0, colorPickerRectWidth])\nconst transformY = interpolate([0, 1], [0, colorPickerRectHeight])\n\nfunction P3BoundaryPolyline({ hue }: { hue: number }) {\n\tconst points = React.useMemo(() => {\n\t\tlet points = \"\"\n\t\tfor (const point of getSaturationPoints(hue).concat(getValuePoints(hue))) {\n\t\t\tpoints += `${transformX(point[0])}, ${transformY(1 - point[1])} `\n\t\t}\n\t\treturn points\n\t}, [hue])\n\n\treturn (\n\t\t<svg viewBox={`0 0 ${colorPickerRectWidth} ${colorPickerRectHeight}`} role=\"presentation\" className={styles.poly}>\n\t\t\t<polyline points={points} />\n\t\t</svg>\n\t)\n}\n\nfunction clampP3Channel(value: number) {\n\treturn Math.trunc(Math.min(Math.max(value, 0), 1) * 1000) / 1000\n}\n\nfunction useColorInputHandler(key: keyof ColorRGBA, value: ColorRGBA, onChange: (value: string) => void) {\n\treturn React.useCallback(\n\t\t(newValue: number) => {\n\t\t\tconst rawNewValue = key === \"a\" ? newValue / 100 : newValue\n\t\t\tconst currentValue = value[key]\n\n\t\t\tif (rawNewValue === currentValue) return\n\n\t\t\tconst color = new P3Color({ r: value.r, g: value.g, b: value.b, a: value.a ?? 1 }).toString(\"p3\", {\n\t\t\t\t[key]: rawNewValue,\n\t\t\t})\n\n\t\t\tonChange(color)\n\t\t\tif (key === \"a\" && rawNewValue === 0) showOpacityWarningToast()\n\t\t},\n\t\t[key, value, onChange],\n\t)\n}\n\nfunction P3ColorPickerInput({\n\tvalue,\n\tonChange,\n\tenabled,\n}: {\n\tvalue: ColorRGBA\n\tonChange: (value: string) => void\n\tenabled?: boolean\n}) {\n\tconst handleRedInputChange = useColorInputHandler(\"r\", value, onChange)\n\tconst handleGreenInputChange = useColorInputHandler(\"g\", value, onChange)\n\tconst handleBlueInputChange = useColorInputHandler(\"b\", value, onChange)\n\tconst handleAlphaInputChange = useColorInputHandler(\"a\", value, onChange)\n\n\treturn (\n\t\t<div className={cx(inputStyles.splitInputContainer, inputStyles.fourValuesEvenSplitInput)}>\n\t\t\t<NumberInputWithTicker\n\t\t\t\tvalue={clampP3Channel(value.r)}\n\t\t\t\tonChange={handleRedInputChange}\n\t\t\t\tmin={0}\n\t\t\t\tmax={1}\n\t\t\t\tstep={0.01}\n\t\t\t\tenabled={enabled}\n\t\t\t\tclassName={inputStyles.input}\n\t\t\t\twrapperClassName={inputStyles.leftSplitInput}\n\t\t\t\ttitle=\"Red\"\n\t\t\t\tdata-testid=\"p3-red-color-input\"\n\t\t\t/>\n\n\t\t\t<NumberInputWithTicker\n\t\t\t\tvalue={clampP3Channel(value.g)}\n\t\t\t\tonChange={handleGreenInputChange}\n\t\t\t\tmin={0}\n\t\t\t\tstep={0.01}\n\t\t\t\tmax={1}\n\t\t\t\tenabled={enabled}\n\t\t\t\tclassName={inputStyles.input}\n\t\t\t\twrapperClassName={inputStyles.centerSplitInput}\n\t\t\t\ttitle=\"Green\"\n\t\t\t\tdata-testid=\"p3-green-color-input\"\n\t\t\t/>\n\n\t\t\t<NumberInputWithTicker\n\t\t\t\tvalue={clampP3Channel(value.b)}\n\t\t\t\tonChange={handleBlueInputChange}\n\t\t\t\tmin={0}\n\t\t\t\tmax={1}\n\t\t\t\tstep={0.01}\n\t\t\t\tenabled={enabled}\n\t\t\t\tclassName={inputStyles.input}\n\t\t\t\twrapperClassName={inputStyles.centerSplitInput}\n\t\t\t\ttitle=\"Blue\"\n\t\t\t\tdata-testid=\"p3-blue-color-input\"\n\t\t\t/>\n\n\t\t\t<NumberInputWithTicker\n\t\t\t\tvalue={decimalToRoundedAndClampedPercentage(value?.a ?? 1)}\n\t\t\t\tonChange={handleAlphaInputChange}\n\t\t\t\tunit=\"%\"\n\t\t\t\tmin={0}\n\t\t\t\tstep={1}\n\t\t\t\tmax={100}\n\t\t\t\tenabled={enabled}\n\t\t\t\tclassName={inputStyles.input}\n\t\t\t\twrapperClassName={inputStyles.rightSplitInput}\n\t\t\t\ttitle=\"Alpha\"\n\t\t\t\tdata-testid=\"p3-alpha-color-input\"\n\t\t\t/>\n\t\t</div>\n\t)\n}\n", "import \"ColorPickerP3.styles_138c6ny.wyw.css\"; export const squareInset = \"squareInset_s1547mmt\";\nexport const square = \"square_siommo3\";\nexport const indicator = \"indicator_ixdcado\";\nexport const controls = \"controls_csdqxt6\";\nexport const hueOpacityGroup = \"hueOpacityGroup_h10f07ai\";\nexport const indicatorOffset = \"indicatorOffset_i1y4xa9u\";\nexport const checkerboard = \"checkerboard_cawslk\";\nexport const opacitySlider = \"opacitySlider_o104dadf\";\nexport const readOnly = \"readOnly_r1u3lu2p\";\nexport const hueSlider = \"hueSlider_hz6ma7m\";\nexport const poly = \"poly_p1bt5whn\";\nexport const inputContainer = \"inputContainer_iehmvlc\";\nexport const popupButton = \"popupButton_p1lr44ru\";\nexport const sampler = \"sampler_s1klz3oz\";", "import \"ColorPickerSampler.styles_rwut3d.wyw.css\"; export const sampler = \"sampler_s10ppfb8\";\nexport const inlineSampler = \"inlineSampler_itu3uif\";", "import { Button, IconPipette } from \"@framerjs/fresco\"\nimport { unhandledError } from \"@framerjs/shared\"\nimport { cx } from \"@linaria/core\"\nimport { useBaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport { sampleColor } from \"document/components/tools/utils/sampleColor.ts\"\nimport * as styles from \"./ColorPickerSampler.styles.ts\"\n\ninterface Props {\n\tenabled?: boolean\n\tclassName?: string\n\tonChange: (color: string) => void\n}\n\nexport function ColorPickerSampler({ enabled, className, onChange }: Props) {\n\tconst engine = useBaseEngine()\n\tconst onColorSample = engine.scheduler.wrapHandler(() => {\n\t\tsampleColor(engine)\n\t\t\t.then(color => {\n\t\t\t\tif (!color) return\n\t\t\t\tonChange(color)\n\t\t\t})\n\t\t\t.catch(unhandledError)\n\t})\n\n\treturn (\n\t\t<Button className={cx(styles.sampler, className)} enabled={enabled} onClick={onColorSample} title=\"Sample Color\">\n\t\t\t<IconPipette />\n\t\t</Button>\n\t)\n}\n", "import { NumberInputWithTicker, TextInput } from \"@framerjs/fresco\"\nimport { cx } from \"@linaria/core\"\nimport { getActionAccelerator } from \"app/AppAccelerators.ts\"\nimport type { ColorRGBA } from \"library/index.ts\"\nimport { Color, ConvertColor } from \"library/index.ts\"\nimport type React from \"react\"\nimport { keyboardEventToBrowserAccelerator } from \"web/pages/project/lib/KeyBindings.ts\"\nimport * as styles from \"./ColorPickerInput.styles.ts\"\nimport type { ColorModel } from \"./types.ts\"\nimport { decimalToRoundedAndClampedPercentage, showOpacityWarningToast } from \"./utils.ts\"\n\ninterface Props {\n\tvalue: ColorRGBA\n\tonChange: (color: string) => void\n\tsampleColor: () => void\n\tsetColorModel: (colorModel: ColorModel) => void\n\tenabled?: boolean\n}\n\nexport function HexColorPickerInput({ value, onChange, sampleColor, setColorModel, enabled }: Props) {\n\tconst handleInputChange = (newValue: string, final: boolean, reset: () => void) => {\n\t\t// Hex input is the only free form input. User can input anything, but we need to validate it.\n\t\t// We also want to handle any color format here and navigate to the correct color model.\n\t\t// For example, if the user inputs `hsl(0, 100%, 50%)` we accept it and navigate to the HSL model.\n\n\t\t// Handle single or double character hex inputs (with or without `#` prefix)\n\t\tif (newValue.match(/^#?[a-f\\d]{1,2}$/iu)) {\n\t\t\tlet hexValue = newValue.startsWith(\"#\") ? newValue.slice(1) : newValue\n\t\t\tif (hexValue.length === 1) {\n\t\t\t\thexValue = hexValue.repeat(6)\n\t\t\t} else if (hexValue.length === 2) {\n\t\t\t\thexValue = hexValue.repeat(3)\n\t\t\t}\n\t\t\tnewValue = \"#\" + hexValue\n\t\t}\n\n\t\tif (!ConvertColor.isValid(newValue)) return\n\n\t\tif (newValue.startsWith(\"hsl(\") || newValue.startsWith(\"hsla(\")) setColorModel(\"HSL\")\n\t\tif (newValue.startsWith(\"rgb(\") || newValue.startsWith(\"rgba(\")) setColorModel(\"RGB\")\n\n\t\t// `333` or `AAA` is a valid color, but not according to React (or CSS) unless we prefix a `#`\n\t\tif (newValue.match(/^[a-f\\d]+$/iu)) {\n\t\t\tnewValue = \"#\" + newValue\n\t\t}\n\t\t// HSV is a valid input, but it needs to be converted to HSL to use in CSS\n\t\tif (newValue.startsWith(\"hsv\")) {\n\t\t\tnewValue = Color.toHslString(Color(newValue))\n\t\t}\n\t\t// Value only contains letter characters, this is probably a CSS named color\n\t\t// CSS named colors are incompatible with our graphic layers\n\t\tif (/^[a-z]+$/i.test(newValue.trim())) {\n\t\t\tnewValue = Color.toHslString(Color(newValue))\n\t\t}\n\n\t\tconst newValueRgb = ConvertColor.toRgb(newValue)\n\n\t\tconst hasExplicitAlpha =\n\t\t\tnewValue.startsWith(\"rgba(\") ||\n\t\t\tnewValue.startsWith(\"hsla(\") ||\n\t\t\t(newValue.startsWith(\"#\") && newValue.length === 9)\n\n\t\tif (hasExplicitAlpha) {\n\t\t\tconst alpha = ConvertColor.getAlpha(newValue)\n\t\t\tif (alpha === 0) showOpacityWarningToast()\n\t\t} else {\n\t\t\t// If the user didn't specify an alpha, we want to preserve the current alpha\n\t\t\tnewValueRgb.a = value.a\n\t\t}\n\n\t\tif (Color.equal(Color(newValueRgb), Color(value))) return reset()\n\t\tonChange(ConvertColor.rgbaToString(newValueRgb))\n\t}\n\n\tconst handleAlphaChange = (newAlpha: number) => {\n\t\tconst newColor = { ...value, a: newAlpha / 100 }\n\t\tconst result = ConvertColor.rgbaToString(newColor)\n\n\t\tif (result) onChange(result)\n\t\tif (newColor.a === 0) showOpacityWarningToast()\n\t}\n\n\tconst onKeyDown = (event: React.KeyboardEvent) => {\n\t\t// We are handling the sampleColor shortcut here explicitly, because we\n\t\t// generally disable app shortcuts inside of input fields\n\t\tconst accelerator = getActionAccelerator(\"sampleColor\")\n\t\tif (accelerator === keyboardEventToBrowserAccelerator(event)) {\n\t\t\tsampleColor()\n\t\t}\n\t}\n\n\treturn (\n\t\t<div className={cx(styles.splitInputContainer, styles.twoValuesSplitInput)}>\n\t\t\t<TextInput\n\t\t\t\tvalue={ConvertColor.rgbToHexValue(value).toLocaleUpperCase()}\n\t\t\t\tonChange={handleInputChange}\n\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\tclassName={cx(styles.input, styles.hexInput)}\n\t\t\t\tdata-testid=\"hex-color-input\"\n\t\t\t/>\n\n\t\t\t<NumberInputWithTicker\n\t\t\t\tvalue={decimalToRoundedAndClampedPercentage(value.a)}\n\t\t\t\tonChange={handleAlphaChange}\n\t\t\t\tunit=\"%\"\n\t\t\t\tmin={0}\n\t\t\t\tstep={1}\n\t\t\t\tmax={100}\n\t\t\t\tenabled={enabled}\n\t\t\t\tclassName={styles.input}\n\t\t\t\ttitle=\"Alpha\"\n\t\t\t\tdata-testid=\"hex-alpha-color-input\"\n\t\t\t/>\n\t\t</div>\n\t)\n}\n", "import { NumberInputWithTicker } from \"@framerjs/fresco\"\nimport type { ColorHSLA } from \"library/index.ts\"\nimport { ConvertColor, cx } from \"library/index.ts\"\nimport React from \"react\"\nimport * as styles from \"./ColorPickerInput.styles.ts\"\nimport { decimalToRoundedAndClampedPercentage, showOpacityWarningToast } from \"./utils.ts\"\n\ninterface Props {\n\tvalue: ColorHSLA\n\tonChange: (value: string) => void\n\tenabled?: boolean\n}\n\nfunction useColorInputHandler(key: keyof ColorHSLA, value: ColorHSLA, onChange: (value: string) => void) {\n\treturn React.useCallback(\n\t\t(newValue: number) => {\n\t\t\tconst rawNewValue = key !== \"h\" ? newValue / 100 : newValue\n\t\t\tif (rawNewValue === value[key]) return\n\t\t\tconst newHsl = { ...value, [key]: rawNewValue }\n\t\t\tonChange(ConvertColor.hslToString(newHsl))\n\t\t\tif (key === \"a\" && rawNewValue === 0) showOpacityWarningToast()\n\t\t},\n\t\t[key, value, onChange],\n\t)\n}\n\nexport function HslColorPickerInput({ value, onChange, enabled }: Props) {\n\tconst handleHueInputChange = useColorInputHandler(\"h\", value, onChange)\n\tconst handleSaturationInputChange = useColorInputHandler(\"s\", value, onChange)\n\tconst handleLightnessInputChange = useColorInputHandler(\"l\", value, onChange)\n\tconst handleAlphaInputChange = useColorInputHandler(\"a\", value, onChange)\n\n\treturn (\n\t\t<div className={cx(styles.splitInputContainer, styles.fourValuesEvenSplitInput)}>\n\t\t\t<NumberInputWithTicker\n\t\t\t\tvalue={value.h}\n\t\t\t\tonChange={handleHueInputChange}\n\t\t\t\tmin={0}\n\t\t\t\tmax={360}\n\t\t\t\tenabled={enabled}\n\t\t\t\tclassName={styles.input}\n\t\t\t\twrapperClassName={styles.leftSplitInput}\n\t\t\t\ttitle=\"Hue\"\n\t\t\t\tdata-testid=\"hsl-hue-color-input\"\n\t\t\t/>\n\n\t\t\t<NumberInputWithTicker\n\t\t\t\tvalue={decimalToRoundedAndClampedPercentage(value.s)}\n\t\t\t\tonChange={handleSaturationInputChange}\n\t\t\t\tmin={0}\n\t\t\t\tmax={100}\n\t\t\t\tenabled={enabled}\n\t\t\t\tclassName={styles.input}\n\t\t\t\twrapperClassName={styles.centerSplitInput}\n\t\t\t\ttitle=\"Saturation\"\n\t\t\t\tdata-testid=\"hsl-saturation-color-input\"\n\t\t\t/>\n\n\t\t\t<NumberInputWithTicker\n\t\t\t\tvalue={decimalToRoundedAndClampedPercentage(value.l)}\n\t\t\t\tonChange={handleLightnessInputChange}\n\t\t\t\tmin={0}\n\t\t\t\tmax={100}\n\t\t\t\tenabled={enabled}\n\t\t\t\tclassName={styles.input}\n\t\t\t\twrapperClassName={styles.centerSplitInput}\n\t\t\t\ttitle=\"Lightness\"\n\t\t\t\tdata-testid=\"hsl-lightness-color-input\"\n\t\t\t/>\n\n\t\t\t<NumberInputWithTicker\n\t\t\t\tvalue={decimalToRoundedAndClampedPercentage(value.a)}\n\t\t\t\tonChange={handleAlphaInputChange}\n\t\t\t\tunit=\"%\"\n\t\t\t\tmin={0}\n\t\t\t\tmax={100}\n\t\t\t\tenabled={enabled}\n\t\t\t\tclassName={styles.input}\n\t\t\t\twrapperClassName={styles.rightSplitInput}\n\t\t\t\ttitle=\"Alpha\"\n\t\t\t\tdata-testid=\"hsl-alpha-color-input\"\n\t\t\t/>\n\t\t</div>\n\t)\n}\n", "import { NumberInputWithTicker } from \"@framerjs/fresco\"\nimport type { ColorRGBA } from \"library/index.ts\"\nimport { ConvertColor, cx } from \"library/index.ts\"\nimport React from \"react\"\nimport * as styles from \"./ColorPickerInput.styles.ts\"\nimport { decimalToRoundedAndClampedPercentage, showOpacityWarningToast } from \"./utils.ts\"\n\ninterface Props {\n\tvalue: ColorRGBA\n\tonChange: (value: string) => void\n\tenabled?: boolean\n}\n\nfunction useColorInputHandler(key: keyof ColorRGBA, value: ColorRGBA, onChange: (value: string) => void) {\n\treturn React.useCallback(\n\t\t(newValue: number) => {\n\t\t\tconst rawNewValue = key === \"a\" ? newValue / 100 : newValue\n\n\t\t\tif (rawNewValue === value[key]) return\n\t\t\tconst newRgb = { ...value, [key]: rawNewValue }\n\t\t\tonChange(ConvertColor.rgbaToString(newRgb))\n\t\t\tif (key === \"a\" && rawNewValue === 0) showOpacityWarningToast()\n\t\t},\n\t\t[key, value, onChange],\n\t)\n}\n\nexport function RgbColorPickerInput({ value, onChange, enabled }: Props) {\n\tconst handleRedInputChange = useColorInputHandler(\"r\", value, onChange)\n\tconst handleGreenInputChange = useColorInputHandler(\"g\", value, onChange)\n\tconst handleBlueInputChange = useColorInputHandler(\"b\", value, onChange)\n\tconst handleAlphaInputChange = useColorInputHandler(\"a\", value, onChange)\n\n\treturn (\n\t\t<div className={cx(styles.splitInputContainer, styles.fourValuesEvenSplitInput)}>\n\t\t\t<NumberInputWithTicker\n\t\t\t\tvalue={value.r}\n\t\t\t\tonChange={handleRedInputChange}\n\t\t\t\tmin={0}\n\t\t\t\tmax={255}\n\t\t\t\tenabled={enabled}\n\t\t\t\tclassName={styles.input}\n\t\t\t\twrapperClassName={styles.leftSplitInput}\n\t\t\t\ttitle=\"Red\"\n\t\t\t\tdata-testid=\"rgb-red-color-input\"\n\t\t\t/>\n\n\t\t\t<NumberInputWithTicker\n\t\t\t\tvalue={value.g}\n\t\t\t\tonChange={handleGreenInputChange}\n\t\t\t\tmin={0}\n\t\t\t\tmax={255}\n\t\t\t\tenabled={enabled}\n\t\t\t\tclassName={styles.input}\n\t\t\t\twrapperClassName={styles.centerSplitInput}\n\t\t\t\ttitle=\"Green\"\n\t\t\t\tdata-testid=\"rgb-green-color-input\"\n\t\t\t/>\n\n\t\t\t<NumberInputWithTicker\n\t\t\t\tvalue={value.b}\n\t\t\t\tonChange={handleBlueInputChange}\n\t\t\t\tmin={0}\n\t\t\t\tmax={255}\n\t\t\t\tenabled={enabled}\n\t\t\t\tclassName={styles.input}\n\t\t\t\twrapperClassName={styles.centerSplitInput}\n\t\t\t\ttitle=\"Blue\"\n\t\t\t\tdata-testid=\"rgb-blue-color-input\"\n\t\t\t/>\n\n\t\t\t<NumberInputWithTicker\n\t\t\t\tvalue={decimalToRoundedAndClampedPercentage(value.a)}\n\t\t\t\tonChange={handleAlphaInputChange}\n\t\t\t\tunit=\"%\"\n\t\t\t\tmin={0}\n\t\t\t\tmax={100}\n\t\t\t\tenabled={enabled}\n\t\t\t\tclassName={styles.input}\n\t\t\t\twrapperClassName={styles.rightSplitInput}\n\t\t\t\ttitle=\"Alpha\"\n\t\t\t\tdata-testid=\"rgb-alpha-color-input\"\n\t\t\t/>\n\t\t</div>\n\t)\n}\n", "import \"ColorPickerPopoutContent.styles_1jg1vu.wyw.css\"; export const container = \"container_c2orl3y\";\nexport const containerPadding = \"containerPadding_c1svq14t\";\nexport const colorPickerFillTypeTabs = \"colorPickerFillTypeTabs_c1j2rli7\";\nexport const scroll = \"scroll_s1cbpxcr\";\nexport const scrollContentWrapper = \"scrollContentWrapper_sxhu8tk\";\nexport const colorPickerInputWrapper = \"colorPickerInputWrapper_c1yp40qr\";\nexport const colorPickerInputWrapperOnPage = \"colorPickerInputWrapperOnPage_czr60e9\";\nexport const colorPickerInput = \"colorPickerInput_c1azw9i\";", "import { isString } from \"@framerjs/assets/src/utils.ts\"\nimport { Scroll } from \"@framerjs/fresco\"\nimport { unhandledError } from \"@framerjs/shared\"\nimport { cx } from \"@linaria/core\"\nimport { MetricsInteractionViews, MetricsViewContext } from \"app/metrics.ts\"\nimport { useBaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport { sampleColor } from \"document/components/tools/utils/sampleColor.ts\"\nimport type { NodeID } from \"document/models/CanvasTree/index.ts\"\nimport type { ColorStyleTokenNode } from \"document/models/CanvasTree/nodes/ColorStyleTokenNode.ts\"\nimport { findTokenNode } from \"document/models/CanvasTree/utils/findTokenNode.ts\"\nimport { isTokenCSSVariable, tokenIdFromCSSVariable } from \"document/models/CanvasTree/utils/tokens.ts\"\nimport type { Gradient } from \"document/models/Gradient.ts\"\nimport { isGradient } from \"document/models/Gradient.ts\"\nimport { Color, ConvertColor, withOpacity } from \"library/index.ts\"\nimport type React from \"react\"\nimport { useCallback, useRef, useState } from \"react\"\nimport { toast } from \"web/lib/toaster.ts\"\nimport { ColorPickerInput } from \"./ColorPickerInput.tsx\"\nimport * as styles from \"./ColorPickerPopoutContent.styles.ts\"\nimport type { ColorModel } from \"./types.ts\"\n\ninterface OnPageColorPickerPopoutContentProps {\n\tvalue: string\n\tonChangeColor: (value: string, colorStopSelection: NodeID | undefined, final: boolean) => void\n\tcolorModel: ColorModel\n\tisDarkMode: boolean\n}\n\nexport function OnPageColorPickerPopoutContent({\n\tvalue,\n\tcolorModel,\n\tisDarkMode,\n\tonChangeColor,\n}: OnPageColorPickerPopoutContentProps) {\n\tconst engine = useBaseEngine()\n\tconst [prevValue, setPrevValue] = useState<string | null>(null)\n\tconst scrollRef = useRef<HTMLDivElement>(null)\n\n\tconst [colorForExternalColor, setColorForExternalColor] = useState<Record<string, string>>({})\n\tconst [pendingExternalColor, setPendingExternalColor] = useState<string | null>(null)\n\tconst [displaySeparator, setDisplaySeparator] = useState(false)\n\n\tconst currentColorValue = getCurrentColorValue({\n\t\ttoken: null,\n\t\tisDarkMode,\n\t\timageFill: false,\n\t\tvalue,\n\t\tcolorStopSelection: undefined,\n\t\tpendingExternalColor,\n\t\tcolorForExternalColor,\n\t\tsetPendingExternalColor,\n\t})\n\n\tconst onScroll = useCallback(\n\t\t(event: React.UIEvent) => {\n\t\t\tconst scrollTop = (event.target as HTMLDivElement).scrollTop\n\t\t\tconst currentDisplaySeparator = scrollTop > 0\n\t\t\tif (currentDisplaySeparator !== displaySeparator) {\n\t\t\t\tsetDisplaySeparator(currentDisplaySeparator)\n\t\t\t}\n\t\t},\n\t\t[displaySeparator],\n\t)\n\n\tconst { handleChangeColor, handleSampleColor } = useColorPickerCallbacks({\n\t\tisDarkMode,\n\t\tonChangeColor,\n\t\tsetColorForExternalColor,\n\t\tsetPendingExternalColor,\n\t})\n\n\t// Update the previousValue for the next render\n\tif (value !== prevValue) {\n\t\tsetPrevValue(value)\n\t}\n\n\treturn (\n\t\t<MetricsViewContext.Provider value={MetricsInteractionViews.COLOR_PICKER}>\n\t\t\t<div className={cx(styles.container)}>\n\t\t\t\t<Scroll onScroll={onScroll} ref={scrollRef} className={styles.scroll}>\n\t\t\t\t\t<div className={styles.scrollContentWrapper}>\n\t\t\t\t\t\t<div className={cx(styles.colorPickerInputWrapper, styles.colorPickerInputWrapperOnPage)}>\n\t\t\t\t\t\t\t<ColorPickerInput\n\t\t\t\t\t\t\t\tonChange={handleChangeColor}\n\t\t\t\t\t\t\t\tcolor={currentColorValue}\n\t\t\t\t\t\t\t\tcolorModel={colorModel}\n\t\t\t\t\t\t\t\tclassName={styles.colorPickerInput}\n\t\t\t\t\t\t\t\tsampleColor={handleSampleColor}\n\t\t\t\t\t\t\t\tengine={engine}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</Scroll>\n\t\t\t</div>\n\t\t</MetricsViewContext.Provider>\n\t)\n}\n\nexport function getCurrentColorValue({\n\tisDarkMode,\n\ttoken,\n\timageFill,\n\tvalue,\n\tcolorStopSelection,\n\tpendingExternalColor,\n\tcolorForExternalColor,\n\tsetPendingExternalColor,\n}: {\n\tisDarkMode: boolean\n\ttoken: ColorStyleTokenNode | null | undefined\n\timageFill: boolean\n\tvalue: string | Gradient\n\tcolorStopSelection: NodeID | undefined\n\tpendingExternalColor: string | null\n\tcolorForExternalColor: { [key: string]: string }\n\tsetPendingExternalColor: (color: string | null) => void\n}) {\n\tlet color: string\n\n\tif (token) {\n\t\tcolor = token.colorForMode(isDarkMode)\n\t} else if (imageFill) {\n\t\tcolor = \"white\"\n\t} else if (isString(value)) {\n\t\tcolor = value\n\t} else {\n\t\tcolor = value?.stops.find(stop => stop.id === colorStopSelection)?.value || value?.stops[0]?.value || \"transparent\"\n\t}\n\n\tif (pendingExternalColor === color) {\n\t\tsetPendingExternalColor(null)\n\t}\n\n\treturn colorForExternalColor[pendingExternalColor ?? color] ?? color\n}\n\nexport function useColorPickerCallbacks({\n\tisDarkMode,\n\tonChangeColor,\n\tselection,\n\tcolorStopSelection,\n\tsetColorForExternalColor,\n\tsetPendingExternalColor,\n}: {\n\tisDarkMode: boolean\n\tonChangeColor: (value: string, colorStopSelection: NodeID | undefined, final: boolean) => void\n\tselection?: NodeID[]\n\tcolorStopSelection?: NodeID\n\tsetColorForExternalColor: (value: Record<string, string>) => void\n\tsetPendingExternalColor: (value: string | null) => void\n}) {\n\tconst engine = useBaseEngine()\n\tconst onChangeLocalColor = useCallback(\n\t\t(value: string | Gradient, gradientStopSelection: string | undefined, final: boolean) => {\n\t\t\tif (isGradient(value)) return\n\t\t\tlet localValue = value\n\t\t\tconst isToken = isTokenCSSVariable(localValue)\n\t\t\tif (isToken) {\n\t\t\t\tconst tokenId = tokenIdFromCSSVariable(localValue)\n\t\t\t\tconst tokenNode = tokenId ? findTokenNode(tokenId, engine.tree) : null\n\t\t\t\tif (tokenNode) {\n\t\t\t\t\tlocalValue = tokenNode.colorForMode(isDarkMode)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// After setting state in the current format, when updating the actual value, convert to RGB for consistency.\n\t\t\tconst rgbValue = Color.isP3String(localValue) ? localValue : ConvertColor.toRgbString(localValue)\n\n\t\t\t// sRGB colors can be chosen in different formats (RGB, HEX, HSV), but we store them internally as RGB,\n\t\t\t// but this can cause rounding errors when converting between formats. To prevent this:\n\t\t\t// 1. We convert the input color to RGB for storage\n\t\t\t// 2. We keep track of the original input format in a dictionary (colorForExternalColor)\n\t\t\t// 3. When displaying the color again, we use the original format from the map\n\t\t\t// This preserves the exact values the user entered while maintaining consistent internal storage\n\t\t\t// Changing the value here WON'T cause a recompute of the currentColorValue because it's memoized and colorForExternalColor is not a dependency of currentColorValue on purpose.\n\t\t\tsetColorForExternalColor({ [rgbValue]: localValue })\n\t\t\tsetPendingExternalColor(rgbValue)\n\n\t\t\t// We need to use queueMicrotask to ensure that the onChangeColor callback is called after the colorForExternalColor state is updated no matter how `onChangeColor` is implemented.\n\t\t\t// Otherwise it is possible for the component to rerender with a new `value` prop before internal state is set, resulting in a rerender that won't be able to read the chosen color syntax representation from the colorForExternalColor dictionary.\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tonChangeColor(isToken ? value : rgbValue, gradientStopSelection, final)\n\t\t\t})\n\t\t},\n\t\t[isDarkMode, onChangeColor, setColorForExternalColor, setPendingExternalColor],\n\t)\n\n\tconst handleChangeColor = useCallback(\n\t\t(color: string, final: boolean = true) => {\n\t\t\tcheckLayerOpacityForSelectionAndWarnIfNecessary(selection)\n\t\t\tonChangeLocalColor(color, colorStopSelection, final)\n\t\t},\n\t\t[selection, colorStopSelection, onChangeLocalColor],\n\t)\n\n\tconst checkLayerOpacityForSelectionAndWarnIfNecessary = useCallback((selection?: NodeID[]) => {\n\t\tif (!selection) return\n\n\t\tconst nodes = engine.tree.getNodes(selection)\n\t\tconst hasZeroOpacity = nodes.some(node => withOpacity(node) && node.resolveValue(\"opacity\") === 0)\n\t\tif (hasZeroOpacity) {\n\t\t\ttoast({\n\t\t\t\ttype: \"add\",\n\t\t\t\tvariant: \"info\",\n\t\t\t\ticon: \"color-wheel\",\n\t\t\t\tprimaryText: \"Increase layer opacity\",\n\t\t\t\tsecondaryText: \"to see changes.\",\n\t\t\t\tkey: \"color-change-null-opacity\",\n\t\t\t\tduration: 3000,\n\t\t\t})\n\t\t}\n\t}, [])\n\n\tconst handleSampleColor = useCallback(() => {\n\t\tsampleColor(engine)\n\t\t\t.then(\n\t\t\t\tengine.scheduler.wrapHandler((color: string | undefined) => {\n\t\t\t\t\tif (!color) return\n\t\t\t\t\thandleChangeColor(color)\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.catch(unhandledError)\n\t}, [handleChangeColor])\n\n\treturn {\n\t\thandleChangeColor,\n\t\thandleSampleColor,\n\t}\n}\n", "import { AnnotationKey } from \"@framerjs/framer-runtime/crossorigin\"\nimport { isString } from \"@framerjs/fresco/src/components/utils/typeCheck\"\nimport type { ExternalModuleExportIdentifier, ModuleExportIdentifierString } from \"@framerjs/shared\"\nimport { assert, asGlobalId, externalModuleIdentifier } from \"@framerjs/shared\"\nimport type { BaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport type { CanvasTree } from \"document/models/CanvasTree/index.ts\"\nimport { ExternalModulesListNode } from \"document/models/CanvasTree/nodes/ExternalModuleNode.ts\"\nimport type { ModulesStore } from \"document/stores/ModulesStore.ts\"\nimport { environment } from \"environment/index.ts\"\nimport { getLookupQueryForModuleComponent, moduleComponents } from \"./moduleComponents.ts\"\n\nconst annotationKey = AnnotationKey.FramerComponentPresetProps\n\nexport interface ComponentWithPreset {\n\tname: string\n\tmoduleId: string\n\tcomponentIdentifier: ModuleExportIdentifierString\n}\n\n// We hard code some components so they always appear in the list.\nlet hardCodedComponentsPromise: Promise<ComponentWithPreset[]> | undefined\n\nasync function loadHardCodedComponentsWithPresetsFromModulesStore(modulesStore: ModulesStore) {\n\tif (environment.isTest) return []\n\n\tconst hardCodedComponents = [moduleComponents.codeblock, moduleComponents.youtube, moduleComponents.vimeo]\n\n\tconst { modules } = await modulesStore.lookUpModules(hardCodedComponents.map(getLookupQueryForModuleComponent))\n\n\treturn hardCodedComponents.map((component, index): ComponentWithPreset => {\n\t\tconst module = modules[index]\n\t\tassert(module, \"Can't find module\")\n\n\t\tassert(component, \"Component is undefined\") // Fix unchecked indexed access error\n\n\t\tassert(module.files.module, \"Module file is not set\") // Fix unchecked indexed access error\n\n\t\tconst moduleIdentifier: ExternalModuleExportIdentifier = externalModuleIdentifier(\n\t\t\tasGlobalId(module.id),\n\t\t\tmodule.saveId,\n\t\t\tmodule.files.module,\n\t\t\t\"exportSpecifier\" in component && isString(component.exportSpecifier) ? component.exportSpecifier : \"default\",\n\t\t)\n\n\t\treturn {\n\t\t\tname: component.title,\n\t\t\tmoduleId: module.id,\n\t\t\tcomponentIdentifier: moduleIdentifier.value,\n\t\t}\n\t})\n}\n\n/** Loads all the hard coded components with presets (e.g. YouTube). */\nfunction getHardCodedComponentsWithPresetsFromModulesStore(modulesStore: ModulesStore) {\n\thardCodedComponentsPromise ??= loadHardCodedComponentsWithPresetsFromModulesStore(modulesStore)\n\treturn hardCodedComponentsPromise\n}\n\n/** Loads all the hard coded components with presets (e.g. YouTube). */\nexport function getHardCodedComponentsWithPresets(engine: BaseEngine) {\n\treturn getHardCodedComponentsWithPresetsFromModulesStore(engine.stores.modulesStore)\n}\n\n/** Gets all components with presets from ExternalModuleNodes. */\nfunction getProjectComponentsWithPresetsFromTree(tree: CanvasTree) {\n\tconst result: ComponentWithPreset[] = []\n\n\tconst externalModules = ExternalModulesListNode.getModuleNodes(tree)\n\tfor (const node of externalModules) {\n\t\tif (node.annotations && annotationKey in node.annotations) {\n\t\t\tresult.push({\n\t\t\t\tname: node.title,\n\t\t\t\tmoduleId: node.id,\n\t\t\t\tcomponentIdentifier: node.codeComponentIdentifier,\n\t\t\t})\n\t\t}\n\t}\n\n\treturn result\n}\n\n/** Gets all components with presets from ExternalModuleNodes. */\nexport function getProjectComponentsWithPresets(engine: BaseEngine) {\n\treturn getProjectComponentsWithPresetsFromTree(engine.tree)\n}\n\nexport function mergeComponentsWithPresets(\n\thardCodedComponents: ComponentWithPreset[],\n\tprojectComponents: ComponentWithPreset[],\n) {\n\tconst moduleIds = new Set<string>()\n\n\tfor (const component of projectComponents) {\n\t\tmoduleIds.add(component.moduleId)\n\t}\n\n\treturn hardCodedComponents\n\t\t.filter(component => !moduleIds.has(component.moduleId))\n\t\t.concat(projectComponents)\n\t\t.sort((left, right) => left.name.localeCompare(right.name))\n}\n\nasync function getComponentsWithPresetsFromStores(tree: CanvasTree, modulesStore: ModulesStore) {\n\tconst hardCodedComponents = await getHardCodedComponentsWithPresetsFromModulesStore(modulesStore)\n\tconst projectComponents = getProjectComponentsWithPresetsFromTree(tree)\n\treturn mergeComponentsWithPresets(hardCodedComponents, projectComponents)\n}\n\n/** Returns all components with the `framerComponentPresetProps` annotation. */\nexport async function getComponentsWithPresets(engine: BaseEngine) {\n\treturn getComponentsWithPresetsFromStores(engine.tree, engine.stores.modulesStore)\n}\n", "import { useBaseEngine } from \"document/base-engine/BaseEngine.ts\"\nimport type { NodeID } from \"document/models/CanvasTree/index.ts\"\nimport type { ColorStyleTokenNode } from \"document/models/CanvasTree/nodes/ColorStyleTokenNode.ts\"\nimport { isColorStyleTokenNode } from \"document/models/CanvasTree/nodes/utils/nodeCheck.ts\"\nimport { findTokenNode } from \"document/models/CanvasTree/utils/findTokenNode.ts\"\nimport {\n\tfallbackValueFromCSSVariable,\n\tisTokenCSSVariable,\n\ttokenIdFromCSSVariable,\n} from \"document/models/CanvasTree/utils/tokens.ts\"\nimport type { Gradient } from \"document/models/Gradient.ts\"\nimport { useSignalState } from \"editorbar/engine/OnPageEngineSignals.ts\"\nimport { isOnPageEngine } from \"editorbar/engine/useOnPageEngine.ts\"\nimport { assert } from \"library/utils/assert.ts\"\nimport { memo, useMemo } from \"react\"\nimport { isString } from \"utils/typeChecks.ts\"\nimport type { ColorPickerContentState, OnPageColorPickerContentState } from \"../../ColorPickerPopoutTypes.ts\"\nimport type { OptionalFillImagePositionRowProps } from \"../../properties/rows/FillImagePositionRow.tsx\"\nimport type { AltTextProps } from \"../ImagePicker.tsx\"\nimport { OnPageColorPickerPopoutContent } from \"./OnPageColorPickerPopoutContent.tsx\"\n\ninterface OnPageColorPickerPopoutProps extends Partial<AltTextProps>, OptionalFillImagePositionRowProps {\n\tvalue: string | Gradient\n\tonChange: (value: string, gradientStopId: NodeID, final: boolean) => void\n}\n\nexport const OnPageColorPickerPopout = memo(function OnPageColorPickerPopout(props: OnPageColorPickerPopoutProps) {\n\tconst state = useCalculateState()\n\n\tconst { value } = useProcessColorValue(props.value, state)\n\tassert(isString(value), \"value must be a string\")\n\treturn (\n\t\t<OnPageColorPickerPopoutContent\n\t\t\t{...props}\n\t\t\tcolorModel={state.colorModel}\n\t\t\tisDarkMode={state.isDarkMode}\n\t\t\tvalue={value}\n\t\t\tonChangeColor={props.onChange}\n\t\t/>\n\t)\n})\n\nfunction isColorPickerContentState(\n\tstate: ColorPickerContentState | OnPageColorPickerContentState,\n): state is ColorPickerContentState {\n\tconst selectionKey: keyof ColorPickerContentState = \"selection\"\n\tconst selectedGradientStopIdKey: keyof ColorPickerContentState = \"selectedGradientStopId\"\n\treturn selectionKey in state && selectedGradientStopIdKey in state\n}\n\nexport function useProcessColorValue(\n\tvalue: string | Gradient,\n\tstate: OnPageColorPickerContentState | ColorPickerContentState,\n) {\n\tconst engine = useBaseEngine()\n\t// Current value or selected stop in gradient\n\tlet color: string\n\t// Current ColorStyleTokenNode for selected stop.\n\tlet token: ColorStyleTokenNode | null = null\n\n\t// Pass the currently selected stop.\n\tif (isString(value)) {\n\t\tcolor = value\n\t} else if (isColorPickerContentState(state)) {\n\t\tcolor = value.stops.find(({ id }) => id === state.selectedGradientStopId)?.value ?? \"transparent\"\n\t} else {\n\t\tcolor = \"transparent\"\n\t}\n\n\tif (isTokenCSSVariable(color)) {\n\t\tconst tokenId = tokenIdFromCSSVariable(color)\n\t\tconst tokenNode = tokenId ? findTokenNode(tokenId, engine.tree) : null\n\n\t\tif (isColorStyleTokenNode(tokenNode) && !tokenNode.softDeleted) token = tokenNode\n\n\t\tif (!token) {\n\t\t\t// TODO: improve handling of missing fallback values\n\t\t\tvalue = tokenNode?.colorForMode(state.isDarkMode) ?? fallbackValueFromCSSVariable(color) ?? \"transparent\"\n\t\t}\n\t}\n\n\treturn { value, token }\n}\n\nfunction useCalculateState(): OnPageColorPickerContentState {\n\tconst engine = useBaseEngine()\n\tassert(isOnPageEngine(engine), \"engine must be an on page engine\")\n\t// Persisted user defaults can't be used here because the on page editor doesn't have access to the main app's localStorage.\n\t// On page persisted user defaults will store it in a memory variable.\n\tconst colorModel = useSignalState(() => engine.stores.persistedUserDefaults.colorModel, [])\n\treturn useMemo(\n\t\t() => ({\n\t\t\tcolorModel,\n\t\t\t// There's no concept of dark mode in the on page editor UI and everything is always dark mode.\n\t\t\tisDarkMode: true,\n\t\t}),\n\t\t[colorModel],\n\t)\n}\n", "import { cx } from \"@linaria/core\"\nimport React from \"react\"\nimport { InlineDocumentation } from \"../../shared/InlineDocumentation.tsx\"\nimport { parseDescriptionMarkdown } from \"../../shared/utils/parseDescriptionMarkdown.tsx\"\nimport { PanelRow } from \"../rows/PanelRow.tsx\"\nimport { doubleColumnClass, spanAllColumnClass } from \"../utils/doubleColumn.styles.ts\"\nimport * as styles from \"./DescriptionRow.styles.ts\"\n\ninterface Props {\n\tfullWidth?: boolean\n\twithMargin?: boolean\n\t/** Subset of Markdown, only `*emphasis*` and `[links](https://foo.bar)` are supported */\n\tdescription: string\n}\n\nexport const DescriptionRow = React.memo(function DescriptionRow({\n\tfullWidth = false,\n\twithMargin = true,\n\tdescription,\n}: Props) {\n\tconst html = parseDescriptionMarkdown(description)\n\n\treturn (\n\t\t<PanelRow title={fullWidth ? undefined : \" \"}>\n\t\t\t<InlineDocumentation\n\t\t\t\tclassName={cx(\n\t\t\t\t\tstyles.description,\n\t\t\t\t\twithMargin ? styles.withMargin : undefined,\n\t\t\t\t\tfullWidth ? spanAllColumnClass : doubleColumnClass,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{html}\n\t\t\t</InlineDocumentation>\n\t\t</PanelRow>\n\t)\n})\n", "import \"InlineDocumentation.styles_1ociz1k.wyw.css\"; export const inlineDocumentation = \"inlineDocumentation_ia3rrjn\";", "import { cx } from \"@linaria/core\"\nimport type React from \"react\"\nimport * as styles from \"./InlineDocumentation.styles.ts\"\n\nexport function InlineDocumentation({ className, children, ...props }: React.ComponentPropsWithoutRef<\"div\">) {\n\treturn (\n\t\t<div className={cx(styles.inlineDocumentation, className)} {...props}>\n\t\t\t{children}\n\t\t</div>\n\t)\n}\n", "import type React from \"react\"\n\nconst linkMatcher = /\\[([^\\]]+)\\]\\((https?:\\/\\/[\\w./?=#%&-]+)\\)/gu\nconst emphasisMatcher = /\\*([^*]+)\\*/gu\nconst newlineMatcher = /(\\n)/gu\n\n/**\n * Subset of Markdown, only `*emphasis*`, `[links](https://foo.bar)` and newlines `\\n` are supported\n *\n * Links are restricted to HTTP(S), and expect to be encoded, as it only allows a narrow set of characters\n *\n * Also supports emphasis inside of link text, and links inside emphasis.\n */\nexport function parseDescriptionMarkdown(\n\tstring: string,\n\tstart: number = 0,\n\tmatchers: RegExp[] = [linkMatcher, emphasisMatcher, newlineMatcher],\n): React.ReactNode[] {\n\tconst [firstMatch, firstMatcher] = matchers\n\t\t.map(matcher => {\n\t\t\tmatcher.lastIndex = start\n\t\t\treturn matcher.exec(string)\n\t\t})\n\t\t.reduce(\n\t\t\t// Find the first matcher that matched (looking the index)\n\t\t\t(previous, currentMatch, index) => {\n\t\t\t\tconst [previousMatch] = previous\n\t\t\t\tif (previousMatch && currentMatch) {\n\t\t\t\t\tif (previousMatch.index < currentMatch.index) {\n\t\t\t\t\t\treturn previous\n\t\t\t\t\t}\n\t\t\t\t} else if (previousMatch) {\n\t\t\t\t\treturn previous\n\t\t\t\t}\n\t\t\t\t// else\n\t\t\t\treturn [currentMatch, matchers[index]]\n\t\t\t},\n\t\t\t[null, undefined] as [RegExpExecArray | null, RegExp?],\n\t\t)\n\n\t// No match from start until the end, so it\u2019s all plain text, we\u2019re done\n\tif (!firstMatch || !firstMatcher) {\n\t\tif (start === string.length) {\n\t\t\treturn []\n\t\t} else {\n\t\t\treturn [string.substring(start)]\n\t\t}\n\t} // else\n\n\tconst result: React.ReactNode[] = []\n\n\t// All the plain text before the match\n\tif (firstMatch.index - start > 0) {\n\t\tresult.push(string.substring(start, firstMatch.index))\n\t}\n\n\t// Save the start index, as the next recursive calls will modify the (global) RegExps\n\tconst nextIndex = firstMatcher.lastIndex\n\n\t// Handle the match, depending on the matcher\n\n\t// Add <a>\n\tif (firstMatcher === linkMatcher) {\n\t\tconst [_, unparsedText, url] = firstMatch\n\t\tconst text = parseDescriptionMarkdown(unparsedText, 0, [emphasisMatcher, newlineMatcher])\n\t\tresult.push(\n\t\t\t<a key={firstMatch.index} href={url} target=\"_blank\">\n\t\t\t\t{text}\n\t\t\t</a>,\n\t\t)\n\t}\n\n\t// Add <em>\n\tif (firstMatcher === emphasisMatcher) {\n\t\tconst [_, unparsedText] = firstMatch\n\t\tconst text = parseDescriptionMarkdown(unparsedText, 0, [linkMatcher, newlineMatcher])\n\t\tresult.push(<em key={firstMatch.index}>{text}</em>)\n\t}\n\n\t// Add <br>\n\tif (firstMatcher === newlineMatcher) {\n\t\tresult.push(<br key={firstMatch.index} />)\n\t}\n\n\t// Parse the rest using a recursive call\n\tresult.push(...parseDescriptionMarkdown(string, nextIndex))\n\n\treturn result\n}\n", "import \"DescriptionRow.styles_10ftxev.wyw.css\"; export const description = \"description_d1ykgdi6\";\nexport const withMargin = \"withMargin_w1wgf3m\";"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mBAAsF;AAqB9E;AATR,IAAM,qCAAiC,4BAA4D,MAAS;AAC5G,+BAA+B,cAAc;AAEtC,SAAS,gCAAgC;AAAA,EAC/C;AAAA,EACA;AACD,GAEI;AACH,SAAO,4CAAC,+BAA+B,UAA/B,EAAwC,OAAO,WAAY,UAAS;AAC7E;AAEO,SAAS,6BAA6B;AAC5C,aAAO,yBAAW,8BAA8B;AACjD;;;AC1BA,IAAAA,gBAA0C;AA4E1C,IAAM,iBAAwC,CAAC;AAExC,IAAM,4BAAwB,6BAAqC,cAAc;AACxF,sBAAsB,cAAc;AAE7B,SAAS,qBAAqB;AACpC,QAAM,cAAU,0BAAW,qBAAqB;AAEhD,MAAI,CAAC,SAAS;AACb,UAAM,IAAI,MAAM,yEAAyE;AAAA,EAC1F;AAEA,SAAO;AACR;;;ACzFA,IAAAC,gBAAkB;AAElB,IAAM,wBAAwB,cAAAC,QAAM,cAAc,KAAK;AAEhD,IAAM,iCAAiC,sBAAsB;AAE7D,SAAS,4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x_runtime", "import_react", "import_jsx_runtime", "import_jsx_runtime", "options", "import_jsx_runtime", "isComputedValue", "React", "VariableReferenceButton", "preview", "title", "stopPropagation", "import_react", "import_jsx_runtime", "isString", "import_react", "iconWrapper", "import_jsx_runtime", "iconWrapper", "import_react", "options", "import_react", "input", "options", "transformBefore", "title", "isString", "options", "input", "isString", "readonly", "titleWrapper", "import_jsx_runtime", "title", "titleWrapper", "import_jsx_runtime", "title", "style", "withButtonCursor", "ReorderControl", "withReorderControl", "import_jsx_runtime", "withReorderControl", "readOnly", "React", "import_react", "import_jsx_runtime", "import_jsx_runtime", "import_jsx_runtime", "import_jsx_runtime", "import_jsx_runtime", "titleWrapper", "disabled", "import_jsx_runtime", "button", "title", "import_jsx_runtime", "title", "icon", "button", "titleWrapper", "import_react", "import_jsx_runtime", "title", "shortcutKey", "preview", "suggestion", "disabled", "titleWrapper", "button", "disabled", "import_jsx_runtime", "title", "shortcutKey", "preview", "suggestion", "button", "import_react", "isString", "color", "import_react", "React", "import_react", "import_react", "import_jsx_runtime", "tooltip", "shortcutKey", "button", "disabled", "import_jsx_runtime", "React", "isString", "import_jsx_runtime", "isString", "import_react", "import_jsx_runtime", "isString", "import_react", "import_jsx_runtime", "import_jsx_runtime", "title", "isString", "import_jsx_runtime", "title", "import_react", "import_jsx_runtime", "title", "import_jsx_runtime", "import_react", "import_jsx_runtime", "readonly", "import_react", "square", "checkerboard", "readOnly", "inputContainer", "sampler", "sampler", "import_jsx_runtime", "sampler", "import_jsx_runtime", "clamp", "React", "style", "disabled", "readOnly", "value", "square", "checkerboard", "inputContainer", "sampler", "readonly", "points", "import_jsx_runtime", "sampleColor", "import_react", "import_jsx_runtime", "useColorInputHandler", "React", "import_react", "import_jsx_runtime", "useColorInputHandler", "React", "import_jsx_runtime", "React", "squareInset", "hueSlider", "indicatorOffset", "sampleColor", "readOnly", "indicator", "readonly", "container", "import_react", "import_jsx_runtime", "container", "selection", "isString", "import_react", "import_jsx_runtime", "OnPageColorPickerPopout", "assert", "isString", "import_react", "import_jsx_runtime", "import_jsx_runtime", "import_jsx_runtime", "React", "DescriptionRow", "fullWidth", "withMargin", "description"]
}
