@morscherlab/mint-sdk 1.3.3 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"templates-BU1pet28.js","names":["$slots"],"sources":["../src/components/BaseTextarea.vue","../src/components/BaseTextarea.vue","../src/components/Tooltip.vue","../src/components/Tooltip.vue","../src/components/BaseCheckbox.vue","../src/components/BaseCheckbox.vue","../src/components/BaseToggle.vue","../src/components/BaseToggle.vue","../src/components/BaseRadioGroup.vue","../src/components/BaseRadioGroup.vue","../src/components/BaseSlider.vue","../src/components/BaseSlider.vue","../src/composables/useSelectionLimit.ts","../src/composables/useListSelection.ts","../src/components/MultiSelect.vue","../src/components/MultiSelect.vue","../src/composables/useCalendarGrid.ts","../src/composables/useDropdownState.ts","../src/components/internal/CalendarGridPanelInternal.vue","../src/components/internal/CalendarGridPanelInternal.vue","../src/components/DatePicker.vue","../src/components/DatePicker.vue","../src/composables/useTimeUtils.ts","../src/components/TimePicker.vue","../src/components/TimePicker.vue","../src/components/TagsInput.vue","../src/components/TagsInput.vue","../src/utils/pluginSecrets.ts","../src/components/SecretInput.vue","../src/components/SecretInput.vue","../src/components/NumberInput.vue","../src/components/NumberInput.vue","../src/components/FileUploader.vue","../src/components/FileUploader.vue","../src/composables/useMenuKeyboard.ts","../src/utils/records.ts","../src/components/DateTimePicker.vue","../src/components/DateTimePicker.vue","../src/composables/useEventStream.ts","../src/jobs.ts","../src/composables/useGeneratedAnalysis.ts","../src/composables/platformContextHelpers.ts","../src/components/internal/generatedJobsApi.ts","../src/components/GeneratedPathInput.vue","../src/components/GeneratedPathInput.vue","../src/composables/useChemicalFormula.ts","../src/components/FormulaInput.vue","../src/components/FormulaInput.vue","../src/composables/useSequenceUtils.ts","../src/components/SequenceInput.vue","../src/components/SequenceInput.vue","../src/components/MoleculeInput.vue","../src/components/MoleculeInput.vue","../src/composables/useConcentrationUnits.ts","../src/components/UnitInput.vue","../src/components/UnitInput.vue","../src/components/ConcentrationInput.vue","../src/components/ConcentrationInput.vue","../src/composables/formBuilderRegistry.ts","../src/composables/controlSchemaUtils.ts","../src/composables/controlSchemaNormalize.ts","../src/composables/controlSchemaFormFields.ts","../src/composables/controlSchemaLayout.ts","../src/composables/controlSchemaAdapters.ts","../src/composables/useControlSchema.ts","../src/utils/color.ts","../src/components/WellPlate.geometry.ts","../src/templates/builderReadUtils.ts","../src/templates/templateEnvelopes.ts","../src/templates/lookup.ts","../src/templates/catalog.ts","../src/templates/packs.ts","../src/templates/presets.ts","../src/templates/componentTargetResolvers.ts","../src/templates/componentBindingHelpers.ts","../src/templates/componentBindingCatalog.ts","../src/templates/templateValidators.ts","../src/templates/assayMatrixAdapters.ts","../src/templates/calibrationCurveAdapters.ts","../src/templates/flowPanelAdapters.ts","../src/templates/instrumentRunAdapterHelpers.ts","../src/templates/instrumentRunAdapters.ts","../src/templates/protocolAdapters.ts","../src/templates/qpcrAdapters.ts","../src/templates/reagentAdapters.ts","../src/templates/samplePrepAdapters.ts","../src/templates/sampleSheetAdapters.ts","../src/templates/timeCourseAdapters.ts","../src/templates/plateMapAdapters.ts","../src/templates/doseResponseAdapters.ts","../src/templates/componentPlateHelpers.ts","../src/templates/adapters.ts","../src/templates/componentPropsFactory.ts","../src/templates/componentDoseResponseProps.ts","../src/templates/componentGenericProps.ts","../src/templates/componentPlateMapProps.ts","../src/templates/componentQpcrPlateProps.ts","../src/templates/componentTemplateProps.ts","../src/templates/componentBindings.ts","../src/templates/builderPresetControls.ts","../src/templates/builderIdUtils.ts","../src/templates/plateMapBuilder.ts","../src/templates/sampleNormalizers.ts","../src/templates/sampleSheetBuilder.ts","../src/templates/samplePrepBuilder.ts","../src/templates/calibrationNormalizers.ts","../src/templates/doseResponseBuilder.ts","../src/templates/calibrationCurveBuilder.ts","../src/templates/protocolNormalizers.ts","../src/templates/timeCourseBuilder.ts","../src/templates/protocolStepsBuilder.ts","../src/templates/assayLookups.ts","../src/templates/assayNormalizers.ts","../src/templates/assayMatrixBuilder.ts","../src/templates/reagentListBuilder.ts","../src/templates/flowNormalizers.ts","../src/templates/flowCytometryPanelBuilder.ts","../src/templates/runNormalizers.ts","../src/templates/instrumentRunBuilder.ts","../src/templates/qpcrPlateBuilder.ts","../src/templates/qpcrExpressionCollectionBuilder.ts","../src/templates/lcmsBatchCollectionBuilder.ts","../src/templates/targetedMetabolomicsHelpers.ts","../src/templates/targetedMetabolomicsCollectionBuilder.ts","../src/templates/elisaAssayCollectionBuilder.ts","../src/templates/flowCytometryAssayCollectionBuilder.ts","../src/templates/westernBlotAssayCollectionBuilder.ts","../src/templates/defaultBioTemplateBuilder.ts","../src/templates/templatePackCollectionBuilder.ts","../src/templates/wellPlateScreenCollectionBuilder.ts","../src/templates/templatePresetCollectionBuilder.ts","../src/templates/controlSchemaClone.ts","../src/templates/controlSchemaMerge.ts","../src/templates/controlSchemaTargets.ts","../src/templates/controlSchemaConstants.ts","../src/templates/templateControlSchemas.ts","../src/templates/presetControlSchemas.ts","../src/templates/controlSchemas.ts"],"sourcesContent":["<script setup lang=\"ts\">\n/** Renders a styled `<textarea>` with configurable rows, resize mode, size, and error state. */\ninterface Props {\n modelValue?: string\n placeholder?: string\n disabled?: boolean\n readonly?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n rows?: number\n resize?: 'none' | 'vertical' | 'horizontal' | 'both'\n maxlength?: number\n ariaDescribedby?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n disabled: false,\n readonly: false,\n error: false,\n size: 'md',\n rows: 3,\n resize: 'vertical',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n focus: [event: FocusEvent]\n blur: [event: FocusEvent]\n}>()\n\nfunction handleInput(event: Event) {\n const target = event.target as HTMLTextAreaElement\n emit('update:modelValue', target.value)\n}\n</script>\n\n<template>\n <textarea\n :value=\"props.modelValue\"\n :placeholder=\"props.placeholder\"\n :disabled=\"props.disabled\"\n :readonly=\"props.readonly\"\n :rows=\"props.rows\"\n :maxlength=\"props.maxlength\"\n :aria-invalid=\"props.error || undefined\"\n :aria-describedby=\"props.ariaDescribedby || undefined\"\n :class=\"[\n 'mint-textarea',\n `mint-textarea--${props.size}`,\n `mint-textarea--resize-${props.resize}`,\n props.error ? 'mint-textarea--error' : '',\n props.disabled ? 'mint-textarea--disabled' : '',\n ]\"\n @input=\"handleInput\"\n @focus=\"emit('focus', $event)\"\n @blur=\"emit('blur', $event)\"\n />\n</template>\n","<script setup lang=\"ts\">\n/** Renders a styled `<textarea>` with configurable rows, resize mode, size, and error state. */\ninterface Props {\n modelValue?: string\n placeholder?: string\n disabled?: boolean\n readonly?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n rows?: number\n resize?: 'none' | 'vertical' | 'horizontal' | 'both'\n maxlength?: number\n ariaDescribedby?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n disabled: false,\n readonly: false,\n error: false,\n size: 'md',\n rows: 3,\n resize: 'vertical',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n focus: [event: FocusEvent]\n blur: [event: FocusEvent]\n}>()\n\nfunction handleInput(event: Event) {\n const target = event.target as HTMLTextAreaElement\n emit('update:modelValue', target.value)\n}\n</script>\n\n<template>\n <textarea\n :value=\"props.modelValue\"\n :placeholder=\"props.placeholder\"\n :disabled=\"props.disabled\"\n :readonly=\"props.readonly\"\n :rows=\"props.rows\"\n :maxlength=\"props.maxlength\"\n :aria-invalid=\"props.error || undefined\"\n :aria-describedby=\"props.ariaDescribedby || undefined\"\n :class=\"[\n 'mint-textarea',\n `mint-textarea--${props.size}`,\n `mint-textarea--resize-${props.resize}`,\n props.error ? 'mint-textarea--error' : '',\n props.disabled ? 'mint-textarea--disabled' : '',\n ]\"\n @input=\"handleInput\"\n @focus=\"emit('focus', $event)\"\n @blur=\"emit('blur', $event)\"\n />\n</template>\n","<script setup lang=\"ts\">\n/** Floating tooltip using @floating-ui with auto-flip, delay, optional keyboard shortcut badge, and body Teleport. */\nimport { ref, onBeforeUnmount, nextTick } from 'vue'\nimport { computePosition, flip, offset, shift, type Placement } from '@floating-ui/dom'\nimport { useEventListener } from '../composables/useEventListener'\n\ninterface Props {\n text: string\n position?: 'top' | 'bottom' | 'left' | 'right'\n delay?: number\n shortcut?: string\n maxWidth?: string | number\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n position: 'top',\n delay: 200,\n shortcut: undefined,\n maxWidth: undefined,\n})\n\nconst tooltipId = `mint-tooltip-${Math.random().toString(36).slice(2, 9)}`\nconst visible = ref(false)\nconst actualPlacement = ref<Placement>(props.position)\nconst triggerRef = ref<HTMLElement | null>(null)\nconst contentRef = ref<HTMLElement | null>(null)\nconst coords = ref({ top: '0px', left: '0px' })\nlet timeoutId: ReturnType<typeof setTimeout> | undefined\n\nasync function updatePosition() {\n if (!triggerRef.value || !contentRef.value) return\n\n const { x, y, placement } = await computePosition(triggerRef.value, contentRef.value, {\n placement: props.position,\n middleware: [\n offset(6),\n flip(),\n shift({ padding: 8 }),\n ],\n })\n\n coords.value = { top: `${y}px`, left: `${x}px` }\n actualPlacement.value = placement\n}\n\nuseEventListener(() => window, 'scroll', updatePosition, {\n passive: true,\n capture: true,\n enabled: visible,\n})\nuseEventListener(() => window, 'resize', updatePosition, { enabled: visible })\n\nasync function show() {\n timeoutId = setTimeout(async () => {\n visible.value = true\n await nextTick()\n await updatePosition()\n }, props.delay)\n}\n\nfunction hide() {\n clearTimeout(timeoutId)\n timeoutId = undefined\n visible.value = false\n}\n\nonBeforeUnmount(() => {\n clearTimeout(timeoutId)\n})\n\nfunction resolvedMaxWidth(value: string | number | undefined): string | undefined {\n if (value === undefined) return undefined\n return typeof value === 'number' ? `${value}px` : value\n}\n</script>\n\n<template>\n <span\n ref=\"triggerRef\"\n class=\"mint-tooltip\"\n :aria-describedby=\"visible ? tooltipId : undefined\"\n @mouseenter=\"show\"\n @mouseleave=\"hide\"\n @focusin=\"show\"\n @focusout=\"hide\"\n >\n <slot />\n <Teleport to=\"body\">\n <span\n v-if=\"visible\"\n :id=\"tooltipId\"\n ref=\"contentRef\"\n :class=\"[\n 'mint-tooltip__content',\n `mint-tooltip__content--${actualPlacement}`,\n maxWidth ? 'mint-tooltip__content--multiline' : '',\n ]\"\n :style=\"{\n top: coords.top,\n left: coords.left,\n maxWidth: resolvedMaxWidth(maxWidth),\n }\"\n role=\"tooltip\"\n >\n <span class=\"mint-tooltip__body\">{{ text }}</span>\n <kbd v-if=\"shortcut\" class=\"mint-tooltip__shortcut\">{{ shortcut }}</kbd>\n </span>\n </Teleport>\n </span>\n</template>\n","<script setup lang=\"ts\">\n/** Floating tooltip using @floating-ui with auto-flip, delay, optional keyboard shortcut badge, and body Teleport. */\nimport { ref, onBeforeUnmount, nextTick } from 'vue'\nimport { computePosition, flip, offset, shift, type Placement } from '@floating-ui/dom'\nimport { useEventListener } from '../composables/useEventListener'\n\ninterface Props {\n text: string\n position?: 'top' | 'bottom' | 'left' | 'right'\n delay?: number\n shortcut?: string\n maxWidth?: string | number\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n position: 'top',\n delay: 200,\n shortcut: undefined,\n maxWidth: undefined,\n})\n\nconst tooltipId = `mint-tooltip-${Math.random().toString(36).slice(2, 9)}`\nconst visible = ref(false)\nconst actualPlacement = ref<Placement>(props.position)\nconst triggerRef = ref<HTMLElement | null>(null)\nconst contentRef = ref<HTMLElement | null>(null)\nconst coords = ref({ top: '0px', left: '0px' })\nlet timeoutId: ReturnType<typeof setTimeout> | undefined\n\nasync function updatePosition() {\n if (!triggerRef.value || !contentRef.value) return\n\n const { x, y, placement } = await computePosition(triggerRef.value, contentRef.value, {\n placement: props.position,\n middleware: [\n offset(6),\n flip(),\n shift({ padding: 8 }),\n ],\n })\n\n coords.value = { top: `${y}px`, left: `${x}px` }\n actualPlacement.value = placement\n}\n\nuseEventListener(() => window, 'scroll', updatePosition, {\n passive: true,\n capture: true,\n enabled: visible,\n})\nuseEventListener(() => window, 'resize', updatePosition, { enabled: visible })\n\nasync function show() {\n timeoutId = setTimeout(async () => {\n visible.value = true\n await nextTick()\n await updatePosition()\n }, props.delay)\n}\n\nfunction hide() {\n clearTimeout(timeoutId)\n timeoutId = undefined\n visible.value = false\n}\n\nonBeforeUnmount(() => {\n clearTimeout(timeoutId)\n})\n\nfunction resolvedMaxWidth(value: string | number | undefined): string | undefined {\n if (value === undefined) return undefined\n return typeof value === 'number' ? `${value}px` : value\n}\n</script>\n\n<template>\n <span\n ref=\"triggerRef\"\n class=\"mint-tooltip\"\n :aria-describedby=\"visible ? tooltipId : undefined\"\n @mouseenter=\"show\"\n @mouseleave=\"hide\"\n @focusin=\"show\"\n @focusout=\"hide\"\n >\n <slot />\n <Teleport to=\"body\">\n <span\n v-if=\"visible\"\n :id=\"tooltipId\"\n ref=\"contentRef\"\n :class=\"[\n 'mint-tooltip__content',\n `mint-tooltip__content--${actualPlacement}`,\n maxWidth ? 'mint-tooltip__content--multiline' : '',\n ]\"\n :style=\"{\n top: coords.top,\n left: coords.left,\n maxWidth: resolvedMaxWidth(maxWidth),\n }\"\n role=\"tooltip\"\n >\n <span class=\"mint-tooltip__body\">{{ text }}</span>\n <kbd v-if=\"shortcut\" class=\"mint-tooltip__shortcut\">{{ shortcut }}</kbd>\n </span>\n </Teleport>\n </span>\n</template>\n","<script setup lang=\"ts\">\n/** Renders a styled checkbox with an optional label, size variants, and disabled state. */\nimport Tooltip from './Tooltip.vue'\n\ninterface Props {\n modelValue?: boolean\n /** Partially checked (e.g. select-all over a partial selection); sets `aria-checked=\"mixed\"`. */\n indeterminate?: boolean\n /** Accessible name for the native input when no visible `label` is rendered (e.g. table rows). */\n ariaLabel?: string\n label?: string\n description?: string\n icon?: string | string[]\n iconColor?: string\n iconBg?: string\n disabled?: boolean\n size?: 'sm' | 'md' | 'lg'\n variant?: 'default' | 'row'\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: false,\n indeterminate: false,\n disabled: false,\n size: 'md',\n variant: 'default',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: boolean]\n}>()\n\nfunction handleChange(event: Event) {\n const target = event.target as HTMLInputElement\n emit('update:modelValue', target.checked)\n}\n\nfunction isSvgIcon(icon?: string | string[]): boolean {\n if (!icon) return false\n return Array.isArray(icon) || icon.startsWith('M') || icon.startsWith('m')\n}\n\nfunction iconStyle(): Record<string, string> {\n return {\n color: props.iconColor ?? (props.modelValue ? 'var(--color-primary)' : 'var(--text-muted)'),\n }\n}\n</script>\n\n<template>\n <label\n :class=\"[\n 'mint-checkbox',\n `mint-checkbox--${props.variant}`,\n props.disabled ? 'mint-checkbox--disabled' : '',\n props.modelValue ? 'mint-checkbox--checked' : '',\n ]\"\n >\n <span\n v-if=\"props.variant === 'row' && props.icon\"\n class=\"mint-checkbox__row-icon\"\n :style=\"iconStyle()\"\n aria-hidden=\"true\"\n >\n <svg\n v-if=\"isSvgIcon(props.icon)\"\n class=\"mint-checkbox__row-svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <template v-if=\"Array.isArray(props.icon)\">\n <path v-for=\"(d, i) in props.icon\" :key=\"i\" :d=\"d\" />\n </template>\n <path v-else :d=\"props.icon\" />\n </svg>\n <span v-else class=\"mint-checkbox__row-text-icon\">{{ props.icon }}</span>\n </span>\n <span\n v-if=\"props.variant === 'row' && props.label\"\n class=\"mint-checkbox__copy\"\n >\n <Tooltip\n v-if=\"props.description\"\n :text=\"props.description\"\n position=\"right\"\n max-width=\"16rem\"\n >\n <span :class=\"['mint-checkbox__label', `mint-checkbox__label--${props.size}`, 'mint-checkbox__label--tooltip']\">\n {{ props.label }}\n </span>\n </Tooltip>\n <span v-else :class=\"['mint-checkbox__label', `mint-checkbox__label--${props.size}`]\">\n {{ props.label }}\n </span>\n </span>\n <div class=\"mint-checkbox__input-wrapper\">\n <input\n type=\"checkbox\"\n :checked=\"props.modelValue\"\n :indeterminate=\"props.indeterminate\"\n :aria-checked=\"props.indeterminate ? 'mixed' : undefined\"\n :disabled=\"props.disabled\"\n :aria-label=\"props.ariaLabel || props.label || 'Checkbox'\"\n class=\"mint-checkbox__native\"\n @change=\"handleChange\"\n />\n <div\n :class=\"[\n 'mint-checkbox__box',\n `mint-checkbox__box--${props.size}`,\n props.modelValue && !props.indeterminate ? 'mint-checkbox__box--checked' : '',\n props.indeterminate ? 'mint-checkbox__box--indeterminate' : '',\n ]\"\n >\n <svg\n v-if=\"props.indeterminate\"\n :class=\"['mint-checkbox__icon', `mint-checkbox__icon--${props.size}`]\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 16 16\"\n aria-hidden=\"true\"\n >\n <path stroke-linecap=\"round\" stroke-width=\"2.2\" d=\"M4 8h8\" />\n </svg>\n <svg\n v-else-if=\"props.modelValue\"\n :class=\"['mint-checkbox__icon', `mint-checkbox__icon--${props.size}`]\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"3\" d=\"M5 13l4 4L19 7\" />\n </svg>\n </div>\n </div>\n <span v-if=\"props.label && props.variant !== 'row'\" :class=\"['mint-checkbox__label', `mint-checkbox__label--${props.size}`]\">\n {{ props.label }}\n </span>\n </label>\n</template>\n","<script setup lang=\"ts\">\n/** Renders a styled checkbox with an optional label, size variants, and disabled state. */\nimport Tooltip from './Tooltip.vue'\n\ninterface Props {\n modelValue?: boolean\n /** Partially checked (e.g. select-all over a partial selection); sets `aria-checked=\"mixed\"`. */\n indeterminate?: boolean\n /** Accessible name for the native input when no visible `label` is rendered (e.g. table rows). */\n ariaLabel?: string\n label?: string\n description?: string\n icon?: string | string[]\n iconColor?: string\n iconBg?: string\n disabled?: boolean\n size?: 'sm' | 'md' | 'lg'\n variant?: 'default' | 'row'\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: false,\n indeterminate: false,\n disabled: false,\n size: 'md',\n variant: 'default',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: boolean]\n}>()\n\nfunction handleChange(event: Event) {\n const target = event.target as HTMLInputElement\n emit('update:modelValue', target.checked)\n}\n\nfunction isSvgIcon(icon?: string | string[]): boolean {\n if (!icon) return false\n return Array.isArray(icon) || icon.startsWith('M') || icon.startsWith('m')\n}\n\nfunction iconStyle(): Record<string, string> {\n return {\n color: props.iconColor ?? (props.modelValue ? 'var(--color-primary)' : 'var(--text-muted)'),\n }\n}\n</script>\n\n<template>\n <label\n :class=\"[\n 'mint-checkbox',\n `mint-checkbox--${props.variant}`,\n props.disabled ? 'mint-checkbox--disabled' : '',\n props.modelValue ? 'mint-checkbox--checked' : '',\n ]\"\n >\n <span\n v-if=\"props.variant === 'row' && props.icon\"\n class=\"mint-checkbox__row-icon\"\n :style=\"iconStyle()\"\n aria-hidden=\"true\"\n >\n <svg\n v-if=\"isSvgIcon(props.icon)\"\n class=\"mint-checkbox__row-svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <template v-if=\"Array.isArray(props.icon)\">\n <path v-for=\"(d, i) in props.icon\" :key=\"i\" :d=\"d\" />\n </template>\n <path v-else :d=\"props.icon\" />\n </svg>\n <span v-else class=\"mint-checkbox__row-text-icon\">{{ props.icon }}</span>\n </span>\n <span\n v-if=\"props.variant === 'row' && props.label\"\n class=\"mint-checkbox__copy\"\n >\n <Tooltip\n v-if=\"props.description\"\n :text=\"props.description\"\n position=\"right\"\n max-width=\"16rem\"\n >\n <span :class=\"['mint-checkbox__label', `mint-checkbox__label--${props.size}`, 'mint-checkbox__label--tooltip']\">\n {{ props.label }}\n </span>\n </Tooltip>\n <span v-else :class=\"['mint-checkbox__label', `mint-checkbox__label--${props.size}`]\">\n {{ props.label }}\n </span>\n </span>\n <div class=\"mint-checkbox__input-wrapper\">\n <input\n type=\"checkbox\"\n :checked=\"props.modelValue\"\n :indeterminate=\"props.indeterminate\"\n :aria-checked=\"props.indeterminate ? 'mixed' : undefined\"\n :disabled=\"props.disabled\"\n :aria-label=\"props.ariaLabel || props.label || 'Checkbox'\"\n class=\"mint-checkbox__native\"\n @change=\"handleChange\"\n />\n <div\n :class=\"[\n 'mint-checkbox__box',\n `mint-checkbox__box--${props.size}`,\n props.modelValue && !props.indeterminate ? 'mint-checkbox__box--checked' : '',\n props.indeterminate ? 'mint-checkbox__box--indeterminate' : '',\n ]\"\n >\n <svg\n v-if=\"props.indeterminate\"\n :class=\"['mint-checkbox__icon', `mint-checkbox__icon--${props.size}`]\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 16 16\"\n aria-hidden=\"true\"\n >\n <path stroke-linecap=\"round\" stroke-width=\"2.2\" d=\"M4 8h8\" />\n </svg>\n <svg\n v-else-if=\"props.modelValue\"\n :class=\"['mint-checkbox__icon', `mint-checkbox__icon--${props.size}`]\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"3\" d=\"M5 13l4 4L19 7\" />\n </svg>\n </div>\n </div>\n <span v-if=\"props.label && props.variant !== 'row'\" :class=\"['mint-checkbox__label', `mint-checkbox__label--${props.size}`]\">\n {{ props.label }}\n </span>\n </label>\n</template>\n","<script setup lang=\"ts\">\n/** Renders an on/off toggle switch with label, size, and keyboard interaction support. */\nimport Tooltip from './Tooltip.vue'\n\ninterface Props {\n modelValue?: boolean\n label?: string\n /** Accessible switch name; defaults to the visual label, then \"Toggle\". */\n ariaLabel?: string\n description?: string\n icon?: string | string[]\n iconColor?: string\n iconBg?: string\n disabled?: boolean\n size?: 'sm' | 'md' | 'lg'\n reverse?: boolean\n variant?: 'default' | 'row'\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: false,\n disabled: false,\n size: 'md',\n reverse: false,\n variant: 'default',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: boolean]\n}>()\n\nfunction toggle() {\n if (!props.disabled) {\n emit('update:modelValue', !props.modelValue)\n }\n}\n\nfunction handleKeydown(event: KeyboardEvent) {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault()\n toggle()\n }\n}\n\nfunction isSvgIcon(icon?: string | string[]): boolean {\n if (!icon) return false\n return Array.isArray(icon) || icon.startsWith('M') || icon.startsWith('m')\n}\n\nfunction iconStyle(): Record<string, string> {\n return {\n color: props.iconColor ?? (props.modelValue ? 'var(--color-primary)' : 'var(--text-muted)'),\n }\n}\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-toggle',\n `mint-toggle--${variant}`,\n reverse ? 'mint-toggle--reverse' : '',\n disabled ? 'mint-toggle--disabled' : '',\n modelValue ? 'mint-toggle--checked' : '',\n ]\"\n @click=\"toggle\"\n >\n <span\n v-if=\"variant === 'row' && icon\"\n class=\"mint-toggle__row-icon\"\n :style=\"iconStyle()\"\n aria-hidden=\"true\"\n >\n <svg\n v-if=\"isSvgIcon(icon)\"\n class=\"mint-toggle__row-svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <template v-if=\"Array.isArray(icon)\">\n <path v-for=\"(d, i) in icon\" :key=\"i\" :d=\"d\" />\n </template>\n <path v-else :d=\"icon\" />\n </svg>\n <span v-else class=\"mint-toggle__row-text-icon\">{{ icon }}</span>\n </span>\n <span\n v-if=\"variant === 'row' && label\"\n class=\"mint-toggle__copy\"\n >\n <Tooltip\n v-if=\"description\"\n :text=\"description\"\n position=\"right\"\n max-width=\"16rem\"\n >\n <span :class=\"['mint-toggle__label', `mint-toggle__label--${size}`, 'mint-toggle__label--tooltip']\">\n {{ label }}\n </span>\n </Tooltip>\n <span\n v-else\n :class=\"['mint-toggle__label', `mint-toggle__label--${size}`]\"\n >\n {{ label }}\n </span>\n </span>\n <div\n role=\"switch\"\n :tabindex=\"disabled ? -1 : 0\"\n :aria-checked=\"modelValue\"\n :aria-label=\"ariaLabel || label || 'Toggle'\"\n :class=\"[\n 'mint-toggle__track',\n `mint-toggle__track--${size}`,\n modelValue ? 'mint-toggle__track--on' : 'mint-toggle__track--off',\n ]\"\n @keydown=\"handleKeydown\"\n >\n <span :class=\"['mint-toggle__knob', `mint-toggle__knob--${size}`]\" />\n </div>\n <span\n v-if=\"label && variant !== 'row'\"\n :class=\"['mint-toggle__label', `mint-toggle__label--${size}`]\"\n >\n {{ label }}\n </span>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Renders an on/off toggle switch with label, size, and keyboard interaction support. */\nimport Tooltip from './Tooltip.vue'\n\ninterface Props {\n modelValue?: boolean\n label?: string\n /** Accessible switch name; defaults to the visual label, then \"Toggle\". */\n ariaLabel?: string\n description?: string\n icon?: string | string[]\n iconColor?: string\n iconBg?: string\n disabled?: boolean\n size?: 'sm' | 'md' | 'lg'\n reverse?: boolean\n variant?: 'default' | 'row'\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: false,\n disabled: false,\n size: 'md',\n reverse: false,\n variant: 'default',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: boolean]\n}>()\n\nfunction toggle() {\n if (!props.disabled) {\n emit('update:modelValue', !props.modelValue)\n }\n}\n\nfunction handleKeydown(event: KeyboardEvent) {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault()\n toggle()\n }\n}\n\nfunction isSvgIcon(icon?: string | string[]): boolean {\n if (!icon) return false\n return Array.isArray(icon) || icon.startsWith('M') || icon.startsWith('m')\n}\n\nfunction iconStyle(): Record<string, string> {\n return {\n color: props.iconColor ?? (props.modelValue ? 'var(--color-primary)' : 'var(--text-muted)'),\n }\n}\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-toggle',\n `mint-toggle--${variant}`,\n reverse ? 'mint-toggle--reverse' : '',\n disabled ? 'mint-toggle--disabled' : '',\n modelValue ? 'mint-toggle--checked' : '',\n ]\"\n @click=\"toggle\"\n >\n <span\n v-if=\"variant === 'row' && icon\"\n class=\"mint-toggle__row-icon\"\n :style=\"iconStyle()\"\n aria-hidden=\"true\"\n >\n <svg\n v-if=\"isSvgIcon(icon)\"\n class=\"mint-toggle__row-svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <template v-if=\"Array.isArray(icon)\">\n <path v-for=\"(d, i) in icon\" :key=\"i\" :d=\"d\" />\n </template>\n <path v-else :d=\"icon\" />\n </svg>\n <span v-else class=\"mint-toggle__row-text-icon\">{{ icon }}</span>\n </span>\n <span\n v-if=\"variant === 'row' && label\"\n class=\"mint-toggle__copy\"\n >\n <Tooltip\n v-if=\"description\"\n :text=\"description\"\n position=\"right\"\n max-width=\"16rem\"\n >\n <span :class=\"['mint-toggle__label', `mint-toggle__label--${size}`, 'mint-toggle__label--tooltip']\">\n {{ label }}\n </span>\n </Tooltip>\n <span\n v-else\n :class=\"['mint-toggle__label', `mint-toggle__label--${size}`]\"\n >\n {{ label }}\n </span>\n </span>\n <div\n role=\"switch\"\n :tabindex=\"disabled ? -1 : 0\"\n :aria-checked=\"modelValue\"\n :aria-label=\"ariaLabel || label || 'Toggle'\"\n :class=\"[\n 'mint-toggle__track',\n `mint-toggle__track--${size}`,\n modelValue ? 'mint-toggle__track--on' : 'mint-toggle__track--off',\n ]\"\n @keydown=\"handleKeydown\"\n >\n <span :class=\"['mint-toggle__knob', `mint-toggle__knob--${size}`]\" />\n </div>\n <span\n v-if=\"label && variant !== 'row'\"\n :class=\"['mint-toggle__label', `mint-toggle__label--${size}`]\"\n >\n {{ label }}\n </span>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Renders a group of radio buttons in list or tile layout, horizontal or vertical. */\nimport { computed } from 'vue'\nimport type { RadioOption, RadioOptionInput } from '../types'\nimport { normalizeOptionInput } from '../utils/options'\n\ninterface Props {\n modelValue?: string | number\n options: RadioOptionInput[]\n name: string\n disabled?: boolean\n direction?: 'horizontal' | 'vertical'\n size?: 'sm' | 'md' | 'lg'\n variant?: 'list' | 'tile'\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n disabled: false,\n direction: 'vertical',\n size: 'md',\n variant: 'list',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | number]\n}>()\n\nconst normalizedOptions = computed<RadioOption[]>(() => props.options.map(normalizeOptionInput))\n\nfunction handleChange(value: string | number) {\n emit('update:modelValue', value)\n}\n</script>\n\n<template>\n <div\n :class=\"['mint-radio-group', `mint-radio-group--${props.direction}`, `mint-radio-group--${props.variant}`]\"\n role=\"radiogroup\"\n >\n <label\n v-for=\"option in normalizedOptions\"\n :key=\"String(option.value)\"\n :class=\"[\n 'mint-radio-option',\n props.modelValue === option.value ? 'mint-radio-option--selected' : '',\n (props.disabled || option.disabled) ? 'mint-radio-option--disabled' : '',\n ]\"\n >\n <template v-if=\"props.variant === 'list'\">\n <div class=\"mint-radio-option__input-wrapper\">\n <input\n type=\"radio\"\n :name=\"props.name\"\n :value=\"option.value\"\n :checked=\"props.modelValue === option.value\"\n :disabled=\"props.disabled || option.disabled\"\n :aria-describedby=\"option.description ? `${props.name}-${option.value}-desc` : undefined\"\n class=\"mint-radio-option__native\"\n @change=\"handleChange(option.value)\"\n />\n <div\n :class=\"[\n 'mint-radio-option__circle',\n `mint-radio-option__circle--${props.size}`,\n props.modelValue === option.value ? 'mint-radio-option__circle--checked' : '',\n ]\"\n >\n <div\n v-if=\"props.modelValue === option.value\"\n :class=\"['mint-radio-option__dot', `mint-radio-option__dot--${props.size}`]\"\n />\n </div>\n </div>\n <div class=\"mint-radio-option__content\">\n <span :class=\"['mint-radio-option__label', `mint-radio-option__label--${props.size}`]\">\n {{ option.label }}\n </span>\n <span\n v-if=\"option.description\"\n :id=\"`${props.name}-${option.value}-desc`\"\n :class=\"['mint-radio-option__description', `mint-radio-option__description--${props.size}`]\"\n >\n {{ option.description }}\n </span>\n </div>\n </template>\n\n <template v-else>\n <input\n type=\"radio\"\n :name=\"props.name\"\n :value=\"option.value\"\n :checked=\"props.modelValue === option.value\"\n :disabled=\"props.disabled || option.disabled\"\n :aria-describedby=\"option.description ? `${props.name}-${option.value}-desc` : undefined\"\n class=\"mint-radio-option__native\"\n @change=\"handleChange(option.value)\"\n />\n <div class=\"mint-radio-option__head\">\n <div\n :class=\"[\n 'mint-radio-option__circle',\n `mint-radio-option__circle--${props.size}`,\n props.modelValue === option.value ? 'mint-radio-option__circle--checked' : '',\n ]\"\n >\n <div\n v-if=\"props.modelValue === option.value\"\n :class=\"['mint-radio-option__dot', `mint-radio-option__dot--${props.size}`]\"\n />\n </div>\n <span class=\"mint-radio-option__title\">{{ option.label }}</span>\n </div>\n <span\n v-if=\"option.description\"\n :id=\"`${props.name}-${option.value}-desc`\"\n class=\"mint-radio-option__description\"\n >\n {{ option.description }}\n </span>\n </template>\n </label>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Renders a group of radio buttons in list or tile layout, horizontal or vertical. */\nimport { computed } from 'vue'\nimport type { RadioOption, RadioOptionInput } from '../types'\nimport { normalizeOptionInput } from '../utils/options'\n\ninterface Props {\n modelValue?: string | number\n options: RadioOptionInput[]\n name: string\n disabled?: boolean\n direction?: 'horizontal' | 'vertical'\n size?: 'sm' | 'md' | 'lg'\n variant?: 'list' | 'tile'\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n disabled: false,\n direction: 'vertical',\n size: 'md',\n variant: 'list',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | number]\n}>()\n\nconst normalizedOptions = computed<RadioOption[]>(() => props.options.map(normalizeOptionInput))\n\nfunction handleChange(value: string | number) {\n emit('update:modelValue', value)\n}\n</script>\n\n<template>\n <div\n :class=\"['mint-radio-group', `mint-radio-group--${props.direction}`, `mint-radio-group--${props.variant}`]\"\n role=\"radiogroup\"\n >\n <label\n v-for=\"option in normalizedOptions\"\n :key=\"String(option.value)\"\n :class=\"[\n 'mint-radio-option',\n props.modelValue === option.value ? 'mint-radio-option--selected' : '',\n (props.disabled || option.disabled) ? 'mint-radio-option--disabled' : '',\n ]\"\n >\n <template v-if=\"props.variant === 'list'\">\n <div class=\"mint-radio-option__input-wrapper\">\n <input\n type=\"radio\"\n :name=\"props.name\"\n :value=\"option.value\"\n :checked=\"props.modelValue === option.value\"\n :disabled=\"props.disabled || option.disabled\"\n :aria-describedby=\"option.description ? `${props.name}-${option.value}-desc` : undefined\"\n class=\"mint-radio-option__native\"\n @change=\"handleChange(option.value)\"\n />\n <div\n :class=\"[\n 'mint-radio-option__circle',\n `mint-radio-option__circle--${props.size}`,\n props.modelValue === option.value ? 'mint-radio-option__circle--checked' : '',\n ]\"\n >\n <div\n v-if=\"props.modelValue === option.value\"\n :class=\"['mint-radio-option__dot', `mint-radio-option__dot--${props.size}`]\"\n />\n </div>\n </div>\n <div class=\"mint-radio-option__content\">\n <span :class=\"['mint-radio-option__label', `mint-radio-option__label--${props.size}`]\">\n {{ option.label }}\n </span>\n <span\n v-if=\"option.description\"\n :id=\"`${props.name}-${option.value}-desc`\"\n :class=\"['mint-radio-option__description', `mint-radio-option__description--${props.size}`]\"\n >\n {{ option.description }}\n </span>\n </div>\n </template>\n\n <template v-else>\n <input\n type=\"radio\"\n :name=\"props.name\"\n :value=\"option.value\"\n :checked=\"props.modelValue === option.value\"\n :disabled=\"props.disabled || option.disabled\"\n :aria-describedby=\"option.description ? `${props.name}-${option.value}-desc` : undefined\"\n class=\"mint-radio-option__native\"\n @change=\"handleChange(option.value)\"\n />\n <div class=\"mint-radio-option__head\">\n <div\n :class=\"[\n 'mint-radio-option__circle',\n `mint-radio-option__circle--${props.size}`,\n props.modelValue === option.value ? 'mint-radio-option__circle--checked' : '',\n ]\"\n >\n <div\n v-if=\"props.modelValue === option.value\"\n :class=\"['mint-radio-option__dot', `mint-radio-option__dot--${props.size}`]\"\n />\n </div>\n <span class=\"mint-radio-option__title\">{{ option.label }}</span>\n </div>\n <span\n v-if=\"option.description\"\n :id=\"`${props.name}-${option.value}-desc`\"\n class=\"mint-radio-option__description\"\n >\n {{ option.description }}\n </span>\n </template>\n </label>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * Renders a range slider with a filled track, optional value display, and size variants.\n * Optional color stops, value thresholds, and end labels turn it into a threshold slider.\n */\nimport { computed, ref } from 'vue'\n\ninterface SliderColorStop {\n /** Position along the track, in percent (0-100). */\n value: number\n color: string\n}\n\ninterface Props {\n modelValue?: number\n min?: number\n max?: number\n step?: number\n disabled?: boolean\n showValue?: boolean\n size?: 'sm' | 'md' | 'lg'\n /** Paint the track with a gradient through these stops instead of the primary fill. */\n colorStops?: SliderColorStop[]\n /** Tone the value badge by percent of range: success up to the first, warning up to the second, error above. */\n thresholds?: [number, number]\n /** Show the range ends under the slider. */\n showLabels?: boolean\n /** Label for the low end. Defaults to `min`. */\n minLabel?: string\n /** Label for the high end. Defaults to `max`. */\n maxLabel?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n min: 0,\n max: 100,\n step: 1,\n disabled: false,\n showValue: true,\n size: 'md',\n showLabels: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: number]\n}>()\n\nconst isDragging = ref(false)\n\nconst sizeConfig = computed(() => {\n switch (props.size) {\n case 'sm': return { height: 2, thumb: 12 }\n case 'lg': return { height: 6, thumb: 18 }\n default: return { height: 4, thumb: 14 }\n }\n})\n\nconst currentValue = computed(() => {\n return props.modelValue ?? props.min\n})\n\nconst percentage = computed(() => {\n const range = props.max - props.min\n if (range === 0) return 0\n return ((currentValue.value - props.min) / range) * 100\n})\n\n// Thumb-in-bounds offset (Radix UI pattern). Without this, the thumb's\n// center lands at left=0%/100% and overhangs the track by halfWidth at\n// each end. Linearly interpolating an inward push of halfWidth at percent=0\n// to halfWidth-pull at percent=100 keeps the thumb's *edges* — not its\n// center — aligned with the track edges.\nconst thumbPosition = computed(() => {\n const halfWidth = sizeConfig.value.thumb / 2\n const offsetPx = (halfWidth * (50 - percentage.value)) / 50\n return `calc(${percentage.value}% + ${offsetPx}px)`\n})\n\nconst trackBackground = computed(() => {\n if (!props.colorStops) return undefined\n const stops = props.colorStops.map(stop => `${stop.color} ${stop.value}%`).join(', ')\n return `linear-gradient(to right, ${stops})`\n})\n\nconst valueTone = computed(() => {\n if (!props.thresholds) return undefined\n const [warningAbove, errorAbove] = props.thresholds\n if (percentage.value <= warningAbove) return 'success'\n if (percentage.value <= errorAbove) return 'warning'\n return 'error'\n})\n\nfunction handleInput(event: Event) {\n const target = event.target as HTMLInputElement\n emit('update:modelValue', Number(target.value))\n}\n</script>\n\n<template>\n <div\n class=\"mint-slider\"\n :class=\"{ 'mint-slider--disabled': disabled, 'mint-slider--labeled': showLabels }\"\n >\n <div class=\"mint-slider__container\">\n <!-- Track background -->\n <div\n class=\"mint-slider__track\"\n :style=\"{ height: `${sizeConfig.height}px`, background: trackBackground }\"\n />\n\n <!-- Filled track — extends to the thumb's center so the two visually\n meet at every position (no gap at the right edge, no overshoot\n at the left). A gradient track has no fill. -->\n <div\n v-if=\"!colorStops\"\n class=\"mint-slider__fill\"\n :style=\"{\n height: `${sizeConfig.height}px`,\n width: thumbPosition,\n }\"\n />\n\n <!-- Native range input -->\n <input\n type=\"range\"\n class=\"mint-slider__input\"\n :value=\"currentValue\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :disabled=\"disabled\"\n :aria-label=\"`Value: ${currentValue}`\"\n :aria-valuemin=\"min\"\n :aria-valuemax=\"max\"\n :aria-valuenow=\"currentValue\"\n @input=\"handleInput\"\n @mousedown=\"isDragging = true\"\n @mouseup=\"isDragging = false\"\n @touchstart.passive=\"isDragging = true\"\n @touchend=\"isDragging = false\"\n />\n\n <!-- Custom thumb — translateX(-50%) centers it on `left` -->\n <div\n class=\"mint-slider__thumb\"\n :class=\"{ 'mint-slider__thumb--dragging': isDragging }\"\n :style=\"{\n width: `${sizeConfig.thumb}px`,\n height: `${sizeConfig.thumb}px`,\n left: thumbPosition,\n }\"\n />\n </div>\n\n <!-- Value display -->\n <span\n v-if=\"showValue\"\n class=\"mint-slider__value\"\n :class=\"valueTone && `mint-slider__value--${valueTone}`\"\n >\n {{ currentValue }}\n </span>\n\n <!-- Range end labels -->\n <div v-if=\"showLabels\" class=\"mint-slider__labels\">\n <span>{{ minLabel ?? min }}</span>\n <span>{{ maxLabel ?? max }}</span>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * Renders a range slider with a filled track, optional value display, and size variants.\n * Optional color stops, value thresholds, and end labels turn it into a threshold slider.\n */\nimport { computed, ref } from 'vue'\n\ninterface SliderColorStop {\n /** Position along the track, in percent (0-100). */\n value: number\n color: string\n}\n\ninterface Props {\n modelValue?: number\n min?: number\n max?: number\n step?: number\n disabled?: boolean\n showValue?: boolean\n size?: 'sm' | 'md' | 'lg'\n /** Paint the track with a gradient through these stops instead of the primary fill. */\n colorStops?: SliderColorStop[]\n /** Tone the value badge by percent of range: success up to the first, warning up to the second, error above. */\n thresholds?: [number, number]\n /** Show the range ends under the slider. */\n showLabels?: boolean\n /** Label for the low end. Defaults to `min`. */\n minLabel?: string\n /** Label for the high end. Defaults to `max`. */\n maxLabel?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n min: 0,\n max: 100,\n step: 1,\n disabled: false,\n showValue: true,\n size: 'md',\n showLabels: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: number]\n}>()\n\nconst isDragging = ref(false)\n\nconst sizeConfig = computed(() => {\n switch (props.size) {\n case 'sm': return { height: 2, thumb: 12 }\n case 'lg': return { height: 6, thumb: 18 }\n default: return { height: 4, thumb: 14 }\n }\n})\n\nconst currentValue = computed(() => {\n return props.modelValue ?? props.min\n})\n\nconst percentage = computed(() => {\n const range = props.max - props.min\n if (range === 0) return 0\n return ((currentValue.value - props.min) / range) * 100\n})\n\n// Thumb-in-bounds offset (Radix UI pattern). Without this, the thumb's\n// center lands at left=0%/100% and overhangs the track by halfWidth at\n// each end. Linearly interpolating an inward push of halfWidth at percent=0\n// to halfWidth-pull at percent=100 keeps the thumb's *edges* — not its\n// center — aligned with the track edges.\nconst thumbPosition = computed(() => {\n const halfWidth = sizeConfig.value.thumb / 2\n const offsetPx = (halfWidth * (50 - percentage.value)) / 50\n return `calc(${percentage.value}% + ${offsetPx}px)`\n})\n\nconst trackBackground = computed(() => {\n if (!props.colorStops) return undefined\n const stops = props.colorStops.map(stop => `${stop.color} ${stop.value}%`).join(', ')\n return `linear-gradient(to right, ${stops})`\n})\n\nconst valueTone = computed(() => {\n if (!props.thresholds) return undefined\n const [warningAbove, errorAbove] = props.thresholds\n if (percentage.value <= warningAbove) return 'success'\n if (percentage.value <= errorAbove) return 'warning'\n return 'error'\n})\n\nfunction handleInput(event: Event) {\n const target = event.target as HTMLInputElement\n emit('update:modelValue', Number(target.value))\n}\n</script>\n\n<template>\n <div\n class=\"mint-slider\"\n :class=\"{ 'mint-slider--disabled': disabled, 'mint-slider--labeled': showLabels }\"\n >\n <div class=\"mint-slider__container\">\n <!-- Track background -->\n <div\n class=\"mint-slider__track\"\n :style=\"{ height: `${sizeConfig.height}px`, background: trackBackground }\"\n />\n\n <!-- Filled track — extends to the thumb's center so the two visually\n meet at every position (no gap at the right edge, no overshoot\n at the left). A gradient track has no fill. -->\n <div\n v-if=\"!colorStops\"\n class=\"mint-slider__fill\"\n :style=\"{\n height: `${sizeConfig.height}px`,\n width: thumbPosition,\n }\"\n />\n\n <!-- Native range input -->\n <input\n type=\"range\"\n class=\"mint-slider__input\"\n :value=\"currentValue\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :disabled=\"disabled\"\n :aria-label=\"`Value: ${currentValue}`\"\n :aria-valuemin=\"min\"\n :aria-valuemax=\"max\"\n :aria-valuenow=\"currentValue\"\n @input=\"handleInput\"\n @mousedown=\"isDragging = true\"\n @mouseup=\"isDragging = false\"\n @touchstart.passive=\"isDragging = true\"\n @touchend=\"isDragging = false\"\n />\n\n <!-- Custom thumb — translateX(-50%) centers it on `left` -->\n <div\n class=\"mint-slider__thumb\"\n :class=\"{ 'mint-slider__thumb--dragging': isDragging }\"\n :style=\"{\n width: `${sizeConfig.thumb}px`,\n height: `${sizeConfig.thumb}px`,\n left: thumbPosition,\n }\"\n />\n </div>\n\n <!-- Value display -->\n <span\n v-if=\"showValue\"\n class=\"mint-slider__value\"\n :class=\"valueTone && `mint-slider__value--${valueTone}`\"\n >\n {{ currentValue }}\n </span>\n\n <!-- Range end labels -->\n <div v-if=\"showLabels\" class=\"mint-slider__labels\">\n <span>{{ minLabel ?? min }}</span>\n <span>{{ maxLabel ?? max }}</span>\n </div>\n </div>\n</template>\n","import { computed, toValue, type ComputedRef, type Ref } from 'vue'\n\nexport type SelectionLimitSource<T> =\n | T\n | Ref<T>\n | ComputedRef<T>\n | (() => T)\n\nexport interface UseSelectionLimitOptions {\n count: SelectionLimitSource<number>\n max?: SelectionLimitSource<number | null | undefined>\n}\n\nexport interface UseSelectionLimitReturn {\n count: ComputedRef<number>\n max: ComputedRef<number | undefined>\n isLimited: ComputedRef<boolean>\n isAtLimit: ComputedRef<boolean>\n canAddMore: ComputedRef<boolean>\n remaining: ComputedRef<number | undefined>\n canAdd: (amount?: number, fromCount?: number) => boolean\n}\n\n/** Shared cap logic for chip, tag, and multi-select controls. */\nexport function useSelectionLimit(options: UseSelectionLimitOptions): UseSelectionLimitReturn {\n const count = computed(() => Math.max(0, Math.floor(toValue(options.count) || 0)))\n const max = computed(() => normalizeMax(toValue(options.max)))\n const isLimited = computed(() => max.value !== undefined)\n const remaining = computed(() => {\n if (max.value === undefined) return undefined\n return Math.max(0, max.value - count.value)\n })\n const isAtLimit = computed(() => remaining.value === 0)\n const canAddMore = computed(() => canAdd(1))\n\n function canAdd(amount = 1, fromCount = count.value): boolean {\n const normalizedAmount = Math.max(0, Math.floor(amount))\n const normalizedCount = Math.max(0, Math.floor(fromCount))\n if (max.value === undefined) return true\n return normalizedCount + normalizedAmount <= max.value\n }\n\n return {\n count,\n max,\n isLimited,\n isAtLimit,\n canAddMore,\n remaining,\n canAdd,\n }\n}\n\nfunction normalizeMax(value: number | null | undefined): number | undefined {\n if (value === null || value === undefined || !Number.isFinite(value)) return undefined\n return Math.max(0, Math.floor(value))\n}\n","import { computed, toValue, type ComputedRef, type Ref } from 'vue'\nimport { useSelectionLimit, type SelectionLimitSource } from './useSelectionLimit'\n\nexport type ListSelectionValue = string | number\n\nexport type ListSelectionSource<T> =\n | T\n | Ref<T>\n | ComputedRef<T>\n | (() => T)\n\nexport type WidenListSelectionValue<TValue extends ListSelectionValue> =\n TValue extends string ? string : TValue extends number ? number : TValue\n\nexport interface UseListSelectionOptions<\n TItem,\n TValue extends ListSelectionValue = ListSelectionValue,\n> {\n selected: ListSelectionSource<readonly TValue[]>\n items?: ListSelectionSource<readonly TItem[]>\n getValue?: (item: TItem) => TValue\n disabled?: ListSelectionSource<boolean | null | undefined>\n max?: SelectionLimitSource<number | null | undefined>\n}\n\nexport interface UseListSelectionReturn<TValue extends ListSelectionValue = ListSelectionValue> {\n selectedValues: ComputedRef<TValue[]>\n selectedSet: ComputedRef<Set<TValue>>\n itemValues: ComputedRef<TValue[]>\n selectedCount: ComputedRef<number>\n itemCount: ComputedRef<number>\n isAllSelected: ComputedRef<boolean>\n isLimited: ComputedRef<boolean>\n isAtLimit: ComputedRef<boolean>\n canAddMore: ComputedRef<boolean>\n remaining: ComputedRef<number | undefined>\n isSelected: (value: TValue) => boolean\n isFullySelected: (values: readonly TValue[]) => boolean\n isPartiallySelected: (values: readonly TValue[]) => boolean\n selectValues: (values: readonly TValue[]) => TValue[]\n toggleValue: (value: TValue) => TValue[]\n toggleValues: (values: readonly TValue[]) => TValue[]\n selectAll: () => TValue[]\n toggleAll: () => TValue[]\n clear: () => TValue[]\n}\n\n/** Shared list-selection state for checkbox lists, sample selectors, and chip selectors. */\nexport function useListSelection<\n TItem = ListSelectionValue,\n TValue extends ListSelectionValue = TItem extends ListSelectionValue ? TItem : ListSelectionValue,\n>(options: UseListSelectionOptions<TItem, TValue>): UseListSelectionReturn<WidenListSelectionValue<TValue>> {\n type ResolvedValue = WidenListSelectionValue<TValue>\n\n const disabled = computed(() => toValue(options.disabled) ?? false)\n const selectedValues = computed<ResolvedValue[]>(() => [...toValue(options.selected)] as ResolvedValue[])\n const selectedSet = computed(() => new Set(selectedValues.value))\n const itemValues = computed<ResolvedValue[]>(() => {\n const items = toValue(options.items) ?? []\n return items.map(item => getItemValue(item, options.getValue) as ResolvedValue)\n })\n\n const selectedCount = computed(() => selectedValues.value.length)\n const itemCount = computed(() => itemValues.value.length)\n const isAllSelected = computed(() => (\n itemValues.value.length > 0 && itemValues.value.every(value => selectedSet.value.has(value))\n ))\n const selectionLimit = useSelectionLimit({\n count: selectedCount,\n max: options.max,\n })\n\n function isSelected(value: ResolvedValue): boolean {\n return selectedSet.value.has(value)\n }\n\n function isFullySelected(values: readonly ResolvedValue[]): boolean {\n return values.length > 0 && values.every(value => selectedSet.value.has(value))\n }\n\n function isPartiallySelected(values: readonly ResolvedValue[]): boolean {\n if (values.length === 0) return false\n const selected = values.filter(value => selectedSet.value.has(value)).length\n return selected > 0 && selected < values.length\n }\n\n function selectValues(values: readonly ResolvedValue[]): ResolvedValue[] {\n if (disabled.value) return selectedValues.value\n const missing = uniqueValues(values).filter(value => !selectedSet.value.has(value))\n if (!selectionLimit.canAdd(missing.length)) return selectedValues.value\n return [...selectedValues.value, ...missing]\n }\n\n function toggleValue(value: ResolvedValue): ResolvedValue[] {\n if (disabled.value) return selectedValues.value\n if (selectedSet.value.has(value)) {\n return selectedValues.value.filter(selected => selected !== value)\n }\n if (!selectionLimit.canAddMore.value) return selectedValues.value\n return [...selectedValues.value, value]\n }\n\n function toggleValues(values: readonly ResolvedValue[]): ResolvedValue[] {\n if (disabled.value) return selectedValues.value\n const unique = uniqueValues(values)\n if (isFullySelected(unique)) {\n const remove = new Set(unique)\n return selectedValues.value.filter(value => !remove.has(value))\n }\n return selectValues(unique)\n }\n\n function selectAll(): ResolvedValue[] {\n return selectValues(itemValues.value)\n }\n\n function toggleAll(): ResolvedValue[] {\n if (isAllSelected.value) return clear()\n return selectAll()\n }\n\n function clear(): ResolvedValue[] {\n return disabled.value ? selectedValues.value : []\n }\n\n return {\n selectedValues,\n selectedSet,\n itemValues,\n selectedCount,\n itemCount,\n isAllSelected,\n isLimited: selectionLimit.isLimited,\n isAtLimit: selectionLimit.isAtLimit,\n canAddMore: selectionLimit.canAddMore,\n remaining: selectionLimit.remaining,\n isSelected,\n isFullySelected,\n isPartiallySelected,\n selectValues,\n toggleValue,\n toggleValues,\n selectAll,\n toggleAll,\n clear,\n }\n}\n\nfunction getItemValue<TItem, TValue extends ListSelectionValue>(\n item: TItem,\n getValue: ((item: TItem) => TValue) | undefined,\n): TValue {\n return getValue ? getValue(item) : item as unknown as TValue\n}\n\nfunction uniqueValues<TValue extends ListSelectionValue>(values: readonly TValue[]): TValue[] {\n return [...new Set(values)]\n}\n","<script setup lang=\"ts\">\n/** Lets users select multiple options from a checkbox list with optional selection cap. */\nimport { computed } from 'vue'\nimport type { MultiSelectOption, MultiSelectOptionInput, MultiSelectSize } from '../types'\nimport { useListSelection } from '../composables/useListSelection'\nimport { normalizeOptionInput } from '../utils/options'\n\ninterface Props {\n modelValue: (string | number)[]\n options: MultiSelectOptionInput[]\n placeholder?: string\n disabled?: boolean\n maxSelections?: number\n size?: MultiSelectSize\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n placeholder: 'Select options...',\n disabled: false,\n size: 'md',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: (string | number)[]]\n}>()\n\nconst normalizedOptions = computed<MultiSelectOption[]>(() => props.options.map(normalizeOptionInput))\nconst optionSelection = useListSelection({\n selected: () => props.modelValue,\n items: normalizedOptions,\n getValue: option => option.value,\n disabled: () => props.disabled,\n max: () => props.maxSelections,\n})\nconst canSelectMore = optionSelection.canAddMore\n\nfunction isSelected(value: string | number): boolean {\n return optionSelection.isSelected(value)\n}\n\nfunction toggleOption(option: MultiSelectOption) {\n if (props.disabled || option.disabled) return\n\n if (isSelected(option.value) || canSelectMore.value) {\n emit('update:modelValue', optionSelection.toggleValue(option.value))\n }\n}\n\nfunction handleKeydown(event: KeyboardEvent, option: MultiSelectOption) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n toggleOption(option)\n }\n}\n\nconst selectedLabels = computed(() => {\n return props.modelValue\n .map(v => normalizedOptions.value.find(o => o.value === v)?.label)\n .filter(Boolean)\n})\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-multi-select',\n `mint-multi-select--${size}`,\n disabled ? 'mint-multi-select--disabled' : '',\n ]\"\n >\n <div\n v-if=\"modelValue.length === 0\"\n class=\"mint-multi-select__placeholder\"\n >\n {{ placeholder }}\n </div>\n\n <div class=\"mint-multi-select__options\" role=\"group\">\n <button\n v-for=\"option in normalizedOptions\"\n :key=\"String(option.value)\"\n type=\"button\"\n role=\"checkbox\"\n :aria-checked=\"isSelected(option.value)\"\n :disabled=\"disabled || option.disabled || (!isSelected(option.value) && !canSelectMore)\"\n :class=\"[\n 'mint-multi-select__chip',\n `mint-multi-select__chip--${size}`,\n isSelected(option.value) ? 'mint-multi-select__chip--active' : '',\n option.disabled ? 'mint-multi-select__chip--disabled' : '',\n !isSelected(option.value) && !canSelectMore ? 'mint-multi-select__chip--disabled' : '',\n ]\"\n @click=\"toggleOption(option)\"\n @keydown=\"handleKeydown($event, option)\"\n >\n <svg\n class=\"mint-multi-select__chip-check\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n <span class=\"mint-multi-select__chip-label\">{{ option.label }}</span>\n </button>\n </div>\n\n <div\n v-if=\"modelValue.length > 0\"\n class=\"mint-multi-select__summary\"\n >\n {{ selectedLabels.join(', ') }}\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Lets users select multiple options from a checkbox list with optional selection cap. */\nimport { computed } from 'vue'\nimport type { MultiSelectOption, MultiSelectOptionInput, MultiSelectSize } from '../types'\nimport { useListSelection } from '../composables/useListSelection'\nimport { normalizeOptionInput } from '../utils/options'\n\ninterface Props {\n modelValue: (string | number)[]\n options: MultiSelectOptionInput[]\n placeholder?: string\n disabled?: boolean\n maxSelections?: number\n size?: MultiSelectSize\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n placeholder: 'Select options...',\n disabled: false,\n size: 'md',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: (string | number)[]]\n}>()\n\nconst normalizedOptions = computed<MultiSelectOption[]>(() => props.options.map(normalizeOptionInput))\nconst optionSelection = useListSelection({\n selected: () => props.modelValue,\n items: normalizedOptions,\n getValue: option => option.value,\n disabled: () => props.disabled,\n max: () => props.maxSelections,\n})\nconst canSelectMore = optionSelection.canAddMore\n\nfunction isSelected(value: string | number): boolean {\n return optionSelection.isSelected(value)\n}\n\nfunction toggleOption(option: MultiSelectOption) {\n if (props.disabled || option.disabled) return\n\n if (isSelected(option.value) || canSelectMore.value) {\n emit('update:modelValue', optionSelection.toggleValue(option.value))\n }\n}\n\nfunction handleKeydown(event: KeyboardEvent, option: MultiSelectOption) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n toggleOption(option)\n }\n}\n\nconst selectedLabels = computed(() => {\n return props.modelValue\n .map(v => normalizedOptions.value.find(o => o.value === v)?.label)\n .filter(Boolean)\n})\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-multi-select',\n `mint-multi-select--${size}`,\n disabled ? 'mint-multi-select--disabled' : '',\n ]\"\n >\n <div\n v-if=\"modelValue.length === 0\"\n class=\"mint-multi-select__placeholder\"\n >\n {{ placeholder }}\n </div>\n\n <div class=\"mint-multi-select__options\" role=\"group\">\n <button\n v-for=\"option in normalizedOptions\"\n :key=\"String(option.value)\"\n type=\"button\"\n role=\"checkbox\"\n :aria-checked=\"isSelected(option.value)\"\n :disabled=\"disabled || option.disabled || (!isSelected(option.value) && !canSelectMore)\"\n :class=\"[\n 'mint-multi-select__chip',\n `mint-multi-select__chip--${size}`,\n isSelected(option.value) ? 'mint-multi-select__chip--active' : '',\n option.disabled ? 'mint-multi-select__chip--disabled' : '',\n !isSelected(option.value) && !canSelectMore ? 'mint-multi-select__chip--disabled' : '',\n ]\"\n @click=\"toggleOption(option)\"\n @keydown=\"handleKeydown($event, option)\"\n >\n <svg\n class=\"mint-multi-select__chip-check\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n <span class=\"mint-multi-select__chip-label\">{{ option.label }}</span>\n </button>\n </div>\n\n <div\n v-if=\"modelValue.length > 0\"\n class=\"mint-multi-select__summary\"\n >\n {{ selectedLabels.join(', ') }}\n </div>\n </div>\n</template>\n","import { computed, ref, type ComputedRef, type Ref } from 'vue'\n\nexport interface CalendarGridDay {\n date: Date\n isCurrentMonth: boolean\n isDisabled: boolean\n}\n\nexport interface UseCalendarGridOptions {\n min?: () => string | undefined\n max?: () => string | undefined\n locale?: () => string | undefined\n}\n\nexport interface UseCalendarGridReturn {\n currentMonth: Ref<Date>\n weekDays: readonly string[]\n monthYear: ComputedRef<string>\n calendarDays: ComputedRef<CalendarGridDay[]>\n isDateDisabled: (date: Date) => boolean\n isSameDay: (date: Date, other: Date | null | undefined) => boolean\n isToday: (date: Date) => boolean\n formatDateValue: (date: Date) => string\n setCurrentMonthFromDate: (date: Date) => void\n prevMonth: () => void\n nextMonth: () => void\n}\n\nconst WEEK_DAYS = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'] as const\n\n/** Shared calendar grid state for date and datetime pickers. */\nexport function useCalendarGrid(options: UseCalendarGridOptions = {}): UseCalendarGridReturn {\n const currentMonth = ref(new Date())\n\n const monthYear = computed(() => {\n return currentMonth.value.toLocaleDateString(options.locale?.() ?? 'en-US', {\n year: 'numeric',\n month: 'long',\n })\n })\n\n const calendarDays = computed<CalendarGridDay[]>(() => {\n const year = currentMonth.value.getFullYear()\n const month = currentMonth.value.getMonth()\n const firstDay = new Date(year, month, 1)\n const lastDay = new Date(year, month + 1, 0)\n const days: CalendarGridDay[] = []\n\n const startPadding = firstDay.getDay()\n for (let i = startPadding - 1; i >= 0; i--) {\n const date = new Date(year, month, -i)\n days.push({ date, isCurrentMonth: false, isDisabled: isDateDisabled(date) })\n }\n\n for (let i = 1; i <= lastDay.getDate(); i++) {\n const date = new Date(year, month, i)\n days.push({ date, isCurrentMonth: true, isDisabled: isDateDisabled(date) })\n }\n\n const endPadding = 42 - days.length\n for (let i = 1; i <= endPadding; i++) {\n const date = new Date(year, month + 1, i)\n days.push({ date, isCurrentMonth: false, isDisabled: isDateDisabled(date) })\n }\n\n return days\n })\n\n function isDateDisabled(date: Date): boolean {\n const minDate = parseBoundaryDate(options.min?.())\n if (minDate && startOfDay(date) < startOfDay(minDate)) return true\n\n const maxDate = parseBoundaryDate(options.max?.())\n if (maxDate && startOfDay(date) > startOfDay(maxDate)) return true\n\n return false\n }\n\n function isSameDay(date: Date, other: Date | null | undefined): boolean {\n if (!other) return false\n return date.toDateString() === other.toDateString()\n }\n\n function isToday(date: Date): boolean {\n return isSameDay(date, new Date())\n }\n\n function formatDateValue(date: Date): string {\n const year = date.getFullYear()\n const month = String(date.getMonth() + 1).padStart(2, '0')\n const day = String(date.getDate()).padStart(2, '0')\n return `${year}-${month}-${day}`\n }\n\n function setCurrentMonthFromDate(date: Date): void {\n currentMonth.value = new Date(date.getFullYear(), date.getMonth(), 1)\n }\n\n function prevMonth(): void {\n currentMonth.value = new Date(\n currentMonth.value.getFullYear(),\n currentMonth.value.getMonth() - 1,\n 1,\n )\n }\n\n function nextMonth(): void {\n currentMonth.value = new Date(\n currentMonth.value.getFullYear(),\n currentMonth.value.getMonth() + 1,\n 1,\n )\n }\n\n return {\n currentMonth,\n weekDays: WEEK_DAYS,\n monthYear,\n calendarDays,\n isDateDisabled,\n isSameDay,\n isToday,\n formatDateValue,\n setCurrentMonthFromDate,\n prevMonth,\n nextMonth,\n }\n}\n\nfunction parseBoundaryDate(value: string | undefined): Date | null {\n if (!value) return null\n const date = value.includes('T') ? new Date(value) : new Date(`${value}T00:00:00`)\n return Number.isNaN(date.getTime()) ? null : date\n}\n\nfunction startOfDay(date: Date): Date {\n const copy = new Date(date)\n copy.setHours(0, 0, 0, 0)\n return copy\n}\n","import { nextTick, ref, type Ref } from 'vue'\nimport { useEventListener } from './useEventListener'\n\nexport interface UseDropdownStateOptions {\n closeOnOutsideClick?: boolean\n closeOnEscape?: boolean\n /** Close the panel when the page scrolls or the viewport resizes. Default `false`. */\n closeOnScroll?: boolean\n insideRefs?: Array<Ref<HTMLElement | null>>\n /**\n * Element that counts as \"inside\" for outside-click closing, typically a\n * `useTemplateRef()`. Without one, bind the returned `rootRef` instead.\n */\n rootRef?: Ref<HTMLElement | null>\n /**\n * Element focus returns to when the panel closes with `close(true)` (Escape).\n * Pass one when the trigger lives outside `rootRef`; otherwise bind the\n * returned `triggerRef` to the trigger element.\n */\n triggerRef?: Ref<HTMLElement | null>\n onOpen?: () => void\n onClose?: () => void\n}\n\nexport interface UseDropdownStateReturn {\n isOpen: Ref<boolean>\n rootRef: Ref<HTMLElement | null>\n /** Bind to the trigger element so Escape can return focus to it. */\n triggerRef: Ref<HTMLElement | null>\n open: () => void\n /** Closes the panel; `returnFocus` moves focus back to `triggerRef`. */\n close: (returnFocus?: boolean) => void\n toggle: () => void\n handleClickOutside: (event: MouseEvent) => void\n handleKeydown: (event: KeyboardEvent) => void\n}\n\n/**\n * Shared disclosure state for dropdown-style SDK components: open/close state,\n * outside-click and Escape closing, optional scroll/resize closing, and focus\n * return to the trigger. `close(returnFocus)` mirrors `useMenuKeyboard`'s\n * contract, so the two compose directly.\n */\nexport function useDropdownState(options: UseDropdownStateOptions = {}): UseDropdownStateReturn {\n const isOpen = ref(false)\n const rootRef = options.rootRef ?? ref<HTMLElement | null>(null)\n const triggerRef = options.triggerRef ?? ref<HTMLElement | null>(null)\n const closeOnOutsideClick = options.closeOnOutsideClick ?? true\n const closeOnEscape = options.closeOnEscape ?? true\n const closeOnScroll = options.closeOnScroll ?? false\n\n function open(): void {\n if (isOpen.value) return\n isOpen.value = true\n options.onOpen?.()\n }\n\n function close(returnFocus = false): void {\n if (!isOpen.value) return\n isOpen.value = false\n options.onClose?.()\n if (returnFocus) {\n void nextTick(() => triggerRef.value?.focus())\n }\n }\n\n function toggle(): void {\n if (isOpen.value) {\n close()\n } else {\n open()\n }\n }\n\n function handleClickOutside(event: MouseEvent): void {\n if (!closeOnOutsideClick || !isOpen.value || !rootRef.value) return\n const target = event.target\n if (\n target instanceof Node &&\n !rootRef.value.contains(target) &&\n !options.insideRefs?.some(ref => ref.value?.contains(target))\n ) {\n close()\n }\n }\n\n function handleKeydown(event: KeyboardEvent): void {\n if (closeOnEscape && event.key === 'Escape') {\n close(true)\n }\n }\n\n function handleViewportChange(): void {\n if (isOpen.value) close()\n }\n\n if (closeOnOutsideClick) {\n useEventListener(() => document, 'click', handleClickOutside)\n }\n if (closeOnEscape) {\n useEventListener(() => document, 'keydown', handleKeydown)\n }\n if (closeOnScroll) {\n useEventListener(() => window, 'scroll', handleViewportChange, true)\n useEventListener(() => window, 'resize', handleViewportChange)\n }\n\n return {\n isOpen,\n rootRef,\n triggerRef,\n open,\n close,\n toggle,\n handleClickOutside,\n handleKeydown,\n }\n}\n","<script setup lang=\"ts\">\n/** Shared calendar grid panel used by date-oriented picker components. */\nimport type { CalendarGridDay } from '../../composables/useCalendarGrid'\n\ninterface Props {\n weekDays: readonly string[]\n monthYear: string\n days: CalendarGridDay[]\n selectedDate?: Date | null\n locale?: string\n previousLabel?: string\n nextLabel?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n selectedDate: null,\n locale: 'en-US',\n previousLabel: 'Previous month',\n nextLabel: 'Next month',\n})\n\nconst emit = defineEmits<{\n 'previous-month': []\n 'next-month': []\n select: [day: CalendarGridDay]\n}>()\n\nfunction isSameDay(date: Date, other: Date | null | undefined): boolean {\n if (!other) return false\n return date.toDateString() === other.toDateString()\n}\n\nfunction isToday(date: Date): boolean {\n return isSameDay(date, new Date())\n}\n\nfunction dayAriaLabel(date: Date): string {\n return date.toLocaleDateString(props.locale, {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n })\n}\n</script>\n\n<template>\n <div class=\"mint-calendar-grid-panel\">\n <div class=\"mint-date-picker__header\">\n <button\n type=\"button\"\n class=\"mint-date-picker__nav-btn\"\n :aria-label=\"previousLabel\"\n @click=\"emit('previous-month')\"\n >\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n </button>\n <span class=\"mint-date-picker__month-year\">{{ monthYear }}</span>\n <button\n type=\"button\"\n class=\"mint-date-picker__nav-btn\"\n :aria-label=\"nextLabel\"\n @click=\"emit('next-month')\"\n >\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n </button>\n </div>\n\n <div class=\"mint-date-picker__weekdays\">\n <div\n v-for=\"day in weekDays\"\n :key=\"day\"\n class=\"mint-date-picker__weekday\"\n >\n {{ day }}\n </div>\n </div>\n\n <div class=\"mint-date-picker__grid\">\n <button\n v-for=\"(day, index) in days\"\n :key=\"index\"\n type=\"button\"\n :disabled=\"day.isDisabled\"\n :aria-label=\"dayAriaLabel(day.date)\"\n :aria-selected=\"isSameDay(day.date, selectedDate)\"\n :class=\"[\n 'mint-date-picker__day',\n !day.isCurrentMonth ? 'mint-date-picker__day--other-month' : '',\n day.isDisabled ? 'mint-date-picker__day--disabled' : '',\n isSameDay(day.date, selectedDate) ? 'mint-date-picker__day--selected' : '',\n isToday(day.date) ? 'mint-date-picker__day--today' : '',\n ]\"\n @click=\"emit('select', day)\"\n >\n {{ day.date.getDate() }}\n </button>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Shared calendar grid panel used by date-oriented picker components. */\nimport type { CalendarGridDay } from '../../composables/useCalendarGrid'\n\ninterface Props {\n weekDays: readonly string[]\n monthYear: string\n days: CalendarGridDay[]\n selectedDate?: Date | null\n locale?: string\n previousLabel?: string\n nextLabel?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n selectedDate: null,\n locale: 'en-US',\n previousLabel: 'Previous month',\n nextLabel: 'Next month',\n})\n\nconst emit = defineEmits<{\n 'previous-month': []\n 'next-month': []\n select: [day: CalendarGridDay]\n}>()\n\nfunction isSameDay(date: Date, other: Date | null | undefined): boolean {\n if (!other) return false\n return date.toDateString() === other.toDateString()\n}\n\nfunction isToday(date: Date): boolean {\n return isSameDay(date, new Date())\n}\n\nfunction dayAriaLabel(date: Date): string {\n return date.toLocaleDateString(props.locale, {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n })\n}\n</script>\n\n<template>\n <div class=\"mint-calendar-grid-panel\">\n <div class=\"mint-date-picker__header\">\n <button\n type=\"button\"\n class=\"mint-date-picker__nav-btn\"\n :aria-label=\"previousLabel\"\n @click=\"emit('previous-month')\"\n >\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n </button>\n <span class=\"mint-date-picker__month-year\">{{ monthYear }}</span>\n <button\n type=\"button\"\n class=\"mint-date-picker__nav-btn\"\n :aria-label=\"nextLabel\"\n @click=\"emit('next-month')\"\n >\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n </button>\n </div>\n\n <div class=\"mint-date-picker__weekdays\">\n <div\n v-for=\"day in weekDays\"\n :key=\"day\"\n class=\"mint-date-picker__weekday\"\n >\n {{ day }}\n </div>\n </div>\n\n <div class=\"mint-date-picker__grid\">\n <button\n v-for=\"(day, index) in days\"\n :key=\"index\"\n type=\"button\"\n :disabled=\"day.isDisabled\"\n :aria-label=\"dayAriaLabel(day.date)\"\n :aria-selected=\"isSameDay(day.date, selectedDate)\"\n :class=\"[\n 'mint-date-picker__day',\n !day.isCurrentMonth ? 'mint-date-picker__day--other-month' : '',\n day.isDisabled ? 'mint-date-picker__day--disabled' : '',\n isSameDay(day.date, selectedDate) ? 'mint-date-picker__day--selected' : '',\n isToday(day.date) ? 'mint-date-picker__day--today' : '',\n ]\"\n @click=\"emit('select', day)\"\n >\n {{ day.date.getDate() }}\n </button>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Input that opens a calendar dropdown for selecting a single date, with clearable support. */\nimport { autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom'\nimport { ref, computed, nextTick, onBeforeUnmount, watch, useTemplateRef } from 'vue'\nimport { useCalendarGrid, type CalendarGridDay } from '../composables/useCalendarGrid'\nimport { useDropdownState } from '../composables/useDropdownState'\nimport { useFocusTrap } from '../composables/useFocusTrap'\nimport CalendarGridPanelInternal from './internal/CalendarGridPanelInternal.vue'\n\ninterface Props {\n modelValue?: string\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n min?: string\n max?: string\n clearable?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n disabled: false,\n error: false,\n size: 'md',\n clearable: true,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | undefined]\n}>()\n\nconst dropdownRef = ref<HTMLElement | null>(null)\nconst dropdownStyle = ref<Record<string, string>>({})\nconst { isOpen, triggerRef, open, close, toggle } = useDropdownState({\n rootRef: useTemplateRef<HTMLElement>('container'),\n insideRefs: [dropdownRef],\n})\n// The panel is a non-modal dialog: Tab cycles inside it while it is open, and\n// focus returns to the input when it closes.\nuseFocusTrap({ containerRef: dropdownRef, active: isOpen })\nconst {\n weekDays,\n monthYear,\n calendarDays,\n isDateDisabled,\n formatDateValue,\n setCurrentMonthFromDate,\n prevMonth,\n nextMonth,\n} = useCalendarGrid({\n min: () => props.min,\n max: () => props.max,\n})\n\nconst selectedDate = computed(() => {\n if (!props.modelValue) return null\n const date = new Date(props.modelValue + 'T00:00:00')\n return isNaN(date.getTime()) ? null : date\n})\n\nconst displayValue = computed(() => {\n if (!selectedDate.value) return ''\n return selectedDate.value.toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n })\n})\n\nfunction selectDate(day: CalendarGridDay) {\n if (day.isDisabled || props.disabled) return\n emit('update:modelValue', formatDateValue(day.date))\n close()\n}\n\nfunction goToToday() {\n const today = new Date()\n setCurrentMonthFromDate(today)\n if (!isDateDisabled(today)) {\n emit('update:modelValue', formatDateValue(today))\n close()\n }\n}\n\nfunction clear() {\n emit('update:modelValue', undefined)\n close()\n}\n\nfunction toggleCalendar() {\n if (props.disabled) return\n toggle()\n}\n\nfunction handleTriggerKeydown(event: KeyboardEvent) {\n if (props.disabled || isOpen.value) return\n if (event.key === 'Enter' || event.key === ' ' || event.key === 'ArrowDown') {\n event.preventDefault()\n open()\n }\n}\n\n// floating-ui keeps the panel anchored (flip/shift) while the page scrolls,\n// instead of the panel closing on every scroll or resize.\nlet stopAutoUpdate: (() => void) | null = null\n\nasync function updateDropdownPosition() {\n const trigger = triggerRef.value\n const panel = dropdownRef.value\n if (!trigger || !panel) return\n\n const { x, y } = await computePosition(trigger, panel, {\n placement: 'bottom-start',\n strategy: 'fixed',\n middleware: [offset(4), flip(), shift({ padding: 8 })],\n })\n dropdownStyle.value = {\n position: 'fixed',\n top: `${y}px`,\n left: `${x}px`,\n zIndex: '9999',\n }\n}\n\nfunction stopPositioning() {\n stopAutoUpdate?.()\n stopAutoUpdate = null\n}\n\nfunction startPositioning() {\n const trigger = triggerRef.value\n const panel = dropdownRef.value\n if (!trigger || !panel) return\n stopPositioning()\n stopAutoUpdate = autoUpdate(trigger, panel, () => void updateDropdownPosition())\n}\n\n/** Moves focus into the calendar grid: selected day, else today, else the first day. */\nfunction focusCalendar() {\n const panel = dropdownRef.value\n if (!panel) return\n const target =\n panel.querySelector<HTMLElement>('.mint-date-picker__day--selected') ??\n panel.querySelector<HTMLElement>('.mint-date-picker__day--today') ??\n panel.querySelector<HTMLElement>('.mint-date-picker__day:not([disabled])')\n target?.focus()\n}\n\nwatch(isOpen, async (opened) => {\n if (!opened) {\n stopPositioning()\n return\n }\n if (selectedDate.value) {\n setCurrentMonthFromDate(selectedDate.value)\n }\n await nextTick()\n startPositioning()\n // A second tick so this focus lands after the focus trap's initial focus.\n await nextTick()\n focusCalendar()\n})\n\nonBeforeUnmount(stopPositioning)\n</script>\n\n<template>\n <div ref=\"container\" class=\"mint-date-picker\">\n <div class=\"mint-date-picker__input-wrapper\">\n <input\n ref=\"triggerRef\"\n type=\"text\"\n readonly\n aria-haspopup=\"dialog\"\n :aria-expanded=\"isOpen\"\n :value=\"displayValue\"\n :placeholder=\"placeholder || 'Select date'\"\n :disabled=\"disabled\"\n :class=\"[\n 'mint-date-picker__input',\n `mint-date-picker__input--${size}`,\n error ? 'mint-date-picker__input--error' : '',\n disabled ? 'mint-date-picker__input--disabled' : '',\n ]\"\n @click=\"toggleCalendar\"\n @keydown=\"handleTriggerKeydown\"\n />\n <div class=\"mint-date-picker__icon\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M8 2v4\" /><path d=\"M16 2v4\" /><rect width=\"18\" height=\"18\" x=\"3\" y=\"4\" rx=\"2\" /><path d=\"M3 10h18\" />\n </svg>\n </div>\n </div>\n\n <Teleport to=\"body\">\n <Transition\n enter-active-class=\"mint-date-picker__dropdown-enter-active\"\n enter-from-class=\"mint-date-picker__dropdown-enter-from\"\n enter-to-class=\"mint-date-picker__dropdown-enter-to\"\n leave-active-class=\"mint-date-picker__dropdown-leave-active\"\n leave-from-class=\"mint-date-picker__dropdown-leave-from\"\n leave-to-class=\"mint-date-picker__dropdown-leave-to\"\n >\n <div\n v-if=\"isOpen\"\n ref=\"dropdownRef\"\n class=\"mint-popover mint-date-picker__dropdown\"\n :style=\"dropdownStyle\"\n role=\"dialog\"\n aria-label=\"Date picker\"\n >\n <CalendarGridPanelInternal\n :week-days=\"weekDays\"\n :month-year=\"monthYear\"\n :days=\"calendarDays\"\n :selected-date=\"selectedDate\"\n @previous-month=\"prevMonth\"\n @next-month=\"nextMonth\"\n @select=\"selectDate\"\n />\n\n <div class=\"mint-date-picker__footer\">\n <button\n type=\"button\"\n class=\"mint-date-picker__footer-btn mint-date-picker__today-btn\"\n @click=\"goToToday\"\n >\n Today\n </button>\n <button\n v-if=\"clearable && modelValue\"\n type=\"button\"\n class=\"mint-date-picker__footer-btn mint-date-picker__clear-btn\"\n @click=\"clear\"\n >\n Clear\n </button>\n </div>\n </div>\n </Transition>\n </Teleport>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Input that opens a calendar dropdown for selecting a single date, with clearable support. */\nimport { autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom'\nimport { ref, computed, nextTick, onBeforeUnmount, watch, useTemplateRef } from 'vue'\nimport { useCalendarGrid, type CalendarGridDay } from '../composables/useCalendarGrid'\nimport { useDropdownState } from '../composables/useDropdownState'\nimport { useFocusTrap } from '../composables/useFocusTrap'\nimport CalendarGridPanelInternal from './internal/CalendarGridPanelInternal.vue'\n\ninterface Props {\n modelValue?: string\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n min?: string\n max?: string\n clearable?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n disabled: false,\n error: false,\n size: 'md',\n clearable: true,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | undefined]\n}>()\n\nconst dropdownRef = ref<HTMLElement | null>(null)\nconst dropdownStyle = ref<Record<string, string>>({})\nconst { isOpen, triggerRef, open, close, toggle } = useDropdownState({\n rootRef: useTemplateRef<HTMLElement>('container'),\n insideRefs: [dropdownRef],\n})\n// The panel is a non-modal dialog: Tab cycles inside it while it is open, and\n// focus returns to the input when it closes.\nuseFocusTrap({ containerRef: dropdownRef, active: isOpen })\nconst {\n weekDays,\n monthYear,\n calendarDays,\n isDateDisabled,\n formatDateValue,\n setCurrentMonthFromDate,\n prevMonth,\n nextMonth,\n} = useCalendarGrid({\n min: () => props.min,\n max: () => props.max,\n})\n\nconst selectedDate = computed(() => {\n if (!props.modelValue) return null\n const date = new Date(props.modelValue + 'T00:00:00')\n return isNaN(date.getTime()) ? null : date\n})\n\nconst displayValue = computed(() => {\n if (!selectedDate.value) return ''\n return selectedDate.value.toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n })\n})\n\nfunction selectDate(day: CalendarGridDay) {\n if (day.isDisabled || props.disabled) return\n emit('update:modelValue', formatDateValue(day.date))\n close()\n}\n\nfunction goToToday() {\n const today = new Date()\n setCurrentMonthFromDate(today)\n if (!isDateDisabled(today)) {\n emit('update:modelValue', formatDateValue(today))\n close()\n }\n}\n\nfunction clear() {\n emit('update:modelValue', undefined)\n close()\n}\n\nfunction toggleCalendar() {\n if (props.disabled) return\n toggle()\n}\n\nfunction handleTriggerKeydown(event: KeyboardEvent) {\n if (props.disabled || isOpen.value) return\n if (event.key === 'Enter' || event.key === ' ' || event.key === 'ArrowDown') {\n event.preventDefault()\n open()\n }\n}\n\n// floating-ui keeps the panel anchored (flip/shift) while the page scrolls,\n// instead of the panel closing on every scroll or resize.\nlet stopAutoUpdate: (() => void) | null = null\n\nasync function updateDropdownPosition() {\n const trigger = triggerRef.value\n const panel = dropdownRef.value\n if (!trigger || !panel) return\n\n const { x, y } = await computePosition(trigger, panel, {\n placement: 'bottom-start',\n strategy: 'fixed',\n middleware: [offset(4), flip(), shift({ padding: 8 })],\n })\n dropdownStyle.value = {\n position: 'fixed',\n top: `${y}px`,\n left: `${x}px`,\n zIndex: '9999',\n }\n}\n\nfunction stopPositioning() {\n stopAutoUpdate?.()\n stopAutoUpdate = null\n}\n\nfunction startPositioning() {\n const trigger = triggerRef.value\n const panel = dropdownRef.value\n if (!trigger || !panel) return\n stopPositioning()\n stopAutoUpdate = autoUpdate(trigger, panel, () => void updateDropdownPosition())\n}\n\n/** Moves focus into the calendar grid: selected day, else today, else the first day. */\nfunction focusCalendar() {\n const panel = dropdownRef.value\n if (!panel) return\n const target =\n panel.querySelector<HTMLElement>('.mint-date-picker__day--selected') ??\n panel.querySelector<HTMLElement>('.mint-date-picker__day--today') ??\n panel.querySelector<HTMLElement>('.mint-date-picker__day:not([disabled])')\n target?.focus()\n}\n\nwatch(isOpen, async (opened) => {\n if (!opened) {\n stopPositioning()\n return\n }\n if (selectedDate.value) {\n setCurrentMonthFromDate(selectedDate.value)\n }\n await nextTick()\n startPositioning()\n // A second tick so this focus lands after the focus trap's initial focus.\n await nextTick()\n focusCalendar()\n})\n\nonBeforeUnmount(stopPositioning)\n</script>\n\n<template>\n <div ref=\"container\" class=\"mint-date-picker\">\n <div class=\"mint-date-picker__input-wrapper\">\n <input\n ref=\"triggerRef\"\n type=\"text\"\n readonly\n aria-haspopup=\"dialog\"\n :aria-expanded=\"isOpen\"\n :value=\"displayValue\"\n :placeholder=\"placeholder || 'Select date'\"\n :disabled=\"disabled\"\n :class=\"[\n 'mint-date-picker__input',\n `mint-date-picker__input--${size}`,\n error ? 'mint-date-picker__input--error' : '',\n disabled ? 'mint-date-picker__input--disabled' : '',\n ]\"\n @click=\"toggleCalendar\"\n @keydown=\"handleTriggerKeydown\"\n />\n <div class=\"mint-date-picker__icon\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M8 2v4\" /><path d=\"M16 2v4\" /><rect width=\"18\" height=\"18\" x=\"3\" y=\"4\" rx=\"2\" /><path d=\"M3 10h18\" />\n </svg>\n </div>\n </div>\n\n <Teleport to=\"body\">\n <Transition\n enter-active-class=\"mint-date-picker__dropdown-enter-active\"\n enter-from-class=\"mint-date-picker__dropdown-enter-from\"\n enter-to-class=\"mint-date-picker__dropdown-enter-to\"\n leave-active-class=\"mint-date-picker__dropdown-leave-active\"\n leave-from-class=\"mint-date-picker__dropdown-leave-from\"\n leave-to-class=\"mint-date-picker__dropdown-leave-to\"\n >\n <div\n v-if=\"isOpen\"\n ref=\"dropdownRef\"\n class=\"mint-popover mint-date-picker__dropdown\"\n :style=\"dropdownStyle\"\n role=\"dialog\"\n aria-label=\"Date picker\"\n >\n <CalendarGridPanelInternal\n :week-days=\"weekDays\"\n :month-year=\"monthYear\"\n :days=\"calendarDays\"\n :selected-date=\"selectedDate\"\n @previous-month=\"prevMonth\"\n @next-month=\"nextMonth\"\n @select=\"selectDate\"\n />\n\n <div class=\"mint-date-picker__footer\">\n <button\n type=\"button\"\n class=\"mint-date-picker__footer-btn mint-date-picker__today-btn\"\n @click=\"goToToday\"\n >\n Today\n </button>\n <button\n v-if=\"clearable && modelValue\"\n type=\"button\"\n class=\"mint-date-picker__footer-btn mint-date-picker__clear-btn\"\n @click=\"clear\"\n >\n Clear\n </button>\n </div>\n </div>\n </Transition>\n </Teleport>\n </div>\n</template>\n","import type { TimeRange } from '../types/components'\n\nexport function parseTime(time: string): { hour: number; minute: number } {\n const [h, m] = time.split(':').map(Number)\n return { hour: h, minute: m }\n}\n\nexport function formatTime(hour: number, minute: number, format: '12h' | '24h' = '24h'): string {\n if (format === '24h') {\n return `${String(hour).padStart(2, '0')}:${String(minute).padStart(2, '0')}`\n }\n const period = hour >= 12 ? 'PM' : 'AM'\n const h12 = hour === 0 ? 12 : hour > 12 ? hour - 12 : hour\n return `${h12}:${String(minute).padStart(2, '0')} ${period}`\n}\n\nexport function formatTimeSlot(time: string, format: '12h' | '24h' = '24h'): string {\n const { hour, minute } = parseTime(time)\n return formatTime(hour, minute, format)\n}\n\nexport function generateTimeSlots(start: string, end: string, stepMinutes: number): string[] {\n const slots: string[] = []\n const s = parseTime(start)\n const e = parseTime(end)\n const startMin = s.hour * 60 + s.minute\n const endMin = e.hour * 60 + e.minute\n\n for (let m = startMin; m <= endMin; m += stepMinutes) {\n const hour = Math.floor(m / 60)\n const minute = m % 60\n if (hour >= 24) break\n slots.push(formatTime(hour, minute))\n }\n return slots\n}\n\nexport function rangesOverlap(a: TimeRange, b: TimeRange): boolean {\n const aStart = toMinutes(a.start)\n const aEnd = toMinutes(a.end)\n const bStart = toMinutes(b.start)\n const bEnd = toMinutes(b.end)\n return aStart < bEnd && bStart < aEnd\n}\n\nexport function durationMinutes(start: string, end: string): number {\n return toMinutes(end) - toMinutes(start)\n}\n\nexport function formatDuration(minutes: number): string {\n if (minutes < 0) return '-' + formatDuration(-minutes)\n const h = Math.floor(minutes / 60)\n const m = minutes % 60\n if (h === 0) return `${m}m`\n if (m === 0) return `${h}h`\n return `${h}h ${m}m`\n}\n\nexport function isTimeInRange(time: string, start: string, end: string): boolean {\n const t = toMinutes(time)\n return t >= toMinutes(start) && t <= toMinutes(end)\n}\n\nexport function findAvailableSlots(\n dayStart: string,\n dayEnd: string,\n occupied: TimeRange[],\n minDuration: number,\n): TimeRange[] {\n const sorted = [...occupied].sort((a, b) => toMinutes(a.start) - toMinutes(b.start))\n const available: TimeRange[] = []\n let cursor = toMinutes(dayStart)\n const end = toMinutes(dayEnd)\n\n for (const slot of sorted) {\n const slotStart = toMinutes(slot.start)\n const slotEnd = toMinutes(slot.end)\n if (slotStart > cursor && slotStart - cursor >= minDuration) {\n available.push({ start: fromMinutes(cursor), end: fromMinutes(slotStart) })\n }\n cursor = Math.max(cursor, slotEnd)\n }\n\n if (end > cursor && end - cursor >= minDuration) {\n available.push({ start: fromMinutes(cursor), end: fromMinutes(end) })\n }\n\n return available\n}\n\nexport function snapToSlot(time: string, stepMinutes: number): string {\n const total = toMinutes(time)\n const snapped = Math.round(total / stepMinutes) * stepMinutes\n return fromMinutes(snapped)\n}\n\nexport function addMinutes(time: string, minutes: number): string {\n const total = toMinutes(time) + minutes\n return fromMinutes(Math.max(0, Math.min(total, 24 * 60 - 1)))\n}\n\nexport function compareTime(a: string, b: string): number {\n const ma = toMinutes(a)\n const mb = toMinutes(b)\n if (ma < mb) return -1\n if (ma > mb) return 1\n return 0\n}\n\nexport function findNearestTimeSlotIndex(time: string, slots: readonly string[]): number {\n if (slots.length === 0) return -1\n const target = toMinutes(time)\n let bestIndex = 0\n let bestDiff = Infinity\n for (let index = 0; index < slots.length; index++) {\n const diff = Math.abs(toMinutes(slots[index]) - target)\n if (diff < bestDiff) {\n bestDiff = diff\n bestIndex = index\n }\n }\n return bestIndex\n}\n\nexport function toMinutes(time: string): number {\n const { hour, minute } = parseTime(time)\n return hour * 60 + minute\n}\n\nexport function fromMinutes(total: number): string {\n const hour = Math.floor(total / 60) % 24\n const minute = total % 60\n return formatTime(hour, minute)\n}\n\n/** Time utility helpers for parsing, formatting, comparing, and snapping HH:MM strings. */\nexport function useTimeUtils() {\n return {\n parseTime,\n formatTime,\n formatTimeSlot,\n generateTimeSlots,\n rangesOverlap,\n durationMinutes,\n formatDuration,\n isTimeInRange,\n findAvailableSlots,\n snapToSlot,\n addMinutes,\n compareTime,\n findNearestTimeSlotIndex,\n toMinutes,\n fromMinutes,\n }\n}\n","<script setup lang=\"ts\">\n/** Input that opens a scrollable time-slot dropdown in 12h or 24h format, with min/max range and optional unavailable slots. */\nimport { ref, computed, watch, nextTick, useId, useTemplateRef } from 'vue'\nimport type { TimeSlotDisabledFn } from '../types'\nimport { useDropdownState } from '../composables/useDropdownState'\nimport {\n compareTime,\n findNearestTimeSlotIndex,\n formatTimeSlot,\n generateTimeSlots,\n} from '../composables/useTimeUtils'\n\ninterface Props {\n modelValue?: string\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n min?: string\n max?: string\n step?: number\n format?: '12h' | '24h'\n clearable?: boolean\n /** Marks slots unavailable; a returned string is shown inline as the reason. */\n disabledSlots?: TimeSlotDisabledFn\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n placeholder: 'Select time',\n disabled: false,\n error: false,\n size: 'md',\n step: 15,\n format: '24h',\n clearable: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | undefined]\n}>()\n\nconst listRef = ref<HTMLUListElement | null>(null)\nconst highlightedIndex = ref(-1)\nconst listboxId = `mint-time-picker-listbox-${useId().replace(/:/g, '')}`\nconst { isOpen, open, close, toggle } = useDropdownState({\n rootRef: useTemplateRef<HTMLElement>('root'),\n triggerRef: useTemplateRef<HTMLElement>('trigger'),\n})\n\n/** Id of the highlighted slot, published to the input as `aria-activedescendant`. */\nconst activeSlotId = computed(() =>\n isOpen.value && highlightedIndex.value >= 0\n ? `${listboxId}-option-${highlightedIndex.value}`\n : undefined,\n)\n\nconst slots = computed(() => {\n const start = props.min ?? '00:00'\n const end = props.max ?? '23:59'\n return generateTimeSlots(start, end, props.step)\n})\n\nconst displayValue = computed(() => {\n if (!props.modelValue) return ''\n return formatTimeSlot(props.modelValue, props.format)\n})\n\nfunction isSlotDisabled(slot: string): boolean {\n if (props.min && compareTime(slot, props.min) < 0) return true\n if (props.max && compareTime(slot, props.max) > 0) return true\n return !!props.disabledSlots?.(slot)\n}\n\nfunction slotReason(slot: string): string | undefined {\n const result = props.disabledSlots?.(slot)\n return typeof result === 'string' && result ? result : undefined\n}\n\nfunction selectSlot(slot: string) {\n if (isSlotDisabled(slot) || props.disabled) return\n emit('update:modelValue', slot)\n close()\n}\n\nfunction clear() {\n emit('update:modelValue', undefined)\n close()\n}\n\nfunction toggleDropdown() {\n if (props.disabled) return\n toggle()\n}\n\nfunction scrollToActiveSlot() {\n nextTick(() => {\n if (!listRef.value) return\n const activeEl = listRef.value.querySelector('.mint-time-picker__slot--active') as HTMLElement | null\n if (activeEl) {\n activeEl.scrollIntoView({ block: 'center' })\n } else if (props.modelValue) {\n // Scroll to nearest slot\n const nearestIndex = findNearestSlotIndex(props.modelValue)\n if (nearestIndex >= 0) {\n const children = listRef.value.children\n if (children[nearestIndex]) {\n (children[nearestIndex] as HTMLElement).scrollIntoView({ block: 'center' })\n }\n }\n }\n })\n}\n\nfunction findNearestSlotIndex(time: string): number {\n return findNearestTimeSlotIndex(time, slots.value)\n}\n\nfunction handleKeydown(event: KeyboardEvent) {\n if (!isOpen.value) {\n if (event.key === 'Enter' || event.key === ' ' || event.key === 'ArrowDown') {\n event.preventDefault()\n open()\n return\n }\n return\n }\n\n switch (event.key) {\n case 'ArrowDown': {\n event.preventDefault()\n let next = highlightedIndex.value + 1\n while (next < slots.value.length && isSlotDisabled(slots.value[next])) next++\n if (next < slots.value.length) {\n highlightedIndex.value = next\n scrollToHighlighted()\n }\n break\n }\n case 'ArrowUp': {\n event.preventDefault()\n let prev = highlightedIndex.value - 1\n while (prev >= 0 && isSlotDisabled(slots.value[prev])) prev--\n if (prev >= 0) {\n highlightedIndex.value = prev\n scrollToHighlighted()\n }\n break\n }\n case 'Enter': {\n event.preventDefault()\n if (highlightedIndex.value >= 0 && highlightedIndex.value < slots.value.length) {\n selectSlot(slots.value[highlightedIndex.value])\n }\n break\n }\n case 'Home': {\n event.preventDefault()\n const first = slots.value.findIndex(slot => !isSlotDisabled(slot))\n if (first >= 0) {\n highlightedIndex.value = first\n scrollToHighlighted()\n }\n break\n }\n case 'End': {\n event.preventDefault()\n for (let index = slots.value.length - 1; index >= 0; index--) {\n if (!isSlotDisabled(slots.value[index])) {\n highlightedIndex.value = index\n scrollToHighlighted()\n break\n }\n }\n break\n }\n case 'Escape': {\n event.preventDefault()\n close(true)\n break\n }\n }\n}\n\nfunction scrollToHighlighted() {\n nextTick(() => {\n if (!listRef.value) return\n const children = listRef.value.children\n if (children[highlightedIndex.value]) {\n (children[highlightedIndex.value] as HTMLElement).scrollIntoView({ block: 'nearest' })\n }\n })\n}\n\nwatch(isOpen, (open) => {\n if (open) {\n // Set highlighted index to current value or nearest slot\n if (props.modelValue) {\n const idx = slots.value.indexOf(props.modelValue)\n highlightedIndex.value = idx >= 0 ? idx : findNearestSlotIndex(props.modelValue)\n } else {\n highlightedIndex.value = 0\n }\n scrollToActiveSlot()\n } else {\n highlightedIndex.value = -1\n }\n})\n</script>\n\n<template>\n <div ref=\"root\" class=\"mint-time-picker\" @keydown=\"handleKeydown\">\n <div class=\"mint-time-picker__input-wrapper\">\n <input\n ref=\"trigger\"\n type=\"text\"\n readonly\n :value=\"displayValue\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :class=\"[\n 'mint-time-picker__input',\n `mint-time-picker__input--${size}`,\n error ? 'mint-time-picker__input--error' : '',\n disabled ? 'mint-time-picker__input--disabled' : '',\n ]\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n :aria-expanded=\"isOpen\"\n :aria-controls=\"isOpen ? listboxId : undefined\"\n :aria-activedescendant=\"activeSlotId\"\n @click=\"toggleDropdown\"\n />\n <button\n v-if=\"clearable && modelValue\"\n type=\"button\"\n class=\"mint-time-picker__clear-btn\"\n aria-label=\"Clear time\"\n @click.stop=\"clear\"\n >\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n <div class=\"mint-time-picker__icon\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"M12 6v6l4 2\" />\n </svg>\n </div>\n </div>\n\n <Transition\n enter-active-class=\"mint-time-picker__dropdown-enter-active\"\n enter-from-class=\"mint-time-picker__dropdown-enter-from\"\n enter-to-class=\"mint-time-picker__dropdown-enter-to\"\n leave-active-class=\"mint-time-picker__dropdown-leave-active\"\n leave-from-class=\"mint-time-picker__dropdown-leave-from\"\n leave-to-class=\"mint-time-picker__dropdown-leave-to\"\n >\n <div\n v-if=\"isOpen\"\n class=\"mint-popover mint-time-picker__dropdown\"\n >\n <ul\n :id=\"listboxId\"\n ref=\"listRef\"\n class=\"mint-time-picker__list\"\n role=\"listbox\"\n aria-label=\"Available times\"\n >\n <li\n v-for=\"(slot, index) in slots\"\n :id=\"`${listboxId}-option-${index}`\"\n :key=\"slot\"\n role=\"option\"\n :aria-selected=\"slot === modelValue\"\n :aria-disabled=\"isSlotDisabled(slot)\"\n :class=\"[\n 'mint-menu-item mint-time-picker__slot',\n slot === modelValue ? 'mint-menu-item--selected mint-time-picker__slot--active' : '',\n isSlotDisabled(slot) ? 'mint-time-picker__slot--disabled' : '',\n index === highlightedIndex && !isSlotDisabled(slot) ? 'mint-menu-item--active mint-time-picker__slot--highlighted' : '',\n ]\"\n @click=\"selectSlot(slot)\"\n >\n <span class=\"mint-time-picker__slot-time\">{{ formatTimeSlot(slot, format) }}</span>\n <span v-if=\"slotReason(slot)\" class=\"mint-time-picker__slot-reason\">{{ slotReason(slot) }}</span>\n <svg class=\"mint-menu-item__check\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M3.5 8.5l3 3 6-7\" />\n </svg>\n </li>\n </ul>\n </div>\n </Transition>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Input that opens a scrollable time-slot dropdown in 12h or 24h format, with min/max range and optional unavailable slots. */\nimport { ref, computed, watch, nextTick, useId, useTemplateRef } from 'vue'\nimport type { TimeSlotDisabledFn } from '../types'\nimport { useDropdownState } from '../composables/useDropdownState'\nimport {\n compareTime,\n findNearestTimeSlotIndex,\n formatTimeSlot,\n generateTimeSlots,\n} from '../composables/useTimeUtils'\n\ninterface Props {\n modelValue?: string\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n min?: string\n max?: string\n step?: number\n format?: '12h' | '24h'\n clearable?: boolean\n /** Marks slots unavailable; a returned string is shown inline as the reason. */\n disabledSlots?: TimeSlotDisabledFn\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n placeholder: 'Select time',\n disabled: false,\n error: false,\n size: 'md',\n step: 15,\n format: '24h',\n clearable: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | undefined]\n}>()\n\nconst listRef = ref<HTMLUListElement | null>(null)\nconst highlightedIndex = ref(-1)\nconst listboxId = `mint-time-picker-listbox-${useId().replace(/:/g, '')}`\nconst { isOpen, open, close, toggle } = useDropdownState({\n rootRef: useTemplateRef<HTMLElement>('root'),\n triggerRef: useTemplateRef<HTMLElement>('trigger'),\n})\n\n/** Id of the highlighted slot, published to the input as `aria-activedescendant`. */\nconst activeSlotId = computed(() =>\n isOpen.value && highlightedIndex.value >= 0\n ? `${listboxId}-option-${highlightedIndex.value}`\n : undefined,\n)\n\nconst slots = computed(() => {\n const start = props.min ?? '00:00'\n const end = props.max ?? '23:59'\n return generateTimeSlots(start, end, props.step)\n})\n\nconst displayValue = computed(() => {\n if (!props.modelValue) return ''\n return formatTimeSlot(props.modelValue, props.format)\n})\n\nfunction isSlotDisabled(slot: string): boolean {\n if (props.min && compareTime(slot, props.min) < 0) return true\n if (props.max && compareTime(slot, props.max) > 0) return true\n return !!props.disabledSlots?.(slot)\n}\n\nfunction slotReason(slot: string): string | undefined {\n const result = props.disabledSlots?.(slot)\n return typeof result === 'string' && result ? result : undefined\n}\n\nfunction selectSlot(slot: string) {\n if (isSlotDisabled(slot) || props.disabled) return\n emit('update:modelValue', slot)\n close()\n}\n\nfunction clear() {\n emit('update:modelValue', undefined)\n close()\n}\n\nfunction toggleDropdown() {\n if (props.disabled) return\n toggle()\n}\n\nfunction scrollToActiveSlot() {\n nextTick(() => {\n if (!listRef.value) return\n const activeEl = listRef.value.querySelector('.mint-time-picker__slot--active') as HTMLElement | null\n if (activeEl) {\n activeEl.scrollIntoView({ block: 'center' })\n } else if (props.modelValue) {\n // Scroll to nearest slot\n const nearestIndex = findNearestSlotIndex(props.modelValue)\n if (nearestIndex >= 0) {\n const children = listRef.value.children\n if (children[nearestIndex]) {\n (children[nearestIndex] as HTMLElement).scrollIntoView({ block: 'center' })\n }\n }\n }\n })\n}\n\nfunction findNearestSlotIndex(time: string): number {\n return findNearestTimeSlotIndex(time, slots.value)\n}\n\nfunction handleKeydown(event: KeyboardEvent) {\n if (!isOpen.value) {\n if (event.key === 'Enter' || event.key === ' ' || event.key === 'ArrowDown') {\n event.preventDefault()\n open()\n return\n }\n return\n }\n\n switch (event.key) {\n case 'ArrowDown': {\n event.preventDefault()\n let next = highlightedIndex.value + 1\n while (next < slots.value.length && isSlotDisabled(slots.value[next])) next++\n if (next < slots.value.length) {\n highlightedIndex.value = next\n scrollToHighlighted()\n }\n break\n }\n case 'ArrowUp': {\n event.preventDefault()\n let prev = highlightedIndex.value - 1\n while (prev >= 0 && isSlotDisabled(slots.value[prev])) prev--\n if (prev >= 0) {\n highlightedIndex.value = prev\n scrollToHighlighted()\n }\n break\n }\n case 'Enter': {\n event.preventDefault()\n if (highlightedIndex.value >= 0 && highlightedIndex.value < slots.value.length) {\n selectSlot(slots.value[highlightedIndex.value])\n }\n break\n }\n case 'Home': {\n event.preventDefault()\n const first = slots.value.findIndex(slot => !isSlotDisabled(slot))\n if (first >= 0) {\n highlightedIndex.value = first\n scrollToHighlighted()\n }\n break\n }\n case 'End': {\n event.preventDefault()\n for (let index = slots.value.length - 1; index >= 0; index--) {\n if (!isSlotDisabled(slots.value[index])) {\n highlightedIndex.value = index\n scrollToHighlighted()\n break\n }\n }\n break\n }\n case 'Escape': {\n event.preventDefault()\n close(true)\n break\n }\n }\n}\n\nfunction scrollToHighlighted() {\n nextTick(() => {\n if (!listRef.value) return\n const children = listRef.value.children\n if (children[highlightedIndex.value]) {\n (children[highlightedIndex.value] as HTMLElement).scrollIntoView({ block: 'nearest' })\n }\n })\n}\n\nwatch(isOpen, (open) => {\n if (open) {\n // Set highlighted index to current value or nearest slot\n if (props.modelValue) {\n const idx = slots.value.indexOf(props.modelValue)\n highlightedIndex.value = idx >= 0 ? idx : findNearestSlotIndex(props.modelValue)\n } else {\n highlightedIndex.value = 0\n }\n scrollToActiveSlot()\n } else {\n highlightedIndex.value = -1\n }\n})\n</script>\n\n<template>\n <div ref=\"root\" class=\"mint-time-picker\" @keydown=\"handleKeydown\">\n <div class=\"mint-time-picker__input-wrapper\">\n <input\n ref=\"trigger\"\n type=\"text\"\n readonly\n :value=\"displayValue\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :class=\"[\n 'mint-time-picker__input',\n `mint-time-picker__input--${size}`,\n error ? 'mint-time-picker__input--error' : '',\n disabled ? 'mint-time-picker__input--disabled' : '',\n ]\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n :aria-expanded=\"isOpen\"\n :aria-controls=\"isOpen ? listboxId : undefined\"\n :aria-activedescendant=\"activeSlotId\"\n @click=\"toggleDropdown\"\n />\n <button\n v-if=\"clearable && modelValue\"\n type=\"button\"\n class=\"mint-time-picker__clear-btn\"\n aria-label=\"Clear time\"\n @click.stop=\"clear\"\n >\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n <div class=\"mint-time-picker__icon\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"M12 6v6l4 2\" />\n </svg>\n </div>\n </div>\n\n <Transition\n enter-active-class=\"mint-time-picker__dropdown-enter-active\"\n enter-from-class=\"mint-time-picker__dropdown-enter-from\"\n enter-to-class=\"mint-time-picker__dropdown-enter-to\"\n leave-active-class=\"mint-time-picker__dropdown-leave-active\"\n leave-from-class=\"mint-time-picker__dropdown-leave-from\"\n leave-to-class=\"mint-time-picker__dropdown-leave-to\"\n >\n <div\n v-if=\"isOpen\"\n class=\"mint-popover mint-time-picker__dropdown\"\n >\n <ul\n :id=\"listboxId\"\n ref=\"listRef\"\n class=\"mint-time-picker__list\"\n role=\"listbox\"\n aria-label=\"Available times\"\n >\n <li\n v-for=\"(slot, index) in slots\"\n :id=\"`${listboxId}-option-${index}`\"\n :key=\"slot\"\n role=\"option\"\n :aria-selected=\"slot === modelValue\"\n :aria-disabled=\"isSlotDisabled(slot)\"\n :class=\"[\n 'mint-menu-item mint-time-picker__slot',\n slot === modelValue ? 'mint-menu-item--selected mint-time-picker__slot--active' : '',\n isSlotDisabled(slot) ? 'mint-time-picker__slot--disabled' : '',\n index === highlightedIndex && !isSlotDisabled(slot) ? 'mint-menu-item--active mint-time-picker__slot--highlighted' : '',\n ]\"\n @click=\"selectSlot(slot)\"\n >\n <span class=\"mint-time-picker__slot-time\">{{ formatTimeSlot(slot, format) }}</span>\n <span v-if=\"slotReason(slot)\" class=\"mint-time-picker__slot-reason\">{{ slotReason(slot) }}</span>\n <svg class=\"mint-menu-item__check\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M3.5 8.5l3 3 6-7\" />\n </svg>\n </li>\n </ul>\n </div>\n </Transition>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Lets users type and add tags with autocomplete suggestions, categories, and a max-tag cap. */\nimport { ref, computed, useTemplateRef } from 'vue'\nimport { useSelectionLimit } from '../composables/useSelectionLimit'\nimport { useDropdownState } from '../composables/useDropdownState'\n\ninterface TagSuggestion {\n value: string\n count?: number\n}\n\ninterface TagCategory {\n name: string\n prefix: string\n color?: 'primary' | 'success' | 'warning' | 'error' | 'info' | 'neutral'\n}\n\ninterface Props {\n modelValue?: string[]\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n maxTags?: number\n allowDuplicates?: boolean\n suggestions?: string[] | TagSuggestion[]\n categories?: TagCategory[]\n activeCategory?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: () => [],\n disabled: false,\n error: false,\n size: 'md',\n allowDuplicates: false,\n suggestions: () => [],\n categories: () => [],\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string[]]\n 'update:activeCategory': [prefix: string]\n}>()\n\nconst inputValue = ref('')\nconst highlightedIndex = ref(-1)\n// The text input doubles as the dropdown trigger, so focus restoration is the\n// composable's `triggerRef` rather than a component-local refocus helper.\nconst {\n isOpen: dropdownOpen,\n triggerRef: inputRef,\n open: openDropdown,\n close: closeDropdown,\n} = useDropdownState({\n rootRef: useTemplateRef<HTMLElement>('root'),\n onClose: () => {\n highlightedIndex.value = -1\n },\n})\n\nconst selectionLimit = useSelectionLimit({\n count: () => props.modelValue.length,\n max: () => props.maxTags,\n})\nconst canAddMore = selectionLimit.canAddMore\n\nconst normalizedSuggestions = computed<TagSuggestion[]>(() => {\n return props.suggestions.map(s => typeof s === 'string' ? { value: s } : s)\n})\n\nconst filteredSuggestions = computed<TagSuggestion[]>(() => {\n const q = inputValue.value.trim().toLowerCase()\n if (!q) return []\n return normalizedSuggestions.value\n .filter(s => s.value.toLowerCase().startsWith(q) && !props.modelValue.includes(s.value))\n .slice(0, 8)\n})\n\nfunction categoryFor(tag: string): TagCategory | undefined {\n const colonIdx = tag.indexOf(':')\n if (colonIdx === -1) return undefined\n const prefix = tag.slice(0, colonIdx)\n return props.categories.find(c => c.prefix === prefix)\n}\n\n// 3f: a category is shown by a group-color dot (3a palette), never a semantic tint.\nconst GROUP_COLORS = [\n 'var(--mint-sample-1)', 'var(--mint-sample-2)', 'var(--mint-sample-3)', 'var(--mint-sample-4)',\n 'var(--mint-sample-5)', 'var(--mint-sample-6)', 'var(--mint-sample-7)', 'var(--mint-sample-8)',\n]\n\nfunction groupColor(category: TagCategory): string {\n return GROUP_COLORS[props.categories.indexOf(category) % GROUP_COLORS.length]\n}\n\nfunction addTag(value: string) {\n const trimmed = value.trim()\n if (!trimmed) return\n if (!selectionLimit.canAdd()) return\n\n // If a category is active and user didn't already type a prefix, prepend it\n let final = trimmed\n if (props.activeCategory && !trimmed.includes(':')) {\n final = `${props.activeCategory}:${trimmed}`\n }\n\n if (!props.allowDuplicates && props.modelValue.includes(final)) return\n\n emit('update:modelValue', [...props.modelValue, final])\n inputValue.value = ''\n closeDropdown()\n}\n\nfunction removeTag(index: number) {\n if (props.disabled) return\n const newTags = [...props.modelValue]\n newTags.splice(index, 1)\n emit('update:modelValue', newTags)\n}\n\nfunction handleKeydown(event: KeyboardEvent) {\n if (event.key === 'ArrowDown' && filteredSuggestions.value.length) {\n event.preventDefault()\n highlightedIndex.value = Math.min(highlightedIndex.value + 1, filteredSuggestions.value.length - 1)\n openDropdown()\n return\n }\n if (event.key === 'ArrowUp' && filteredSuggestions.value.length) {\n event.preventDefault()\n highlightedIndex.value = Math.max(highlightedIndex.value - 1, 0)\n return\n }\n if (event.key === 'Enter' || event.key === ',') {\n event.preventDefault()\n if (highlightedIndex.value >= 0 && filteredSuggestions.value[highlightedIndex.value]) {\n addTag(filteredSuggestions.value[highlightedIndex.value].value)\n } else {\n addTag(inputValue.value)\n }\n return\n }\n if (event.key === 'Escape') {\n closeDropdown(true)\n return\n }\n if (event.key === 'Backspace' && !inputValue.value && props.modelValue.length > 0) {\n removeTag(props.modelValue.length - 1)\n }\n}\n\nfunction handleFocus() {\n if (filteredSuggestions.value.length) openDropdown()\n}\n\nfunction handleBlur() {\n // Delay so a click on a suggestion fires first\n setTimeout(() => {\n closeDropdown()\n }, 120)\n}\n\nfunction handlePaste(event: ClipboardEvent) {\n event.preventDefault()\n const text = event.clipboardData?.getData('text')\n if (!text) return\n\n const tags = text.split(/[,\\n]/).map(t => t.trim()).filter(Boolean)\n const newTags = [...props.modelValue]\n\n for (const tag of tags) {\n if (!selectionLimit.canAdd(1, newTags.length)) break\n if (!props.allowDuplicates && newTags.includes(tag)) continue\n newTags.push(tag)\n }\n\n emit('update:modelValue', newTags)\n}\n\nfunction focusInput() {\n inputRef.value?.focus()\n}\n\nfunction setCategory(prefix: string) {\n emit('update:activeCategory', prefix === props.activeCategory ? '' : prefix)\n}\n\nfunction onInputEvent() {\n if (filteredSuggestions.value.length > 0) {\n openDropdown()\n } else {\n closeDropdown()\n }\n highlightedIndex.value = -1\n}\n</script>\n\n<template>\n <div\n ref=\"root\"\n :class=\"[\n 'mint-tags-input',\n `mint-tags-input--${size}`,\n error ? 'mint-tags-input--error' : '',\n disabled ? 'mint-tags-input--disabled' : '',\n categories.length ? 'mint-tags-input--categorized' : '',\n ]\"\n >\n <!-- Category switcher (only if categories defined) -->\n <div v-if=\"categories.length\" class=\"mint-tags-input__categories\">\n <button\n v-for=\"cat in categories\"\n :key=\"cat.prefix\"\n type=\"button\"\n :class=\"[\n 'mint-tags-input__category',\n `mint-tags-input__category--${cat.color ?? 'neutral'}`,\n activeCategory === cat.prefix ? 'mint-tags-input__category--active' : '',\n ]\"\n :disabled=\"disabled\"\n @click=\"setCategory(cat.prefix)\"\n >\n <span class=\"mint-tags-input__tag-dot\" :style=\"{ background: groupColor(cat) }\" aria-hidden=\"true\" />\n {{ cat.name }}\n </button>\n </div>\n\n <div class=\"mint-tags-input__field\" @click=\"focusInput\">\n <span\n v-for=\"(tag, index) in modelValue\"\n :key=\"`${tag}-${index}`\"\n :class=\"[\n 'mint-tags-input__tag',\n `mint-tags-input__tag--${size}`,\n categoryFor(tag) ? `mint-tags-input__tag--${categoryFor(tag)?.color ?? 'neutral'}` : '',\n ]\"\n >\n <span\n v-if=\"categoryFor(tag)\"\n class=\"mint-tags-input__tag-dot\"\n :style=\"{ background: groupColor(categoryFor(tag)!) }\"\n aria-hidden=\"true\"\n />\n {{ tag }}\n <button\n v-if=\"!disabled\"\n type=\"button\"\n :aria-label=\"`Remove ${tag}`\"\n class=\"mint-tags-input__tag-remove\"\n @click.stop=\"removeTag(index)\"\n >\n <svg class=\"mint-tags-input__tag-remove-icon\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" viewBox=\"0 0 24 24\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </span>\n\n <input\n ref=\"inputRef\"\n v-model=\"inputValue\"\n type=\"text\"\n :placeholder=\"modelValue.length === 0 ? placeholder : ''\"\n :disabled=\"disabled || !canAddMore\"\n :class=\"['mint-tags-input__input', `mint-tags-input__input--${size}`]\"\n @keydown=\"handleKeydown\"\n @paste=\"handlePaste\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n @input=\"onInputEvent\"\n />\n\n <!-- Autocomplete dropdown -->\n <div\n v-if=\"dropdownOpen && filteredSuggestions.length\"\n class=\"mint-tags-input__dropdown\"\n >\n <button\n v-for=\"(sug, i) in filteredSuggestions\"\n :key=\"sug.value\"\n type=\"button\"\n :class=\"[\n 'mint-tags-input__dropdown-item',\n i === highlightedIndex ? 'mint-tags-input__dropdown-item--highlighted' : '',\n ]\"\n @mousedown.prevent=\"addTag(sug.value)\"\n >\n <span>{{ sug.value }}</span>\n <span v-if=\"sug.count !== undefined\" class=\"mint-tags-input__dropdown-count\">\n {{ sug.count }}\n </span>\n </button>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Lets users type and add tags with autocomplete suggestions, categories, and a max-tag cap. */\nimport { ref, computed, useTemplateRef } from 'vue'\nimport { useSelectionLimit } from '../composables/useSelectionLimit'\nimport { useDropdownState } from '../composables/useDropdownState'\n\ninterface TagSuggestion {\n value: string\n count?: number\n}\n\ninterface TagCategory {\n name: string\n prefix: string\n color?: 'primary' | 'success' | 'warning' | 'error' | 'info' | 'neutral'\n}\n\ninterface Props {\n modelValue?: string[]\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n maxTags?: number\n allowDuplicates?: boolean\n suggestions?: string[] | TagSuggestion[]\n categories?: TagCategory[]\n activeCategory?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: () => [],\n disabled: false,\n error: false,\n size: 'md',\n allowDuplicates: false,\n suggestions: () => [],\n categories: () => [],\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string[]]\n 'update:activeCategory': [prefix: string]\n}>()\n\nconst inputValue = ref('')\nconst highlightedIndex = ref(-1)\n// The text input doubles as the dropdown trigger, so focus restoration is the\n// composable's `triggerRef` rather than a component-local refocus helper.\nconst {\n isOpen: dropdownOpen,\n triggerRef: inputRef,\n open: openDropdown,\n close: closeDropdown,\n} = useDropdownState({\n rootRef: useTemplateRef<HTMLElement>('root'),\n onClose: () => {\n highlightedIndex.value = -1\n },\n})\n\nconst selectionLimit = useSelectionLimit({\n count: () => props.modelValue.length,\n max: () => props.maxTags,\n})\nconst canAddMore = selectionLimit.canAddMore\n\nconst normalizedSuggestions = computed<TagSuggestion[]>(() => {\n return props.suggestions.map(s => typeof s === 'string' ? { value: s } : s)\n})\n\nconst filteredSuggestions = computed<TagSuggestion[]>(() => {\n const q = inputValue.value.trim().toLowerCase()\n if (!q) return []\n return normalizedSuggestions.value\n .filter(s => s.value.toLowerCase().startsWith(q) && !props.modelValue.includes(s.value))\n .slice(0, 8)\n})\n\nfunction categoryFor(tag: string): TagCategory | undefined {\n const colonIdx = tag.indexOf(':')\n if (colonIdx === -1) return undefined\n const prefix = tag.slice(0, colonIdx)\n return props.categories.find(c => c.prefix === prefix)\n}\n\n// 3f: a category is shown by a group-color dot (3a palette), never a semantic tint.\nconst GROUP_COLORS = [\n 'var(--mint-sample-1)', 'var(--mint-sample-2)', 'var(--mint-sample-3)', 'var(--mint-sample-4)',\n 'var(--mint-sample-5)', 'var(--mint-sample-6)', 'var(--mint-sample-7)', 'var(--mint-sample-8)',\n]\n\nfunction groupColor(category: TagCategory): string {\n return GROUP_COLORS[props.categories.indexOf(category) % GROUP_COLORS.length]\n}\n\nfunction addTag(value: string) {\n const trimmed = value.trim()\n if (!trimmed) return\n if (!selectionLimit.canAdd()) return\n\n // If a category is active and user didn't already type a prefix, prepend it\n let final = trimmed\n if (props.activeCategory && !trimmed.includes(':')) {\n final = `${props.activeCategory}:${trimmed}`\n }\n\n if (!props.allowDuplicates && props.modelValue.includes(final)) return\n\n emit('update:modelValue', [...props.modelValue, final])\n inputValue.value = ''\n closeDropdown()\n}\n\nfunction removeTag(index: number) {\n if (props.disabled) return\n const newTags = [...props.modelValue]\n newTags.splice(index, 1)\n emit('update:modelValue', newTags)\n}\n\nfunction handleKeydown(event: KeyboardEvent) {\n if (event.key === 'ArrowDown' && filteredSuggestions.value.length) {\n event.preventDefault()\n highlightedIndex.value = Math.min(highlightedIndex.value + 1, filteredSuggestions.value.length - 1)\n openDropdown()\n return\n }\n if (event.key === 'ArrowUp' && filteredSuggestions.value.length) {\n event.preventDefault()\n highlightedIndex.value = Math.max(highlightedIndex.value - 1, 0)\n return\n }\n if (event.key === 'Enter' || event.key === ',') {\n event.preventDefault()\n if (highlightedIndex.value >= 0 && filteredSuggestions.value[highlightedIndex.value]) {\n addTag(filteredSuggestions.value[highlightedIndex.value].value)\n } else {\n addTag(inputValue.value)\n }\n return\n }\n if (event.key === 'Escape') {\n closeDropdown(true)\n return\n }\n if (event.key === 'Backspace' && !inputValue.value && props.modelValue.length > 0) {\n removeTag(props.modelValue.length - 1)\n }\n}\n\nfunction handleFocus() {\n if (filteredSuggestions.value.length) openDropdown()\n}\n\nfunction handleBlur() {\n // Delay so a click on a suggestion fires first\n setTimeout(() => {\n closeDropdown()\n }, 120)\n}\n\nfunction handlePaste(event: ClipboardEvent) {\n event.preventDefault()\n const text = event.clipboardData?.getData('text')\n if (!text) return\n\n const tags = text.split(/[,\\n]/).map(t => t.trim()).filter(Boolean)\n const newTags = [...props.modelValue]\n\n for (const tag of tags) {\n if (!selectionLimit.canAdd(1, newTags.length)) break\n if (!props.allowDuplicates && newTags.includes(tag)) continue\n newTags.push(tag)\n }\n\n emit('update:modelValue', newTags)\n}\n\nfunction focusInput() {\n inputRef.value?.focus()\n}\n\nfunction setCategory(prefix: string) {\n emit('update:activeCategory', prefix === props.activeCategory ? '' : prefix)\n}\n\nfunction onInputEvent() {\n if (filteredSuggestions.value.length > 0) {\n openDropdown()\n } else {\n closeDropdown()\n }\n highlightedIndex.value = -1\n}\n</script>\n\n<template>\n <div\n ref=\"root\"\n :class=\"[\n 'mint-tags-input',\n `mint-tags-input--${size}`,\n error ? 'mint-tags-input--error' : '',\n disabled ? 'mint-tags-input--disabled' : '',\n categories.length ? 'mint-tags-input--categorized' : '',\n ]\"\n >\n <!-- Category switcher (only if categories defined) -->\n <div v-if=\"categories.length\" class=\"mint-tags-input__categories\">\n <button\n v-for=\"cat in categories\"\n :key=\"cat.prefix\"\n type=\"button\"\n :class=\"[\n 'mint-tags-input__category',\n `mint-tags-input__category--${cat.color ?? 'neutral'}`,\n activeCategory === cat.prefix ? 'mint-tags-input__category--active' : '',\n ]\"\n :disabled=\"disabled\"\n @click=\"setCategory(cat.prefix)\"\n >\n <span class=\"mint-tags-input__tag-dot\" :style=\"{ background: groupColor(cat) }\" aria-hidden=\"true\" />\n {{ cat.name }}\n </button>\n </div>\n\n <div class=\"mint-tags-input__field\" @click=\"focusInput\">\n <span\n v-for=\"(tag, index) in modelValue\"\n :key=\"`${tag}-${index}`\"\n :class=\"[\n 'mint-tags-input__tag',\n `mint-tags-input__tag--${size}`,\n categoryFor(tag) ? `mint-tags-input__tag--${categoryFor(tag)?.color ?? 'neutral'}` : '',\n ]\"\n >\n <span\n v-if=\"categoryFor(tag)\"\n class=\"mint-tags-input__tag-dot\"\n :style=\"{ background: groupColor(categoryFor(tag)!) }\"\n aria-hidden=\"true\"\n />\n {{ tag }}\n <button\n v-if=\"!disabled\"\n type=\"button\"\n :aria-label=\"`Remove ${tag}`\"\n class=\"mint-tags-input__tag-remove\"\n @click.stop=\"removeTag(index)\"\n >\n <svg class=\"mint-tags-input__tag-remove-icon\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" viewBox=\"0 0 24 24\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </span>\n\n <input\n ref=\"inputRef\"\n v-model=\"inputValue\"\n type=\"text\"\n :placeholder=\"modelValue.length === 0 ? placeholder : ''\"\n :disabled=\"disabled || !canAddMore\"\n :class=\"['mint-tags-input__input', `mint-tags-input__input--${size}`]\"\n @keydown=\"handleKeydown\"\n @paste=\"handlePaste\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n @input=\"onInputEvent\"\n />\n\n <!-- Autocomplete dropdown -->\n <div\n v-if=\"dropdownOpen && filteredSuggestions.length\"\n class=\"mint-tags-input__dropdown\"\n >\n <button\n v-for=\"(sug, i) in filteredSuggestions\"\n :key=\"sug.value\"\n type=\"button\"\n :class=\"[\n 'mint-tags-input__dropdown-item',\n i === highlightedIndex ? 'mint-tags-input__dropdown-item--highlighted' : '',\n ]\"\n @mousedown.prevent=\"addTag(sug.value)\"\n >\n <span>{{ sug.value }}</span>\n <span v-if=\"sug.count !== undefined\" class=\"mint-tags-input__dropdown-count\">\n {{ sug.count }}\n </span>\n </button>\n </div>\n </div>\n </div>\n</template>\n","/**\n * Stable references for plugin secret settings.\n *\n * A settings response never carries a secret's value. Every secret leaf is a\n * marker instead:\n *\n * - `{ \"$secret\": \"sec_…\", \"set\": true }` — a stored secret, referenced by a\n * stable opaque id. Send the marker back unchanged to keep the stored value.\n * - `null` — nothing stored at that position.\n * - `{ \"$secret\": null, \"locked\": true }` — the effective value comes from the\n * environment and is never written back.\n *\n * On save each secret leaf accepts the reference, a plain string (a new value),\n * or `null` (clear). Payloads carry `secret_format: \"ref\"` so a `null` reads as\n * a deliberate clear rather than the deprecated \"unchanged\" placeholder.\n */\n\n/** Reserved marker key that references a stored secret. */\nexport const PLUGIN_SECRET_REF_KEY = '$secret'\n\n/** Reserved payload key declaring which secret wire format a client speaks. */\nexport const PLUGIN_SECRET_FORMAT_KEY = 'secret_format'\n\n/** Wire format published and understood by this SDK. */\nexport const PLUGIN_SECRET_FORMAT_REF = 'ref'\n\n/** One `$secret` marker as published by a settings response. */\nexport interface PluginSecretRef {\n $secret: string | null\n set?: boolean\n locked?: boolean\n}\n\n/** What a settings form should tell the user about one secret field. */\nexport type PluginSecretState = 'set' | 'unset' | 'environment'\n\nconst MARKER_KEYS = new Set([PLUGIN_SECRET_REF_KEY, 'set', 'locked'])\n\n/** Return whether one settings value is a `$secret` reference marker. */\nexport function isPluginSecretRef(value: unknown): value is PluginSecretRef {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return false\n const record = value as Record<string, unknown>\n if (!(PLUGIN_SECRET_REF_KEY in record)) return false\n return Object.keys(record).every(key => MARKER_KEYS.has(key))\n}\n\n/** Return the stored secret id behind a marker, or `null` when nothing is stored. */\nexport function pluginSecretId(value: unknown): string | null {\n if (!isPluginSecretRef(value)) return null\n return typeof value.$secret === 'string' ? value.$secret : null\n}\n\n/** Classify one secret field for display: stored, unset, or environment-provided. */\nexport function pluginSecretState(value: unknown): PluginSecretState {\n if (isPluginSecretRef(value)) {\n if (value.locked) return 'environment'\n return typeof value.$secret === 'string' ? 'set' : 'unset'\n }\n return typeof value === 'string' && value.length > 0 ? 'set' : 'unset'\n}\n\n/** Human label for one secret field's state. */\nexport function pluginSecretLabel(value: unknown): string {\n const state = pluginSecretState(value)\n if (state === 'environment') return 'Provided by environment'\n return state === 'set' ? 'Set' : 'Not set'\n}\n\n/** Whether a secret field is read-only because the environment supplies it. */\nexport function isPluginSecretLocked(value: unknown): boolean {\n return isPluginSecretRef(value) && value.locked === true\n}\n\n/**\n * Value to submit for an untouched secret field: the reference, unchanged.\n *\n * A locked marker round-trips too, which is how the platform keeps a stored\n * value that an environment variable currently hides.\n */\nexport function keepPluginSecret(current: unknown): PluginSecretRef | null {\n if (isPluginSecretRef(current)) return { ...current }\n return null\n}\n\n/** Value to submit when the user typed a new secret. */\nexport function setPluginSecret(value: string): string {\n return value\n}\n\n/** Value to submit when the user cleared a secret. */\nexport function clearPluginSecret(): null {\n return null\n}\n\n/** Whether a settings response declares the `$secret` reference wire format. */\nexport function usesPluginSecretReferences(response: unknown): boolean {\n if (!response || typeof response !== 'object') return false\n return (\n (response as Record<string, unknown>)[PLUGIN_SECRET_FORMAT_KEY]\n === PLUGIN_SECRET_FORMAT_REF\n )\n}\n","<script setup lang=\"ts\">\n/** Edits one plugin secret setting: shows set / not set / provided by environment, and submits a `$secret` reference, a new value, or `null`. */\nimport { computed, ref, watch } from 'vue'\nimport BaseInput from './BaseInput.vue'\nimport BaseButton from './BaseButton.vue'\nimport {\n clearPluginSecret,\n isPluginSecretLocked,\n isPluginSecretRef,\n keepPluginSecret,\n pluginSecretLabel,\n pluginSecretState,\n setPluginSecret,\n type PluginSecretRef,\n type PluginSecretState,\n} from '../utils/pluginSecrets'\n\ntype SecretValue = PluginSecretRef | string | null\n\ninterface Props {\n /** The `$secret` marker from the settings response, a typed string, or `null`. */\n modelValue?: SecretValue\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n /** Label on the control that starts entering a replacement value. */\n changeLabel?: string\n /** Label on the control that clears a stored secret. */\n clearLabel?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: null,\n placeholder: 'Enter a new value',\n disabled: false,\n error: false,\n size: 'md',\n changeLabel: 'Change',\n clearLabel: 'Clear',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: SecretValue]\n}>()\n\n/** The reference this field started from, so an abandoned edit can restore it. */\nconst storedReference = ref<PluginSecretRef | null>(keepPluginSecret(props.modelValue))\nconst isEditing = ref(typeof props.modelValue === 'string')\n\nwatch(\n () => props.modelValue,\n (value) => {\n if (isPluginSecretRef(value)) {\n storedReference.value = keepPluginSecret(value)\n isEditing.value = false\n }\n },\n)\n\nconst state = computed<PluginSecretState>(() => pluginSecretState(props.modelValue))\nconst locked = computed(() => isPluginSecretLocked(props.modelValue)\n || isPluginSecretLocked(storedReference.value))\nconst statusLabel = computed(() => isEditing.value\n ? 'New value'\n : pluginSecretLabel(props.modelValue))\nconst typedValue = computed(() => typeof props.modelValue === 'string' ? props.modelValue : '')\nconst canClear = computed(() => !locked.value && (state.value === 'set' || isEditing.value))\n\nfunction startEditing(): void {\n if (props.disabled || locked.value) return\n isEditing.value = true\n emit('update:modelValue', setPluginSecret(''))\n}\n\nfunction updateTyped(value: string | number | null): void {\n emit('update:modelValue', setPluginSecret(value == null ? '' : String(value)))\n}\n\nfunction cancelEditing(): void {\n isEditing.value = false\n emit('update:modelValue', storedReference.value ? { ...storedReference.value } : null)\n}\n\nfunction clear(): void {\n if (props.disabled || locked.value) return\n isEditing.value = false\n storedReference.value = null\n emit('update:modelValue', clearPluginSecret())\n}\n</script>\n\n<template>\n <div class=\"mint-secret-input\" :class=\"{ 'mint-secret-input--error': error }\">\n <div class=\"mint-secret-input__status\">\n <span\n class=\"mint-secret-input__badge\"\n :class=\"`mint-secret-input__badge--${isEditing ? 'pending' : state}`\"\n ><span class=\"mint-secret-input__dot\" aria-hidden=\"true\" />{{ statusLabel }}</span>\n <span v-if=\"locked\" class=\"mint-secret-input__hint\">\n This value comes from the environment and cannot be edited here.\n </span>\n </div>\n\n <BaseInput\n v-if=\"isEditing\"\n type=\"password\"\n autocomplete=\"new-password\"\n :model-value=\"typedValue\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :error=\"error\"\n :size=\"size\"\n @update:model-value=\"updateTyped\"\n />\n\n <div class=\"mint-secret-input__actions\">\n <BaseButton\n v-if=\"!isEditing\"\n type=\"button\"\n variant=\"secondary\"\n :size=\"size === 'lg' ? 'md' : 'sm'\"\n :disabled=\"disabled || locked\"\n @click=\"startEditing\"\n >\n {{ changeLabel }}\n </BaseButton>\n <BaseButton\n v-else\n type=\"button\"\n variant=\"ghost\"\n :size=\"size === 'lg' ? 'md' : 'sm'\"\n :disabled=\"disabled\"\n @click=\"cancelEditing\"\n >\n Cancel\n </BaseButton>\n <BaseButton\n v-if=\"canClear\"\n type=\"button\"\n variant=\"ghost\"\n :size=\"size === 'lg' ? 'md' : 'sm'\"\n :disabled=\"disabled\"\n @click=\"clear\"\n >\n {{ clearLabel }}\n </BaseButton>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Edits one plugin secret setting: shows set / not set / provided by environment, and submits a `$secret` reference, a new value, or `null`. */\nimport { computed, ref, watch } from 'vue'\nimport BaseInput from './BaseInput.vue'\nimport BaseButton from './BaseButton.vue'\nimport {\n clearPluginSecret,\n isPluginSecretLocked,\n isPluginSecretRef,\n keepPluginSecret,\n pluginSecretLabel,\n pluginSecretState,\n setPluginSecret,\n type PluginSecretRef,\n type PluginSecretState,\n} from '../utils/pluginSecrets'\n\ntype SecretValue = PluginSecretRef | string | null\n\ninterface Props {\n /** The `$secret` marker from the settings response, a typed string, or `null`. */\n modelValue?: SecretValue\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n /** Label on the control that starts entering a replacement value. */\n changeLabel?: string\n /** Label on the control that clears a stored secret. */\n clearLabel?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: null,\n placeholder: 'Enter a new value',\n disabled: false,\n error: false,\n size: 'md',\n changeLabel: 'Change',\n clearLabel: 'Clear',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: SecretValue]\n}>()\n\n/** The reference this field started from, so an abandoned edit can restore it. */\nconst storedReference = ref<PluginSecretRef | null>(keepPluginSecret(props.modelValue))\nconst isEditing = ref(typeof props.modelValue === 'string')\n\nwatch(\n () => props.modelValue,\n (value) => {\n if (isPluginSecretRef(value)) {\n storedReference.value = keepPluginSecret(value)\n isEditing.value = false\n }\n },\n)\n\nconst state = computed<PluginSecretState>(() => pluginSecretState(props.modelValue))\nconst locked = computed(() => isPluginSecretLocked(props.modelValue)\n || isPluginSecretLocked(storedReference.value))\nconst statusLabel = computed(() => isEditing.value\n ? 'New value'\n : pluginSecretLabel(props.modelValue))\nconst typedValue = computed(() => typeof props.modelValue === 'string' ? props.modelValue : '')\nconst canClear = computed(() => !locked.value && (state.value === 'set' || isEditing.value))\n\nfunction startEditing(): void {\n if (props.disabled || locked.value) return\n isEditing.value = true\n emit('update:modelValue', setPluginSecret(''))\n}\n\nfunction updateTyped(value: string | number | null): void {\n emit('update:modelValue', setPluginSecret(value == null ? '' : String(value)))\n}\n\nfunction cancelEditing(): void {\n isEditing.value = false\n emit('update:modelValue', storedReference.value ? { ...storedReference.value } : null)\n}\n\nfunction clear(): void {\n if (props.disabled || locked.value) return\n isEditing.value = false\n storedReference.value = null\n emit('update:modelValue', clearPluginSecret())\n}\n</script>\n\n<template>\n <div class=\"mint-secret-input\" :class=\"{ 'mint-secret-input--error': error }\">\n <div class=\"mint-secret-input__status\">\n <span\n class=\"mint-secret-input__badge\"\n :class=\"`mint-secret-input__badge--${isEditing ? 'pending' : state}`\"\n ><span class=\"mint-secret-input__dot\" aria-hidden=\"true\" />{{ statusLabel }}</span>\n <span v-if=\"locked\" class=\"mint-secret-input__hint\">\n This value comes from the environment and cannot be edited here.\n </span>\n </div>\n\n <BaseInput\n v-if=\"isEditing\"\n type=\"password\"\n autocomplete=\"new-password\"\n :model-value=\"typedValue\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :error=\"error\"\n :size=\"size\"\n @update:model-value=\"updateTyped\"\n />\n\n <div class=\"mint-secret-input__actions\">\n <BaseButton\n v-if=\"!isEditing\"\n type=\"button\"\n variant=\"secondary\"\n :size=\"size === 'lg' ? 'md' : 'sm'\"\n :disabled=\"disabled || locked\"\n @click=\"startEditing\"\n >\n {{ changeLabel }}\n </BaseButton>\n <BaseButton\n v-else\n type=\"button\"\n variant=\"ghost\"\n :size=\"size === 'lg' ? 'md' : 'sm'\"\n :disabled=\"disabled\"\n @click=\"cancelEditing\"\n >\n Cancel\n </BaseButton>\n <BaseButton\n v-if=\"canClear\"\n type=\"button\"\n variant=\"ghost\"\n :size=\"size === 'lg' ? 'md' : 'sm'\"\n :disabled=\"disabled\"\n @click=\"clear\"\n >\n {{ clearLabel }}\n </BaseButton>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Numeric input with always-visible steppers, optional unit label, and (with min+max) an in-field drag-to-scrub range fill. */\nimport { computed, onBeforeUnmount } from 'vue'\n\ninterface Props {\n modelValue?: number\n min?: number\n max?: number\n step?: number\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n placeholder?: string\n unit?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n step: 1,\n disabled: false,\n error: false,\n size: 'md',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: number | undefined]\n}>()\n\nconst isSliderMode = computed(() => props.min !== undefined && props.max !== undefined)\n\nconst sliderPercent = computed(() => {\n const min = props.min\n const max = props.max\n if (min === undefined || max === undefined || props.modelValue === undefined) return 0\n const range = max - min\n if (range === 0) return 0\n return Math.min(100, Math.max(0, ((props.modelValue - min) / range) * 100))\n})\n\nconst canDecrement = computed(() => {\n if (props.modelValue === undefined) return true\n if (props.min === undefined) return true\n return props.modelValue > props.min\n})\n\nconst canIncrement = computed(() => {\n if (props.modelValue === undefined) return true\n if (props.max === undefined) return true\n return props.modelValue < props.max\n})\n\nfunction clamp(value: number): number {\n let result = value\n if (props.min !== undefined && result < props.min) result = props.min\n if (props.max !== undefined && result > props.max) result = props.max\n return result\n}\n\n/** Clamp and trim float noise (0.1 + 0.2 → 0.3) without losing real precision. */\nfunction settle(value: number): number {\n return Number(clamp(value).toFixed(10))\n}\n\n/** Snap to the step grid anchored at `min`, for pointer scrubbing. */\nfunction snap(value: number): number {\n const origin = props.min ?? 0\n return settle(origin + Math.round((value - origin) / props.step) * props.step)\n}\n\nfunction handleInput(event: Event) {\n const target = event.target as HTMLInputElement\n const value = target.value === '' ? undefined : Number(target.value)\n if (value !== undefined && !isNaN(value)) {\n emit('update:modelValue', clamp(value))\n } else {\n emit('update:modelValue', undefined)\n }\n}\n\nfunction nudge(delta: number) {\n if (props.disabled) return\n if (delta < 0 && !canDecrement.value) return\n if (delta > 0 && !canIncrement.value) return\n const current = props.modelValue ?? (delta < 0 ? props.max ?? 0 : props.min ?? 0)\n emit('update:modelValue', settle(current + delta))\n}\n\nfunction decrement() {\n nudge(-props.step)\n}\n\nfunction increment() {\n nudge(props.step)\n}\n\n// Home/End only apply on the slider surface: inside the text input they must\n// keep moving the caret.\nfunction handleKeydown(event: KeyboardEvent, allowJump = false) {\n if (props.disabled) return\n switch (event.key) {\n case 'ArrowUp': increment(); break\n case 'ArrowDown': decrement(); break\n case 'PageUp': nudge(props.step * 10); break\n case 'PageDown': nudge(-props.step * 10); break\n case 'Home':\n if (!allowJump || props.min === undefined) return\n emit('update:modelValue', props.min)\n break\n case 'End':\n if (!allowJump || props.max === undefined) return\n emit('update:modelValue', props.max)\n break\n default:\n return\n }\n event.preventDefault()\n}\n\n// The surrounding range uses absolute position; dragging the number uses a\n// relative offset so grabbing it never jumps away from the current value.\nfunction scrubTo(clientX: number, area: HTMLElement) {\n const rect = area.getBoundingClientRect()\n if (rect.width === 0 || props.min === undefined || props.max === undefined) return\n const ratio = Math.min(1, Math.max(0, (clientX - rect.left) / rect.width))\n emit('update:modelValue', snap(props.min + ratio * (props.max - props.min)))\n}\n\nlet stopScrubbing: (() => void) | undefined\nonBeforeUnmount(() => stopScrubbing?.())\n\nfunction handleScrubStart(event: PointerEvent) {\n const target = event.target as HTMLElement\n const onNumber = target.tagName === 'INPUT'\n if (props.disabled || event.button !== 0 || (!onNumber && !isSliderMode.value)) return\n stopScrubbing?.()\n const area = event.currentTarget as HTMLElement\n const startValue = props.modelValue ?? props.min ?? 0\n const width = area.getBoundingClientRect().width\n const unitsPerPixel = isSliderMode.value && width > 0\n ? (props.max! - props.min!) / width\n : props.step / 8\n // Preserve ordinary clicks and double-clicks for caret placement and typing.\n if (!onNumber) {\n event.preventDefault()\n scrubTo(event.clientX, area)\n }\n target.setPointerCapture?.(event.pointerId)\n let dragging = false\n const move = (e: PointerEvent) => {\n if (e.pointerId !== event.pointerId) return\n if (props.disabled) { stop(); return }\n if (!onNumber) { scrubTo(e.clientX, area); return }\n const delta = e.clientX - event.clientX\n if (!dragging && Math.abs(delta) < 4) return\n dragging = true\n e.preventDefault()\n emit('update:modelValue', settle(startValue + Math.round(delta * unitsPerPixel / props.step) * props.step))\n }\n const stop = () => {\n area.removeEventListener('pointermove', move)\n area.removeEventListener('pointerup', stop)\n area.removeEventListener('pointercancel', stop)\n area.removeEventListener('lostpointercapture', stop)\n if (target.hasPointerCapture?.(event.pointerId)) target.releasePointerCapture(event.pointerId)\n stopScrubbing = undefined\n }\n stopScrubbing = stop\n area.addEventListener('pointermove', move)\n area.addEventListener('pointerup', stop)\n area.addEventListener('pointercancel', stop)\n area.addEventListener('lostpointercapture', stop)\n}\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-number-input',\n `mint-number-input--${size}`,\n isSliderMode ? 'mint-number-input--slider' : 'mint-number-input--stepper',\n error ? 'mint-number-input--error' : '',\n disabled ? 'mint-number-input--disabled' : '',\n ]\"\n >\n <div class=\"mint-number-input__field\">\n <div\n class=\"mint-number-input__scrub\"\n :style=\"isSliderMode ? { '--mint-number-input-fill': `${sliderPercent}%` } : undefined\"\n :role=\"isSliderMode ? 'slider' : undefined\"\n :tabindex=\"isSliderMode && !disabled ? 0 : undefined\"\n :aria-valuenow=\"isSliderMode ? modelValue : undefined\"\n :aria-valuemin=\"isSliderMode ? min : undefined\"\n :aria-valuemax=\"isSliderMode ? max : undefined\"\n :aria-orientation=\"isSliderMode ? 'horizontal' : undefined\"\n @pointerdown=\"handleScrubStart\"\n @keydown.self=\"isSliderMode && handleKeydown($event, true)\"\n >\n <template v-if=\"isSliderMode\">\n <span class=\"mint-number-input__wash\" aria-hidden=\"true\" />\n <span class=\"mint-number-input__rule\" aria-hidden=\"true\" />\n </template>\n <input\n type=\"number\"\n :value=\"modelValue\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :class=\"[\n 'mint-number-input__input',\n `mint-number-input__input--${size}`,\n ]\"\n @input=\"handleInput\"\n @keydown=\"handleKeydown\"\n />\n <span v-if=\"unit\" class=\"mint-number-input__unit\">{{ unit }}</span>\n </div>\n\n <div class=\"mint-number-input__steppers\" aria-hidden=\"true\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Decrease value\"\n :disabled=\"disabled || !canDecrement\"\n class=\"mint-number-input__stepper mint-number-input__stepper--down\"\n @click=\"decrement\"\n >\n <svg viewBox=\"0 0 10 10\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\">\n <path d=\"M2 5h6\" />\n </svg>\n </button>\n <button\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Increase value\"\n :disabled=\"disabled || !canIncrement\"\n class=\"mint-number-input__stepper mint-number-input__stepper--up\"\n @click=\"increment\"\n >\n <svg viewBox=\"0 0 10 10\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\">\n <path d=\"M5 2v6\" /><path d=\"M2 5h6\" />\n </svg>\n </button>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Numeric input with always-visible steppers, optional unit label, and (with min+max) an in-field drag-to-scrub range fill. */\nimport { computed, onBeforeUnmount } from 'vue'\n\ninterface Props {\n modelValue?: number\n min?: number\n max?: number\n step?: number\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n placeholder?: string\n unit?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n step: 1,\n disabled: false,\n error: false,\n size: 'md',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: number | undefined]\n}>()\n\nconst isSliderMode = computed(() => props.min !== undefined && props.max !== undefined)\n\nconst sliderPercent = computed(() => {\n const min = props.min\n const max = props.max\n if (min === undefined || max === undefined || props.modelValue === undefined) return 0\n const range = max - min\n if (range === 0) return 0\n return Math.min(100, Math.max(0, ((props.modelValue - min) / range) * 100))\n})\n\nconst canDecrement = computed(() => {\n if (props.modelValue === undefined) return true\n if (props.min === undefined) return true\n return props.modelValue > props.min\n})\n\nconst canIncrement = computed(() => {\n if (props.modelValue === undefined) return true\n if (props.max === undefined) return true\n return props.modelValue < props.max\n})\n\nfunction clamp(value: number): number {\n let result = value\n if (props.min !== undefined && result < props.min) result = props.min\n if (props.max !== undefined && result > props.max) result = props.max\n return result\n}\n\n/** Clamp and trim float noise (0.1 + 0.2 → 0.3) without losing real precision. */\nfunction settle(value: number): number {\n return Number(clamp(value).toFixed(10))\n}\n\n/** Snap to the step grid anchored at `min`, for pointer scrubbing. */\nfunction snap(value: number): number {\n const origin = props.min ?? 0\n return settle(origin + Math.round((value - origin) / props.step) * props.step)\n}\n\nfunction handleInput(event: Event) {\n const target = event.target as HTMLInputElement\n const value = target.value === '' ? undefined : Number(target.value)\n if (value !== undefined && !isNaN(value)) {\n emit('update:modelValue', clamp(value))\n } else {\n emit('update:modelValue', undefined)\n }\n}\n\nfunction nudge(delta: number) {\n if (props.disabled) return\n if (delta < 0 && !canDecrement.value) return\n if (delta > 0 && !canIncrement.value) return\n const current = props.modelValue ?? (delta < 0 ? props.max ?? 0 : props.min ?? 0)\n emit('update:modelValue', settle(current + delta))\n}\n\nfunction decrement() {\n nudge(-props.step)\n}\n\nfunction increment() {\n nudge(props.step)\n}\n\n// Home/End only apply on the slider surface: inside the text input they must\n// keep moving the caret.\nfunction handleKeydown(event: KeyboardEvent, allowJump = false) {\n if (props.disabled) return\n switch (event.key) {\n case 'ArrowUp': increment(); break\n case 'ArrowDown': decrement(); break\n case 'PageUp': nudge(props.step * 10); break\n case 'PageDown': nudge(-props.step * 10); break\n case 'Home':\n if (!allowJump || props.min === undefined) return\n emit('update:modelValue', props.min)\n break\n case 'End':\n if (!allowJump || props.max === undefined) return\n emit('update:modelValue', props.max)\n break\n default:\n return\n }\n event.preventDefault()\n}\n\n// The surrounding range uses absolute position; dragging the number uses a\n// relative offset so grabbing it never jumps away from the current value.\nfunction scrubTo(clientX: number, area: HTMLElement) {\n const rect = area.getBoundingClientRect()\n if (rect.width === 0 || props.min === undefined || props.max === undefined) return\n const ratio = Math.min(1, Math.max(0, (clientX - rect.left) / rect.width))\n emit('update:modelValue', snap(props.min + ratio * (props.max - props.min)))\n}\n\nlet stopScrubbing: (() => void) | undefined\nonBeforeUnmount(() => stopScrubbing?.())\n\nfunction handleScrubStart(event: PointerEvent) {\n const target = event.target as HTMLElement\n const onNumber = target.tagName === 'INPUT'\n if (props.disabled || event.button !== 0 || (!onNumber && !isSliderMode.value)) return\n stopScrubbing?.()\n const area = event.currentTarget as HTMLElement\n const startValue = props.modelValue ?? props.min ?? 0\n const width = area.getBoundingClientRect().width\n const unitsPerPixel = isSliderMode.value && width > 0\n ? (props.max! - props.min!) / width\n : props.step / 8\n // Preserve ordinary clicks and double-clicks for caret placement and typing.\n if (!onNumber) {\n event.preventDefault()\n scrubTo(event.clientX, area)\n }\n target.setPointerCapture?.(event.pointerId)\n let dragging = false\n const move = (e: PointerEvent) => {\n if (e.pointerId !== event.pointerId) return\n if (props.disabled) { stop(); return }\n if (!onNumber) { scrubTo(e.clientX, area); return }\n const delta = e.clientX - event.clientX\n if (!dragging && Math.abs(delta) < 4) return\n dragging = true\n e.preventDefault()\n emit('update:modelValue', settle(startValue + Math.round(delta * unitsPerPixel / props.step) * props.step))\n }\n const stop = () => {\n area.removeEventListener('pointermove', move)\n area.removeEventListener('pointerup', stop)\n area.removeEventListener('pointercancel', stop)\n area.removeEventListener('lostpointercapture', stop)\n if (target.hasPointerCapture?.(event.pointerId)) target.releasePointerCapture(event.pointerId)\n stopScrubbing = undefined\n }\n stopScrubbing = stop\n area.addEventListener('pointermove', move)\n area.addEventListener('pointerup', stop)\n area.addEventListener('pointercancel', stop)\n area.addEventListener('lostpointercapture', stop)\n}\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-number-input',\n `mint-number-input--${size}`,\n isSliderMode ? 'mint-number-input--slider' : 'mint-number-input--stepper',\n error ? 'mint-number-input--error' : '',\n disabled ? 'mint-number-input--disabled' : '',\n ]\"\n >\n <div class=\"mint-number-input__field\">\n <div\n class=\"mint-number-input__scrub\"\n :style=\"isSliderMode ? { '--mint-number-input-fill': `${sliderPercent}%` } : undefined\"\n :role=\"isSliderMode ? 'slider' : undefined\"\n :tabindex=\"isSliderMode && !disabled ? 0 : undefined\"\n :aria-valuenow=\"isSliderMode ? modelValue : undefined\"\n :aria-valuemin=\"isSliderMode ? min : undefined\"\n :aria-valuemax=\"isSliderMode ? max : undefined\"\n :aria-orientation=\"isSliderMode ? 'horizontal' : undefined\"\n @pointerdown=\"handleScrubStart\"\n @keydown.self=\"isSliderMode && handleKeydown($event, true)\"\n >\n <template v-if=\"isSliderMode\">\n <span class=\"mint-number-input__wash\" aria-hidden=\"true\" />\n <span class=\"mint-number-input__rule\" aria-hidden=\"true\" />\n </template>\n <input\n type=\"number\"\n :value=\"modelValue\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :class=\"[\n 'mint-number-input__input',\n `mint-number-input__input--${size}`,\n ]\"\n @input=\"handleInput\"\n @keydown=\"handleKeydown\"\n />\n <span v-if=\"unit\" class=\"mint-number-input__unit\">{{ unit }}</span>\n </div>\n\n <div class=\"mint-number-input__steppers\" aria-hidden=\"true\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Decrease value\"\n :disabled=\"disabled || !canDecrement\"\n class=\"mint-number-input__stepper mint-number-input__stepper--down\"\n @click=\"decrement\"\n >\n <svg viewBox=\"0 0 10 10\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\">\n <path d=\"M2 5h6\" />\n </svg>\n </button>\n <button\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Increase value\"\n :disabled=\"disabled || !canIncrement\"\n class=\"mint-number-input__stepper mint-number-input__stepper--up\"\n @click=\"increment\"\n >\n <svg viewBox=\"0 0 10 10\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\">\n <path d=\"M5 2v6\" /><path d=\"M2 5h6\" />\n </svg>\n </button>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Drag-and-drop file upload zone with type filtering, size validation, and folder mode. */\nimport { ref, computed, watch } from 'vue'\n\ninterface Props {\n accept?: string\n multiple?: boolean\n maxSize?: number\n disabled?: boolean\n size?: 'sm' | 'md' | 'lg'\n mode?: 'file' | 'folder' | 'file+folder'\n /** Hide the selection list when a parent presents the files itself. */\n showFiles?: boolean\n /** Restore selections owned by a parent form; omitted for internal selection state. */\n files?: File[]\n rootName?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n multiple: false,\n disabled: false,\n size: 'md',\n mode: 'file',\n showFiles: true,\n})\n\nconst emit = defineEmits<{\n upload: [files: File[], rootName?: string, relativePaths?: string[]]\n remove: [files: File[]]\n error: [message: string]\n}>()\n\nconst isDragOver = ref(false)\nconst inputRef = ref<HTMLInputElement>()\nconst selectedFiles = ref<File[]>([])\nconst folderName = ref<string | null>(null)\n\nwatch(() => [props.files, props.rootName] as const, ([files, rootName]) => {\n if (files === undefined) return\n selectedFiles.value = [...files]\n folderName.value = rootName ?? extractFolderName(files)\n}, { immediate: true })\n\nconst isFolder = computed(() => props.mode === 'folder')\nconst isMixed = computed(() => props.mode === 'file+folder')\n\nconst acceptLabel = computed(() => {\n if (!props.accept) return isFolder.value ? 'a folder' : 'any file'\n return props.accept.split(',').map(a => a.trim().replace('.', '').toUpperCase()).join(', ')\n})\n\nconst maxSizeLabel = computed(() => {\n if (!props.maxSize) return null\n if (props.maxSize >= 1024 * 1024 * 1024) {\n return `${(props.maxSize / (1024 * 1024 * 1024)).toFixed(1)} GB`\n }\n if (props.maxSize >= 1024 * 1024) {\n return `${(props.maxSize / (1024 * 1024)).toFixed(1)} MB`\n }\n if (props.maxSize >= 1024) {\n return `${(props.maxSize / 1024).toFixed(1)} KB`\n }\n return `${props.maxSize} bytes`\n})\n\nconst fileTypeMap: Record<string, { color: string; label: string }> = {\n csv: { color: '#10B981', label: 'CSV' },\n tsv: { color: '#10B981', label: 'TSV' },\n xlsx: { color: '#10B981', label: 'XLSX' },\n xls: { color: '#10B981', label: 'XLS' },\n pdf: { color: '#EF4444', label: 'PDF' },\n png: { color: '#8B5CF6', label: 'PNG' },\n jpg: { color: '#8B5CF6', label: 'JPG' },\n jpeg: { color: '#8B5CF6', label: 'JPEG' },\n gif: { color: '#8B5CF6', label: 'GIF' },\n svg: { color: '#8B5CF6', label: 'SVG' },\n webp: { color: '#8B5CF6', label: 'WEBP' },\n json: { color: '#F59E0B', label: 'JSON' },\n xml: { color: '#F59E0B', label: 'XML' },\n txt: { color: '#64748B', label: 'TXT' },\n zip: { color: '#6366F1', label: 'ZIP' },\n gz: { color: '#6366F1', label: 'GZ' },\n py: { color: '#3B82F6', label: 'PY' },\n js: { color: '#EAB308', label: 'JS' },\n ts: { color: '#3B82F6', label: 'TS' },\n fasta: { color: '#EC4899', label: 'FASTA' },\n fastq: { color: '#EC4899', label: 'FASTQ' },\n bam: { color: '#EC4899', label: 'BAM' },\n vcf: { color: '#EC4899', label: 'VCF' },\n}\n\nfunction getFileType(filename: string): { color: string; label: string } {\n const ext = filename.split('.').pop()?.toLowerCase() || ''\n return fileTypeMap[ext] || { color: '#94A3B8', label: ext.toUpperCase() || 'FILE' }\n}\n\nfunction validateFiles(files: FileList | File[]): File[] {\n const validFiles: File[] = []\n\n for (const file of Array.from(files)) {\n if (props.maxSize && file.size > props.maxSize) {\n emit('error', `File \"${file.name}\" exceeds maximum size of ${maxSizeLabel.value}`)\n continue\n }\n\n if (props.accept) {\n const acceptedTypes = props.accept.split(',').map(t => t.trim().toLowerCase())\n const fileExt = '.' + file.name.split('.').pop()?.toLowerCase()\n const fileType = file.type.toLowerCase()\n\n const isAccepted = acceptedTypes.some(type => {\n if (type.startsWith('.')) {\n return fileExt === type\n }\n if (type.endsWith('/*')) {\n return fileType.startsWith(type.replace('/*', '/'))\n }\n return fileType === type\n })\n\n if (!isAccepted) {\n emit('error', `File \"${file.name}\" is not an accepted file type`)\n continue\n }\n }\n\n validFiles.push(file)\n }\n\n return validFiles\n}\n\nfunction handleFiles(\n files: FileList | File[],\n folder?: string,\n explicitRelativePaths?: string[],\n) {\n const candidates = Array.from(files)\n const validFiles = validateFiles(files)\n if (validFiles.length === 0) return\n const relativePaths = validFiles.map((file) => {\n const candidateIndex = candidates.indexOf(file)\n return explicitRelativePaths?.[candidateIndex]\n || file.webkitRelativePath\n || (folder ? `${folder}/${file.name}` : file.name)\n })\n\n if (isFolder.value) {\n folderName.value = folder || extractFolderName(validFiles)\n selectedFiles.value = validFiles\n emit('upload', validFiles, folderName.value ?? undefined, relativePaths)\n } else if (!props.multiple) {\n selectedFiles.value = [validFiles[0]]\n emit('upload', [validFiles[0]], undefined, [relativePaths[0]])\n } else {\n selectedFiles.value = [...selectedFiles.value, ...validFiles]\n emit('upload', validFiles, undefined, relativePaths)\n }\n}\n\nfunction extractFolderName(files: File[]): string | null {\n if (files.length === 0) return null\n const firstPath = files[0].webkitRelativePath\n if (firstPath) {\n return firstPath.split('/')[0]\n }\n return null\n}\n\nasync function handleDrop(event: DragEvent) {\n event.preventDefault()\n isDragOver.value = false\n if (props.disabled) return\n\n try {\n if (props.mode !== 'file' && event.dataTransfer?.items?.length) {\n await handleFolderDrop(event.dataTransfer.items)\n } else if (event.dataTransfer?.files) {\n handleFiles(event.dataTransfer.files)\n }\n } catch (cause) {\n emit('error', cause instanceof Error ? cause.message : 'Could not read the dropped folder.')\n }\n}\n\nasync function handleFolderDrop(items: DataTransferItemList) {\n const files: File[] = []\n const relativePaths: string[] = []\n let folderNameFromDrop: string | undefined\n\n // Capture live drag data before awaiting: the browser protects it after the drop handler.\n const dropped = Array.from(items, (item) => {\n const entry = item.webkitGetAsEntry?.()\n return { entry, file: entry ? null : item.getAsFile?.() }\n })\n for (const { entry, file: droppedFile } of dropped) {\n if (entry?.isDirectory) {\n folderNameFromDrop = entry.name\n await readDirectory(\n entry as FileSystemDirectoryEntry,\n files,\n relativePaths,\n entry.name,\n )\n } else {\n const file = entry?.isFile\n ? await getFile(entry as FileSystemFileEntry)\n : droppedFile\n if (file) {\n files.push(file)\n relativePaths.push(file.name)\n }\n }\n }\n\n if (files.length > 0) {\n handleFiles(files, folderNameFromDrop, relativePaths)\n }\n}\n\nasync function readDirectory(\n directory: FileSystemDirectoryEntry,\n files: File[],\n relativePaths: string[],\n prefix: string,\n): Promise<void> {\n const reader = directory.createReader()\n // readEntries returns at most 100 entries per call per spec — must loop\n let batch: FileSystemEntry[]\n do {\n batch = await new Promise<FileSystemEntry[]>((resolve, reject) => {\n reader.readEntries(resolve, reject)\n })\n for (const entry of batch) {\n if (entry.isFile) {\n const file = await getFile(entry as FileSystemFileEntry)\n if (file) {\n files.push(file)\n relativePaths.push(`${prefix}/${file.name}`)\n }\n } else if (entry.isDirectory) {\n await readDirectory(\n entry as FileSystemDirectoryEntry,\n files,\n relativePaths,\n `${prefix}/${entry.name}`,\n )\n }\n }\n } while (batch.length > 0)\n}\n\nfunction getFile(entry: FileSystemFileEntry): Promise<File | null> {\n return new Promise((resolve) => {\n entry.file(resolve, () => resolve(null))\n })\n}\n\nfunction handleDragOver(event: DragEvent) {\n event.preventDefault()\n if (!props.disabled) {\n isDragOver.value = true\n }\n}\n\nfunction handleDragLeave() {\n isDragOver.value = false\n}\n\nfunction handleInputChange(event: Event) {\n const target = event.target as HTMLInputElement\n if (target.files) {\n handleFiles(target.files)\n }\n target.value = ''\n}\n\nfunction openFilePicker() {\n if (!props.disabled) {\n inputRef.value?.click()\n }\n}\n\nfunction removeFile(index: number) {\n const removed = selectedFiles.value[index]\n selectedFiles.value = selectedFiles.value.filter((_, i) => i !== index)\n if (isFolder.value && selectedFiles.value.length === 0) {\n folderName.value = null\n }\n if (removed) emit('remove', [removed])\n}\n\nfunction clearAll() {\n const removed = [...selectedFiles.value]\n selectedFiles.value = []\n folderName.value = null\n if (removed.length) emit('remove', removed)\n}\n\nfunction formatFileSize(bytes: number): string {\n if (bytes >= 1024 * 1024) {\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`\n }\n if (bytes >= 1024) {\n return `${(bytes / 1024).toFixed(1)} KB`\n }\n return `${bytes} bytes`\n}\n</script>\n\n<template>\n <div class=\"mint-file-uploader\">\n <!-- Dropzone -->\n <div\n role=\"button\"\n tabindex=\"0\"\n :aria-label=\"disabled\n ? 'File upload disabled'\n : isMixed\n ? 'Drop files or a folder, or click to choose files'\n : isFolder ? 'Click or drag a folder to upload' : 'Click or drag files to upload'\"\n :aria-disabled=\"disabled\"\n :class=\"[\n 'mint-file-uploader__dropzone',\n `mint-file-uploader__dropzone--${size}`,\n isDragOver ? 'mint-file-uploader__dropzone--dragover' : '',\n disabled ? 'mint-file-uploader__dropzone--disabled' : '',\n selectedFiles.length > 0 ? 'mint-file-uploader__dropzone--has-files' : '',\n ]\"\n @click=\"openFilePicker\"\n @keydown.enter=\"openFilePicker\"\n @keydown.space.prevent=\"openFilePicker\"\n @drop=\"handleDrop\"\n @dragover=\"handleDragOver\"\n @dragleave=\"handleDragLeave\"\n >\n <input\n ref=\"inputRef\"\n type=\"file\"\n :accept=\"accept\"\n :multiple=\"isFolder || multiple\"\n :disabled=\"disabled\"\n :webkitdirectory=\"isFolder || undefined\"\n class=\"mint-file-uploader__input\"\n @change=\"handleInputChange\"\n />\n\n <div class=\"mint-file-uploader__content\">\n <svg\n v-if=\"isFolder\"\n class=\"mint-file-uploader__icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z\" />\n </svg>\n <svg\n v-else\n class=\"mint-file-uploader__icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3\" /><path d=\"m16 16-4-4-4 4\" /><path d=\"M12 12v9\" />\n </svg>\n\n <p class=\"mint-file-uploader__text\">\n {{ isMixed ? 'Drop files or a folder, or click to choose files' : `Drop ${acceptLabel} or click` }}\n </p>\n </div>\n </div>\n\n <!-- Actions slot (e.g. template buttons) -->\n <div v-if=\"$slots.actions\" class=\"mint-file-uploader__actions\">\n <slot name=\"actions\" />\n </div>\n\n <!-- Folder summary display -->\n <div v-if=\"showFiles && isFolder && folderName && selectedFiles.length > 0\" class=\"mint-file-uploader__folder-summary\">\n <div class=\"mint-file-uploader__folder-info\">\n <div class=\"mint-file-uploader__folder-icon-wrapper\">\n <svg class=\"mint-file-uploader__folder-icon\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" viewBox=\"0 0 24 24\">\n <path d=\"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2\" />\n </svg>\n </div>\n <div class=\"mint-file-uploader__folder-details\">\n <span class=\"mint-file-uploader__folder-name\">{{ folderName }}</span>\n <span class=\"mint-file-uploader__folder-count\">{{ selectedFiles.length }} file{{ selectedFiles.length !== 1 ? 's' : '' }}</span>\n </div>\n </div>\n <button\n type=\"button\"\n aria-label=\"Clear folder\"\n class=\"mint-file-uploader__remove-btn\"\n @click.stop=\"clearAll\"\n >\n <svg class=\"mint-file-uploader__remove-icon\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" viewBox=\"0 0 24 24\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </div>\n\n <!-- File list display -->\n <TransitionGroup\n v-if=\"showFiles && !isFolder && selectedFiles.length > 0\"\n tag=\"ul\"\n name=\"mint-file-uploader-item\"\n class=\"mint-file-uploader__list\"\n >\n <li\n v-for=\"(file, index) in selectedFiles\"\n :key=\"`${file.name}-${file.size}-${index}`\"\n class=\"mint-file-uploader__file\"\n >\n <div class=\"mint-file-uploader__file-info\">\n <span\n class=\"mint-file-uploader__file-badge\"\n :style=\"{ '--badge-color': getFileType(file.name).color }\"\n >\n {{ getFileType(file.name).label }}\n </span>\n <div class=\"mint-file-uploader__file-meta\">\n <span class=\"mint-file-uploader__file-name\">{{ file.name }}</span>\n <span class=\"mint-file-uploader__file-size\">{{ formatFileSize(file.size) }}</span>\n </div>\n </div>\n <button\n type=\"button\"\n :aria-label=\"`Remove ${file.name}`\"\n class=\"mint-file-uploader__remove-btn\"\n @click.stop=\"removeFile(index)\"\n >\n <svg class=\"mint-file-uploader__remove-icon\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" viewBox=\"0 0 24 24\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </li>\n </TransitionGroup>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Drag-and-drop file upload zone with type filtering, size validation, and folder mode. */\nimport { ref, computed, watch } from 'vue'\n\ninterface Props {\n accept?: string\n multiple?: boolean\n maxSize?: number\n disabled?: boolean\n size?: 'sm' | 'md' | 'lg'\n mode?: 'file' | 'folder' | 'file+folder'\n /** Hide the selection list when a parent presents the files itself. */\n showFiles?: boolean\n /** Restore selections owned by a parent form; omitted for internal selection state. */\n files?: File[]\n rootName?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n multiple: false,\n disabled: false,\n size: 'md',\n mode: 'file',\n showFiles: true,\n})\n\nconst emit = defineEmits<{\n upload: [files: File[], rootName?: string, relativePaths?: string[]]\n remove: [files: File[]]\n error: [message: string]\n}>()\n\nconst isDragOver = ref(false)\nconst inputRef = ref<HTMLInputElement>()\nconst selectedFiles = ref<File[]>([])\nconst folderName = ref<string | null>(null)\n\nwatch(() => [props.files, props.rootName] as const, ([files, rootName]) => {\n if (files === undefined) return\n selectedFiles.value = [...files]\n folderName.value = rootName ?? extractFolderName(files)\n}, { immediate: true })\n\nconst isFolder = computed(() => props.mode === 'folder')\nconst isMixed = computed(() => props.mode === 'file+folder')\n\nconst acceptLabel = computed(() => {\n if (!props.accept) return isFolder.value ? 'a folder' : 'any file'\n return props.accept.split(',').map(a => a.trim().replace('.', '').toUpperCase()).join(', ')\n})\n\nconst maxSizeLabel = computed(() => {\n if (!props.maxSize) return null\n if (props.maxSize >= 1024 * 1024 * 1024) {\n return `${(props.maxSize / (1024 * 1024 * 1024)).toFixed(1)} GB`\n }\n if (props.maxSize >= 1024 * 1024) {\n return `${(props.maxSize / (1024 * 1024)).toFixed(1)} MB`\n }\n if (props.maxSize >= 1024) {\n return `${(props.maxSize / 1024).toFixed(1)} KB`\n }\n return `${props.maxSize} bytes`\n})\n\nconst fileTypeMap: Record<string, { color: string; label: string }> = {\n csv: { color: '#10B981', label: 'CSV' },\n tsv: { color: '#10B981', label: 'TSV' },\n xlsx: { color: '#10B981', label: 'XLSX' },\n xls: { color: '#10B981', label: 'XLS' },\n pdf: { color: '#EF4444', label: 'PDF' },\n png: { color: '#8B5CF6', label: 'PNG' },\n jpg: { color: '#8B5CF6', label: 'JPG' },\n jpeg: { color: '#8B5CF6', label: 'JPEG' },\n gif: { color: '#8B5CF6', label: 'GIF' },\n svg: { color: '#8B5CF6', label: 'SVG' },\n webp: { color: '#8B5CF6', label: 'WEBP' },\n json: { color: '#F59E0B', label: 'JSON' },\n xml: { color: '#F59E0B', label: 'XML' },\n txt: { color: '#64748B', label: 'TXT' },\n zip: { color: '#6366F1', label: 'ZIP' },\n gz: { color: '#6366F1', label: 'GZ' },\n py: { color: '#3B82F6', label: 'PY' },\n js: { color: '#EAB308', label: 'JS' },\n ts: { color: '#3B82F6', label: 'TS' },\n fasta: { color: '#EC4899', label: 'FASTA' },\n fastq: { color: '#EC4899', label: 'FASTQ' },\n bam: { color: '#EC4899', label: 'BAM' },\n vcf: { color: '#EC4899', label: 'VCF' },\n}\n\nfunction getFileType(filename: string): { color: string; label: string } {\n const ext = filename.split('.').pop()?.toLowerCase() || ''\n return fileTypeMap[ext] || { color: '#94A3B8', label: ext.toUpperCase() || 'FILE' }\n}\n\nfunction validateFiles(files: FileList | File[]): File[] {\n const validFiles: File[] = []\n\n for (const file of Array.from(files)) {\n if (props.maxSize && file.size > props.maxSize) {\n emit('error', `File \"${file.name}\" exceeds maximum size of ${maxSizeLabel.value}`)\n continue\n }\n\n if (props.accept) {\n const acceptedTypes = props.accept.split(',').map(t => t.trim().toLowerCase())\n const fileExt = '.' + file.name.split('.').pop()?.toLowerCase()\n const fileType = file.type.toLowerCase()\n\n const isAccepted = acceptedTypes.some(type => {\n if (type.startsWith('.')) {\n return fileExt === type\n }\n if (type.endsWith('/*')) {\n return fileType.startsWith(type.replace('/*', '/'))\n }\n return fileType === type\n })\n\n if (!isAccepted) {\n emit('error', `File \"${file.name}\" is not an accepted file type`)\n continue\n }\n }\n\n validFiles.push(file)\n }\n\n return validFiles\n}\n\nfunction handleFiles(\n files: FileList | File[],\n folder?: string,\n explicitRelativePaths?: string[],\n) {\n const candidates = Array.from(files)\n const validFiles = validateFiles(files)\n if (validFiles.length === 0) return\n const relativePaths = validFiles.map((file) => {\n const candidateIndex = candidates.indexOf(file)\n return explicitRelativePaths?.[candidateIndex]\n || file.webkitRelativePath\n || (folder ? `${folder}/${file.name}` : file.name)\n })\n\n if (isFolder.value) {\n folderName.value = folder || extractFolderName(validFiles)\n selectedFiles.value = validFiles\n emit('upload', validFiles, folderName.value ?? undefined, relativePaths)\n } else if (!props.multiple) {\n selectedFiles.value = [validFiles[0]]\n emit('upload', [validFiles[0]], undefined, [relativePaths[0]])\n } else {\n selectedFiles.value = [...selectedFiles.value, ...validFiles]\n emit('upload', validFiles, undefined, relativePaths)\n }\n}\n\nfunction extractFolderName(files: File[]): string | null {\n if (files.length === 0) return null\n const firstPath = files[0].webkitRelativePath\n if (firstPath) {\n return firstPath.split('/')[0]\n }\n return null\n}\n\nasync function handleDrop(event: DragEvent) {\n event.preventDefault()\n isDragOver.value = false\n if (props.disabled) return\n\n try {\n if (props.mode !== 'file' && event.dataTransfer?.items?.length) {\n await handleFolderDrop(event.dataTransfer.items)\n } else if (event.dataTransfer?.files) {\n handleFiles(event.dataTransfer.files)\n }\n } catch (cause) {\n emit('error', cause instanceof Error ? cause.message : 'Could not read the dropped folder.')\n }\n}\n\nasync function handleFolderDrop(items: DataTransferItemList) {\n const files: File[] = []\n const relativePaths: string[] = []\n let folderNameFromDrop: string | undefined\n\n // Capture live drag data before awaiting: the browser protects it after the drop handler.\n const dropped = Array.from(items, (item) => {\n const entry = item.webkitGetAsEntry?.()\n return { entry, file: entry ? null : item.getAsFile?.() }\n })\n for (const { entry, file: droppedFile } of dropped) {\n if (entry?.isDirectory) {\n folderNameFromDrop = entry.name\n await readDirectory(\n entry as FileSystemDirectoryEntry,\n files,\n relativePaths,\n entry.name,\n )\n } else {\n const file = entry?.isFile\n ? await getFile(entry as FileSystemFileEntry)\n : droppedFile\n if (file) {\n files.push(file)\n relativePaths.push(file.name)\n }\n }\n }\n\n if (files.length > 0) {\n handleFiles(files, folderNameFromDrop, relativePaths)\n }\n}\n\nasync function readDirectory(\n directory: FileSystemDirectoryEntry,\n files: File[],\n relativePaths: string[],\n prefix: string,\n): Promise<void> {\n const reader = directory.createReader()\n // readEntries returns at most 100 entries per call per spec — must loop\n let batch: FileSystemEntry[]\n do {\n batch = await new Promise<FileSystemEntry[]>((resolve, reject) => {\n reader.readEntries(resolve, reject)\n })\n for (const entry of batch) {\n if (entry.isFile) {\n const file = await getFile(entry as FileSystemFileEntry)\n if (file) {\n files.push(file)\n relativePaths.push(`${prefix}/${file.name}`)\n }\n } else if (entry.isDirectory) {\n await readDirectory(\n entry as FileSystemDirectoryEntry,\n files,\n relativePaths,\n `${prefix}/${entry.name}`,\n )\n }\n }\n } while (batch.length > 0)\n}\n\nfunction getFile(entry: FileSystemFileEntry): Promise<File | null> {\n return new Promise((resolve) => {\n entry.file(resolve, () => resolve(null))\n })\n}\n\nfunction handleDragOver(event: DragEvent) {\n event.preventDefault()\n if (!props.disabled) {\n isDragOver.value = true\n }\n}\n\nfunction handleDragLeave() {\n isDragOver.value = false\n}\n\nfunction handleInputChange(event: Event) {\n const target = event.target as HTMLInputElement\n if (target.files) {\n handleFiles(target.files)\n }\n target.value = ''\n}\n\nfunction openFilePicker() {\n if (!props.disabled) {\n inputRef.value?.click()\n }\n}\n\nfunction removeFile(index: number) {\n const removed = selectedFiles.value[index]\n selectedFiles.value = selectedFiles.value.filter((_, i) => i !== index)\n if (isFolder.value && selectedFiles.value.length === 0) {\n folderName.value = null\n }\n if (removed) emit('remove', [removed])\n}\n\nfunction clearAll() {\n const removed = [...selectedFiles.value]\n selectedFiles.value = []\n folderName.value = null\n if (removed.length) emit('remove', removed)\n}\n\nfunction formatFileSize(bytes: number): string {\n if (bytes >= 1024 * 1024) {\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`\n }\n if (bytes >= 1024) {\n return `${(bytes / 1024).toFixed(1)} KB`\n }\n return `${bytes} bytes`\n}\n</script>\n\n<template>\n <div class=\"mint-file-uploader\">\n <!-- Dropzone -->\n <div\n role=\"button\"\n tabindex=\"0\"\n :aria-label=\"disabled\n ? 'File upload disabled'\n : isMixed\n ? 'Drop files or a folder, or click to choose files'\n : isFolder ? 'Click or drag a folder to upload' : 'Click or drag files to upload'\"\n :aria-disabled=\"disabled\"\n :class=\"[\n 'mint-file-uploader__dropzone',\n `mint-file-uploader__dropzone--${size}`,\n isDragOver ? 'mint-file-uploader__dropzone--dragover' : '',\n disabled ? 'mint-file-uploader__dropzone--disabled' : '',\n selectedFiles.length > 0 ? 'mint-file-uploader__dropzone--has-files' : '',\n ]\"\n @click=\"openFilePicker\"\n @keydown.enter=\"openFilePicker\"\n @keydown.space.prevent=\"openFilePicker\"\n @drop=\"handleDrop\"\n @dragover=\"handleDragOver\"\n @dragleave=\"handleDragLeave\"\n >\n <input\n ref=\"inputRef\"\n type=\"file\"\n :accept=\"accept\"\n :multiple=\"isFolder || multiple\"\n :disabled=\"disabled\"\n :webkitdirectory=\"isFolder || undefined\"\n class=\"mint-file-uploader__input\"\n @change=\"handleInputChange\"\n />\n\n <div class=\"mint-file-uploader__content\">\n <svg\n v-if=\"isFolder\"\n class=\"mint-file-uploader__icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z\" />\n </svg>\n <svg\n v-else\n class=\"mint-file-uploader__icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3\" /><path d=\"m16 16-4-4-4 4\" /><path d=\"M12 12v9\" />\n </svg>\n\n <p class=\"mint-file-uploader__text\">\n {{ isMixed ? 'Drop files or a folder, or click to choose files' : `Drop ${acceptLabel} or click` }}\n </p>\n </div>\n </div>\n\n <!-- Actions slot (e.g. template buttons) -->\n <div v-if=\"$slots.actions\" class=\"mint-file-uploader__actions\">\n <slot name=\"actions\" />\n </div>\n\n <!-- Folder summary display -->\n <div v-if=\"showFiles && isFolder && folderName && selectedFiles.length > 0\" class=\"mint-file-uploader__folder-summary\">\n <div class=\"mint-file-uploader__folder-info\">\n <div class=\"mint-file-uploader__folder-icon-wrapper\">\n <svg class=\"mint-file-uploader__folder-icon\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" viewBox=\"0 0 24 24\">\n <path d=\"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2\" />\n </svg>\n </div>\n <div class=\"mint-file-uploader__folder-details\">\n <span class=\"mint-file-uploader__folder-name\">{{ folderName }}</span>\n <span class=\"mint-file-uploader__folder-count\">{{ selectedFiles.length }} file{{ selectedFiles.length !== 1 ? 's' : '' }}</span>\n </div>\n </div>\n <button\n type=\"button\"\n aria-label=\"Clear folder\"\n class=\"mint-file-uploader__remove-btn\"\n @click.stop=\"clearAll\"\n >\n <svg class=\"mint-file-uploader__remove-icon\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" viewBox=\"0 0 24 24\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </div>\n\n <!-- File list display -->\n <TransitionGroup\n v-if=\"showFiles && !isFolder && selectedFiles.length > 0\"\n tag=\"ul\"\n name=\"mint-file-uploader-item\"\n class=\"mint-file-uploader__list\"\n >\n <li\n v-for=\"(file, index) in selectedFiles\"\n :key=\"`${file.name}-${file.size}-${index}`\"\n class=\"mint-file-uploader__file\"\n >\n <div class=\"mint-file-uploader__file-info\">\n <span\n class=\"mint-file-uploader__file-badge\"\n :style=\"{ '--badge-color': getFileType(file.name).color }\"\n >\n {{ getFileType(file.name).label }}\n </span>\n <div class=\"mint-file-uploader__file-meta\">\n <span class=\"mint-file-uploader__file-name\">{{ file.name }}</span>\n <span class=\"mint-file-uploader__file-size\">{{ formatFileSize(file.size) }}</span>\n </div>\n </div>\n <button\n type=\"button\"\n :aria-label=\"`Remove ${file.name}`\"\n class=\"mint-file-uploader__remove-btn\"\n @click.stop=\"removeFile(index)\"\n >\n <svg class=\"mint-file-uploader__remove-icon\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" viewBox=\"0 0 24 24\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </li>\n </TransitionGroup>\n </div>\n</template>\n","import { nextTick } from 'vue'\n\nexport interface UseMenuKeyboardOptions {\n /** Returns the currently navigable items inside the open panel, in DOM order. */\n items: () => HTMLElement[]\n /** True while the panel is open. */\n isOpen: () => boolean\n /** Opens the panel. */\n open: () => void\n /** Closes the panel. When `returnFocus` is true, focus should return to the trigger. */\n close: (returnFocus?: boolean) => void\n}\n\nexport interface UseMenuKeyboardReturn {\n /**\n * Bind to the trigger's `@keydown`. ArrowDown/Enter/Space open the panel (when\n * closed) and focus its first item; ArrowUp opens it focused on the last item.\n */\n handleTriggerKeydown: (event: KeyboardEvent) => void\n /**\n * Bind to the open panel's `@keydown`. ArrowUp/ArrowDown cycle focus with\n * wraparound, Home/End jump to the first/last item, Escape closes, returns\n * focus to the trigger and stops propagating, and Tab closes without moving focus.\n */\n handlePanelKeydown: (event: KeyboardEvent) => void\n}\n\n/**\n * Shared keyboard contract for menu- and listbox-style disclosure panels (the\n * WAI-ARIA menu button pattern). Used by ActionMenu and AppAvatarMenu,\n * each pairing it with `useDropdownState` for the disclosure state itself.\n */\nexport function useMenuKeyboard(options: UseMenuKeyboardOptions): UseMenuKeyboardReturn {\n function focusItem(position: 'first' | 'last') {\n void nextTick(() => {\n const items = options.items()\n const target = position === 'first' ? items[0] : items[items.length - 1]\n target?.focus()\n })\n }\n\n function handleTriggerKeydown(event: KeyboardEvent) {\n if (options.isOpen()) return\n\n if (event.key === 'ArrowDown' || event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n options.open()\n focusItem('first')\n return\n }\n if (event.key === 'ArrowUp') {\n event.preventDefault()\n options.open()\n focusItem('last')\n }\n }\n\n function handlePanelKeydown(event: KeyboardEvent) {\n const items = options.items()\n const currentIndex = items.indexOf(document.activeElement as HTMLElement)\n\n if (event.key === 'Escape') {\n event.preventDefault()\n // The menu handles this Escape; an enclosing BaseModal must not close too.\n event.stopPropagation()\n options.close(true)\n return\n }\n if (event.key === 'Tab') {\n options.close()\n return\n }\n if (event.key === 'Home') {\n event.preventDefault()\n items[0]?.focus()\n return\n }\n if (event.key === 'End') {\n event.preventDefault()\n items[items.length - 1]?.focus()\n return\n }\n if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp') return\n\n event.preventDefault()\n const direction = event.key === 'ArrowDown' ? 1 : -1\n const nextIndex = (Math.max(currentIndex, 0) + direction + items.length) % items.length\n items[nextIndex]?.focus()\n }\n\n return { handleTriggerKeydown, handlePanelKeydown }\n}\n","/** Narrow an unknown value to a plain object (arrays and null excluded). */\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\n/** Narrow an unknown value to any non-null object, arrays included. */\nexport function isObjectLike(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null\n}\n","<script setup lang=\"ts\">\n/** Combined date and time picker with a dropdown calendar, time slots, and 12/24 h format support. */\nimport { computed, ref, watch, nextTick, useTemplateRef } from 'vue'\nimport { useCalendarGrid, type CalendarGridDay } from '../composables/useCalendarGrid'\nimport { useDropdownState } from '../composables/useDropdownState'\nimport { useFocusTrap } from '../composables/useFocusTrap'\nimport { formatTime, formatTimeSlot, generateTimeSlots, toMinutes } from '../composables/useTimeUtils'\nimport CalendarGridPanelInternal from './internal/CalendarGridPanelInternal.vue'\n\ninterface Props {\n modelValue?: string\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n min?: string\n max?: string\n timeStep?: number\n timeFormat?: '12h' | '24h'\n clearable?: boolean\n locale?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n placeholder: 'Select date & time',\n disabled: false,\n error: false,\n size: 'md',\n timeStep: 15,\n timeFormat: '24h',\n clearable: false,\n locale: 'en-US',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | undefined]\n}>()\n\nconst dropdownRef = ref<HTMLElement | null>(null)\nconst { isOpen, open, close, toggle } = useDropdownState({\n rootRef: useTemplateRef<HTMLElement>('root'),\n triggerRef: useTemplateRef<HTMLElement>('trigger'),\n})\n// Non-modal dialog: Tab stays inside the panel, focus returns to the input on close.\nuseFocusTrap({ containerRef: dropdownRef, active: isOpen })\nconst {\n weekDays,\n monthYear,\n calendarDays,\n formatDateValue,\n setCurrentMonthFromDate,\n prevMonth,\n nextMonth,\n} = useCalendarGrid({\n min: () => props.min,\n max: () => props.max,\n locale: () => props.locale,\n})\n\n// Parse model value into date and time parts\nconst selectedDate = computed(() => {\n if (!props.modelValue) return null\n const d = new Date(props.modelValue)\n return isNaN(d.getTime()) ? null : d\n})\n\nconst selectedDateStr = computed(() => {\n if (!selectedDate.value) return null\n return formatDateValue(selectedDate.value)\n})\n\nconst selectedTimeStr = computed(() => {\n if (!selectedDate.value) return null\n return formatTime(selectedDate.value.getHours(), selectedDate.value.getMinutes())\n})\n\nconst displayValue = computed(() => {\n if (!selectedDate.value) return ''\n const dateStr = selectedDate.value.toLocaleDateString(props.locale, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n })\n const timeStr = formatTime(\n selectedDate.value.getHours(),\n selectedDate.value.getMinutes(),\n props.timeFormat,\n )\n return `${dateStr} ${timeStr}`\n})\n\n// Time slots\nconst timeSlots = computed(() => {\n return generateTimeSlots('00:00', '23:59', props.timeStep)\n})\n\nfunction isTimeDisabled(time: string): boolean {\n if (!selectedDateStr.value) return false\n const timeMinutes = toMinutes(time)\n\n if (props.min) {\n const minDate = new Date(props.min)\n if (selectedDateStr.value === formatDateValue(minDate)) {\n const minMin = minDate.getHours() * 60 + minDate.getMinutes()\n if (timeMinutes < minMin) return true\n }\n }\n if (props.max) {\n const maxDate = new Date(props.max)\n if (selectedDateStr.value === formatDateValue(maxDate)) {\n const maxMin = maxDate.getHours() * 60 + maxDate.getMinutes()\n if (timeMinutes > maxMin) return true\n }\n }\n return false\n}\n\nfunction selectDate(day: CalendarGridDay) {\n if (day.isDisabled || props.disabled) return\n const dateStr = formatDateValue(day.date)\n const timeStr = selectedTimeStr.value || '09:00'\n emit('update:modelValue', `${dateStr}T${timeStr}`)\n}\n\nfunction selectTime(time: string) {\n if (isTimeDisabled(time)) return\n const dateStr = selectedDateStr.value || formatDateValue(new Date())\n emit('update:modelValue', `${dateStr}T${time}`)\n}\n\nfunction goToNow() {\n const now = new Date()\n setCurrentMonthFromDate(now)\n const dateStr = formatDateValue(now)\n const timeStr = formatTime(now.getHours(), now.getMinutes())\n emit('update:modelValue', `${dateStr}T${timeStr}`)\n close()\n}\n\nfunction goToToday() {\n const today = new Date()\n setCurrentMonthFromDate(today)\n const dateStr = formatDateValue(today)\n const timeStr = selectedTimeStr.value || '09:00'\n emit('update:modelValue', `${dateStr}T${timeStr}`)\n}\n\nfunction clear() {\n emit('update:modelValue', undefined)\n close()\n}\n\nfunction toggleDropdown() {\n if (props.disabled) return\n toggle()\n}\n\nfunction handleTriggerKeydown(event: KeyboardEvent) {\n if (props.disabled || isOpen.value) return\n if (event.key === 'Enter' || event.key === ' ' || event.key === 'ArrowDown') {\n event.preventDefault()\n open()\n }\n}\n\n/** Moves focus into the calendar grid: selected day, else today, else the first day. */\nfunction focusCalendar() {\n const panel = dropdownRef.value\n if (!panel) return\n const target =\n panel.querySelector<HTMLElement>('.mint-date-picker__day--selected') ??\n panel.querySelector<HTMLElement>('.mint-date-picker__day--today') ??\n panel.querySelector<HTMLElement>('.mint-date-picker__day:not([disabled])')\n target?.focus()\n}\n\nwatch(isOpen, async (opened) => {\n if (!opened) return\n if (selectedDate.value) {\n setCurrentMonthFromDate(selectedDate.value)\n }\n await nextTick()\n if (selectedDate.value) {\n // Scroll time grid to selected time\n const grid = dropdownRef.value?.querySelector('.mint-datetime-picker__time-grid')\n const active = dropdownRef.value?.querySelector('.mint-datetime-picker__time-chip--active')\n if (grid && active) {\n active.scrollIntoView({ block: 'center' })\n }\n }\n // A second tick so this focus lands after the focus trap's initial focus.\n await nextTick()\n focusCalendar()\n})\n</script>\n\n<template>\n <div ref=\"root\" class=\"mint-datetime-picker\">\n <div class=\"mint-datetime-picker__input-wrapper\">\n <div class=\"mint-datetime-picker__icon-calendar\">\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z\" />\n </svg>\n </div>\n <input\n ref=\"trigger\"\n type=\"text\"\n readonly\n aria-haspopup=\"dialog\"\n :aria-expanded=\"isOpen\"\n :value=\"displayValue\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :class=\"[\n 'mint-datetime-picker__input',\n `mint-datetime-picker__input--${size}`,\n error ? 'mint-datetime-picker__input--error' : '',\n disabled ? 'mint-datetime-picker__input--disabled' : '',\n ]\"\n aria-label=\"Select date and time\"\n @click=\"toggleDropdown\"\n @keydown=\"handleTriggerKeydown\"\n />\n <div class=\"mint-datetime-picker__icon-clock\">\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z\" />\n </svg>\n </div>\n </div>\n\n <Transition\n enter-active-class=\"mint-datetime-picker__dropdown-enter-active\"\n enter-from-class=\"mint-datetime-picker__dropdown-enter-from\"\n enter-to-class=\"mint-datetime-picker__dropdown-enter-to\"\n leave-active-class=\"mint-datetime-picker__dropdown-leave-active\"\n leave-from-class=\"mint-datetime-picker__dropdown-leave-from\"\n leave-to-class=\"mint-datetime-picker__dropdown-leave-to\"\n >\n <div\n v-if=\"isOpen\"\n ref=\"dropdownRef\"\n class=\"mint-popover mint-datetime-picker__dropdown\"\n role=\"dialog\"\n aria-label=\"Date and time picker\"\n >\n <!-- Calendar section -->\n <div class=\"mint-datetime-picker__calendar-section\">\n <CalendarGridPanelInternal\n :week-days=\"weekDays\"\n :month-year=\"monthYear\"\n :days=\"calendarDays\"\n :selected-date=\"selectedDate\"\n :locale=\"locale\"\n @previous-month=\"prevMonth\"\n @next-month=\"nextMonth\"\n @select=\"selectDate\"\n />\n </div>\n\n <!-- Divider -->\n <div class=\"mint-datetime-picker__divider\" />\n\n <!-- Time section -->\n <div class=\"mint-datetime-picker__time-section\">\n <div class=\"mint-datetime-picker__time-label\">Time</div>\n <div class=\"mint-datetime-picker__time-grid\">\n <button\n v-for=\"time in timeSlots\"\n :key=\"time\"\n type=\"button\"\n :disabled=\"isTimeDisabled(time)\"\n :class=\"[\n 'mint-datetime-picker__time-chip',\n selectedTimeStr === time ? 'mint-datetime-picker__time-chip--active' : '',\n isTimeDisabled(time) ? 'mint-datetime-picker__time-chip--disabled' : '',\n ]\"\n @click=\"selectTime(time)\"\n >\n {{ formatTimeSlot(time, timeFormat) }}\n </button>\n </div>\n </div>\n\n <!-- Footer -->\n <div class=\"mint-datetime-picker__footer\">\n <div>\n <button type=\"button\" class=\"mint-datetime-picker__footer-btn\" @click=\"goToToday\">Today</button>\n <button type=\"button\" class=\"mint-datetime-picker__footer-btn\" @click=\"goToNow\">Now</button>\n </div>\n <button\n v-if=\"clearable && modelValue\"\n type=\"button\"\n class=\"mint-datetime-picker__footer-btn mint-datetime-picker__footer-btn--muted\"\n @click=\"clear\"\n >\n Clear\n </button>\n </div>\n </div>\n </Transition>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Combined date and time picker with a dropdown calendar, time slots, and 12/24 h format support. */\nimport { computed, ref, watch, nextTick, useTemplateRef } from 'vue'\nimport { useCalendarGrid, type CalendarGridDay } from '../composables/useCalendarGrid'\nimport { useDropdownState } from '../composables/useDropdownState'\nimport { useFocusTrap } from '../composables/useFocusTrap'\nimport { formatTime, formatTimeSlot, generateTimeSlots, toMinutes } from '../composables/useTimeUtils'\nimport CalendarGridPanelInternal from './internal/CalendarGridPanelInternal.vue'\n\ninterface Props {\n modelValue?: string\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n min?: string\n max?: string\n timeStep?: number\n timeFormat?: '12h' | '24h'\n clearable?: boolean\n locale?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n placeholder: 'Select date & time',\n disabled: false,\n error: false,\n size: 'md',\n timeStep: 15,\n timeFormat: '24h',\n clearable: false,\n locale: 'en-US',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | undefined]\n}>()\n\nconst dropdownRef = ref<HTMLElement | null>(null)\nconst { isOpen, open, close, toggle } = useDropdownState({\n rootRef: useTemplateRef<HTMLElement>('root'),\n triggerRef: useTemplateRef<HTMLElement>('trigger'),\n})\n// Non-modal dialog: Tab stays inside the panel, focus returns to the input on close.\nuseFocusTrap({ containerRef: dropdownRef, active: isOpen })\nconst {\n weekDays,\n monthYear,\n calendarDays,\n formatDateValue,\n setCurrentMonthFromDate,\n prevMonth,\n nextMonth,\n} = useCalendarGrid({\n min: () => props.min,\n max: () => props.max,\n locale: () => props.locale,\n})\n\n// Parse model value into date and time parts\nconst selectedDate = computed(() => {\n if (!props.modelValue) return null\n const d = new Date(props.modelValue)\n return isNaN(d.getTime()) ? null : d\n})\n\nconst selectedDateStr = computed(() => {\n if (!selectedDate.value) return null\n return formatDateValue(selectedDate.value)\n})\n\nconst selectedTimeStr = computed(() => {\n if (!selectedDate.value) return null\n return formatTime(selectedDate.value.getHours(), selectedDate.value.getMinutes())\n})\n\nconst displayValue = computed(() => {\n if (!selectedDate.value) return ''\n const dateStr = selectedDate.value.toLocaleDateString(props.locale, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n })\n const timeStr = formatTime(\n selectedDate.value.getHours(),\n selectedDate.value.getMinutes(),\n props.timeFormat,\n )\n return `${dateStr} ${timeStr}`\n})\n\n// Time slots\nconst timeSlots = computed(() => {\n return generateTimeSlots('00:00', '23:59', props.timeStep)\n})\n\nfunction isTimeDisabled(time: string): boolean {\n if (!selectedDateStr.value) return false\n const timeMinutes = toMinutes(time)\n\n if (props.min) {\n const minDate = new Date(props.min)\n if (selectedDateStr.value === formatDateValue(minDate)) {\n const minMin = minDate.getHours() * 60 + minDate.getMinutes()\n if (timeMinutes < minMin) return true\n }\n }\n if (props.max) {\n const maxDate = new Date(props.max)\n if (selectedDateStr.value === formatDateValue(maxDate)) {\n const maxMin = maxDate.getHours() * 60 + maxDate.getMinutes()\n if (timeMinutes > maxMin) return true\n }\n }\n return false\n}\n\nfunction selectDate(day: CalendarGridDay) {\n if (day.isDisabled || props.disabled) return\n const dateStr = formatDateValue(day.date)\n const timeStr = selectedTimeStr.value || '09:00'\n emit('update:modelValue', `${dateStr}T${timeStr}`)\n}\n\nfunction selectTime(time: string) {\n if (isTimeDisabled(time)) return\n const dateStr = selectedDateStr.value || formatDateValue(new Date())\n emit('update:modelValue', `${dateStr}T${time}`)\n}\n\nfunction goToNow() {\n const now = new Date()\n setCurrentMonthFromDate(now)\n const dateStr = formatDateValue(now)\n const timeStr = formatTime(now.getHours(), now.getMinutes())\n emit('update:modelValue', `${dateStr}T${timeStr}`)\n close()\n}\n\nfunction goToToday() {\n const today = new Date()\n setCurrentMonthFromDate(today)\n const dateStr = formatDateValue(today)\n const timeStr = selectedTimeStr.value || '09:00'\n emit('update:modelValue', `${dateStr}T${timeStr}`)\n}\n\nfunction clear() {\n emit('update:modelValue', undefined)\n close()\n}\n\nfunction toggleDropdown() {\n if (props.disabled) return\n toggle()\n}\n\nfunction handleTriggerKeydown(event: KeyboardEvent) {\n if (props.disabled || isOpen.value) return\n if (event.key === 'Enter' || event.key === ' ' || event.key === 'ArrowDown') {\n event.preventDefault()\n open()\n }\n}\n\n/** Moves focus into the calendar grid: selected day, else today, else the first day. */\nfunction focusCalendar() {\n const panel = dropdownRef.value\n if (!panel) return\n const target =\n panel.querySelector<HTMLElement>('.mint-date-picker__day--selected') ??\n panel.querySelector<HTMLElement>('.mint-date-picker__day--today') ??\n panel.querySelector<HTMLElement>('.mint-date-picker__day:not([disabled])')\n target?.focus()\n}\n\nwatch(isOpen, async (opened) => {\n if (!opened) return\n if (selectedDate.value) {\n setCurrentMonthFromDate(selectedDate.value)\n }\n await nextTick()\n if (selectedDate.value) {\n // Scroll time grid to selected time\n const grid = dropdownRef.value?.querySelector('.mint-datetime-picker__time-grid')\n const active = dropdownRef.value?.querySelector('.mint-datetime-picker__time-chip--active')\n if (grid && active) {\n active.scrollIntoView({ block: 'center' })\n }\n }\n // A second tick so this focus lands after the focus trap's initial focus.\n await nextTick()\n focusCalendar()\n})\n</script>\n\n<template>\n <div ref=\"root\" class=\"mint-datetime-picker\">\n <div class=\"mint-datetime-picker__input-wrapper\">\n <div class=\"mint-datetime-picker__icon-calendar\">\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z\" />\n </svg>\n </div>\n <input\n ref=\"trigger\"\n type=\"text\"\n readonly\n aria-haspopup=\"dialog\"\n :aria-expanded=\"isOpen\"\n :value=\"displayValue\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :class=\"[\n 'mint-datetime-picker__input',\n `mint-datetime-picker__input--${size}`,\n error ? 'mint-datetime-picker__input--error' : '',\n disabled ? 'mint-datetime-picker__input--disabled' : '',\n ]\"\n aria-label=\"Select date and time\"\n @click=\"toggleDropdown\"\n @keydown=\"handleTriggerKeydown\"\n />\n <div class=\"mint-datetime-picker__icon-clock\">\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z\" />\n </svg>\n </div>\n </div>\n\n <Transition\n enter-active-class=\"mint-datetime-picker__dropdown-enter-active\"\n enter-from-class=\"mint-datetime-picker__dropdown-enter-from\"\n enter-to-class=\"mint-datetime-picker__dropdown-enter-to\"\n leave-active-class=\"mint-datetime-picker__dropdown-leave-active\"\n leave-from-class=\"mint-datetime-picker__dropdown-leave-from\"\n leave-to-class=\"mint-datetime-picker__dropdown-leave-to\"\n >\n <div\n v-if=\"isOpen\"\n ref=\"dropdownRef\"\n class=\"mint-popover mint-datetime-picker__dropdown\"\n role=\"dialog\"\n aria-label=\"Date and time picker\"\n >\n <!-- Calendar section -->\n <div class=\"mint-datetime-picker__calendar-section\">\n <CalendarGridPanelInternal\n :week-days=\"weekDays\"\n :month-year=\"monthYear\"\n :days=\"calendarDays\"\n :selected-date=\"selectedDate\"\n :locale=\"locale\"\n @previous-month=\"prevMonth\"\n @next-month=\"nextMonth\"\n @select=\"selectDate\"\n />\n </div>\n\n <!-- Divider -->\n <div class=\"mint-datetime-picker__divider\" />\n\n <!-- Time section -->\n <div class=\"mint-datetime-picker__time-section\">\n <div class=\"mint-datetime-picker__time-label\">Time</div>\n <div class=\"mint-datetime-picker__time-grid\">\n <button\n v-for=\"time in timeSlots\"\n :key=\"time\"\n type=\"button\"\n :disabled=\"isTimeDisabled(time)\"\n :class=\"[\n 'mint-datetime-picker__time-chip',\n selectedTimeStr === time ? 'mint-datetime-picker__time-chip--active' : '',\n isTimeDisabled(time) ? 'mint-datetime-picker__time-chip--disabled' : '',\n ]\"\n @click=\"selectTime(time)\"\n >\n {{ formatTimeSlot(time, timeFormat) }}\n </button>\n </div>\n </div>\n\n <!-- Footer -->\n <div class=\"mint-datetime-picker__footer\">\n <div>\n <button type=\"button\" class=\"mint-datetime-picker__footer-btn\" @click=\"goToToday\">Today</button>\n <button type=\"button\" class=\"mint-datetime-picker__footer-btn\" @click=\"goToNow\">Now</button>\n </div>\n <button\n v-if=\"clearable && modelValue\"\n type=\"button\"\n class=\"mint-datetime-picker__footer-btn mint-datetime-picker__footer-btn--muted\"\n @click=\"clear\"\n >\n Clear\n </button>\n </div>\n </div>\n </Transition>\n </div>\n</template>\n","import {\n getCurrentInstance,\n getCurrentScope,\n onMounted,\n onScopeDispose,\n ref,\n shallowRef,\n type Ref,\n} from 'vue'\nimport { tryUseSettingsStore } from '../stores/settings'\n\nexport type EventStreamTransport = (\n input: RequestInfo | URL,\n init?: RequestInit,\n) => Promise<Response>\n\nexport interface EventStreamMessage<TData = string> {\n event: string\n data: TData\n id?: string\n retry?: number\n raw: string\n}\n\nexport interface EventStreamOptions<TData = string> {\n transport?: EventStreamTransport\n headers?: HeadersInit\n credentials?: RequestCredentials\n immediate?: boolean\n /**\n * Reconnect after a dropped stream. Left unset, it follows the platform's\n * `wsAutoReconnect` setting, defaulting to `true` without a settings store.\n */\n reconnect?: boolean\n /**\n * Delay before the first reconnect attempt. Left unset, it follows the\n * platform's `wsReconnectInterval` setting, defaulting to 2000 ms without a\n * settings store. A server-sent `retry:` field still overrides it.\n */\n reconnectDelayMs?: number\n parseJson?: boolean\n shouldReconnect?: (cause?: unknown) => boolean\n onOpen?: () => void\n onMessage?: (message: EventStreamMessage<TData>) => void\n onError?: (cause: unknown) => void\n onClose?: (cause?: unknown) => void\n errorLabel?: string\n}\n\nexport interface UseEventStreamReturn<TData = string> {\n isConnected: Ref<boolean>\n isConnecting: Ref<boolean>\n error: Ref<string | null>\n lastMessage: Ref<EventStreamMessage<TData> | null>\n lastEventId: Ref<string | null>\n start: () => void\n stop: () => void\n}\n\ninterface ParsedEventStreamBlock<TData> {\n message?: EventStreamMessage<TData>\n id?: string\n retry?: number\n}\n\nclass EventStreamResponseError extends Error {\n constructor(readonly response: Response, label: string) {\n super(`${label} failed with HTTP ${response.status}`)\n this.name = 'EventStreamResponseError'\n }\n}\n\n/** Parse one complete SSE block without owning connection policy. */\nexport function parseEventStreamBlock<TData>(\n block: string,\n parseJson: boolean,\n): ParsedEventStreamBlock<TData> | null {\n let event = 'message'\n let id: string | undefined\n let retry: number | undefined\n const dataLines: string[] = []\n\n for (const line of block.split(/\\r\\n|\\r|\\n/)) {\n if (!line || line.startsWith(':')) continue\n const separator = line.indexOf(':')\n const field = separator === -1 ? line : line.slice(0, separator)\n const value = separator === -1\n ? ''\n : line.slice(separator + 1).replace(/^ /, '')\n\n if (field === 'event') event = value || 'message'\n if (field === 'data') dataLines.push(value)\n if (field === 'id' && !value.includes('\\0')) id = value\n if (field === 'retry' && /^\\d+$/.test(value)) retry = Number(value)\n }\n\n if (!dataLines.length && id === undefined && retry === undefined) return null\n const data = dataLines.join('\\n')\n return {\n message: dataLines.length\n ? {\n event,\n data: (parseJson && data ? JSON.parse(data) : data) as TData,\n id,\n retry,\n raw: block,\n }\n : undefined,\n id,\n retry,\n }\n}\n\n/** Shared fetch-based SSE lifecycle with cancellation and reconnect safety. */\nexport function useEventStream<TData = string>(\n url: string | (() => string),\n options: EventStreamOptions<TData> = {},\n): UseEventStreamReturn<TData> {\n const isConnected = ref(false)\n const isConnecting = ref(false)\n const error = ref<string | null>(null)\n const lastMessage = shallowRef<EventStreamMessage<TData> | null>(null)\n const lastEventId = ref<string | null>(null)\n let controller: AbortController | null = null\n let reader: ReadableStreamDefaultReader<Uint8Array> | null = null\n let reconnectTimer: ReturnType<typeof setTimeout> | null = null\n const settings = tryUseSettingsStore()\n const reconnectEnabled = options.reconnect ?? settings?.wsAutoReconnect ?? true\n let reconnectDelayMs = options.reconnectDelayMs ?? settings?.wsReconnectInterval ?? 2_000\n let stopped = true\n let generation = 0\n\n function clearReconnectTimer(): void {\n if (reconnectTimer === null) return\n clearTimeout(reconnectTimer)\n reconnectTimer = null\n }\n\n function ownsConnection(\n connectionGeneration: number,\n connectionController: AbortController,\n ): boolean {\n return !stopped\n && generation === connectionGeneration\n && controller === connectionController\n }\n\n function scheduleReconnect(connectionGeneration: number, cause?: unknown): void {\n if (stopped || generation !== connectionGeneration) return\n if (!reconnectEnabled || options.shouldReconnect?.(cause) === false) {\n stopped = true\n return\n }\n clearReconnectTimer()\n reconnectTimer = setTimeout(() => {\n reconnectTimer = null\n if (stopped || generation !== connectionGeneration) return\n void connect(connectionGeneration)\n }, reconnectDelayMs)\n }\n\n function dispatchBlock(\n block: string,\n connectionGeneration: number,\n connectionController: AbortController,\n ): void {\n const parsed = parseEventStreamBlock<TData>(block, options.parseJson ?? false)\n if (!parsed || !ownsConnection(connectionGeneration, connectionController)) return\n if (parsed.id !== undefined) {\n lastEventId.value = parsed.id\n if (!ownsConnection(connectionGeneration, connectionController)) return\n }\n if (parsed.retry !== undefined) reconnectDelayMs = parsed.retry\n const message = parsed.message\n if (!message || !ownsConnection(connectionGeneration, connectionController)) return\n lastMessage.value = message\n if (!ownsConnection(connectionGeneration, connectionController)) return\n options.onMessage?.(message)\n }\n\n async function consume(\n body: ReadableStream<Uint8Array>,\n connectionGeneration: number,\n connectionController: AbortController,\n ): Promise<void> {\n const connectionReader = body.getReader()\n reader = connectionReader\n const decoder = new TextDecoder()\n let buffer = ''\n try {\n for (;;) {\n const { value, done } = await connectionReader.read()\n if (!ownsConnection(connectionGeneration, connectionController)) return\n buffer += decoder.decode(value, { stream: !done })\n\n let boundary = /(?:\\r\\n|\\r|\\n){2}/.exec(buffer)\n while (boundary?.index !== undefined) {\n const block = buffer.slice(0, boundary.index)\n buffer = buffer.slice(boundary.index + boundary[0].length)\n dispatchBlock(block, connectionGeneration, connectionController)\n if (!ownsConnection(connectionGeneration, connectionController)) return\n boundary = /(?:\\r\\n|\\r|\\n){2}/.exec(buffer)\n }\n\n if (!done) continue\n if (buffer) dispatchBlock(buffer, connectionGeneration, connectionController)\n return\n }\n } finally {\n if (reader === connectionReader) reader = null\n connectionReader.releaseLock()\n }\n }\n\n async function connect(connectionGeneration: number): Promise<void> {\n if (stopped || generation !== connectionGeneration) return\n controller?.abort()\n const connectionController = new AbortController()\n controller = connectionController\n isConnecting.value = true\n if (!ownsConnection(connectionGeneration, connectionController)) return\n error.value = null\n if (!ownsConnection(connectionGeneration, connectionController)) return\n\n let cause: unknown\n try {\n const headers = new Headers(options.headers)\n headers.set('Accept', 'text/event-stream')\n if (lastEventId.value && !headers.has('Last-Event-ID')) {\n headers.set('Last-Event-ID', lastEventId.value)\n }\n const transport = options.transport ?? globalThis.fetch?.bind(globalThis)\n if (!transport) throw new Error('[MINT SDK] fetch is required for event streams.')\n const response = await transport(typeof url === 'function' ? url() : url, {\n method: 'GET',\n headers,\n credentials: options.credentials ?? 'same-origin',\n signal: connectionController.signal,\n })\n if (!ownsConnection(connectionGeneration, connectionController)) return\n if (!response.ok) {\n throw new EventStreamResponseError(response, options.errorLabel ?? 'Event stream')\n }\n if (!response.body) {\n throw new Error(`${options.errorLabel ?? 'Event stream'} response did not include a readable body.`)\n }\n\n isConnected.value = true\n if (!ownsConnection(connectionGeneration, connectionController)) return\n isConnecting.value = false\n if (!ownsConnection(connectionGeneration, connectionController)) return\n options.onOpen?.()\n if (!ownsConnection(connectionGeneration, connectionController)) return\n await consume(response.body, connectionGeneration, connectionController)\n } catch (errorCause) {\n cause = errorCause\n if (\n ownsConnection(connectionGeneration, connectionController)\n && !isAbortError(errorCause)\n ) {\n error.value = errorCause instanceof Error\n ? errorCause.message\n : `${options.errorLabel ?? 'Event stream'} failed`\n if (ownsConnection(connectionGeneration, connectionController)) {\n options.onError?.(errorCause)\n }\n }\n } finally {\n if (ownsConnection(connectionGeneration, connectionController)) {\n isConnecting.value = false\n if (!ownsConnection(connectionGeneration, connectionController)) return\n isConnected.value = false\n if (!ownsConnection(connectionGeneration, connectionController)) return\n controller = null\n options.onClose?.(cause)\n if (!stopped && generation === connectionGeneration) {\n scheduleReconnect(connectionGeneration, cause)\n }\n }\n }\n }\n\n function start(): void {\n if (!stopped) return\n stopped = false\n clearReconnectTimer()\n generation += 1\n void connect(generation)\n }\n\n function stop(): void {\n if (stopped) return\n stopped = true\n generation += 1\n clearReconnectTimer()\n controller?.abort()\n controller = null\n if (reader) void reader.cancel().catch(() => undefined)\n reader = null\n isConnecting.value = false\n isConnected.value = false\n }\n\n const currentInstance = getCurrentInstance()\n if (currentInstance && options.immediate !== false && typeof window === 'undefined') {\n onMounted(start)\n }\n if (getCurrentScope()) onScopeDispose(stop)\n if (options.immediate !== false && (typeof window !== 'undefined' || !currentInstance)) {\n start()\n }\n\n return {\n isConnected,\n isConnecting,\n error,\n lastMessage,\n lastEventId,\n start,\n stop,\n }\n}\n\nfunction isAbortError(cause: unknown): boolean {\n return cause instanceof DOMException && cause.name === 'AbortError'\n}\n","import type { JobState, JobStateInput, JobStatus } from './types/jobs'\n\nconst ACTIVE_JOB_STATUSES = new Set<JobStatus>([\n 'awaiting_input',\n 'queued',\n 'running',\n])\nconst TERMINAL_JOB_STATUSES = new Set<JobStatus>([\n 'completed',\n 'failed',\n 'cancelled',\n])\n\nexport interface JobCapabilityInput {\n status: string\n can_cancel?: boolean | null\n can_delete?: boolean | null\n}\n\nexport interface JobCapabilities {\n can_cancel: boolean\n can_delete: boolean\n}\n\n/** Resolve action support while retaining one-cycle legacy status inference. */\nexport function resolveJobCapabilities(job: JobCapabilityInput): JobCapabilities {\n const legacyCanCancel = job.status === 'queued' || job.status === 'running'\n const legacyCanDelete = TERMINAL_JOB_STATUSES.has(job.status as JobStatus)\n return {\n can_cancel: typeof job.can_cancel === 'boolean' ? job.can_cancel : legacyCanCancel,\n can_delete: typeof job.can_delete === 'boolean' ? job.can_delete : legacyCanDelete,\n }\n}\n\n/** Clamp invalid or out-of-range progress values for safe display. */\nexport function normalizeJobPercent(value: number): number {\n if (!Number.isFinite(value)) return 0\n return Math.min(100, Math.max(0, value))\n}\n\n/** Create a detached canonical state without changing the transport input. */\nexport function normalizeJobState(job: JobStateInput): JobState {\n const capabilities = resolveJobCapabilities(job)\n return {\n ...job,\n definition_id: job.definition_id\n ?? (typeof job.metadata.definition_id === 'string' ? job.metadata.definition_id : null),\n result_status: job.result_status\n ?? (job.status === 'completed' && job.metadata.has_result === true ? 'available' : 'none'),\n result_expires_at: job.result_expires_at ?? null,\n progress: {\n ...job.progress,\n percent: normalizeJobPercent(job.progress.percent),\n },\n warnings: [...job.warnings],\n folders: [...job.folders],\n metadata: { ...job.metadata },\n ...capabilities,\n }\n}\n\nexport function isActiveJobStatus(status: JobStatus): boolean {\n return ACTIVE_JOB_STATUSES.has(status)\n}\n\nexport function isTerminalJobStatus(status: JobStatus): boolean {\n return TERMINAL_JOB_STATUSES.has(status)\n}\n\nexport function jobStatusLabel(status: JobStatus): string {\n const labels: Record<JobStatus, string> = {\n awaiting_input: 'Waiting for input',\n queued: 'Queued',\n running: 'Running',\n completed: 'Completed',\n failed: 'Failed',\n cancelled: 'Cancelled',\n }\n return labels[status]\n}\n","import {\n computed,\n onScopeDispose,\n ref,\n shallowRef,\n type ComputedRef,\n type Ref,\n type ShallowRef,\n} from 'vue'\n\nimport type {\n JobsStatusTrayAdapter,\n PluginJobCenterSource,\n} from './useJobsStatusTray'\nimport { useEventStream, type EventStreamMessage } from './useEventStream'\nimport { isActiveJobStatus, normalizeJobState } from '../jobs'\nimport { MintApiError, mintApiErrorFromResponse } from '../apiErrors'\nimport type {\n GeneratedAnalysisJob,\n GeneratedAnalysisJobInput,\n GeneratedAnalysisResult,\n GeneratedSession,\n GeneratedAnalysisManifest,\n PluginJobArtifactPathInput,\n PluginJobPathInput,\n PluginJobPathUpload,\n PluginJobStagedPartInput,\n PluginJobStagedPartUploadResult,\n PluginJobStaging,\n PluginJobStagingPagination,\n} from '../types/generated-ui'\n\nexport type GeneratedAnalysisTransport = (\n input: RequestInfo | URL,\n init?: RequestInit,\n) => Promise<Response>\n\nexport interface GeneratedAnalysisTransportOptions {\n fetcher?: typeof fetch\n getAccessToken?: () => string | null | undefined\n}\n\nexport interface UsePluginJobsOptions {\n baseUrl: string\n transport?: GeneratedAnalysisTransport\n storage?: Storage\n createId?: () => string\n pollInterval?: number\n stream?: boolean\n streamReconnectDelay?: number\n immediate?: boolean\n}\n\nexport type GeneratedAnalysisOptions = UsePluginJobsOptions\n\nexport interface PluginJobWaitOptions {\n signal?: AbortSignal\n rejectOnFailure?: boolean\n}\n\nexport interface PluginJobRequestOptions {\n signal?: AbortSignal\n}\n\ninterface GeneratedSessionStorage {\n getItem: (key: string) => string | null\n setItem: (key: string, value: string) => void\n}\n\nexport interface UsePluginJobsReturn extends PluginJobCenterSource {\n manifest: ShallowRef<GeneratedAnalysisManifest | null>\n session: ShallowRef<GeneratedSession | null>\n jobs: ShallowRef<GeneratedAnalysisJob[]>\n latestResult: ComputedRef<GeneratedAnalysisResult | null>\n isLoading: Ref<boolean>\n isSubmitting: Ref<boolean>\n error: ShallowRef<string | null>\n status: ShallowRef<'idle' | 'initializing' | 'ready' | 'paused' | 'error' | 'disposed'>\n initialize: () => Promise<void>\n ready: () => Promise<void>\n uploadPath: (\n input: PluginJobPathInput,\n definitionId?: string,\n ) => Promise<PluginJobPathUpload>\n uploadStagedPart: <Metadata>(\n input: PluginJobStagedPartInput<Metadata>,\n ) => Promise<PluginJobStagedPartUploadResult<Metadata>>\n getJobStaging: <Metadata = unknown>(\n job: GeneratedAnalysisJob | string,\n pagination?: PluginJobStagingPagination,\n ) => Promise<PluginJobStaging<Metadata>>\n sealJob: (job: GeneratedAnalysisJob | string) => Promise<GeneratedAnalysisJob>\n submit: (definitionId: string, inputs: Record<string, unknown>) => Promise<GeneratedAnalysisJob>\n loadResult: (job: GeneratedAnalysisJob) => Promise<GeneratedAnalysisResult | null>\n resultForJob: (jobId: string) => GeneratedAnalysisResult | null\n refreshJobs: () => Promise<GeneratedAnalysisJob[]>\n refresh: () => Promise<GeneratedAnalysisJob[]>\n getJob: (jobId: string, options?: PluginJobRequestOptions) => Promise<GeneratedAnalysisJob>\n waitForJob: (\n job: GeneratedAnalysisJob | string,\n options?: PluginJobWaitOptions,\n ) => Promise<GeneratedAnalysisJob>\n jobsFor: (definitionId: string) => GeneratedAnalysisJob[]\n cancelJob: (job: GeneratedAnalysisJob | string) => Promise<GeneratedAnalysisJob>\n deleteJob: (job: GeneratedAnalysisJob | string) => Promise<boolean>\n clearFinishedJobs: (definitionId?: string) => Promise<number>\n pause: () => void\n resume: () => void\n dispose: () => void\n /** @deprecated Pass the runtime itself to SDK job UI as its source. */\n jobsAdapter: JobsStatusTrayAdapter\n}\n\nexport type UseGeneratedAnalysisReturn = UsePluginJobsReturn\n\nconst AUTH_TOKEN_KEY = 'mint-auth-token'\nconst SESSION_NOT_FOUND_DETAIL = 'Session not found'\nconst MAX_RESULT_CACHE_ENTRIES = 32\nconst MAX_RESULT_RETRIES = 3\nconst DOWNLOAD_URL_REFRESH_SKEW_MS = 30_000\n\ninterface PluginJobWaiter {\n resolve: (job: GeneratedAnalysisJob) => void\n reject: (cause: unknown) => void\n rejectOnFailure: boolean\n signal?: AbortSignal\n abort?: () => void\n}\n\ntype PluginJobStreamData = GeneratedAnalysisJobInput | {\n jobs: GeneratedAnalysisJobInput[]\n}\n\nexport function createGeneratedAnalysisTransport(\n options: GeneratedAnalysisTransportOptions = {},\n): GeneratedAnalysisTransport {\n const fetcher = options.fetcher ?? globalThis.fetch.bind(globalThis)\n const getAccessToken = options.getAccessToken ?? readStoredAccessToken\n\n return async (input, init = {}) => {\n const headers = new Headers(init.headers)\n const accessToken = getAccessToken()\n if (accessToken && !headers.has('Authorization')) {\n headers.set('Authorization', `Bearer ${accessToken}`)\n }\n return await fetcher(input, {\n credentials: 'same-origin',\n ...init,\n headers,\n })\n }\n}\n\nexport function useGeneratedAnalysis(\n options: GeneratedAnalysisOptions,\n): UseGeneratedAnalysisReturn {\n return createPluginJobs(options, '/generated/manifest')\n}\n\n/**\n * Connect a custom plugin frontend to the SDK-owned job lifecycle.\n *\n * @example Recommended\n * ```ts\n * const jobs = usePluginJobs({ baseUrl: '/api/leaf/jobs' })\n * await jobs.initialize()\n * ```\n */\nexport function usePluginJobs(\n options: UsePluginJobsOptions,\n): UsePluginJobsReturn {\n return createPluginJobs(options)\n}\n\nfunction createPluginJobs(\n options: UsePluginJobsOptions,\n manifestPath?: string,\n): UsePluginJobsReturn {\n const baseUrl = options.baseUrl.replace(/\\/$/, '')\n const transport = options.transport ?? createGeneratedAnalysisTransport()\n const storage = createGeneratedSessionStorage(options.storage)\n const createId = options.createId ?? (() => globalThis.crypto.randomUUID())\n const pollInterval = options.pollInterval ?? 750\n const streamEnabled = options.stream ?? true\n const streamReconnectDelay = options.streamReconnectDelay ?? 1_500\n const tabKey = `mint:generated:${baseUrl}:tab`\n const sessionKey = `mint:generated:${baseUrl}:session`\n const manifest = shallowRef<GeneratedAnalysisManifest | null>(null)\n const session = shallowRef<GeneratedSession | null>(null)\n const jobs = shallowRef<GeneratedAnalysisJob[]>([])\n const jobRevisions = new Map<string, number>()\n const pendingJobOperations = new Map<string, number>()\n const resultCache = shallowRef<Record<string, GeneratedAnalysisResult>>({})\n const isLoading = ref(false)\n const isSubmitting = ref(false)\n const error = shallowRef<string | null>(null)\n const status = shallowRef<'idle' | 'initializing' | 'ready' | 'paused' | 'error' | 'disposed'>('idle')\n let pollTimer: ReturnType<typeof setTimeout> | undefined\n let disposed = false\n let paused = false\n let initialized = false\n let initializePromise: Promise<void> | undefined\n let refreshPromise: Promise<GeneratedAnalysisJob[]> | undefined\n let initializeRefreshPromise: Promise<GeneratedAnalysisJob[]> | undefined\n let jobsRevision = 0\n let resultCacheOrder: string[] = []\n const resultRequests = new Map<string, Promise<GeneratedAnalysisResult | null>>()\n const jobWaiters = new Map<string, Set<PluginJobWaiter>>()\n const resultRetryAttempts = new Map<string, number>()\n const resultRetryTimers = new Map<string, ReturnType<typeof setTimeout>>()\n const downloadRefreshTimers = new Map<string, ReturnType<typeof setTimeout>>()\n const jobStream = useEventStream<PluginJobStreamData>(`${baseUrl}/jobs/events`, {\n transport,\n immediate: false,\n reconnectDelayMs: streamReconnectDelay,\n parseJson: true,\n errorLabel: 'Job stream',\n onOpen: clearPoll,\n onMessage: applyJobStreamMessage,\n onError: schedulePollForActiveJobs,\n onClose: schedulePollForActiveJobs,\n })\n\n const latestResult = computed<GeneratedAnalysisResult | null>(() => {\n const job = currentCompletedJob()\n return job ? resultForJob(job.job_id) : null\n })\n\n function initialize(): Promise<void> {\n if (disposed) return Promise.reject(new Error('Plugin jobs runtime is disposed'))\n if (initialized) return Promise.resolve()\n if (initializePromise) return initializePromise\n isLoading.value = true\n error.value = null\n status.value = 'initializing'\n const pending = (async () => {\n if (manifestPath) {\n const loadedManifest = await request<GeneratedAnalysisManifest>(manifestPath, { method: 'GET' })\n if (!disposed) manifest.value = loadedManifest\n }\n const resolvedSession = await resolveSession()\n if (disposed) return\n session.value = resolvedSession\n await refreshJobs()\n if (disposed) return\n initialized = true\n status.value = paused ? 'paused' : 'ready'\n if (streamEnabled && !paused) jobStream.start()\n })().catch((cause: unknown) => {\n if (!disposed) {\n error.value = errorMessage(cause, 'Failed to initialize generated analysis')\n status.value = 'error'\n }\n throw cause\n }).finally(() => {\n if (initializePromise === pending) initializePromise = undefined\n if (!disposed) isLoading.value = false\n })\n initializePromise = pending\n return pending\n }\n\n async function resolveSession(): Promise<GeneratedSession> {\n let tabId = storage.getItem(tabKey)\n if (!tabId) {\n tabId = createId()\n storage.setItem(tabKey, tabId)\n }\n const storedSessionId = storage.getItem(sessionKey)\n const payload = await request<{ sessions: GeneratedSession[] }>('/jobs/sessions', { method: 'GET' })\n const existing = payload.sessions.find(candidate => (\n candidate.id === storedSessionId && candidate.tab_id === tabId\n ))\n if (existing) return existing\n const created = await request<GeneratedSession>('/jobs/sessions', {\n method: 'POST',\n body: JSON.stringify({ tab_id: tabId }),\n })\n storage.setItem(sessionKey, created.id)\n return created\n }\n\n async function submit(\n definitionId: string,\n inputs: Record<string, unknown>,\n ): Promise<GeneratedAnalysisJob> {\n if (!session.value) throw new Error('Generated analysis session is not initialized')\n const clientRequestId = createId()\n isSubmitting.value = true\n error.value = null\n try {\n let jobInput: GeneratedAnalysisJobInput\n try {\n jobInput = await submitToSession(\n session.value.id,\n clientRequestId,\n await stagePathInputs(inputs, session.value.id, definitionId),\n )\n } catch (cause) {\n if (!isSessionNotFoundError(cause)) throw cause\n session.value = await resolveSession()\n jobInput = await submitToSession(\n session.value.id,\n clientRequestId,\n await stagePathInputs(inputs, session.value.id, definitionId),\n )\n }\n const job = upsertJob(jobInput, definitionId)\n if (!jobStream.isConnected.value) schedulePoll()\n return job\n } catch (cause) {\n error.value = errorMessage(cause, 'Failed to submit analysis')\n throw cause\n } finally {\n isSubmitting.value = false\n }\n\n function submitToSession(\n sessionId: string,\n requestId: string,\n stagedInputs: Record<string, unknown>,\n ): Promise<GeneratedAnalysisJobInput> {\n return request<GeneratedAnalysisJobInput>('/jobs', {\n method: 'POST',\n body: JSON.stringify({\n definition_id: definitionId,\n inputs: stagedInputs,\n session_id: sessionId,\n client_request_id: requestId,\n }),\n })\n }\n }\n\n async function uploadPath(\n input: PluginJobPathInput,\n definitionId?: string,\n ): Promise<PluginJobPathUpload> {\n if (!session.value) throw new Error('Generated analysis session is not initialized')\n return uploadPathForSession(input, session.value.id, definitionId)\n }\n\n async function uploadStagedPart<Metadata>(\n input: PluginJobStagedPartInput<Metadata>,\n ): Promise<PluginJobStagedPartUploadResult<Metadata>> {\n const jobId = jobIdFromReference(input.job)\n const body = new FormData()\n body.append('file', input.file)\n body.append('metadata', JSON.stringify(input.metadata))\n if (input.expectedSize !== undefined) {\n body.append('expected_size', String(input.expectedSize))\n }\n if (input.expectedSha256 !== undefined) {\n body.append('expected_sha256', input.expectedSha256)\n }\n return request<PluginJobStagedPartUploadResult<Metadata>>(\n `/jobs/${encodeURIComponent(jobId)}/parts/${encodeStagedPartKey(input.key)}`,\n { method: 'PUT', body, signal: input.signal },\n )\n }\n\n function getJobStaging<Metadata = unknown>(\n job: GeneratedAnalysisJob | string,\n pagination: PluginJobStagingPagination = {},\n ): Promise<PluginJobStaging<Metadata>> {\n const jobId = jobIdFromReference(job)\n const query = new URLSearchParams()\n if (pagination.offset !== undefined) query.set('offset', String(pagination.offset))\n if (pagination.limit !== undefined) query.set('limit', String(pagination.limit))\n const suffix = query.size > 0 ? `?${query}` : ''\n return request<PluginJobStaging<Metadata>>(\n `/jobs/${encodeURIComponent(jobId)}/staging${suffix}`,\n { method: 'GET' },\n )\n }\n\n async function sealJob(\n job: GeneratedAnalysisJob | string,\n ): Promise<GeneratedAnalysisJob> {\n const jobId = jobIdFromReference(job)\n const revision = beginJobOperation(jobId)\n try {\n const updated = await request<GeneratedAnalysisJobInput>(\n `/jobs/${encodeURIComponent(jobId)}/seal`,\n { method: 'POST' },\n )\n return mergeJobResponse(updated, revision)\n } finally {\n finishJobOperation(jobId)\n }\n }\n\n async function uploadPathForSession(\n input: PluginJobPathInput,\n sessionId: string,\n definitionId?: string,\n ): Promise<PluginJobPathUpload> {\n if (!input.files.length || input.files.length !== input.relativePaths.length) {\n throw new Error('Path upload requires one relative path for each file')\n }\n const body = new FormData()\n body.append('session_id', sessionId)\n if (input.rootName) body.append('root_name', input.rootName)\n for (let index = 0; index < input.files.length; index += 1) {\n body.append('files', input.files[index]!)\n body.append('relative_paths', input.relativePaths[index]!)\n }\n const headers: Record<string, string> = {\n 'X-Mint-Job-Session': sessionId,\n }\n if (definitionId) headers['X-Mint-Job-Definition'] = definitionId\n return request<PluginJobPathUpload>('/jobs/uploads', {\n method: 'POST',\n body,\n signal: input.signal,\n headers,\n })\n }\n\n async function stageArtifactPathForSession(\n input: PluginJobArtifactPathInput,\n sessionId: string,\n definitionId: string,\n ): Promise<PluginJobPathUpload> {\n return request<PluginJobPathUpload>('/jobs/artifacts', {\n method: 'POST',\n body: JSON.stringify({\n experiment_id: input.experimentId,\n artifact_id: input.artifactId,\n session_id: sessionId,\n }),\n signal: input.signal,\n headers: {\n 'X-Mint-Job-Session': sessionId,\n 'X-Mint-Job-Definition': definitionId,\n },\n })\n }\n\n async function stagePathInputs(\n inputs: Record<string, unknown>,\n sessionId: string,\n definitionId: string,\n ): Promise<Record<string, unknown>> {\n return await stagePathValue(inputs, sessionId, definitionId) as Record<string, unknown>\n }\n\n async function stagePathValue(\n value: unknown,\n sessionId: string,\n definitionId: string,\n ): Promise<unknown> {\n if (typeof File !== 'undefined' && value instanceof File) {\n const upload = await uploadPathForSession({\n kind: 'path',\n files: [value],\n relativePaths: [value.name],\n }, sessionId, definitionId)\n return { token: upload.token }\n }\n if (isPluginJobPathInput(value)) {\n const upload = await uploadPathForSession(value, sessionId, definitionId)\n return { token: upload.token }\n }\n if (isPluginJobArtifactPathInput(value)) {\n const upload = await stageArtifactPathForSession(value, sessionId, definitionId)\n return { token: upload.token }\n }\n if (Array.isArray(value)) {\n return await Promise.all(value.map(\n item => stagePathValue(item, sessionId, definitionId),\n ))\n }\n if (value && typeof value === 'object') {\n const entries = await Promise.all(Object.entries(value).map(async ([key, child]) => (\n [key, await stagePathValue(child, sessionId, definitionId)] as const\n )))\n return Object.fromEntries(entries)\n }\n return value\n }\n\n function refreshJobs(): Promise<GeneratedAnalysisJob[]> {\n if (disposed) return Promise.resolve(jobs.value)\n if (refreshPromise) return refreshPromise\n const revision = jobsRevision\n const pending = request<{ jobs: GeneratedAnalysisJobInput[] }>('/jobs', { method: 'GET' })\n .then((payload) => {\n if (disposed) return jobs.value\n if (revision !== jobsRevision) {\n if (jobs.value.some(job => isActiveJobStatus(job.status))) schedulePoll()\n return jobs.value\n }\n replaceJobs(payload.jobs)\n error.value = null\n if (!paused && !jobStream.isConnected.value && jobs.value.some(job => isActiveJobStatus(job.status))) {\n schedulePoll()\n }\n return jobs.value\n }).finally(() => {\n if (refreshPromise === pending) refreshPromise = undefined\n })\n refreshPromise = pending\n return pending\n }\n\n function refresh(): Promise<GeneratedAnalysisJob[]> {\n if (disposed) return Promise.resolve(jobs.value)\n if (initialized) return refreshJobs()\n if (initializeRefreshPromise) return initializeRefreshPromise\n const pending = initialize()\n .then(() => jobs.value)\n .finally(() => {\n if (initializeRefreshPromise === pending) initializeRefreshPromise = undefined\n })\n initializeRefreshPromise = pending\n return pending\n }\n\n async function getJob(\n jobId: string,\n options: PluginJobRequestOptions = {},\n ): Promise<GeneratedAnalysisJob> {\n const revision = beginJobOperation(jobId)\n try {\n const job = await request<GeneratedAnalysisJobInput>(\n `/jobs/${encodeURIComponent(jobId)}`,\n { method: 'GET', signal: options.signal },\n )\n return mergeJobResponse(job, revision)\n } finally {\n finishJobOperation(jobId)\n }\n }\n\n function waitForJob(\n job: GeneratedAnalysisJob | string,\n options: PluginJobWaitOptions = {},\n ): Promise<GeneratedAnalysisJob> {\n if (disposed) return Promise.reject(new Error('Plugin jobs runtime is disposed'))\n if (options.signal?.aborted) {\n return Promise.reject(pluginJobWaitAbort(options.signal))\n }\n const jobId = jobIdFromReference(job)\n const current = typeof job === 'string'\n ? jobs.value.find(candidate => candidate.job_id === jobId)\n : jobs.value.find(candidate => candidate.job_id === jobId) ?? job\n if (current && !isActiveJobStatus(current.status)) {\n return terminalWaitResult(current, options.rejectOnFailure === true)\n }\n if (paused) return Promise.reject(new Error('Plugin jobs runtime is paused'))\n return new Promise<GeneratedAnalysisJob>((resolve, reject) => {\n const waiter: PluginJobWaiter = {\n resolve,\n reject,\n rejectOnFailure: options.rejectOnFailure === true,\n signal: options.signal,\n }\n if (options.signal) {\n waiter.abort = () => {\n removeJobWaiter(jobId, waiter)\n reject(pluginJobWaitAbort(options.signal!))\n }\n options.signal.addEventListener('abort', waiter.abort, { once: true })\n }\n const waiting = jobWaiters.get(jobId) ?? new Set<PluginJobWaiter>()\n waiting.add(waiter)\n jobWaiters.set(jobId, waiting)\n if (!paused) {\n if (streamEnabled) jobStream.start()\n if (!jobStream.isConnected.value) schedulePoll()\n }\n void getJob(jobId, { signal: options.signal }).catch((cause: unknown) => {\n if (current && isRetryableJobLookupError(cause)) {\n if (!jobStream.isConnected.value) schedulePoll()\n return\n }\n removeJobWaiter(jobId, waiter)\n reject(cause)\n })\n })\n }\n\n function settleJobWaiters(job: GeneratedAnalysisJob): void {\n if (isActiveJobStatus(job.status)) return\n const waiting = jobWaiters.get(job.job_id)\n if (!waiting) return\n jobWaiters.delete(job.job_id)\n for (const waiter of waiting) {\n if (waiter.abort && waiter.signal) {\n waiter.signal.removeEventListener('abort', waiter.abort)\n }\n void terminalWaitResult(job, waiter.rejectOnFailure).then(\n waiter.resolve,\n waiter.reject,\n )\n }\n }\n\n function rejectJobWaiters(jobId: string, cause: unknown): void {\n const waiting = jobWaiters.get(jobId)\n if (!waiting) return\n jobWaiters.delete(jobId)\n for (const waiter of waiting) {\n if (waiter.abort && waiter.signal) {\n waiter.signal.removeEventListener('abort', waiter.abort)\n }\n waiter.reject(cause)\n }\n }\n\n function removeJobWaiter(jobId: string, waiter: PluginJobWaiter): void {\n const waiting = jobWaiters.get(jobId)\n if (!waiting) return\n waiting.delete(waiter)\n if (waiting.size === 0) jobWaiters.delete(jobId)\n if (waiter.abort && waiter.signal) {\n waiter.signal.removeEventListener('abort', waiter.abort)\n }\n }\n\n function jobsFor(definitionId: string): GeneratedAnalysisJob[] {\n return jobs.value.filter(job => job.definition_id === definitionId)\n }\n\n function canonicalJob(\n input: GeneratedAnalysisJobInput,\n fallbackDefinitionId?: string,\n ): GeneratedAnalysisJob {\n const normalized = normalizeJobState(input)\n const definitionId = normalized.definition_id ?? fallbackDefinitionId ?? null\n return {\n ...normalized,\n definition_id: definitionId,\n metadata: definitionId\n ? { ...normalized.metadata, definition_id: definitionId }\n : normalized.metadata,\n }\n }\n\n function recordJobsMutation(jobIds: Iterable<string>): void {\n jobsRevision += 1\n for (const jobId of jobIds) {\n jobRevisions.set(jobId, (jobRevisions.get(jobId) ?? 0) + 1)\n }\n }\n\n function beginJobOperation(jobId: string): number {\n pendingJobOperations.set(jobId, (pendingJobOperations.get(jobId) ?? 0) + 1)\n return jobRevisions.get(jobId) ?? 0\n }\n\n function finishJobOperation(jobId: string): void {\n const remaining = (pendingJobOperations.get(jobId) ?? 1) - 1\n if (remaining > 0) pendingJobOperations.set(jobId, remaining)\n else pendingJobOperations.delete(jobId)\n pruneJobRevisions()\n }\n\n function pruneJobRevisions(): void {\n const retained = new Set([\n ...jobs.value.map(job => job.job_id),\n ...pendingJobOperations.keys(),\n ])\n for (const jobId of jobRevisions.keys()) {\n if (!retained.has(jobId)) jobRevisions.delete(jobId)\n }\n }\n\n function replaceJobs(inputs: readonly GeneratedAnalysisJobInput[]): GeneratedAnalysisJob[] {\n const previousJobs = new Map(jobs.value.map(job => [job.job_id, job]))\n const previousJobIds = new Set(jobs.value.map(job => job.job_id))\n const nextJobs = inputs.map((input) => {\n const incoming = canonicalJob(input)\n const current = previousJobs.get(incoming.job_id)\n return current && shouldPreserveJobLifecycle(current, incoming) ? current : incoming\n })\n const nextJobIds = new Set(nextJobs.map(job => job.job_id))\n recordJobsMutation(new Set([\n ...previousJobIds,\n ...nextJobIds,\n ]))\n jobs.value = nextJobs\n for (const job of nextJobs) settleJobWaiters(job)\n for (const jobId of previousJobIds) {\n if (!nextJobIds.has(jobId)) {\n rejectJobWaiters(jobId, new Error(`Job ${jobId} is no longer available`))\n }\n }\n pruneResultState()\n pruneJobRevisions()\n return nextJobs\n }\n\n function upsertJob(\n input: GeneratedAnalysisJobInput,\n fallbackDefinitionId?: string,\n ): GeneratedAnalysisJob {\n const incoming = canonicalJob(input, fallbackDefinitionId)\n const current = jobs.value.find(candidate => candidate.job_id === incoming.job_id)\n const job = current && shouldPreserveJobLifecycle(current, incoming)\n ? current\n : incoming\n if (job === current) {\n settleJobWaiters(job)\n pruneResultState()\n pruneJobRevisions()\n return job\n }\n jobs.value = [job, ...jobs.value.filter(candidate => candidate.job_id !== job.job_id)]\n recordJobsMutation([job.job_id])\n settleJobWaiters(job)\n pruneResultState()\n pruneJobRevisions()\n return job\n }\n\n function mergeJobResponse(\n input: GeneratedAnalysisJobInput,\n expectedRevision: number,\n ): GeneratedAnalysisJob {\n const incoming = canonicalJob(input)\n const current = jobs.value.find(candidate => candidate.job_id === incoming.job_id)\n if (disposed) return current ?? incoming\n if (current && shouldPreserveJobLifecycle(current, incoming)) return current\n if (expectedRevision === (jobRevisions.get(incoming.job_id) ?? 0)) {\n return upsertJob(incoming)\n }\n if (current && jobLifecycleRank(incoming.status) > jobLifecycleRank(current.status)) {\n return upsertJob(incoming)\n }\n return current ?? incoming\n }\n\n function currentCompletedJob(): GeneratedAnalysisJob | undefined {\n const activeSessionId = session.value?.id\n return jobs.value.find(candidate => (\n candidate.session_id === activeSessionId\n && candidate.status === 'completed'\n && candidate.result_status === 'available'\n ))\n }\n\n function resultForJob(jobId: string): GeneratedAnalysisResult | null {\n return resultCache.value[jobId] ?? null\n }\n\n function loadResult(job: GeneratedAnalysisJob): Promise<GeneratedAnalysisResult | null> {\n return loadResultInternal(job)\n }\n\n function loadResultInternal(\n job: GeneratedAnalysisJob,\n forceRefresh = false,\n ): Promise<GeneratedAnalysisResult | null> {\n if (\n disposed\n || !isLoadableResultJob(job)\n ) return Promise.resolve(null)\n\n const cached = resultForJob(job.job_id)\n if (cached && !forceRefresh && !managedDownloadNeedsRefresh(cached)) {\n return Promise.resolve(cached)\n }\n const pending = resultRequests.get(job.job_id)\n if (pending) return pending\n\n const requestResult = request<GeneratedAnalysisResult>(\n `/jobs/${encodeURIComponent(job.job_id)}/result`,\n { method: 'GET' },\n ).then((result) => {\n if (!disposed && isCurrentResultJob(job.job_id)) {\n cacheResult(job.job_id, result)\n clearResultRetry(job.job_id)\n error.value = null\n }\n return result\n }).catch((cause: unknown) => {\n if (!disposed && isCurrentResultJob(job.job_id)) {\n error.value = errorMessage(cause, 'Failed to load analysis result')\n if (cached && isManagedDownloadResult(cached)) {\n handleManagedDownloadRefreshFailure(job, cause)\n } else {\n scheduleResultRetry(job, cause)\n }\n }\n return null\n }).finally(() => {\n resultRequests.delete(job.job_id)\n })\n resultRequests.set(job.job_id, requestResult)\n return requestResult\n }\n\n function cacheResult(jobId: string, result: GeneratedAnalysisResult): void {\n resultCacheOrder = [jobId, ...resultCacheOrder.filter(candidate => candidate !== jobId)]\n .slice(0, MAX_RESULT_CACHE_ENTRIES)\n const retained = new Set(resultCacheOrder)\n resultCache.value = Object.fromEntries([\n ...Object.entries(resultCache.value)\n .filter(([candidate]) => retained.has(candidate) && candidate !== jobId),\n [jobId, result],\n ])\n for (const candidate of downloadRefreshTimers.keys()) {\n if (!retained.has(candidate)) clearManagedDownloadRefresh(candidate)\n }\n scheduleManagedDownloadRefresh(jobId, managedDownloadRefreshDelay(result))\n }\n\n function pruneResultState(): void {\n const loadableJobIds = new Set(jobs.value\n .filter(job => isLoadableResultJob(job))\n .map(job => job.job_id))\n resultCacheOrder = resultCacheOrder\n .filter(jobId => loadableJobIds.has(jobId))\n .slice(0, MAX_RESULT_CACHE_ENTRIES)\n const retained = new Set(resultCacheOrder)\n resultCache.value = Object.fromEntries(\n Object.entries(resultCache.value).filter(([jobId]) => retained.has(jobId)),\n )\n for (const jobId of resultRetryTimers.keys()) {\n if (!loadableJobIds.has(jobId)) clearResultRetry(jobId)\n }\n for (const jobId of resultRetryAttempts.keys()) {\n if (!loadableJobIds.has(jobId)) clearResultRetry(jobId)\n }\n for (const jobId of downloadRefreshTimers.keys()) {\n if (!loadableJobIds.has(jobId) || !retained.has(jobId)) {\n clearManagedDownloadRefresh(jobId)\n }\n }\n }\n\n function scheduleManagedDownloadRefresh(jobId: string, delay: number | null): void {\n clearManagedDownloadRefresh(jobId)\n if (delay === null || disposed || paused) return\n downloadRefreshTimers.set(jobId, setTimeout(() => {\n downloadRefreshTimers.delete(jobId)\n if (disposed || paused) return\n const current = jobs.value.find(candidate => candidate.job_id === jobId)\n if (current && isLoadableResultJob(current)) {\n void loadResultInternal(current, true)\n }\n }, Math.max(0, delay)))\n }\n\n function clearManagedDownloadRefresh(jobId: string): void {\n const timer = downloadRefreshTimers.get(jobId)\n if (timer !== undefined) clearTimeout(timer)\n downloadRefreshTimers.delete(jobId)\n }\n\n function handleManagedDownloadRefreshFailure(\n job: GeneratedAnalysisJob,\n cause: unknown,\n ): void {\n if (cause instanceof MintApiError) {\n if (cause.status === 404 || cause.status === 410) {\n discardCachedResult(job.job_id)\n jobs.value = jobs.value.map(candidate => (\n candidate.job_id === job.job_id\n ? { ...candidate, result_status: 'expired' }\n : candidate\n ))\n recordJobsMutation([job.job_id])\n return\n }\n if (cause.status === 401 || cause.status === 403) {\n discardCachedResult(job.job_id)\n return\n }\n }\n scheduleResultRetry(job, cause, true)\n }\n\n function discardCachedResult(jobId: string): void {\n clearResultRetry(jobId)\n clearManagedDownloadRefresh(jobId)\n resultCacheOrder = resultCacheOrder.filter(candidate => candidate !== jobId)\n const retainedResults = { ...resultCache.value }\n delete retainedResults[jobId]\n resultCache.value = retainedResults\n }\n\n function isLoadableResultJob(job: GeneratedAnalysisJob): boolean {\n return job.status === 'completed'\n && job.result_status === 'available'\n }\n\n function isCurrentResultJob(jobId: string): boolean {\n const job = jobs.value.find(candidate => candidate.job_id === jobId)\n return job !== undefined && isLoadableResultJob(job)\n }\n\n function scheduleResultRetry(\n job: GeneratedAnalysisJob,\n cause: unknown,\n forceRefresh = false,\n ): void {\n if (\n paused\n || !isRetryableResultError(cause)\n || resultRetryTimers.has(job.job_id)\n ) return\n const attempt = resultRetryAttempts.get(job.job_id) ?? 0\n if (attempt >= MAX_RESULT_RETRIES) return\n resultRetryAttempts.set(job.job_id, attempt + 1)\n resultRetryTimers.set(job.job_id, setTimeout(() => {\n resultRetryTimers.delete(job.job_id)\n const current = jobs.value.find(candidate => candidate.job_id === job.job_id)\n if (!paused && current && isLoadableResultJob(current)) {\n void loadResultInternal(current, forceRefresh)\n }\n }, pollInterval * (2 ** attempt)))\n }\n\n function clearResultRetry(jobId: string): void {\n const timer = resultRetryTimers.get(jobId)\n if (timer !== undefined) clearTimeout(timer)\n resultRetryTimers.delete(jobId)\n resultRetryAttempts.delete(jobId)\n }\n\n function schedulePoll(): void {\n if (disposed || paused || jobStream.isConnected.value || pollTimer !== undefined) return\n pollTimer = setTimeout(async () => {\n pollTimer = undefined\n if (disposed) return\n try {\n await refreshJobs()\n } catch (cause) {\n error.value = errorMessage(cause, 'Failed to refresh analysis jobs')\n if (jobs.value.some(job => isActiveJobStatus(job.status))) schedulePoll()\n }\n }, pollInterval)\n }\n\n function clearPoll(): void {\n if (pollTimer === undefined) return\n clearTimeout(pollTimer)\n pollTimer = undefined\n }\n\n function schedulePollForActiveJobs(): void {\n if (jobs.value.some(job => isActiveJobStatus(job.status))) schedulePoll()\n }\n\n function applyJobStreamMessage(message: EventStreamMessage<PluginJobStreamData>): void {\n if (message.event === 'snapshot' && 'jobs' in message.data) {\n const payload = message.data\n replaceJobs(payload.jobs)\n } else if (message.event === 'job' || message.event === 'terminal') {\n upsertJob(message.data as GeneratedAnalysisJobInput)\n }\n error.value = null\n }\n\n async function cancelJob(job: GeneratedAnalysisJob | string): Promise<GeneratedAnalysisJob> {\n const jobId = typeof job === 'string' ? job : job.job_id\n const revision = beginJobOperation(jobId)\n try {\n const updated = await request<GeneratedAnalysisJobInput>(\n `/jobs/${encodeURIComponent(jobId)}/cancel`,\n { method: 'POST' },\n )\n return mergeJobResponse(updated, revision)\n } finally {\n finishJobOperation(jobId)\n }\n }\n\n async function deleteJob(job: GeneratedAnalysisJob | string): Promise<boolean> {\n const jobId = typeof job === 'string' ? job : job.job_id\n await request<{ status: 'deleted' }>(\n `/jobs/${encodeURIComponent(jobId)}`,\n { method: 'DELETE' },\n )\n jobs.value = jobs.value.filter(candidate => candidate.job_id !== jobId)\n recordJobsMutation([jobId])\n rejectJobWaiters(jobId, new Error(`Job ${jobId} was deleted`))\n discardCachedResult(jobId)\n pruneJobRevisions()\n return true\n }\n\n async function clearFinishedJobs(definitionId?: string): Promise<number> {\n const query = definitionId === undefined\n ? ''\n : `?definition_id=${encodeURIComponent(definitionId)}`\n const payload = await request<{ deleted: number }>(`/jobs${query}`, { method: 'DELETE' })\n if (payload.deleted > 0) await refreshJobs()\n return payload.deleted\n }\n\n const jobsAdapter: JobsStatusTrayAdapter = {\n listJobs: async () => ({ jobs: await refreshJobs() }),\n cancelJob: async job => cancelJob(job as GeneratedAnalysisJob),\n deleteJob: async job => deleteJob(job as GeneratedAnalysisJob),\n clearFinishedJobs: async () => clearFinishedJobs(),\n }\n\n function pause(): void {\n if (disposed || paused) return\n paused = true\n status.value = 'paused'\n clearPoll()\n for (const jobId of resultRetryTimers.keys()) clearResultRetry(jobId)\n for (const jobId of downloadRefreshTimers.keys()) {\n clearManagedDownloadRefresh(jobId)\n }\n jobStream.stop()\n }\n\n function resume(): void {\n if (disposed || !paused) return\n paused = false\n status.value = initialized ? 'ready' : 'idle'\n if (!initialized) return\n for (const [jobId, result] of Object.entries(resultCache.value)) {\n scheduleManagedDownloadRefresh(jobId, managedDownloadRefreshDelay(result))\n }\n if (streamEnabled) jobStream.start()\n else if (jobs.value.some(job => isActiveJobStatus(job.status))) schedulePoll()\n }\n\n function dispose(): void {\n if (disposed) return\n disposed = true\n paused = true\n status.value = 'disposed'\n clearPoll()\n for (const timer of resultRetryTimers.values()) clearTimeout(timer)\n resultRetryTimers.clear()\n resultRetryAttempts.clear()\n for (const timer of downloadRefreshTimers.values()) clearTimeout(timer)\n downloadRefreshTimers.clear()\n const cause = new Error('Plugin jobs runtime is disposed')\n for (const jobId of jobWaiters.keys()) rejectJobWaiters(jobId, cause)\n jobRevisions.clear()\n pendingJobOperations.clear()\n jobStream.stop()\n }\n\n async function request<T>(path: string, init: RequestInit): Promise<T> {\n const response = await transport(`${baseUrl}${path}`, {\n ...init,\n headers: {\n Accept: 'application/json',\n ...(init.body && !(init.body instanceof FormData)\n ? { 'Content-Type': 'application/json' }\n : {}),\n ...init.headers,\n },\n })\n if (!response.ok) {\n const payload: unknown = await response.json().catch(() => null)\n throw mintApiErrorFromResponse(response.status, payload, {\n requestId: response.headers.get('X-Request-ID'),\n })\n }\n return await response.json() as T\n }\n\n onScopeDispose(dispose)\n\n if (options.immediate) void initialize().catch(() => undefined)\n\n return {\n manifest,\n session,\n jobs,\n latestResult,\n isLoading,\n isSubmitting,\n error,\n status,\n initialize,\n ready: initialize,\n uploadPath,\n uploadStagedPart,\n getJobStaging,\n sealJob,\n submit,\n loadResult,\n resultForJob,\n refreshJobs,\n refresh,\n getJob,\n waitForJob,\n jobsFor,\n cancelJob,\n deleteJob,\n clearFinishedJobs,\n pause,\n resume,\n dispose,\n jobsAdapter,\n }\n}\n\nfunction jobIdFromReference(job: GeneratedAnalysisJob | string): string {\n return typeof job === 'string' ? job : job.job_id\n}\n\nfunction encodeStagedPartKey(key: string): string {\n return key.split('/').map(segment => encodeURIComponent(segment)).join('/')\n}\n\nfunction jobLifecycleRank(status: GeneratedAnalysisJob['status']): number {\n if (status === 'awaiting_input') return 0\n if (status === 'queued') return 1\n if (status === 'running') return 2\n return 3\n}\n\nfunction shouldPreserveJobLifecycle(\n current: GeneratedAnalysisJob,\n incoming: GeneratedAnalysisJob,\n): boolean {\n const currentRank = jobLifecycleRank(current.status)\n const incomingRank = jobLifecycleRank(incoming.status)\n return incomingRank < currentRank\n || (currentRank === 3 && incomingRank === 3 && current.status !== incoming.status)\n}\n\nfunction terminalWaitResult(\n job: GeneratedAnalysisJob,\n rejectOnFailure: boolean,\n): Promise<GeneratedAnalysisJob> {\n if (rejectOnFailure && (job.status === 'failed' || job.status === 'cancelled')) {\n return Promise.reject(new Error(job.error ?? `Job ${job.job_id} ${job.status}`))\n }\n return Promise.resolve(job)\n}\n\nfunction pluginJobWaitAbort(signal: AbortSignal): unknown {\n if (signal.reason !== undefined) return signal.reason\n const cause = new Error('Waiting for job was aborted')\n cause.name = 'AbortError'\n return cause\n}\n\nfunction isPluginJobArtifactPathInput(value: unknown): value is PluginJobArtifactPathInput {\n return Boolean(\n value\n && typeof value === 'object'\n && 'kind' in value\n && value.kind === 'artifact-path'\n && 'experimentId' in value\n && Number.isInteger(value.experimentId)\n && 'artifactId' in value\n && Number.isInteger(value.artifactId),\n )\n}\n\nfunction isPluginJobPathInput(value: unknown): value is PluginJobPathInput {\n return Boolean(\n value\n && typeof value === 'object'\n && 'kind' in value\n && value.kind === 'path'\n && 'files' in value\n && Array.isArray(value.files)\n && 'relativePaths' in value\n && Array.isArray(value.relativePaths),\n )\n}\n\nfunction readStoredAccessToken(): string | null {\n try {\n return globalThis.localStorage?.getItem(AUTH_TOKEN_KEY) ?? null\n } catch {\n return null\n }\n}\n\nfunction createGeneratedSessionStorage(candidate?: Storage): GeneratedSessionStorage {\n const fallback = new Map<string, string>()\n let delegate: Storage | undefined\n let available = true\n try {\n delegate = candidate ?? globalThis.sessionStorage\n } catch {\n available = false\n }\n return {\n getItem(key) {\n if (available && delegate) {\n try {\n return delegate.getItem(key) ?? fallback.get(key) ?? null\n } catch {\n available = false\n }\n }\n return fallback.get(key) ?? null\n },\n setItem(key, value) {\n fallback.set(key, value)\n if (available && delegate) {\n try {\n delegate.setItem(key, value)\n } catch {\n available = false\n }\n }\n },\n }\n}\n\nfunction isSessionNotFoundError(error: unknown): boolean {\n return error instanceof MintApiError\n && error.status === 404\n && (error.detail === SESSION_NOT_FOUND_DETAIL || error.message === SESSION_NOT_FOUND_DETAIL)\n}\n\nfunction isRetryableResultError(error: unknown): boolean {\n return !(error instanceof MintApiError)\n || error.status === 409\n || error.status === 429\n || error.status >= 500\n}\n\nfunction isRetryableJobLookupError(error: unknown): boolean {\n return !(error instanceof MintApiError)\n || error.status === 408\n || error.status === 429\n || error.status >= 500\n}\n\nfunction isManagedDownloadResult(\n result: GeneratedAnalysisResult,\n): result is Extract<GeneratedAnalysisResult, { kind: 'artifact' }> {\n return result.kind === 'artifact' && result.managed === true\n}\n\nfunction managedDownloadNeedsRefresh(result: GeneratedAnalysisResult): boolean {\n if (!isManagedDownloadResult(result)) return false\n if (!result.download_url || !result.download_expires_at) return true\n const expiresAt = Date.parse(result.download_expires_at)\n return !Number.isFinite(expiresAt)\n || expiresAt <= Date.now() + DOWNLOAD_URL_REFRESH_SKEW_MS\n}\n\nfunction managedDownloadRefreshDelay(result: GeneratedAnalysisResult): number | null {\n if (!isManagedDownloadResult(result)) return null\n if (!result.download_url || !result.download_expires_at) return null\n const expiresAt = Date.parse(result.download_expires_at)\n if (!Number.isFinite(expiresAt)) return null\n const remaining = expiresAt - Date.now()\n return remaining <= DOWNLOAD_URL_REFRESH_SKEW_MS\n ? remaining\n : remaining - DOWNLOAD_URL_REFRESH_SKEW_MS\n}\n\nfunction errorMessage(error: unknown, fallback: string): string {\n return error instanceof Error ? error.message : fallback\n}\n","import type { PlatformContext } from '../types'\n\nexport type ExperimentAwarePlatformContext = PlatformContext & {\n currentExperiment?: unknown\n currentExperimentId?: unknown\n experiment?: unknown\n experimentId?: unknown\n}\n\nexport function getInjectedPlatformContext(): PlatformContext | undefined {\n if (typeof window === 'undefined') return undefined\n return (window as unknown as { __MINT_PLATFORM__?: PlatformContext }).__MINT_PLATFORM__\n}\n\n/** Return the platform's canonical plugin identity for the mounted frontend. */\nexport function resolveCurrentPluginId(): string | undefined {\n const pluginId = getInjectedPlatformContext()?.plugin?.id\n return typeof pluginId === 'string' && pluginId ? pluginId : undefined\n}\n\nexport function getInjectedExperimentContext(): ExperimentAwarePlatformContext | undefined {\n return getInjectedPlatformContext() as ExperimentAwarePlatformContext | undefined\n}\n\nexport function currentExperimentFromContext<TExperiment>(\n context: ExperimentAwarePlatformContext | undefined = getInjectedExperimentContext(),\n): TExperiment | undefined {\n const candidate = context?.currentExperiment ?? context?.experiment\n return candidate && typeof candidate === 'object'\n ? candidate as TExperiment\n : undefined\n}\n\nexport function currentExperimentIdFromContext(\n context: ExperimentAwarePlatformContext | undefined = getInjectedExperimentContext(),\n): number | undefined {\n return parseExperimentId(\n context?.currentExperimentId ??\n context?.experimentId ??\n context?.currentExperiment ??\n context?.experiment,\n )\n}\n\nexport function currentExperimentIdFromUrl(): number | undefined {\n if (typeof window === 'undefined') return undefined\n const location = window.location\n const params = new URLSearchParams(location?.search ?? '')\n return parseExperimentId(params.get('experimentId') ?? params.get('experiment_id'))\n ?? experimentIdFromPath(location?.pathname ?? '')\n ?? experimentIdFromPath((location?.hash ?? '').replace(/^#\\/?/, '/'))\n}\n\nexport function resolveCurrentExperimentId(\n context: ExperimentAwarePlatformContext | undefined = getInjectedExperimentContext(),\n): number | undefined {\n return currentExperimentIdFromContext(context) ?? currentExperimentIdFromUrl()\n}\n\nexport function parseExperimentId(value: unknown): number | undefined {\n if (typeof value === 'number' && Number.isFinite(value)) return value\n if (typeof value === 'string' && value.trim()) {\n const parsed = Number(value)\n return Number.isFinite(parsed) ? parsed : undefined\n }\n if (value && typeof value === 'object' && 'id' in value) {\n return parseExperimentId((value as { id?: unknown }).id)\n }\n return undefined\n}\n\nfunction experimentIdFromPath(path: string): number | undefined {\n const segments = path.split('/').filter(Boolean)\n for (let index = 0; index < segments.length - 1; index += 1) {\n const segment = segments[index]?.toLowerCase()\n if (segment === 'experiment' || segment === 'experiments') {\n return parseExperimentId(decodeURIComponent(segments[index + 1] ?? ''))\n }\n }\n return undefined\n}\n","import type { InjectionKey } from 'vue'\n\nimport type { GeneratedAnalysisTransport } from '../../composables/useGeneratedAnalysis'\n\n/** The plugin jobs API a generated workspace talks to, for fields that need it. */\nexport interface GeneratedJobsApi {\n baseUrl: string\n /** Defaults to the authenticated SDK transport. */\n transport?: GeneratedAnalysisTransport\n}\n\nexport const GENERATED_JOBS_API_KEY: InjectionKey<GeneratedJobsApi> = Symbol('mint-generated-jobs-api')\n","<script setup lang=\"ts\">\nimport { computed, inject, ref, watch } from 'vue'\n\nimport { mintApiErrorFromResponse } from '../apiErrors'\nimport { formatExperimentDate } from '../composables/experiment-utils'\nimport { createGeneratedAnalysisTransport } from '../composables/useGeneratedAnalysis'\nimport {\n getInjectedPlatformContext,\n resolveCurrentExperimentId,\n} from '../composables/platformContextHelpers'\nimport type { AnalysisArtifactSummary } from '../types/analysisArtifactTypes'\nimport type {\n PluginJobArtifactPathInput,\n PluginJobPathInput,\n PluginJobPathSelection,\n} from '../types/generated-ui'\nimport BaseButton from './BaseButton.vue'\nimport BaseModal from './BaseModal.vue'\nimport FileUploader from './FileUploader.vue'\nimport { GENERATED_JOBS_API_KEY } from './internal/generatedJobsApi'\nimport ResourcePickerListInternal from './internal/ResourcePickerListInternal.vue'\n\n/** A file artifact the plugin's jobs API says this Path input may use. */\ninterface ReadableArtifact extends AnalysisArtifactSummary {\n filename: string\n}\n\nconst props = defineProps<{\n modelValue?: PluginJobPathSelection | PluginJobPathSelection[] | null\n disabled?: boolean\n multiple?: boolean\n}>()\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: PluginJobPathSelection | PluginJobPathSelection[] | null]\n}>()\n\nconst mode = ref<'file' | 'folder'>('file')\nconst selections = computed(() => Array.isArray(props.modelValue)\n ? props.modelValue\n : props.modelValue ? [props.modelValue] : [])\nconst uploads = computed(() => selections.value.filter(\n (selection): selection is PluginJobPathInput => selection.kind === 'path',\n))\nconst artifacts = computed(() => selections.value.filter(\n (selection): selection is PluginJobArtifactPathInput => selection.kind === 'artifact-path',\n))\nconst selectedFiles = computed(() => uploads.value.flatMap(selection => selection.files))\nwatch(uploads, (current) => {\n if (current.length) mode.value = current.every(selection => selection.rootName) ? 'folder' : 'file'\n}, { immediate: true })\nconst artifactOpen = ref(false)\nconst artifactSearch = ref('')\nconst artifactRows = ref<ReadableArtifact[]>([])\nconst artifactLoading = ref(false)\nconst artifactError = ref<string | null>(null)\nconst platform = getInjectedPlatformContext()\nconst experimentId = resolveCurrentExperimentId(platform)\nconst jobsApi = inject(GENERATED_JOBS_API_KEY, null)\nconst canSelectArtifact = computed(() => Boolean(platform?.isIntegrated && experimentId && jobsApi))\nconst visibleArtifactRows = computed(() => {\n const query = artifactSearch.value.trim().toLowerCase()\n return query\n ? artifactRows.value.filter(row => [row.display_name, row.artifact_key, row.filename, row.plugin_id]\n .some(text => text.toLowerCase().includes(query)))\n : artifactRows.value\n})\n\nfunction selectMode(nextMode: 'file' | 'folder'): void {\n mode.value = nextMode\n emit('update:modelValue', null)\n}\n\nfunction selectFiles(\n files: File[],\n rootName?: string,\n relativePaths?: string[],\n): void {\n const paths = relativePaths ?? files.map(file => file.name)\n const added: PluginJobPathInput[] = props.multiple && !rootName\n ? files.map((file, index) => ({\n kind: 'path',\n files: [file],\n relativePaths: [paths[index] ?? file.name],\n }))\n : [{\n kind: 'path',\n files,\n relativePaths: paths,\n ...(rootName ? { rootName } : {}),\n }]\n emitSelections(props.multiple ? [...selections.value, ...added] : added)\n}\n\nfunction removeFiles(files: File[]): void {\n const removed = new Set(files)\n emitSelections(selections.value.flatMap((selection): PluginJobPathSelection[] => {\n if (selection.kind !== 'path') return [selection]\n const indexes = selection.files\n .map((file, index) => removed.has(file) ? -1 : index)\n .filter(index => index >= 0)\n if (!indexes.length) return []\n return [{\n ...selection,\n files: indexes.map(index => selection.files[index]!),\n relativePaths: indexes.map(index => selection.relativePaths[index]!),\n }]\n }))\n}\n\nfunction removeArtifact(artifact: PluginJobArtifactPathInput): void {\n emitSelections(selections.value.filter(selection => selection !== artifact))\n}\n\nfunction emitSelections(next: PluginJobPathSelection[]): void {\n emit('update:modelValue', props.multiple ? next : next[0] ?? null)\n}\n\n// The plugin lists exactly the artifacts its staging route accepts (same\n// readers and visibility rule), so a pick never fails later with a 404.\nlet artifactRequest = 0\n\nasync function openArtifactPicker(): Promise<void> {\n if (!jobsApi || !experimentId) return\n const request = ++artifactRequest\n artifactOpen.value = true\n artifactSearch.value = ''\n artifactLoading.value = true\n artifactError.value = null\n let rows: ReadableArtifact[] = []\n let error: string | null = null\n try {\n const transport = jobsApi.transport ?? createGeneratedAnalysisTransport()\n const baseUrl = jobsApi.baseUrl.replace(/\\/$/, '')\n const response = await transport(\n `${baseUrl}/jobs/artifacts?experiment_id=${encodeURIComponent(experimentId)}`,\n { headers: { Accept: 'application/json' } },\n )\n const payload: unknown = await response.json().catch(() => null)\n if (!response.ok) throw mintApiErrorFromResponse(response.status, payload)\n rows = (payload as { artifacts?: ReadableArtifact[] } | null)?.artifacts ?? []\n } catch (cause) {\n error = cause instanceof Error ? cause.message : 'Failed to load artifacts'\n }\n // A reopened picker owns the list; an earlier, slower answer is dropped.\n if (request !== artifactRequest) return\n artifactRows.value = rows\n artifactError.value = error\n artifactLoading.value = false\n}\n\nfunction describeArtifact(row: ReadableArtifact) {\n const date = row.updated_at ?? row.created_at\n return {\n code: row.artifact_key,\n title: row.display_name,\n meta: [row.filename, row.plugin_id],\n date: date ? formatExperimentDate(date) : '',\n }\n}\n\n// Only the database ids are kept: the plugin re-authorizes and copies the\n// file when the job is submitted, so the browser never downloads it.\nfunction selectArtifact(row: ReadableArtifact): void {\n const selection: PluginJobArtifactPathInput = {\n kind: 'artifact-path',\n experimentId: row.experiment_id,\n artifactId: row.id,\n name: row.filename,\n }\n emitSelections(props.multiple ? [...selections.value, selection] : [selection])\n artifactOpen.value = false\n}\n</script>\n\n<template>\n <div class=\"mint-generated-path-input\">\n <div class=\"mint-generated-path-input__modes\" role=\"group\" aria-label=\"Path type\">\n <BaseButton\n size=\"sm\"\n :variant=\"mode === 'file' ? 'primary' : 'secondary'\"\n :disabled=\"disabled\"\n @click=\"selectMode('file')\"\n >\n File\n </BaseButton>\n <BaseButton\n size=\"sm\"\n :variant=\"mode === 'folder' ? 'primary' : 'secondary'\"\n :disabled=\"disabled\"\n @click=\"selectMode('folder')\"\n >\n Folder\n </BaseButton>\n <BaseButton\n v-if=\"canSelectArtifact\"\n size=\"sm\"\n variant=\"secondary\"\n :disabled=\"disabled\"\n @click=\"openArtifactPicker\"\n >\n Existing artifact\n </BaseButton>\n </div>\n\n <FileUploader\n :key=\"mode\"\n :mode=\"mode\"\n :files=\"selectedFiles\"\n :root-name=\"uploads[0]?.rootName\"\n :multiple=\"multiple && mode === 'file'\"\n :disabled=\"disabled\"\n @upload=\"selectFiles\"\n @remove=\"removeFiles\"\n />\n\n <ul v-if=\"artifacts.length\" class=\"mint-file-uploader__list\">\n <li\n v-for=\"artifact in artifacts\"\n :key=\"`${artifact.experimentId}:${artifact.artifactId}`\"\n class=\"mint-file-uploader__file mint-generated-path-input__artifact\"\n >\n <div class=\"mint-file-uploader__file-info\">\n <span class=\"mint-file-uploader__file-badge mint-generated-path-input__artifact-badge\">ART</span>\n <div class=\"mint-file-uploader__file-meta\">\n <span class=\"mint-file-uploader__file-name\">{{ artifact.name }}</span>\n <span class=\"mint-file-uploader__file-size\">Existing artifact · experiment {{ artifact.experimentId }}</span>\n </div>\n </div>\n <button\n type=\"button\"\n :aria-label=\"`Remove ${artifact.name}`\"\n class=\"mint-file-uploader__remove-btn\"\n :disabled=\"disabled\"\n @click.stop=\"removeArtifact(artifact)\"\n >\n <svg class=\"mint-file-uploader__remove-icon\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" viewBox=\"0 0 24 24\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </li>\n </ul>\n\n <BaseModal\n v-if=\"canSelectArtifact\"\n v-model=\"artifactOpen\"\n title=\"Select a file artifact\"\n size=\"lg\"\n >\n <ResourcePickerListInternal\n v-model:search=\"artifactSearch\"\n label=\"File artifacts\"\n placeholder=\"Search file artifacts…\"\n :items=\"visibleArtifactRows\"\n :item-key=\"(row) => row.id\"\n :describe=\"describeArtifact\"\n :loading=\"artifactLoading\"\n :error=\"artifactError\"\n :empty-title=\"artifactRows.length ? 'No matching file artifacts' : 'No file artifacts this plugin can read'\"\n :empty-description=\"artifactRows.length\n ? 'Try a different search.'\n : 'Only active file artifacts saved by this plugin, or by the plugins it declares as readers, can be used as a path.'\"\n @select=\"selectArtifact\"\n />\n </BaseModal>\n </div>\n</template>\n\n<style scoped>\n.mint-generated-path-input {\n display: grid;\n gap: 0.75rem;\n}\n\n.mint-generated-path-input__modes {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem;\n}\n\n.mint-generated-path-input__artifact-badge {\n --badge-color: var(--color-primary);\n}\n\n.mint-generated-path-input__artifact .mint-file-uploader__remove-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n color: var(--text-muted);\n background: transparent;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, inject, ref, watch } from 'vue'\n\nimport { mintApiErrorFromResponse } from '../apiErrors'\nimport { formatExperimentDate } from '../composables/experiment-utils'\nimport { createGeneratedAnalysisTransport } from '../composables/useGeneratedAnalysis'\nimport {\n getInjectedPlatformContext,\n resolveCurrentExperimentId,\n} from '../composables/platformContextHelpers'\nimport type { AnalysisArtifactSummary } from '../types/analysisArtifactTypes'\nimport type {\n PluginJobArtifactPathInput,\n PluginJobPathInput,\n PluginJobPathSelection,\n} from '../types/generated-ui'\nimport BaseButton from './BaseButton.vue'\nimport BaseModal from './BaseModal.vue'\nimport FileUploader from './FileUploader.vue'\nimport { GENERATED_JOBS_API_KEY } from './internal/generatedJobsApi'\nimport ResourcePickerListInternal from './internal/ResourcePickerListInternal.vue'\n\n/** A file artifact the plugin's jobs API says this Path input may use. */\ninterface ReadableArtifact extends AnalysisArtifactSummary {\n filename: string\n}\n\nconst props = defineProps<{\n modelValue?: PluginJobPathSelection | PluginJobPathSelection[] | null\n disabled?: boolean\n multiple?: boolean\n}>()\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: PluginJobPathSelection | PluginJobPathSelection[] | null]\n}>()\n\nconst mode = ref<'file' | 'folder'>('file')\nconst selections = computed(() => Array.isArray(props.modelValue)\n ? props.modelValue\n : props.modelValue ? [props.modelValue] : [])\nconst uploads = computed(() => selections.value.filter(\n (selection): selection is PluginJobPathInput => selection.kind === 'path',\n))\nconst artifacts = computed(() => selections.value.filter(\n (selection): selection is PluginJobArtifactPathInput => selection.kind === 'artifact-path',\n))\nconst selectedFiles = computed(() => uploads.value.flatMap(selection => selection.files))\nwatch(uploads, (current) => {\n if (current.length) mode.value = current.every(selection => selection.rootName) ? 'folder' : 'file'\n}, { immediate: true })\nconst artifactOpen = ref(false)\nconst artifactSearch = ref('')\nconst artifactRows = ref<ReadableArtifact[]>([])\nconst artifactLoading = ref(false)\nconst artifactError = ref<string | null>(null)\nconst platform = getInjectedPlatformContext()\nconst experimentId = resolveCurrentExperimentId(platform)\nconst jobsApi = inject(GENERATED_JOBS_API_KEY, null)\nconst canSelectArtifact = computed(() => Boolean(platform?.isIntegrated && experimentId && jobsApi))\nconst visibleArtifactRows = computed(() => {\n const query = artifactSearch.value.trim().toLowerCase()\n return query\n ? artifactRows.value.filter(row => [row.display_name, row.artifact_key, row.filename, row.plugin_id]\n .some(text => text.toLowerCase().includes(query)))\n : artifactRows.value\n})\n\nfunction selectMode(nextMode: 'file' | 'folder'): void {\n mode.value = nextMode\n emit('update:modelValue', null)\n}\n\nfunction selectFiles(\n files: File[],\n rootName?: string,\n relativePaths?: string[],\n): void {\n const paths = relativePaths ?? files.map(file => file.name)\n const added: PluginJobPathInput[] = props.multiple && !rootName\n ? files.map((file, index) => ({\n kind: 'path',\n files: [file],\n relativePaths: [paths[index] ?? file.name],\n }))\n : [{\n kind: 'path',\n files,\n relativePaths: paths,\n ...(rootName ? { rootName } : {}),\n }]\n emitSelections(props.multiple ? [...selections.value, ...added] : added)\n}\n\nfunction removeFiles(files: File[]): void {\n const removed = new Set(files)\n emitSelections(selections.value.flatMap((selection): PluginJobPathSelection[] => {\n if (selection.kind !== 'path') return [selection]\n const indexes = selection.files\n .map((file, index) => removed.has(file) ? -1 : index)\n .filter(index => index >= 0)\n if (!indexes.length) return []\n return [{\n ...selection,\n files: indexes.map(index => selection.files[index]!),\n relativePaths: indexes.map(index => selection.relativePaths[index]!),\n }]\n }))\n}\n\nfunction removeArtifact(artifact: PluginJobArtifactPathInput): void {\n emitSelections(selections.value.filter(selection => selection !== artifact))\n}\n\nfunction emitSelections(next: PluginJobPathSelection[]): void {\n emit('update:modelValue', props.multiple ? next : next[0] ?? null)\n}\n\n// The plugin lists exactly the artifacts its staging route accepts (same\n// readers and visibility rule), so a pick never fails later with a 404.\nlet artifactRequest = 0\n\nasync function openArtifactPicker(): Promise<void> {\n if (!jobsApi || !experimentId) return\n const request = ++artifactRequest\n artifactOpen.value = true\n artifactSearch.value = ''\n artifactLoading.value = true\n artifactError.value = null\n let rows: ReadableArtifact[] = []\n let error: string | null = null\n try {\n const transport = jobsApi.transport ?? createGeneratedAnalysisTransport()\n const baseUrl = jobsApi.baseUrl.replace(/\\/$/, '')\n const response = await transport(\n `${baseUrl}/jobs/artifacts?experiment_id=${encodeURIComponent(experimentId)}`,\n { headers: { Accept: 'application/json' } },\n )\n const payload: unknown = await response.json().catch(() => null)\n if (!response.ok) throw mintApiErrorFromResponse(response.status, payload)\n rows = (payload as { artifacts?: ReadableArtifact[] } | null)?.artifacts ?? []\n } catch (cause) {\n error = cause instanceof Error ? cause.message : 'Failed to load artifacts'\n }\n // A reopened picker owns the list; an earlier, slower answer is dropped.\n if (request !== artifactRequest) return\n artifactRows.value = rows\n artifactError.value = error\n artifactLoading.value = false\n}\n\nfunction describeArtifact(row: ReadableArtifact) {\n const date = row.updated_at ?? row.created_at\n return {\n code: row.artifact_key,\n title: row.display_name,\n meta: [row.filename, row.plugin_id],\n date: date ? formatExperimentDate(date) : '',\n }\n}\n\n// Only the database ids are kept: the plugin re-authorizes and copies the\n// file when the job is submitted, so the browser never downloads it.\nfunction selectArtifact(row: ReadableArtifact): void {\n const selection: PluginJobArtifactPathInput = {\n kind: 'artifact-path',\n experimentId: row.experiment_id,\n artifactId: row.id,\n name: row.filename,\n }\n emitSelections(props.multiple ? [...selections.value, selection] : [selection])\n artifactOpen.value = false\n}\n</script>\n\n<template>\n <div class=\"mint-generated-path-input\">\n <div class=\"mint-generated-path-input__modes\" role=\"group\" aria-label=\"Path type\">\n <BaseButton\n size=\"sm\"\n :variant=\"mode === 'file' ? 'primary' : 'secondary'\"\n :disabled=\"disabled\"\n @click=\"selectMode('file')\"\n >\n File\n </BaseButton>\n <BaseButton\n size=\"sm\"\n :variant=\"mode === 'folder' ? 'primary' : 'secondary'\"\n :disabled=\"disabled\"\n @click=\"selectMode('folder')\"\n >\n Folder\n </BaseButton>\n <BaseButton\n v-if=\"canSelectArtifact\"\n size=\"sm\"\n variant=\"secondary\"\n :disabled=\"disabled\"\n @click=\"openArtifactPicker\"\n >\n Existing artifact\n </BaseButton>\n </div>\n\n <FileUploader\n :key=\"mode\"\n :mode=\"mode\"\n :files=\"selectedFiles\"\n :root-name=\"uploads[0]?.rootName\"\n :multiple=\"multiple && mode === 'file'\"\n :disabled=\"disabled\"\n @upload=\"selectFiles\"\n @remove=\"removeFiles\"\n />\n\n <ul v-if=\"artifacts.length\" class=\"mint-file-uploader__list\">\n <li\n v-for=\"artifact in artifacts\"\n :key=\"`${artifact.experimentId}:${artifact.artifactId}`\"\n class=\"mint-file-uploader__file mint-generated-path-input__artifact\"\n >\n <div class=\"mint-file-uploader__file-info\">\n <span class=\"mint-file-uploader__file-badge mint-generated-path-input__artifact-badge\">ART</span>\n <div class=\"mint-file-uploader__file-meta\">\n <span class=\"mint-file-uploader__file-name\">{{ artifact.name }}</span>\n <span class=\"mint-file-uploader__file-size\">Existing artifact · experiment {{ artifact.experimentId }}</span>\n </div>\n </div>\n <button\n type=\"button\"\n :aria-label=\"`Remove ${artifact.name}`\"\n class=\"mint-file-uploader__remove-btn\"\n :disabled=\"disabled\"\n @click.stop=\"removeArtifact(artifact)\"\n >\n <svg class=\"mint-file-uploader__remove-icon\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" viewBox=\"0 0 24 24\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </li>\n </ul>\n\n <BaseModal\n v-if=\"canSelectArtifact\"\n v-model=\"artifactOpen\"\n title=\"Select a file artifact\"\n size=\"lg\"\n >\n <ResourcePickerListInternal\n v-model:search=\"artifactSearch\"\n label=\"File artifacts\"\n placeholder=\"Search file artifacts…\"\n :items=\"visibleArtifactRows\"\n :item-key=\"(row) => row.id\"\n :describe=\"describeArtifact\"\n :loading=\"artifactLoading\"\n :error=\"artifactError\"\n :empty-title=\"artifactRows.length ? 'No matching file artifacts' : 'No file artifacts this plugin can read'\"\n :empty-description=\"artifactRows.length\n ? 'Try a different search.'\n : 'Only active file artifacts saved by this plugin, or by the plugins it declares as readers, can be used as a path.'\"\n @select=\"selectArtifact\"\n />\n </BaseModal>\n </div>\n</template>\n\n<style scoped>\n.mint-generated-path-input {\n display: grid;\n gap: 0.75rem;\n}\n\n.mint-generated-path-input__modes {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem;\n}\n\n.mint-generated-path-input__artifact-badge {\n --badge-color: var(--color-primary);\n}\n\n.mint-generated-path-input__artifact .mint-file-uploader__remove-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n color: var(--text-muted);\n background: transparent;\n}\n</style>\n","// Types\nexport interface ParsedElement {\n symbol: string\n count: number\n}\n\nexport interface FormulaParseResult {\n elements: Record<string, number>\n valid: boolean\n error?: string\n}\n\n/** `coefficient` is a full-size multiplier at the start of a hydrate segment (the 5 in CuSO4·5H2O). */\nexport type FormulaPartType = 'element' | 'subscript' | 'superscript' | 'paren' | 'dot' | 'charge' | 'coefficient'\n\nexport interface FormulaPart {\n type: FormulaPartType\n text: string\n}\n\n// Every element with its standard atomic weight (mass number of the most stable isotope when none is defined)\nexport const ATOMIC_WEIGHTS: Record<string, number> = {\n H: 1.008, He: 4.003, Li: 6.941, Be: 9.012, B: 10.81,\n C: 12.011, N: 14.007, O: 15.999, F: 18.998, Ne: 20.180,\n Na: 22.990, Mg: 24.305, Al: 26.982, Si: 28.086, P: 30.974,\n S: 32.065, Cl: 35.453, Ar: 39.948, K: 39.098, Ca: 40.078,\n Sc: 44.956, Ti: 47.867, V: 50.942, Cr: 51.996,\n Mn: 54.938, Fe: 55.845, Co: 58.933, Ni: 58.693, Cu: 63.546,\n Zn: 65.38, Ga: 69.723, Ge: 72.630, As: 74.922, Se: 78.971,\n Br: 79.904, Kr: 83.798, Rb: 85.468, Sr: 87.62, Y: 88.906,\n Zr: 91.224, Nb: 92.906, Mo: 95.95, Tc: 98, Ru: 101.07,\n Rh: 102.906, Pd: 106.42, Ag: 107.868, Cd: 112.414, In: 114.818,\n Sn: 118.710, Sb: 121.760, Te: 127.60, I: 126.904, Xe: 131.293,\n Cs: 132.905, Ba: 137.327, La: 138.905, Ce: 140.116, Pr: 140.908,\n Nd: 144.242, Pm: 145, Sm: 150.36, Eu: 151.964, Gd: 157.25,\n Tb: 158.925, Dy: 162.500, Ho: 164.930, Er: 167.259, Tm: 168.934,\n Yb: 173.045, Lu: 174.967, Hf: 178.49, Ta: 180.948, W: 183.84,\n Re: 186.207, Os: 190.23, Ir: 192.217, Pt: 195.084, Au: 196.967,\n Hg: 200.592, Tl: 204.38, Pb: 207.2, Bi: 208.980, Po: 209,\n At: 210, Rn: 222, Fr: 223, Ra: 226, Ac: 227,\n Th: 232.038, Pa: 231.036, U: 238.029, Np: 237, Pu: 244,\n Am: 243, Cm: 247, Bk: 247, Cf: 251, Es: 252,\n Fm: 257, Md: 258, No: 259, Lr: 266, Rf: 267,\n Db: 268, Sg: 269, Bh: 270, Hs: 277, Mt: 278,\n Ds: 281, Rg: 282, Cn: 285, Nh: 286, Fl: 289,\n Mc: 290, Lv: 293, Ts: 294, Og: 294,\n}\n\nfunction parseFormulaSegment(formula: string): FormulaParseResult {\n const elements: Record<string, number> = {}\n const stack: Record<string, number>[] = [{}]\n let i = 0\n\n while (i < formula.length) {\n const ch = formula[i]\n\n if (ch === '(') {\n stack.push({})\n i++\n } else if (ch === ')') {\n if (stack.length < 2) {\n return { elements: {}, valid: false, error: 'Unmatched closing parenthesis' }\n }\n i++\n // Read multiplier after closing paren\n let numStr = ''\n while (i < formula.length && /\\d/.test(formula[i])) {\n numStr += formula[i]\n i++\n }\n const multiplier = numStr ? parseInt(numStr, 10) : 1\n const top = stack.pop()!\n const current = stack[stack.length - 1]\n for (const [el, count] of Object.entries(top)) {\n current[el] = (current[el] || 0) + count * multiplier\n }\n } else if (/[A-Z]/.test(ch)) {\n // Element symbol: uppercase letter optionally followed by lowercase\n let symbol = ch\n i++\n while (i < formula.length && /[a-z]/.test(formula[i])) {\n symbol += formula[i]\n i++\n }\n // Validate element\n if (!(symbol in ATOMIC_WEIGHTS)) {\n return { elements: {}, valid: false, error: `Unknown element: ${symbol}` }\n }\n // Read count\n let numStr = ''\n while (i < formula.length && /\\d/.test(formula[i])) {\n numStr += formula[i]\n i++\n }\n const count = numStr ? parseInt(numStr, 10) : 1\n const current = stack[stack.length - 1]\n current[symbol] = (current[symbol] || 0) + count\n } else {\n return { elements: {}, valid: false, error: `Unexpected character: ${ch}` }\n }\n }\n\n if (stack.length !== 1) {\n return { elements: {}, valid: false, error: 'Unmatched opening parenthesis' }\n }\n\n Object.assign(elements, stack[0])\n return { elements, valid: true }\n}\n\n/** Parses and renders chemical formulas, computes molecular weight, and generates rich-text formula parts. */\nexport function useChemicalFormula() {\n function parseFormula(formula: string): FormulaParseResult {\n const trimmed = formula.trim()\n if (!trimmed) {\n return { elements: {}, valid: false, error: 'Empty formula' }\n }\n\n // A trailing charge (SO4^2-, Fe2+, NH4+) does not change the composition. Like renderFormulaParts,\n // digits before a bare sign are the charge only on a lone element (Fe2+); otherwise they are a\n // subscript and the sign a unit charge (NH4+). Write Hg2^2+ for any other multiple charge.\n const body = trimmed.replace(/^([A-Z][a-z]?)\\d*[+-]$/, '$1').replace(/(\\^\\d*)?[+-]$/, '')\n if (!body) {\n return { elements: {}, valid: false, error: 'Empty formula' }\n }\n // Split on hydrate separator (·, . or *)\n const parts = body.split(/[·.*]/)\n const combined: Record<string, number> = {}\n\n for (const part of parts) {\n const segment = part.trim()\n if (!segment) continue\n\n // Check for leading coefficient (e.g., 5H2O)\n let coefficient = 1\n let formulaStr = segment\n const coeffMatch = segment.match(/^(\\d+)([A-Z].*)$/)\n if (coeffMatch) {\n coefficient = parseInt(coeffMatch[1], 10)\n formulaStr = coeffMatch[2]\n }\n\n const result = parseFormulaSegment(formulaStr)\n if (!result.valid) {\n return result\n }\n\n for (const [el, count] of Object.entries(result.elements)) {\n combined[el] = (combined[el] || 0) + count * coefficient\n }\n }\n\n return { elements: combined, valid: true }\n }\n\n function calculateMW(elements: Record<string, number>): number {\n let mw = 0\n for (const [el, count] of Object.entries(elements)) {\n const weight = ATOMIC_WEIGHTS[el]\n if (weight !== undefined) {\n mw += weight * count\n }\n }\n return Math.round(mw * 1000) / 1000\n }\n\n function renderFormulaParts(formula: string): FormulaPart[] {\n const parts: FormulaPart[] = []\n const trimmed = formula.trim()\n let i = 0\n\n while (i < trimmed.length) {\n const ch = trimmed[i]\n\n // Hydrate dot separator\n if (ch === '·' || (ch === '.' && i > 0 && /\\d/.test(trimmed[i - 1]) && i + 1 < trimmed.length && /\\d/.test(trimmed[i + 1]))) {\n // Disambiguate: '.' as hydrate separator only if followed by a digit then uppercase\n // For simplicity, treat '·' always as dot\n if (ch === '·') {\n parts.push({ type: 'dot', text: '·' })\n i++\n continue\n }\n }\n\n // Parentheses\n if (ch === '(' || ch === ')') {\n parts.push({ type: 'paren', text: ch })\n i++\n // After ')' check for subscript number\n if (ch === ')' && i < trimmed.length && /\\d/.test(trimmed[i])) {\n let numStr = ''\n while (i < trimmed.length && /\\d/.test(trimmed[i])) {\n numStr += trimmed[i]\n i++\n }\n parts.push({ type: 'subscript', text: numStr })\n }\n continue\n }\n\n // Charge notation: ^2+, ^2-, 2+, 2- at end, or +, -\n if (ch === '^') {\n i++\n let chargeStr = ''\n while (i < trimmed.length && /[\\d+\\-]/.test(trimmed[i])) {\n chargeStr += trimmed[i]\n i++\n }\n if (chargeStr) {\n parts.push({ type: 'charge', text: chargeStr })\n }\n continue\n }\n\n // Element symbol: uppercase followed by optional lowercase\n if (/[A-Z]/.test(ch)) {\n let symbol = ch\n i++\n while (i < trimmed.length && /[a-z]/.test(trimmed[i])) {\n symbol += trimmed[i]\n i++\n }\n parts.push({ type: 'element', text: symbol })\n\n // Check for subscript number after element\n if (i < trimmed.length && /\\d/.test(trimmed[i])) {\n let numStr = ''\n while (i < trimmed.length && /\\d/.test(trimmed[i])) {\n numStr += trimmed[i]\n i++\n }\n parts.push({ type: 'subscript', text: numStr })\n\n // On a lone element the digits before a trailing sign are the charge (Fe2+);\n // elsewhere they stay a subscript and the sign renders as a unit charge (NH4+).\n if (parts.length === 2 && i === trimmed.length - 1 && (trimmed[i] === '+' || trimmed[i] === '-')) {\n parts.push({ type: 'charge', text: numStr + trimmed[i] })\n parts.splice(parts.length - 2, 1) // Remove the subscript\n i++\n continue\n }\n }\n continue\n }\n\n // Leading digit (hydrate coefficient like 5H2O)\n if (/\\d/.test(ch)) {\n let numStr = ''\n while (i < trimmed.length && /\\d/.test(trimmed[i])) {\n numStr += trimmed[i]\n i++\n }\n // Could be a subscript or coefficient depending on context\n // If next char is uppercase, it's a coefficient (render as element-like text)\n // If at end or followed by +/-, it's a charge component\n const prev = parts[parts.length - 1]\n if (i < trimmed.length && (trimmed[i] === '+' || trimmed[i] === '-')) {\n parts.push({ type: 'charge', text: numStr + trimmed[i] })\n i++\n } else if (!prev || prev.type === 'dot') {\n parts.push({ type: 'coefficient', text: numStr })\n } else {\n parts.push({ type: 'subscript', text: numStr })\n }\n continue\n }\n\n // Standalone + or - (charge)\n if (ch === '+' || ch === '-') {\n parts.push({ type: 'charge', text: ch })\n i++\n continue\n }\n\n // Dot or asterisk as hydrate separator\n if (ch === '.' || ch === '*') {\n parts.push({ type: 'dot', text: '·' })\n i++\n continue\n }\n\n // Skip whitespace\n if (/\\s/.test(ch)) {\n i++\n continue\n }\n\n // Unknown character, skip\n i++\n }\n\n return parts\n }\n\n return {\n parseFormula,\n calculateMW,\n renderFormulaParts,\n }\n}\n","<script setup lang=\"ts\">\n/**\n * Text input for chemical formulas (e.g. Ca(OH)2, CuSO4·5H2O). Blurred, the field shows the rendered\n * formula; focused, the raw text. A fixed segment shows the molecular weight; an unknown symbol puts\n * the field in the error state and names the symbol.\n */\nimport { computed, ref } from 'vue'\nimport { useChemicalFormula } from '../composables/useChemicalFormula'\n\ninterface Props {\n modelValue?: string\n showPreview?: boolean\n showMW?: boolean\n placeholder?: string\n error?: boolean\n disabled?: boolean\n size?: 'sm' | 'md' | 'lg'\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: '',\n showPreview: true,\n showMW: true,\n placeholder: 'e.g. Ca(OH)2',\n error: false,\n disabled: false,\n size: 'md',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n 'mw': [mw: number | null]\n}>()\n\nconst { parseFormula, calculateMW, renderFormulaParts } = useChemicalFormula()\n\nconst focused = ref(false)\n\nfunction analyse(value: string) {\n if (!value.trim()) return { mw: null, error: null }\n const result = parseFormula(value)\n if (!result.valid) return { mw: null, error: result.error || 'Invalid formula' }\n return { mw: calculateMW(result.elements), error: null }\n}\n\nconst analysis = computed(() => analyse(props.modelValue))\nconst parts = computed(() => renderFormulaParts(props.modelValue))\nconst showRendered = computed(() =>\n props.showPreview && !focused.value && Boolean(props.modelValue.trim()) && !analysis.value.error,\n)\nconst mwText = computed(() => (analysis.value.mw === null ? '—' : analysis.value.mw.toFixed(2)))\n\nfunction handleInput(event: Event) {\n const value = (event.target as HTMLInputElement).value\n emit('update:modelValue', value)\n emit('mw', analyse(value).mw)\n}\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-formula-input',\n error || analysis.error ? 'mint-formula-input--error' : '',\n disabled ? 'mint-formula-input--disabled' : '',\n ]\"\n >\n <div :class=\"['mint-formula-input__field', `mint-formula-input__field--${size}`]\">\n <div class=\"mint-formula-input__entry\">\n <input\n type=\"text\"\n :value=\"modelValue\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :aria-invalid=\"error || Boolean(analysis.error) || undefined\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n :class=\"['mint-formula-input__input', showRendered ? 'mint-formula-input__input--masked' : '']\"\n aria-label=\"Chemical formula\"\n @input=\"handleInput\"\n @focus=\"focused = true\"\n @blur=\"focused = false\"\n />\n <span v-if=\"showRendered\" class=\"mint-formula-input__rendered\" aria-hidden=\"true\">\n <template v-for=\"(part, i) in parts\" :key=\"i\">\n <span v-if=\"part.type === 'subscript'\" class=\"mint-formula-input__sub\">{{ part.text }}</span>\n <span v-else-if=\"part.type === 'superscript' || part.type === 'charge'\" class=\"mint-formula-input__sup\">{{ part.text }}</span>\n <span v-else-if=\"part.type === 'dot'\" class=\"mint-formula-input__dot\">{{ part.text }}</span>\n <span v-else>{{ part.text }}</span>\n </template>\n </span>\n </div>\n <span v-if=\"showMW\" class=\"mint-formula-input__mw\"><span class=\"mint-formula-input__mw-label\">MW</span> <span class=\"mint-formula-input__mw-value\">{{ mwText }}</span> <span class=\"mint-formula-input__mw-unit\">g/mol</span></span>\n </div>\n\n <div v-if=\"analysis.error\" class=\"mint-formula-input__error-text\">\n {{ analysis.error }}\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * Text input for chemical formulas (e.g. Ca(OH)2, CuSO4·5H2O). Blurred, the field shows the rendered\n * formula; focused, the raw text. A fixed segment shows the molecular weight; an unknown symbol puts\n * the field in the error state and names the symbol.\n */\nimport { computed, ref } from 'vue'\nimport { useChemicalFormula } from '../composables/useChemicalFormula'\n\ninterface Props {\n modelValue?: string\n showPreview?: boolean\n showMW?: boolean\n placeholder?: string\n error?: boolean\n disabled?: boolean\n size?: 'sm' | 'md' | 'lg'\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: '',\n showPreview: true,\n showMW: true,\n placeholder: 'e.g. Ca(OH)2',\n error: false,\n disabled: false,\n size: 'md',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n 'mw': [mw: number | null]\n}>()\n\nconst { parseFormula, calculateMW, renderFormulaParts } = useChemicalFormula()\n\nconst focused = ref(false)\n\nfunction analyse(value: string) {\n if (!value.trim()) return { mw: null, error: null }\n const result = parseFormula(value)\n if (!result.valid) return { mw: null, error: result.error || 'Invalid formula' }\n return { mw: calculateMW(result.elements), error: null }\n}\n\nconst analysis = computed(() => analyse(props.modelValue))\nconst parts = computed(() => renderFormulaParts(props.modelValue))\nconst showRendered = computed(() =>\n props.showPreview && !focused.value && Boolean(props.modelValue.trim()) && !analysis.value.error,\n)\nconst mwText = computed(() => (analysis.value.mw === null ? '—' : analysis.value.mw.toFixed(2)))\n\nfunction handleInput(event: Event) {\n const value = (event.target as HTMLInputElement).value\n emit('update:modelValue', value)\n emit('mw', analyse(value).mw)\n}\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-formula-input',\n error || analysis.error ? 'mint-formula-input--error' : '',\n disabled ? 'mint-formula-input--disabled' : '',\n ]\"\n >\n <div :class=\"['mint-formula-input__field', `mint-formula-input__field--${size}`]\">\n <div class=\"mint-formula-input__entry\">\n <input\n type=\"text\"\n :value=\"modelValue\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :aria-invalid=\"error || Boolean(analysis.error) || undefined\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n :class=\"['mint-formula-input__input', showRendered ? 'mint-formula-input__input--masked' : '']\"\n aria-label=\"Chemical formula\"\n @input=\"handleInput\"\n @focus=\"focused = true\"\n @blur=\"focused = false\"\n />\n <span v-if=\"showRendered\" class=\"mint-formula-input__rendered\" aria-hidden=\"true\">\n <template v-for=\"(part, i) in parts\" :key=\"i\">\n <span v-if=\"part.type === 'subscript'\" class=\"mint-formula-input__sub\">{{ part.text }}</span>\n <span v-else-if=\"part.type === 'superscript' || part.type === 'charge'\" class=\"mint-formula-input__sup\">{{ part.text }}</span>\n <span v-else-if=\"part.type === 'dot'\" class=\"mint-formula-input__dot\">{{ part.text }}</span>\n <span v-else>{{ part.text }}</span>\n </template>\n </span>\n </div>\n <span v-if=\"showMW\" class=\"mint-formula-input__mw\"><span class=\"mint-formula-input__mw-label\">MW</span> <span class=\"mint-formula-input__mw-value\">{{ mwText }}</span> <span class=\"mint-formula-input__mw-unit\">g/mol</span></span>\n </div>\n\n <div v-if=\"analysis.error\" class=\"mint-formula-input__error-text\">\n {{ analysis.error }}\n </div>\n </div>\n</template>\n","export type SequenceType = 'dna' | 'rna' | 'protein' | 'auto'\n\nexport interface SequenceStats {\n length: number\n gcPercent?: number\n molecularWeight?: number\n}\n\n/** What `validateSequence` would strip or flag, so a field can report it instead. */\nexport interface SequenceProblems {\n /** Ambiguous `N` bases (DNA/RNA only; `N` is asparagine in protein). */\n ambiguousBases: number\n /** Unique characters outside the alphabet, upper-cased, in order of appearance. Whitespace is ignored. */\n invalidCharacters: string[]\n}\n\nconst DNA_CHARS = /[^ATCGNatcgn]/g\nconst RNA_CHARS = /[^AUCGNaucgn]/g\nconst PROTEIN_CHARS = /[^ACDEFGHIKLMNPQRSTVWYacdefghiklmnpqrstvwy]/g\n\nconst DNA_COMPLEMENT: Record<string, string> = {\n A: 'T', T: 'A', C: 'G', G: 'C', N: 'N',\n a: 't', t: 'a', c: 'g', g: 'c', n: 'n',\n}\n\nconst RNA_COMPLEMENT: Record<string, string> = {\n A: 'U', U: 'A', C: 'G', G: 'C', N: 'N',\n a: 'u', u: 'a', c: 'g', g: 'c', n: 'n',\n}\n\n// Average molecular weights per residue\nconst MW_DNA_NT = 330 // Da per nucleotide (average)\nconst MW_RNA_NT = 340 // Da per nucleotide (average)\nconst MW_PROTEIN_AA = 110 // Da per amino acid (average)\n\n/** Detects, validates, cleans, and computes stats (GC%, MW) for DNA, RNA, and protein sequences. */\nexport function useSequenceUtils() {\n function detectSequenceType(seq: string): 'dna' | 'rna' | 'protein' {\n const upper = seq.toUpperCase()\n\n // If contains U but not T, it's RNA\n if (upper.includes('U') && !upper.includes('T')) {\n return 'rna'\n }\n\n // If its letters are only ATCGN, it's DNA (line breaks, spaces and digits don't count)\n if (/^[ATCGN]+$/i.test(seq.replace(/[^a-z]/gi, ''))) {\n return 'dna'\n }\n\n return 'protein'\n }\n\n function validateSequence(seq: string, type: SequenceType): string {\n const effectiveType = type === 'auto' ? detectSequenceType(seq) : type\n\n switch (effectiveType) {\n case 'dna':\n return seq.replace(DNA_CHARS, '')\n case 'rna':\n return seq.replace(RNA_CHARS, '')\n case 'protein':\n return seq.replace(PROTEIN_CHARS, '')\n default:\n return seq\n }\n }\n\n function findSequenceProblems(seq: string, type: 'dna' | 'rna' | 'protein'): SequenceProblems {\n const alphabet = { dna: DNA_CHARS, rna: RNA_CHARS, protein: PROTEIN_CHARS }[type]\n const invalid = seq.replace(/\\s/g, '').match(alphabet) ?? []\n return {\n ambiguousBases: type === 'protein' ? 0 : (seq.match(/n/gi) ?? []).length,\n invalidCharacters: [...new Set(invalid.map(ch => ch.toUpperCase()))],\n }\n }\n\n function reverseComplement(seq: string, type: 'dna' | 'rna'): string {\n const complementMap = type === 'dna' ? DNA_COMPLEMENT : RNA_COMPLEMENT\n\n return seq\n .split('')\n .reverse()\n .map(ch => complementMap[ch] ?? ch)\n .join('')\n }\n\n function calculateStats(seq: string, type: 'dna' | 'rna' | 'protein'): SequenceStats {\n const length = seq.length\n const stats: SequenceStats = { length }\n\n if (type === 'dna' || type === 'rna') {\n const upper = seq.toUpperCase()\n let gcCount = 0\n for (const ch of upper) {\n if (ch === 'G' || ch === 'C') gcCount++\n }\n stats.gcPercent = length > 0 ? Math.round((gcCount / length) * 10000) / 100 : 0\n stats.molecularWeight = length * (type === 'dna' ? MW_DNA_NT : MW_RNA_NT)\n } else {\n stats.molecularWeight = length * MW_PROTEIN_AA\n }\n\n return stats\n }\n\n function formatFasta(seq: string, lineWidth: number = 60): string {\n const lines: string[] = []\n for (let i = 0; i < seq.length; i += lineWidth) {\n lines.push(seq.slice(i, i + lineWidth))\n }\n return lines.join('\\n')\n }\n\n return {\n detectSequenceType,\n validateSequence,\n findSequenceProblems,\n reverseComplement,\n calculateStats,\n formatFasta,\n }\n}\n","<script setup lang=\"ts\">\n/** Textarea for DNA/RNA/protein sequences with auto-detection, validation, GC-content stats, reverse-complement, and FASTA formatting tools. */\nimport { computed, ref, watch } from 'vue'\nimport { useSequenceUtils, type SequenceType, type SequenceStats } from '../composables/useSequenceUtils'\n\ninterface Props {\n modelValue?: string\n type?: SequenceType\n readonly?: boolean\n showStats?: boolean\n showTools?: boolean\n maxLength?: number\n placeholder?: string\n rows?: number\n error?: boolean\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: '',\n type: 'auto',\n readonly: false,\n showStats: true,\n showTools: true,\n rows: 6,\n placeholder: 'Paste or type sequence...',\n error: false,\n disabled: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\ndefineSlots<{\n tools?(props: { sequence: string; type: 'dna' | 'rna' | 'protein'; stats: SequenceStats }): unknown\n}>()\n\nconst { detectSequenceType, validateSequence, findSequenceProblems, reverseComplement, calculateStats, formatFasta } = useSequenceUtils()\n\n// The field shows what was typed; `modelValue` stays the sanitised sequence and\n// the stripped characters are reported below the field instead of vanishing (9c).\nconst draft = ref(props.modelValue)\nlet lastEmitted = props.modelValue\nwatch(() => props.modelValue, (value) => {\n if (value === lastEmitted) return\n draft.value = value\n lastEmitted = value\n})\n\n// Detected from what was typed, so residues the sanitised value would drop still count.\nconst resolvedType = computed<'dna' | 'rna' | 'protein'>(() => {\n if (props.type !== 'auto') return props.type as 'dna' | 'rna' | 'protein'\n if (!draft.value) return 'dna'\n return detectSequenceType(draft.value)\n})\n\nconst TYPE_LABELS = { dna: 'DNA', rna: 'RNA', protein: 'Protein' } as const\n\nconst stats = computed<SequenceStats>(() => {\n if (!props.modelValue) return { length: 0 }\n return calculateStats(props.modelValue, resolvedType.value)\n})\n\nconst problems = computed(() => findSequenceProblems(draft.value, resolvedType.value))\nconst hasInvalid = computed(() => problems.value.invalidCharacters.length > 0)\n\nconst viewerLines = computed(() => {\n if (!props.modelValue) return []\n const formatted = formatFasta(props.modelValue, 60)\n return formatted.split('\\n').filter(l => l.length > 0)\n})\n\nfunction handleInput(event: Event) {\n const target = event.target as HTMLTextAreaElement\n draft.value = target.value\n // maxLength counts sequence characters, so the cut falls after the last one that fits.\n const value = capToMaxLength(target.value, resolvedType.value)\n if (value !== target.value) {\n draft.value = value\n target.value = value\n }\n lastEmitted = validateSequence(value, resolvedType.value)\n emit('update:modelValue', lastEmitted)\n}\n\nfunction capToMaxLength(text: string, type: 'dna' | 'rna' | 'protein'): string {\n if (!props.maxLength) return text\n let kept = 0\n for (let i = 0; i < text.length; i++) {\n kept += validateSequence(text[i], type).length\n if (kept > props.maxLength) return text.slice(0, i)\n }\n return text\n}\n\nfunction doReverseComplement() {\n if (!props.modelValue || resolvedType.value === 'protein') return\n emit('update:modelValue', reverseComplement(props.modelValue, resolvedType.value as 'dna' | 'rna'))\n}\n\nfunction doUppercase() {\n if (!props.modelValue) return\n emit('update:modelValue', props.modelValue.toUpperCase())\n}\n\nfunction doClear() {\n draft.value = ''\n emit('update:modelValue', '')\n}\n\nfunction doCopy() {\n if (!props.modelValue) return\n navigator.clipboard.writeText(props.modelValue)\n}\n\nfunction getBaseClass(char: string): string {\n const c = char.toLowerCase()\n if (c === 'a') return 'mint-sequence-input__base--a'\n if (c === 't') return 'mint-sequence-input__base--t'\n if (c === 'u') return 'mint-sequence-input__base--u'\n if (c === 'g') return 'mint-sequence-input__base--g'\n if (c === 'c') return 'mint-sequence-input__base--c'\n if (c === 'n') return 'mint-sequence-input__base--n'\n return ''\n}\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-sequence-input',\n error || hasInvalid ? 'mint-sequence-input--error' : '',\n disabled ? 'mint-sequence-input--disabled' : '',\n ]\"\n >\n <!-- Toolbar -->\n <div v-if=\"showTools && !readonly\" class=\"mint-sequence-input__toolbar\">\n <span class=\"mint-sequence-input__type-badge\">{{ TYPE_LABELS[resolvedType] }}</span>\n <div class=\"mint-sequence-input__tool-sep\" />\n <slot name=\"tools\" :sequence=\"modelValue || ''\" :type=\"resolvedType\" :stats=\"stats\">\n <button\n v-if=\"resolvedType !== 'protein'\"\n type=\"button\"\n class=\"mint-sequence-input__tool-btn\"\n :disabled=\"!modelValue || disabled\"\n @click=\"doReverseComplement\"\n >\n Rev Comp\n </button>\n <button\n type=\"button\"\n class=\"mint-sequence-input__tool-btn\"\n :disabled=\"!modelValue || disabled\"\n @click=\"doUppercase\"\n >\n Uppercase\n </button>\n <div class=\"mint-sequence-input__tool-sep\" />\n <button\n type=\"button\"\n class=\"mint-sequence-input__tool-btn\"\n :disabled=\"!modelValue || disabled\"\n @click=\"doCopy\"\n >\n Copy\n </button>\n <button\n type=\"button\"\n class=\"mint-sequence-input__tool-btn\"\n :disabled=\"!draft || disabled\"\n @click=\"doClear\"\n >\n Clear\n </button>\n </slot>\n </div>\n\n <!-- Editor (input mode) -->\n <div v-if=\"!readonly\" class=\"mint-sequence-input__editor\">\n <textarea\n :value=\"draft\"\n :rows=\"rows\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n class=\"mint-sequence-input__textarea\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n @input=\"handleInput\"\n />\n </div>\n\n <!-- Viewer (readonly mode) -->\n <div v-else class=\"mint-sequence-input__viewer\">\n <div\n v-for=\"(line, lineIdx) in viewerLines\"\n :key=\"lineIdx\"\n class=\"mint-sequence-input__viewer-line\"\n >\n <span class=\"mint-sequence-input__line-number\">{{ lineIdx * 60 + 1 }}</span>\n <span class=\"mint-sequence-input__line-content\">\n <span\n v-for=\"(char, charIdx) in line.split('')\"\n :key=\"charIdx\"\n :class=\"getBaseClass(char)\"\n >{{ char }}</span>\n </span>\n </div>\n <div v-if=\"!modelValue\" class=\"mint-sequence-input__viewer-line\">\n <span class=\"mint-sequence-input__line-number\" />\n <span class=\"mint-sequence-input__line-content\" style=\"color: var(--text-muted);\">No sequence</span>\n </div>\n </div>\n\n <!-- Stats and problems -->\n <div\n v-if=\"(showStats && modelValue) || problems.ambiguousBases || hasInvalid\"\n class=\"mint-sequence-input__stats\"\n >\n <template v-if=\"showStats && modelValue\">\n <span>\n <span class=\"mint-sequence-input__stat-label\">Length:</span>\n <span class=\"mint-sequence-input__stat-value\">{{ stats.length }}</span>\n </span>\n <span v-if=\"stats.gcPercent !== undefined\">\n <span class=\"mint-sequence-input__stat-label\">GC:</span>\n <span class=\"mint-sequence-input__stat-value\">{{ stats.gcPercent.toFixed(1) }}%</span>\n </span>\n <span v-if=\"stats.molecularWeight !== undefined\">\n <span class=\"mint-sequence-input__stat-label\">MW:</span>\n <span class=\"mint-sequence-input__stat-value\">~{{ (stats.molecularWeight / 1000).toFixed(1) }} kDa</span>\n </span>\n </template>\n <span v-if=\"problems.ambiguousBases\" class=\"mint-sequence-input__problem mint-sequence-input__problem--warning\">\n <svg class=\"mint-sequence-input__problem-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path class=\"mint-sequence-input__problem-shape\" d=\"M8 1.5l7 12.5H1z\" />\n <path class=\"mint-sequence-input__problem-mark\" d=\"M8 6v3.5M8 11.5v.01\" />\n </svg>\n {{ problems.ambiguousBases }} ambiguous bases (N)\n </span>\n <span v-if=\"hasInvalid\" role=\"alert\" class=\"mint-sequence-input__problem mint-sequence-input__problem--error\">\n <svg class=\"mint-sequence-input__problem-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <circle class=\"mint-sequence-input__problem-shape\" cx=\"8\" cy=\"8\" r=\"7\" />\n <path class=\"mint-sequence-input__problem-mark\" d=\"M8 4.5v4M8 11.5v.01\" />\n </svg>\n Invalid characters: {{ problems.invalidCharacters.join(' ') }}\n </span>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Textarea for DNA/RNA/protein sequences with auto-detection, validation, GC-content stats, reverse-complement, and FASTA formatting tools. */\nimport { computed, ref, watch } from 'vue'\nimport { useSequenceUtils, type SequenceType, type SequenceStats } from '../composables/useSequenceUtils'\n\ninterface Props {\n modelValue?: string\n type?: SequenceType\n readonly?: boolean\n showStats?: boolean\n showTools?: boolean\n maxLength?: number\n placeholder?: string\n rows?: number\n error?: boolean\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: '',\n type: 'auto',\n readonly: false,\n showStats: true,\n showTools: true,\n rows: 6,\n placeholder: 'Paste or type sequence...',\n error: false,\n disabled: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\ndefineSlots<{\n tools?(props: { sequence: string; type: 'dna' | 'rna' | 'protein'; stats: SequenceStats }): unknown\n}>()\n\nconst { detectSequenceType, validateSequence, findSequenceProblems, reverseComplement, calculateStats, formatFasta } = useSequenceUtils()\n\n// The field shows what was typed; `modelValue` stays the sanitised sequence and\n// the stripped characters are reported below the field instead of vanishing (9c).\nconst draft = ref(props.modelValue)\nlet lastEmitted = props.modelValue\nwatch(() => props.modelValue, (value) => {\n if (value === lastEmitted) return\n draft.value = value\n lastEmitted = value\n})\n\n// Detected from what was typed, so residues the sanitised value would drop still count.\nconst resolvedType = computed<'dna' | 'rna' | 'protein'>(() => {\n if (props.type !== 'auto') return props.type as 'dna' | 'rna' | 'protein'\n if (!draft.value) return 'dna'\n return detectSequenceType(draft.value)\n})\n\nconst TYPE_LABELS = { dna: 'DNA', rna: 'RNA', protein: 'Protein' } as const\n\nconst stats = computed<SequenceStats>(() => {\n if (!props.modelValue) return { length: 0 }\n return calculateStats(props.modelValue, resolvedType.value)\n})\n\nconst problems = computed(() => findSequenceProblems(draft.value, resolvedType.value))\nconst hasInvalid = computed(() => problems.value.invalidCharacters.length > 0)\n\nconst viewerLines = computed(() => {\n if (!props.modelValue) return []\n const formatted = formatFasta(props.modelValue, 60)\n return formatted.split('\\n').filter(l => l.length > 0)\n})\n\nfunction handleInput(event: Event) {\n const target = event.target as HTMLTextAreaElement\n draft.value = target.value\n // maxLength counts sequence characters, so the cut falls after the last one that fits.\n const value = capToMaxLength(target.value, resolvedType.value)\n if (value !== target.value) {\n draft.value = value\n target.value = value\n }\n lastEmitted = validateSequence(value, resolvedType.value)\n emit('update:modelValue', lastEmitted)\n}\n\nfunction capToMaxLength(text: string, type: 'dna' | 'rna' | 'protein'): string {\n if (!props.maxLength) return text\n let kept = 0\n for (let i = 0; i < text.length; i++) {\n kept += validateSequence(text[i], type).length\n if (kept > props.maxLength) return text.slice(0, i)\n }\n return text\n}\n\nfunction doReverseComplement() {\n if (!props.modelValue || resolvedType.value === 'protein') return\n emit('update:modelValue', reverseComplement(props.modelValue, resolvedType.value as 'dna' | 'rna'))\n}\n\nfunction doUppercase() {\n if (!props.modelValue) return\n emit('update:modelValue', props.modelValue.toUpperCase())\n}\n\nfunction doClear() {\n draft.value = ''\n emit('update:modelValue', '')\n}\n\nfunction doCopy() {\n if (!props.modelValue) return\n navigator.clipboard.writeText(props.modelValue)\n}\n\nfunction getBaseClass(char: string): string {\n const c = char.toLowerCase()\n if (c === 'a') return 'mint-sequence-input__base--a'\n if (c === 't') return 'mint-sequence-input__base--t'\n if (c === 'u') return 'mint-sequence-input__base--u'\n if (c === 'g') return 'mint-sequence-input__base--g'\n if (c === 'c') return 'mint-sequence-input__base--c'\n if (c === 'n') return 'mint-sequence-input__base--n'\n return ''\n}\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-sequence-input',\n error || hasInvalid ? 'mint-sequence-input--error' : '',\n disabled ? 'mint-sequence-input--disabled' : '',\n ]\"\n >\n <!-- Toolbar -->\n <div v-if=\"showTools && !readonly\" class=\"mint-sequence-input__toolbar\">\n <span class=\"mint-sequence-input__type-badge\">{{ TYPE_LABELS[resolvedType] }}</span>\n <div class=\"mint-sequence-input__tool-sep\" />\n <slot name=\"tools\" :sequence=\"modelValue || ''\" :type=\"resolvedType\" :stats=\"stats\">\n <button\n v-if=\"resolvedType !== 'protein'\"\n type=\"button\"\n class=\"mint-sequence-input__tool-btn\"\n :disabled=\"!modelValue || disabled\"\n @click=\"doReverseComplement\"\n >\n Rev Comp\n </button>\n <button\n type=\"button\"\n class=\"mint-sequence-input__tool-btn\"\n :disabled=\"!modelValue || disabled\"\n @click=\"doUppercase\"\n >\n Uppercase\n </button>\n <div class=\"mint-sequence-input__tool-sep\" />\n <button\n type=\"button\"\n class=\"mint-sequence-input__tool-btn\"\n :disabled=\"!modelValue || disabled\"\n @click=\"doCopy\"\n >\n Copy\n </button>\n <button\n type=\"button\"\n class=\"mint-sequence-input__tool-btn\"\n :disabled=\"!draft || disabled\"\n @click=\"doClear\"\n >\n Clear\n </button>\n </slot>\n </div>\n\n <!-- Editor (input mode) -->\n <div v-if=\"!readonly\" class=\"mint-sequence-input__editor\">\n <textarea\n :value=\"draft\"\n :rows=\"rows\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n class=\"mint-sequence-input__textarea\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n @input=\"handleInput\"\n />\n </div>\n\n <!-- Viewer (readonly mode) -->\n <div v-else class=\"mint-sequence-input__viewer\">\n <div\n v-for=\"(line, lineIdx) in viewerLines\"\n :key=\"lineIdx\"\n class=\"mint-sequence-input__viewer-line\"\n >\n <span class=\"mint-sequence-input__line-number\">{{ lineIdx * 60 + 1 }}</span>\n <span class=\"mint-sequence-input__line-content\">\n <span\n v-for=\"(char, charIdx) in line.split('')\"\n :key=\"charIdx\"\n :class=\"getBaseClass(char)\"\n >{{ char }}</span>\n </span>\n </div>\n <div v-if=\"!modelValue\" class=\"mint-sequence-input__viewer-line\">\n <span class=\"mint-sequence-input__line-number\" />\n <span class=\"mint-sequence-input__line-content\" style=\"color: var(--text-muted);\">No sequence</span>\n </div>\n </div>\n\n <!-- Stats and problems -->\n <div\n v-if=\"(showStats && modelValue) || problems.ambiguousBases || hasInvalid\"\n class=\"mint-sequence-input__stats\"\n >\n <template v-if=\"showStats && modelValue\">\n <span>\n <span class=\"mint-sequence-input__stat-label\">Length:</span>\n <span class=\"mint-sequence-input__stat-value\">{{ stats.length }}</span>\n </span>\n <span v-if=\"stats.gcPercent !== undefined\">\n <span class=\"mint-sequence-input__stat-label\">GC:</span>\n <span class=\"mint-sequence-input__stat-value\">{{ stats.gcPercent.toFixed(1) }}%</span>\n </span>\n <span v-if=\"stats.molecularWeight !== undefined\">\n <span class=\"mint-sequence-input__stat-label\">MW:</span>\n <span class=\"mint-sequence-input__stat-value\">~{{ (stats.molecularWeight / 1000).toFixed(1) }} kDa</span>\n </span>\n </template>\n <span v-if=\"problems.ambiguousBases\" class=\"mint-sequence-input__problem mint-sequence-input__problem--warning\">\n <svg class=\"mint-sequence-input__problem-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path class=\"mint-sequence-input__problem-shape\" d=\"M8 1.5l7 12.5H1z\" />\n <path class=\"mint-sequence-input__problem-mark\" d=\"M8 6v3.5M8 11.5v.01\" />\n </svg>\n {{ problems.ambiguousBases }} ambiguous bases (N)\n </span>\n <span v-if=\"hasInvalid\" role=\"alert\" class=\"mint-sequence-input__problem mint-sequence-input__problem--error\">\n <svg class=\"mint-sequence-input__problem-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <circle class=\"mint-sequence-input__problem-shape\" cx=\"8\" cy=\"8\" r=\"7\" />\n <path class=\"mint-sequence-input__problem-mark\" d=\"M8 4.5v4M8 11.5v.01\" />\n </svg>\n Invalid characters: {{ problems.invalidCharacters.join(' ') }}\n </span>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Interactive chemical structure editor powered by JSME, emitting SMILES strings for compound registration in experiment design. */\nimport { ref, computed, onMounted, onUnmounted, watch, nextTick } from 'vue'\nimport type { MoleculeData } from '../types'\n\ninterface Props {\n modelValue?: MoleculeData\n disabled?: boolean\n readonly?: boolean\n height?: number\n showSmiles?: boolean\n placeholder?: string\n error?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n disabled: false,\n readonly: false,\n height: 300,\n showSmiles: true,\n placeholder: 'Draw a chemical structure',\n error: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [data: MoleculeData | undefined]\n 'error': [message: string]\n}>()\n\n// State\nconst containerRef = ref<HTMLDivElement | null>(null)\nconst jsmeInstance = ref<unknown>(null)\nconst isLoading = ref(true)\nconst loadError = ref<string | null>(null)\nconst debounceTimer = ref<ReturnType<typeof setTimeout> | null>(null)\n\n// Computed\nconst hasStructure = computed(() => {\n return props.modelValue?.smiles && props.modelValue.smiles.length > 0\n})\n\n// Use window-level state to persist across component instances and hot-reloads\ninterface JSMEGlobalState {\n __jsmeCallbacks__?: Array<() => void>\n __jsmeLoading__?: boolean\n __jsmeLoaded__?: boolean\n __jsmeLoadPromise__?: Promise<void>\n JSApplet?: { JSME?: new (id: string, width: string, height: string, options?: object) => unknown }\n jsmeOnLoad?: () => void\n}\n\nfunction getJSMEState(): JSMEGlobalState {\n const win = window as unknown as JSMEGlobalState\n if (!win.__jsmeCallbacks__) {\n win.__jsmeCallbacks__ = []\n }\n return win\n}\n\nfunction waitForJSME(): Promise<void> {\n const win = getJSMEState()\n\n // Already loaded\n if (win.JSApplet?.JSME) {\n return Promise.resolve()\n }\n\n // Reuse existing promise if loading\n if (win.__jsmeLoadPromise__) {\n return win.__jsmeLoadPromise__\n }\n\n win.__jsmeLoadPromise__ = new Promise((resolve, reject) => {\n // Double-check after promise creation\n if (win.JSApplet?.JSME) {\n resolve()\n return\n }\n\n // Set up global callback FIRST (before checking for existing script)\n const originalOnLoad = win.jsmeOnLoad\n win.jsmeOnLoad = () => {\n win.__jsmeLoaded__ = true\n originalOnLoad?.()\n win.__jsmeCallbacks__?.forEach(cb => cb())\n win.__jsmeCallbacks__ = []\n resolve()\n }\n\n // Add to callback queue\n win.__jsmeCallbacks__?.push(resolve)\n\n // Drop a failed script and the cached promise so a later mount retries from scratch.\n const fail = (script: Element, message: string) => {\n if (!script.isConnected) return // already failed (timeout, then a late error)\n win.__jsmeLoading__ = false\n win.__jsmeLoadPromise__ = undefined\n script.remove()\n reject(new Error(message))\n }\n\n // Check if script already exists\n const existingScript = document.querySelector('script[data-jsme]')\n if (existingScript) {\n // Script exists, poll for JSApplet.JSME (in case jsmeOnLoad already fired)\n const checkReady = setInterval(() => {\n if (win.JSApplet?.JSME) {\n clearInterval(checkReady)\n win.__jsmeLoaded__ = true\n win.__jsmeCallbacks__?.forEach(cb => cb())\n win.__jsmeCallbacks__ = []\n resolve()\n }\n }, 100)\n\n setTimeout(() => {\n clearInterval(checkReady)\n if (!win.__jsmeLoaded__ && !win.JSApplet?.JSME) {\n fail(existingScript, 'JSME initialization timeout')\n }\n }, 15000)\n return\n }\n\n // Load the script\n win.__jsmeLoading__ = true\n const script = document.createElement('script')\n script.src = 'https://jsme-editor.github.io/dist/jsme/jsme.nocache.js'\n script.integrity = 'sha384-l6tNzsc/eAJ7uql0dGAcHYI5ANVEV7DrJYjzXp3t13L+3OzLnfpzJO0Uio7mUSjY'\n script.crossOrigin = 'anonymous'\n script.async = true\n script.setAttribute('data-jsme', 'true')\n\n script.onerror = () => fail(script, 'Failed to load JSME script')\n\n // Timeout\n setTimeout(() => {\n if (!win.__jsmeLoaded__ && !win.JSApplet?.JSME) {\n fail(script, 'JSME initialization timeout')\n }\n }, 15000)\n\n document.head.appendChild(script)\n })\n\n return win.__jsmeLoadPromise__\n}\n\n// Wait for the browser to complete a paint cycle\nfunction waitForPaint(): Promise<void> {\n return new Promise(resolve => {\n requestAnimationFrame(() => requestAnimationFrame(() => resolve()))\n })\n}\n\n// JSME initialization — two phases:\n// 1. Load the script (no DOM needed)\n// 2. Reveal the editor div, wait for paint, then mount JSME with explicit px dimensions\nasync function initJSME() {\n if (props.readonly) return\n\n try {\n isLoading.value = true\n loadError.value = null\n\n // Phase 1: load the JSME script (independent of DOM)\n await waitForJSME()\n\n const win = getJSMEState()\n if (!win.JSApplet?.JSME) {\n throw new Error('JSME library not available after loading')\n }\n\n // Phase 2: reveal the editor div by clearing the loading state\n isLoading.value = false\n await nextTick()\n\n if (!containerRef.value) return\n\n // Wait for a full paint cycle so GWT can measure the container\n await waitForPaint()\n\n if (!containerRef.value) return\n\n // Use explicit pixel width — GWT cannot resolve percentage widths reliably\n const rect = containerRef.value.getBoundingClientRect()\n const width = Math.floor(rect.width) || 400\n\n // Mount JSME into the now-painted container\n const editorId = `jsme-${Date.now()}`\n containerRef.value.id = editorId\n\n const instance = new win.JSApplet.JSME(\n editorId,\n `${width}px`,\n `${props.height}px`,\n {\n options: 'query,hydrogens,paste',\n }\n )\n\n jsmeInstance.value = instance\n\n // Set initial value if provided\n if (props.modelValue?.molfile) {\n (instance as { readMolFile: (mol: string) => void }).readMolFile(props.modelValue.molfile)\n }\n\n // Set up change callback\n (instance as { setCallBack: (event: string, callback: () => void) => void }).setCallBack('AfterStructureModified', handleStructureChange)\n } catch (err) {\n const message = err instanceof Error ? err.message : 'Failed to load molecule editor'\n loadError.value = message\n emit('error', message)\n isLoading.value = false\n }\n}\n\nfunction handleStructureChange() {\n // Debounce the change event\n if (debounceTimer.value) {\n clearTimeout(debounceTimer.value)\n }\n\n debounceTimer.value = setTimeout(() => {\n if (!jsmeInstance.value) return\n\n const instance = jsmeInstance.value as {\n smiles: () => string\n molFile: () => string\n }\n\n const smiles = instance.smiles()\n const molfile = instance.molFile()\n\n if (!smiles || smiles.length === 0) {\n emit('update:modelValue', undefined)\n } else {\n emit('update:modelValue', { smiles, molfile })\n }\n }, 300)\n}\n\nfunction clearStructure() {\n if (jsmeInstance.value) {\n (jsmeInstance.value as { reset: () => void }).reset()\n }\n emit('update:modelValue', undefined)\n}\n\n// Watch for external value changes\nwatch(() => props.modelValue, (newValue) => {\n if (!jsmeInstance.value) return\n\n const instance = jsmeInstance.value as {\n smiles: () => string\n readMolFile: (mol: string) => void\n reset: () => void\n }\n\n // Only update if the external value differs from current\n const currentSmiles = instance.smiles()\n if (newValue?.smiles !== currentSmiles) {\n if (newValue?.molfile) {\n instance.readMolFile(newValue.molfile)\n } else {\n instance.reset()\n }\n }\n})\n\n// Lifecycle\nonMounted(() => {\n if (!props.readonly) {\n initJSME()\n } else {\n isLoading.value = false\n }\n})\n\nonUnmounted(() => {\n if (debounceTimer.value) {\n clearTimeout(debounceTimer.value)\n }\n jsmeInstance.value = null\n})\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-molecule-input',\n disabled ? 'mint-molecule-input--disabled' : '',\n readonly ? 'mint-molecule-input--readonly' : '',\n error ? 'mint-molecule-input--error' : '',\n ]\"\n >\n <!-- Loading state -->\n <div\n v-if=\"isLoading && !readonly\"\n class=\"mint-molecule-input__skeleton\"\n :style=\"{ height: `${height}px` }\"\n >\n <svg\n class=\"mint-molecule-input__skeleton-icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z\"\n />\n </svg>\n <span class=\"mint-molecule-input__skeleton-text\">Loading molecule editor...</span>\n </div>\n\n <!-- Error state -->\n <div\n v-else-if=\"loadError\"\n class=\"mint-molecule-input__error\"\n >\n <svg\n class=\"mint-molecule-input__error-icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\"\n />\n </svg>\n {{ loadError }}\n </div>\n\n <!-- Readonly mode - show empty or placeholder -->\n <template v-else-if=\"readonly\">\n <div\n v-if=\"hasStructure\"\n class=\"mint-molecule-input__readonly\"\n :style=\"{ height: `${height}px` }\"\n >\n <!-- In readonly mode, we just display a placeholder since we don't have SVG rendering -->\n <div class=\"mint-molecule-input__empty\">\n <svg\n class=\"mint-molecule-input__empty-icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z\"\n />\n </svg>\n <span class=\"mint-molecule-input__empty-text\">Structure defined (readonly)</span>\n </div>\n </div>\n <div\n v-else\n class=\"mint-molecule-input__empty\"\n :style=\"{ height: `${height}px` }\"\n >\n <svg\n class=\"mint-molecule-input__empty-icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z\"\n />\n </svg>\n <span class=\"mint-molecule-input__empty-text\">No structure</span>\n </div>\n </template>\n\n <!-- Editor mode -->\n <template v-else>\n <div\n ref=\"containerRef\"\n class=\"mint-molecule-input__editor\"\n :style=\"{ height: `${height}px` }\"\n role=\"application\"\n aria-label=\"Molecule structure editor\"\n />\n\n <!-- Actions toolbar -->\n <div class=\"mint-molecule-input__actions\">\n <button\n type=\"button\"\n class=\"mint-molecule-input__action-btn\"\n :disabled=\"!hasStructure || disabled\"\n aria-label=\"Clear structure\"\n @click=\"clearStructure\"\n >\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16\" />\n </svg>\n </button>\n </div>\n </template>\n\n <!-- SMILES display -->\n <div\n v-if=\"showSmiles && hasStructure && !loadError\"\n class=\"mint-molecule-input__smiles\"\n >\n <span class=\"mint-molecule-input__smiles-label\">SMILES:</span>\n {{ modelValue?.smiles }}\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Interactive chemical structure editor powered by JSME, emitting SMILES strings for compound registration in experiment design. */\nimport { ref, computed, onMounted, onUnmounted, watch, nextTick } from 'vue'\nimport type { MoleculeData } from '../types'\n\ninterface Props {\n modelValue?: MoleculeData\n disabled?: boolean\n readonly?: boolean\n height?: number\n showSmiles?: boolean\n placeholder?: string\n error?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n disabled: false,\n readonly: false,\n height: 300,\n showSmiles: true,\n placeholder: 'Draw a chemical structure',\n error: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [data: MoleculeData | undefined]\n 'error': [message: string]\n}>()\n\n// State\nconst containerRef = ref<HTMLDivElement | null>(null)\nconst jsmeInstance = ref<unknown>(null)\nconst isLoading = ref(true)\nconst loadError = ref<string | null>(null)\nconst debounceTimer = ref<ReturnType<typeof setTimeout> | null>(null)\n\n// Computed\nconst hasStructure = computed(() => {\n return props.modelValue?.smiles && props.modelValue.smiles.length > 0\n})\n\n// Use window-level state to persist across component instances and hot-reloads\ninterface JSMEGlobalState {\n __jsmeCallbacks__?: Array<() => void>\n __jsmeLoading__?: boolean\n __jsmeLoaded__?: boolean\n __jsmeLoadPromise__?: Promise<void>\n JSApplet?: { JSME?: new (id: string, width: string, height: string, options?: object) => unknown }\n jsmeOnLoad?: () => void\n}\n\nfunction getJSMEState(): JSMEGlobalState {\n const win = window as unknown as JSMEGlobalState\n if (!win.__jsmeCallbacks__) {\n win.__jsmeCallbacks__ = []\n }\n return win\n}\n\nfunction waitForJSME(): Promise<void> {\n const win = getJSMEState()\n\n // Already loaded\n if (win.JSApplet?.JSME) {\n return Promise.resolve()\n }\n\n // Reuse existing promise if loading\n if (win.__jsmeLoadPromise__) {\n return win.__jsmeLoadPromise__\n }\n\n win.__jsmeLoadPromise__ = new Promise((resolve, reject) => {\n // Double-check after promise creation\n if (win.JSApplet?.JSME) {\n resolve()\n return\n }\n\n // Set up global callback FIRST (before checking for existing script)\n const originalOnLoad = win.jsmeOnLoad\n win.jsmeOnLoad = () => {\n win.__jsmeLoaded__ = true\n originalOnLoad?.()\n win.__jsmeCallbacks__?.forEach(cb => cb())\n win.__jsmeCallbacks__ = []\n resolve()\n }\n\n // Add to callback queue\n win.__jsmeCallbacks__?.push(resolve)\n\n // Drop a failed script and the cached promise so a later mount retries from scratch.\n const fail = (script: Element, message: string) => {\n if (!script.isConnected) return // already failed (timeout, then a late error)\n win.__jsmeLoading__ = false\n win.__jsmeLoadPromise__ = undefined\n script.remove()\n reject(new Error(message))\n }\n\n // Check if script already exists\n const existingScript = document.querySelector('script[data-jsme]')\n if (existingScript) {\n // Script exists, poll for JSApplet.JSME (in case jsmeOnLoad already fired)\n const checkReady = setInterval(() => {\n if (win.JSApplet?.JSME) {\n clearInterval(checkReady)\n win.__jsmeLoaded__ = true\n win.__jsmeCallbacks__?.forEach(cb => cb())\n win.__jsmeCallbacks__ = []\n resolve()\n }\n }, 100)\n\n setTimeout(() => {\n clearInterval(checkReady)\n if (!win.__jsmeLoaded__ && !win.JSApplet?.JSME) {\n fail(existingScript, 'JSME initialization timeout')\n }\n }, 15000)\n return\n }\n\n // Load the script\n win.__jsmeLoading__ = true\n const script = document.createElement('script')\n script.src = 'https://jsme-editor.github.io/dist/jsme/jsme.nocache.js'\n script.integrity = 'sha384-l6tNzsc/eAJ7uql0dGAcHYI5ANVEV7DrJYjzXp3t13L+3OzLnfpzJO0Uio7mUSjY'\n script.crossOrigin = 'anonymous'\n script.async = true\n script.setAttribute('data-jsme', 'true')\n\n script.onerror = () => fail(script, 'Failed to load JSME script')\n\n // Timeout\n setTimeout(() => {\n if (!win.__jsmeLoaded__ && !win.JSApplet?.JSME) {\n fail(script, 'JSME initialization timeout')\n }\n }, 15000)\n\n document.head.appendChild(script)\n })\n\n return win.__jsmeLoadPromise__\n}\n\n// Wait for the browser to complete a paint cycle\nfunction waitForPaint(): Promise<void> {\n return new Promise(resolve => {\n requestAnimationFrame(() => requestAnimationFrame(() => resolve()))\n })\n}\n\n// JSME initialization — two phases:\n// 1. Load the script (no DOM needed)\n// 2. Reveal the editor div, wait for paint, then mount JSME with explicit px dimensions\nasync function initJSME() {\n if (props.readonly) return\n\n try {\n isLoading.value = true\n loadError.value = null\n\n // Phase 1: load the JSME script (independent of DOM)\n await waitForJSME()\n\n const win = getJSMEState()\n if (!win.JSApplet?.JSME) {\n throw new Error('JSME library not available after loading')\n }\n\n // Phase 2: reveal the editor div by clearing the loading state\n isLoading.value = false\n await nextTick()\n\n if (!containerRef.value) return\n\n // Wait for a full paint cycle so GWT can measure the container\n await waitForPaint()\n\n if (!containerRef.value) return\n\n // Use explicit pixel width — GWT cannot resolve percentage widths reliably\n const rect = containerRef.value.getBoundingClientRect()\n const width = Math.floor(rect.width) || 400\n\n // Mount JSME into the now-painted container\n const editorId = `jsme-${Date.now()}`\n containerRef.value.id = editorId\n\n const instance = new win.JSApplet.JSME(\n editorId,\n `${width}px`,\n `${props.height}px`,\n {\n options: 'query,hydrogens,paste',\n }\n )\n\n jsmeInstance.value = instance\n\n // Set initial value if provided\n if (props.modelValue?.molfile) {\n (instance as { readMolFile: (mol: string) => void }).readMolFile(props.modelValue.molfile)\n }\n\n // Set up change callback\n (instance as { setCallBack: (event: string, callback: () => void) => void }).setCallBack('AfterStructureModified', handleStructureChange)\n } catch (err) {\n const message = err instanceof Error ? err.message : 'Failed to load molecule editor'\n loadError.value = message\n emit('error', message)\n isLoading.value = false\n }\n}\n\nfunction handleStructureChange() {\n // Debounce the change event\n if (debounceTimer.value) {\n clearTimeout(debounceTimer.value)\n }\n\n debounceTimer.value = setTimeout(() => {\n if (!jsmeInstance.value) return\n\n const instance = jsmeInstance.value as {\n smiles: () => string\n molFile: () => string\n }\n\n const smiles = instance.smiles()\n const molfile = instance.molFile()\n\n if (!smiles || smiles.length === 0) {\n emit('update:modelValue', undefined)\n } else {\n emit('update:modelValue', { smiles, molfile })\n }\n }, 300)\n}\n\nfunction clearStructure() {\n if (jsmeInstance.value) {\n (jsmeInstance.value as { reset: () => void }).reset()\n }\n emit('update:modelValue', undefined)\n}\n\n// Watch for external value changes\nwatch(() => props.modelValue, (newValue) => {\n if (!jsmeInstance.value) return\n\n const instance = jsmeInstance.value as {\n smiles: () => string\n readMolFile: (mol: string) => void\n reset: () => void\n }\n\n // Only update if the external value differs from current\n const currentSmiles = instance.smiles()\n if (newValue?.smiles !== currentSmiles) {\n if (newValue?.molfile) {\n instance.readMolFile(newValue.molfile)\n } else {\n instance.reset()\n }\n }\n})\n\n// Lifecycle\nonMounted(() => {\n if (!props.readonly) {\n initJSME()\n } else {\n isLoading.value = false\n }\n})\n\nonUnmounted(() => {\n if (debounceTimer.value) {\n clearTimeout(debounceTimer.value)\n }\n jsmeInstance.value = null\n})\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-molecule-input',\n disabled ? 'mint-molecule-input--disabled' : '',\n readonly ? 'mint-molecule-input--readonly' : '',\n error ? 'mint-molecule-input--error' : '',\n ]\"\n >\n <!-- Loading state -->\n <div\n v-if=\"isLoading && !readonly\"\n class=\"mint-molecule-input__skeleton\"\n :style=\"{ height: `${height}px` }\"\n >\n <svg\n class=\"mint-molecule-input__skeleton-icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z\"\n />\n </svg>\n <span class=\"mint-molecule-input__skeleton-text\">Loading molecule editor...</span>\n </div>\n\n <!-- Error state -->\n <div\n v-else-if=\"loadError\"\n class=\"mint-molecule-input__error\"\n >\n <svg\n class=\"mint-molecule-input__error-icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\"\n />\n </svg>\n {{ loadError }}\n </div>\n\n <!-- Readonly mode - show empty or placeholder -->\n <template v-else-if=\"readonly\">\n <div\n v-if=\"hasStructure\"\n class=\"mint-molecule-input__readonly\"\n :style=\"{ height: `${height}px` }\"\n >\n <!-- In readonly mode, we just display a placeholder since we don't have SVG rendering -->\n <div class=\"mint-molecule-input__empty\">\n <svg\n class=\"mint-molecule-input__empty-icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z\"\n />\n </svg>\n <span class=\"mint-molecule-input__empty-text\">Structure defined (readonly)</span>\n </div>\n </div>\n <div\n v-else\n class=\"mint-molecule-input__empty\"\n :style=\"{ height: `${height}px` }\"\n >\n <svg\n class=\"mint-molecule-input__empty-icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z\"\n />\n </svg>\n <span class=\"mint-molecule-input__empty-text\">No structure</span>\n </div>\n </template>\n\n <!-- Editor mode -->\n <template v-else>\n <div\n ref=\"containerRef\"\n class=\"mint-molecule-input__editor\"\n :style=\"{ height: `${height}px` }\"\n role=\"application\"\n aria-label=\"Molecule structure editor\"\n />\n\n <!-- Actions toolbar -->\n <div class=\"mint-molecule-input__actions\">\n <button\n type=\"button\"\n class=\"mint-molecule-input__action-btn\"\n :disabled=\"!hasStructure || disabled\"\n aria-label=\"Clear structure\"\n @click=\"clearStructure\"\n >\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16\" />\n </svg>\n </button>\n </div>\n </template>\n\n <!-- SMILES display -->\n <div\n v-if=\"showSmiles && hasStructure && !loadError\"\n class=\"mint-molecule-input__smiles\"\n >\n <span class=\"mint-molecule-input__smiles-label\">SMILES:</span>\n {{ modelValue?.smiles }}\n </div>\n </div>\n</template>\n","import { computed, type ComputedRef } from 'vue'\n\n// Concentration unit types\nexport type MolarityUnit = 'pM' | 'nM' | 'µM' | 'mM' | 'M'\nexport type MassVolumeUnit = 'pg/mL' | 'ng/mL' | 'µg/mL' | 'mg/mL' | 'g/mL'\nexport type PercentageUnit = '% v/v' | '% w/v' | '% w/w'\nexport type ConcentrationUnit = MolarityUnit | MassVolumeUnit | PercentageUnit | string\n\nexport interface ConcentrationValue {\n value: number\n unit: ConcentrationUnit\n}\n\nexport interface UnitCategory {\n label: string\n units: ConcentrationUnit[]\n}\n\nexport interface UseConcentrationUnitsReturn {\n unitCategories: ComputedRef<UnitCategory[]>\n molarityUnits: MolarityUnit[]\n massVolumeUnits: MassVolumeUnit[]\n percentageUnits: PercentageUnit[]\n convert: (value: number, from: ConcentrationUnit, to: ConcentrationUnit, mw?: number) => number | null\n formatWithUnit: (concentration: ConcentrationValue, precision?: number) => string\n parseConcentration: (input: string) => ConcentrationValue | null\n getBaseUnit: (unit: ConcentrationUnit) => ConcentrationUnit\n getConversionHint: (concentration: ConcentrationValue) => string | null\n isMolarity: (unit: ConcentrationUnit) => boolean\n isMassVolume: (unit: ConcentrationUnit) => boolean\n isPercentage: (unit: ConcentrationUnit) => boolean\n}\n\n// Conversion factors to base unit (M for molarity, g/mL for mass/volume)\nconst MOLARITY_FACTORS: Record<MolarityUnit, number> = {\n 'pM': 1e-12,\n 'nM': 1e-9,\n 'µM': 1e-6,\n 'mM': 1e-3,\n 'M': 1,\n}\n\nconst MASS_VOLUME_FACTORS: Record<MassVolumeUnit, number> = {\n 'pg/mL': 1e-12,\n 'ng/mL': 1e-9,\n 'µg/mL': 1e-6,\n 'mg/mL': 1e-3,\n 'g/mL': 1,\n}\n\n// Percentage conversion factors (for potential future use)\n// const PERCENTAGE_FACTORS: Record<PercentageUnit, number> = {\n// '% v/v': 0.01,\n// '% w/v': 0.01,\n// '% w/w': 0.01,\n// }\n\nconst MOLARITY_UNITS: MolarityUnit[] = ['pM', 'nM', 'µM', 'mM', 'M']\nconst MASS_VOLUME_UNITS: MassVolumeUnit[] = ['pg/mL', 'ng/mL', 'µg/mL', 'mg/mL', 'g/mL']\nconst PERCENTAGE_UNITS: PercentageUnit[] = ['% v/v', '% w/v', '% w/w']\n\n/** Converts between molarity, mass/volume, and percentage concentration units with formatting helpers. */\nexport function useConcentrationUnits(): UseConcentrationUnitsReturn {\n const unitCategories = computed<UnitCategory[]>(() => [\n { label: 'Molarity', units: MOLARITY_UNITS },\n { label: 'Mass/Volume', units: MASS_VOLUME_UNITS },\n { label: 'Percentage', units: PERCENTAGE_UNITS },\n ])\n\n function isMolarity(unit: ConcentrationUnit): unit is MolarityUnit {\n return MOLARITY_UNITS.includes(unit as MolarityUnit)\n }\n\n function isMassVolume(unit: ConcentrationUnit): unit is MassVolumeUnit {\n return MASS_VOLUME_UNITS.includes(unit as MassVolumeUnit)\n }\n\n function isPercentage(unit: ConcentrationUnit): unit is PercentageUnit {\n return PERCENTAGE_UNITS.includes(unit as PercentageUnit)\n }\n\n function getBaseUnit(unit: ConcentrationUnit): ConcentrationUnit {\n if (isMolarity(unit)) return 'M'\n if (isMassVolume(unit)) return 'g/mL'\n if (isPercentage(unit)) return '% w/v'\n return unit\n }\n\n function convert(\n value: number,\n from: ConcentrationUnit,\n to: ConcentrationUnit,\n mw?: number\n ): number | null {\n if (from === to) return value\n if (value === 0) return 0\n\n // Same category conversion\n if (isMolarity(from) && isMolarity(to)) {\n const baseValue = value * MOLARITY_FACTORS[from]\n return baseValue / MOLARITY_FACTORS[to]\n }\n\n if (isMassVolume(from) && isMassVolume(to)) {\n const baseValue = value * MASS_VOLUME_FACTORS[from]\n return baseValue / MASS_VOLUME_FACTORS[to]\n }\n\n if (isPercentage(from) && isPercentage(to)) {\n // Percentage conversions within same category are direct\n return value\n }\n\n // Cross-category conversion (requires molecular weight)\n if (mw && mw > 0) {\n // Molarity to Mass/Volume\n if (isMolarity(from) && isMassVolume(to)) {\n // Convert to M, then to g/mL using MW, then to target unit\n const molarConc = value * MOLARITY_FACTORS[from]\n const massConc = molarConc * mw // g/mL (MW in g/mol, concentration in mol/L = g/L)\n return massConc / MASS_VOLUME_FACTORS[to]\n }\n\n // Mass/Volume to Molarity\n if (isMassVolume(from) && isMolarity(to)) {\n // Convert to g/mL, then to M using MW, then to target unit\n const massConc = value * MASS_VOLUME_FACTORS[from]\n const molarConc = massConc / mw // M (g/mL / g/mol = mol/L)\n return molarConc / MOLARITY_FACTORS[to]\n }\n }\n\n return null // Cannot convert without MW or between incompatible units\n }\n\n function formatWithUnit(concentration: ConcentrationValue, precision: number = 3): string {\n const { value, unit } = concentration\n if (value === 0) return `0 ${unit}`\n\n // Use appropriate precision based on value magnitude\n let formattedValue: string\n if (Math.abs(value) >= 1000) {\n formattedValue = value.toExponential(precision - 1)\n } else if (Math.abs(value) < 0.001) {\n formattedValue = value.toExponential(precision - 1)\n } else {\n formattedValue = value.toPrecision(precision)\n }\n\n // Remove trailing zeros after decimal point\n formattedValue = formattedValue.replace(/\\.?0+$/, '')\n formattedValue = formattedValue.replace(/\\.?0+e/, 'e')\n\n return `${formattedValue} ${unit}`\n }\n\n function parseConcentration(input: string): ConcentrationValue | null {\n const trimmed = input.trim()\n if (!trimmed) return null\n\n // Match number followed by optional unit\n const match = trimmed.match(/^([-+]?\\d*\\.?\\d+(?:[eE][-+]?\\d+)?)\\s*(.*)$/)\n if (!match) return null\n\n const value = parseFloat(match[1])\n if (isNaN(value)) return null\n\n let unit = match[2].trim()\n if (!unit) {\n return null // Unit is required\n }\n\n // Normalize common variations\n unit = unit\n .replace(/uM/i, 'µM')\n .replace(/um/i, 'µM')\n .replace(/ug\\/ml/i, 'µg/mL')\n .replace(/ng\\/ml/i, 'ng/mL')\n .replace(/mg\\/ml/i, 'mg/mL')\n .replace(/pg\\/ml/i, 'pg/mL')\n .replace(/g\\/ml/i, 'g/mL')\n\n return { value, unit }\n }\n\n function getConversionHint(concentration: ConcentrationValue): string | null {\n const { value, unit } = concentration\n if (value === 0) return null\n\n // Find adjacent unit for conversion hint\n if (isMolarity(unit)) {\n const index = MOLARITY_UNITS.indexOf(unit)\n // If value is large, suggest next higher unit\n if (value >= 1000 && index < MOLARITY_UNITS.length - 1) {\n const nextUnit = MOLARITY_UNITS[index + 1]\n const converted = convert(value, unit, nextUnit)\n if (converted !== null) {\n return formatWithUnit({ value: converted, unit: nextUnit })\n }\n }\n // If value is small, suggest next lower unit\n if (value < 1 && index > 0) {\n const prevUnit = MOLARITY_UNITS[index - 1]\n const converted = convert(value, unit, prevUnit)\n if (converted !== null) {\n return formatWithUnit({ value: converted, unit: prevUnit })\n }\n }\n }\n\n if (isMassVolume(unit)) {\n const index = MASS_VOLUME_UNITS.indexOf(unit)\n if (value >= 1000 && index < MASS_VOLUME_UNITS.length - 1) {\n const nextUnit = MASS_VOLUME_UNITS[index + 1]\n const converted = convert(value, unit, nextUnit)\n if (converted !== null) {\n return formatWithUnit({ value: converted, unit: nextUnit })\n }\n }\n if (value < 1 && index > 0) {\n const prevUnit = MASS_VOLUME_UNITS[index - 1]\n const converted = convert(value, unit, prevUnit)\n if (converted !== null) {\n return formatWithUnit({ value: converted, unit: prevUnit })\n }\n }\n }\n\n return null\n }\n\n return {\n unitCategories,\n molarityUnits: MOLARITY_UNITS,\n massVolumeUnits: MASS_VOLUME_UNITS,\n percentageUnits: PERCENTAGE_UNITS,\n convert,\n formatWithUnit,\n parseConcentration,\n getBaseUnit,\n getConversionHint,\n isMolarity,\n isMassVolume,\n isPercentage,\n }\n}\n","<script setup lang=\"ts\">\n/**\n * Numeric input with a unit segment. Several units open a menu that previews the value in each\n * unit; units with a `factor` also get a hint in the neighbour unit nearest to 1–1000.\n */\nimport { computePosition, flip, offset, shift } from '@floating-ui/dom'\nimport { computed, nextTick, ref, useTemplateRef, watch } from 'vue'\nimport { useDropdownState } from '../composables/useDropdownState'\nimport { useMenuKeyboard } from '../composables/useMenuKeyboard'\nimport type { UnitOption } from '../types'\n\ninterface Props {\n modelValue?: number\n unit?: string\n units: UnitOption[]\n precision?: number\n min?: number\n max?: number\n step?: number\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n convertOnUnitChange?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n precision: undefined,\n step: undefined,\n placeholder: 'Enter value',\n disabled: false,\n error: false,\n size: 'md',\n convertOnUnitChange: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: number | undefined]\n 'update:unit': [unit: string]\n 'change': [data: { value: number | undefined; unit: string }]\n}>()\n\nconst currentUnit = computed(() => props.unit || (props.units.length > 0 ? props.units[0].value : ''))\nconst currentOption = computed(() => findUnit(currentUnit.value))\nconst selectable = computed(() => props.units.length > 1)\n\n/** Menu rows: ungrouped units first, then one labelled block per group. */\nconst menuSections = computed(() => {\n const sections = new Map<string, UnitOption[]>()\n for (const u of props.units) {\n const key = u.group ?? ''\n sections.set(key, [...(sections.get(key) ?? []), u])\n }\n return [...sections].map(([label, units]) => ({ label, units }))\n .sort((a, b) => Number(a.label !== '') - Number(b.label !== ''))\n})\n\nfunction findUnit(value: string): UnitOption | undefined {\n return props.units.find(u => u.value === value)\n}\n\nfunction roundToPrecision(value: number): number {\n if (props.precision === undefined) return value\n const factor = Math.pow(10, props.precision)\n return Math.round(value * factor) / factor\n}\n\nfunction clamp(value: number): number {\n let result = value\n if (props.min !== undefined && result < props.min) result = props.min\n if (props.max !== undefined && result > props.max) result = props.max\n return result\n}\n\n/** 4 significant digits; exponent form outside 1e-3 … 1e6. */\nfunction formatNumber(value: number): string {\n const abs = Math.abs(value)\n if (abs !== 0 && (abs >= 1e6 || abs < 1e-3)) return value.toExponential(2)\n return String(parseFloat(value.toPrecision(4)))\n}\n\n/** The current value in `target`; null without factors or across unit groups (M vs mg/mL). */\nfunction convertTo(target: UnitOption): number | null {\n const current = currentOption.value\n if (props.modelValue === undefined || current?.factor === undefined || !target.factor) return null\n if (target.group !== current.group) return null\n return props.modelValue * current.factor / target.factor\n}\n\nfunction preview(target: UnitOption): string {\n const converted = convertTo(target)\n return converted === null ? '' : formatNumber(converted)\n}\n\n/** Log distance of |value| from the 1–1000 window (0 inside it). */\nfunction distanceFromReadable(value: number): number {\n const exp = Math.log10(Math.abs(value))\n return exp < 0 ? -exp : Math.max(0, exp - 3)\n}\n\nconst conversionHint = computed(() => {\n const current = currentOption.value\n if (!props.modelValue || current?.factor === undefined) return null\n const scale = props.units\n .filter(u => u.factor !== undefined && u.group === current.group)\n .sort((a, b) => a.factor! - b.factor!)\n const index = scale.indexOf(current)\n let best: { unit: UnitOption; value: number } | null = null\n for (const neighbour of [scale[index + 1], scale[index - 1]]) {\n const value = neighbour && convertTo(neighbour)\n if (!value) continue\n if (!best || distanceFromReadable(value) < distanceFromReadable(best.value)) best = { unit: neighbour, value }\n }\n return best && `${formatNumber(best.value)} ${best.unit.label}`\n})\n\nfunction handleValueInput(event: Event) {\n const target = event.target as HTMLInputElement\n const value = target.value === '' ? undefined : Number(target.value)\n\n if (value === undefined || isNaN(value)) {\n emit('update:modelValue', undefined)\n emit('change', { value: undefined, unit: currentUnit.value })\n return\n }\n\n const clamped = clamp(value)\n emit('update:modelValue', clamped)\n emit('change', { value: clamped, unit: currentUnit.value })\n}\n\nfunction selectUnit(newUnitValue: string) {\n close(true)\n if (newUnitValue === currentUnit.value) return\n\n let newValue = props.modelValue\n if (props.convertOnUnitChange && newValue !== undefined) {\n const oldUnit = currentOption.value\n const newUnit = findUnit(newUnitValue)\n if (oldUnit?.factor !== undefined && newUnit?.factor !== undefined && newUnit.factor !== 0) {\n newValue = clamp(roundToPrecision(newValue * (oldUnit.factor / newUnit.factor)))\n emit('update:modelValue', newValue)\n }\n }\n\n emit('update:unit', newUnitValue)\n emit('change', { value: newValue, unit: newUnitValue })\n}\n\n// ---- Unit menu (disclosure + WAI-ARIA keyboard, shared with ActionMenu) ----\nconst menuRef = ref<HTMLElement | null>(null)\n// Transparent (not visibility:hidden) until placed, so the open-time focus can land on an option.\nconst menuStyle = ref<Record<string, string>>({ opacity: '0' })\nconst { isOpen, rootRef, open, close } = useDropdownState({\n triggerRef: useTemplateRef<HTMLElement>('trigger'),\n closeOnScroll: true,\n insideRefs: [menuRef],\n onOpen: () => { menuStyle.value = { opacity: '0' } },\n})\n\n/** Teleported + fixed like ActionMenu, so overflow:hidden/auto ancestors never clip the menu. */\nwatch(isOpen, async (opened) => {\n if (!opened) return\n await nextTick()\n if (!rootRef.value || !menuRef.value) return\n const { x, y } = await computePosition(rootRef.value, menuRef.value, {\n placement: 'bottom-end',\n strategy: 'fixed',\n middleware: [offset(4), flip(), shift({ padding: 8 })],\n })\n menuStyle.value = { left: `${x}px`, top: `${y}px` }\n})\n\nfunction menuItems(): HTMLElement[] {\n return menuRef.value ? Array.from(menuRef.value.querySelectorAll<HTMLElement>('[role=\"option\"]')) : []\n}\n\nfunction openMenu(focusSelected = true) {\n if (props.disabled || !selectable.value) return\n open()\n if (focusSelected) {\n void nextTick(() => (menuItems().find(el => el.getAttribute('aria-selected') === 'true') ?? menuItems()[0])?.focus())\n }\n}\n\nfunction toggleMenu() {\n if (isOpen.value) close()\n else openMenu()\n}\n\nconst { handleTriggerKeydown, handlePanelKeydown } = useMenuKeyboard({\n items: menuItems,\n isOpen: () => isOpen.value,\n open: () => openMenu(false),\n close,\n})\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-unit-input',\n error ? 'mint-unit-input--error' : '',\n disabled ? 'mint-unit-input--disabled' : '',\n ]\"\n >\n <div ref=\"rootRef\" class=\"mint-unit-input__field\">\n <div :class=\"['mint-unit-input__controls', `mint-unit-input__controls--${size}`]\">\n <input\n type=\"number\"\n :value=\"modelValue\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :aria-invalid=\"error || undefined\"\n :class=\"[\n 'mint-unit-input__value',\n `mint-unit-input__value--${size}`,\n disabled ? 'mint-unit-input__value--disabled' : '',\n ]\"\n aria-label=\"Value\"\n @input=\"handleValueInput\"\n />\n\n <button\n v-if=\"selectable\"\n ref=\"trigger\"\n type=\"button\"\n :class=\"['mint-unit-input__unit', { 'mint-unit-input__unit--open': isOpen }]\"\n :disabled=\"disabled\"\n aria-haspopup=\"listbox\"\n :aria-expanded=\"isOpen\"\n :aria-label=\"`Unit: ${currentOption?.label ?? currentUnit}`\"\n @click=\"toggleMenu\"\n @keydown=\"handleTriggerKeydown\"\n >\n {{ currentOption?.label ?? currentUnit }}\n <svg class=\"mint-unit-input__chevron\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <path d=\"M4 6l4 4 4-4\" />\n </svg>\n </button>\n <span v-else class=\"mint-unit-input__unit\">{{ currentOption?.label ?? currentUnit }}</span>\n </div>\n\n </div>\n\n <Teleport to=\"body\">\n <div\n v-if=\"isOpen\"\n ref=\"menuRef\"\n class=\"mint-popover mint-unit-input__menu\"\n :style=\"menuStyle\"\n role=\"listbox\"\n aria-label=\"Unit\"\n @keydown=\"handlePanelKeydown\"\n >\n <template v-for=\"section in menuSections\" :key=\"section.label\">\n <div v-if=\"section.label\" class=\"mint-unit-input__menu-group\" role=\"presentation\">{{ section.label }}</div>\n <button\n v-for=\"u in section.units\"\n :key=\"u.value\"\n type=\"button\"\n role=\"option\"\n :aria-selected=\"u.value === currentUnit\"\n :class=\"['mint-menu-item', { 'mint-menu-item--selected': u.value === currentUnit }]\"\n @click=\"selectUnit(u.value)\"\n >\n <span class=\"mint-menu-item__text\"><span class=\"mint-menu-item__label\">{{ u.label }}</span></span>\n <span v-if=\"preview(u)\" class=\"mint-menu-item__meta\">{{ preview(u) }}</span>\n </button>\n </template>\n </div>\n </Teleport>\n\n <div v-if=\"conversionHint\" class=\"mint-unit-input__hint\">≈ {{ conversionHint }}</div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * Numeric input with a unit segment. Several units open a menu that previews the value in each\n * unit; units with a `factor` also get a hint in the neighbour unit nearest to 1–1000.\n */\nimport { computePosition, flip, offset, shift } from '@floating-ui/dom'\nimport { computed, nextTick, ref, useTemplateRef, watch } from 'vue'\nimport { useDropdownState } from '../composables/useDropdownState'\nimport { useMenuKeyboard } from '../composables/useMenuKeyboard'\nimport type { UnitOption } from '../types'\n\ninterface Props {\n modelValue?: number\n unit?: string\n units: UnitOption[]\n precision?: number\n min?: number\n max?: number\n step?: number\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n convertOnUnitChange?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n precision: undefined,\n step: undefined,\n placeholder: 'Enter value',\n disabled: false,\n error: false,\n size: 'md',\n convertOnUnitChange: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: number | undefined]\n 'update:unit': [unit: string]\n 'change': [data: { value: number | undefined; unit: string }]\n}>()\n\nconst currentUnit = computed(() => props.unit || (props.units.length > 0 ? props.units[0].value : ''))\nconst currentOption = computed(() => findUnit(currentUnit.value))\nconst selectable = computed(() => props.units.length > 1)\n\n/** Menu rows: ungrouped units first, then one labelled block per group. */\nconst menuSections = computed(() => {\n const sections = new Map<string, UnitOption[]>()\n for (const u of props.units) {\n const key = u.group ?? ''\n sections.set(key, [...(sections.get(key) ?? []), u])\n }\n return [...sections].map(([label, units]) => ({ label, units }))\n .sort((a, b) => Number(a.label !== '') - Number(b.label !== ''))\n})\n\nfunction findUnit(value: string): UnitOption | undefined {\n return props.units.find(u => u.value === value)\n}\n\nfunction roundToPrecision(value: number): number {\n if (props.precision === undefined) return value\n const factor = Math.pow(10, props.precision)\n return Math.round(value * factor) / factor\n}\n\nfunction clamp(value: number): number {\n let result = value\n if (props.min !== undefined && result < props.min) result = props.min\n if (props.max !== undefined && result > props.max) result = props.max\n return result\n}\n\n/** 4 significant digits; exponent form outside 1e-3 … 1e6. */\nfunction formatNumber(value: number): string {\n const abs = Math.abs(value)\n if (abs !== 0 && (abs >= 1e6 || abs < 1e-3)) return value.toExponential(2)\n return String(parseFloat(value.toPrecision(4)))\n}\n\n/** The current value in `target`; null without factors or across unit groups (M vs mg/mL). */\nfunction convertTo(target: UnitOption): number | null {\n const current = currentOption.value\n if (props.modelValue === undefined || current?.factor === undefined || !target.factor) return null\n if (target.group !== current.group) return null\n return props.modelValue * current.factor / target.factor\n}\n\nfunction preview(target: UnitOption): string {\n const converted = convertTo(target)\n return converted === null ? '' : formatNumber(converted)\n}\n\n/** Log distance of |value| from the 1–1000 window (0 inside it). */\nfunction distanceFromReadable(value: number): number {\n const exp = Math.log10(Math.abs(value))\n return exp < 0 ? -exp : Math.max(0, exp - 3)\n}\n\nconst conversionHint = computed(() => {\n const current = currentOption.value\n if (!props.modelValue || current?.factor === undefined) return null\n const scale = props.units\n .filter(u => u.factor !== undefined && u.group === current.group)\n .sort((a, b) => a.factor! - b.factor!)\n const index = scale.indexOf(current)\n let best: { unit: UnitOption; value: number } | null = null\n for (const neighbour of [scale[index + 1], scale[index - 1]]) {\n const value = neighbour && convertTo(neighbour)\n if (!value) continue\n if (!best || distanceFromReadable(value) < distanceFromReadable(best.value)) best = { unit: neighbour, value }\n }\n return best && `${formatNumber(best.value)} ${best.unit.label}`\n})\n\nfunction handleValueInput(event: Event) {\n const target = event.target as HTMLInputElement\n const value = target.value === '' ? undefined : Number(target.value)\n\n if (value === undefined || isNaN(value)) {\n emit('update:modelValue', undefined)\n emit('change', { value: undefined, unit: currentUnit.value })\n return\n }\n\n const clamped = clamp(value)\n emit('update:modelValue', clamped)\n emit('change', { value: clamped, unit: currentUnit.value })\n}\n\nfunction selectUnit(newUnitValue: string) {\n close(true)\n if (newUnitValue === currentUnit.value) return\n\n let newValue = props.modelValue\n if (props.convertOnUnitChange && newValue !== undefined) {\n const oldUnit = currentOption.value\n const newUnit = findUnit(newUnitValue)\n if (oldUnit?.factor !== undefined && newUnit?.factor !== undefined && newUnit.factor !== 0) {\n newValue = clamp(roundToPrecision(newValue * (oldUnit.factor / newUnit.factor)))\n emit('update:modelValue', newValue)\n }\n }\n\n emit('update:unit', newUnitValue)\n emit('change', { value: newValue, unit: newUnitValue })\n}\n\n// ---- Unit menu (disclosure + WAI-ARIA keyboard, shared with ActionMenu) ----\nconst menuRef = ref<HTMLElement | null>(null)\n// Transparent (not visibility:hidden) until placed, so the open-time focus can land on an option.\nconst menuStyle = ref<Record<string, string>>({ opacity: '0' })\nconst { isOpen, rootRef, open, close } = useDropdownState({\n triggerRef: useTemplateRef<HTMLElement>('trigger'),\n closeOnScroll: true,\n insideRefs: [menuRef],\n onOpen: () => { menuStyle.value = { opacity: '0' } },\n})\n\n/** Teleported + fixed like ActionMenu, so overflow:hidden/auto ancestors never clip the menu. */\nwatch(isOpen, async (opened) => {\n if (!opened) return\n await nextTick()\n if (!rootRef.value || !menuRef.value) return\n const { x, y } = await computePosition(rootRef.value, menuRef.value, {\n placement: 'bottom-end',\n strategy: 'fixed',\n middleware: [offset(4), flip(), shift({ padding: 8 })],\n })\n menuStyle.value = { left: `${x}px`, top: `${y}px` }\n})\n\nfunction menuItems(): HTMLElement[] {\n return menuRef.value ? Array.from(menuRef.value.querySelectorAll<HTMLElement>('[role=\"option\"]')) : []\n}\n\nfunction openMenu(focusSelected = true) {\n if (props.disabled || !selectable.value) return\n open()\n if (focusSelected) {\n void nextTick(() => (menuItems().find(el => el.getAttribute('aria-selected') === 'true') ?? menuItems()[0])?.focus())\n }\n}\n\nfunction toggleMenu() {\n if (isOpen.value) close()\n else openMenu()\n}\n\nconst { handleTriggerKeydown, handlePanelKeydown } = useMenuKeyboard({\n items: menuItems,\n isOpen: () => isOpen.value,\n open: () => openMenu(false),\n close,\n})\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-unit-input',\n error ? 'mint-unit-input--error' : '',\n disabled ? 'mint-unit-input--disabled' : '',\n ]\"\n >\n <div ref=\"rootRef\" class=\"mint-unit-input__field\">\n <div :class=\"['mint-unit-input__controls', `mint-unit-input__controls--${size}`]\">\n <input\n type=\"number\"\n :value=\"modelValue\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :aria-invalid=\"error || undefined\"\n :class=\"[\n 'mint-unit-input__value',\n `mint-unit-input__value--${size}`,\n disabled ? 'mint-unit-input__value--disabled' : '',\n ]\"\n aria-label=\"Value\"\n @input=\"handleValueInput\"\n />\n\n <button\n v-if=\"selectable\"\n ref=\"trigger\"\n type=\"button\"\n :class=\"['mint-unit-input__unit', { 'mint-unit-input__unit--open': isOpen }]\"\n :disabled=\"disabled\"\n aria-haspopup=\"listbox\"\n :aria-expanded=\"isOpen\"\n :aria-label=\"`Unit: ${currentOption?.label ?? currentUnit}`\"\n @click=\"toggleMenu\"\n @keydown=\"handleTriggerKeydown\"\n >\n {{ currentOption?.label ?? currentUnit }}\n <svg class=\"mint-unit-input__chevron\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <path d=\"M4 6l4 4 4-4\" />\n </svg>\n </button>\n <span v-else class=\"mint-unit-input__unit\">{{ currentOption?.label ?? currentUnit }}</span>\n </div>\n\n </div>\n\n <Teleport to=\"body\">\n <div\n v-if=\"isOpen\"\n ref=\"menuRef\"\n class=\"mint-popover mint-unit-input__menu\"\n :style=\"menuStyle\"\n role=\"listbox\"\n aria-label=\"Unit\"\n @keydown=\"handlePanelKeydown\"\n >\n <template v-for=\"section in menuSections\" :key=\"section.label\">\n <div v-if=\"section.label\" class=\"mint-unit-input__menu-group\" role=\"presentation\">{{ section.label }}</div>\n <button\n v-for=\"u in section.units\"\n :key=\"u.value\"\n type=\"button\"\n role=\"option\"\n :aria-selected=\"u.value === currentUnit\"\n :class=\"['mint-menu-item', { 'mint-menu-item--selected': u.value === currentUnit }]\"\n @click=\"selectUnit(u.value)\"\n >\n <span class=\"mint-menu-item__text\"><span class=\"mint-menu-item__label\">{{ u.label }}</span></span>\n <span v-if=\"preview(u)\" class=\"mint-menu-item__meta\">{{ preview(u) }}</span>\n </button>\n </template>\n </div>\n </Teleport>\n\n <div v-if=\"conversionHint\" class=\"mint-unit-input__hint\">≈ {{ conversionHint }}</div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Paired numeric + unit input for reagent concentrations (pM–M, mg/mL, etc.) with optional molar-mass conversion hint. */\nimport { computed, watch } from 'vue'\nimport {\n useConcentrationUnits,\n type ConcentrationValue,\n type ConcentrationUnit,\n} from '../composables/useConcentrationUnits'\nimport UnitInput from './UnitInput.vue'\n\ninterface Props {\n modelValue?: ConcentrationValue\n allowedUnits?: ConcentrationUnit[]\n showConversion?: boolean\n molecularWeight?: number\n min?: number\n max?: number\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n placeholder?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n showConversion: true,\n disabled: false,\n error: false,\n size: 'md',\n placeholder: 'Enter value',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: ConcentrationValue | undefined]\n}>()\n\nconst { unitCategories, convert, getBaseUnit, isMolarity, isMassVolume } = useConcentrationUnits()\n\n/** Scale factor to the category base unit; UnitInput uses it for menu previews and the nearest-unit hint. */\nfunction factorOf(unit: ConcentrationUnit): number | undefined {\n if (!props.showConversion || !(isMolarity(unit) || isMassVolume(unit))) return undefined\n return convert(1, unit, getBaseUnit(unit)) ?? undefined\n}\n\n// Filter categories based on allowedUnits\nconst filteredCategories = computed(() => {\n const allowedUnits = props.allowedUnits\n if (!allowedUnits || allowedUnits.length === 0) {\n return unitCategories.value\n }\n return unitCategories.value\n .map(cat => ({\n label: cat.label,\n units: cat.units.filter(u => allowedUnits.includes(u)),\n }))\n .filter(cat => cat.units.length > 0)\n})\n\n// Flatten all available units\nconst availableUnits = computed(() => {\n return filteredCategories.value.flatMap(cat => cat.units)\n})\n\nconst unitOptions = computed(() =>\n filteredCategories.value.flatMap(category =>\n category.units.map(unit => ({\n value: unit,\n label: unit,\n group: filteredCategories.value.length > 1 ? category.label : undefined,\n factor: factorOf(unit),\n }))\n )\n)\n\n// Current value and unit\nconst currentValue = computed(() => props.modelValue?.value)\nconst currentUnit = computed(() => props.modelValue?.unit || availableUnits.value[0] || 'µM')\n\nfunction handleValueUpdate(value: number | undefined) {\n if (value === undefined || isNaN(value)) {\n emit('update:modelValue', undefined)\n return\n }\n\n // Apply min/max constraints\n let clampedValue = value\n if (props.min !== undefined && clampedValue < props.min) {\n clampedValue = props.min\n }\n if (props.max !== undefined && clampedValue > props.max) {\n clampedValue = props.max\n }\n\n emit('update:modelValue', {\n value: clampedValue,\n unit: currentUnit.value,\n })\n}\n\nfunction handleUnitUpdate(unit: string) {\n emit('update:modelValue', {\n value: currentValue.value ?? 0,\n unit: unit as ConcentrationUnit,\n })\n}\n\n// Ensure modelValue always has a valid unit\nwatch(availableUnits, (units) => {\n if (props.modelValue && !units.includes(props.modelValue.unit)) {\n emit('update:modelValue', {\n value: props.modelValue.value,\n unit: units[0] || 'µM',\n })\n }\n}, { immediate: true })\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-concentration-input',\n error ? 'mint-concentration-input--error' : '',\n disabled ? 'mint-concentration-input--disabled' : '',\n ]\"\n >\n <UnitInput\n :model-value=\"currentValue\"\n :unit=\"currentUnit\"\n :units=\"unitOptions\"\n :min=\"min\"\n :max=\"max\"\n :disabled=\"disabled\"\n :error=\"error\"\n :size=\"size\"\n :placeholder=\"placeholder\"\n @update:model-value=\"handleValueUpdate\"\n @update:unit=\"handleUnitUpdate\"\n />\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Paired numeric + unit input for reagent concentrations (pM–M, mg/mL, etc.) with optional molar-mass conversion hint. */\nimport { computed, watch } from 'vue'\nimport {\n useConcentrationUnits,\n type ConcentrationValue,\n type ConcentrationUnit,\n} from '../composables/useConcentrationUnits'\nimport UnitInput from './UnitInput.vue'\n\ninterface Props {\n modelValue?: ConcentrationValue\n allowedUnits?: ConcentrationUnit[]\n showConversion?: boolean\n molecularWeight?: number\n min?: number\n max?: number\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n placeholder?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n showConversion: true,\n disabled: false,\n error: false,\n size: 'md',\n placeholder: 'Enter value',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: ConcentrationValue | undefined]\n}>()\n\nconst { unitCategories, convert, getBaseUnit, isMolarity, isMassVolume } = useConcentrationUnits()\n\n/** Scale factor to the category base unit; UnitInput uses it for menu previews and the nearest-unit hint. */\nfunction factorOf(unit: ConcentrationUnit): number | undefined {\n if (!props.showConversion || !(isMolarity(unit) || isMassVolume(unit))) return undefined\n return convert(1, unit, getBaseUnit(unit)) ?? undefined\n}\n\n// Filter categories based on allowedUnits\nconst filteredCategories = computed(() => {\n const allowedUnits = props.allowedUnits\n if (!allowedUnits || allowedUnits.length === 0) {\n return unitCategories.value\n }\n return unitCategories.value\n .map(cat => ({\n label: cat.label,\n units: cat.units.filter(u => allowedUnits.includes(u)),\n }))\n .filter(cat => cat.units.length > 0)\n})\n\n// Flatten all available units\nconst availableUnits = computed(() => {\n return filteredCategories.value.flatMap(cat => cat.units)\n})\n\nconst unitOptions = computed(() =>\n filteredCategories.value.flatMap(category =>\n category.units.map(unit => ({\n value: unit,\n label: unit,\n group: filteredCategories.value.length > 1 ? category.label : undefined,\n factor: factorOf(unit),\n }))\n )\n)\n\n// Current value and unit\nconst currentValue = computed(() => props.modelValue?.value)\nconst currentUnit = computed(() => props.modelValue?.unit || availableUnits.value[0] || 'µM')\n\nfunction handleValueUpdate(value: number | undefined) {\n if (value === undefined || isNaN(value)) {\n emit('update:modelValue', undefined)\n return\n }\n\n // Apply min/max constraints\n let clampedValue = value\n if (props.min !== undefined && clampedValue < props.min) {\n clampedValue = props.min\n }\n if (props.max !== undefined && clampedValue > props.max) {\n clampedValue = props.max\n }\n\n emit('update:modelValue', {\n value: clampedValue,\n unit: currentUnit.value,\n })\n}\n\nfunction handleUnitUpdate(unit: string) {\n emit('update:modelValue', {\n value: currentValue.value ?? 0,\n unit: unit as ConcentrationUnit,\n })\n}\n\n// Ensure modelValue always has a valid unit\nwatch(availableUnits, (units) => {\n if (props.modelValue && !units.includes(props.modelValue.unit)) {\n emit('update:modelValue', {\n value: props.modelValue.value,\n unit: units[0] || 'µM',\n })\n }\n}, { immediate: true })\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-concentration-input',\n error ? 'mint-concentration-input--error' : '',\n disabled ? 'mint-concentration-input--disabled' : '',\n ]\"\n >\n <UnitInput\n :model-value=\"currentValue\"\n :unit=\"currentUnit\"\n :units=\"unitOptions\"\n :min=\"min\"\n :max=\"max\"\n :disabled=\"disabled\"\n :error=\"error\"\n :size=\"size\"\n :placeholder=\"placeholder\"\n @update:model-value=\"handleValueUpdate\"\n @update:unit=\"handleUnitUpdate\"\n />\n </div>\n</template>\n","import type { Component } from 'vue'\nimport type { FormFieldType } from '../types/form-builder'\n\nimport BaseInput from '../components/BaseInput.vue'\nimport SecretInput from '../components/SecretInput.vue'\nimport BaseTextarea from '../components/BaseTextarea.vue'\nimport BaseSelect from '../components/BaseSelect.vue'\nimport MultiSelect from '../components/MultiSelect.vue'\nimport BaseCheckbox from '../components/BaseCheckbox.vue'\nimport BaseToggle from '../components/BaseToggle.vue'\nimport BaseRadioGroup from '../components/BaseRadioGroup.vue'\nimport BaseSlider from '../components/BaseSlider.vue'\nimport TagsInput from '../components/TagsInput.vue'\nimport NumberInput from '../components/NumberInput.vue'\nimport DatePicker from '../components/DatePicker.vue'\nimport TimePicker from '../components/TimePicker.vue'\nimport DateTimePicker from '../components/DateTimePicker.vue'\nimport FileUploader from '../components/FileUploader.vue'\nimport GeneratedPathInput from '../components/GeneratedPathInput.vue'\nimport FormulaInput from '../components/FormulaInput.vue'\nimport SequenceInput from '../components/SequenceInput.vue'\nimport MoleculeInput from '../components/MoleculeInput.vue'\nimport ConcentrationInput from '../components/ConcentrationInput.vue'\nimport UnitInput from '../components/UnitInput.vue'\n\nexport interface RegistryEntry {\n component: Component\n /** Default props applied to the component. */\n defaults: Record<string, unknown>\n /** Whether the component uses v-model (false for event-only components like FileUploader). */\n vModel: boolean\n}\n\nconst registry: Record<FormFieldType, RegistryEntry> = {\n text: { component: BaseInput, defaults: { type: 'text' }, vModel: true },\n email: { component: BaseInput, defaults: { type: 'email' }, vModel: true },\n password: { component: BaseInput, defaults: { type: 'password' }, vModel: true },\n secret: { component: SecretInput, defaults: {}, vModel: true },\n tel: { component: BaseInput, defaults: { type: 'tel' }, vModel: true },\n url: { component: BaseInput, defaults: { type: 'url' }, vModel: true },\n search: { component: BaseInput, defaults: { type: 'search' }, vModel: true },\n number: { component: NumberInput, defaults: {}, vModel: true },\n textarea: { component: BaseTextarea, defaults: {}, vModel: true },\n select: { component: BaseSelect, defaults: {}, vModel: true },\n multiselect: { component: MultiSelect, defaults: {}, vModel: true },\n checkbox: { component: BaseCheckbox, defaults: {}, vModel: true },\n toggle: { component: BaseToggle, defaults: {}, vModel: true },\n radio: { component: BaseRadioGroup, defaults: {}, vModel: true },\n slider: { component: BaseSlider, defaults: {}, vModel: true },\n tags: { component: TagsInput, defaults: {}, vModel: true },\n date: { component: DatePicker, defaults: {}, vModel: true },\n time: { component: TimePicker, defaults: {}, vModel: true },\n datetime: { component: DateTimePicker, defaults: {}, vModel: true },\n file: { component: FileUploader, defaults: {}, vModel: false },\n path: { component: GeneratedPathInput, defaults: {}, vModel: true },\n formula: { component: FormulaInput, defaults: {}, vModel: true },\n sequence: { component: SequenceInput, defaults: {}, vModel: true },\n molecule: { component: MoleculeInput, defaults: {}, vModel: true },\n concentration: { component: ConcentrationInput, defaults: {}, vModel: true },\n unit: { component: UnitInput, defaults: {}, vModel: true },\n}\n\n/** Return the registry entry for a given field type. Throws if the type is unregistered. */\nexport function getFieldRegistryEntry(type: FormFieldType): RegistryEntry {\n return registry[type]\n}\n\n/** Get the default empty value for a given field type. */\nexport function getTypeDefault(type: FormFieldType): unknown {\n switch (type) {\n case 'checkbox':\n case 'toggle':\n return false\n case 'number':\n case 'slider':\n return undefined\n case 'multiselect':\n case 'tags':\n return []\n case 'secret':\n // A secret field has no empty string state: `null` means \"not stored\".\n return null\n default:\n return ''\n }\n}\n","export function recordValue(value: unknown): Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n ? value as Record<string, unknown>\n : {}\n}\n\nexport function numericValue(value: number | { value: number; message: string }): number {\n return typeof value === 'number' ? value : value.value\n}\n\nexport function orderedUnique(values: string[]): string[] {\n return [...new Set(values)]\n}\n\nexport function replaceRecord(target: Record<string, unknown>, values: Record<string, unknown>) {\n for (const key of Object.keys(target)) {\n delete target[key]\n }\n Object.assign(target, values)\n}\n\nexport function omitUndefined<T extends object>(record: T): T {\n const next: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(record as Record<string, unknown>)) {\n if (value !== undefined) next[key] = value\n }\n return next as T\n}\n\nexport function humanize(value: string): string {\n return value\n .replace(/[_-]+/g, ' ')\n .replace(/([a-z])([A-Z])/g, '$1 $2')\n .trim()\n .replace(/\\w\\S*/g, word => word.charAt(0).toUpperCase() + word.slice(1))\n}\n","import type {\n SelectOption,\n} from '../types'\nimport type {\n FormFieldType,\n} from '../types/form-builder'\nimport {\n getTypeDefault,\n} from './formBuilderRegistry'\nimport {\n humanize,\n} from './controlSchemaUtils'\nimport type {\n ControlDefinition,\n ControlInput,\n ControlOption,\n ControlOptionValue,\n ControlSchema,\n ControlSchemaOptions,\n} from './controlSchemaTypes'\n\nexport interface NormalizedControl {\n name: string\n definition: ControlDefinition\n type: FormFieldType\n sectionId: string\n viewId: string\n order: number\n}\n\nexport function normalizeControls(\n controls: ControlSchema,\n options: ControlSchemaOptions = {},\n): NormalizedControl[] {\n return Object.entries(controls)\n .map(([name, input], index): NormalizedControl => {\n const definition = normalizeControlDefinition(input)\n const type = definition.type ?? inferControlType(definition)\n return {\n name,\n definition,\n type,\n sectionId: definition.section ?? options.section ?? 'controls',\n viewId: definition.view ?? options.view ?? 'default',\n order: definition.order ?? index,\n }\n })\n .sort((a, b) => a.order - b.order)\n}\n\nexport function normalizeControlDefinition(input: ControlInput): ControlDefinition {\n if (isControlOptionArray(input)) {\n if (input.length === 0) return { type: 'tags', default: [] }\n return {\n default: optionValue(input[0]),\n options: input,\n }\n }\n\n if (typeof input === 'string' || typeof input === 'number' || typeof input === 'boolean') {\n return { default: input }\n }\n\n return input\n}\n\nexport function defaultValueForControl(definition: ControlDefinition, type: FormFieldType): unknown {\n if (definition.default !== undefined) return definition.default\n if (definition.defaultValue !== undefined) return definition.defaultValue\n return getTypeDefault(type)\n}\n\nexport function normalizeOption(option: ControlOption): SelectOption<unknown> {\n if (typeof option === 'object' && option !== null && 'label' in option) {\n return option\n }\n return {\n value: option,\n label: humanize(String(option)),\n }\n}\n\nfunction isControlOptionArray(input: ControlInput): input is readonly ControlOption[] {\n return Array.isArray(input)\n}\n\nfunction inferControlType(definition: ControlDefinition): FormFieldType {\n const value = definition.default ?? definition.defaultValue\n if (definition.options?.length) return Array.isArray(value) ? 'multiselect' : 'select'\n if (typeof value === 'boolean') return 'toggle'\n if (typeof value === 'number') return 'number'\n if (Array.isArray(value)) return 'tags'\n return 'text'\n}\n\nfunction optionValue(option: ControlOption): ControlOptionValue | unknown {\n if (typeof option === 'object' && option !== null && 'value' in option) {\n return option.value\n }\n return option\n}\n","import type {\n FieldValidation,\n FormFieldSchema,\n} from '../types/form-builder'\nimport {\n defaultValueForControl,\n normalizeOption,\n type NormalizedControl,\n} from './controlSchemaNormalize'\nimport {\n humanize,\n numericValue,\n} from './controlSchemaUtils'\nimport type {\n ControlDefinition,\n} from './controlSchemaTypes'\n\nexport function controlToFormField(control: NormalizedControl): FormFieldSchema {\n const { name, definition, type } = control\n const props = fieldProps(definition)\n return {\n name,\n label: definition.label ?? humanize(name),\n type,\n defaultValue: defaultValueForControl(definition, type),\n placeholder: definition.placeholder,\n hint: definition.hint,\n icon: definition.icon,\n iconColor: definition.iconColor,\n iconBg: definition.iconBg,\n size: definition.size,\n disabled: definition.disabled,\n readonly: definition.readonly,\n validation: validationForControl(definition),\n condition: definition.condition,\n access: definition.access,\n colSpan: definition.colSpan,\n props,\n }\n}\n\nfunction fieldProps(definition: ControlDefinition): Record<string, unknown> {\n const props: Record<string, unknown> = {}\n if (definition.min !== undefined) props.min = numericValue(definition.min)\n if (definition.max !== undefined) props.max = numericValue(definition.max)\n if (definition.options) props.options = definition.options.map(normalizeOption)\n return { ...props, ...(definition.props ?? {}) }\n}\n\nfunction validationForControl(definition: ControlDefinition): FieldValidation | undefined {\n const validation: FieldValidation = { ...(definition.validation ?? {}) }\n if (definition.required !== undefined) validation.required = definition.required\n if (definition.min !== undefined) validation.min = definition.min\n if (definition.max !== undefined) validation.max = definition.max\n if (definition.minLength !== undefined) validation.minLength = definition.minLength\n if (definition.maxLength !== undefined) validation.maxLength = definition.maxLength\n if (definition.email !== undefined) validation.email = definition.email\n if (definition.pattern !== undefined) validation.pattern = definition.pattern\n return Object.keys(validation).length > 0 ? validation : undefined\n}\n","import type {\n PillNavItem,\n} from '../types'\nimport type {\n NormalizedControl,\n} from './controlSchemaNormalize'\nimport {\n humanize,\n} from './controlSchemaUtils'\nimport type {\n ControlDefinition,\n ControlSchemaOptions,\n ControlSectionConfig,\n ControlSidebarConfig,\n} from './controlSchemaTypes'\n\nexport function sectionConfig(\n sectionId: string,\n controls: NormalizedControl[],\n options: ControlSchemaOptions,\n): ControlSectionConfig {\n const configured = options.sections?.[sectionId]\n const first = controls[0]?.definition\n return {\n ...configured,\n id: sectionId,\n label: configured?.label ?? first?.sectionLabel,\n title: configured?.title ?? first?.sectionLabel,\n description: configured?.description ?? first?.sectionDescription,\n subtitle: configured?.subtitle ?? first?.sectionSubtitle,\n }\n}\n\nexport function firstSidebarConfig(controls: NormalizedControl[]): ControlSidebarConfig | undefined {\n for (const control of controls) {\n const sidebar = control.definition.sidebar\n if (sidebar && typeof sidebar === 'object' && sidebar.enabled !== false) return sidebar\n }\n return undefined\n}\n\nexport function isSidebarEnabled(sidebar: ControlDefinition['sidebar']): boolean {\n if (sidebar === false) return false\n if (sidebar && typeof sidebar === 'object') return sidebar.enabled !== false\n return true\n}\n\nexport function controlViewItem(viewId: string, options: ControlSchemaOptions): PillNavItem {\n const config = options.views?.[viewId]\n return {\n id: viewId,\n label: config?.label ?? humanize(viewId),\n ...(config?.icon !== undefined ? { icon: config.icon } : {}),\n ...(config?.to !== undefined ? { to: config.to } : {}),\n ...(config?.href !== undefined ? { href: config.href } : {}),\n ...(config?.disabled !== undefined ? { disabled: config.disabled } : {}),\n ...(config?.children !== undefined ? { children: config.children } : {}),\n }\n}\n","import type {\n PillNavItem,\n SidebarToolSection,\n SettingsModalSchema,\n TopBarSettingsConfig,\n} from '../types'\nimport type {\n FormSectionSchema,\n} from '../types/form-builder'\nimport {\n controlToFormField,\n} from './controlSchemaFormFields'\nimport {\n controlViewItem,\n firstSidebarConfig,\n isSidebarEnabled,\n sectionConfig,\n} from './controlSchemaLayout'\nimport {\n normalizeControls,\n} from './controlSchemaNormalize'\nimport {\n humanize,\n orderedUnique,\n} from './controlSchemaUtils'\nimport type {\n ControlFormSchema,\n ControlSchema,\n ControlSchemaOptions,\n} from './controlSchemaTypes'\n\n/** Convert a compact control schema into a FormBuilder schema. */\nexport function controlsToFormSchema(\n controls: ControlSchema,\n options: ControlSchemaOptions = {},\n): ControlFormSchema {\n const normalized = normalizeControls(controls, options)\n const sectionIds = orderedUnique(normalized.map(control => control.sectionId))\n const sections = sectionIds.map((sectionId): FormSectionSchema => {\n const sectionControls = normalized.filter(control => control.sectionId === sectionId)\n const config = sectionConfig(sectionId, sectionControls, options)\n return {\n id: sectionId,\n title: config.title ?? config.label ?? humanize(sectionId),\n description: config.description,\n columns: config.columns ?? options.columns ?? 1,\n defaultOpen: config.defaultOpen,\n condition: config.condition,\n fields: sectionControls.map(controlToFormField),\n }\n })\n\n return {\n sections,\n submitLabel: options.submitLabel,\n cancelLabel: options.cancelLabel,\n showCancel: options.showCancel,\n }\n}\n\n/** Convert controls into AppSidebar panels grouped by view and section. */\nexport function controlsToSidebarPanels(\n controls: ControlSchema,\n options: ControlSchemaOptions = {},\n): Record<string, SidebarToolSection[]> {\n const normalized = normalizeControls(controls, options)\n .filter(control => isSidebarEnabled(control.definition.sidebar))\n const viewIds = orderedUnique(normalized.map(control => control.viewId))\n const panels: Record<string, SidebarToolSection[]> = {}\n\n for (const viewId of viewIds) {\n const viewControls = normalized.filter(control => control.viewId === viewId)\n const sectionIds = orderedUnique(viewControls.map(control => control.sectionId))\n panels[viewId] = sectionIds.map((sectionId): SidebarToolSection => {\n const sectionControls = viewControls.filter(control => control.sectionId === sectionId)\n const config = sectionConfig(sectionId, sectionControls, options)\n const sidebarConfig = firstSidebarConfig(sectionControls)\n return {\n id: sectionId,\n label: sidebarConfig?.label ?? config.label ?? config.title ?? humanize(sectionId),\n subtitle: sidebarConfig?.subtitle ?? config.subtitle,\n icon: sidebarConfig?.icon ?? config.icon,\n iconColor: sidebarConfig?.iconColor ?? config.iconColor,\n iconBg: sidebarConfig?.iconBg ?? config.iconBg,\n badge: sidebarConfig?.badge ?? config.badge,\n badgeTone: sidebarConfig?.badgeTone ?? config.badgeTone,\n actions: sidebarConfig?.actions ?? config.actions,\n defaultOpen: sidebarConfig?.defaultOpen ?? config.defaultOpen,\n showToggle: sidebarConfig?.showToggle ?? config.showToggle,\n }\n })\n }\n\n return panels\n}\n\n/** Convert controls into a SettingsModal schema grouped by the same sections. */\nexport function controlsToSettingsSchema(\n controls: ControlSchema,\n options: ControlSchemaOptions = {},\n): SettingsModalSchema {\n const normalized = normalizeControls(controls, options)\n const sectionIds = orderedUnique(normalized.map(control => control.sectionId))\n\n return {\n groups: sectionIds.map((sectionId) => {\n const sectionControls = normalized.filter(control => control.sectionId === sectionId)\n const config = sectionConfig(sectionId, sectionControls, options)\n return {\n id: sectionId,\n label: config.label ?? config.title ?? humanize(sectionId),\n description: config.description ?? config.subtitle,\n icon: typeof config.icon === 'string' ? config.icon : undefined,\n fields: sectionControls.map(controlToFormField),\n columns: config.columns ?? options.columns ?? 1,\n condition: config.condition,\n access: config.access,\n }\n }),\n }\n}\n\n/** Convert controls into an AppTopBar settingsConfig object that passes compact controls through to SettingsModal. */\nexport function controlsToTopBarSettingsConfig(\n controls: ControlSchema,\n options: ControlSchemaOptions = {},\n config: Omit<TopBarSettingsConfig, 'schema' | 'controls' | 'controlOptions'> = {},\n): TopBarSettingsConfig {\n return {\n ...config,\n controls,\n controlOptions: options,\n }\n}\n\n/** Return generated control view IDs that have at least one sidebar panel. */\nexport function controlsToViewIds(\n controls: ControlSchema,\n options: ControlSchemaOptions = {},\n): string[] {\n return controlsToViewItems(controls, options).map(item => item.id)\n}\n\n/** Return AppTopBar pillNav-compatible view items for switching generated control sidebars. */\nexport function controlsToViewItems(\n controls: ControlSchema,\n options: ControlSchemaOptions = {},\n): PillNavItem[] {\n return Object.entries(controlsToSidebarPanels(controls, options))\n .filter(([, sections]) => sections.length > 0)\n .map(([id]) => controlViewItem(id, options))\n}\n\n/** Return the first generated sidebar view ID, or an empty string when controls render no sidebar panels. */\nexport function getDefaultControlView(\n controls: ControlSchema,\n options: ControlSchemaOptions = {},\n): string {\n return controlsToViewIds(controls, options)[0] ?? ''\n}\n\n/** Return a headerless single-section FormBuilder schema for rendering inside an AppSidebar section slot. */\nexport function controlsToSectionFormSchema(\n controls: ControlSchema,\n sectionId: string,\n options: ControlSchemaOptions = {},\n): ControlFormSchema {\n const schema = controlsToFormSchema(controls, options)\n return {\n sections: schema.sections\n .filter(section => section.id === sectionId)\n .map(section => ({ ...section, title: '', description: undefined })),\n submitLabel: schema.submitLabel,\n cancelLabel: schema.cancelLabel,\n showCancel: schema.showCancel,\n }\n}\n\n/** Return headerless FormBuilder schemas keyed by section ID for AppSidebar auto-rendering. */\nexport function controlsToSectionFormSchemas(\n controls: ControlSchema,\n options: ControlSchemaOptions = {},\n): Record<string, ControlFormSchema> {\n const schema = controlsToFormSchema(controls, options)\n const schemas: Record<string, ControlFormSchema> = {}\n for (const section of schema.sections) {\n schemas[section.id] = {\n sections: [{ ...section, title: '', description: undefined }],\n submitLabel: schema.submitLabel,\n cancelLabel: schema.cancelLabel,\n showCancel: schema.showCancel,\n }\n }\n return schemas\n}\n","import {\n defaultValueForControl,\n normalizeControls,\n} from './controlSchemaNormalize'\nimport {\n controlToFormField,\n} from './controlSchemaFormFields'\nimport {\n controlsToFormSchema,\n controlsToSectionFormSchema,\n controlsToSectionFormSchemas,\n controlsToSettingsSchema,\n controlsToSidebarPanels,\n controlsToTopBarSettingsConfig,\n controlsToViewItems,\n} from './controlSchemaAdapters'\nimport type {\n ControlComponentBindingsConfig,\n ControlSchema,\n ControlSchemaOptions,\n ControlValues,\n UseControlSchemaReturn,\n} from './controlSchemaTypes'\n\nexport type * from './controlSchemaTypes'\n\nexport {\n mergeControlWorkspaceOptions,\n} from './controlWorkspaceOptions'\n\nexport {\n useControlWorkspace,\n} from './useControlWorkspace'\n\nexport {\n controlValuesToComponentBindings,\n controlValuesToComponentBindingsById,\n controlValuesToComponentProps,\n} from './controlComponentBindings'\n\nexport {\n controlsToFormSchema,\n controlsToSectionFormSchema,\n controlsToSectionFormSchemas,\n controlsToSettingsSchema,\n controlsToSidebarPanels,\n controlsToTopBarSettingsConfig,\n controlsToViewIds,\n controlsToViewItems,\n getDefaultControlView,\n} from './controlSchemaAdapters'\n\nexport {\n defineControlModel,\n isControlModelBinding,\n resolveControlModel,\n} from './controlSchemaModel'\n\nexport {\n defineDoseCalculatorControlProps,\n defineDoseDesignControlModel,\n defineWellPlateControlProps,\n defineWellPlateDoseComponentBindings,\n defineWellPlateDoseControlProps,\n} from './controlSchemaDoseDesign'\n\n/** Preserve literal control keys while marking an object as a MINT control schema. */\nexport function defineControls<TControls extends ControlSchema>(controls: TControls): TControls {\n return controls\n}\n\n/** Preserve literal SDK component binding ids while marking an object as generated workspace component bindings. */\nexport function defineControlComponentBindings<TBindings extends ControlComponentBindingsConfig>(\n bindings: TBindings,\n): TBindings {\n return bindings\n}\n\n/** Build default values for a control schema, matching FormBuilder field defaults. */\nexport function getControlDefaults<TControls extends ControlSchema>(\n controls: TControls,\n): ControlValues<TControls> {\n const values: Record<string, unknown> = {}\n for (const control of normalizeControls(controls)) {\n values[control.name] = defaultValueForControl(control.definition, control.type)\n }\n return values as ControlValues<TControls>\n}\n\n/** Prepare FormBuilder, SettingsModal, AppTopBar settings, AppSidebar, and initial values from one compact control model. */\nexport function useControlSchema<TControls extends ControlSchema>(\n controls: TControls,\n options: ControlSchemaOptions = {},\n): UseControlSchemaReturn<TControls> {\n const formSchema = controlsToFormSchema(controls, options)\n const settingsSchema = controlsToSettingsSchema(controls, options)\n const topBarSettingsConfig = controlsToTopBarSettingsConfig(controls, options)\n const sidebarPanels = controlsToSidebarPanels(controls, options)\n const viewItems = controlsToViewItems(controls, options)\n const viewIds = viewItems.map(item => item.id)\n const defaultView = viewIds[0] ?? ''\n const sectionSchemas = controlsToSectionFormSchemas(controls, options)\n\n return {\n controls,\n fields: normalizeControls(controls, options).map(controlToFormField),\n formSchema,\n form: {\n schema: formSchema,\n },\n settingsSchema,\n settings: {\n schema: settingsSchema,\n },\n topBarSettingsConfig,\n topBarSettings: {\n showSettings: true,\n settingsConfig: topBarSettingsConfig,\n },\n sidebarPanels,\n viewIds,\n viewItems,\n defaultView,\n sectionSchemas,\n sidebar: {\n panels: sidebarPanels,\n forms: sectionSchemas,\n viewIds,\n viewItems,\n defaultView,\n },\n initialValues: getControlDefaults(controls),\n sectionSchema: (sectionId: string) => controlsToSectionFormSchema(controls, sectionId, options),\n }\n}\n","/**\n * Shared color scales and color math for the MINT SDK.\n *\n * ## Why the exported values are hex, not `var(--…)`\n *\n * Every scale below is mirrored by a CSS custom property in\n * `styles/variables.css` (`--mint-sample-1…9`, `--mint-slot-r/g/b/y`), so\n * stylesheets and `:style` bindings can stay theme-aware by referencing the\n * token. The JavaScript constants deliberately carry the plain hex **fallback**\n * for the same slot, because these values are also\n *\n * - persisted into experiment design data (`SampleType.color`), where a\n * `var(--…)` string would be meaningless outside the browser, and\n * - handed to canvas / SVG / export code paths, which cannot resolve CSS\n * custom properties.\n *\n * Keep the two in sync: a change here must be mirrored in `variables.css`.\n */\n\nimport type { SlotPosition } from '../types/componentLabTypes'\n\n/**\n * Canonical categorical scale for sample types, plate maps, dose-response\n * series and legends. Mirrors `--mint-sample-1` … `--mint-sample-9`.\n */\nexport const SAMPLE_COLOR_SCALE: readonly string[] = [\n '#3B82F6', // blue\n '#10B981', // green\n '#EF4444', // red\n '#F59E0B', // amber\n '#8B5CF6', // purple\n '#F97316', // orange\n '#06B6D4', // cyan\n '#14B8A6', // teal\n '#6B7280', // gray\n]\n\n/**\n * Group palette as CSS tokens (3a): groups always take `--mint-sample-1` …\n * `--mint-sample-8`; the 9th (gray) stays out of the group cycle.\n */\nexport const SAMPLE_GROUP_TOKENS: readonly string[] = [\n 'var(--mint-sample-1)',\n 'var(--mint-sample-2)',\n 'var(--mint-sample-3)',\n 'var(--mint-sample-4)',\n 'var(--mint-sample-5)',\n 'var(--mint-sample-6)',\n 'var(--mint-sample-7)',\n 'var(--mint-sample-8)',\n]\n\n/**\n * Slot-position colors (R/G/B/Y rack positions).\n * Mirrors `--mint-slot-r`, `--mint-slot-g`, `--mint-slot-b`, `--mint-slot-y`.\n */\nexport const SLOT_COLORS: Record<SlotPosition, string> = {\n R: '#ef4444', // red\n G: '#22c55e', // green\n B: '#3b82f6', // blue\n Y: '#eab308', // yellow\n}\n\n/** Slot positions in their canonical display order. */\nexport const SLOT_ORDER: readonly SlotPosition[] = ['R', 'G', 'B', 'Y']\n\n/**\n * Color utilities for deriving same-hue-family shades.\n *\n * Used by SampleSelector and other group/legend UIs where a parent color\n * needs to seed a gradient of related shades for its children.\n */\n\nexport interface Hsl {\n h: number // 0–360\n s: number // 0–100\n l: number // 0–100\n}\n\nconst HEX_RE = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i\n\nfunction clamp(n: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, n))\n}\n\nexport function hexToHsl(hex: string): Hsl {\n const match = HEX_RE.exec(hex.trim())\n if (!match) return { h: 0, s: 0, l: 50 }\n\n let raw = match[1]\n if (raw.length === 3) raw = raw.split('').map(c => c + c).join('')\n\n const r = parseInt(raw.slice(0, 2), 16) / 255\n const g = parseInt(raw.slice(2, 4), 16) / 255\n const b = parseInt(raw.slice(4, 6), 16) / 255\n\n const max = Math.max(r, g, b)\n const min = Math.min(r, g, b)\n const delta = max - min\n\n let h = 0\n if (delta !== 0) {\n if (max === r) h = ((g - b) / delta) % 6\n else if (max === g) h = (b - r) / delta + 2\n else h = (r - g) / delta + 4\n }\n h = (h * 60 + 360) % 360\n\n const l = (max + min) / 2\n const s = delta === 0 ? 0 : delta / (1 - Math.abs(2 * l - 1))\n\n return { h, s: s * 100, l: l * 100 }\n}\n\nexport function hslToHex(h: number, s: number, l: number): string {\n const sNorm = clamp(s, 0, 100) / 100\n const lNorm = clamp(l, 0, 100) / 100\n const hNorm = ((h % 360) + 360) % 360\n\n const c = (1 - Math.abs(2 * lNorm - 1)) * sNorm\n const x = c * (1 - Math.abs(((hNorm / 60) % 2) - 1))\n const m = lNorm - c / 2\n\n let r = 0, g = 0, b = 0\n if (hNorm < 60) [r, g, b] = [c, x, 0]\n else if (hNorm < 120) [r, g, b] = [x, c, 0]\n else if (hNorm < 180) [r, g, b] = [0, c, x]\n else if (hNorm < 240) [r, g, b] = [0, x, c]\n else if (hNorm < 300) [r, g, b] = [x, 0, c]\n else [r, g, b] = [c, 0, x]\n\n const toHex = (n: number) => Math.round((n + m) * 255).toString(16).padStart(2, '0')\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`\n}\n\n/**\n * Derive a same-hue-family shade of `parentHex` for child at `index` of `total`.\n *\n * Lightness is distributed evenly within [35, 75] so all children remain\n * readable on light/dark backgrounds. Hue and saturation are inherited from\n * the parent. With `total <= 1`, returns the parent unchanged.\n *\n * Children are ordered light → dark by index, so index 0 is the brightest\n * sibling and index `total - 1` is the darkest.\n */\nexport function deriveShade(parentHex: string, index: number, total: number): string {\n if (total <= 1) return parentHex\n const { h, s, l } = hexToHsl(parentHex)\n\n const L_MIN = 35\n const L_MAX = 75\n const spread = Math.min(L_MAX - L_MIN, 40)\n const center = clamp(l, L_MIN + spread / 2, L_MAX - spread / 2)\n\n const top = center + spread / 2\n const bot = center - spread / 2\n const t = total === 1 ? 0.5 : index / (total - 1)\n const childL = top - t * (top - bot)\n\n const childS = clamp(s, 35, 100)\n return hslToHex(h, childS, childL)\n}\n","import type { Well, WellPlateFormat, WellPlateSize } from '../types'\n\nexport interface WellPlateConfig {\n rows: number\n cols: number\n}\n\nexport interface WellPlateCoordinate {\n row: number\n col: number\n}\n\nexport interface WellPlateSizeConfig {\n cellWidth: string\n cellHeight: string\n headerWidth: string\n headerHeight: string\n fontSize: string\n gap: string\n}\n\nexport const PLATE_CONFIGS: Record<WellPlateFormat, WellPlateConfig> = {\n 6: { rows: 2, cols: 3 },\n 12: { rows: 3, cols: 4 },\n 24: { rows: 4, cols: 6 },\n 48: { rows: 6, cols: 8 },\n 54: { rows: 6, cols: 9 },\n 96: { rows: 8, cols: 12 },\n 384: { rows: 16, cols: 24 },\n}\n\nexport const WELL_PLATE_SIZE_CONFIGS: Record<WellPlateSize, WellPlateSizeConfig> = {\n // Compact square wells (PlateEditor, 7a): room for the Q / i glyph, not a sample name.\n xs: { cellWidth: '26px', cellHeight: '26px', headerWidth: '20px', headerHeight: '20px', fontSize: '0.6875rem', gap: '6px' },\n sm: { cellWidth: '40px', cellHeight: '40px', headerWidth: '32px', headerHeight: '32px', fontSize: '0.625rem', gap: '2px' },\n md: { cellWidth: '56px', cellHeight: '32px', headerWidth: '32px', headerHeight: '24px', fontSize: '0.75rem', gap: '3px' },\n lg: { cellWidth: '80px', cellHeight: '40px', headerWidth: '40px', headerHeight: '32px', fontSize: '0.875rem', gap: '4px' },\n xl: { cellWidth: '96px', cellHeight: '48px', headerWidth: '48px', headerHeight: '40px', fontSize: '1rem', gap: '4px' },\n fill: { cellWidth: '100%', cellHeight: '32px', headerWidth: '32px', headerHeight: '24px', fontSize: '0.75rem', gap: '2px' },\n}\n\n/**\n * Spreadsheet-style row label for a zero-based row index: A…Z, then AA, AB, …\n *\n * This is the single row-label generator for the SDK — plate grids, rack\n * grids, well-id parsing and the template builders all go through it.\n */\nexport function rowLabel(index: number): string {\n let label = ''\n let current = index\n for (;;) {\n label = String.fromCharCode(65 + (current % 26)) + label\n current = Math.floor(current / 26) - 1\n if (current < 0) return label\n }\n}\n\n/** Inverse of {@link rowLabel}: 'A' → 0, 'Z' → 25, 'AA' → 26. */\nexport function rowIndex(label: string): number {\n return [...label].reduce((value, char) => value * 26 + char.charCodeAt(0) - 64, 0) - 1\n}\n\nexport function createPlateRowLabels(config: WellPlateConfig): string[] {\n return Array.from({ length: config.rows }, (_, index) => rowLabel(index))\n}\n\nfunction plateConfigOrThrow(format: number): WellPlateConfig {\n const config = PLATE_CONFIGS[format as WellPlateFormat]\n if (!config) throw new Error(`Unsupported plate format '${format}'.`)\n return config\n}\n\n/** Every well id of a plate, row-major (A1, A2, … B1, …). */\nexport function wellIdsForFormat(format: number): string[] {\n const { rows, cols } = plateConfigOrThrow(format)\n return Array.from({ length: rows }, (_, row) =>\n Array.from({ length: cols }, (_col, col) => `${rowLabel(row)}${col + 1}`)\n ).flat()\n}\n\n/** Throw unless `wellId` names a well that exists on a `format`-well plate. */\nexport function assertWellInFormat(wellId: string, format: number): void {\n const { rows, cols } = plateConfigOrThrow(format)\n const match = /^([A-Z]+)([1-9][0-9]*)$/.exec(wellId.toUpperCase())\n if (!match) {\n throw new Error(`Invalid well id '${wellId}'.`)\n }\n const row = rowIndex(match[1])\n const col = Number(match[2]) - 1\n if (row < 0 || col < 0 || row >= rows || col >= cols) {\n throw new Error(`Well '${wellId}' is outside a ${format}-well plate.`)\n }\n}\n\n/** Coerce an unknown value to a supported plate format, else `fallback`. */\nexport function readPlateFormat(value: unknown, fallback: WellPlateFormat): WellPlateFormat {\n const parsed = typeof value === 'number'\n ? value\n : typeof value === 'string'\n ? Number(value)\n : Number.NaN\n return parsed in PLATE_CONFIGS ? (parsed as WellPlateFormat) : fallback\n}\n\nexport function createPlateColumnLabels(config: WellPlateConfig): number[] {\n return Array.from({ length: config.cols }, (_, index) => index + 1)\n}\n\nexport function createWellGrid(\n config: WellPlateConfig,\n rowLabels: string[],\n wells: Record<string, Partial<Well>>,\n): Well[][] {\n const grid: Well[][] = []\n for (let row = 0; row < config.rows; row++) {\n const rowWells: Well[] = []\n for (let col = 0; col < config.cols; col++) {\n const id = `${rowLabels[row]}${col + 1}`\n const wellData = wells[id] || {}\n rowWells.push({\n id,\n row,\n col,\n state: wellData.state || 'empty',\n sampleType: wellData.sampleType,\n group: wellData.group,\n value: wellData.value,\n metadata: wellData.metadata,\n })\n }\n grid.push(rowWells)\n }\n return grid\n}\n\nexport function getRectangleWellIds(\n start: WellPlateCoordinate,\n end: WellPlateCoordinate,\n rowLabels: string[],\n): Set<string> {\n const minRow = Math.min(start.row, end.row)\n const maxRow = Math.max(start.row, end.row)\n const minCol = Math.min(start.col, end.col)\n const maxCol = Math.max(start.col, end.col)\n\n const wells = new Set<string>()\n for (let row = minRow; row <= maxRow; row++) {\n for (let col = minCol; col <= maxCol; col++) {\n wells.add(`${rowLabels[row]}${col + 1}`)\n }\n }\n return wells\n}\n","export { isRecord } from '../utils/records'\n\nexport function readStringList(value: unknown, fallback: string[]): string[] {\n if (Array.isArray(value)) {\n const items = value.map(item => String(item).trim()).filter(Boolean)\n return items.length ? items : fallback\n }\n if (typeof value === 'string') {\n const items = value.split(',').map(item => item.trim()).filter(Boolean)\n return items.length ? items : fallback\n }\n return fallback\n}\n\nexport function readNumberList(value: unknown, fallback: number[]): number[] {\n const rawItems = Array.isArray(value)\n ? value\n : typeof value === 'string'\n ? value.split(',')\n : []\n const items = rawItems\n .map(item => Number(String(item).trim()))\n .filter(item => Number.isFinite(item))\n return items.length ? items : fallback\n}\n\nexport function readString(value: unknown, fallback: string): string {\n return typeof value === 'string' && value.trim() ? value.trim() : fallback\n}\n\nexport function readOptionalString(value: unknown): string | undefined {\n return typeof value === 'string' && value.trim() ? value.trim() : undefined\n}\n\nexport function readInteger(value: unknown, fallback: number): number {\n const parsed = typeof value === 'number'\n ? value\n : typeof value === 'string'\n ? Number(value)\n : Number.NaN\n return Number.isFinite(parsed) ? Math.max(1, Math.round(parsed)) : fallback\n}\n\nexport function readNumber(value: unknown, fallback: number): number {\n const parsed = typeof value === 'number'\n ? value\n : typeof value === 'string'\n ? Number(value)\n : Number.NaN\n return Number.isFinite(parsed) ? parsed : fallback\n}\n\nexport function readBoolean(value: unknown, fallback: boolean): boolean {\n return typeof value === 'boolean' ? value : fallback\n}\n","import type {\n BioTemplateEnvelope,\n TemplateCollection,\n TemplateCollectionEnvelope,\n TemplateId,\n} from './types'\nimport { isRecord } from './builderReadUtils'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport const TEMPLATE_COLLECTION_KEY = 'templates'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createTemplateEnvelope<TData>(\n templateId: TemplateId,\n data: TData,\n metadata: Record<string, unknown> = {},\n templateVersion = '1.0'\n): BioTemplateEnvelope<TData> {\n return {\n template_id: templateId,\n template_version: templateVersion,\n kind: 'experiment-design',\n data,\n metadata,\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createTemplateCollection(\n templates: Array<BioTemplateEnvelope<unknown>>,\n metadata?: Record<string, unknown>\n): TemplateCollectionEnvelope {\n const collection: TemplateCollection = {}\n for (const template of templates) {\n assertGenericTemplateEnvelope(template)\n const templateId = template.template_id\n if (collection[templateId]) {\n throw new Error(`Duplicate template_id '${templateId}' in template collection.`)\n }\n collection[templateId] = template\n }\n\n return metadata === undefined\n ? { [TEMPLATE_COLLECTION_KEY]: collection }\n : { [TEMPLATE_COLLECTION_KEY]: collection, metadata }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function extractTemplateCollection(value: unknown): TemplateCollection {\n if (isEnvelope<unknown>(value)) {\n assertGenericTemplateEnvelope(value)\n return { [value.template_id]: value }\n }\n if (!isRecord(value)) {\n throw new Error('Template collection payload must be an object.')\n }\n\n const rawCollection = value[TEMPLATE_COLLECTION_KEY]\n if (rawCollection === undefined) {\n return {}\n }\n if (!isRecord(rawCollection)) {\n throw new Error('Template collection must be an object.')\n }\n\n const collection: TemplateCollection = {}\n for (const [templateId, template] of Object.entries(rawCollection)) {\n assertGenericTemplateEnvelope(template)\n if (template.template_id !== templateId) {\n throw new Error(\n `Template collection key '${templateId}' does not match envelope template_id '${template.template_id}'.`\n )\n }\n collection[templateId] = template\n }\n return collection\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function ensureTemplateFromCollection<TTemplate extends BioTemplateEnvelope<unknown>>(\n value: unknown,\n templateId: TemplateId | string\n): TTemplate {\n const collection = extractTemplateCollection(value)\n const template = collection[templateId]\n if (!template) {\n throw new Error(`Template '${templateId}' was not found in template collection.`)\n }\n assertTemplateEnvelope(template, templateId)\n return template as TTemplate\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function assertTemplateEnvelope<TData>(\n value: unknown,\n templateId: TemplateId | string\n): asserts value is BioTemplateEnvelope<TData> {\n assertGenericTemplateEnvelope(value)\n if (value.template_id !== templateId) {\n throw new Error(`Expected template_id '${templateId}', got '${String(value.template_id)}'.`)\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function ensureTemplateEnvelope<TTemplate extends BioTemplateEnvelope<unknown>>(\n value: unknown,\n templateId: TemplateId | string\n): TTemplate {\n assertTemplateEnvelope(value, templateId)\n return value as TTemplate\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function getTemplateData<TData>(\n template: BioTemplateEnvelope<TData> | TData,\n templateId?: TemplateId | string\n): TData {\n if (isEnvelope<TData>(template)) {\n if (templateId) assertTemplateEnvelope<TData>(template, templateId)\n return template.data\n }\n return template\n}\n\nfunction assertGenericTemplateEnvelope(value: unknown): asserts value is BioTemplateEnvelope<unknown> {\n if (!isRecord(value)) {\n throw new Error('Template envelope must be an object.')\n }\n if (typeof value.template_id !== 'string' || value.template_id.length === 0) {\n throw new Error('Template envelope requires a template_id string.')\n }\n if (typeof value.template_version !== 'string' || value.template_version.length === 0) {\n throw new Error('Template envelope requires a template_version string.')\n }\n if (!isRecord(value.data)) {\n throw new Error('Template envelope data must be an object.')\n }\n if ('metadata' in value && !isRecord(value.metadata)) {\n throw new Error('Template envelope metadata must be an object.')\n }\n}\n\nfunction isEnvelope<TData>(value: unknown): value is BioTemplateEnvelope<TData> {\n return isRecord(value) && 'template_id' in value && 'data' in value\n}\n","/** Normalize human-facing template lookup terms so spaces, hyphens, and underscores behave the same. */\nexport function normalizeTemplateLookupKey(value: string): string {\n return value.trim().toLowerCase().replace(/[\\s_-]+/g, '-')\n}\n\nexport function templateIdentifierMatches(query: string, identifiers: readonly string[]): boolean {\n const normalizedQuery = normalizeTemplateLookupKey(query)\n return identifiers.some(value => normalizeTemplateLookupKey(value) === normalizedQuery)\n}\n\nexport function templateSearchMatches(query: string, values: readonly string[]): boolean {\n const lowerQuery = query.trim().toLowerCase()\n const normalizedQuery = normalizeTemplateLookupKey(query)\n return values.some(value =>\n value.toLowerCase().includes(lowerQuery)\n || normalizeTemplateLookupKey(value).includes(normalizedQuery),\n )\n}\n","import type { TemplateId } from './types'\n\nimport { templateIdentifierMatches, templateSearchMatches } from './lookup'\n\nexport interface BioTemplateCatalogEntry {\n name: TemplateId\n template_id: TemplateId\n template_version: string\n label: string\n category: 'bio-data'\n purpose: string\n aliases: readonly string[]\n python_import: string\n python_example: string\n frontend_import: string\n frontend_adapters: readonly string[]\n components: readonly string[]\n add_command: string\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport const bioTemplateCatalog = [\n {\n name: 'plate-map',\n template_id: 'plate-map',\n template_version: '1.0',\n label: 'Plate map',\n category: 'bio-data',\n purpose: 'Plate layout, wells, sample assignments, and sample legend data.',\n aliases: ['wellplate', 'well-plate', 'plate layout', 'plate-map editor'],\n python_import: 'from mint_sdk.templates import PlateMapTemplate, save_template',\n python_example: 'PlateMapTemplate.create_96_well(name=\"Plate 1\", samples=[\"Control\", \"Treatment\"])',\n frontend_import: \"import { toPlateMapEditorState, toWellPlateWells } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toPlateMapEditorState', 'toWellPlateWells'],\n components: ['PlateEditor', 'WellPlate', 'SampleLegend'],\n add_command: 'mint add data-template plate-map --page',\n },\n {\n name: 'sample-sheet',\n template_id: 'sample-sheet',\n template_version: '1.0',\n label: 'Sample sheet',\n category: 'bio-data',\n purpose: 'Tabular sample metadata, display columns, and group definitions.',\n aliases: ['sample metadata', 'sample table', 'metadata sheet', 'csv samples'],\n python_import: 'from mint_sdk.templates import SampleSheetTemplate, save_template',\n python_example: 'SampleSheetTemplate.from_rows([{\"sample_id\": \"S001\", \"name\": \"Control 1\", \"group\": \"Control\"}])',\n frontend_import: \"import { toTemplateDataFrame, toSampleOptions } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toSampleDataFrame', 'toSampleRows', 'toSampleColumns', 'toSampleOptions'],\n components: ['DataFrame', 'SampleSelector', 'GroupAssigner'],\n add_command: 'mint add data-template sample-sheet --page',\n },\n {\n name: 'sample-prep',\n template_id: 'sample-prep',\n template_version: '1.0',\n label: 'Sample prep',\n category: 'bio-data',\n purpose: 'Extraction, dilution, normalization, transfer, source/destination, volume, reagent, and status steps.',\n aliases: ['sample preparation', 'extraction', 'dilution', 'normalization', 'prep steps'],\n python_import: 'from mint_sdk.templates import SamplePrepTemplate, save_template',\n python_example: 'SamplePrepTemplate.create([\"S001\", \"S002\"], prep_type=\"extraction\", output_volume=50)',\n frontend_import: \"import { toSamplePrepDataFrame, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toSamplePrepDataFrame', 'toSamplePrepRows', 'toSamplePrepColumns'],\n components: ['DataFrame', 'ProtocolStepEditor', 'SampleSelector', 'WellPlate'],\n add_command: 'mint add data-template sample-prep --page',\n },\n {\n name: 'dose-response',\n template_id: 'dose-response',\n template_version: '1.0',\n label: 'Dose response',\n category: 'bio-data',\n purpose: 'Compounds, concentration series, controls, replicates, and optional plate layout.',\n aliases: [\n 'drug response',\n 'concentration series',\n 'dose curve',\n 'dose design',\n 'dose planner',\n 'dose calculator',\n 'drp',\n ],\n python_import: 'from mint_sdk.templates import ControlDefinition, DoseResponseTemplate, save_template',\n python_example: 'DoseResponseTemplate.create({\"Compound A\": [10, 1, 0.1]}, unit=\"uM\", replicates=3)',\n frontend_import: \"import { toDoseConditions, toDoseLayoutState } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toDoseConditions', 'toDoseLayoutState'],\n components: ['DoseCalculator', 'ReagentEditor', 'WellPlate'],\n add_command: 'mint add data-template dose-response --page',\n },\n {\n name: 'calibration-curve',\n template_id: 'calibration-curve',\n template_version: '1.0',\n label: 'Calibration curve',\n category: 'bio-data',\n purpose: 'Standard curves, blank/QC points, fitted model settings, and acceptance thresholds.',\n aliases: ['standard curve', 'calibration', 'quantitation', 'qc acceptance', 'calibrator'],\n python_import: 'from mint_sdk.templates import CalibrationCurveTemplate, save_template',\n python_example: 'CalibrationCurveTemplate.create([0.1, 1, 10, 100], analyte=\"Glucose\", unit=\"uM\")',\n frontend_import: \"import { toCalibrationCurveDataFrame, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toCalibrationCurveDataFrame', 'toCalibrationCurveRows', 'toCalibrationCurveColumns'],\n components: ['DataFrame', 'FitPanel', 'ChartContainer'],\n add_command: 'mint add data-template calibration-curve --page',\n },\n {\n name: 'time-course',\n template_id: 'time-course',\n template_version: '1.0',\n label: 'Time course',\n category: 'bio-data',\n purpose: 'Longitudinal time points, conditions, replicates, and scheduled samples.',\n aliases: ['longitudinal', 'time series', 'sampling schedule', 'kinetics'],\n python_import: 'from mint_sdk.templates import TimeCourseTemplate, save_template',\n python_example: 'TimeCourseTemplate.create([0, 6, 24], unit=\"hour\", conditions=[\"Control\", \"Treatment\"], replicates=3)',\n frontend_import: \"import { toTemplateDataFrame, toTimeCourseSteps } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toTimeCourseDataFrame', 'toTimeCourseRows', 'toTimeCourseSteps', 'toTimeCourseColumns'],\n components: ['ExperimentTimeline', 'DataFrame', 'ScheduleCalendar'],\n add_command: 'mint add data-template time-course --page',\n },\n {\n name: 'protocol-steps',\n template_id: 'protocol-steps',\n template_version: '1.0',\n label: 'Protocol steps',\n category: 'bio-data',\n purpose: 'Ordered experiment protocol steps, durations, statuses, and run-sheet parameters.',\n aliases: ['protocol', 'run sheet', 'workflow', 'method steps', 'sop'],\n python_import: 'from mint_sdk.templates import ProtocolStepsTemplate, save_template',\n python_example: 'ProtocolStepsTemplate.create([\"Seed cells\", \"Add treatment\", \"Measure viability\"])',\n frontend_import: \"import { toProtocolSteps, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toProtocolSteps', 'toProtocolDataFrame'],\n components: ['ExperimentTimeline', 'ProtocolStepEditor', 'DataFrame'],\n add_command: 'mint add data-template protocol-steps --page',\n },\n {\n name: 'assay-matrix',\n template_id: 'assay-matrix',\n template_version: '1.0',\n label: 'Assay matrix',\n category: 'bio-data',\n purpose: 'Sample-by-feature measurement matrices for omics, plate-reader, and marker assays.',\n aliases: ['omics matrix', 'measurement matrix', 'readout matrix', 'feature table'],\n python_import: 'from mint_sdk.templates import AssayMatrixTemplate, save_template',\n python_example: 'AssayMatrixTemplate.create(samples=[\"S001\", \"S002\"], features=[\"Lactate\", \"Glucose\"])',\n frontend_import: \"import { toAssayMatrixSampleOptions, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toAssayMatrixDataFrame', 'toAssayMatrixRows', 'toAssayMatrixColumns', 'toAssayMatrixSampleOptions'],\n components: ['DataFrame', 'ChartContainer', 'SampleSelector'],\n add_command: 'mint add data-template assay-matrix --page',\n },\n {\n name: 'reagent-list',\n template_id: 'reagent-list',\n template_version: '1.0',\n label: 'Reagent list',\n category: 'bio-data',\n purpose: 'Experiment reagents, catalog numbers, lots, storage, locations, and stock status.',\n aliases: ['reagents', 'inventory', 'antibodies', 'primers', 'compound stocks'],\n python_import: 'from mint_sdk.templates import ReagentListTemplate, save_template',\n python_example: 'ReagentListTemplate.create([\"DMSO\", \"Compound A\", \"Anti-HA antibody\"])',\n frontend_import: \"import { toReagentListItems, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toReagentDataFrame', 'toReagentListItems'],\n components: ['ReagentList', 'DataFrame', 'ReagentEditor'],\n add_command: 'mint add data-template reagent-list --page',\n },\n {\n name: 'flow-cytometry-panel',\n template_id: 'flow-cytometry-panel',\n template_version: '1.0',\n label: 'Flow cytometry panel',\n category: 'bio-data',\n purpose: 'Flow-cytometry markers, fluorophores, detectors, compensation controls, and panel metadata.',\n aliases: ['flow panel', 'facs panel', 'cytometry panel', 'antibody panel'],\n python_import: 'from mint_sdk.templates import FlowCytometryPanelTemplate, save_template',\n python_example: 'FlowCytometryPanelTemplate.create([\"CD3\", \"CD4\", \"CD8\"], instrument=\"BD LSRFortessa\")',\n frontend_import: \"import { toFlowPanelDataFrame, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toFlowPanelDataFrame', 'toFlowPanelRows', 'toFlowPanelColumns'],\n components: ['DataFrame', 'ReagentList', 'SampleSelector'],\n add_command: 'mint add data-template flow-cytometry-panel --page',\n },\n {\n name: 'instrument-run',\n template_id: 'instrument-run',\n template_version: '1.0',\n label: 'Instrument run',\n category: 'bio-data',\n purpose: 'Instrument sequence tables, sample queues, methods, QC, blanks, and acquisition status.',\n aliases: ['run queue', 'sequence table', 'sample queue', 'lcms run', 'instrument sequence', 'batch run'],\n python_import: 'from mint_sdk.templates import InstrumentRunTemplate, save_template',\n python_example: 'InstrumentRunTemplate.create([\"S001\", \"S002\"], instrument=\"LC-MS\")',\n frontend_import: \"import { toInstrumentRunDataFrame, toInstrumentRunScheduleEvents, toInstrumentRunSteps, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toInstrumentRunDataFrame', 'toInstrumentRunRows', 'toInstrumentRunColumns', 'toInstrumentRunSteps', 'toInstrumentRunScheduleEvents'],\n components: ['DataFrame', 'ExperimentTimeline', 'ScheduleCalendar', 'SampleSelector'],\n add_command: 'mint add data-template instrument-run --page',\n },\n {\n name: 'qpcr-plate',\n template_id: 'qpcr-plate',\n template_version: '1.0',\n label: 'qPCR plate',\n category: 'bio-data',\n purpose: 'qPCR/ddPCR plate layouts, samples, targets, replicate reactions, controls, and Cq fields.',\n aliases: ['qpcr', 'qPCR', 'ddpcr', 'rt-qpcr', 'gene expression', 'primer plate'],\n python_import: 'from mint_sdk.templates import QpcrPlateTemplate, save_template',\n python_example: 'QpcrPlateTemplate.create(samples=[\"Control\", \"Treatment\"], targets=[\"ACTB\", \"GAPDH\"], replicates=3)',\n frontend_import: \"import { toQpcrDataFrame, toQpcrWellPlateWells, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toQpcrDataFrame', 'toQpcrRows', 'toQpcrColumns', 'toQpcrWellPlateWells'],\n components: ['DataFrame', 'WellPlate', 'SampleSelector'],\n add_command: 'mint add data-template qpcr-plate --page',\n },\n] as const satisfies readonly BioTemplateCatalogEntry[]\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function listBioTemplateCatalog(): readonly BioTemplateCatalogEntry[] {\n return bioTemplateCatalog\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function getBioTemplateInfo(name: string): BioTemplateCatalogEntry | undefined {\n return bioTemplateCatalog.find(entry => {\n const identifiers = [\n entry.name,\n entry.template_id,\n entry.label,\n ...entry.aliases,\n ]\n return templateIdentifierMatches(name, identifiers)\n })\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function searchBioTemplateCatalog(query: string): readonly BioTemplateCatalogEntry[] {\n const normalized = query.trim().toLowerCase()\n if (!normalized) return bioTemplateCatalog\n\n return bioTemplateCatalog.filter(entry => templateSearchMatches(normalized, [\n entry.name,\n entry.template_id,\n entry.label,\n entry.purpose,\n entry.python_import,\n entry.python_example,\n entry.frontend_import,\n entry.add_command,\n ...entry.aliases,\n ...entry.frontend_adapters,\n ...entry.components,\n ]))\n}\n","import { bioTemplateCatalog } from './catalog'\nimport type { TemplateId, TemplatePackId } from './types'\n\nimport { templateIdentifierMatches, templateSearchMatches } from './lookup'\n\nexport interface BioTemplatePackEntry {\n name: TemplatePackId\n label: string\n category: 'bio-template-pack'\n purpose: string\n templates: readonly TemplateId[]\n aliases: readonly string[]\n frontend_adapters: readonly string[]\n components: readonly string[]\n add_command: string\n docs_command: string\n}\n\ninterface BioTemplatePackDefinition {\n name: TemplatePackId\n label: string\n purpose: string\n templates: readonly TemplateId[]\n aliases: readonly string[]\n}\n\nconst templateInfoById = new Map(\n bioTemplateCatalog.map(entry => [entry.template_id, entry]),\n)\n\nfunction collectTemplateField(\n templateIds: readonly TemplateId[],\n field: 'frontend_adapters' | 'components',\n): readonly string[] {\n const values: string[] = []\n for (const templateId of templateIds) {\n const entry = templateInfoById.get(templateId)\n if (!entry) {\n throw new Error(`Unknown bio template in pack catalog: ${templateId}`)\n }\n for (const value of entry[field]) {\n if (!values.includes(value)) {\n values.push(value)\n }\n }\n }\n return values\n}\n\nfunction createPack(definition: BioTemplatePackDefinition): BioTemplatePackEntry {\n return {\n ...definition,\n category: 'bio-template-pack',\n frontend_adapters: collectTemplateField(definition.templates, 'frontend_adapters'),\n components: collectTemplateField(definition.templates, 'components'),\n add_command: `mint add data-template-pack ${definition.name} --page`,\n docs_command: `mint docs template-pack ${definition.name}`,\n }\n}\n\nconst bioTemplatePackDefinitions = [\n {\n name: 'cell-culture-screen',\n label: 'Cell culture screen',\n purpose: 'Plate layout, sample metadata, sample prep, reagents, protocol, dose-response, and flow-panel setup.',\n templates: [\n 'sample-sheet',\n 'sample-prep',\n 'plate-map',\n 'reagent-list',\n 'protocol-steps',\n 'dose-response',\n 'flow-cytometry-panel',\n ],\n aliases: ['cell culture', 'screen', 'drug screen', 'plate screen'],\n },\n {\n name: 'omics-assay',\n label: 'Omics assay',\n purpose: 'Sample metadata, sample prep, reagents, protocol, instrument run queue, calibration curve, and measurement matrix.',\n templates: [\n 'sample-sheet',\n 'sample-prep',\n 'reagent-list',\n 'protocol-steps',\n 'instrument-run',\n 'calibration-curve',\n 'assay-matrix',\n ],\n aliases: [\n 'omics',\n 'metabolomics',\n 'metabolism',\n 'metabolite profiling',\n 'proteomics',\n 'assay matrix',\n 'lcms',\n 'standard curve',\n ],\n },\n {\n name: 'longitudinal-study',\n label: 'Longitudinal study',\n purpose: 'Sample metadata, time-course schedule, protocol, and measurement matrix.',\n templates: [\n 'sample-sheet',\n 'time-course',\n 'protocol-steps',\n 'assay-matrix',\n ],\n aliases: ['time series', 'time-course study', 'kinetics', 'longitudinal'],\n },\n {\n name: 'molecular-assay',\n label: 'Molecular assay',\n purpose: 'Sample metadata, sample prep, reagents, protocol, instrument run queue, calibration curve, and qPCR/ddPCR plate setup.',\n templates: [\n 'sample-sheet',\n 'sample-prep',\n 'reagent-list',\n 'protocol-steps',\n 'instrument-run',\n 'calibration-curve',\n 'qpcr-plate',\n ],\n aliases: ['molecular', 'qpcr', 'qPCR', 'gene expression', 'rt-qpcr', 'ddpcr'],\n },\n] as const satisfies readonly BioTemplatePackDefinition[]\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport const bioTemplatePacks = bioTemplatePackDefinitions.map(createPack) as readonly BioTemplatePackEntry[]\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function listBioTemplatePacks(): readonly BioTemplatePackEntry[] {\n return bioTemplatePacks\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function getBioTemplatePackInfo(name: string): BioTemplatePackEntry | undefined {\n return bioTemplatePacks.find(entry => {\n const identifiers = [\n entry.name,\n entry.label,\n ...entry.aliases,\n ]\n return templateIdentifierMatches(name, identifiers)\n })\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function searchBioTemplatePacks(query: string): readonly BioTemplatePackEntry[] {\n const normalized = query.trim().toLowerCase()\n if (!normalized) return bioTemplatePacks\n\n return bioTemplatePacks.filter(entry => templateSearchMatches(normalized, [\n entry.name,\n entry.label,\n entry.purpose,\n entry.add_command,\n entry.docs_command,\n ...entry.templates,\n ...entry.aliases,\n ...entry.frontend_adapters,\n ...entry.components,\n ]))\n}\n","import type { TemplateId, TemplatePresetId } from './types'\n\nimport { templateIdentifierMatches, templateSearchMatches } from './lookup'\n\nexport interface BioTemplatePresetEntry {\n name: TemplatePresetId\n label: string\n category: 'bio-template-preset'\n purpose: string\n templates: readonly TemplateId[]\n aliases: readonly string[]\n python_import: string\n python_example: string\n frontend_import: string\n frontend_adapters: readonly string[]\n components: readonly string[]\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport const bioTemplatePresets = [\n {\n name: 'wellplate-screen',\n label: 'Well-plate screen',\n category: 'bio-template-preset',\n purpose: 'Plate map, sample sheet, and dose-response payloads for plate-based screening assays.',\n templates: ['plate-map', 'sample-sheet', 'dose-response'],\n aliases: [\n 'wellplate',\n 'well-plate screen',\n 'drug screen',\n 'plate screen',\n 'dose response plate',\n 'dose design',\n 'dose planner',\n ],\n python_import: 'from mint_sdk.templates import create_wellplate_screen_collection, save_template_collection',\n python_example: 'create_wellplate_screen_collection(samples=[\"Control\", \"Treatment\"], compounds={\"Drug A\": [10, 1, 0.1]}, unit=\"uM\")',\n frontend_import: \"import { createWellPlateScreenCollection, toPlateMapEditorState, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toPlateMapEditorState', 'toTemplateDataFrame', 'toDoseConditions'],\n components: ['PlateEditor', 'WellPlate', 'DataFrame', 'DoseCalculator'],\n },\n {\n name: 'qpcr-expression',\n label: 'qPCR expression',\n category: 'bio-template-preset',\n purpose: 'Sample metadata and qPCR/ddPCR plate layout for target-expression assays.',\n templates: ['sample-sheet', 'qpcr-plate'],\n aliases: ['qpcr', 'qPCR', 'rt-qpcr', 'ddpcr', 'gene expression', 'primer plate'],\n python_import: 'from mint_sdk.templates import create_qpcr_expression_collection, save_template_collection',\n python_example: 'create_qpcr_expression_collection(samples=[\"Control\", \"Treatment\"], targets=[\"ACTB\", \"GAPDH\"], replicates=3)',\n frontend_import: \"import { createQpcrExpressionCollection, toQpcrWellPlateWells, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toQpcrDataFrame', 'toQpcrWellPlateWells'],\n components: ['DataFrame', 'WellPlate', 'SampleSelector'],\n },\n {\n name: 'lcms-batch',\n label: 'LC-MS batch',\n category: 'bio-template-preset',\n purpose: 'Sample metadata, instrument queue, and assay matrix payloads for omics acquisition batches.',\n templates: ['sample-sheet', 'instrument-run', 'assay-matrix'],\n aliases: [\n 'lcms',\n 'lc-ms',\n 'mass spec batch',\n 'omics batch',\n 'metabolomics',\n 'metabolism',\n 'metabolite profiling',\n 'run queue',\n 'sequence table',\n ],\n python_import: 'from mint_sdk.templates import create_lcms_batch_collection, save_template_collection',\n python_example: 'create_lcms_batch_collection(samples=[\"S001\", \"S002\"], features=[\"Glucose\", \"Lactate\"], instrument=\"LC-MS\")',\n frontend_import: \"import { createLcmsBatchCollection, toAssayMatrixSampleOptions, toInstrumentRunDataFrame, toInstrumentRunScheduleEvents, toInstrumentRunSteps, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toInstrumentRunDataFrame', 'toInstrumentRunSteps', 'toInstrumentRunScheduleEvents', 'toAssayMatrixDataFrame', 'toAssayMatrixSampleOptions'],\n components: ['DataFrame', 'ExperimentTimeline', 'ScheduleCalendar', 'ChartContainer', 'SampleSelector'],\n },\n {\n name: 'targeted-metabolomics',\n label: 'Targeted metabolomics',\n category: 'bio-template-preset',\n purpose: 'Sample metadata, extraction prep, internal standards, LC/GC-MS sequence, calibration curve, and metabolite readout matrix for quantitative metabolomics.',\n templates: ['sample-sheet', 'sample-prep', 'reagent-list', 'instrument-run', 'calibration-curve', 'assay-matrix'],\n aliases: [\n 'targeted metabolomics',\n 'quantitative metabolomics',\n 'lc-ms metabolomics',\n 'gc-ms metabolomics',\n 'targeted lcms',\n 'metabolite quantitation',\n 'mass spec quantitation',\n 'internal standards',\n 'peak area ratio',\n ],\n python_import: 'from mint_sdk.templates import create_targeted_metabolomics_collection, save_template_collection',\n python_example: 'create_targeted_metabolomics_collection(samples=[\"S001\", \"S002\"], metabolites=[\"Glucose\", \"Lactate\"], internal_standards=[\"13C Glucose\"], instrument=\"LC-MS\")',\n frontend_import: \"import { createTargetedMetabolomicsCollection, toInstrumentRunDataFrame, toCalibrationCurveDataFrame, toAssayMatrixDataFrame, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toSamplePrepDataFrame', 'toReagentDataFrame', 'toInstrumentRunDataFrame', 'toInstrumentRunSteps', 'toInstrumentRunScheduleEvents', 'toCalibrationCurveDataFrame', 'toAssayMatrixDataFrame', 'toAssayMatrixSampleOptions'],\n components: ['DataFrame', 'ReagentList', 'ExperimentTimeline', 'ScheduleCalendar', 'FitPanel', 'ChartContainer', 'SampleSelector'],\n },\n {\n name: 'elisa-assay',\n label: 'ELISA assay',\n category: 'bio-template-preset',\n purpose: 'Plate layout, sample metadata, standard curve, and readout matrix for ELISA and plate-reader assays.',\n templates: ['plate-map', 'sample-sheet', 'calibration-curve', 'assay-matrix'],\n aliases: ['elisa', 'plate reader assay', 'standard curve plate', 'absorbance assay', 'immunoassay'],\n python_import: 'from mint_sdk.templates import create_elisa_assay_collection, save_template_collection',\n python_example: 'create_elisa_assay_collection(samples=[\"Control\", \"Treatment\"], analyte=\"IL-6\", standard_concentrations=[1000, 100, 10, 1], unit=\"pg/mL\")',\n frontend_import: \"import { createElisaAssayCollection, toPlateMapEditorState, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toPlateMapEditorState', 'toTemplateDataFrame', 'toCalibrationCurveDataFrame'],\n components: ['PlateEditor', 'WellPlate', 'DataFrame', 'FitPanel', 'ChartContainer'],\n },\n {\n name: 'flow-cytometry-assay',\n label: 'Flow cytometry assay',\n category: 'bio-template-preset',\n purpose: 'Sample metadata, antibody marker panel, compensation controls, and readout matrix for flow-cytometry assays.',\n templates: ['sample-sheet', 'flow-cytometry-panel', 'assay-matrix'],\n aliases: [\n 'flow cytometry',\n 'facs',\n 'facs panel',\n 'flow panel',\n 'immune phenotyping',\n 'immunophenotyping',\n ],\n python_import: 'from mint_sdk.templates import create_flow_cytometry_assay_collection, save_template_collection',\n python_example: 'create_flow_cytometry_assay_collection(samples=[\"Control\", \"Treatment\"], markers=[\"CD3\", \"CD4\", \"CD8\"], instrument=\"BD LSRFortessa\")',\n frontend_import: \"import { createFlowCytometryAssayCollection, toFlowPanelDataFrame, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toFlowPanelDataFrame', 'toAssayMatrixDataFrame'],\n components: ['DataFrame', 'SampleSelector', 'ChartContainer'],\n },\n {\n name: 'western-blot-assay',\n label: 'Western blot assay',\n category: 'bio-template-preset',\n purpose: 'Sample metadata, antibody/reagent list, protocol steps, and normalized protein readout matrix for Western blot assays.',\n templates: ['sample-sheet', 'reagent-list', 'protocol-steps', 'assay-matrix'],\n aliases: ['western blot', 'western-blot', 'immunoblot', 'protein blot', 'protein expression'],\n python_import: 'from mint_sdk.templates import create_western_blot_assay_collection, save_template_collection',\n python_example: 'create_western_blot_assay_collection(samples=[\"Control\", \"Treatment\"], targets=[\"pERK\", \"ERK\"], loading_control=\"ACTB\")',\n frontend_import: \"import { createWesternBlotAssayCollection, toReagentDataFrame, toProtocolDataFrame, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toReagentDataFrame', 'toProtocolDataFrame'],\n components: ['DataFrame', 'ReagentList', 'ExperimentTimeline', 'SampleSelector'],\n },\n] as const satisfies readonly BioTemplatePresetEntry[]\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function listBioTemplatePresets(): readonly BioTemplatePresetEntry[] {\n return bioTemplatePresets\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function getBioTemplatePresetInfo(name: string): BioTemplatePresetEntry | undefined {\n return bioTemplatePresets.find(entry => {\n const identifiers = [\n entry.name,\n entry.label,\n ...entry.aliases,\n ]\n return templateIdentifierMatches(name, identifiers)\n })\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function searchBioTemplatePresets(query: string): readonly BioTemplatePresetEntry[] {\n const normalized = query.trim().toLowerCase()\n if (!normalized) return bioTemplatePresets\n\n return bioTemplatePresets.filter(entry => templateSearchMatches(normalized, [\n entry.name,\n entry.label,\n entry.purpose,\n entry.python_import,\n entry.python_example,\n entry.frontend_import,\n ...entry.templates,\n ...entry.aliases,\n ...entry.frontend_adapters,\n ...entry.components,\n ]))\n}\n","import { isObjectLike as isRecord } from '../utils/records'\nimport { extractTemplateCollection } from './templateEnvelopes'\nimport { getBioTemplateInfo } from './catalog'\nimport { getBioTemplatePackInfo } from './packs'\nimport { getBioTemplatePresetInfo } from './presets'\nimport type {\n BioTemplateEnvelope,\n TemplateCollectionEnvelope,\n TemplateId,\n TemplatePackId,\n TemplatePresetId,\n} from './types'\n\ntype BioTemplateComponentTarget =\n | TemplateId\n | TemplatePackId\n | TemplatePresetId\n | string\n | BioTemplateEnvelope<unknown>\n | TemplateCollectionEnvelope\n\nexport function resolveComponentTemplateIds(target: BioTemplateComponentTarget): TemplateId[] {\n if (typeof target === 'string') {\n const preset = getBioTemplatePresetInfo(target)\n if (preset) return [...preset.templates]\n const pack = getBioTemplatePackInfo(target)\n if (pack) return [...pack.templates]\n const template = getBioTemplateInfo(target)\n return template ? [template.template_id] : []\n }\n\n if (isTemplateEnvelope(target)) {\n const template = getBioTemplateInfo(target.template_id)\n return template ? [template.template_id] : []\n }\n\n const presetName = collectionPresetName(target)\n if (presetName) {\n const preset = getBioTemplatePresetInfo(presetName)\n if (preset) return [...preset.templates]\n }\n\n const packName = collectionPackName(target)\n if (packName) {\n const pack = getBioTemplatePackInfo(packName)\n if (pack) return [...pack.templates]\n }\n\n return Object.keys(extractTemplateCollection(target))\n .map(templateId => getBioTemplateInfo(templateId)?.template_id)\n .filter((templateId): templateId is TemplateId => templateId !== undefined)\n}\n\nexport function isTemplateEnvelope(value: unknown): value is BioTemplateEnvelope<unknown> {\n return isRecord(value) && typeof value.template_id === 'string' && 'data' in value\n}\n\nfunction collectionPresetName(value: unknown): string | undefined {\n if (!isRecord(value) || !isRecord(value.metadata)) return undefined\n return typeof value.metadata.preset === 'string' ? value.metadata.preset : undefined\n}\n\nfunction collectionPackName(value: unknown): string | undefined {\n if (!isRecord(value) || !isRecord(value.metadata)) return undefined\n return typeof value.metadata.pack === 'string' ? value.metadata.pack : undefined\n}\n\n","interface CloneableComponentBinding {\n adapters: readonly string[]\n props: readonly string[]\n}\n\ninterface NamedComponentBinding {\n template_id: string\n component: string\n}\n\ninterface ComponentImportStatement {\n statement: string\n}\n\nexport function cloneBindingMap<TName extends string, TBinding extends CloneableComponentBinding>(\n bindings: Record<TName, readonly TBinding[]>\n): Record<TName, TBinding[]> {\n const result = {} as Record<TName, TBinding[]>\n for (const name of Object.keys(bindings) as TName[]) {\n result[name] = cloneBindings(bindings[name])\n }\n return result\n}\n\nexport function cloneBindings<TBinding extends CloneableComponentBinding>(\n bindings: readonly TBinding[]\n): TBinding[] {\n return bindings.map(cloneBinding)\n}\n\nexport function cloneBinding<TBinding extends CloneableComponentBinding>(binding: TBinding): TBinding {\n return {\n ...binding,\n adapters: [...binding.adapters],\n props: [...binding.props],\n }\n}\n\nexport function uniquePropsName(\n binding: NamedComponentBinding,\n usedNames: Map<string, number>\n): string {\n const base = toCamelIdentifier(`${binding.template_id} ${binding.component} props`)\n const count = usedNames.get(base) ?? 0\n usedNames.set(base, count + 1)\n return count === 0 ? base : `${base}${count + 1}`\n}\n\nfunction toCamelIdentifier(value: string): string {\n const words = value\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .split(/[^A-Za-z0-9]+/)\n .filter(Boolean)\n\n if (words.length === 0) return 'componentProps'\n\n return words\n .map((word, index) => {\n const lower = word.toLowerCase()\n return index === 0 ? lower : lower.charAt(0).toUpperCase() + lower.slice(1)\n })\n .join('')\n}\n\nexport function toVueSfc(\n imports: readonly ComponentImportStatement[],\n setupLines: readonly string[],\n template: string,\n includeTargetTypeImport: boolean\n): string {\n const importLines = [\n ...imports.map(item => item.statement),\n \"import { toBioTemplateComponentProps } from '@morscherlab/mint-sdk/templates'\",\n ...(includeTargetTypeImport\n ? [\"import type { BioTemplateEnvelope, TemplateCollectionEnvelope } from '@morscherlab/mint-sdk/templates'\"]\n : []),\n ]\n const templateLines = template\n ? template.split('\\n').map(line => ` ${line}`).join('\\n')\n : ''\n\n return [\n '<script setup lang=\"ts\">',\n ...importLines,\n '',\n ...setupLines,\n '</script>',\n '',\n '<template>',\n templateLines,\n '</template>',\n ].join('\\n')\n}\n","import type { TemplateId } from './types'\n\ninterface ComponentBinding {\n id: string\n template_id: TemplateId\n component: string\n adapters: readonly string[]\n props: readonly string[]\n description: string\n importPath: '@morscherlab/mint-sdk'\n}\n\nexport const templateComponentBindings = {\n 'plate-map': [\n binding('plate-map', 'PlateEditor', ['toPlateMapEditorState', 'racksFromPlateState'], ['modelValue', 'activeRackId', 'groups', 'formats', 'wellFields'], 'Edit plate layouts and assign sample groups from plate-map template data.'),\n binding('plate-map', 'WellPlate', ['toWellPlateWells'], ['format', 'wells', 'sampleColors', 'legendItems'], 'Render the active plate as a well grid.'),\n ],\n 'sample-sheet': [\n binding('sample-sheet', 'DataFrame', ['toTemplateDataFrame'], ['data', 'columns', 'rowKey'], 'Render sample metadata as a sortable table.'),\n binding('sample-sheet', 'SampleSelector', ['toSampleOptions'], ['samples', 'modelValue'], 'Select samples from sample-sheet records.'),\n ],\n 'sample-prep': [\n binding('sample-prep', 'DataFrame', ['toTemplateDataFrame'], ['data', 'columns', 'rowKey'], 'Render preparation steps as a table.'),\n ],\n 'dose-response': [\n binding('dose-response', 'DoseCalculator', ['toDoseConditions'], ['mode', 'targetWells'], 'Configure serial dilution and apply concentrations to wells.'),\n binding('dose-response', 'WellPlate', ['toDoseLayoutState'], ['format', 'wells', 'sampleColors', 'legendItems'], 'Render the optional dose-response plate layout.'),\n ],\n 'calibration-curve': [\n binding('calibration-curve', 'DataFrame', ['toTemplateDataFrame'], ['data', 'columns', 'rowKey'], 'Render standards, QC, blanks, and response values.'),\n ],\n 'time-course': [\n binding('time-course', 'ExperimentTimeline', ['toTimeCourseSteps'], ['modelValue', 'orientation'], 'Render time points as an ordered timeline.'),\n binding('time-course', 'DataFrame', ['toTemplateDataFrame'], ['data', 'columns', 'rowKey'], 'Render longitudinal samples as a table.'),\n ],\n 'protocol-steps': [\n binding('protocol-steps', 'ExperimentTimeline', ['toProtocolSteps'], ['modelValue', 'orientation', 'editable'], 'Render protocol steps as an editable timeline.'),\n binding('protocol-steps', 'DataFrame', ['toTemplateDataFrame'], ['data', 'columns', 'rowKey'], 'Render protocol steps as a table.'),\n ],\n 'assay-matrix': [\n binding('assay-matrix', 'DataFrame', ['toTemplateDataFrame'], ['data', 'columns', 'rowKey'], 'Render sample-by-feature measurements.'),\n binding('assay-matrix', 'SampleSelector', ['toAssayMatrixSampleOptions'], ['samples', 'modelValue'], 'Select samples from assay-matrix records.'),\n ],\n 'reagent-list': [\n binding('reagent-list', 'ReagentList', ['toReagentListItems'], ['modelValue'], 'Render reagents with lot, storage, and stock metadata.'),\n binding('reagent-list', 'DataFrame', ['toTemplateDataFrame'], ['data', 'columns', 'rowKey'], 'Render reagents as a table.'),\n ],\n 'flow-cytometry-panel': [\n binding('flow-cytometry-panel', 'DataFrame', ['toTemplateDataFrame'], ['data', 'columns', 'rowKey'], 'Render markers, fluorophores, detectors, and controls.'),\n ],\n 'instrument-run': [\n binding('instrument-run', 'DataFrame', ['toTemplateDataFrame'], ['data', 'columns', 'rowKey'], 'Render acquisition queues, methods, QC, and run status.'),\n binding(\n 'instrument-run',\n 'ScheduleCalendar',\n ['toInstrumentRunScheduleEvents'],\n ['modelValue', 'events', 'view', 'readonly', 'showNavigation', 'showViewToggle'],\n 'Render acquisition queues as a scheduled run calendar.',\n ),\n binding(\n 'instrument-run',\n 'ExperimentTimeline',\n ['toInstrumentRunSteps'],\n ['modelValue', 'orientation', 'showDuration', 'editable'],\n 'Render acquisition queues as an ordered run timeline.',\n ),\n ],\n 'qpcr-plate': [\n binding('qpcr-plate', 'WellPlate', ['toQpcrWellPlateWells'], ['format', 'wells', 'sampleColors', 'legendItems'], 'Render qPCR reactions on a well plate.'),\n binding('qpcr-plate', 'DataFrame', ['toTemplateDataFrame'], ['data', 'columns', 'rowKey'], 'Render qPCR reactions, targets, controls, and Cq values.'),\n ],\n} satisfies Record<TemplateId, readonly ComponentBinding[]>\n\nfunction binding(\n templateId: TemplateId,\n component: string,\n adapters: readonly string[],\n props: readonly string[],\n description: string\n): ComponentBinding {\n return {\n id: `${templateId}:${component}`,\n template_id: templateId,\n component,\n adapters,\n props,\n description,\n importPath: '@morscherlab/mint-sdk',\n }\n}\n","import type {\n AssayMatrixTemplateData,\n CalibrationCurveTemplateData,\n DoseResponseTemplateData,\n FlowCytometryPanelTemplateData,\n InstrumentRunTemplateData,\n PlateMapTemplateData,\n ProtocolStepsTemplateData,\n QpcrPlateTemplateData,\n ReagentListTemplateData,\n SamplePrepTemplateData,\n SampleSheetTemplateData,\n TimeCourseTemplateData,\n} from './types'\nimport { assertWellInFormat } from '../components/WellPlate.geometry'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validatePlateMapData(data: PlateMapTemplateData): void {\n if (!Array.isArray(data.plates) || data.plates.length === 0) {\n throw new Error('Plate-map template requires at least one plate.')\n }\n const sampleIds = new Set(data.samples.map(sample => sample.id))\n if (sampleIds.size !== data.samples.length) {\n throw new Error('Plate-map sample ids must be unique.')\n }\n for (const plate of data.plates) {\n for (const [wellId, well] of Object.entries(plate.wells)) {\n if (well.id !== wellId) {\n throw new Error(`Well key '${wellId}' does not match well id '${well.id}'.`)\n }\n if (well.sampleType && !sampleIds.has(well.sampleType)) {\n throw new Error(`Well '${well.id}' references unknown sample '${well.sampleType}'.`)\n }\n }\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateSampleSheetData(data: SampleSheetTemplateData): void {\n if (!Array.isArray(data.samples) || data.samples.length === 0) {\n throw new Error('Sample-sheet template requires at least one sample.')\n }\n const sampleIds = new Set(data.samples.map(sample => sample.sampleId))\n if (sampleIds.size !== data.samples.length) {\n throw new Error('Sample-sheet sample ids must be unique.')\n }\n for (const group of data.groups) {\n for (const sampleId of group.samples) {\n if (!sampleIds.has(sampleId)) {\n throw new Error(`Group '${group.name}' references unknown sample '${sampleId}'.`)\n }\n }\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateSamplePrepData(data: SamplePrepTemplateData): void {\n if (!data.protocolName) {\n throw new Error('Sample-prep template requires protocolName.')\n }\n if (!Array.isArray(data.steps) || data.steps.length === 0) {\n throw new Error('Sample-prep template requires at least one step.')\n }\n const stepIds = new Set(data.steps.map(step => step.id))\n if (stepIds.size !== data.steps.length) {\n throw new Error('Sample-prep step ids must be unique.')\n }\n const orders = new Set(data.steps.map(step => step.order))\n if (orders.size !== data.steps.length) {\n throw new Error('Sample-prep step orders must be unique.')\n }\n for (const step of data.steps) {\n if (!step.id || !step.name) {\n throw new Error('Sample-prep steps require id and name.')\n }\n if (step.order < 0) {\n throw new Error(`Sample-prep step '${step.id}' has a negative order.`)\n }\n if (!step.volumeUnit) {\n throw new Error(`Sample-prep step '${step.id}' requires volumeUnit.`)\n }\n if (step.inputVolume !== undefined && step.inputVolume < 0) {\n throw new Error(`Sample-prep step '${step.id}' has a negative input volume.`)\n }\n if (step.outputVolume !== undefined && step.outputVolume < 0) {\n throw new Error(`Sample-prep step '${step.id}' has a negative output volume.`)\n }\n if (step.durationMin !== undefined && step.durationMin < 0) {\n throw new Error(`Sample-prep step '${step.id}' has a negative duration.`)\n }\n if (!step.sourceSampleId && !step.destinationSampleId && !step.reagentId) {\n throw new Error(`Sample-prep step '${step.id}' requires a source, destination, or reagent.`)\n }\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateDoseResponseData(data: DoseResponseTemplateData): void {\n if (!Array.isArray(data.compounds) || data.compounds.length === 0) {\n throw new Error('Dose-response template requires at least one compound.')\n }\n if (!data.unit) {\n throw new Error('Dose-response template requires a unit.')\n }\n if (data.replicates < 1) {\n throw new Error('Dose-response replicates must be at least 1.')\n }\n for (const compound of data.compounds) {\n if (compound.concentrations.length === 0) {\n throw new Error(`Compound '${compound.name}' requires at least one concentration.`)\n }\n if (compound.concentrations.some(value => value < 0)) {\n throw new Error(`Compound '${compound.name}' has a negative concentration.`)\n }\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateCalibrationCurveData(data: CalibrationCurveTemplateData): void {\n if (!data.analyte) {\n throw new Error('Calibration-curve template requires an analyte.')\n }\n if (!data.xUnit) {\n throw new Error('Calibration-curve template requires xUnit.')\n }\n if (!data.responseUnit) {\n throw new Error('Calibration-curve template requires responseUnit.')\n }\n if (!Array.isArray(data.points) || data.points.length === 0) {\n throw new Error('Calibration-curve template requires at least one point.')\n }\n if (data.acceptance.minRSquared < 0 || data.acceptance.minRSquared > 1) {\n throw new Error('Calibration-curve minRSquared must be between 0 and 1.')\n }\n if (data.acceptance.standardTolerancePercent < 0 || data.acceptance.qcTolerancePercent < 0) {\n throw new Error('Calibration-curve tolerances cannot be negative.')\n }\n\n const pointIds = new Set(data.points.map(point => point.id))\n if (pointIds.size !== data.points.length) {\n throw new Error('Calibration-curve point ids must be unique.')\n }\n const orders = new Set(data.points.map(point => point.order))\n if (orders.size !== data.points.length) {\n throw new Error('Calibration-curve point orders must be unique.')\n }\n\n let standards = 0\n for (const point of data.points) {\n if (!point.id || !point.level) {\n throw new Error('Calibration-curve points require id and level.')\n }\n if (!point.unit) {\n throw new Error(`Calibration-curve point '${point.id}' requires unit.`)\n }\n if (point.order < 0) {\n throw new Error(`Calibration-curve point '${point.id}' has a negative order.`)\n }\n if (point.concentration < 0) {\n throw new Error(`Calibration-curve point '${point.id}' has a negative concentration.`)\n }\n if ((point.role === 'standard' || point.role === 'qc') && point.concentration <= 0) {\n throw new Error(`Calibration-curve point '${point.id}' requires positive concentration.`)\n }\n if (point.replicate < 1) {\n throw new Error(`Calibration-curve point '${point.id}' replicate must be at least 1.`)\n }\n if (point.role === 'standard' && point.include) {\n standards += 1\n }\n }\n\n if (standards < 2) {\n throw new Error('Calibration-curve template requires at least two included standards.')\n }\n if (data.acceptance.requireBlank && !data.points.some(point => point.role === 'blank')) {\n throw new Error('Calibration-curve template requires a blank point when requireBlank is true.')\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateTimeCourseData(data: TimeCourseTemplateData): void {\n if (!Array.isArray(data.timepoints) || data.timepoints.length === 0) {\n throw new Error('Time-course template requires at least one time point.')\n }\n if (!Array.isArray(data.conditions) || data.conditions.length === 0) {\n throw new Error('Time-course template requires at least one condition.')\n }\n const timepointIds = new Set(data.timepoints.map(timepoint => timepoint.id))\n if (timepointIds.size !== data.timepoints.length) {\n throw new Error('Time-course time point ids must be unique.')\n }\n const conditionIds = new Set(data.conditions.map(condition => condition.id))\n if (conditionIds.size !== data.conditions.length) {\n throw new Error('Time-course condition ids must be unique.')\n }\n const sampleIds = new Set(data.samples.map(sample => sample.sampleId))\n if (sampleIds.size !== data.samples.length) {\n throw new Error('Time-course sample ids must be unique.')\n }\n for (const sample of data.samples) {\n if (!timepointIds.has(sample.timepointId)) {\n throw new Error(`Sample '${sample.sampleId}' references unknown time point.`)\n }\n if (!conditionIds.has(sample.conditionId)) {\n throw new Error(`Sample '${sample.sampleId}' references unknown condition.`)\n }\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateProtocolStepsData(data: ProtocolStepsTemplateData): void {\n if (!Array.isArray(data.steps) || data.steps.length === 0) {\n throw new Error('Protocol-steps template requires at least one step.')\n }\n const stepIds = new Set(data.steps.map(step => step.id))\n if (stepIds.size !== data.steps.length) {\n throw new Error('Protocol-steps ids must be unique.')\n }\n const orders = new Set(data.steps.map(step => step.order))\n if (orders.size !== data.steps.length) {\n throw new Error('Protocol-steps orders must be unique.')\n }\n for (const step of data.steps) {\n if (!step.id) {\n throw new Error('Protocol step id is required.')\n }\n if (!step.name) {\n throw new Error(`Protocol step '${step.id}' requires a name.`)\n }\n if (step.duration !== undefined && step.duration < 0) {\n throw new Error(`Protocol step '${step.id}' has a negative duration.`)\n }\n if (step.order < 0) {\n throw new Error(`Protocol step '${step.id}' has a negative order.`)\n }\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateAssayMatrixData(data: AssayMatrixTemplateData): void {\n if (!Array.isArray(data.samples) || data.samples.length === 0) {\n throw new Error('Assay-matrix template requires at least one sample.')\n }\n if (!Array.isArray(data.features) || data.features.length === 0) {\n throw new Error('Assay-matrix template requires at least one feature.')\n }\n const sampleIds = new Set(data.samples.map(sample => sample.sampleId))\n if (sampleIds.size !== data.samples.length) {\n throw new Error('Assay-matrix sample ids must be unique.')\n }\n const featureIds = new Set(data.features.map(feature => feature.id))\n if (featureIds.size !== data.features.length) {\n throw new Error('Assay-matrix feature ids must be unique.')\n }\n const measurementIds = new Set<string>()\n for (const measurement of data.measurements) {\n const key = `${measurement.sampleId}:${measurement.featureId}`\n if (measurementIds.has(key)) {\n throw new Error(`Duplicate assay measurement for '${key}'.`)\n }\n measurementIds.add(key)\n if (!sampleIds.has(measurement.sampleId)) {\n throw new Error(`Measurement references unknown sample '${measurement.sampleId}'.`)\n }\n if (!featureIds.has(measurement.featureId)) {\n throw new Error(`Measurement references unknown feature '${measurement.featureId}'.`)\n }\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateReagentListData(data: ReagentListTemplateData): void {\n if (!Array.isArray(data.reagents) || data.reagents.length === 0) {\n throw new Error('Reagent-list template requires at least one reagent.')\n }\n const reagentIds = new Set(data.reagents.map(reagent => reagent.id))\n if (reagentIds.size !== data.reagents.length) {\n throw new Error('Reagent-list reagent ids must be unique.')\n }\n for (const reagent of data.reagents) {\n if (!reagent.id) {\n throw new Error('Reagent-list reagent id is required.')\n }\n if (!reagent.name) {\n throw new Error(`Reagent '${reagent.id}' requires a name.`)\n }\n if (reagent.stockLevel !== undefined && reagent.stockLevel < 0) {\n throw new Error(`Reagent '${reagent.id}' has a negative stock level.`)\n }\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateFlowCytometryPanelData(data: FlowCytometryPanelTemplateData): void {\n if (!Array.isArray(data.markers) || data.markers.length === 0) {\n throw new Error('Flow-cytometry panel template requires at least one marker.')\n }\n const markerIds = new Set(data.markers.map(marker => marker.id))\n if (markerIds.size !== data.markers.length) {\n throw new Error('Flow-cytometry panel marker ids must be unique.')\n }\n const controlIds = new Set(data.controls.map(control => control.id))\n if (controlIds.size !== data.controls.length) {\n throw new Error('Flow-cytometry panel control ids must be unique.')\n }\n for (const marker of data.markers) {\n if (!marker.id) {\n throw new Error('Flow-cytometry panel marker id is required.')\n }\n if (!marker.marker) {\n throw new Error(`Flow-cytometry panel marker '${marker.id}' requires a marker name.`)\n }\n }\n for (const control of data.controls) {\n if (!control.id) {\n throw new Error('Flow-cytometry panel control id is required.')\n }\n if (!control.name) {\n throw new Error(`Flow-cytometry panel control '${control.id}' requires a name.`)\n }\n if (control.markerId && !markerIds.has(control.markerId)) {\n throw new Error(`Flow-cytometry panel control '${control.id}' references unknown marker '${control.markerId}'.`)\n }\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateInstrumentRunData(data: InstrumentRunTemplateData): void {\n if (!Array.isArray(data.methods) || data.methods.length === 0) {\n throw new Error('Instrument-run template requires at least one method.')\n }\n if (!Array.isArray(data.items) || data.items.length === 0) {\n throw new Error('Instrument-run template requires at least one run item.')\n }\n const methodIds = new Set(data.methods.map(method => method.id))\n if (methodIds.size !== data.methods.length) {\n throw new Error('Instrument-run method ids must be unique.')\n }\n for (const method of data.methods) {\n if (!method.id || !method.name) {\n throw new Error('Instrument-run methods require id and name.')\n }\n }\n const itemIds = new Set(data.items.map(item => item.id))\n if (itemIds.size !== data.items.length) {\n throw new Error('Instrument-run item ids must be unique.')\n }\n const orders = new Set(data.items.map(item => item.order))\n if (orders.size !== data.items.length) {\n throw new Error('Instrument-run item orders must be unique.')\n }\n for (const item of data.items) {\n if (!item.id) {\n throw new Error('Instrument-run items require id.')\n }\n if (!methodIds.has(item.methodId)) {\n throw new Error(`Instrument-run item '${item.id}' references unknown method '${item.methodId}'.`)\n }\n if (item.kind === 'sample' && !item.sampleId) {\n throw new Error(`Instrument-run sample item '${item.id}' requires sampleId.`)\n }\n if (item.order < 0) {\n throw new Error(`Instrument-run item '${item.id}' has a negative order.`)\n }\n if (item.injectionVolume !== undefined && item.injectionVolume < 0) {\n throw new Error(`Instrument-run item '${item.id}' has a negative injection volume.`)\n }\n if (item.expectedDurationMin !== undefined && item.expectedDurationMin < 0) {\n throw new Error(`Instrument-run item '${item.id}' has a negative expected duration.`)\n }\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateQpcrPlateData(data: QpcrPlateTemplateData): void {\n if (!Array.isArray(data.samples) || data.samples.length === 0) {\n throw new Error('qPCR plate template requires at least one sample.')\n }\n if (!Array.isArray(data.targets) || data.targets.length === 0) {\n throw new Error('qPCR plate template requires at least one target.')\n }\n if (!Array.isArray(data.reactions) || data.reactions.length === 0) {\n throw new Error('qPCR plate template requires at least one reaction.')\n }\n const sampleIds = new Set(data.samples.map(sample => sample.sampleId))\n if (sampleIds.size !== data.samples.length) {\n throw new Error('qPCR plate sample ids must be unique.')\n }\n const targetIds = new Set(data.targets.map(target => target.id))\n if (targetIds.size !== data.targets.length) {\n throw new Error('qPCR plate target ids must be unique.')\n }\n const reactionIds = new Set(data.reactions.map(reaction => reaction.id))\n if (reactionIds.size !== data.reactions.length) {\n throw new Error('qPCR plate reaction ids must be unique.')\n }\n const wellIds = new Set(data.reactions.map(reaction => reaction.wellId))\n if (wellIds.size !== data.reactions.length) {\n throw new Error('qPCR plate reaction wells must be unique.')\n }\n for (const reaction of data.reactions) {\n assertWellInFormat(reaction.wellId, data.format)\n if (!reaction.id) {\n throw new Error('qPCR reaction id is required.')\n }\n if (!reaction.targetId || !targetIds.has(reaction.targetId)) {\n throw new Error(`qPCR reaction '${reaction.id}' references unknown target '${reaction.targetId}'.`)\n }\n if (reaction.sampleId && !sampleIds.has(reaction.sampleId)) {\n throw new Error(`qPCR reaction '${reaction.id}' references unknown sample '${reaction.sampleId}'.`)\n }\n if (reaction.controlKind === 'sample' && !reaction.sampleId) {\n throw new Error(`qPCR sample reaction '${reaction.id}' requires sampleId.`)\n }\n if (reaction.replicate < 1) {\n throw new Error(`qPCR reaction '${reaction.id}' replicate must be at least 1.`)\n }\n if (reaction.cq !== undefined && reaction.cq !== null && reaction.cq < 0) {\n throw new Error(`qPCR reaction '${reaction.id}' has a negative Cq.`)\n }\n if (reaction.quantity !== undefined && reaction.quantity !== null && reaction.quantity < 0) {\n throw new Error(`qPCR reaction '${reaction.id}' has a negative quantity.`)\n }\n }\n}\n","import type { SelectOption } from '../types'\nimport { getTemplateData } from './templateEnvelopes'\nimport { validateAssayMatrixData } from './templateValidators'\nimport type {\n AssayMatrixColumnsAdapterResult,\n AssayMatrixDataFrameAdapterResult,\n AssayMatrixRowsAdapterResult,\n AssayMatrixSampleOptionsAdapterResult,\n AssayMatrixTemplate,\n AssayMatrixTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toAssayMatrixRows(\n template: AssayMatrixTemplate | AssayMatrixTemplateData\n): AssayMatrixRowsAdapterResult {\n const data = getTemplateData(template, 'assay-matrix')\n validateAssayMatrixData(data)\n const measurements = new Map(\n data.measurements.map(measurement => [\n `${measurement.sampleId}:${measurement.featureId}`,\n measurement.value ?? null,\n ])\n )\n\n return data.samples.map(sample => {\n const row: Record<string, unknown> = {\n sampleId: sample.sampleId,\n name: sample.name,\n group: sample.group,\n ...(sample.metadata ?? {}),\n }\n for (const feature of data.features) {\n row[feature.id] = measurements.get(`${sample.sampleId}:${feature.id}`) ?? null\n }\n return row\n })\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toAssayMatrixColumns(\n template: AssayMatrixTemplate | AssayMatrixTemplateData\n): AssayMatrixColumnsAdapterResult {\n const data = getTemplateData(template, 'assay-matrix')\n validateAssayMatrixData(data)\n return [\n { key: 'sampleId', label: 'Sample ID', sortable: true },\n { key: 'name', label: 'Name', sortable: true },\n { key: 'group', label: 'Group', sortable: true },\n ...data.features.map(feature => ({\n key: feature.id,\n label: feature.unit ? `${feature.name} (${feature.unit})` : feature.name,\n sortable: true,\n align: 'right' as const,\n })),\n ]\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toAssayMatrixDataFrame(\n template: AssayMatrixTemplate | AssayMatrixTemplateData\n): AssayMatrixDataFrameAdapterResult {\n return {\n data: toAssayMatrixRows(template),\n columns: toAssayMatrixColumns(template),\n rowKey: 'sampleId',\n }\n}\n\n/**\n * Convert an assay-matrix template into SampleSelector options derived from assay samples.\n *\n * @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins.\n */\nexport function toAssayMatrixSampleOptions(\n template: AssayMatrixTemplate | AssayMatrixTemplateData\n): AssayMatrixSampleOptionsAdapterResult {\n const data = getTemplateData(template, 'assay-matrix')\n validateAssayMatrixData(data)\n return data.samples.map((sample): SelectOption<string> => ({\n value: sample.sampleId,\n label: sample.name ?? sample.sampleId,\n description: sample.group,\n }))\n}\n","import { getTemplateData } from './templateEnvelopes'\nimport { validateCalibrationCurveData } from './templateValidators'\nimport type {\n CalibrationCurveColumnsAdapterResult,\n CalibrationCurveDataFrameAdapterResult,\n CalibrationCurveRowsAdapterResult,\n CalibrationCurveTemplate,\n CalibrationCurveTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toCalibrationCurveRows(\n template: CalibrationCurveTemplate | CalibrationCurveTemplateData\n): CalibrationCurveRowsAdapterResult {\n const data = getTemplateData(template, 'calibration-curve')\n validateCalibrationCurveData(data)\n return [...data.points]\n .sort((a, b) => a.order - b.order)\n .map(point => ({\n id: point.id,\n order: point.order,\n role: point.role,\n level: point.level,\n concentration: point.concentration,\n unit: point.unit,\n expectedResponse: point.expectedResponse,\n response: point.response,\n replicate: point.replicate,\n include: point.include,\n status: point.status,\n analyte: data.analyte,\n model: data.model,\n ...(point.metadata ?? {}),\n }))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toCalibrationCurveColumns(): CalibrationCurveColumnsAdapterResult {\n return [\n { key: 'order', label: 'Order', sortable: true, align: 'right' },\n { key: 'role', label: 'Role', sortable: true },\n { key: 'level', label: 'Level', sortable: true },\n { key: 'concentration', label: 'Concentration', sortable: true, align: 'right' },\n { key: 'unit', label: 'Unit', sortable: true },\n { key: 'expectedResponse', label: 'Expected', sortable: true, align: 'right' },\n { key: 'response', label: 'Response', sortable: true, align: 'right' },\n { key: 'replicate', label: 'Replicate', sortable: true, align: 'right' },\n { key: 'include', label: 'Include', sortable: true },\n { key: 'status', label: 'Status', sortable: true },\n ]\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toCalibrationCurveDataFrame(\n template: CalibrationCurveTemplate | CalibrationCurveTemplateData\n): CalibrationCurveDataFrameAdapterResult {\n return {\n data: toCalibrationCurveRows(template),\n columns: toCalibrationCurveColumns(),\n rowKey: 'id',\n }\n}\n","import { getTemplateData } from './templateEnvelopes'\nimport { validateFlowCytometryPanelData } from './templateValidators'\nimport type {\n FlowCytometryPanelTemplate,\n FlowCytometryPanelTemplateData,\n FlowPanelColumnsAdapterResult,\n FlowPanelDataFrameAdapterResult,\n FlowPanelRowsAdapterResult,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toFlowPanelRows(\n template: FlowCytometryPanelTemplate | FlowCytometryPanelTemplateData\n): FlowPanelRowsAdapterResult {\n const data = getTemplateData(template, 'flow-cytometry-panel')\n validateFlowCytometryPanelData(data)\n return data.markers.map(marker => {\n const markerControls = data.controls\n .filter(control => control.markerId === marker.id)\n .map(control => control.name)\n .join(', ')\n return {\n id: marker.id,\n marker: marker.marker,\n fluorophore: marker.fluorophore,\n detector: marker.detector,\n clone: marker.clone,\n reagentId: marker.reagentId,\n purpose: marker.purpose,\n compensationRequired: marker.compensationRequired,\n controls: markerControls,\n instrument: data.instrument,\n ...(marker.metadata ?? {}),\n }\n })\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toFlowPanelColumns(): FlowPanelColumnsAdapterResult {\n return [\n { key: 'marker', label: 'Marker', sortable: true },\n { key: 'fluorophore', label: 'Fluorophore', sortable: true },\n { key: 'detector', label: 'Detector', sortable: true },\n { key: 'clone', label: 'Clone', sortable: true },\n { key: 'purpose', label: 'Purpose', sortable: true },\n { key: 'compensationRequired', label: 'Compensation', sortable: true },\n { key: 'controls', label: 'Controls' },\n { key: 'instrument', label: 'Instrument', sortable: true },\n ]\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toFlowPanelDataFrame(\n template: FlowCytometryPanelTemplate | FlowCytometryPanelTemplateData\n): FlowPanelDataFrameAdapterResult {\n return {\n data: toFlowPanelRows(template),\n columns: toFlowPanelColumns(),\n rowKey: 'id',\n }\n}\n","import type {\n ProtocolStepStatus,\n ProtocolStepType,\n ScheduleEventStatus,\n} from '../types'\nimport type {\n InstrumentRunItem,\n InstrumentRunItemKind,\n InstrumentRunStatus,\n} from './types'\n\nexport function instrumentRunStepType(kind: InstrumentRunItemKind): ProtocolStepType {\n switch (kind) {\n case 'wash':\n return 'wash'\n case 'blank':\n case 'qc':\n case 'standard':\n case 'calibration':\n case 'sample':\n return 'measurement'\n default:\n return 'custom'\n }\n}\n\nexport function instrumentRunStepStatus(status: InstrumentRunStatus): ProtocolStepStatus {\n switch (status) {\n case 'running':\n return 'in_progress'\n case 'completed':\n return 'completed'\n case 'failed':\n return 'failed'\n case 'skipped':\n return 'skipped'\n case 'planned':\n case 'queued':\n default:\n return 'pending'\n }\n}\n\nexport function instrumentRunScheduleStatus(status: InstrumentRunStatus): ScheduleEventStatus {\n switch (status) {\n case 'running':\n return 'in-progress'\n case 'completed':\n return 'confirmed'\n case 'failed':\n case 'skipped':\n return 'cancelled'\n case 'planned':\n case 'queued':\n default:\n return 'pending'\n }\n}\n\nexport function instrumentRunScheduleColor(kind: InstrumentRunItem['kind']): string {\n switch (kind) {\n case 'blank':\n return '#64748b'\n case 'qc':\n return '#8b5cf6'\n case 'standard':\n case 'calibration':\n return '#f59e0b'\n case 'wash':\n return '#06b6d4'\n case 'sample':\n return '#2563eb'\n default:\n return '#475569'\n }\n}\n\nexport function dateFromMetadata(\n metadata: Record<string, unknown> | undefined,\n keys: readonly string[]\n): Date | undefined {\n if (!metadata) return undefined\n for (const key of keys) {\n const value = metadata[key]\n if (!(typeof value === 'string' || value instanceof Date)) continue\n const date = new Date(value)\n if (!Number.isNaN(date.getTime())) return date\n }\n return undefined\n}\n\nexport function addMinutes(date: Date, minutes: number): Date {\n return new Date(date.getTime() + minutes * 60_000)\n}\n","import type {\n ProtocolStep,\n ScheduleEvent,\n} from '../types'\nimport { getTemplateData } from './templateEnvelopes'\nimport { validateInstrumentRunData } from './templateValidators'\nimport type {\n InstrumentRunColumnsAdapterResult,\n InstrumentRunDataFrameAdapterResult,\n InstrumentRunRowsAdapterResult,\n InstrumentRunScheduleEventsAdapterResult,\n InstrumentRunStepsAdapterResult,\n InstrumentRunTemplate,\n InstrumentRunTemplateData,\n} from './types'\nimport {\n addMinutes,\n dateFromMetadata,\n instrumentRunScheduleColor,\n instrumentRunScheduleStatus,\n instrumentRunStepStatus,\n instrumentRunStepType,\n} from './instrumentRunAdapterHelpers'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toInstrumentRunRows(\n template: InstrumentRunTemplate | InstrumentRunTemplateData\n): InstrumentRunRowsAdapterResult {\n const data = getTemplateData(template, 'instrument-run')\n validateInstrumentRunData(data)\n const methods = new Map(data.methods.map(method => [method.id, method]))\n return [...data.items]\n .sort((a, b) => a.order - b.order)\n .map(item => {\n const method = methods.get(item.methodId)\n return {\n id: item.id,\n order: item.order,\n kind: item.kind,\n sampleId: item.sampleId,\n name: item.name ?? item.sampleId ?? item.kind,\n method: method?.name ?? item.methodId,\n vial: item.vial,\n plateId: item.plateId,\n wellId: item.wellId,\n injectionVolume: item.injectionVolume,\n expectedDurationMin: item.expectedDurationMin,\n status: item.status,\n instrument: data.instrument ?? method?.instrument,\n ...(item.metadata ?? {}),\n }\n })\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toInstrumentRunColumns(): InstrumentRunColumnsAdapterResult {\n return [\n { key: 'order', label: 'Order', sortable: true, align: 'right' },\n { key: 'kind', label: 'Kind', sortable: true },\n { key: 'sampleId', label: 'Sample ID', sortable: true },\n { key: 'name', label: 'Name', sortable: true },\n { key: 'method', label: 'Method', sortable: true },\n { key: 'vial', label: 'Vial', sortable: true },\n { key: 'wellId', label: 'Well', sortable: true },\n { key: 'injectionVolume', label: 'Injection', sortable: true, align: 'right' },\n { key: 'expectedDurationMin', label: 'Duration', sortable: true, align: 'right' },\n { key: 'status', label: 'Status', sortable: true },\n { key: 'instrument', label: 'Instrument', sortable: true },\n ]\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toInstrumentRunDataFrame(\n template: InstrumentRunTemplate | InstrumentRunTemplateData\n): InstrumentRunDataFrameAdapterResult {\n return {\n data: toInstrumentRunRows(template),\n columns: toInstrumentRunColumns(),\n rowKey: 'id',\n }\n}\n\n/**\n * Convert an instrument-run template into ExperimentTimeline protocol steps for acquisition queue previews.\n *\n * @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins.\n */\nexport function toInstrumentRunSteps(\n template: InstrumentRunTemplate | InstrumentRunTemplateData\n): InstrumentRunStepsAdapterResult {\n const data = getTemplateData(template, 'instrument-run')\n validateInstrumentRunData(data)\n const methods = new Map(data.methods.map(method => [method.id, method]))\n return [...data.items]\n .sort((a, b) => a.order - b.order)\n .map((item): ProtocolStep => {\n const method = methods.get(item.methodId)\n const name = item.name ?? item.sampleId ?? item.kind\n return {\n id: item.id,\n type: instrumentRunStepType(item.kind),\n name,\n description: [\n item.kind,\n method?.name,\n item.vial ? `Vial ${item.vial}` : undefined,\n item.wellId ? `Well ${item.wellId}` : undefined,\n ]\n .filter(Boolean)\n .join(' / '),\n duration: item.expectedDurationMin,\n status: instrumentRunStepStatus(item.status),\n parameters: {\n kind: item.kind,\n sampleId: item.sampleId,\n methodId: item.methodId,\n method: method?.name,\n vial: item.vial,\n plateId: item.plateId,\n wellId: item.wellId,\n injectionVolume: item.injectionVolume,\n instrument: data.instrument ?? method?.instrument,\n },\n order: item.order,\n }\n })\n}\n\n/**\n * Convert an instrument-run template into readonly ScheduleCalendar events ordered by run queue timing.\n *\n * @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins.\n */\nexport function toInstrumentRunScheduleEvents(\n template: InstrumentRunTemplate | InstrumentRunTemplateData\n): InstrumentRunScheduleEventsAdapterResult {\n const data = getTemplateData(template, 'instrument-run')\n validateInstrumentRunData(data)\n const methods = new Map(data.methods.map(method => [method.id, method]))\n let cursor = dateFromMetadata(data.metadata, ['scheduledStart', 'runStart', 'start', 'startedAt'])\n ?? new Date('2024-01-01T08:00:00.000Z')\n\n return [...data.items]\n .sort((a, b) => a.order - b.order)\n .map((item): ScheduleEvent => {\n const method = methods.get(item.methodId)\n const start = dateFromMetadata(item.metadata, ['scheduledStart', 'start', 'startedAt']) ?? cursor\n const end = dateFromMetadata(item.metadata, ['scheduledEnd', 'end', 'completedAt'])\n ?? addMinutes(start, Math.max(item.expectedDurationMin ?? 10, 1))\n cursor = end\n\n return {\n id: item.id,\n title: item.name ?? item.sampleId ?? item.kind,\n start: start.toISOString(),\n end: end.toISOString(),\n color: instrumentRunScheduleColor(item.kind),\n status: instrumentRunScheduleStatus(item.status),\n draggable: false,\n resizable: false,\n metadata: {\n kind: item.kind,\n sampleId: item.sampleId,\n methodId: item.methodId,\n method: method?.name,\n vial: item.vial,\n plateId: item.plateId,\n wellId: item.wellId,\n injectionVolume: item.injectionVolume,\n instrument: data.instrument ?? method?.instrument,\n },\n }\n })\n}\n","import { getTemplateData } from './templateEnvelopes'\nimport { validateProtocolStepsData } from './templateValidators'\nimport type {\n ProtocolColumnsAdapterResult,\n ProtocolDataFrameAdapterResult,\n ProtocolRowsAdapterResult,\n ProtocolStepsAdapterResult,\n ProtocolStepsTemplate,\n ProtocolStepsTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toProtocolSteps(\n template: ProtocolStepsTemplate | ProtocolStepsTemplateData\n): ProtocolStepsAdapterResult {\n const data = getTemplateData(template, 'protocol-steps')\n validateProtocolStepsData(data)\n return [...data.steps]\n .sort((a, b) => a.order - b.order)\n .map(step => ({\n id: step.id,\n type: step.type,\n name: step.name,\n description: step.description,\n duration: step.duration,\n status: step.status,\n parameters: step.parameters,\n order: step.order,\n }))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toProtocolRows(\n template: ProtocolStepsTemplate | ProtocolStepsTemplateData\n): ProtocolRowsAdapterResult {\n const data = getTemplateData(template, 'protocol-steps')\n validateProtocolStepsData(data)\n return [...data.steps]\n .sort((a, b) => a.order - b.order)\n .map(step => ({\n id: step.id,\n order: step.order,\n type: step.type,\n name: step.name,\n description: step.description,\n duration: step.duration,\n status: step.status,\n ...(step.metadata ?? {}),\n }))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toProtocolColumns(): ProtocolColumnsAdapterResult {\n return [\n { key: 'order', label: 'Order', sortable: true, align: 'right' },\n { key: 'name', label: 'Name', sortable: true },\n { key: 'type', label: 'Type', sortable: true },\n { key: 'duration', label: 'Duration', sortable: true, align: 'right' },\n { key: 'status', label: 'Status', sortable: true },\n { key: 'description', label: 'Description', sortable: true },\n ]\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toProtocolDataFrame(\n template: ProtocolStepsTemplate | ProtocolStepsTemplateData\n): ProtocolDataFrameAdapterResult {\n return {\n data: toProtocolRows(template),\n columns: toProtocolColumns(),\n rowKey: 'id',\n }\n}\n","import type { Well } from '../types'\nimport { getTemplateData } from './templateEnvelopes'\nimport { validateQpcrPlateData } from './templateValidators'\nimport type {\n QpcrColumnsAdapterResult,\n QpcrDataFrameAdapterResult,\n QpcrPlateTemplate,\n QpcrPlateTemplateData,\n QpcrRowsAdapterResult,\n QpcrWellMapAdapterResult,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toQpcrRows(\n template: QpcrPlateTemplate | QpcrPlateTemplateData\n): QpcrRowsAdapterResult {\n const data = getTemplateData(template, 'qpcr-plate')\n validateQpcrPlateData(data)\n const samples = new Map(data.samples.map(sample => [sample.sampleId, sample]))\n const targets = new Map(data.targets.map(target => [target.id, target]))\n\n return data.reactions.map(reaction => {\n const sample = reaction.sampleId ? samples.get(reaction.sampleId) : undefined\n const target = targets.get(reaction.targetId)\n return {\n id: reaction.id,\n wellId: reaction.wellId,\n sampleId: reaction.sampleId,\n sample: sample?.name ?? reaction.sampleId ?? reaction.controlKind,\n group: sample?.group,\n targetId: reaction.targetId,\n target: target?.name ?? reaction.targetId,\n replicate: reaction.replicate,\n controlKind: reaction.controlKind,\n cq: reaction.cq ?? null,\n quantity: reaction.quantity ?? null,\n flags: reaction.flags.join(', '),\n instrument: data.instrument,\n chemistry: data.chemistry,\n ...(reaction.metadata ?? {}),\n }\n })\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toQpcrColumns(): QpcrColumnsAdapterResult {\n return [\n { key: 'wellId', label: 'Well', sortable: true },\n { key: 'sample', label: 'Sample', sortable: true },\n { key: 'group', label: 'Group', sortable: true },\n { key: 'target', label: 'Target', sortable: true },\n { key: 'replicate', label: 'Replicate', sortable: true, align: 'right' },\n { key: 'controlKind', label: 'Control', sortable: true },\n { key: 'cq', label: 'Cq', sortable: true, align: 'right' },\n { key: 'quantity', label: 'Quantity', sortable: true, align: 'right' },\n { key: 'flags', label: 'Flags' },\n ]\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toQpcrDataFrame(\n template: QpcrPlateTemplate | QpcrPlateTemplateData\n): QpcrDataFrameAdapterResult {\n return {\n data: toQpcrRows(template),\n columns: toQpcrColumns(),\n rowKey: 'id',\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toQpcrWellPlateWells(\n template: QpcrPlateTemplate | QpcrPlateTemplateData\n): QpcrWellMapAdapterResult {\n const data = getTemplateData(template, 'qpcr-plate')\n validateQpcrPlateData(data)\n return Object.fromEntries(data.reactions.map(reaction => {\n const [row, col] = wellPositionFromId(reaction.wellId)\n return [\n reaction.wellId,\n {\n id: reaction.wellId,\n row,\n col,\n state: 'filled' as const,\n sampleType: reaction.sampleId ?? reaction.controlKind,\n value: reaction.cq ?? undefined,\n metadata: {\n reactionId: reaction.id,\n sampleId: reaction.sampleId,\n targetId: reaction.targetId,\n replicate: reaction.replicate,\n controlKind: reaction.controlKind,\n },\n } satisfies Well,\n ]\n }))\n}\n\nfunction wellPositionFromId(wellId: string): [number, number] {\n const match = /^([A-Z]+)([1-9][0-9]*)$/.exec(wellId.toUpperCase())\n if (!match) {\n throw new Error(`Invalid well id '${wellId}'.`)\n }\n const row = [...match[1]].reduce((value, char) => value * 26 + char.charCodeAt(0) - 64, 0) - 1\n const col = Number(match[2]) - 1\n return [row, col]\n}\n","import { getTemplateData } from './templateEnvelopes'\nimport { validateReagentListData } from './templateValidators'\nimport type {\n ReagentColumnsAdapterResult,\n ReagentDataFrameAdapterResult,\n ReagentListItemsAdapterResult,\n ReagentListTemplate,\n ReagentListTemplateData,\n ReagentRowsAdapterResult,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toReagentListItems(\n template: ReagentListTemplate | ReagentListTemplateData\n): ReagentListItemsAdapterResult {\n const data = getTemplateData(template, 'reagent-list')\n validateReagentListData(data)\n return data.reagents.map(reagent => ({\n id: reagent.id,\n name: reagent.name,\n catalogNumber: reagent.catalogNumber,\n lotNumber: reagent.lotNumber,\n expiryDate: reagent.expiryDate,\n storageCondition: reagent.storageCondition,\n location: reagent.location,\n stockLevel: reagent.stockLevel,\n stockUnit: reagent.stockUnit,\n supplier: reagent.supplier,\n url: reagent.url,\n }))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toReagentRows(\n template: ReagentListTemplate | ReagentListTemplateData\n): ReagentRowsAdapterResult {\n const data = getTemplateData(template, 'reagent-list')\n validateReagentListData(data)\n return data.reagents.map(reagent => ({\n id: reagent.id,\n name: reagent.name,\n kind: reagent.kind,\n catalogNumber: reagent.catalogNumber,\n lotNumber: reagent.lotNumber,\n expiryDate: reagent.expiryDate,\n storageCondition: reagent.storageCondition,\n location: reagent.location,\n stockLevel: reagent.stockLevel,\n stockUnit: reagent.stockUnit,\n supplier: reagent.supplier,\n concentration: reagent.concentration,\n ...(reagent.metadata ?? {}),\n }))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toReagentColumns(): ReagentColumnsAdapterResult {\n return [\n { key: 'name', label: 'Name', sortable: true },\n { key: 'kind', label: 'Kind', sortable: true },\n { key: 'catalogNumber', label: 'Catalog', sortable: true },\n { key: 'lotNumber', label: 'Lot', sortable: true },\n { key: 'expiryDate', label: 'Expiry', sortable: true },\n { key: 'storageCondition', label: 'Storage', sortable: true },\n { key: 'location', label: 'Location', sortable: true },\n { key: 'stockLevel', label: 'Stock', sortable: true, align: 'right' },\n { key: 'stockUnit', label: 'Unit', sortable: true },\n { key: 'supplier', label: 'Supplier', sortable: true },\n ]\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toReagentDataFrame(\n template: ReagentListTemplate | ReagentListTemplateData\n): ReagentDataFrameAdapterResult {\n return {\n data: toReagentRows(template),\n columns: toReagentColumns(),\n rowKey: 'id',\n }\n}\n","import { getTemplateData } from './templateEnvelopes'\nimport { validateSamplePrepData } from './templateValidators'\nimport type {\n SamplePrepColumnsAdapterResult,\n SamplePrepDataFrameAdapterResult,\n SamplePrepRowsAdapterResult,\n SamplePrepTemplate,\n SamplePrepTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toSamplePrepRows(\n template: SamplePrepTemplate | SamplePrepTemplateData\n): SamplePrepRowsAdapterResult {\n const data = getTemplateData(template, 'sample-prep')\n validateSamplePrepData(data)\n return [...data.steps]\n .sort((a, b) => a.order - b.order)\n .map(step => ({\n id: step.id,\n order: step.order,\n type: step.type,\n name: step.name,\n sourceSampleId: step.sourceSampleId,\n sourceWellId: step.sourceWellId,\n destinationSampleId: step.destinationSampleId,\n destinationWellId: step.destinationWellId,\n reagentId: step.reagentId,\n inputVolume: step.inputVolume,\n outputVolume: step.outputVolume,\n volumeUnit: step.volumeUnit,\n durationMin: step.durationMin,\n status: step.status,\n protocolName: data.protocolName,\n ...(step.metadata ?? {}),\n }))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toSamplePrepColumns(): SamplePrepColumnsAdapterResult {\n return [\n { key: 'order', label: 'Order', sortable: true, align: 'right' },\n { key: 'type', label: 'Type', sortable: true },\n { key: 'name', label: 'Step', sortable: true },\n { key: 'sourceSampleId', label: 'Source', sortable: true },\n { key: 'sourceWellId', label: 'Source well', sortable: true },\n { key: 'destinationSampleId', label: 'Destination', sortable: true },\n { key: 'destinationWellId', label: 'Destination well', sortable: true },\n { key: 'reagentId', label: 'Reagent', sortable: true },\n { key: 'inputVolume', label: 'Input', sortable: true, align: 'right' },\n { key: 'outputVolume', label: 'Output', sortable: true, align: 'right' },\n { key: 'volumeUnit', label: 'Unit', sortable: true },\n { key: 'status', label: 'Status', sortable: true },\n ]\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toSamplePrepDataFrame(\n template: SamplePrepTemplate | SamplePrepTemplateData\n): SamplePrepDataFrameAdapterResult {\n return {\n data: toSamplePrepRows(template),\n columns: toSamplePrepColumns(),\n rowKey: 'id',\n }\n}\n","import type {\n DataFrameColumn,\n SelectOption,\n} from '../types'\nimport { getTemplateData } from './templateEnvelopes'\nimport { validateSampleSheetData } from './templateValidators'\nimport type {\n SampleColumnsAdapterResult,\n SampleDataFrameAdapterResult,\n SampleOptionsAdapterResult,\n SampleRowsAdapterResult,\n SampleSheetTemplate,\n SampleSheetTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toSampleRows(\n template: SampleSheetTemplate | SampleSheetTemplateData\n): SampleRowsAdapterResult {\n const data = getTemplateData(template, 'sample-sheet')\n validateSampleSheetData(data)\n return data.samples.map(sample => ({\n sampleId: sample.sampleId,\n name: sample.name,\n group: sample.group,\n batch: sample.batch,\n replicate: sample.replicate,\n plateId: sample.plateId,\n wellId: sample.wellId,\n ...(sample.metadata ?? {}),\n }))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toSampleColumns(\n template: SampleSheetTemplate | SampleSheetTemplateData\n): SampleColumnsAdapterResult {\n const data = getTemplateData(template, 'sample-sheet')\n validateSampleSheetData(data)\n return data.columns.map((column): DataFrameColumn<Record<string, unknown>> => ({\n key: sampleColumnKey(column.id),\n label: column.label,\n sortable: true,\n align: column.type === 'number' || column.type === 'integer' ? 'right' : 'left',\n }))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toSampleDataFrame(\n template: SampleSheetTemplate | SampleSheetTemplateData\n): SampleDataFrameAdapterResult {\n return {\n data: toSampleRows(template),\n columns: toSampleColumns(template),\n rowKey: 'sampleId',\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toSampleOptions(\n template: SampleSheetTemplate | SampleSheetTemplateData\n): SampleOptionsAdapterResult {\n const data = getTemplateData(template, 'sample-sheet')\n validateSampleSheetData(data)\n return data.samples.map((sample): SelectOption<string> => ({\n value: sample.sampleId,\n label: sample.name ?? sample.sampleId,\n description: [sample.group, sample.batch].filter(Boolean).join(' / ') || undefined,\n }))\n}\n\nfunction sampleColumnKey(columnId: string): string {\n const aliases: Record<string, string> = {\n sample_id: 'sampleId',\n plate_id: 'plateId',\n well_id: 'wellId',\n }\n return aliases[columnId] ?? columnId\n}\n","import { getTemplateData } from './templateEnvelopes'\nimport { validateTimeCourseData } from './templateValidators'\nimport type {\n TimeCourseColumnsAdapterResult,\n TimeCourseDataFrameAdapterResult,\n TimeCourseRowsAdapterResult,\n TimeCourseStepsAdapterResult,\n TimeCourseTemplate,\n TimeCourseTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toTimeCourseRows(\n template: TimeCourseTemplate | TimeCourseTemplateData\n): TimeCourseRowsAdapterResult {\n const data = getTemplateData(template, 'time-course')\n validateTimeCourseData(data)\n const timepoints = new Map(data.timepoints.map(timepoint => [timepoint.id, timepoint]))\n const conditions = new Map(data.conditions.map(condition => [condition.id, condition]))\n\n return data.samples.map(sample => {\n const timepoint = timepoints.get(sample.timepointId)\n const condition = conditions.get(sample.conditionId)\n return {\n sampleId: sample.sampleId,\n condition: condition?.name ?? sample.conditionId,\n timepoint: timepoint?.label ?? sample.timepointId,\n value: timepoint?.value,\n unit: timepoint?.unit,\n replicate: sample.replicate,\n ...(sample.metadata ?? {}),\n }\n })\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toTimeCourseColumns(): TimeCourseColumnsAdapterResult {\n return [\n { key: 'sampleId', label: 'Sample ID', sortable: true },\n { key: 'condition', label: 'Condition', sortable: true },\n { key: 'timepoint', label: 'Time Point', sortable: true },\n { key: 'value', label: 'Value', sortable: true, align: 'right' },\n { key: 'unit', label: 'Unit', sortable: true },\n { key: 'replicate', label: 'Replicate', sortable: true, align: 'right' },\n ]\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toTimeCourseDataFrame(\n template: TimeCourseTemplate | TimeCourseTemplateData\n): TimeCourseDataFrameAdapterResult {\n return {\n data: toTimeCourseRows(template),\n columns: toTimeCourseColumns(),\n rowKey: 'sampleId',\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toTimeCourseSteps(\n template: TimeCourseTemplate | TimeCourseTemplateData\n): TimeCourseStepsAdapterResult {\n const data = getTemplateData(template, 'time-course')\n validateTimeCourseData(data)\n return data.timepoints.map((timepoint, index) => ({\n id: timepoint.id,\n type: 'measurement',\n name: timepoint.label,\n description: `${data.conditions.length} condition${data.conditions.length === 1 ? '' : 's'}`,\n status: 'pending',\n order: index,\n parameters: {\n value: timepoint.value,\n unit: timepoint.unit,\n },\n }))\n}\n","import type {\n PlateMapEditorState,\n} from '../types'\nimport { getTemplateData } from './templateEnvelopes'\nimport { validatePlateMapData } from './templateValidators'\nimport type {\n PlateMapEditorAdapterResult,\n PlateMapTemplate,\n PlateMapTemplateData,\n WellMapAdapterResult,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toPlateMapEditorState(\n template: PlateMapTemplate | PlateMapTemplateData\n): PlateMapEditorAdapterResult {\n const data = getTemplateData(template, 'plate-map')\n validatePlateMapData(data)\n const activePlateId = data.activePlateId ?? data.plates[0].id\n return {\n plates: data.plates,\n activePlateId,\n samples: data.samples,\n selectedWells: data.selectedWells ?? [],\n activeSampleId: data.activeSampleId,\n } satisfies PlateMapEditorState\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toWellPlateWells(\n template: PlateMapTemplate | PlateMapTemplateData,\n plateId?: string\n): WellMapAdapterResult {\n const state = toPlateMapEditorState(template)\n const plate = state.plates.find(candidate => candidate.id === (plateId ?? state.activePlateId))\n ?? state.plates[0]\n return plate.wells\n}\n","import type {\n PlateCondition,\n PlateMapEditorState,\n} from '../types'\nimport { SAMPLE_COLOR_SCALE } from '../utils/color'\nimport { toPlateMapEditorState } from './plateMapAdapters'\nimport { getTemplateData } from './templateEnvelopes'\nimport { validateDoseResponseData } from './templateValidators'\nimport type {\n DoseConditionsAdapterResult,\n DoseResponseTemplate,\n DoseResponseTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toDoseConditions(\n template: DoseResponseTemplate | DoseResponseTemplateData\n): DoseConditionsAdapterResult {\n const data = getTemplateData(template, 'dose-response')\n validateDoseResponseData(data)\n return data.compounds.map((compound, index): PlateCondition => ({\n label: compound.name,\n color: String(compound.metadata?.color ?? SAMPLE_COLOR_SCALE[index % SAMPLE_COLOR_SCALE.length]),\n concentrations: compound.concentrations,\n unit: data.unit,\n }))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toDoseLayoutState(\n template: DoseResponseTemplate | DoseResponseTemplateData\n): PlateMapEditorState | undefined {\n const data = getTemplateData(template, 'dose-response')\n validateDoseResponseData(data)\n return data.layout ? toPlateMapEditorState(data.layout) : undefined\n}\n","import type {\n PlateMapEditorState,\n Rack,\n Well,\n WellLegendItem,\n} from '../types'\nimport { SAMPLE_COLOR_SCALE, SLOT_ORDER } from '../utils/color'\n\nexport function activePlateFromState(state: PlateMapEditorState) {\n return state.plates.find(plate => plate.id === state.activePlateId) ?? state.plates[0]\n}\n\nexport function sampleColorsFromPlateState(state: PlateMapEditorState): Record<string, string> {\n return Object.fromEntries(\n state.samples\n .filter(sample => sample.color)\n .map(sample => [sample.id, sample.color as string])\n )\n}\n\nexport function legendItemsFromPlateState(state: PlateMapEditorState): WellLegendItem[] {\n return state.samples.map((sample, index) => ({\n type: sample.id,\n label: sample.name,\n color: sample.color ?? colorForIndex(index),\n }))\n}\n\nexport function colorForIndex(index: number): string {\n // The gray tail of the scale is reserved for \"other\"; component plates cycle the eight hues.\n const colors = SAMPLE_COLOR_SCALE.slice(0, 8)\n return colors[index % colors.length]\n}\n\n/**\n * Plates as PlateEditor racks: slots assigned in order, a well's sample id moved to its group (the stored\n * plate map keeps it in `sampleType`). Plate maps carry no injection volume.\n * @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins.\n */\nexport function racksFromPlateState(state: PlateMapEditorState): Rack[] {\n const sampleIds = new Set(state.samples.map(sample => sample.id))\n const asRackWell = (well: Well): Partial<Well> =>\n well.sampleType && sampleIds.has(well.sampleType) ? { ...well, sampleType: 'sample', group: well.sampleType } : well\n return state.plates.map((plate, index) => ({\n id: plate.id,\n name: plate.name,\n format: plate.format,\n slot: SLOT_ORDER[index % SLOT_ORDER.length],\n injectionVolume: 0,\n wells: Object.fromEntries(Object.entries(plate.wells).map(([id, well]) => [id, asRackWell(well)])),\n }))\n}\n","import type { Well } from '../types'\nimport type {\n AssayMatrixTemplate,\n BioTemplateEnvelope,\n CalibrationCurveTemplate,\n DataFrameTemplate,\n FlowCytometryPanelTemplate,\n InstrumentRunTemplate,\n ProtocolStepsTemplate,\n QpcrPlateTemplate,\n ReagentListTemplate,\n SamplePrepTemplate,\n SampleSheetTemplate,\n TimeCourseTemplate,\n TemplateDataFrameAdapterResult,\n} from './types'\nimport { toAssayMatrixDataFrame } from './assayMatrixAdapters'\nimport { toCalibrationCurveDataFrame } from './calibrationCurveAdapters'\nimport { toFlowPanelDataFrame } from './flowPanelAdapters'\nimport { toInstrumentRunDataFrame } from './instrumentRunAdapters'\nimport { toProtocolDataFrame } from './protocolAdapters'\nimport { toQpcrDataFrame } from './qpcrAdapters'\nimport { toReagentDataFrame } from './reagentAdapters'\nimport { toSamplePrepDataFrame } from './samplePrepAdapters'\nimport { toSampleDataFrame } from './sampleSheetAdapters'\nimport { toTimeCourseDataFrame } from './timeCourseAdapters'\n\nexport {\n toAssayMatrixColumns,\n toAssayMatrixDataFrame,\n toAssayMatrixRows,\n toAssayMatrixSampleOptions,\n} from './assayMatrixAdapters'\n\nexport {\n toCalibrationCurveColumns,\n toCalibrationCurveDataFrame,\n toCalibrationCurveRows,\n} from './calibrationCurveAdapters'\n\nexport {\n toDoseConditions,\n toDoseLayoutState,\n} from './doseResponseAdapters'\n\nexport {\n toFlowPanelColumns,\n toFlowPanelDataFrame,\n toFlowPanelRows,\n} from './flowPanelAdapters'\n\nexport {\n toInstrumentRunColumns,\n toInstrumentRunDataFrame,\n toInstrumentRunRows,\n toInstrumentRunScheduleEvents,\n toInstrumentRunSteps,\n} from './instrumentRunAdapters'\n\nexport {\n toPlateMapEditorState,\n toWellPlateWells,\n} from './plateMapAdapters'\n\nexport { racksFromPlateState } from './componentPlateHelpers'\n\nexport {\n toProtocolColumns,\n toProtocolDataFrame,\n toProtocolRows,\n toProtocolSteps,\n} from './protocolAdapters'\n\nexport {\n toQpcrColumns,\n toQpcrDataFrame,\n toQpcrRows,\n toQpcrWellPlateWells,\n} from './qpcrAdapters'\n\nexport {\n toReagentColumns,\n toReagentDataFrame,\n toReagentListItems,\n toReagentRows,\n} from './reagentAdapters'\n\nexport {\n toSamplePrepColumns,\n toSamplePrepDataFrame,\n toSamplePrepRows,\n} from './samplePrepAdapters'\n\nexport {\n toSampleColumns,\n toSampleDataFrame,\n toSampleOptions,\n toSampleRows,\n} from './sampleSheetAdapters'\n\nexport {\n toTimeCourseColumns,\n toTimeCourseDataFrame,\n toTimeCourseRows,\n toTimeCourseSteps,\n} from './timeCourseAdapters'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toTemplateDataFrame(\n template: DataFrameTemplate | BioTemplateEnvelope<unknown>\n): TemplateDataFrameAdapterResult {\n switch (template.template_id) {\n case 'sample-sheet':\n return toSampleDataFrame(template as SampleSheetTemplate)\n case 'sample-prep':\n return toSamplePrepDataFrame(template as SamplePrepTemplate)\n case 'calibration-curve':\n return toCalibrationCurveDataFrame(template as CalibrationCurveTemplate)\n case 'time-course':\n return toTimeCourseDataFrame(template as TimeCourseTemplate)\n case 'protocol-steps':\n return toProtocolDataFrame(template as ProtocolStepsTemplate)\n case 'assay-matrix':\n return toAssayMatrixDataFrame(template as AssayMatrixTemplate)\n case 'reagent-list':\n return toReagentDataFrame(template as ReagentListTemplate)\n case 'flow-cytometry-panel':\n return toFlowPanelDataFrame(template as FlowCytometryPanelTemplate)\n case 'instrument-run':\n return toInstrumentRunDataFrame(template as InstrumentRunTemplate)\n case 'qpcr-plate':\n return toQpcrDataFrame(template as QpcrPlateTemplate)\n default:\n throw new Error(`Template '${String(template.template_id)}' does not expose a DataFrame adapter.`)\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toWellMapArray(wells: Record<string, Well>): Well[] {\n return Object.values(wells)\n}\n","import { cloneBinding } from './componentBindingHelpers'\nimport { templateComponentBindings } from './componentBindingCatalog'\nimport type {\n BioTemplateComponentPropsBinding,\n} from './componentBindings'\nimport type { TemplateId } from './types'\n\nexport function propsBinding(\n templateId: TemplateId,\n component: string,\n propsObject: Record<string, unknown>\n): BioTemplateComponentPropsBinding {\n const matched = templateComponentBindings[templateId].find(binding => binding.component === component)\n if (!matched) {\n throw new Error(`No component binding registered for '${templateId}' and '${component}'.`)\n }\n return {\n ...cloneBinding(matched),\n propsObject,\n }\n}\n","import {\n toDoseConditions,\n toDoseLayoutState,\n} from './adapters'\nimport {\n activePlateFromState,\n sampleColorsFromPlateState,\n} from './componentPlateHelpers'\nimport { propsBinding } from './componentPropsFactory'\nimport type { BioTemplateComponentPropsBinding } from './componentBindings'\nimport type { DoseResponseTemplate } from './types'\n\nexport function doseResponseProps(template: DoseResponseTemplate): BioTemplateComponentPropsBinding[] {\n const conditions = toDoseConditions(template)\n const layout = toDoseLayoutState(template)\n const targetWells = layout ? Object.keys(activePlateFromState(layout).wells) : []\n const props = [\n propsBinding('dose-response', 'DoseCalculator', {\n mode: 'serial',\n targetWells,\n disabled: conditions.length === 0,\n }),\n ]\n\n if (layout) {\n const plate = activePlateFromState(layout)\n props.push(propsBinding('dose-response', 'WellPlate', {\n format: plate.format,\n wells: plate.wells,\n sampleColors: sampleColorsFromPlateState(layout),\n legendItems: conditions.map(condition => ({\n type: condition.label,\n label: condition.label,\n color: condition.color,\n })),\n showLegend: true,\n }))\n }\n\n return props\n}\n","import {\n toAssayMatrixSampleOptions,\n toInstrumentRunScheduleEvents,\n toReagentListItems,\n toSampleOptions,\n toTemplateDataFrame,\n} from './adapters'\nimport { propsBinding } from './componentPropsFactory'\nimport type { BioTemplateComponentPropsBinding } from './componentBindings'\nimport type {\n AssayMatrixTemplate,\n DataFrameTemplate,\n InstrumentRunTemplate,\n ProtocolStepsTemplate,\n ReagentListTemplate,\n SampleSheetTemplate,\n TemplateId,\n TimeCourseTemplate,\n} from './types'\n\nexport function dataFrameProps(template: DataFrameTemplate): BioTemplateComponentPropsBinding {\n const frame = toTemplateDataFrame(template)\n return propsBinding(template.template_id as TemplateId, 'DataFrame', {\n ...frame,\n searchable: true,\n sortable: true,\n size: 'sm',\n })\n}\n\nexport function sampleSelectorProps(template: SampleSheetTemplate): BioTemplateComponentPropsBinding {\n const options = toSampleOptions(template)\n return propsBinding('sample-sheet', 'SampleSelector', {\n samples: options.map(option => option.label),\n modelValue: [],\n })\n}\n\nexport function assayMatrixSampleSelectorProps(template: AssayMatrixTemplate): BioTemplateComponentPropsBinding {\n const options = toAssayMatrixSampleOptions(template)\n return propsBinding('assay-matrix', 'SampleSelector', {\n samples: options.map(option => option.label),\n modelValue: [],\n })\n}\n\nexport function timelineProps(\n template: TimeCourseTemplate | ProtocolStepsTemplate | InstrumentRunTemplate,\n steps: unknown[],\n editable = false\n): BioTemplateComponentPropsBinding {\n return propsBinding(template.template_id as TemplateId, 'ExperimentTimeline', {\n modelValue: steps,\n orientation: 'vertical',\n editable,\n })\n}\n\nexport function scheduleCalendarProps(template: InstrumentRunTemplate): BioTemplateComponentPropsBinding {\n const events = toInstrumentRunScheduleEvents(template)\n return propsBinding('instrument-run', 'ScheduleCalendar', {\n modelValue: events[0]?.start,\n events,\n view: 'day',\n readonly: true,\n showNavigation: false,\n showViewToggle: false,\n })\n}\n\nexport function reagentListProps(template: ReagentListTemplate): BioTemplateComponentPropsBinding {\n return propsBinding('reagent-list', 'ReagentList', {\n modelValue: toReagentListItems(template),\n searchable: true,\n sortable: true,\n })\n}\n","import {\n toPlateMapEditorState,\n toWellPlateWells,\n} from './adapters'\nimport {\n activePlateFromState,\n legendItemsFromPlateState,\n racksFromPlateState,\n sampleColorsFromPlateState,\n} from './componentPlateHelpers'\nimport { propsBinding } from './componentPropsFactory'\nimport type { BioTemplateComponentPropsBinding } from './componentBindings'\nimport type { PlateMapTemplate } from './types'\n\nexport function plateMapProps(template: PlateMapTemplate): BioTemplateComponentPropsBinding[] {\n const state = toPlateMapEditorState(template)\n const plate = activePlateFromState(state)\n return [\n propsBinding('plate-map', 'PlateEditor', {\n modelValue: racksFromPlateState(state),\n activeRackId: plate.id,\n groups: state.samples,\n formats: [plate.format],\n wellFields: false,\n }),\n propsBinding('plate-map', 'WellPlate', {\n format: plate.format,\n wells: toWellPlateWells(template),\n sampleColors: sampleColorsFromPlateState(state),\n legendItems: legendItemsFromPlateState(state),\n showLegend: true,\n }),\n ]\n}\n","import type { WellLegendItem } from '../types'\nimport { toQpcrWellPlateWells } from './adapters'\nimport { colorForIndex } from './componentPlateHelpers'\nimport { getTemplateData } from './templateEnvelopes'\nimport { dataFrameProps } from './componentGenericProps'\nimport { propsBinding } from './componentPropsFactory'\nimport type { BioTemplateComponentPropsBinding } from './componentBindings'\nimport type { QpcrPlateTemplate } from './types'\n\nexport function qpcrPlateProps(template: QpcrPlateTemplate): BioTemplateComponentPropsBinding[] {\n const data = getTemplateData(template, 'qpcr-plate')\n const frame = dataFrameProps(template)\n return [\n propsBinding('qpcr-plate', 'WellPlate', {\n format: data.format,\n wells: toQpcrWellPlateWells(template),\n sampleColors: Object.fromEntries(data.samples.map((sample, index) => [sample.sampleId, colorForIndex(index)])),\n legendItems: data.samples.map((sample, index): WellLegendItem => ({\n type: sample.sampleId,\n label: sample.name ?? sample.sampleId,\n color: colorForIndex(index),\n })),\n showLegend: true,\n }),\n frame,\n ]\n}\n","import {\n toInstrumentRunSteps,\n toProtocolSteps,\n toTimeCourseSteps,\n} from './adapters'\nimport { doseResponseProps } from './componentDoseResponseProps'\nimport {\n assayMatrixSampleSelectorProps,\n dataFrameProps,\n reagentListProps,\n sampleSelectorProps,\n scheduleCalendarProps,\n timelineProps,\n} from './componentGenericProps'\nimport { plateMapProps } from './componentPlateMapProps'\nimport { qpcrPlateProps } from './componentQpcrPlateProps'\nimport type { BioTemplateComponentPropsBinding } from './componentBindings'\nimport type {\n AssayMatrixTemplate,\n BioTemplateEnvelope,\n DataFrameTemplate,\n DoseResponseTemplate,\n InstrumentRunTemplate,\n PlateMapTemplate,\n ProtocolStepsTemplate,\n QpcrPlateTemplate,\n ReagentListTemplate,\n SampleSheetTemplate,\n TimeCourseTemplate,\n} from './types'\n\nexport function propsForTemplate(template: BioTemplateEnvelope<unknown>): BioTemplateComponentPropsBinding[] {\n switch (template.template_id) {\n case 'plate-map':\n return plateMapProps(template as PlateMapTemplate)\n case 'sample-sheet':\n return [\n dataFrameProps(template as DataFrameTemplate),\n sampleSelectorProps(template as SampleSheetTemplate),\n ]\n case 'sample-prep':\n case 'calibration-curve':\n case 'flow-cytometry-panel':\n return [dataFrameProps(template as DataFrameTemplate)]\n case 'assay-matrix':\n return [\n dataFrameProps(template as DataFrameTemplate),\n assayMatrixSampleSelectorProps(template as AssayMatrixTemplate),\n ]\n case 'instrument-run':\n return [\n dataFrameProps(template as DataFrameTemplate),\n scheduleCalendarProps(template as InstrumentRunTemplate),\n timelineProps(template as InstrumentRunTemplate, toInstrumentRunSteps(template as InstrumentRunTemplate)),\n ]\n case 'dose-response':\n return doseResponseProps(template as DoseResponseTemplate)\n case 'time-course':\n return [\n timelineProps(template as TimeCourseTemplate, toTimeCourseSteps(template as TimeCourseTemplate)),\n dataFrameProps(template as DataFrameTemplate),\n ]\n case 'protocol-steps':\n return [\n timelineProps(template as ProtocolStepsTemplate, toProtocolSteps(template as ProtocolStepsTemplate), true),\n dataFrameProps(template as DataFrameTemplate),\n ]\n case 'reagent-list':\n return [\n reagentListProps(template as ReagentListTemplate),\n dataFrameProps(template as DataFrameTemplate),\n ]\n case 'qpcr-plate':\n return qpcrPlateProps(template as QpcrPlateTemplate)\n default:\n return []\n }\n}\n","import { extractTemplateCollection } from './templateEnvelopes'\nimport {\n isTemplateEnvelope,\n resolveComponentTemplateIds,\n} from './componentTargetResolvers'\nimport {\n cloneBinding,\n cloneBindingMap,\n cloneBindings,\n toVueSfc,\n uniquePropsName,\n} from './componentBindingHelpers'\nimport { templateComponentBindings } from './componentBindingCatalog'\nimport { propsForTemplate } from './componentTemplateProps'\nimport type {\n BioTemplateEnvelope,\n TemplateCollectionEnvelope,\n TemplateId,\n TemplatePackId,\n TemplatePresetId,\n} from './types'\n\nexport type BioTemplateComponentTarget =\n | TemplateId\n | TemplatePackId\n | TemplatePresetId\n | string\n | BioTemplateEnvelope<unknown>\n | TemplateCollectionEnvelope\n\nexport interface BioTemplateComponentBinding {\n id: string\n template_id: TemplateId\n component: string\n adapters: readonly string[]\n props: readonly string[]\n description: string\n importPath: '@morscherlab/mint-sdk'\n}\n\nexport interface BioTemplateComponentPropsBinding extends BioTemplateComponentBinding {\n propsObject: Record<string, unknown>\n}\n\nexport interface BioTemplateResolvedComponentBinding extends Omit<BioTemplateComponentBinding, 'props'> {\n /** Prop names advertised by the static template/component compatibility catalog. */\n propNames: readonly string[]\n /** Concrete props ready for direct `v-bind=\"componentBindingsById[id].props\"` use. */\n props: Record<string, unknown>\n /** Backward-compatible alias for callers that already consume componentProps entries. */\n propsObject: Record<string, unknown>\n}\n\nexport type BioTemplateComponentBindingsById = Record<string, BioTemplateResolvedComponentBinding>\nexport type BioTemplateComponentPropsById = Record<string, Record<string, unknown>>\nexport type BioTemplateComponentPropsByComponent = Record<string, Record<string, unknown>[]>\n\nexport interface BioTemplateComponentPropsLookupOptions {\n templateId?: TemplateId\n id?: string\n}\n\nexport interface BioTemplateComponentImport {\n importPath: BioTemplateComponentBinding['importPath']\n components: string[]\n statement: string\n}\n\nexport interface BioTemplateComponentSnippet extends BioTemplateComponentBinding {\n propsName: string\n propsExpression: string\n template: string\n}\n\nexport interface BioTemplateComponentSnippetOptions {\n propsVariable?: string\n}\n\nexport interface BioTemplateComponentUsageOptions extends BioTemplateComponentSnippetOptions {\n targetExpression?: string\n targetPropName?: string\n}\n\nexport interface BioTemplateComponentUsage {\n imports: BioTemplateComponentImport[]\n componentProps: BioTemplateComponentPropsBinding[]\n snippets: BioTemplateComponentSnippet[]\n propsDeclarations: string[]\n scriptSetup: string\n template: string\n sfc: string\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function listBioTemplateComponentBindings(): Record<TemplateId, BioTemplateComponentBinding[]> {\n return cloneBindingMap(templateComponentBindings)\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function getBioTemplateComponentBindings(\n target: BioTemplateComponentTarget\n): BioTemplateComponentBinding[] {\n const templateIds = resolveComponentTemplateIds(target)\n return templateIds.flatMap(templateId => cloneBindings(templateComponentBindings[templateId]))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toBioTemplateComponentProps(\n target: BioTemplateEnvelope<unknown> | TemplateCollectionEnvelope\n): BioTemplateComponentPropsBinding[] {\n if (isTemplateEnvelope(target)) {\n return propsForTemplate(target)\n }\n\n const collection = extractTemplateCollection(target)\n return Object.values(collection).flatMap(template => propsForTemplate(template))\n}\n\n/**\n * Return resolved component bindings with concrete props for direct slot rendering.\n *\n * @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins.\n */\nexport function toBioTemplateComponentBindings(\n target: BioTemplateEnvelope<unknown> | TemplateCollectionEnvelope,\n): BioTemplateResolvedComponentBinding[] {\n return toBioTemplateComponentProps(target).map(toResolvedComponentBinding)\n}\n\n/**\n * Return resolved component bindings keyed by stable template component id.\n *\n * @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins.\n */\nexport function toBioTemplateComponentBindingsById(\n target: BioTemplateEnvelope<unknown> | TemplateCollectionEnvelope,\n): BioTemplateComponentBindingsById {\n return Object.fromEntries(\n toBioTemplateComponentBindings(target).map(binding => [binding.id, binding]),\n )\n}\n\n/**\n * Return component props keyed by stable binding id for direct `v-bind=\"componentPropsById[id]\"` use.\n *\n * @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins.\n */\nexport function toBioTemplateComponentPropsById(\n target: BioTemplateEnvelope<unknown> | TemplateCollectionEnvelope,\n): BioTemplateComponentPropsById {\n return Object.fromEntries(\n toBioTemplateComponentProps(target).map(binding => [binding.id, binding.propsObject]),\n )\n}\n\n/**\n * Return component props grouped by SDK component name for direct WellPlate/DoseCalculator binding.\n *\n * @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins.\n */\nexport function toBioTemplateComponentPropsByComponent(\n target: BioTemplateEnvelope<unknown> | TemplateCollectionEnvelope,\n): BioTemplateComponentPropsByComponent {\n const grouped: BioTemplateComponentPropsByComponent = {}\n for (const binding of toBioTemplateComponentProps(target)) {\n const props = grouped[binding.component] ?? []\n props.push(binding.propsObject)\n grouped[binding.component] = props\n }\n return grouped\n}\n\n/**\n * Return the first props object for an SDK component, optionally restricted by template id or binding id.\n *\n * @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins.\n */\nexport function getBioTemplateComponentProps(\n target: BioTemplateEnvelope<unknown> | TemplateCollectionEnvelope,\n component: string,\n options: BioTemplateComponentPropsLookupOptions = {},\n): Record<string, unknown> | undefined {\n return toBioTemplateComponentProps(target).find((binding) => {\n if (binding.component !== component) return false\n if (options.id !== undefined && binding.id !== options.id) return false\n if (options.templateId !== undefined && binding.template_id !== options.templateId) return false\n return true\n })?.propsObject\n}\n\nfunction toResolvedComponentBinding(\n binding: BioTemplateComponentPropsBinding,\n): BioTemplateResolvedComponentBinding {\n const { props: propNames, propsObject, ...rest } = binding\n return {\n ...rest,\n propNames,\n props: propsObject,\n propsObject,\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toBioTemplateComponentImports(\n target: BioTemplateComponentTarget\n): BioTemplateComponentImport[] {\n const groups = new Map<BioTemplateComponentBinding['importPath'], string[]>()\n\n for (const binding of getBioTemplateComponentBindings(target)) {\n const components = groups.get(binding.importPath) ?? []\n if (!components.includes(binding.component)) components.push(binding.component)\n groups.set(binding.importPath, components)\n }\n\n return Array.from(groups.entries()).map(([importPath, components]) => ({\n importPath,\n components,\n statement: `import { ${components.join(', ')} } from '${importPath}'`,\n }))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toBioTemplateComponentSnippets(\n target: BioTemplateEnvelope<unknown> | TemplateCollectionEnvelope,\n options: BioTemplateComponentSnippetOptions = {}\n): BioTemplateComponentSnippet[] {\n const propsVariable = options.propsVariable ?? 'componentProps'\n const usedNames = new Map<string, number>()\n\n return toBioTemplateComponentProps(target).map((binding, index) => {\n const propsName = uniquePropsName(binding, usedNames)\n const propsExpression = `${propsVariable}[${index}].propsObject`\n return {\n ...cloneBinding(binding),\n propsName,\n propsExpression,\n template: `<${binding.component} v-bind=\"${propsExpression}\" />`,\n }\n })\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toBioTemplateComponentUsage(\n target: BioTemplateEnvelope<unknown> | TemplateCollectionEnvelope,\n options: BioTemplateComponentUsageOptions = {}\n): BioTemplateComponentUsage {\n const propsVariable = options.propsVariable ?? 'componentProps'\n const usesGeneratedTargetProp = options.targetExpression === undefined\n const targetPropName = options.targetPropName ?? 'templateCollection'\n const targetExpression = options.targetExpression ?? `props.${targetPropName}`\n const componentProps = toBioTemplateComponentProps(target)\n const snippets = toBioTemplateComponentSnippets(target, { propsVariable }).map(snippet => ({\n ...snippet,\n propsExpression: snippet.propsName,\n template: `<${snippet.component} v-bind=\"${snippet.propsName}\" />`,\n }))\n const propsDeclarations = snippets.map(\n (snippet, index) => `const ${snippet.propsName} = ${propsVariable}[${index}].propsObject`\n )\n const setupLines = [\n ...(usesGeneratedTargetProp\n ? [`const props = defineProps<{ ${targetPropName}: BioTemplateEnvelope<unknown> | TemplateCollectionEnvelope }>()`]\n : []),\n `const ${propsVariable} = toBioTemplateComponentProps(${targetExpression})`,\n ...propsDeclarations,\n ]\n const imports = toBioTemplateComponentImports(target)\n const template = snippets.map(snippet => snippet.template).join('\\n')\n\n return {\n imports,\n componentProps,\n snippets,\n propsDeclarations,\n scriptSetup: setupLines.join('\\n'),\n template,\n sfc: toVueSfc(imports, setupLines, template, usesGeneratedTargetProp),\n }\n}\n","import {\n readBoolean,\n readInteger,\n readNumber,\n readNumberList,\n readOptionalString,\n readString,\n readStringList,\n} from './builderReadUtils'\nimport { readPlateFormat } from '../components/WellPlate.geometry'\nimport { getBioTemplatePresetInfo } from './presets'\nimport type {\n CreateElisaAssayCollectionOptions,\n CreateFlowCytometryAssayCollectionOptions,\n CreateLcmsBatchCollectionOptions,\n CreateQpcrExpressionCollectionOptions,\n CreateQpcrPlateTemplateOptions,\n CreateSamplePrepTemplateOptions,\n CreateTargetedMetabolomicsCollectionOptions,\n CreateWellPlateScreenCollectionOptions,\n CreateWesternBlotAssayCollectionOptions,\n TemplatePresetId,\n} from './types'\n\nexport type BioTemplateControlValues = Record<string, unknown>\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function bioTemplatePresetControlValuesToOptions(\n name: 'wellplate-screen',\n values: BioTemplateControlValues\n): CreateWellPlateScreenCollectionOptions\nexport function bioTemplatePresetControlValuesToOptions(\n name: 'qpcr-expression',\n values: BioTemplateControlValues\n): CreateQpcrExpressionCollectionOptions\nexport function bioTemplatePresetControlValuesToOptions(\n name: 'lcms-batch',\n values: BioTemplateControlValues\n): CreateLcmsBatchCollectionOptions\nexport function bioTemplatePresetControlValuesToOptions(\n name: 'targeted-metabolomics',\n values: BioTemplateControlValues\n): CreateTargetedMetabolomicsCollectionOptions\nexport function bioTemplatePresetControlValuesToOptions(\n name: 'elisa-assay',\n values: BioTemplateControlValues\n): CreateElisaAssayCollectionOptions\nexport function bioTemplatePresetControlValuesToOptions(\n name: 'flow-cytometry-assay',\n values: BioTemplateControlValues\n): CreateFlowCytometryAssayCollectionOptions\nexport function bioTemplatePresetControlValuesToOptions(\n name: 'western-blot-assay',\n values: BioTemplateControlValues\n): CreateWesternBlotAssayCollectionOptions\nexport function bioTemplatePresetControlValuesToOptions(\n name: TemplatePresetId | string,\n values: BioTemplateControlValues\n):\n | CreateWellPlateScreenCollectionOptions\n | CreateQpcrExpressionCollectionOptions\n | CreateLcmsBatchCollectionOptions\n | CreateTargetedMetabolomicsCollectionOptions\n | CreateElisaAssayCollectionOptions\n | CreateFlowCytometryAssayCollectionOptions\n | CreateWesternBlotAssayCollectionOptions\nexport function bioTemplatePresetControlValuesToOptions(\n name: TemplatePresetId | string,\n values: BioTemplateControlValues\n):\n | CreateWellPlateScreenCollectionOptions\n | CreateQpcrExpressionCollectionOptions\n | CreateLcmsBatchCollectionOptions\n | CreateTargetedMetabolomicsCollectionOptions\n | CreateElisaAssayCollectionOptions\n | CreateFlowCytometryAssayCollectionOptions\n | CreateWesternBlotAssayCollectionOptions {\n const preset = getBioTemplatePresetInfo(name)\n if (!preset) {\n throw new Error(`Unknown template preset '${name}'.`)\n }\n\n if (preset.name === 'wellplate-screen') {\n return {\n samples: readStringList(values.sampleNames, ['Control', 'Treatment']),\n plateName: readString(values.plateName, 'Screen plate'),\n plateFormat: readPlateFormat(values.plateFormat, 96),\n unit: readString(values.unit, 'uM'),\n replicates: readInteger(values.replicates, 3),\n }\n }\n\n if (preset.name === 'qpcr-expression') {\n return {\n samples: readStringList(values.sampleNames, ['Control', 'Treatment']),\n targets: readStringList(values.targets, ['ACTB', 'GAPDH']),\n chemistry: readString(values.chemistry, 'sybr') as CreateQpcrPlateTemplateOptions['chemistry'],\n format: readPlateFormat(values.plateFormat, 96),\n includeNoTemplateControls: readBoolean(values.includeNoTemplateControls, true),\n replicates: readInteger(values.replicates, 3),\n instrument: readOptionalString(values.instrument),\n }\n }\n\n if (preset.name === 'lcms-batch') {\n return {\n samples: readStringList(values.sampleNames, ['S001', 'S002']),\n features: readStringList(values.featureNames, ['Glucose', 'Lactate']),\n instrument: readString(values.instrument, 'LC-MS'),\n method: readString(values.method, 'Default method'),\n includeQc: readBoolean(values.includeQc, true),\n }\n }\n\n if (preset.name === 'targeted-metabolomics') {\n return {\n samples: readStringList(values.sampleNames, ['S001', 'S002']),\n metabolites: readStringList(values.metaboliteNames, ['Glucose', 'Lactate', 'Pyruvate']),\n internalStandards: readStringList(\n values.internalStandards,\n ['Stable isotope internal standard mix'],\n ),\n standardConcentrations: readNumberList(values.standardConcentrations, [0.1, 1, 10, 100]),\n concentrationUnit: readString(values.concentrationUnit, 'uM'),\n responseUnit: readString(values.responseUnit, 'peak area ratio'),\n calibrationAnalyte: readOptionalString(values.calibrationAnalyte),\n instrument: readString(values.instrument, 'LC-MS'),\n method: readString(values.method, 'Targeted metabolomics'),\n prepType: readString(values.prepType, 'extraction') as CreateSamplePrepTemplateOptions['prepType'],\n outputVolume: readNumber(values.outputVolume, 50),\n includeQc: readBoolean(values.includeQc, true),\n }\n }\n\n if (preset.name === 'elisa-assay') {\n return {\n samples: readStringList(values.sampleNames, ['Control', 'Treatment']),\n analyte: readString(values.analyte, 'Analyte'),\n standardConcentrations: readNumberList(values.standardConcentrations, [1000, 100, 10, 1]),\n unit: readString(values.unit, 'pg/mL'),\n responseUnit: readString(values.responseUnit, 'OD450'),\n plateName: readString(values.plateName, 'ELISA plate'),\n plateFormat: readPlateFormat(values.plateFormat, 96),\n }\n }\n\n if (preset.name === 'flow-cytometry-assay') {\n return {\n samples: readStringList(values.sampleNames, ['Control', 'Treatment']),\n markers: readStringList(values.markers, ['CD3', 'CD4', 'CD8']),\n features: readStringList(values.featureNames, ['CD3+ cells', 'CD4+ cells', 'CD8+ cells']),\n instrument: readString(values.instrument, 'Flow cytometer'),\n includeDefaultControls: readBoolean(values.includeDefaultControls, true),\n }\n }\n\n if (preset.name === 'western-blot-assay') {\n return {\n samples: readStringList(values.sampleNames, ['Control', 'Treatment']),\n targets: readStringList(values.targets, ['Target protein']),\n loadingControl: readString(values.loadingControl, 'ACTB'),\n }\n }\n\n throw new Error(`Unknown template preset '${name}'.`)\n}\n","export function sampleIdFromName(name: string, index: number): string {\n return idFromName(name, `sample-${index + 1}`)\n}\n\nexport function compoundIdFromName(name: string, index: number): string {\n return idFromName(name, `compound-${index + 1}`)\n}\n\nexport function idFromName(name: string, fallback: string): string {\n const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '')\n return slug || fallback\n}\n\nexport function timepointId(value: number, unit: string, index: number): string {\n const raw = Number.isInteger(value)\n ? String(value)\n : String(value).replace(/0+$/, '').replace(/\\.$/, '')\n const token = raw.replace('.', 'p')\n return token ? `t${token}-${unit}` : `timepoint-${index + 1}`\n}\n","import { SAMPLE_COLOR_SCALE } from '../utils/color'\nimport { sampleIdFromName } from './builderIdUtils'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport type {\n CreatePlateMapTemplateOptions,\n PlateMapTemplate,\n TemplateSample,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createPlateMapTemplate(\n options: CreatePlateMapTemplateOptions = {}\n): PlateMapTemplate {\n const {\n id = 'plate-1',\n name = 'Plate 1',\n format = 96,\n samples = [],\n metadata = {},\n } = options\n\n const sampleDefinitions = samples.map((sample, index): TemplateSample => {\n if (typeof sample !== 'string') return sample\n return {\n id: sampleIdFromName(sample, index),\n name: sample,\n color: SAMPLE_COLOR_SCALE[index % SAMPLE_COLOR_SCALE.length],\n }\n })\n\n return createTemplateEnvelope('plate-map', {\n plates: [\n {\n id,\n name,\n format,\n wells: {},\n },\n ],\n samples: sampleDefinitions,\n activePlateId: id,\n selectedWells: [],\n }, metadata)\n}\n","import type {\n SamplePrepStep,\n SamplePrepStepInput,\n SampleRecord,\n} from './types'\nimport {\n idFromName,\n sampleIdFromName,\n} from './builderIdUtils'\n\nexport function normalizeSampleRecord(sample: SampleRecord): SampleRecord {\n return {\n ...sample,\n metadata: sample.metadata ?? {},\n }\n}\n\nexport function presetSampleRecords(samples: Array<string | SampleRecord>): SampleRecord[] {\n return samples.map((sample, index) => {\n if (typeof sample !== 'string') return normalizeSampleRecord(sample)\n return {\n sampleId: sampleIdFromName(sample, index),\n name: sample,\n metadata: {},\n }\n })\n}\n\nexport function normalizeSamplePrepStep(\n step: SamplePrepStepInput,\n prepType: SamplePrepStep['type'],\n volumeUnit: string,\n order: number,\n index: number\n): SamplePrepStep {\n const type = step.type ?? prepType\n const sourceSampleId = step.sourceSampleId\n const name = step.name || `Prepare ${sourceSampleId ?? index + 1}`\n return {\n id: step.id || idFromName(name, `${type}-${index + 1}`),\n order: step.order ?? order,\n type,\n name,\n sourceSampleId,\n sourcePlateId: step.sourcePlateId,\n sourceWellId: step.sourceWellId,\n destinationSampleId: step.destinationSampleId,\n destinationPlateId: step.destinationPlateId,\n destinationWellId: step.destinationWellId,\n reagentId: step.reagentId,\n inputVolume: step.inputVolume,\n outputVolume: step.outputVolume,\n volumeUnit: step.volumeUnit || volumeUnit,\n durationMin: step.durationMin,\n status: step.status ?? 'planned',\n metadata: step.metadata ?? {},\n }\n}\n","import { normalizeSampleRecord } from './sampleNormalizers'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport { validateSampleSheetData } from './templateValidators'\nimport type {\n CreateSampleSheetTemplateOptions,\n SampleSheetTemplate,\n SampleSheetTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createSampleSheetTemplate(\n options: CreateSampleSheetTemplateOptions\n): SampleSheetTemplate {\n const data: SampleSheetTemplateData = {\n samples: options.samples.map(normalizeSampleRecord),\n columns: options.columns ?? [\n { id: 'sampleId', label: 'Sample ID', type: 'string', required: true, groupable: false },\n { id: 'name', label: 'Name', type: 'string', required: false, groupable: false },\n ],\n groups: options.groups ?? [],\n }\n validateSampleSheetData(data)\n return createTemplateEnvelope('sample-sheet', data, options.metadata ?? {})\n}\n","import { idFromName } from './builderIdUtils'\nimport { normalizeSamplePrepStep } from './sampleNormalizers'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport { validateSamplePrepData } from './templateValidators'\nimport type {\n CreateSamplePrepTemplateOptions,\n SamplePrepStep,\n SamplePrepTemplate,\n SamplePrepTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createSamplePrepTemplate(\n options: CreateSamplePrepTemplateOptions\n): SamplePrepTemplate {\n const prepType = options.prepType ?? 'extraction'\n const volumeUnit = options.volumeUnit ?? 'uL'\n const steps: SamplePrepStep[] = []\n let order = 1\n\n for (const [index, sample] of options.samples.entries()) {\n if (typeof sample !== 'string') {\n const step = normalizeSamplePrepStep(sample, prepType, volumeUnit, order, index)\n steps.push(step)\n order = Math.max(order, step.order + 1)\n continue\n }\n const sourceSampleId = idFromName(sample, `sample-${index + 1}`)\n steps.push({\n id: `${sourceSampleId}-prep`,\n order,\n type: prepType,\n name: `Prepare ${sample}`,\n sourceSampleId,\n destinationSampleId: `${sourceSampleId}-prepared`,\n inputVolume: options.inputVolume,\n outputVolume: options.outputVolume,\n volumeUnit,\n status: 'planned',\n metadata: {},\n })\n order += 1\n }\n\n const data: SamplePrepTemplateData = {\n protocolName: options.protocolName ?? 'Sample preparation',\n steps,\n metadata: options.metadata ?? {},\n }\n validateSamplePrepData(data)\n return createTemplateEnvelope('sample-prep', data, options.metadata ?? {})\n}\n","import type {\n CalibrationAcceptance,\n CalibrationPoint,\n CalibrationPointInput,\n CompoundDoseSeries,\n ControlDefinition,\n} from './types'\nimport { idFromName } from './builderIdUtils'\n\nexport function normalizeCompound(compound: CompoundDoseSeries): CompoundDoseSeries {\n return {\n ...compound,\n concentrations: [...compound.concentrations].sort((a, b) => b - a),\n metadata: compound.metadata ?? {},\n }\n}\n\nexport function normalizeCalibrationAcceptance(\n acceptance?: Partial<CalibrationAcceptance>,\n requireBlank = true\n): CalibrationAcceptance {\n return {\n minRSquared: acceptance?.minRSquared ?? 0.99,\n standardTolerancePercent: acceptance?.standardTolerancePercent ?? 15,\n qcTolerancePercent: acceptance?.qcTolerancePercent ?? 20,\n requireBlank: acceptance?.requireBlank ?? requireBlank,\n metadata: acceptance?.metadata ?? {},\n }\n}\n\nexport function normalizeCalibrationPoint(\n point: CalibrationPointInput,\n unit: string,\n order: number,\n index: number\n): CalibrationPoint {\n const role = point.role ?? 'standard'\n const level = point.level || `${role.charAt(0).toUpperCase()}${role.slice(1)} ${index + 1}`\n return {\n id: point.id || idFromName(level, `${role}-${index + 1}`),\n order: point.order ?? order,\n role,\n level,\n concentration: point.concentration ?? 0,\n unit: point.unit || unit,\n expectedResponse: point.expectedResponse,\n response: point.response,\n replicate: point.replicate ?? 1,\n include: point.include ?? true,\n status: point.status ?? 'planned',\n metadata: point.metadata ?? {},\n }\n}\n\nexport function normalizeControl(control: ControlDefinition): ControlDefinition {\n return {\n ...control,\n metadata: control.metadata ?? {},\n }\n}\n","import { compoundIdFromName } from './builderIdUtils'\nimport {\n normalizeCompound,\n normalizeControl,\n} from './calibrationNormalizers'\nimport {\n createTemplateEnvelope,\n getTemplateData,\n} from './templateEnvelopes'\nimport { validateDoseResponseData } from './templateValidators'\nimport type {\n CreateDoseResponseTemplateOptions,\n DoseResponseTemplate,\n DoseResponseTemplateData,\n PlateMapTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createDoseResponseTemplate(\n options: CreateDoseResponseTemplateOptions\n): DoseResponseTemplate {\n const compounds = Array.isArray(options.compounds)\n ? options.compounds.map(normalizeCompound)\n : Object.entries(options.compounds).map(([name, concentrations], index) => normalizeCompound({\n id: compoundIdFromName(name, index),\n name,\n concentrations,\n metadata: {},\n }))\n\n const layout = options.layout\n ? getTemplateData<PlateMapTemplateData>(options.layout)\n : undefined\n\n const data: DoseResponseTemplateData = {\n compounds,\n unit: options.unit,\n replicates: options.replicates ?? 1,\n controls: (options.controls ?? []).map(normalizeControl),\n layout,\n metadata: options.metadata ?? {},\n }\n validateDoseResponseData(data)\n return createTemplateEnvelope('dose-response', data, options.metadata ?? {})\n}\n","import { idFromName } from './builderIdUtils'\nimport {\n normalizeCalibrationAcceptance,\n normalizeCalibrationPoint,\n} from './calibrationNormalizers'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport { validateCalibrationCurveData } from './templateValidators'\nimport type {\n CalibrationCurveTemplate,\n CalibrationCurveTemplateData,\n CalibrationPoint,\n CreateCalibrationCurveTemplateOptions,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createCalibrationCurveTemplate(\n options: CreateCalibrationCurveTemplateOptions\n): CalibrationCurveTemplate {\n const unit = options.unit ?? 'uM'\n const points: CalibrationPoint[] = []\n let order = 1\n\n if (options.includeBlank !== false) {\n points.push({\n id: 'blank',\n order,\n role: 'blank',\n level: 'Blank',\n concentration: 0,\n unit,\n replicate: 1,\n include: true,\n status: 'planned',\n metadata: {},\n })\n order += 1\n }\n\n const standardValues: number[] = []\n for (const [index, concentration] of options.concentrations.entries()) {\n if (typeof concentration !== 'number') {\n const point = normalizeCalibrationPoint(concentration, unit, order, index)\n points.push(point)\n if (point.role === 'standard') standardValues.push(point.concentration)\n order = Math.max(order, point.order + 1)\n continue\n }\n standardValues.push(concentration)\n points.push({\n id: `std-${index + 1}`,\n order,\n role: 'standard',\n level: `Standard ${index + 1}`,\n concentration,\n unit,\n replicate: 1,\n include: true,\n status: 'planned',\n metadata: {},\n })\n order += 1\n }\n\n if (options.includeQc !== false) {\n const positiveValues = [...standardValues].filter(value => value > 0).sort((a, b) => a - b)\n const qcValues = positiveValues.length === 0\n ? []\n : positiveValues[0] === positiveValues[positiveValues.length - 1]\n ? [positiveValues[0]]\n : [positiveValues[0], positiveValues[positiveValues.length - 1]]\n for (const [index, concentration] of qcValues.entries()) {\n const level = index === 0 ? 'QC low' : 'QC high'\n points.push({\n id: idFromName(level, `qc-${index + 1}`),\n order,\n role: 'qc',\n level,\n concentration,\n unit,\n replicate: 1,\n include: true,\n status: 'planned',\n metadata: {},\n })\n order += 1\n }\n }\n\n const data: CalibrationCurveTemplateData = {\n analyte: options.analyte ?? 'Analyte',\n model: options.model ?? 'linear',\n xUnit: unit,\n responseUnit: options.responseUnit ?? 'response',\n points,\n acceptance: normalizeCalibrationAcceptance(options.acceptance, options.includeBlank !== false),\n metadata: options.metadata ?? {},\n }\n validateCalibrationCurveData(data)\n return createTemplateEnvelope('calibration-curve', data, options.metadata ?? {})\n}\n","import type {\n ProtocolStepRecord,\n TimeCourseCondition,\n TimePoint,\n} from './types'\nimport { idFromName } from './builderIdUtils'\n\nexport function normalizeTimePoint(timepoint: TimePoint): TimePoint {\n return {\n ...timepoint,\n metadata: timepoint.metadata ?? {},\n }\n}\n\nexport function normalizeCondition(condition: TimeCourseCondition): TimeCourseCondition {\n return {\n ...condition,\n metadata: condition.metadata ?? {},\n }\n}\n\nexport function normalizeProtocolStep(\n step: Partial<ProtocolStepRecord> & { name: string },\n index: number\n): ProtocolStepRecord {\n return {\n id: step.id ?? idFromName(step.name, `step-${index + 1}`),\n type: step.type ?? 'custom',\n name: step.name,\n description: step.description,\n duration: step.duration,\n status: step.status ?? 'pending',\n parameters: step.parameters ?? {},\n order: step.order ?? index,\n metadata: step.metadata ?? {},\n }\n}\n","import { SAMPLE_COLOR_SCALE } from '../utils/color'\nimport {\n idFromName,\n timepointId,\n} from './builderIdUtils'\nimport {\n normalizeCondition,\n normalizeTimePoint,\n} from './protocolNormalizers'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport { validateTimeCourseData } from './templateValidators'\nimport type {\n CreateTimeCourseTemplateOptions,\n TimeCourseCondition,\n TimeCourseTemplate,\n TimeCourseTemplateData,\n TimePoint,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createTimeCourseTemplate(\n options: CreateTimeCourseTemplateOptions\n): TimeCourseTemplate {\n const timepoints = options.timepoints.map((timepoint, index): TimePoint => {\n if (typeof timepoint !== 'number') return normalizeTimePoint(timepoint)\n return {\n id: timepointId(timepoint, options.unit, index),\n label: `${timepoint} ${options.unit}`,\n value: timepoint,\n unit: options.unit,\n metadata: {},\n }\n }).sort((a, b) => a.value - b.value)\n\n const conditions = options.conditions.map((condition, index): TimeCourseCondition => {\n if (typeof condition !== 'string') return normalizeCondition(condition)\n return {\n id: idFromName(condition, `condition-${index + 1}`),\n name: condition,\n color: SAMPLE_COLOR_SCALE[index % SAMPLE_COLOR_SCALE.length],\n metadata: {},\n }\n })\n\n const samples = conditions.flatMap(condition =>\n timepoints.flatMap(timepoint =>\n Array.from({ length: options.replicates ?? 1 }, (_, index) => ({\n sampleId: `${condition.id}-${timepoint.id}-r${index + 1}`,\n conditionId: condition.id,\n timepointId: timepoint.id,\n replicate: index + 1,\n metadata: {},\n }))\n )\n )\n\n const data: TimeCourseTemplateData = {\n timepoints,\n conditions,\n samples,\n metadata: options.metadata ?? {},\n }\n validateTimeCourseData(data)\n return createTemplateEnvelope('time-course', data, options.metadata ?? {})\n}\n","import { idFromName } from './builderIdUtils'\nimport { normalizeProtocolStep } from './protocolNormalizers'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport { validateProtocolStepsData } from './templateValidators'\nimport type {\n CreateProtocolStepsTemplateOptions,\n ProtocolStepRecord,\n ProtocolStepsTemplate,\n ProtocolStepsTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createProtocolStepsTemplate(\n options: CreateProtocolStepsTemplateOptions\n): ProtocolStepsTemplate {\n const steps = options.steps.map((step, index): ProtocolStepRecord => {\n if (typeof step === 'string') {\n return {\n id: idFromName(step, `step-${index + 1}`),\n type: 'custom',\n name: step,\n status: 'pending',\n parameters: {},\n order: index,\n metadata: {},\n }\n }\n return normalizeProtocolStep(step, index)\n }).sort((a, b) => a.order - b.order)\n\n const data: ProtocolStepsTemplateData = {\n steps,\n metadata: options.metadata ?? {},\n }\n validateProtocolStepsData(data)\n return createTemplateEnvelope('protocol-steps', data, options.metadata ?? {})\n}\n","import type {\n AssayFeature,\n AssaySample,\n} from './types'\nimport { idFromName } from './builderIdUtils'\n\nexport function createAssaySampleLookup(samples: AssaySample[]): Map<string, string> {\n const lookup = new Map<string, string>()\n for (const sample of samples) {\n addLookupAlias(lookup, sample.sampleId, sample.sampleId)\n if (sample.name) {\n addLookupAlias(lookup, sample.name, sample.sampleId)\n addLookupAlias(lookup, idFromName(sample.name, sample.sampleId), sample.sampleId)\n }\n }\n return lookup\n}\n\nexport function createAssayFeatureLookup(features: AssayFeature[]): Map<string, string> {\n const lookup = new Map<string, string>()\n for (const feature of features) {\n addLookupAlias(lookup, feature.id, feature.id)\n addLookupAlias(lookup, feature.name, feature.id)\n addLookupAlias(lookup, idFromName(feature.name, feature.id), feature.id)\n }\n return lookup\n}\n\nfunction addLookupAlias(lookup: Map<string, string>, alias: string, value: string): void {\n if (!lookup.has(alias)) {\n lookup.set(alias, value)\n }\n}\n","import type {\n AssayFeature,\n AssaySample,\n ReagentRecord,\n ReagentTemplateInput,\n} from './types'\n\nexport function normalizeAssaySample(sample: AssaySample): AssaySample {\n return {\n ...sample,\n metadata: sample.metadata ?? {},\n }\n}\n\nexport function normalizeAssayFeature(feature: AssayFeature): AssayFeature {\n return {\n ...feature,\n metadata: feature.metadata ?? {},\n }\n}\n\nexport function normalizeReagent(reagent: ReagentTemplateInput): ReagentRecord {\n return {\n ...reagent,\n expiryDate: normalizeDateString(reagent.expiryDate),\n kind: reagent.kind ?? 'reagent',\n metadata: reagent.metadata ?? {},\n }\n}\n\nfunction normalizeDateString(value: Date | string | null | undefined): string | undefined {\n if (value === undefined || value === null) return undefined\n return value instanceof Date ? value.toISOString() : value\n}\n","import {\n createAssayFeatureLookup,\n createAssaySampleLookup,\n} from './assayLookups'\nimport {\n normalizeAssayFeature,\n normalizeAssaySample,\n} from './assayNormalizers'\nimport { idFromName } from './builderIdUtils'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport { validateAssayMatrixData } from './templateValidators'\nimport type {\n AssayFeature,\n AssayMatrixTemplate,\n AssayMatrixTemplateData,\n AssaySample,\n CreateAssayMatrixTemplateOptions,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createAssayMatrixTemplate(\n options: CreateAssayMatrixTemplateOptions\n): AssayMatrixTemplate {\n const samples = options.samples.map((sample, index): AssaySample => {\n if (typeof sample !== 'string') return normalizeAssaySample(sample)\n return {\n sampleId: idFromName(sample, `sample-${index + 1}`),\n name: sample,\n metadata: {},\n }\n })\n const features = options.features.map((feature, index): AssayFeature => {\n if (typeof feature !== 'string') return normalizeAssayFeature(feature)\n return {\n id: idFromName(feature, `feature-${index + 1}`),\n name: feature,\n type: 'readout',\n metadata: {},\n }\n })\n const sampleLookup = createAssaySampleLookup(samples)\n const featureLookup = createAssayFeatureLookup(features)\n const measurements = Object.entries(options.values ?? {}).flatMap(([sampleId, featureValues]) =>\n Object.entries(featureValues).map(([featureId, value]) => ({\n sampleId: sampleLookup.get(sampleId) ?? sampleId,\n featureId: featureLookup.get(featureId) ?? featureId,\n value,\n metadata: {},\n }))\n )\n\n const data: AssayMatrixTemplateData = {\n samples,\n features,\n measurements,\n metadata: options.metadata ?? {},\n }\n validateAssayMatrixData(data)\n return createTemplateEnvelope('assay-matrix', data, options.metadata ?? {})\n}\n","import { normalizeReagent } from './assayNormalizers'\nimport { idFromName } from './builderIdUtils'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport { validateReagentListData } from './templateValidators'\nimport type {\n CreateReagentListTemplateOptions,\n ReagentListTemplate,\n ReagentListTemplateData,\n ReagentRecord,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createReagentListTemplate(\n options: CreateReagentListTemplateOptions\n): ReagentListTemplate {\n const reagents = options.reagents.map((reagent, index): ReagentRecord => {\n if (typeof reagent !== 'string') return normalizeReagent(reagent)\n return {\n id: idFromName(reagent, `reagent-${index + 1}`),\n name: reagent,\n kind: 'reagent',\n metadata: {},\n }\n })\n const data: ReagentListTemplateData = {\n reagents,\n metadata: options.metadata ?? {},\n }\n validateReagentListData(data)\n return createTemplateEnvelope('reagent-list', data, options.metadata ?? {})\n}\n","import type {\n FlowPanelControl,\n FlowPanelMarker,\n} from './types'\nimport { idFromName } from './builderIdUtils'\n\nexport function normalizeFlowMarker(\n marker: Partial<FlowPanelMarker> & { marker: string },\n index: number\n): FlowPanelMarker {\n return {\n id: marker.id ?? idFromName(marker.marker, `marker-${index + 1}`),\n marker: marker.marker,\n fluorophore: marker.fluorophore ?? 'unassigned',\n detector: marker.detector,\n clone: marker.clone,\n reagentId: marker.reagentId,\n purpose: marker.purpose ?? 'phenotype',\n compensationRequired: marker.compensationRequired ?? true,\n metadata: marker.metadata ?? {},\n }\n}\n\nexport function normalizeFlowControl(\n control: Partial<FlowPanelControl> & { name: string },\n index: number\n): FlowPanelControl {\n return {\n id: control.id ?? idFromName(control.name, `control-${index + 1}`),\n name: control.name,\n kind: control.kind ?? 'other',\n markerId: control.markerId,\n required: control.required ?? true,\n metadata: control.metadata ?? {},\n }\n}\n\nexport function defaultFlowControls(markers: FlowPanelMarker[]): FlowPanelControl[] {\n return [\n {\n id: 'unstained',\n name: 'Unstained',\n kind: 'unstained',\n required: true,\n metadata: {},\n },\n ...markers\n .filter(marker => marker.compensationRequired)\n .map(marker => ({\n id: `${marker.id}-single-stain`,\n name: `${marker.marker} single stain`,\n kind: 'single-stain' as const,\n markerId: marker.id,\n required: true,\n metadata: {},\n })),\n ]\n}\n","import { idFromName } from './builderIdUtils'\nimport {\n defaultFlowControls,\n normalizeFlowControl,\n normalizeFlowMarker,\n} from './flowNormalizers'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport { validateFlowCytometryPanelData } from './templateValidators'\nimport type {\n CreateFlowCytometryPanelTemplateOptions,\n FlowCytometryPanelTemplate,\n FlowCytometryPanelTemplateData,\n FlowPanelControl,\n FlowPanelMarker,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createFlowCytometryPanelTemplate(\n options: CreateFlowCytometryPanelTemplateOptions\n): FlowCytometryPanelTemplate {\n const markers = options.markers.map((marker, index): FlowPanelMarker => {\n if (typeof marker !== 'string') return normalizeFlowMarker(marker, index)\n return {\n id: idFromName(marker, `marker-${index + 1}`),\n marker,\n fluorophore: 'unassigned',\n purpose: 'phenotype',\n compensationRequired: true,\n metadata: {},\n }\n })\n const controls = options.controls === undefined\n ? options.includeDefaultControls === false\n ? []\n : defaultFlowControls(markers)\n : options.controls.map((control, index): FlowPanelControl => {\n if (typeof control !== 'string') return normalizeFlowControl(control, index)\n return {\n id: idFromName(control, `control-${index + 1}`),\n name: control,\n kind: 'other',\n required: true,\n metadata: {},\n }\n })\n const data: FlowCytometryPanelTemplateData = {\n markers,\n controls,\n instrument: options.instrument,\n metadata: options.metadata ?? {},\n }\n validateFlowCytometryPanelData(data)\n return createTemplateEnvelope('flow-cytometry-panel', data, options.metadata ?? {})\n}\n","import type {\n InstrumentMethod,\n InstrumentRunItem,\n QpcrSample,\n QpcrTarget,\n} from './types'\nimport { idFromName } from './builderIdUtils'\n\nexport function normalizeInstrumentMethod(\n method: Partial<InstrumentMethod> & { name?: string },\n fallbackInstrument?: string\n): InstrumentMethod {\n const name = method.name || method.id || 'Default method'\n return {\n id: method.id || idFromName(name, 'method-1'),\n name,\n instrument: method.instrument ?? fallbackInstrument,\n acquisitionMode: method.acquisitionMode,\n metadata: method.metadata ?? {},\n }\n}\n\nexport function normalizeInstrumentRunItem(\n item: Partial<InstrumentRunItem> & { name?: string; sampleId?: string },\n defaultMethodId: string,\n fallbackOrder: number,\n index: number\n): InstrumentRunItem {\n const kind = item.kind ?? 'sample'\n const sampleId = item.sampleId || (kind === 'sample'\n ? idFromName(item.name ?? `Sample ${index + 1}`, `sample-${index + 1}`)\n : undefined)\n const label = item.name ?? sampleId ?? kind\n return {\n id: item.id || idFromName(label, `${kind}-${index + 1}`),\n order: item.order ?? fallbackOrder,\n kind,\n sampleId,\n name: item.name,\n methodId: item.methodId || defaultMethodId,\n vial: item.vial,\n plateId: item.plateId,\n wellId: item.wellId,\n injectionVolume: item.injectionVolume,\n expectedDurationMin: item.expectedDurationMin,\n status: item.status ?? 'planned',\n metadata: item.metadata ?? {},\n }\n}\n\nexport function normalizeQpcrSample(sample: QpcrSample): QpcrSample {\n return {\n ...sample,\n metadata: sample.metadata ?? {},\n }\n}\n\nexport function normalizeQpcrTarget(target: QpcrTarget): QpcrTarget {\n return {\n ...target,\n metadata: target.metadata ?? {},\n }\n}\n","import { idFromName } from './builderIdUtils'\nimport {\n normalizeInstrumentMethod,\n normalizeInstrumentRunItem,\n} from './runNormalizers'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport { validateInstrumentRunData } from './templateValidators'\nimport type {\n CreateInstrumentRunTemplateOptions,\n InstrumentRunItem,\n InstrumentRunTemplate,\n InstrumentRunTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createInstrumentRunTemplate(\n options: CreateInstrumentRunTemplateOptions\n): InstrumentRunTemplate {\n const method = typeof options.method === 'string' || options.method === undefined\n ? {\n id: idFromName(options.method ?? 'Default method', 'method-1'),\n name: options.method ?? 'Default method',\n instrument: options.instrument,\n metadata: {},\n }\n : normalizeInstrumentMethod(options.method, options.instrument)\n const items: InstrumentRunItem[] = []\n let order = 1\n\n if (options.includeBlanks !== false) {\n items.push({\n id: 'blank-start',\n order,\n kind: 'blank',\n name: 'Blank start',\n methodId: method.id,\n status: 'planned',\n metadata: {},\n })\n order += 1\n }\n\n if (options.includeQc !== false) {\n items.push({\n id: 'qc-start',\n order,\n kind: 'qc',\n name: 'QC start',\n methodId: method.id,\n status: 'planned',\n metadata: {},\n })\n order += 1\n }\n\n for (const [index, item] of options.items.entries()) {\n if (typeof item !== 'string') {\n const normalized = normalizeInstrumentRunItem(item, method.id, order, index)\n items.push(normalized)\n order = Math.max(order, normalized.order + 1)\n continue\n }\n const sampleId = idFromName(item, `sample-${index + 1}`)\n items.push({\n id: `${sampleId}-run`,\n order,\n kind: 'sample',\n sampleId,\n name: item,\n methodId: method.id,\n status: 'planned',\n metadata: {},\n })\n order += 1\n }\n\n if (options.includeQc !== false) {\n items.push({\n id: 'qc-end',\n order,\n kind: 'qc',\n name: 'QC end',\n methodId: method.id,\n status: 'planned',\n metadata: {},\n })\n }\n\n const data: InstrumentRunTemplateData = {\n runId: 'run-1',\n instrument: options.instrument,\n methods: [method],\n items,\n metadata: options.metadata ?? {},\n }\n validateInstrumentRunData(data)\n return createTemplateEnvelope('instrument-run', data, options.metadata ?? {})\n}\n","import { idFromName } from './builderIdUtils'\nimport { wellIdsForFormat } from '../components/WellPlate.geometry'\nimport {\n normalizeQpcrSample,\n normalizeQpcrTarget,\n} from './runNormalizers'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport { validateQpcrPlateData } from './templateValidators'\nimport type {\n CreateQpcrPlateTemplateOptions,\n QpcrPlateTemplate,\n QpcrPlateTemplateData,\n QpcrReaction,\n QpcrSample,\n QpcrTarget,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createQpcrPlateTemplate(\n options: CreateQpcrPlateTemplateOptions\n): QpcrPlateTemplate {\n const format = options.format ?? 96\n const replicates = options.replicates ?? 3\n if (replicates < 1) {\n throw new Error('qPCR replicates must be at least 1.')\n }\n\n const samples = options.samples.map((sample, index): QpcrSample => {\n if (typeof sample !== 'string') return normalizeQpcrSample(sample)\n return {\n sampleId: idFromName(sample, `sample-${index + 1}`),\n name: sample,\n metadata: {},\n }\n })\n const targets = options.targets.map((target, index): QpcrTarget => {\n if (typeof target !== 'string') return normalizeQpcrTarget(target)\n return {\n id: idFromName(target, `target-${index + 1}`),\n name: target,\n metadata: {},\n }\n })\n const wells = wellIdsForFormat(format)\n let wellIndex = 0\n const reactions: QpcrReaction[] = []\n\n for (const sample of samples) {\n for (const target of targets) {\n for (let replicate = 1; replicate <= replicates; replicate += 1) {\n const wellId = wells[wellIndex]\n if (!wellId) throw new Error(`qPCR plate format ${format} does not have enough wells.`)\n reactions.push({\n id: `${sample.sampleId}-${target.id}-r${replicate}`,\n wellId,\n sampleId: sample.sampleId,\n targetId: target.id,\n replicate,\n controlKind: 'sample',\n flags: [],\n metadata: {},\n })\n wellIndex += 1\n }\n }\n }\n\n if (options.includeNoTemplateControls !== false) {\n for (const target of targets) {\n const wellId = wells[wellIndex]\n if (!wellId) throw new Error(`qPCR plate format ${format} does not have enough wells.`)\n reactions.push({\n id: `ntc-${target.id}`,\n wellId,\n targetId: target.id,\n replicate: 1,\n controlKind: 'no-template',\n flags: [],\n metadata: {},\n })\n wellIndex += 1\n }\n }\n\n const data: QpcrPlateTemplateData = {\n plateId: 'qpcr-plate-1',\n format,\n samples,\n targets,\n reactions,\n instrument: options.instrument,\n chemistry: options.chemistry ?? 'sybr',\n metadata: options.metadata ?? {},\n }\n validateQpcrPlateData(data)\n return createTemplateEnvelope('qpcr-plate', data, options.metadata ?? {})\n}\n","import { createQpcrPlateTemplate } from './qpcrPlateBuilder'\nimport { createSampleSheetTemplate } from './sampleSheetBuilder'\nimport { presetSampleRecords } from './sampleNormalizers'\nimport { createTemplateCollection } from './templateEnvelopes'\nimport type {\n CreateQpcrExpressionCollectionOptions,\n TemplateCollectionEnvelope,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createQpcrExpressionCollection(\n options: CreateQpcrExpressionCollectionOptions = {}\n): TemplateCollectionEnvelope {\n const sampleRecords = presetSampleRecords(options.samples ?? ['Control', 'Treatment'])\n const sampleSheet = createSampleSheetTemplate({ samples: sampleRecords })\n const qpcr = createQpcrPlateTemplate({\n samples: sampleRecords.map(sample => ({\n sampleId: sample.sampleId,\n name: sample.name,\n group: sample.group,\n metadata: sample.metadata ?? {},\n })),\n targets: options.targets ?? ['ACTB', 'GAPDH'],\n chemistry: options.chemistry,\n format: options.format,\n includeNoTemplateControls: options.includeNoTemplateControls,\n replicates: options.replicates ?? 3,\n instrument: options.instrument,\n })\n return createTemplateCollection(\n [sampleSheet, qpcr],\n { preset: 'qpcr-expression', ...(options.metadata ?? {}) }\n )\n}\n","import { createAssayMatrixTemplate } from './assayMatrixBuilder'\nimport { createInstrumentRunTemplate } from './instrumentRunBuilder'\nimport { createSampleSheetTemplate } from './sampleSheetBuilder'\nimport { presetSampleRecords } from './sampleNormalizers'\nimport { createTemplateCollection } from './templateEnvelopes'\nimport type {\n CreateLcmsBatchCollectionOptions,\n TemplateCollectionEnvelope,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createLcmsBatchCollection(\n options: CreateLcmsBatchCollectionOptions = {}\n): TemplateCollectionEnvelope {\n const sampleRecords = presetSampleRecords(options.samples ?? ['S001', 'S002'])\n const sampleSheet = createSampleSheetTemplate({ samples: sampleRecords })\n const instrumentRun = createInstrumentRunTemplate({\n items: sampleRecords.map(sample => ({\n sampleId: sample.sampleId,\n name: sample.name ?? sample.sampleId,\n })),\n method: options.method ?? 'Default method',\n instrument: options.instrument ?? 'LC-MS',\n includeQc: options.includeQc,\n })\n const assayMatrix = createAssayMatrixTemplate({\n samples: sampleRecords.map(sample => ({\n sampleId: sample.sampleId,\n name: sample.name,\n group: sample.group,\n metadata: sample.metadata ?? {},\n })),\n features: options.features ?? ['Glucose', 'Lactate'],\n })\n return createTemplateCollection(\n [sampleSheet, instrumentRun, assayMatrix],\n { preset: 'lcms-batch', ...(options.metadata ?? {}) }\n )\n}\n","import type {\n AssayFeature,\n CalibrationPoint,\n InstrumentRunItemInput,\n ReagentTemplateInput,\n SampleRecord,\n} from './types'\nimport {\n normalizeAssayFeature,\n normalizeReagent,\n} from './assayNormalizers'\nimport { idFromName } from './builderIdUtils'\n\nexport function normalizeMetaboliteFeatures(\n metabolites: Array<string | AssayFeature>,\n responseUnit: string,\n): AssayFeature[] {\n return metabolites.map((metabolite, index) => {\n if (typeof metabolite === 'string') {\n return {\n id: idFromName(metabolite, `metabolite-${index + 1}`),\n name: metabolite,\n type: 'metabolite',\n unit: responseUnit,\n metadata: { quantitation: 'targeted' },\n }\n }\n\n const feature = normalizeAssayFeature(metabolite)\n return {\n ...feature,\n type: feature.type ?? 'metabolite',\n unit: feature.unit ?? responseUnit,\n metadata: {\n quantitation: 'targeted',\n ...feature.metadata,\n },\n }\n })\n}\n\nexport function normalizeInternalStandardReagents(\n internalStandards: Array<string | ReagentTemplateInput>,\n): ReagentTemplateInput[] {\n return internalStandards.map((standard, index) => {\n if (typeof standard === 'string') {\n return {\n id: idFromName(standard, `internal-standard-${index + 1}`),\n name: standard,\n kind: 'compound',\n metadata: { role: 'internal-standard' },\n }\n }\n\n const reagent = normalizeReagent(standard)\n return {\n ...reagent,\n kind: standard.kind ?? 'compound',\n metadata: {\n role: 'internal-standard',\n ...reagent.metadata,\n },\n }\n })\n}\n\nexport function targetedMetabolomicsRunItems(\n samples: SampleRecord[],\n calibrationPoints: CalibrationPoint[],\n includeQc: boolean,\n): InstrumentRunItemInput[] {\n const calibrationItems = calibrationPoints\n .filter(point => point.role !== 'qc' || includeQc)\n .filter(point => point.role === 'blank' || point.role === 'standard' || point.role === 'qc')\n .map((point): InstrumentRunItemInput => ({\n id: `${point.id}-run`,\n kind: calibrationRunItemKind(point.role),\n name: point.level,\n metadata: {\n concentration: point.concentration,\n unit: point.unit,\n role: point.role,\n },\n }))\n\n const sampleItems = samples.map((sample): InstrumentRunItemInput => ({\n sampleId: sample.sampleId,\n name: sample.name ?? sample.sampleId,\n kind: 'sample',\n }))\n\n return [...calibrationItems, ...sampleItems]\n}\n\nexport function firstFeatureName(features: AssayFeature[], fallback: string): string {\n return features.find(feature => feature.name)?.name ?? fallback\n}\n\nfunction calibrationRunItemKind(role: CalibrationPoint['role']): 'blank' | 'standard' | 'qc' {\n if (role === 'blank' || role === 'standard' || role === 'qc') return role\n return 'standard'\n}\n","import { createAssayMatrixTemplate } from './assayMatrixBuilder'\nimport { createCalibrationCurveTemplate } from './calibrationCurveBuilder'\nimport { createInstrumentRunTemplate } from './instrumentRunBuilder'\nimport { createReagentListTemplate } from './reagentListBuilder'\nimport { createSamplePrepTemplate } from './samplePrepBuilder'\nimport { createSampleSheetTemplate } from './sampleSheetBuilder'\nimport { presetSampleRecords } from './sampleNormalizers'\nimport {\n firstFeatureName,\n normalizeInternalStandardReagents,\n normalizeMetaboliteFeatures,\n targetedMetabolomicsRunItems,\n} from './targetedMetabolomicsHelpers'\nimport { createTemplateCollection } from './templateEnvelopes'\nimport type {\n CreateTargetedMetabolomicsCollectionOptions,\n TemplateCollectionEnvelope,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createTargetedMetabolomicsCollection(\n options: CreateTargetedMetabolomicsCollectionOptions = {}\n): TemplateCollectionEnvelope {\n const sampleRecords = presetSampleRecords(options.samples ?? ['S001', 'S002'])\n const responseUnit = options.responseUnit ?? 'peak area ratio'\n const concentrationUnit = options.concentrationUnit ?? 'uM'\n const metaboliteFeatures = normalizeMetaboliteFeatures(\n options.metabolites ?? ['Glucose', 'Lactate', 'Pyruvate'],\n responseUnit,\n )\n const sampleSheet = createSampleSheetTemplate({ samples: sampleRecords })\n const samplePrep = createSamplePrepTemplate({\n samples: sampleRecords.map(sample => sample.sampleId),\n prepType: options.prepType ?? 'extraction',\n protocolName: 'Metabolomics sample preparation',\n outputVolume: options.outputVolume ?? 50,\n metadata: { assay: 'targeted-metabolomics' },\n })\n const reagents = createReagentListTemplate({\n reagents: normalizeInternalStandardReagents(\n options.internalStandards ?? ['Stable isotope internal standard mix'],\n ),\n metadata: { assay: 'targeted-metabolomics' },\n })\n const calibrationCurve = createCalibrationCurveTemplate({\n concentrations: options.standardConcentrations ?? [0.1, 1, 10, 100],\n analyte: options.calibrationAnalyte ?? firstFeatureName(metaboliteFeatures, 'Metabolite panel'),\n unit: concentrationUnit,\n responseUnit,\n model: 'linear-weighted-1-x',\n includeQc: options.includeQc,\n metadata: { assay: 'targeted-metabolomics' },\n })\n const instrumentRun = createInstrumentRunTemplate({\n items: targetedMetabolomicsRunItems(\n sampleRecords,\n calibrationCurve.data.points,\n options.includeQc !== false,\n ),\n method: options.method ?? 'Targeted metabolomics',\n instrument: options.instrument ?? 'LC-MS',\n includeBlanks: false,\n includeQc: false,\n metadata: { assay: 'targeted-metabolomics' },\n })\n const assayMatrix = createAssayMatrixTemplate({\n samples: sampleRecords.map(sample => ({\n sampleId: sample.sampleId,\n name: sample.name,\n group: sample.group,\n metadata: sample.metadata ?? {},\n })),\n features: metaboliteFeatures,\n metadata: { assay: 'targeted-metabolomics', responseUnit },\n })\n return createTemplateCollection(\n [sampleSheet, samplePrep, reagents, instrumentRun, calibrationCurve, assayMatrix],\n { preset: 'targeted-metabolomics', ...(options.metadata ?? {}) }\n )\n}\n","import { createAssayMatrixTemplate } from './assayMatrixBuilder'\nimport { SAMPLE_COLOR_SCALE } from '../utils/color'\nimport { idFromName } from './builderIdUtils'\nimport { createCalibrationCurveTemplate } from './calibrationCurveBuilder'\nimport { createPlateMapTemplate } from './plateMapBuilder'\nimport { createSampleSheetTemplate } from './sampleSheetBuilder'\nimport { presetSampleRecords } from './sampleNormalizers'\nimport { createTemplateCollection } from './templateEnvelopes'\nimport type {\n CreateElisaAssayCollectionOptions,\n TemplateCollectionEnvelope,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createElisaAssayCollection(\n options: CreateElisaAssayCollectionOptions = {}\n): TemplateCollectionEnvelope {\n const sampleRecords = presetSampleRecords(options.samples ?? ['Control', 'Treatment'])\n const analyte = options.analyte ?? 'Analyte'\n const responseUnit = options.responseUnit ?? 'OD450'\n const plate = createPlateMapTemplate({\n name: options.plateName ?? 'ELISA plate',\n format: options.plateFormat ?? 96,\n samples: [\n { id: 'blank', name: 'Blank' },\n { id: 'standard', name: 'Standards' },\n { id: 'qc', name: 'QC' },\n ...sampleRecords.map((sample, index) => ({\n id: sample.sampleId,\n name: sample.name ?? sample.sampleId,\n color: SAMPLE_COLOR_SCALE[index % SAMPLE_COLOR_SCALE.length],\n })),\n ],\n })\n const sampleSheet = createSampleSheetTemplate({ samples: sampleRecords })\n const calibrationCurve = createCalibrationCurveTemplate({\n concentrations: options.standardConcentrations ?? [1000, 100, 10, 1],\n analyte,\n unit: options.unit ?? 'pg/mL',\n responseUnit,\n model: 'four-parameter-logistic',\n })\n const assayMatrix = createAssayMatrixTemplate({\n samples: sampleRecords.map(sample => ({\n sampleId: sample.sampleId,\n name: sample.name,\n group: sample.group,\n metadata: sample.metadata ?? {},\n })),\n features: [{\n id: idFromName(analyte, 'analyte'),\n name: analyte,\n type: 'protein',\n unit: responseUnit,\n metadata: {},\n }],\n metadata: { analyte, responseUnit },\n })\n return createTemplateCollection(\n [plate, sampleSheet, calibrationCurve, assayMatrix],\n { preset: 'elisa-assay', ...(options.metadata ?? {}) }\n )\n}\n","import { createAssayMatrixTemplate } from './assayMatrixBuilder'\nimport { createFlowCytometryPanelTemplate } from './flowCytometryPanelBuilder'\nimport { createSampleSheetTemplate } from './sampleSheetBuilder'\nimport { presetSampleRecords } from './sampleNormalizers'\nimport { createTemplateCollection } from './templateEnvelopes'\nimport type {\n CreateFlowCytometryAssayCollectionOptions,\n TemplateCollectionEnvelope,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createFlowCytometryAssayCollection(\n options: CreateFlowCytometryAssayCollectionOptions = {}\n): TemplateCollectionEnvelope {\n const sampleRecords = presetSampleRecords(options.samples ?? ['Control', 'Treatment'])\n const markers = options.markers ?? ['CD3', 'CD4', 'CD8']\n const sampleSheet = createSampleSheetTemplate({ samples: sampleRecords })\n const flowPanel = createFlowCytometryPanelTemplate({\n markers,\n instrument: options.instrument ?? 'Flow cytometer',\n includeDefaultControls: options.includeDefaultControls,\n })\n const assayMatrix = createAssayMatrixTemplate({\n samples: sampleRecords.map(sample => ({\n sampleId: sample.sampleId,\n name: sample.name,\n group: sample.group,\n metadata: sample.metadata ?? {},\n })),\n features: options.features ?? flowPanel.data.markers.map(marker => ({\n id: marker.id,\n name: `${marker.marker}+ cells`,\n type: 'cell',\n unit: '%',\n metadata: { marker: marker.marker, fluorophore: marker.fluorophore },\n })),\n })\n return createTemplateCollection(\n [sampleSheet, flowPanel, assayMatrix],\n { preset: 'flow-cytometry-assay', ...(options.metadata ?? {}) }\n )\n}\n","import { createAssayMatrixTemplate } from './assayMatrixBuilder'\nimport { idFromName } from './builderIdUtils'\nimport { createProtocolStepsTemplate } from './protocolStepsBuilder'\nimport { createReagentListTemplate } from './reagentListBuilder'\nimport { createSampleSheetTemplate } from './sampleSheetBuilder'\nimport { presetSampleRecords } from './sampleNormalizers'\nimport { createTemplateCollection } from './templateEnvelopes'\nimport type {\n CreateWesternBlotAssayCollectionOptions,\n TemplateCollectionEnvelope,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createWesternBlotAssayCollection(\n options: CreateWesternBlotAssayCollectionOptions = {}\n): TemplateCollectionEnvelope {\n const sampleRecords = presetSampleRecords(options.samples ?? ['Control', 'Treatment'])\n const loadingControl = options.loadingControl ?? 'ACTB'\n const targetNames = (options.targets ?? ['Target protein']).map(target =>\n typeof target === 'string' ? target : target.name ?? target.id\n )\n const featureNames = loadingControl && !targetNames.includes(loadingControl)\n ? [...targetNames, loadingControl]\n : targetNames\n const sampleSheet = createSampleSheetTemplate({ samples: sampleRecords })\n const reagentList = createReagentListTemplate({\n reagents: [\n { id: 'primary-antibody', name: 'Primary antibody', kind: 'antibody', storageCondition: '4C' },\n { id: 'secondary-antibody', name: 'Secondary antibody', kind: 'antibody', storageCondition: '4C' },\n { id: 'lysis-buffer', name: 'Lysis buffer', kind: 'buffer', storageCondition: '4C' },\n { id: 'blocking-buffer', name: 'Blocking buffer', kind: 'buffer', storageCondition: '4C' },\n { id: 'wash-buffer', name: 'TBST wash buffer', kind: 'buffer', storageCondition: 'RT' },\n { id: 'substrate', name: 'Detection substrate', kind: 'reagent', storageCondition: '4C' },\n ],\n metadata: { assay: 'western-blot' },\n })\n const protocol = createProtocolStepsTemplate({\n steps: [\n { id: 'lyse-samples', type: 'addition', name: 'Lyse samples', duration: 30 },\n { id: 'run-gel', type: 'custom', name: 'Run SDS-PAGE', duration: 90 },\n { id: 'transfer', type: 'transfer', name: 'Transfer to membrane', duration: 60 },\n { id: 'block', type: 'incubation', name: 'Block membrane', duration: 60 },\n { id: 'primary-antibody', type: 'incubation', name: 'Primary antibody incubation', duration: 960 },\n { id: 'secondary-antibody', type: 'incubation', name: 'Secondary antibody incubation', duration: 60 },\n { id: 'detect', type: 'measurement', name: 'Detect and quantify bands', duration: 30 },\n ],\n metadata: { assay: 'western-blot' },\n })\n const assayMatrix = createAssayMatrixTemplate({\n samples: sampleRecords.map(sample => ({\n sampleId: sample.sampleId,\n name: sample.name,\n group: sample.group,\n metadata: sample.metadata ?? {},\n })),\n features: featureNames.map((feature, index) => ({\n id: idFromName(feature, `feature-${index + 1}`),\n name: feature,\n type: 'protein',\n unit: 'relative intensity',\n metadata: { loadingControl: feature === loadingControl },\n })),\n metadata: { assay: 'western-blot', loadingControl },\n })\n return createTemplateCollection(\n [sampleSheet, reagentList, protocol, assayMatrix],\n { preset: 'western-blot-assay', ...(options.metadata ?? {}) }\n )\n}\n","import { getBioTemplateInfo } from './catalog'\nimport { createAssayMatrixTemplate } from './assayMatrixBuilder'\nimport { createCalibrationCurveTemplate } from './calibrationCurveBuilder'\nimport { createDoseResponseTemplate } from './doseResponseBuilder'\nimport { createFlowCytometryPanelTemplate } from './flowCytometryPanelBuilder'\nimport { createInstrumentRunTemplate } from './instrumentRunBuilder'\nimport { createPlateMapTemplate } from './plateMapBuilder'\nimport { createProtocolStepsTemplate } from './protocolStepsBuilder'\nimport { createQpcrPlateTemplate } from './qpcrPlateBuilder'\nimport { createReagentListTemplate } from './reagentListBuilder'\nimport { createSamplePrepTemplate } from './samplePrepBuilder'\nimport { createSampleSheetTemplate } from './sampleSheetBuilder'\nimport { createTimeCourseTemplate } from './timeCourseBuilder'\nimport type {\n BioTemplateEnvelope,\n TemplateId,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createDefaultBioTemplate(templateId: TemplateId | string): BioTemplateEnvelope<unknown> {\n const template = getBioTemplateInfo(templateId)\n if (!template) {\n throw new Error(`Unknown bio template '${templateId}'.`)\n }\n\n switch (template.template_id) {\n case 'plate-map':\n return createPlateMapTemplate({\n name: 'Plate 1',\n samples: ['Control', 'Treatment'],\n })\n case 'sample-sheet':\n return createSampleSheetTemplate({\n samples: [\n { sampleId: 'S001', name: 'Control 1', group: 'Control' },\n { sampleId: 'S002', name: 'Treatment 1', group: 'Treatment' },\n ],\n })\n case 'sample-prep':\n return createSamplePrepTemplate({\n samples: ['S001', 'S002'],\n prepType: 'extraction',\n outputVolume: 50,\n })\n case 'dose-response':\n return createDoseResponseTemplate({\n compounds: {\n 'Compound A': [10, 1, 0.1],\n },\n unit: 'uM',\n replicates: 3,\n })\n case 'calibration-curve':\n return createCalibrationCurveTemplate({\n concentrations: [0.1, 1, 10, 100],\n analyte: 'Analyte',\n unit: 'uM',\n })\n case 'time-course':\n return createTimeCourseTemplate({\n timepoints: [0, 6, 24],\n unit: 'hour',\n conditions: ['Control', 'Treatment'],\n replicates: 3,\n })\n case 'protocol-steps':\n return createProtocolStepsTemplate({\n steps: [\n {\n id: 'seed-cells',\n type: 'addition',\n name: 'Seed cells',\n description: 'Add cells to wells or culture vessels.',\n duration: 15,\n },\n {\n id: 'incubate-overnight',\n type: 'incubation',\n name: 'Incubate overnight',\n duration: 960,\n parameters: { temperature: '37 C', co2: '5%' },\n },\n {\n id: 'measure-readout',\n type: 'measurement',\n name: 'Measure readout',\n duration: 45,\n },\n ],\n })\n case 'assay-matrix':\n return createAssayMatrixTemplate({\n samples: ['S001', 'S002'],\n features: ['Lactate', 'Glucose'],\n values: {\n s001: { lactate: 1.2, glucose: 5.4 },\n s002: { lactate: 2.1, glucose: 4.8 },\n },\n })\n case 'reagent-list':\n return createReagentListTemplate({\n reagents: ['DMSO', 'Compound A', 'Anti-HA antibody'],\n })\n case 'flow-cytometry-panel':\n return createFlowCytometryPanelTemplate({\n markers: ['CD3', 'CD4', 'CD8'],\n instrument: 'BD LSRFortessa',\n })\n case 'instrument-run':\n return createInstrumentRunTemplate({\n items: ['S001', 'S002'],\n instrument: 'LC-MS',\n method: 'Default method',\n })\n case 'qpcr-plate':\n return createQpcrPlateTemplate({\n samples: ['Control', 'Treatment'],\n targets: ['ACTB', 'GAPDH'],\n replicates: 3,\n instrument: 'QuantStudio',\n })\n default:\n throw new Error(`Unknown bio template '${templateId}'.`)\n }\n}\n","import { getBioTemplatePackInfo } from './packs'\nimport { createDefaultBioTemplate } from './defaultBioTemplateBuilder'\nimport { createTemplateCollection } from './templateEnvelopes'\nimport type {\n CreateBioTemplatePackCollectionOptions,\n TemplateCollectionEnvelope,\n TemplatePackId,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createBioTemplatePackCollection(\n name: TemplatePackId | string,\n options: CreateBioTemplatePackCollectionOptions = {},\n): TemplateCollectionEnvelope {\n const pack = getBioTemplatePackInfo(name)\n if (!pack) {\n throw new Error(`Unknown template pack '${name}'.`)\n }\n\n return createTemplateCollection(\n pack.templates.map(templateId => createDefaultBioTemplate(templateId)),\n { pack: pack.name, ...(options.metadata ?? {}) },\n )\n}\n","import { SAMPLE_COLOR_SCALE } from '../utils/color'\nimport { createDoseResponseTemplate } from './doseResponseBuilder'\nimport { createPlateMapTemplate } from './plateMapBuilder'\nimport { createSampleSheetTemplate } from './sampleSheetBuilder'\nimport { presetSampleRecords } from './sampleNormalizers'\nimport { createTemplateCollection } from './templateEnvelopes'\nimport type {\n CreateWellPlateScreenCollectionOptions,\n TemplateCollectionEnvelope,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createWellPlateScreenCollection(\n options: CreateWellPlateScreenCollectionOptions = {}\n): TemplateCollectionEnvelope {\n const sampleRecords = presetSampleRecords(options.samples ?? ['Control', 'Treatment'])\n const plate = createPlateMapTemplate({\n name: options.plateName ?? 'Screen plate',\n format: options.plateFormat ?? 96,\n samples: sampleRecords.map((sample, index) => ({\n id: sample.sampleId,\n name: sample.name ?? sample.sampleId,\n color: SAMPLE_COLOR_SCALE[index % SAMPLE_COLOR_SCALE.length],\n })),\n })\n const sampleSheet = createSampleSheetTemplate({ samples: sampleRecords })\n const doseResponse = createDoseResponseTemplate({\n compounds: options.compounds ?? { 'Compound A': [10, 1, 0.1] },\n unit: options.unit ?? 'uM',\n replicates: options.replicates ?? 3,\n layout: plate,\n })\n return createTemplateCollection(\n [plate, sampleSheet, doseResponse],\n { preset: 'wellplate-screen', ...(options.metadata ?? {}) }\n )\n}\n","import { bioTemplatePresetControlValuesToOptions } from './builderPresetControls'\nimport type { BioTemplateControlValues } from './builderPresetControls'\nimport { createElisaAssayCollection } from './elisaAssayCollectionBuilder'\nimport { createFlowCytometryAssayCollection } from './flowCytometryAssayCollectionBuilder'\nimport { createLcmsBatchCollection } from './lcmsBatchCollectionBuilder'\nimport { getBioTemplatePresetInfo } from './presets'\nimport { createQpcrExpressionCollection } from './qpcrExpressionCollectionBuilder'\nimport { createTargetedMetabolomicsCollection } from './targetedMetabolomicsCollectionBuilder'\nimport { createWellPlateScreenCollection } from './wellPlateScreenCollectionBuilder'\nimport { createWesternBlotAssayCollection } from './westernBlotAssayCollectionBuilder'\nimport type {\n CreateElisaAssayCollectionOptions,\n CreateFlowCytometryAssayCollectionOptions,\n CreateLcmsBatchCollectionOptions,\n CreateQpcrExpressionCollectionOptions,\n CreateTargetedMetabolomicsCollectionOptions,\n CreateWellPlateScreenCollectionOptions,\n CreateWesternBlotAssayCollectionOptions,\n TemplateCollectionEnvelope,\n TemplatePresetId,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createBioTemplatePresetCollection(\n name: 'wellplate-screen',\n options?: CreateWellPlateScreenCollectionOptions\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollection(\n name: 'qpcr-expression',\n options?: CreateQpcrExpressionCollectionOptions\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollection(\n name: 'lcms-batch',\n options?: CreateLcmsBatchCollectionOptions\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollection(\n name: 'targeted-metabolomics',\n options?: CreateTargetedMetabolomicsCollectionOptions\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollection(\n name: 'elisa-assay',\n options?: CreateElisaAssayCollectionOptions\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollection(\n name: 'flow-cytometry-assay',\n options?: CreateFlowCytometryAssayCollectionOptions\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollection(\n name: 'western-blot-assay',\n options?: CreateWesternBlotAssayCollectionOptions\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollection(\n name: string,\n options?:\n | CreateWellPlateScreenCollectionOptions\n | CreateQpcrExpressionCollectionOptions\n | CreateLcmsBatchCollectionOptions\n | CreateTargetedMetabolomicsCollectionOptions\n | CreateElisaAssayCollectionOptions\n | CreateFlowCytometryAssayCollectionOptions\n | CreateWesternBlotAssayCollectionOptions\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollection(\n name: TemplatePresetId | string,\n options:\n | CreateWellPlateScreenCollectionOptions\n | CreateQpcrExpressionCollectionOptions\n | CreateLcmsBatchCollectionOptions\n | CreateTargetedMetabolomicsCollectionOptions\n | CreateElisaAssayCollectionOptions\n | CreateFlowCytometryAssayCollectionOptions\n | CreateWesternBlotAssayCollectionOptions = {}\n): TemplateCollectionEnvelope {\n const preset = getBioTemplatePresetInfo(name)\n if (!preset) {\n throw new Error(`Unknown template preset '${name}'.`)\n }\n if (preset.name === 'wellplate-screen') {\n return createWellPlateScreenCollection(options as CreateWellPlateScreenCollectionOptions)\n }\n if (preset.name === 'qpcr-expression') {\n return createQpcrExpressionCollection(options as CreateQpcrExpressionCollectionOptions)\n }\n if (preset.name === 'lcms-batch') {\n return createLcmsBatchCollection(options as CreateLcmsBatchCollectionOptions)\n }\n if (preset.name === 'targeted-metabolomics') {\n return createTargetedMetabolomicsCollection(options as CreateTargetedMetabolomicsCollectionOptions)\n }\n if (preset.name === 'elisa-assay') {\n return createElisaAssayCollection(options as CreateElisaAssayCollectionOptions)\n }\n if (preset.name === 'flow-cytometry-assay') {\n return createFlowCytometryAssayCollection(options as CreateFlowCytometryAssayCollectionOptions)\n }\n if (preset.name === 'western-blot-assay') {\n return createWesternBlotAssayCollection(options as CreateWesternBlotAssayCollectionOptions)\n }\n throw new Error(`Unknown template preset '${name}'.`)\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createBioTemplatePresetCollectionFromControls(\n name: 'wellplate-screen',\n values: BioTemplateControlValues\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollectionFromControls(\n name: 'qpcr-expression',\n values: BioTemplateControlValues\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollectionFromControls(\n name: 'lcms-batch',\n values: BioTemplateControlValues\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollectionFromControls(\n name: 'targeted-metabolomics',\n values: BioTemplateControlValues\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollectionFromControls(\n name: 'elisa-assay',\n values: BioTemplateControlValues\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollectionFromControls(\n name: 'flow-cytometry-assay',\n values: BioTemplateControlValues\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollectionFromControls(\n name: 'western-blot-assay',\n values: BioTemplateControlValues\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollectionFromControls(\n name: TemplatePresetId | string,\n values: BioTemplateControlValues\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollectionFromControls(\n name: TemplatePresetId | string,\n values: BioTemplateControlValues\n): TemplateCollectionEnvelope {\n const options = bioTemplatePresetControlValuesToOptions(name, values)\n return createBioTemplatePresetCollection(name, options)\n}\n","import type {\n BioTemplateControlSchema,\n} from './controlSchemaTypes'\n\nexport function cloneSchemaMap<TName extends string>(\n schemas: Record<TName, BioTemplateControlSchema>\n): Record<TName, BioTemplateControlSchema> {\n const result = {} as Record<TName, BioTemplateControlSchema>\n for (const name of Object.keys(schemas) as TName[]) {\n result[name] = cloneControlSchema(schemas[name])\n }\n return result\n}\n\nexport function cloneControlSchema(schema: BioTemplateControlSchema): BioTemplateControlSchema {\n return Object.fromEntries(\n Object.entries(schema).map(([name, definition]) => [name, cloneControlDefinition(definition)])\n )\n}\n\nexport function cloneControlDefinition(\n definition: BioTemplateControlSchema[string]\n): BioTemplateControlSchema[string] {\n return {\n ...definition,\n options: definition.options ? [...definition.options] : undefined,\n props: definition.props ? { ...definition.props } : undefined,\n sidebar: typeof definition.sidebar === 'object' && definition.sidebar !== null\n ? { ...definition.sidebar }\n : definition.sidebar,\n }\n}\n","import {\n getBioTemplateInfo,\n} from './catalog'\nimport {\n cloneControlDefinition,\n} from './controlSchemaClone'\nimport type {\n BioTemplateControlSchema,\n} from './controlSchemaTypes'\nimport type {\n TemplateId,\n} from './types'\n\nexport function mergeTemplateControlSchemas(\n templateIds: TemplateId[],\n templateSchemas: Record<TemplateId, BioTemplateControlSchema>\n): BioTemplateControlSchema {\n const merged: BioTemplateControlSchema = {}\n for (const templateId of templateIds) {\n const schema = templateSchemas[templateId]\n const template = getBioTemplateInfo(templateId)\n for (const [name, definition] of Object.entries(schema)) {\n const key = `${camelize(templateId)}${capitalize(name)}`\n merged[key] = {\n ...cloneControlDefinition(definition),\n section: definition.section ?? templateId,\n sectionLabel: definition.sectionLabel ?? template?.label ?? templateId,\n }\n }\n }\n return merged\n}\n\nfunction camelize(value: string): string {\n return value.replace(/-([a-z0-9])/g, (_, char: string) => char.toUpperCase())\n}\n\nfunction capitalize(value: string): string {\n return value.charAt(0).toUpperCase() + value.slice(1)\n}\n","import { isObjectLike as isRecord } from '../utils/records'\nimport {\n getBioTemplateInfo,\n} from './catalog'\nimport {\n getBioTemplatePackInfo,\n} from './packs'\nimport {\n getBioTemplatePresetInfo,\n} from './presets'\nimport {\n extractTemplateCollection,\n} from './templateEnvelopes'\nimport type {\n BioTemplateEnvelope,\n TemplateId,\n TemplatePresetId,\n} from './types'\nimport type {\n BioTemplateControlTarget,\n} from './controlSchemaTypes'\n\nexport type ControlSchemaResolvedTarget =\n | { kind: 'template'; name: TemplateId }\n | { kind: 'pack'; templates: TemplateId[] }\n | { kind: 'preset'; name: TemplatePresetId }\n | { kind: 'collection'; templates: TemplateId[] }\n\nexport function resolveControlSchemaTarget(\n target: BioTemplateControlTarget\n): ControlSchemaResolvedTarget | undefined {\n if (typeof target === 'string') {\n const preset = getBioTemplatePresetInfo(target)\n if (preset) return { kind: 'preset', name: preset.name }\n const pack = getBioTemplatePackInfo(target)\n if (pack) return { kind: 'pack', templates: [...pack.templates] }\n const template = getBioTemplateInfo(target)\n if (template) return { kind: 'template', name: template.template_id }\n return undefined\n }\n\n if (isTemplateEnvelope(target)) {\n const template = getBioTemplateInfo(target.template_id)\n return template ? { kind: 'template', name: template.template_id } : undefined\n }\n\n const presetName = collectionPresetName(target)\n if (presetName) {\n const preset = getBioTemplatePresetInfo(presetName)\n if (preset) return { kind: 'preset', name: preset.name }\n }\n\n const packName = collectionPackName(target)\n if (packName) {\n const pack = getBioTemplatePackInfo(packName)\n if (pack) return { kind: 'pack', templates: [...pack.templates] }\n }\n\n const collection = extractTemplateCollection(target)\n const templateIds = Object.keys(collection)\n .map(id => getBioTemplateInfo(id)?.template_id)\n .filter((id): id is TemplateId => id !== undefined)\n return templateIds.length > 0 ? { kind: 'collection', templates: templateIds } : undefined\n}\n\nexport function describeControlTarget(target: BioTemplateControlTarget): string {\n if (typeof target === 'string') return target\n if (isTemplateEnvelope(target)) return target.template_id\n return collectionPresetName(target) ?? collectionPackName(target) ?? 'template collection'\n}\n\nfunction isTemplateEnvelope(value: unknown): value is BioTemplateEnvelope<unknown> {\n return isRecord(value) && typeof value.template_id === 'string' && 'data' in value\n}\n\nfunction collectionPresetName(value: unknown): string | undefined {\n if (!isRecord(value) || !isRecord(value.metadata)) return undefined\n return typeof value.metadata.preset === 'string' ? value.metadata.preset : undefined\n}\n\nfunction collectionPackName(value: unknown): string | undefined {\n if (!isRecord(value) || !isRecord(value.metadata)) return undefined\n return typeof value.metadata.pack === 'string' ? value.metadata.pack : undefined\n}\n\n","export const ICONS = {\n plate: ['M4 4h16v16H4z', 'M8 4v16', 'M12 4v16', 'M16 4v16', 'M4 8h16', 'M4 12h16', 'M4 16h16'],\n samples: ['M16 21v-2a4 4 0 0 0-8 0v2', 'M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8'],\n dose: ['M10 2v8L4 20h16l-6-10V2', 'M8 2h8', 'M7 14h10'],\n table: ['M3 5h18', 'M3 12h18', 'M3 19h18', 'M8 5v14', 'M16 5v14'],\n run: ['M4 17l6-6 4 4 6-8', 'M4 21h16'],\n settings: ['M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8', 'M4 12h2', 'M18 12h2', 'M12 4v2', 'M12 18v2'],\n}\n\nexport const PLATE_FORMAT_OPTIONS = [6, 12, 24, 48, 96, 384] as const\nexport const CONCENTRATION_UNITS = ['nM', 'uM', 'mM', 'ug/mL', 'mg/mL'] as const\n","import {\n CONCENTRATION_UNITS,\n ICONS,\n PLATE_FORMAT_OPTIONS,\n} from './controlSchemaConstants'\nimport type {\n BioTemplateControlSchema,\n} from './controlSchemaTypes'\nimport type {\n TemplateId,\n} from './types'\n\nexport const templateControlSchemas = {\n 'plate-map': {\n plateName: {\n label: 'Plate name',\n default: 'Plate 1',\n section: 'layout',\n sectionLabel: 'Layout',\n sectionSubtitle: 'Plate geometry',\n view: 'design',\n sidebar: { icon: ICONS.plate, iconColor: '#6366f1', iconBg: '#e0e7ff' },\n },\n plateFormat: {\n label: 'Format',\n default: 96,\n options: PLATE_FORMAT_OPTIONS,\n section: 'layout',\n view: 'design',\n },\n sampleNames: {\n type: 'tags',\n label: 'Samples',\n default: ['Control', 'Treatment'],\n section: 'samples',\n sectionLabel: 'Samples',\n sectionSubtitle: 'Groups and legend',\n view: 'design',\n sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },\n },\n },\n 'sample-sheet': {\n sampleCount: {\n type: 'number',\n label: 'Sample count',\n default: 2,\n min: 1,\n max: 10000,\n section: 'samples',\n sectionLabel: 'Samples',\n sectionSubtitle: 'Metadata table',\n view: 'design',\n sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },\n },\n includeGroups: {\n label: 'Include groups',\n default: true,\n section: 'samples',\n view: 'design',\n },\n includeBatch: {\n label: 'Include batch',\n default: false,\n section: 'columns',\n sectionLabel: 'Columns',\n view: 'design',\n sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },\n },\n },\n 'sample-prep': {\n prepType: {\n label: 'Prep type',\n default: 'extraction',\n options: ['extraction', 'dilution', 'normalization', 'transfer', 'quench', 'custom'],\n section: 'protocol',\n sectionLabel: 'Protocol',\n sectionSubtitle: 'Prep workflow',\n view: 'design',\n sidebar: { icon: ICONS.run, iconColor: '#f97316', iconBg: '#ffedd5' },\n },\n volumeUnit: {\n label: 'Volume unit',\n default: 'uL',\n options: ['uL', 'mL'],\n section: 'protocol',\n view: 'design',\n },\n outputVolume: {\n type: 'number',\n label: 'Output volume',\n default: 50,\n min: 0,\n section: 'protocol',\n view: 'design',\n },\n },\n 'dose-response': {\n unit: {\n label: 'Dose unit',\n default: 'uM',\n options: CONCENTRATION_UNITS,\n section: 'dose',\n sectionLabel: 'Dose Design',\n sectionSubtitle: 'Concentration series',\n view: 'design',\n sidebar: { icon: ICONS.dose, iconColor: '#8b5cf6', iconBg: '#ede9fe' },\n },\n replicates: {\n type: 'number',\n label: 'Replicates',\n default: 3,\n min: 1,\n max: 24,\n section: 'dose',\n view: 'design',\n },\n includePlateLayout: {\n label: 'Create plate layout',\n default: true,\n section: 'layout',\n sectionLabel: 'Layout',\n sectionSubtitle: 'Well assignment',\n view: 'design',\n sidebar: { icon: ICONS.plate, iconColor: '#6366f1', iconBg: '#e0e7ff', defaultOpen: false },\n },\n },\n 'calibration-curve': {\n analyte: {\n label: 'Analyte',\n default: 'Analyte',\n section: 'standards',\n sectionLabel: 'Standards',\n sectionSubtitle: 'Curve setup',\n view: 'analysis',\n sidebar: { icon: ICONS.dose, iconColor: '#8b5cf6', iconBg: '#ede9fe' },\n },\n model: {\n label: 'Model',\n default: 'linear',\n options: ['linear', 'linear-weighted-1-x', 'linear-weighted-1-x2', 'quadratic', 'four-parameter-logistic'],\n section: 'fit',\n sectionLabel: 'Fit',\n view: 'analysis',\n sidebar: { icon: ICONS.settings, iconColor: '#6366f1', iconBg: '#e0e7ff' },\n },\n minRSquared: {\n type: 'number',\n label: 'Minimum R squared',\n default: 0.99,\n min: 0,\n max: 1,\n props: { step: 0.001 },\n section: 'fit',\n view: 'analysis',\n },\n },\n 'time-course': {\n timeUnit: {\n label: 'Time unit',\n default: 'hour',\n options: ['second', 'minute', 'hour', 'day', 'week'],\n section: 'schedule',\n sectionLabel: 'Schedule',\n sectionSubtitle: 'Sampling timeline',\n view: 'design',\n sidebar: { icon: ICONS.run, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },\n },\n replicates: {\n type: 'number',\n label: 'Replicates',\n default: 3,\n min: 1,\n max: 24,\n section: 'samples',\n sectionLabel: 'Samples',\n view: 'design',\n sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },\n },\n },\n 'protocol-steps': {\n defaultDuration: {\n type: 'number',\n label: 'Default duration',\n default: 30,\n min: 0,\n section: 'protocol',\n sectionLabel: 'Protocol',\n sectionSubtitle: 'Step defaults',\n view: 'design',\n sidebar: { icon: ICONS.run, iconColor: '#f97316', iconBg: '#ffedd5' },\n props: { suffix: 'min' },\n },\n editable: {\n label: 'Editable timeline',\n default: true,\n section: 'protocol',\n view: 'design',\n },\n },\n 'assay-matrix': {\n featureType: {\n label: 'Feature type',\n default: 'metabolite',\n options: ['metabolite', 'protein', 'gene', 'cell', 'compound', 'readout', 'other'],\n section: 'features',\n sectionLabel: 'Features',\n sectionSubtitle: 'Measurement matrix',\n view: 'analysis',\n sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },\n },\n normalizeValues: {\n label: 'Normalize values',\n default: false,\n section: 'analysis',\n sectionLabel: 'Analysis',\n view: 'analysis',\n sidebar: { icon: ICONS.settings, iconColor: '#6366f1', iconBg: '#e0e7ff', defaultOpen: false },\n },\n },\n 'reagent-list': {\n reagentKind: {\n label: 'Reagent kind',\n default: 'reagent',\n options: ['compound', 'antibody', 'primer', 'enzyme', 'buffer', 'media', 'kit', 'reagent', 'other'],\n section: 'inventory',\n sectionLabel: 'Inventory',\n sectionSubtitle: 'Reagent metadata',\n view: 'design',\n sidebar: { icon: ICONS.table, iconColor: '#10b981', iconBg: '#d1fae5' },\n },\n trackStock: {\n label: 'Track stock level',\n default: true,\n section: 'inventory',\n view: 'design',\n },\n },\n 'flow-cytometry-panel': {\n markers: {\n type: 'tags',\n label: 'Markers',\n default: ['CD3', 'CD4', 'CD8'],\n section: 'panel',\n sectionLabel: 'Panel',\n sectionSubtitle: 'Markers and controls',\n view: 'design',\n sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },\n },\n instrument: {\n label: 'Instrument',\n default: 'Flow cytometer',\n section: 'panel',\n sectionLabel: 'Panel',\n sectionSubtitle: 'Markers and controls',\n view: 'design',\n sidebar: { icon: ICONS.settings, iconColor: '#6366f1', iconBg: '#e0e7ff' },\n },\n includeDefaultControls: {\n label: 'Default controls',\n default: true,\n section: 'panel',\n view: 'design',\n },\n },\n 'instrument-run': {\n instrument: {\n label: 'Instrument',\n default: 'LC-MS',\n options: ['LC-MS', 'GC-MS', 'Orbitrap', 'Triple quadrupole', 'Plate reader', 'Other'],\n section: 'acquisition',\n sectionLabel: 'Acquisition',\n sectionSubtitle: 'Run queue',\n view: 'run',\n sidebar: { icon: ICONS.run, iconColor: '#ef4444', iconBg: '#fee2e2' },\n },\n method: {\n label: 'Method',\n default: 'Default method',\n section: 'acquisition',\n view: 'run',\n },\n includeQc: {\n label: 'Include QC',\n default: true,\n section: 'quality',\n sectionLabel: 'Quality Control',\n view: 'run',\n sidebar: { icon: ICONS.settings, iconColor: '#6366f1', iconBg: '#e0e7ff', defaultOpen: false },\n },\n },\n 'qpcr-plate': {\n chemistry: {\n label: 'Chemistry',\n default: 'sybr',\n options: ['sybr', 'taqman', 'probe', 'evagreen', 'other'],\n section: 'assay',\n sectionLabel: 'Assay',\n sectionSubtitle: 'qPCR setup',\n view: 'design',\n sidebar: { icon: ICONS.plate, iconColor: '#6366f1', iconBg: '#e0e7ff' },\n },\n replicates: {\n type: 'number',\n label: 'Replicates',\n default: 3,\n min: 1,\n max: 12,\n section: 'assay',\n view: 'design',\n },\n includeNoTemplateControls: {\n label: 'No-template controls',\n default: true,\n section: 'controls',\n sectionLabel: 'Controls',\n view: 'design',\n sidebar: { icon: ICONS.settings, iconColor: '#8b5cf6', iconBg: '#ede9fe', defaultOpen: false },\n },\n },\n} satisfies Record<TemplateId, BioTemplateControlSchema>\n","import {\n CONCENTRATION_UNITS,\n ICONS,\n PLATE_FORMAT_OPTIONS,\n} from './controlSchemaConstants'\nimport type {\n BioTemplateControlSchema,\n} from './controlSchemaTypes'\nimport {\n templateControlSchemas,\n} from './templateControlSchemas'\nimport type {\n TemplatePresetId,\n} from './types'\n\nexport const presetControlSchemas = {\n 'wellplate-screen': {\n ...templateControlSchemas['plate-map'],\n ...templateControlSchemas['dose-response'],\n sampleNames: {\n ...templateControlSchemas['plate-map'].sampleNames,\n default: ['Control', 'Treatment'],\n },\n },\n 'qpcr-expression': {\n sampleNames: {\n type: 'tags',\n label: 'Samples',\n default: ['Control', 'Treatment'],\n section: 'samples',\n sectionLabel: 'Samples',\n sectionSubtitle: 'Expression groups',\n view: 'design',\n sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },\n },\n targets: {\n type: 'tags',\n label: 'Targets',\n default: ['ACTB', 'GAPDH'],\n section: 'assay',\n sectionLabel: 'Assay',\n view: 'design',\n sidebar: { icon: ICONS.plate, iconColor: '#6366f1', iconBg: '#e0e7ff' },\n },\n ...templateControlSchemas['qpcr-plate'],\n },\n 'lcms-batch': {\n sampleNames: {\n type: 'tags',\n label: 'Samples',\n default: ['S001', 'S002'],\n section: 'samples',\n sectionLabel: 'Samples',\n sectionSubtitle: 'Batch samples',\n view: 'run',\n sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },\n },\n featureNames: {\n type: 'tags',\n label: 'Features',\n default: ['Glucose', 'Lactate'],\n section: 'features',\n sectionLabel: 'Features',\n view: 'analysis',\n sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },\n },\n ...templateControlSchemas['instrument-run'],\n ...templateControlSchemas['assay-matrix'],\n },\n 'targeted-metabolomics': {\n sampleNames: {\n type: 'tags',\n label: 'Samples',\n default: ['S001', 'S002'],\n section: 'samples',\n sectionLabel: 'Samples',\n sectionSubtitle: 'Unknowns and QC pool',\n view: 'run',\n sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },\n },\n metaboliteNames: {\n type: 'tags',\n label: 'Metabolites',\n default: ['Glucose', 'Lactate', 'Pyruvate'],\n section: 'features',\n sectionLabel: 'Metabolites',\n sectionSubtitle: 'Quantitation panel',\n view: 'analysis',\n sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },\n },\n internalStandards: {\n type: 'tags',\n label: 'Internal standards',\n default: ['Stable isotope internal standard mix'],\n section: 'standards',\n sectionLabel: 'Standards',\n sectionSubtitle: 'Calibration and internal standards',\n view: 'analysis',\n sidebar: { icon: ICONS.dose, iconColor: '#8b5cf6', iconBg: '#ede9fe' },\n },\n standardConcentrations: {\n type: 'tags',\n label: 'Calibration levels',\n default: ['0.1', '1', '10', '100'],\n section: 'standards',\n view: 'analysis',\n },\n concentrationUnit: {\n label: 'Concentration unit',\n default: 'uM',\n options: CONCENTRATION_UNITS,\n section: 'standards',\n view: 'analysis',\n },\n responseUnit: {\n label: 'Response unit',\n default: 'peak area ratio',\n section: 'readout',\n sectionLabel: 'Readout',\n view: 'analysis',\n sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },\n },\n instrument: {\n ...templateControlSchemas['instrument-run'].instrument,\n default: 'LC-MS',\n },\n method: {\n ...templateControlSchemas['instrument-run'].method,\n default: 'Targeted metabolomics',\n },\n prepType: {\n ...templateControlSchemas['sample-prep'].prepType,\n default: 'extraction',\n },\n outputVolume: templateControlSchemas['sample-prep'].outputVolume,\n includeQc: templateControlSchemas['instrument-run'].includeQc,\n },\n 'elisa-assay': {\n sampleNames: {\n type: 'tags',\n label: 'Samples',\n default: ['Control', 'Treatment'],\n section: 'samples',\n sectionLabel: 'Samples',\n sectionSubtitle: 'Unknowns and controls',\n view: 'design',\n sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },\n },\n analyte: {\n label: 'Analyte',\n default: 'Analyte',\n section: 'standards',\n sectionLabel: 'Standards',\n sectionSubtitle: 'Calibration setup',\n view: 'analysis',\n sidebar: { icon: ICONS.dose, iconColor: '#8b5cf6', iconBg: '#ede9fe' },\n },\n standardConcentrations: {\n type: 'tags',\n label: 'Standards',\n default: ['1000', '100', '10', '1'],\n section: 'standards',\n view: 'analysis',\n },\n unit: {\n label: 'Concentration unit',\n default: 'pg/mL',\n options: ['pg/mL', 'ng/mL', 'ug/mL', 'nM', 'uM'],\n section: 'standards',\n view: 'analysis',\n },\n responseUnit: {\n label: 'Response unit',\n default: 'OD450',\n section: 'readout',\n sectionLabel: 'Readout',\n view: 'analysis',\n sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },\n },\n plateName: {\n label: 'Plate name',\n default: 'ELISA plate',\n section: 'layout',\n sectionLabel: 'Layout',\n sectionSubtitle: 'Plate geometry',\n view: 'design',\n sidebar: { icon: ICONS.plate, iconColor: '#6366f1', iconBg: '#e0e7ff' },\n },\n plateFormat: {\n label: 'Format',\n default: 96,\n options: PLATE_FORMAT_OPTIONS,\n section: 'layout',\n view: 'design',\n },\n },\n 'flow-cytometry-assay': {\n sampleNames: {\n type: 'tags',\n label: 'Samples',\n default: ['Control', 'Treatment'],\n section: 'samples',\n sectionLabel: 'Samples',\n sectionSubtitle: 'Assay groups',\n view: 'design',\n sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },\n },\n markers: {\n ...templateControlSchemas['flow-cytometry-panel'].markers,\n default: ['CD3', 'CD4', 'CD8'],\n },\n featureNames: {\n type: 'tags',\n label: 'Readouts',\n default: ['CD3+ cells', 'CD4+ cells', 'CD8+ cells'],\n section: 'features',\n sectionLabel: 'Readouts',\n sectionSubtitle: 'Assay matrix columns',\n view: 'analysis',\n sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },\n },\n instrument: {\n ...templateControlSchemas['flow-cytometry-panel'].instrument,\n default: 'Flow cytometer',\n },\n includeDefaultControls: templateControlSchemas['flow-cytometry-panel'].includeDefaultControls,\n },\n 'western-blot-assay': {\n sampleNames: {\n type: 'tags',\n label: 'Samples',\n default: ['Control', 'Treatment'],\n section: 'samples',\n sectionLabel: 'Samples',\n sectionSubtitle: 'Blot lanes and groups',\n view: 'design',\n sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },\n },\n targets: {\n type: 'tags',\n label: 'Targets',\n default: ['Target protein'],\n section: 'assay',\n sectionLabel: 'Assay',\n sectionSubtitle: 'Protein targets',\n view: 'design',\n sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },\n },\n loadingControl: {\n label: 'Loading control',\n default: 'ACTB',\n section: 'normalization',\n sectionLabel: 'Normalization',\n view: 'analysis',\n sidebar: { icon: ICONS.settings, iconColor: '#6366f1', iconBg: '#e0e7ff' },\n },\n },\n} satisfies Record<TemplatePresetId, BioTemplateControlSchema>\n","import {\n controlsToFormSchema,\n controlsToSectionFormSchemas,\n controlsToSidebarPanels,\n getControlDefaults,\n useControlSchema,\n type ControlSchemaOptions,\n type UseControlSchemaReturn,\n} from '../composables/useControlSchema'\nimport {\n cloneControlSchema,\n cloneSchemaMap,\n} from './controlSchemaClone'\nimport {\n mergeTemplateControlSchemas,\n} from './controlSchemaMerge'\nimport {\n describeControlTarget,\n resolveControlSchemaTarget,\n} from './controlSchemaTargets'\nimport {\n presetControlSchemas,\n} from './presetControlSchemas'\nimport {\n templateControlSchemas,\n} from './templateControlSchemas'\nimport type {\n TemplateId,\n TemplatePresetId,\n} from './types'\nimport type {\n BioTemplateControlSchema,\n BioTemplateControlTarget,\n} from './controlSchemaTypes'\n\nexport type {\n BioTemplateControlSchema,\n BioTemplateControlTarget,\n} from './controlSchemaTypes'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function listBioTemplateControlSchemas(): Record<TemplateId, BioTemplateControlSchema> {\n return cloneSchemaMap(templateControlSchemas)\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function listBioTemplatePresetControlSchemas(): Record<TemplatePresetId, BioTemplateControlSchema> {\n return cloneSchemaMap(presetControlSchemas)\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function getBioTemplateControlSchema(\n target: BioTemplateControlTarget\n): BioTemplateControlSchema | undefined {\n const resolved = resolveControlSchemaTarget(target)\n if (!resolved) return undefined\n\n if (resolved.kind === 'template') {\n return cloneControlSchema(templateControlSchemas[resolved.name])\n }\n if (resolved.kind === 'preset') {\n return cloneControlSchema(presetControlSchemas[resolved.name])\n }\n return mergeTemplateControlSchemas(resolved.templates, templateControlSchemas)\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function requireBioTemplateControlSchema(\n target: BioTemplateControlTarget\n): BioTemplateControlSchema {\n const schema = getBioTemplateControlSchema(target)\n if (!schema) {\n throw new Error(`No built-in control schema found for '${describeControlTarget(target)}'.`)\n }\n return schema\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createBioTemplateControlToolkit(\n target: BioTemplateControlTarget,\n options: ControlSchemaOptions = {}\n): UseControlSchemaReturn<BioTemplateControlSchema> {\n return useControlSchema(requireBioTemplateControlSchema(target), options)\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function bioTemplateControlsToFormSchema(\n target: BioTemplateControlTarget,\n options: ControlSchemaOptions = {}\n) {\n return controlsToFormSchema(requireBioTemplateControlSchema(target), options)\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function bioTemplateControlsToSidebarPanels(\n target: BioTemplateControlTarget,\n options: ControlSchemaOptions = {}\n) {\n return controlsToSidebarPanels(requireBioTemplateControlSchema(target), options)\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function bioTemplateControlsToSectionFormSchemas(\n target: BioTemplateControlTarget,\n options: ControlSchemaOptions = {}\n) {\n return controlsToSectionFormSchemas(requireBioTemplateControlSchema(target), options)\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function getBioTemplateControlDefaults(target: BioTemplateControlTarget) {\n return getControlDefaults(requireBioTemplateControlSchema(target))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAeA,MAAM,QAAQ;EASd,MAAM,OAAO;EAMb,SAAS,YAAY,OAAc;GACjC,MAAM,SAAS,MAAM;GACrB,KAAK,qBAAqB,OAAO,KAAK;EACxC;;GAIE,OAAA,UAAA,GAAA,mBAmBE,YAAA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AAgB,mCACd,QACA,UAAgC,CAAC,GACjC;CACA,OAAO,wBAAwB,gCAAgC,MAAM,GAAG,OAAO;AACjF;;AAGA,SAAgB,wCACd,QACA,UAAgC,CAAC,GACjC;CACA,OAAO,6BAA6B,gCAAgC,MAAM,GAAG,OAAO;AACtF;;AAGA,SAAgB,8BAA8B,QAAkC;CAC9E,OAAO,mBAAmB,gCAAgC,MAAM,CAAC;AACnE"}
1
+ {"version":3,"file":"templates-B2DB0MCM.js","names":["$slots"],"sources":["../src/components/BaseTextarea.vue","../src/components/BaseTextarea.vue","../src/components/Tooltip.vue","../src/components/Tooltip.vue","../src/components/BaseCheckbox.vue","../src/components/BaseCheckbox.vue","../src/components/BaseToggle.vue","../src/components/BaseToggle.vue","../src/components/BaseRadioGroup.vue","../src/components/BaseRadioGroup.vue","../src/components/BaseSlider.vue","../src/components/BaseSlider.vue","../src/composables/useSelectionLimit.ts","../src/composables/useListSelection.ts","../src/components/MultiSelect.vue","../src/components/MultiSelect.vue","../src/composables/useCalendarGrid.ts","../src/composables/useDropdownState.ts","../src/components/internal/CalendarGridPanelInternal.vue","../src/components/internal/CalendarGridPanelInternal.vue","../src/components/DatePicker.vue","../src/components/DatePicker.vue","../src/composables/useTimeUtils.ts","../src/components/TimePicker.vue","../src/components/TimePicker.vue","../src/components/TagsInput.vue","../src/components/TagsInput.vue","../src/utils/pluginSecrets.ts","../src/components/SecretInput.vue","../src/components/SecretInput.vue","../src/components/NumberInput.vue","../src/components/NumberInput.vue","../src/components/FileUploader.vue","../src/components/FileUploader.vue","../src/composables/useMenuKeyboard.ts","../src/utils/records.ts","../src/components/DateTimePicker.vue","../src/components/DateTimePicker.vue","../src/composables/useEventStream.ts","../src/jobs.ts","../src/composables/useGeneratedAnalysis.ts","../src/composables/platformContextHelpers.ts","../src/components/internal/generatedJobsApi.ts","../src/components/GeneratedPathInput.vue","../src/components/GeneratedPathInput.vue","../src/composables/useChemicalFormula.ts","../src/components/FormulaInput.vue","../src/components/FormulaInput.vue","../src/composables/useSequenceUtils.ts","../src/components/SequenceInput.vue","../src/components/SequenceInput.vue","../src/components/MoleculeInput.vue","../src/components/MoleculeInput.vue","../src/composables/useConcentrationUnits.ts","../src/components/UnitInput.vue","../src/components/UnitInput.vue","../src/components/ConcentrationInput.vue","../src/components/ConcentrationInput.vue","../src/composables/formBuilderRegistry.ts","../src/composables/controlSchemaUtils.ts","../src/composables/controlSchemaNormalize.ts","../src/composables/controlSchemaFormFields.ts","../src/composables/controlSchemaLayout.ts","../src/composables/controlSchemaAdapters.ts","../src/composables/useControlSchema.ts","../src/utils/color.ts","../src/components/WellPlate.geometry.ts","../src/templates/builderReadUtils.ts","../src/templates/templateEnvelopes.ts","../src/templates/lookup.ts","../src/templates/catalog.ts","../src/templates/packs.ts","../src/templates/presets.ts","../src/templates/componentTargetResolvers.ts","../src/templates/componentBindingHelpers.ts","../src/templates/componentBindingCatalog.ts","../src/templates/templateValidators.ts","../src/templates/assayMatrixAdapters.ts","../src/templates/calibrationCurveAdapters.ts","../src/templates/flowPanelAdapters.ts","../src/templates/instrumentRunAdapterHelpers.ts","../src/templates/instrumentRunAdapters.ts","../src/templates/protocolAdapters.ts","../src/templates/qpcrAdapters.ts","../src/templates/reagentAdapters.ts","../src/templates/samplePrepAdapters.ts","../src/templates/sampleSheetAdapters.ts","../src/templates/timeCourseAdapters.ts","../src/templates/plateMapAdapters.ts","../src/templates/doseResponseAdapters.ts","../src/templates/componentPlateHelpers.ts","../src/templates/adapters.ts","../src/templates/componentPropsFactory.ts","../src/templates/componentDoseResponseProps.ts","../src/templates/componentGenericProps.ts","../src/templates/componentPlateMapProps.ts","../src/templates/componentQpcrPlateProps.ts","../src/templates/componentTemplateProps.ts","../src/templates/componentBindings.ts","../src/templates/builderPresetControls.ts","../src/templates/builderIdUtils.ts","../src/templates/plateMapBuilder.ts","../src/templates/sampleNormalizers.ts","../src/templates/sampleSheetBuilder.ts","../src/templates/samplePrepBuilder.ts","../src/templates/calibrationNormalizers.ts","../src/templates/doseResponseBuilder.ts","../src/templates/calibrationCurveBuilder.ts","../src/templates/protocolNormalizers.ts","../src/templates/timeCourseBuilder.ts","../src/templates/protocolStepsBuilder.ts","../src/templates/assayLookups.ts","../src/templates/assayNormalizers.ts","../src/templates/assayMatrixBuilder.ts","../src/templates/reagentListBuilder.ts","../src/templates/flowNormalizers.ts","../src/templates/flowCytometryPanelBuilder.ts","../src/templates/runNormalizers.ts","../src/templates/instrumentRunBuilder.ts","../src/templates/qpcrPlateBuilder.ts","../src/templates/qpcrExpressionCollectionBuilder.ts","../src/templates/lcmsBatchCollectionBuilder.ts","../src/templates/targetedMetabolomicsHelpers.ts","../src/templates/targetedMetabolomicsCollectionBuilder.ts","../src/templates/elisaAssayCollectionBuilder.ts","../src/templates/flowCytometryAssayCollectionBuilder.ts","../src/templates/westernBlotAssayCollectionBuilder.ts","../src/templates/defaultBioTemplateBuilder.ts","../src/templates/templatePackCollectionBuilder.ts","../src/templates/wellPlateScreenCollectionBuilder.ts","../src/templates/templatePresetCollectionBuilder.ts","../src/templates/controlSchemaClone.ts","../src/templates/controlSchemaMerge.ts","../src/templates/controlSchemaTargets.ts","../src/templates/controlSchemaConstants.ts","../src/templates/templateControlSchemas.ts","../src/templates/presetControlSchemas.ts","../src/templates/controlSchemas.ts"],"sourcesContent":["<script setup lang=\"ts\">\n/** Renders a styled `<textarea>` with configurable rows, resize mode, size, and error state. */\ninterface Props {\n modelValue?: string\n placeholder?: string\n disabled?: boolean\n readonly?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n rows?: number\n resize?: 'none' | 'vertical' | 'horizontal' | 'both'\n maxlength?: number\n ariaDescribedby?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n disabled: false,\n readonly: false,\n error: false,\n size: 'md',\n rows: 3,\n resize: 'vertical',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n focus: [event: FocusEvent]\n blur: [event: FocusEvent]\n}>()\n\nfunction handleInput(event: Event) {\n const target = event.target as HTMLTextAreaElement\n emit('update:modelValue', target.value)\n}\n</script>\n\n<template>\n <textarea\n :value=\"props.modelValue\"\n :placeholder=\"props.placeholder\"\n :disabled=\"props.disabled\"\n :readonly=\"props.readonly\"\n :rows=\"props.rows\"\n :maxlength=\"props.maxlength\"\n :aria-invalid=\"props.error || undefined\"\n :aria-describedby=\"props.ariaDescribedby || undefined\"\n :class=\"[\n 'mint-textarea',\n `mint-textarea--${props.size}`,\n `mint-textarea--resize-${props.resize}`,\n props.error ? 'mint-textarea--error' : '',\n props.disabled ? 'mint-textarea--disabled' : '',\n ]\"\n @input=\"handleInput\"\n @focus=\"emit('focus', $event)\"\n @blur=\"emit('blur', $event)\"\n />\n</template>\n","<script setup lang=\"ts\">\n/** Renders a styled `<textarea>` with configurable rows, resize mode, size, and error state. */\ninterface Props {\n modelValue?: string\n placeholder?: string\n disabled?: boolean\n readonly?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n rows?: number\n resize?: 'none' | 'vertical' | 'horizontal' | 'both'\n maxlength?: number\n ariaDescribedby?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n disabled: false,\n readonly: false,\n error: false,\n size: 'md',\n rows: 3,\n resize: 'vertical',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n focus: [event: FocusEvent]\n blur: [event: FocusEvent]\n}>()\n\nfunction handleInput(event: Event) {\n const target = event.target as HTMLTextAreaElement\n emit('update:modelValue', target.value)\n}\n</script>\n\n<template>\n <textarea\n :value=\"props.modelValue\"\n :placeholder=\"props.placeholder\"\n :disabled=\"props.disabled\"\n :readonly=\"props.readonly\"\n :rows=\"props.rows\"\n :maxlength=\"props.maxlength\"\n :aria-invalid=\"props.error || undefined\"\n :aria-describedby=\"props.ariaDescribedby || undefined\"\n :class=\"[\n 'mint-textarea',\n `mint-textarea--${props.size}`,\n `mint-textarea--resize-${props.resize}`,\n props.error ? 'mint-textarea--error' : '',\n props.disabled ? 'mint-textarea--disabled' : '',\n ]\"\n @input=\"handleInput\"\n @focus=\"emit('focus', $event)\"\n @blur=\"emit('blur', $event)\"\n />\n</template>\n","<script setup lang=\"ts\">\n/** Floating tooltip using @floating-ui with auto-flip, delay, optional keyboard shortcut badge, and body Teleport. */\nimport { ref, onBeforeUnmount, nextTick } from 'vue'\nimport { computePosition, flip, offset, shift, type Placement } from '@floating-ui/dom'\nimport { useEventListener } from '../composables/useEventListener'\n\ninterface Props {\n text: string\n position?: 'top' | 'bottom' | 'left' | 'right'\n delay?: number\n shortcut?: string\n maxWidth?: string | number\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n position: 'top',\n delay: 200,\n shortcut: undefined,\n maxWidth: undefined,\n})\n\nconst tooltipId = `mint-tooltip-${Math.random().toString(36).slice(2, 9)}`\nconst visible = ref(false)\nconst actualPlacement = ref<Placement>(props.position)\nconst triggerRef = ref<HTMLElement | null>(null)\nconst contentRef = ref<HTMLElement | null>(null)\nconst coords = ref({ top: '0px', left: '0px' })\nlet timeoutId: ReturnType<typeof setTimeout> | undefined\n\nasync function updatePosition() {\n if (!triggerRef.value || !contentRef.value) return\n\n const { x, y, placement } = await computePosition(triggerRef.value, contentRef.value, {\n placement: props.position,\n middleware: [\n offset(6),\n flip(),\n shift({ padding: 8 }),\n ],\n })\n\n coords.value = { top: `${y}px`, left: `${x}px` }\n actualPlacement.value = placement\n}\n\nuseEventListener(() => window, 'scroll', updatePosition, {\n passive: true,\n capture: true,\n enabled: visible,\n})\nuseEventListener(() => window, 'resize', updatePosition, { enabled: visible })\n\nasync function show() {\n timeoutId = setTimeout(async () => {\n visible.value = true\n await nextTick()\n await updatePosition()\n }, props.delay)\n}\n\nfunction hide() {\n clearTimeout(timeoutId)\n timeoutId = undefined\n visible.value = false\n}\n\nonBeforeUnmount(() => {\n clearTimeout(timeoutId)\n})\n\nfunction resolvedMaxWidth(value: string | number | undefined): string | undefined {\n if (value === undefined) return undefined\n return typeof value === 'number' ? `${value}px` : value\n}\n</script>\n\n<template>\n <span\n ref=\"triggerRef\"\n class=\"mint-tooltip\"\n :aria-describedby=\"visible ? tooltipId : undefined\"\n @mouseenter=\"show\"\n @mouseleave=\"hide\"\n @focusin=\"show\"\n @focusout=\"hide\"\n >\n <slot />\n <Teleport to=\"body\">\n <span\n v-if=\"visible\"\n :id=\"tooltipId\"\n ref=\"contentRef\"\n :class=\"[\n 'mint-tooltip__content',\n `mint-tooltip__content--${actualPlacement}`,\n maxWidth ? 'mint-tooltip__content--multiline' : '',\n ]\"\n :style=\"{\n top: coords.top,\n left: coords.left,\n maxWidth: resolvedMaxWidth(maxWidth),\n }\"\n role=\"tooltip\"\n >\n <span class=\"mint-tooltip__body\">{{ text }}</span>\n <kbd v-if=\"shortcut\" class=\"mint-tooltip__shortcut\">{{ shortcut }}</kbd>\n </span>\n </Teleport>\n </span>\n</template>\n","<script setup lang=\"ts\">\n/** Floating tooltip using @floating-ui with auto-flip, delay, optional keyboard shortcut badge, and body Teleport. */\nimport { ref, onBeforeUnmount, nextTick } from 'vue'\nimport { computePosition, flip, offset, shift, type Placement } from '@floating-ui/dom'\nimport { useEventListener } from '../composables/useEventListener'\n\ninterface Props {\n text: string\n position?: 'top' | 'bottom' | 'left' | 'right'\n delay?: number\n shortcut?: string\n maxWidth?: string | number\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n position: 'top',\n delay: 200,\n shortcut: undefined,\n maxWidth: undefined,\n})\n\nconst tooltipId = `mint-tooltip-${Math.random().toString(36).slice(2, 9)}`\nconst visible = ref(false)\nconst actualPlacement = ref<Placement>(props.position)\nconst triggerRef = ref<HTMLElement | null>(null)\nconst contentRef = ref<HTMLElement | null>(null)\nconst coords = ref({ top: '0px', left: '0px' })\nlet timeoutId: ReturnType<typeof setTimeout> | undefined\n\nasync function updatePosition() {\n if (!triggerRef.value || !contentRef.value) return\n\n const { x, y, placement } = await computePosition(triggerRef.value, contentRef.value, {\n placement: props.position,\n middleware: [\n offset(6),\n flip(),\n shift({ padding: 8 }),\n ],\n })\n\n coords.value = { top: `${y}px`, left: `${x}px` }\n actualPlacement.value = placement\n}\n\nuseEventListener(() => window, 'scroll', updatePosition, {\n passive: true,\n capture: true,\n enabled: visible,\n})\nuseEventListener(() => window, 'resize', updatePosition, { enabled: visible })\n\nasync function show() {\n timeoutId = setTimeout(async () => {\n visible.value = true\n await nextTick()\n await updatePosition()\n }, props.delay)\n}\n\nfunction hide() {\n clearTimeout(timeoutId)\n timeoutId = undefined\n visible.value = false\n}\n\nonBeforeUnmount(() => {\n clearTimeout(timeoutId)\n})\n\nfunction resolvedMaxWidth(value: string | number | undefined): string | undefined {\n if (value === undefined) return undefined\n return typeof value === 'number' ? `${value}px` : value\n}\n</script>\n\n<template>\n <span\n ref=\"triggerRef\"\n class=\"mint-tooltip\"\n :aria-describedby=\"visible ? tooltipId : undefined\"\n @mouseenter=\"show\"\n @mouseleave=\"hide\"\n @focusin=\"show\"\n @focusout=\"hide\"\n >\n <slot />\n <Teleport to=\"body\">\n <span\n v-if=\"visible\"\n :id=\"tooltipId\"\n ref=\"contentRef\"\n :class=\"[\n 'mint-tooltip__content',\n `mint-tooltip__content--${actualPlacement}`,\n maxWidth ? 'mint-tooltip__content--multiline' : '',\n ]\"\n :style=\"{\n top: coords.top,\n left: coords.left,\n maxWidth: resolvedMaxWidth(maxWidth),\n }\"\n role=\"tooltip\"\n >\n <span class=\"mint-tooltip__body\">{{ text }}</span>\n <kbd v-if=\"shortcut\" class=\"mint-tooltip__shortcut\">{{ shortcut }}</kbd>\n </span>\n </Teleport>\n </span>\n</template>\n","<script setup lang=\"ts\">\n/** Renders a styled checkbox with an optional label, size variants, and disabled state. */\nimport Tooltip from './Tooltip.vue'\n\ninterface Props {\n modelValue?: boolean\n /** Partially checked (e.g. select-all over a partial selection); sets `aria-checked=\"mixed\"`. */\n indeterminate?: boolean\n /** Accessible name for the native input when no visible `label` is rendered (e.g. table rows). */\n ariaLabel?: string\n label?: string\n description?: string\n icon?: string | string[]\n iconColor?: string\n iconBg?: string\n disabled?: boolean\n size?: 'sm' | 'md' | 'lg'\n variant?: 'default' | 'row'\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: false,\n indeterminate: false,\n disabled: false,\n size: 'md',\n variant: 'default',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: boolean]\n}>()\n\nfunction handleChange(event: Event) {\n const target = event.target as HTMLInputElement\n emit('update:modelValue', target.checked)\n}\n\nfunction isSvgIcon(icon?: string | string[]): boolean {\n if (!icon) return false\n return Array.isArray(icon) || icon.startsWith('M') || icon.startsWith('m')\n}\n\nfunction iconStyle(): Record<string, string> {\n return {\n color: props.iconColor ?? (props.modelValue ? 'var(--color-primary)' : 'var(--text-muted)'),\n }\n}\n</script>\n\n<template>\n <label\n :class=\"[\n 'mint-checkbox',\n `mint-checkbox--${props.variant}`,\n props.disabled ? 'mint-checkbox--disabled' : '',\n props.modelValue ? 'mint-checkbox--checked' : '',\n ]\"\n >\n <span\n v-if=\"props.variant === 'row' && props.icon\"\n class=\"mint-checkbox__row-icon\"\n :style=\"iconStyle()\"\n aria-hidden=\"true\"\n >\n <svg\n v-if=\"isSvgIcon(props.icon)\"\n class=\"mint-checkbox__row-svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <template v-if=\"Array.isArray(props.icon)\">\n <path v-for=\"(d, i) in props.icon\" :key=\"i\" :d=\"d\" />\n </template>\n <path v-else :d=\"props.icon\" />\n </svg>\n <span v-else class=\"mint-checkbox__row-text-icon\">{{ props.icon }}</span>\n </span>\n <span\n v-if=\"props.variant === 'row' && props.label\"\n class=\"mint-checkbox__copy\"\n >\n <Tooltip\n v-if=\"props.description\"\n :text=\"props.description\"\n position=\"right\"\n max-width=\"16rem\"\n >\n <span :class=\"['mint-checkbox__label', `mint-checkbox__label--${props.size}`, 'mint-checkbox__label--tooltip']\">\n {{ props.label }}\n </span>\n </Tooltip>\n <span v-else :class=\"['mint-checkbox__label', `mint-checkbox__label--${props.size}`]\">\n {{ props.label }}\n </span>\n </span>\n <div class=\"mint-checkbox__input-wrapper\">\n <input\n type=\"checkbox\"\n :checked=\"props.modelValue\"\n :indeterminate=\"props.indeterminate\"\n :aria-checked=\"props.indeterminate ? 'mixed' : undefined\"\n :disabled=\"props.disabled\"\n :aria-label=\"props.ariaLabel || props.label || 'Checkbox'\"\n class=\"mint-checkbox__native\"\n @change=\"handleChange\"\n />\n <div\n :class=\"[\n 'mint-checkbox__box',\n `mint-checkbox__box--${props.size}`,\n props.modelValue && !props.indeterminate ? 'mint-checkbox__box--checked' : '',\n props.indeterminate ? 'mint-checkbox__box--indeterminate' : '',\n ]\"\n >\n <svg\n v-if=\"props.indeterminate\"\n :class=\"['mint-checkbox__icon', `mint-checkbox__icon--${props.size}`]\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 16 16\"\n aria-hidden=\"true\"\n >\n <path stroke-linecap=\"round\" stroke-width=\"2.2\" d=\"M4 8h8\" />\n </svg>\n <svg\n v-else-if=\"props.modelValue\"\n :class=\"['mint-checkbox__icon', `mint-checkbox__icon--${props.size}`]\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"3\" d=\"M5 13l4 4L19 7\" />\n </svg>\n </div>\n </div>\n <span v-if=\"props.label && props.variant !== 'row'\" :class=\"['mint-checkbox__label', `mint-checkbox__label--${props.size}`]\">\n {{ props.label }}\n </span>\n </label>\n</template>\n","<script setup lang=\"ts\">\n/** Renders a styled checkbox with an optional label, size variants, and disabled state. */\nimport Tooltip from './Tooltip.vue'\n\ninterface Props {\n modelValue?: boolean\n /** Partially checked (e.g. select-all over a partial selection); sets `aria-checked=\"mixed\"`. */\n indeterminate?: boolean\n /** Accessible name for the native input when no visible `label` is rendered (e.g. table rows). */\n ariaLabel?: string\n label?: string\n description?: string\n icon?: string | string[]\n iconColor?: string\n iconBg?: string\n disabled?: boolean\n size?: 'sm' | 'md' | 'lg'\n variant?: 'default' | 'row'\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: false,\n indeterminate: false,\n disabled: false,\n size: 'md',\n variant: 'default',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: boolean]\n}>()\n\nfunction handleChange(event: Event) {\n const target = event.target as HTMLInputElement\n emit('update:modelValue', target.checked)\n}\n\nfunction isSvgIcon(icon?: string | string[]): boolean {\n if (!icon) return false\n return Array.isArray(icon) || icon.startsWith('M') || icon.startsWith('m')\n}\n\nfunction iconStyle(): Record<string, string> {\n return {\n color: props.iconColor ?? (props.modelValue ? 'var(--color-primary)' : 'var(--text-muted)'),\n }\n}\n</script>\n\n<template>\n <label\n :class=\"[\n 'mint-checkbox',\n `mint-checkbox--${props.variant}`,\n props.disabled ? 'mint-checkbox--disabled' : '',\n props.modelValue ? 'mint-checkbox--checked' : '',\n ]\"\n >\n <span\n v-if=\"props.variant === 'row' && props.icon\"\n class=\"mint-checkbox__row-icon\"\n :style=\"iconStyle()\"\n aria-hidden=\"true\"\n >\n <svg\n v-if=\"isSvgIcon(props.icon)\"\n class=\"mint-checkbox__row-svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <template v-if=\"Array.isArray(props.icon)\">\n <path v-for=\"(d, i) in props.icon\" :key=\"i\" :d=\"d\" />\n </template>\n <path v-else :d=\"props.icon\" />\n </svg>\n <span v-else class=\"mint-checkbox__row-text-icon\">{{ props.icon }}</span>\n </span>\n <span\n v-if=\"props.variant === 'row' && props.label\"\n class=\"mint-checkbox__copy\"\n >\n <Tooltip\n v-if=\"props.description\"\n :text=\"props.description\"\n position=\"right\"\n max-width=\"16rem\"\n >\n <span :class=\"['mint-checkbox__label', `mint-checkbox__label--${props.size}`, 'mint-checkbox__label--tooltip']\">\n {{ props.label }}\n </span>\n </Tooltip>\n <span v-else :class=\"['mint-checkbox__label', `mint-checkbox__label--${props.size}`]\">\n {{ props.label }}\n </span>\n </span>\n <div class=\"mint-checkbox__input-wrapper\">\n <input\n type=\"checkbox\"\n :checked=\"props.modelValue\"\n :indeterminate=\"props.indeterminate\"\n :aria-checked=\"props.indeterminate ? 'mixed' : undefined\"\n :disabled=\"props.disabled\"\n :aria-label=\"props.ariaLabel || props.label || 'Checkbox'\"\n class=\"mint-checkbox__native\"\n @change=\"handleChange\"\n />\n <div\n :class=\"[\n 'mint-checkbox__box',\n `mint-checkbox__box--${props.size}`,\n props.modelValue && !props.indeterminate ? 'mint-checkbox__box--checked' : '',\n props.indeterminate ? 'mint-checkbox__box--indeterminate' : '',\n ]\"\n >\n <svg\n v-if=\"props.indeterminate\"\n :class=\"['mint-checkbox__icon', `mint-checkbox__icon--${props.size}`]\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 16 16\"\n aria-hidden=\"true\"\n >\n <path stroke-linecap=\"round\" stroke-width=\"2.2\" d=\"M4 8h8\" />\n </svg>\n <svg\n v-else-if=\"props.modelValue\"\n :class=\"['mint-checkbox__icon', `mint-checkbox__icon--${props.size}`]\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"3\" d=\"M5 13l4 4L19 7\" />\n </svg>\n </div>\n </div>\n <span v-if=\"props.label && props.variant !== 'row'\" :class=\"['mint-checkbox__label', `mint-checkbox__label--${props.size}`]\">\n {{ props.label }}\n </span>\n </label>\n</template>\n","<script setup lang=\"ts\">\n/** Renders an on/off toggle switch with label, size, and keyboard interaction support. */\nimport Tooltip from './Tooltip.vue'\n\ninterface Props {\n modelValue?: boolean\n label?: string\n /** Accessible switch name; defaults to the visual label, then \"Toggle\". */\n ariaLabel?: string\n description?: string\n icon?: string | string[]\n iconColor?: string\n iconBg?: string\n disabled?: boolean\n size?: 'sm' | 'md' | 'lg'\n reverse?: boolean\n variant?: 'default' | 'row'\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: false,\n disabled: false,\n size: 'md',\n reverse: false,\n variant: 'default',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: boolean]\n}>()\n\nfunction toggle() {\n if (!props.disabled) {\n emit('update:modelValue', !props.modelValue)\n }\n}\n\nfunction handleKeydown(event: KeyboardEvent) {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault()\n toggle()\n }\n}\n\nfunction isSvgIcon(icon?: string | string[]): boolean {\n if (!icon) return false\n return Array.isArray(icon) || icon.startsWith('M') || icon.startsWith('m')\n}\n\nfunction iconStyle(): Record<string, string> {\n return {\n color: props.iconColor ?? (props.modelValue ? 'var(--color-primary)' : 'var(--text-muted)'),\n }\n}\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-toggle',\n `mint-toggle--${variant}`,\n reverse ? 'mint-toggle--reverse' : '',\n disabled ? 'mint-toggle--disabled' : '',\n modelValue ? 'mint-toggle--checked' : '',\n ]\"\n @click=\"toggle\"\n >\n <span\n v-if=\"variant === 'row' && icon\"\n class=\"mint-toggle__row-icon\"\n :style=\"iconStyle()\"\n aria-hidden=\"true\"\n >\n <svg\n v-if=\"isSvgIcon(icon)\"\n class=\"mint-toggle__row-svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <template v-if=\"Array.isArray(icon)\">\n <path v-for=\"(d, i) in icon\" :key=\"i\" :d=\"d\" />\n </template>\n <path v-else :d=\"icon\" />\n </svg>\n <span v-else class=\"mint-toggle__row-text-icon\">{{ icon }}</span>\n </span>\n <span\n v-if=\"variant === 'row' && label\"\n class=\"mint-toggle__copy\"\n >\n <Tooltip\n v-if=\"description\"\n :text=\"description\"\n position=\"right\"\n max-width=\"16rem\"\n >\n <span :class=\"['mint-toggle__label', `mint-toggle__label--${size}`, 'mint-toggle__label--tooltip']\">\n {{ label }}\n </span>\n </Tooltip>\n <span\n v-else\n :class=\"['mint-toggle__label', `mint-toggle__label--${size}`]\"\n >\n {{ label }}\n </span>\n </span>\n <div\n role=\"switch\"\n :tabindex=\"disabled ? -1 : 0\"\n :aria-checked=\"modelValue\"\n :aria-label=\"ariaLabel || label || 'Toggle'\"\n :class=\"[\n 'mint-toggle__track',\n `mint-toggle__track--${size}`,\n modelValue ? 'mint-toggle__track--on' : 'mint-toggle__track--off',\n ]\"\n @keydown=\"handleKeydown\"\n >\n <span :class=\"['mint-toggle__knob', `mint-toggle__knob--${size}`]\" />\n </div>\n <span\n v-if=\"label && variant !== 'row'\"\n :class=\"['mint-toggle__label', `mint-toggle__label--${size}`]\"\n >\n {{ label }}\n </span>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Renders an on/off toggle switch with label, size, and keyboard interaction support. */\nimport Tooltip from './Tooltip.vue'\n\ninterface Props {\n modelValue?: boolean\n label?: string\n /** Accessible switch name; defaults to the visual label, then \"Toggle\". */\n ariaLabel?: string\n description?: string\n icon?: string | string[]\n iconColor?: string\n iconBg?: string\n disabled?: boolean\n size?: 'sm' | 'md' | 'lg'\n reverse?: boolean\n variant?: 'default' | 'row'\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: false,\n disabled: false,\n size: 'md',\n reverse: false,\n variant: 'default',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: boolean]\n}>()\n\nfunction toggle() {\n if (!props.disabled) {\n emit('update:modelValue', !props.modelValue)\n }\n}\n\nfunction handleKeydown(event: KeyboardEvent) {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault()\n toggle()\n }\n}\n\nfunction isSvgIcon(icon?: string | string[]): boolean {\n if (!icon) return false\n return Array.isArray(icon) || icon.startsWith('M') || icon.startsWith('m')\n}\n\nfunction iconStyle(): Record<string, string> {\n return {\n color: props.iconColor ?? (props.modelValue ? 'var(--color-primary)' : 'var(--text-muted)'),\n }\n}\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-toggle',\n `mint-toggle--${variant}`,\n reverse ? 'mint-toggle--reverse' : '',\n disabled ? 'mint-toggle--disabled' : '',\n modelValue ? 'mint-toggle--checked' : '',\n ]\"\n @click=\"toggle\"\n >\n <span\n v-if=\"variant === 'row' && icon\"\n class=\"mint-toggle__row-icon\"\n :style=\"iconStyle()\"\n aria-hidden=\"true\"\n >\n <svg\n v-if=\"isSvgIcon(icon)\"\n class=\"mint-toggle__row-svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <template v-if=\"Array.isArray(icon)\">\n <path v-for=\"(d, i) in icon\" :key=\"i\" :d=\"d\" />\n </template>\n <path v-else :d=\"icon\" />\n </svg>\n <span v-else class=\"mint-toggle__row-text-icon\">{{ icon }}</span>\n </span>\n <span\n v-if=\"variant === 'row' && label\"\n class=\"mint-toggle__copy\"\n >\n <Tooltip\n v-if=\"description\"\n :text=\"description\"\n position=\"right\"\n max-width=\"16rem\"\n >\n <span :class=\"['mint-toggle__label', `mint-toggle__label--${size}`, 'mint-toggle__label--tooltip']\">\n {{ label }}\n </span>\n </Tooltip>\n <span\n v-else\n :class=\"['mint-toggle__label', `mint-toggle__label--${size}`]\"\n >\n {{ label }}\n </span>\n </span>\n <div\n role=\"switch\"\n :tabindex=\"disabled ? -1 : 0\"\n :aria-checked=\"modelValue\"\n :aria-label=\"ariaLabel || label || 'Toggle'\"\n :class=\"[\n 'mint-toggle__track',\n `mint-toggle__track--${size}`,\n modelValue ? 'mint-toggle__track--on' : 'mint-toggle__track--off',\n ]\"\n @keydown=\"handleKeydown\"\n >\n <span :class=\"['mint-toggle__knob', `mint-toggle__knob--${size}`]\" />\n </div>\n <span\n v-if=\"label && variant !== 'row'\"\n :class=\"['mint-toggle__label', `mint-toggle__label--${size}`]\"\n >\n {{ label }}\n </span>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Renders a group of radio buttons in list or tile layout, horizontal or vertical. */\nimport { computed } from 'vue'\nimport type { RadioOption, RadioOptionInput } from '../types'\nimport { normalizeOptionInput } from '../utils/options'\n\ninterface Props {\n modelValue?: string | number\n options: RadioOptionInput[]\n name: string\n disabled?: boolean\n direction?: 'horizontal' | 'vertical'\n size?: 'sm' | 'md' | 'lg'\n variant?: 'list' | 'tile'\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n disabled: false,\n direction: 'vertical',\n size: 'md',\n variant: 'list',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | number]\n}>()\n\nconst normalizedOptions = computed<RadioOption[]>(() => props.options.map(normalizeOptionInput))\n\nfunction handleChange(value: string | number) {\n emit('update:modelValue', value)\n}\n</script>\n\n<template>\n <div\n :class=\"['mint-radio-group', `mint-radio-group--${props.direction}`, `mint-radio-group--${props.variant}`]\"\n role=\"radiogroup\"\n >\n <label\n v-for=\"option in normalizedOptions\"\n :key=\"String(option.value)\"\n :class=\"[\n 'mint-radio-option',\n props.modelValue === option.value ? 'mint-radio-option--selected' : '',\n (props.disabled || option.disabled) ? 'mint-radio-option--disabled' : '',\n ]\"\n >\n <template v-if=\"props.variant === 'list'\">\n <div class=\"mint-radio-option__input-wrapper\">\n <input\n type=\"radio\"\n :name=\"props.name\"\n :value=\"option.value\"\n :checked=\"props.modelValue === option.value\"\n :disabled=\"props.disabled || option.disabled\"\n :aria-describedby=\"option.description ? `${props.name}-${option.value}-desc` : undefined\"\n class=\"mint-radio-option__native\"\n @change=\"handleChange(option.value)\"\n />\n <div\n :class=\"[\n 'mint-radio-option__circle',\n `mint-radio-option__circle--${props.size}`,\n props.modelValue === option.value ? 'mint-radio-option__circle--checked' : '',\n ]\"\n >\n <div\n v-if=\"props.modelValue === option.value\"\n :class=\"['mint-radio-option__dot', `mint-radio-option__dot--${props.size}`]\"\n />\n </div>\n </div>\n <div class=\"mint-radio-option__content\">\n <span :class=\"['mint-radio-option__label', `mint-radio-option__label--${props.size}`]\">\n {{ option.label }}\n </span>\n <span\n v-if=\"option.description\"\n :id=\"`${props.name}-${option.value}-desc`\"\n :class=\"['mint-radio-option__description', `mint-radio-option__description--${props.size}`]\"\n >\n {{ option.description }}\n </span>\n </div>\n </template>\n\n <template v-else>\n <input\n type=\"radio\"\n :name=\"props.name\"\n :value=\"option.value\"\n :checked=\"props.modelValue === option.value\"\n :disabled=\"props.disabled || option.disabled\"\n :aria-describedby=\"option.description ? `${props.name}-${option.value}-desc` : undefined\"\n class=\"mint-radio-option__native\"\n @change=\"handleChange(option.value)\"\n />\n <div class=\"mint-radio-option__head\">\n <div\n :class=\"[\n 'mint-radio-option__circle',\n `mint-radio-option__circle--${props.size}`,\n props.modelValue === option.value ? 'mint-radio-option__circle--checked' : '',\n ]\"\n >\n <div\n v-if=\"props.modelValue === option.value\"\n :class=\"['mint-radio-option__dot', `mint-radio-option__dot--${props.size}`]\"\n />\n </div>\n <span class=\"mint-radio-option__title\">{{ option.label }}</span>\n </div>\n <span\n v-if=\"option.description\"\n :id=\"`${props.name}-${option.value}-desc`\"\n class=\"mint-radio-option__description\"\n >\n {{ option.description }}\n </span>\n </template>\n </label>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Renders a group of radio buttons in list or tile layout, horizontal or vertical. */\nimport { computed } from 'vue'\nimport type { RadioOption, RadioOptionInput } from '../types'\nimport { normalizeOptionInput } from '../utils/options'\n\ninterface Props {\n modelValue?: string | number\n options: RadioOptionInput[]\n name: string\n disabled?: boolean\n direction?: 'horizontal' | 'vertical'\n size?: 'sm' | 'md' | 'lg'\n variant?: 'list' | 'tile'\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n disabled: false,\n direction: 'vertical',\n size: 'md',\n variant: 'list',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | number]\n}>()\n\nconst normalizedOptions = computed<RadioOption[]>(() => props.options.map(normalizeOptionInput))\n\nfunction handleChange(value: string | number) {\n emit('update:modelValue', value)\n}\n</script>\n\n<template>\n <div\n :class=\"['mint-radio-group', `mint-radio-group--${props.direction}`, `mint-radio-group--${props.variant}`]\"\n role=\"radiogroup\"\n >\n <label\n v-for=\"option in normalizedOptions\"\n :key=\"String(option.value)\"\n :class=\"[\n 'mint-radio-option',\n props.modelValue === option.value ? 'mint-radio-option--selected' : '',\n (props.disabled || option.disabled) ? 'mint-radio-option--disabled' : '',\n ]\"\n >\n <template v-if=\"props.variant === 'list'\">\n <div class=\"mint-radio-option__input-wrapper\">\n <input\n type=\"radio\"\n :name=\"props.name\"\n :value=\"option.value\"\n :checked=\"props.modelValue === option.value\"\n :disabled=\"props.disabled || option.disabled\"\n :aria-describedby=\"option.description ? `${props.name}-${option.value}-desc` : undefined\"\n class=\"mint-radio-option__native\"\n @change=\"handleChange(option.value)\"\n />\n <div\n :class=\"[\n 'mint-radio-option__circle',\n `mint-radio-option__circle--${props.size}`,\n props.modelValue === option.value ? 'mint-radio-option__circle--checked' : '',\n ]\"\n >\n <div\n v-if=\"props.modelValue === option.value\"\n :class=\"['mint-radio-option__dot', `mint-radio-option__dot--${props.size}`]\"\n />\n </div>\n </div>\n <div class=\"mint-radio-option__content\">\n <span :class=\"['mint-radio-option__label', `mint-radio-option__label--${props.size}`]\">\n {{ option.label }}\n </span>\n <span\n v-if=\"option.description\"\n :id=\"`${props.name}-${option.value}-desc`\"\n :class=\"['mint-radio-option__description', `mint-radio-option__description--${props.size}`]\"\n >\n {{ option.description }}\n </span>\n </div>\n </template>\n\n <template v-else>\n <input\n type=\"radio\"\n :name=\"props.name\"\n :value=\"option.value\"\n :checked=\"props.modelValue === option.value\"\n :disabled=\"props.disabled || option.disabled\"\n :aria-describedby=\"option.description ? `${props.name}-${option.value}-desc` : undefined\"\n class=\"mint-radio-option__native\"\n @change=\"handleChange(option.value)\"\n />\n <div class=\"mint-radio-option__head\">\n <div\n :class=\"[\n 'mint-radio-option__circle',\n `mint-radio-option__circle--${props.size}`,\n props.modelValue === option.value ? 'mint-radio-option__circle--checked' : '',\n ]\"\n >\n <div\n v-if=\"props.modelValue === option.value\"\n :class=\"['mint-radio-option__dot', `mint-radio-option__dot--${props.size}`]\"\n />\n </div>\n <span class=\"mint-radio-option__title\">{{ option.label }}</span>\n </div>\n <span\n v-if=\"option.description\"\n :id=\"`${props.name}-${option.value}-desc`\"\n class=\"mint-radio-option__description\"\n >\n {{ option.description }}\n </span>\n </template>\n </label>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * Renders a range slider with a filled track, optional value display, and size variants.\n * Optional color stops, value thresholds, and end labels turn it into a threshold slider.\n */\nimport { computed, ref } from 'vue'\n\ninterface SliderColorStop {\n /** Position along the track, in percent (0-100). */\n value: number\n color: string\n}\n\ninterface Props {\n modelValue?: number\n min?: number\n max?: number\n step?: number\n disabled?: boolean\n showValue?: boolean\n size?: 'sm' | 'md' | 'lg'\n /** Paint the track with a gradient through these stops instead of the primary fill. */\n colorStops?: SliderColorStop[]\n /** Tone the value badge by percent of range: success up to the first, warning up to the second, error above. */\n thresholds?: [number, number]\n /** Show the range ends under the slider. */\n showLabels?: boolean\n /** Label for the low end. Defaults to `min`. */\n minLabel?: string\n /** Label for the high end. Defaults to `max`. */\n maxLabel?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n min: 0,\n max: 100,\n step: 1,\n disabled: false,\n showValue: true,\n size: 'md',\n showLabels: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: number]\n}>()\n\nconst isDragging = ref(false)\n\nconst sizeConfig = computed(() => {\n switch (props.size) {\n case 'sm': return { height: 2, thumb: 12 }\n case 'lg': return { height: 6, thumb: 18 }\n default: return { height: 4, thumb: 14 }\n }\n})\n\nconst currentValue = computed(() => {\n return props.modelValue ?? props.min\n})\n\nconst percentage = computed(() => {\n const range = props.max - props.min\n if (range === 0) return 0\n return ((currentValue.value - props.min) / range) * 100\n})\n\n// Thumb-in-bounds offset (Radix UI pattern). Without this, the thumb's\n// center lands at left=0%/100% and overhangs the track by halfWidth at\n// each end. Linearly interpolating an inward push of halfWidth at percent=0\n// to halfWidth-pull at percent=100 keeps the thumb's *edges* — not its\n// center — aligned with the track edges.\nconst thumbPosition = computed(() => {\n const halfWidth = sizeConfig.value.thumb / 2\n const offsetPx = (halfWidth * (50 - percentage.value)) / 50\n return `calc(${percentage.value}% + ${offsetPx}px)`\n})\n\nconst trackBackground = computed(() => {\n if (!props.colorStops) return undefined\n const stops = props.colorStops.map(stop => `${stop.color} ${stop.value}%`).join(', ')\n return `linear-gradient(to right, ${stops})`\n})\n\nconst valueTone = computed(() => {\n if (!props.thresholds) return undefined\n const [warningAbove, errorAbove] = props.thresholds\n if (percentage.value <= warningAbove) return 'success'\n if (percentage.value <= errorAbove) return 'warning'\n return 'error'\n})\n\nfunction handleInput(event: Event) {\n const target = event.target as HTMLInputElement\n emit('update:modelValue', Number(target.value))\n}\n</script>\n\n<template>\n <div\n class=\"mint-slider\"\n :class=\"{ 'mint-slider--disabled': disabled, 'mint-slider--labeled': showLabels }\"\n >\n <div class=\"mint-slider__container\">\n <!-- Track background -->\n <div\n class=\"mint-slider__track\"\n :style=\"{ height: `${sizeConfig.height}px`, background: trackBackground }\"\n />\n\n <!-- Filled track — extends to the thumb's center so the two visually\n meet at every position (no gap at the right edge, no overshoot\n at the left). A gradient track has no fill. -->\n <div\n v-if=\"!colorStops\"\n class=\"mint-slider__fill\"\n :style=\"{\n height: `${sizeConfig.height}px`,\n width: thumbPosition,\n }\"\n />\n\n <!-- Native range input -->\n <input\n type=\"range\"\n class=\"mint-slider__input\"\n :value=\"currentValue\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :disabled=\"disabled\"\n :aria-label=\"`Value: ${currentValue}`\"\n :aria-valuemin=\"min\"\n :aria-valuemax=\"max\"\n :aria-valuenow=\"currentValue\"\n @input=\"handleInput\"\n @mousedown=\"isDragging = true\"\n @mouseup=\"isDragging = false\"\n @touchstart.passive=\"isDragging = true\"\n @touchend=\"isDragging = false\"\n />\n\n <!-- Custom thumb — translateX(-50%) centers it on `left` -->\n <div\n class=\"mint-slider__thumb\"\n :class=\"{ 'mint-slider__thumb--dragging': isDragging }\"\n :style=\"{\n width: `${sizeConfig.thumb}px`,\n height: `${sizeConfig.thumb}px`,\n left: thumbPosition,\n }\"\n />\n </div>\n\n <!-- Value display -->\n <span\n v-if=\"showValue\"\n class=\"mint-slider__value\"\n :class=\"valueTone && `mint-slider__value--${valueTone}`\"\n >\n {{ currentValue }}\n </span>\n\n <!-- Range end labels -->\n <div v-if=\"showLabels\" class=\"mint-slider__labels\">\n <span>{{ minLabel ?? min }}</span>\n <span>{{ maxLabel ?? max }}</span>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * Renders a range slider with a filled track, optional value display, and size variants.\n * Optional color stops, value thresholds, and end labels turn it into a threshold slider.\n */\nimport { computed, ref } from 'vue'\n\ninterface SliderColorStop {\n /** Position along the track, in percent (0-100). */\n value: number\n color: string\n}\n\ninterface Props {\n modelValue?: number\n min?: number\n max?: number\n step?: number\n disabled?: boolean\n showValue?: boolean\n size?: 'sm' | 'md' | 'lg'\n /** Paint the track with a gradient through these stops instead of the primary fill. */\n colorStops?: SliderColorStop[]\n /** Tone the value badge by percent of range: success up to the first, warning up to the second, error above. */\n thresholds?: [number, number]\n /** Show the range ends under the slider. */\n showLabels?: boolean\n /** Label for the low end. Defaults to `min`. */\n minLabel?: string\n /** Label for the high end. Defaults to `max`. */\n maxLabel?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n min: 0,\n max: 100,\n step: 1,\n disabled: false,\n showValue: true,\n size: 'md',\n showLabels: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: number]\n}>()\n\nconst isDragging = ref(false)\n\nconst sizeConfig = computed(() => {\n switch (props.size) {\n case 'sm': return { height: 2, thumb: 12 }\n case 'lg': return { height: 6, thumb: 18 }\n default: return { height: 4, thumb: 14 }\n }\n})\n\nconst currentValue = computed(() => {\n return props.modelValue ?? props.min\n})\n\nconst percentage = computed(() => {\n const range = props.max - props.min\n if (range === 0) return 0\n return ((currentValue.value - props.min) / range) * 100\n})\n\n// Thumb-in-bounds offset (Radix UI pattern). Without this, the thumb's\n// center lands at left=0%/100% and overhangs the track by halfWidth at\n// each end. Linearly interpolating an inward push of halfWidth at percent=0\n// to halfWidth-pull at percent=100 keeps the thumb's *edges* — not its\n// center — aligned with the track edges.\nconst thumbPosition = computed(() => {\n const halfWidth = sizeConfig.value.thumb / 2\n const offsetPx = (halfWidth * (50 - percentage.value)) / 50\n return `calc(${percentage.value}% + ${offsetPx}px)`\n})\n\nconst trackBackground = computed(() => {\n if (!props.colorStops) return undefined\n const stops = props.colorStops.map(stop => `${stop.color} ${stop.value}%`).join(', ')\n return `linear-gradient(to right, ${stops})`\n})\n\nconst valueTone = computed(() => {\n if (!props.thresholds) return undefined\n const [warningAbove, errorAbove] = props.thresholds\n if (percentage.value <= warningAbove) return 'success'\n if (percentage.value <= errorAbove) return 'warning'\n return 'error'\n})\n\nfunction handleInput(event: Event) {\n const target = event.target as HTMLInputElement\n emit('update:modelValue', Number(target.value))\n}\n</script>\n\n<template>\n <div\n class=\"mint-slider\"\n :class=\"{ 'mint-slider--disabled': disabled, 'mint-slider--labeled': showLabels }\"\n >\n <div class=\"mint-slider__container\">\n <!-- Track background -->\n <div\n class=\"mint-slider__track\"\n :style=\"{ height: `${sizeConfig.height}px`, background: trackBackground }\"\n />\n\n <!-- Filled track — extends to the thumb's center so the two visually\n meet at every position (no gap at the right edge, no overshoot\n at the left). A gradient track has no fill. -->\n <div\n v-if=\"!colorStops\"\n class=\"mint-slider__fill\"\n :style=\"{\n height: `${sizeConfig.height}px`,\n width: thumbPosition,\n }\"\n />\n\n <!-- Native range input -->\n <input\n type=\"range\"\n class=\"mint-slider__input\"\n :value=\"currentValue\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :disabled=\"disabled\"\n :aria-label=\"`Value: ${currentValue}`\"\n :aria-valuemin=\"min\"\n :aria-valuemax=\"max\"\n :aria-valuenow=\"currentValue\"\n @input=\"handleInput\"\n @mousedown=\"isDragging = true\"\n @mouseup=\"isDragging = false\"\n @touchstart.passive=\"isDragging = true\"\n @touchend=\"isDragging = false\"\n />\n\n <!-- Custom thumb — translateX(-50%) centers it on `left` -->\n <div\n class=\"mint-slider__thumb\"\n :class=\"{ 'mint-slider__thumb--dragging': isDragging }\"\n :style=\"{\n width: `${sizeConfig.thumb}px`,\n height: `${sizeConfig.thumb}px`,\n left: thumbPosition,\n }\"\n />\n </div>\n\n <!-- Value display -->\n <span\n v-if=\"showValue\"\n class=\"mint-slider__value\"\n :class=\"valueTone && `mint-slider__value--${valueTone}`\"\n >\n {{ currentValue }}\n </span>\n\n <!-- Range end labels -->\n <div v-if=\"showLabels\" class=\"mint-slider__labels\">\n <span>{{ minLabel ?? min }}</span>\n <span>{{ maxLabel ?? max }}</span>\n </div>\n </div>\n</template>\n","import { computed, toValue, type ComputedRef, type Ref } from 'vue'\n\nexport type SelectionLimitSource<T> =\n | T\n | Ref<T>\n | ComputedRef<T>\n | (() => T)\n\nexport interface UseSelectionLimitOptions {\n count: SelectionLimitSource<number>\n max?: SelectionLimitSource<number | null | undefined>\n}\n\nexport interface UseSelectionLimitReturn {\n count: ComputedRef<number>\n max: ComputedRef<number | undefined>\n isLimited: ComputedRef<boolean>\n isAtLimit: ComputedRef<boolean>\n canAddMore: ComputedRef<boolean>\n remaining: ComputedRef<number | undefined>\n canAdd: (amount?: number, fromCount?: number) => boolean\n}\n\n/** Shared cap logic for chip, tag, and multi-select controls. */\nexport function useSelectionLimit(options: UseSelectionLimitOptions): UseSelectionLimitReturn {\n const count = computed(() => Math.max(0, Math.floor(toValue(options.count) || 0)))\n const max = computed(() => normalizeMax(toValue(options.max)))\n const isLimited = computed(() => max.value !== undefined)\n const remaining = computed(() => {\n if (max.value === undefined) return undefined\n return Math.max(0, max.value - count.value)\n })\n const isAtLimit = computed(() => remaining.value === 0)\n const canAddMore = computed(() => canAdd(1))\n\n function canAdd(amount = 1, fromCount = count.value): boolean {\n const normalizedAmount = Math.max(0, Math.floor(amount))\n const normalizedCount = Math.max(0, Math.floor(fromCount))\n if (max.value === undefined) return true\n return normalizedCount + normalizedAmount <= max.value\n }\n\n return {\n count,\n max,\n isLimited,\n isAtLimit,\n canAddMore,\n remaining,\n canAdd,\n }\n}\n\nfunction normalizeMax(value: number | null | undefined): number | undefined {\n if (value === null || value === undefined || !Number.isFinite(value)) return undefined\n return Math.max(0, Math.floor(value))\n}\n","import { computed, toValue, type ComputedRef, type Ref } from 'vue'\nimport { useSelectionLimit, type SelectionLimitSource } from './useSelectionLimit'\n\nexport type ListSelectionValue = string | number\n\nexport type ListSelectionSource<T> =\n | T\n | Ref<T>\n | ComputedRef<T>\n | (() => T)\n\nexport type WidenListSelectionValue<TValue extends ListSelectionValue> =\n TValue extends string ? string : TValue extends number ? number : TValue\n\nexport interface UseListSelectionOptions<\n TItem,\n TValue extends ListSelectionValue = ListSelectionValue,\n> {\n selected: ListSelectionSource<readonly TValue[]>\n items?: ListSelectionSource<readonly TItem[]>\n getValue?: (item: TItem) => TValue\n disabled?: ListSelectionSource<boolean | null | undefined>\n max?: SelectionLimitSource<number | null | undefined>\n}\n\nexport interface UseListSelectionReturn<TValue extends ListSelectionValue = ListSelectionValue> {\n selectedValues: ComputedRef<TValue[]>\n selectedSet: ComputedRef<Set<TValue>>\n itemValues: ComputedRef<TValue[]>\n selectedCount: ComputedRef<number>\n itemCount: ComputedRef<number>\n isAllSelected: ComputedRef<boolean>\n isLimited: ComputedRef<boolean>\n isAtLimit: ComputedRef<boolean>\n canAddMore: ComputedRef<boolean>\n remaining: ComputedRef<number | undefined>\n isSelected: (value: TValue) => boolean\n isFullySelected: (values: readonly TValue[]) => boolean\n isPartiallySelected: (values: readonly TValue[]) => boolean\n selectValues: (values: readonly TValue[]) => TValue[]\n toggleValue: (value: TValue) => TValue[]\n toggleValues: (values: readonly TValue[]) => TValue[]\n selectAll: () => TValue[]\n toggleAll: () => TValue[]\n clear: () => TValue[]\n}\n\n/** Shared list-selection state for checkbox lists, sample selectors, and chip selectors. */\nexport function useListSelection<\n TItem = ListSelectionValue,\n TValue extends ListSelectionValue = TItem extends ListSelectionValue ? TItem : ListSelectionValue,\n>(options: UseListSelectionOptions<TItem, TValue>): UseListSelectionReturn<WidenListSelectionValue<TValue>> {\n type ResolvedValue = WidenListSelectionValue<TValue>\n\n const disabled = computed(() => toValue(options.disabled) ?? false)\n const selectedValues = computed<ResolvedValue[]>(() => [...toValue(options.selected)] as ResolvedValue[])\n const selectedSet = computed(() => new Set(selectedValues.value))\n const itemValues = computed<ResolvedValue[]>(() => {\n const items = toValue(options.items) ?? []\n return items.map(item => getItemValue(item, options.getValue) as ResolvedValue)\n })\n\n const selectedCount = computed(() => selectedValues.value.length)\n const itemCount = computed(() => itemValues.value.length)\n const isAllSelected = computed(() => (\n itemValues.value.length > 0 && itemValues.value.every(value => selectedSet.value.has(value))\n ))\n const selectionLimit = useSelectionLimit({\n count: selectedCount,\n max: options.max,\n })\n\n function isSelected(value: ResolvedValue): boolean {\n return selectedSet.value.has(value)\n }\n\n function isFullySelected(values: readonly ResolvedValue[]): boolean {\n return values.length > 0 && values.every(value => selectedSet.value.has(value))\n }\n\n function isPartiallySelected(values: readonly ResolvedValue[]): boolean {\n if (values.length === 0) return false\n const selected = values.filter(value => selectedSet.value.has(value)).length\n return selected > 0 && selected < values.length\n }\n\n function selectValues(values: readonly ResolvedValue[]): ResolvedValue[] {\n if (disabled.value) return selectedValues.value\n const missing = uniqueValues(values).filter(value => !selectedSet.value.has(value))\n if (!selectionLimit.canAdd(missing.length)) return selectedValues.value\n return [...selectedValues.value, ...missing]\n }\n\n function toggleValue(value: ResolvedValue): ResolvedValue[] {\n if (disabled.value) return selectedValues.value\n if (selectedSet.value.has(value)) {\n return selectedValues.value.filter(selected => selected !== value)\n }\n if (!selectionLimit.canAddMore.value) return selectedValues.value\n return [...selectedValues.value, value]\n }\n\n function toggleValues(values: readonly ResolvedValue[]): ResolvedValue[] {\n if (disabled.value) return selectedValues.value\n const unique = uniqueValues(values)\n if (isFullySelected(unique)) {\n const remove = new Set(unique)\n return selectedValues.value.filter(value => !remove.has(value))\n }\n return selectValues(unique)\n }\n\n function selectAll(): ResolvedValue[] {\n return selectValues(itemValues.value)\n }\n\n function toggleAll(): ResolvedValue[] {\n if (isAllSelected.value) return clear()\n return selectAll()\n }\n\n function clear(): ResolvedValue[] {\n return disabled.value ? selectedValues.value : []\n }\n\n return {\n selectedValues,\n selectedSet,\n itemValues,\n selectedCount,\n itemCount,\n isAllSelected,\n isLimited: selectionLimit.isLimited,\n isAtLimit: selectionLimit.isAtLimit,\n canAddMore: selectionLimit.canAddMore,\n remaining: selectionLimit.remaining,\n isSelected,\n isFullySelected,\n isPartiallySelected,\n selectValues,\n toggleValue,\n toggleValues,\n selectAll,\n toggleAll,\n clear,\n }\n}\n\nfunction getItemValue<TItem, TValue extends ListSelectionValue>(\n item: TItem,\n getValue: ((item: TItem) => TValue) | undefined,\n): TValue {\n return getValue ? getValue(item) : item as unknown as TValue\n}\n\nfunction uniqueValues<TValue extends ListSelectionValue>(values: readonly TValue[]): TValue[] {\n return [...new Set(values)]\n}\n","<script setup lang=\"ts\">\n/** Lets users select multiple options from a checkbox list with optional selection cap. */\nimport { computed } from 'vue'\nimport type { MultiSelectOption, MultiSelectOptionInput, MultiSelectSize } from '../types'\nimport { useListSelection } from '../composables/useListSelection'\nimport { normalizeOptionInput } from '../utils/options'\n\ninterface Props {\n modelValue: (string | number)[]\n options: MultiSelectOptionInput[]\n placeholder?: string\n disabled?: boolean\n maxSelections?: number\n size?: MultiSelectSize\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n placeholder: 'Select options...',\n disabled: false,\n size: 'md',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: (string | number)[]]\n}>()\n\nconst normalizedOptions = computed<MultiSelectOption[]>(() => props.options.map(normalizeOptionInput))\nconst optionSelection = useListSelection({\n selected: () => props.modelValue,\n items: normalizedOptions,\n getValue: option => option.value,\n disabled: () => props.disabled,\n max: () => props.maxSelections,\n})\nconst canSelectMore = optionSelection.canAddMore\n\nfunction isSelected(value: string | number): boolean {\n return optionSelection.isSelected(value)\n}\n\nfunction toggleOption(option: MultiSelectOption) {\n if (props.disabled || option.disabled) return\n\n if (isSelected(option.value) || canSelectMore.value) {\n emit('update:modelValue', optionSelection.toggleValue(option.value))\n }\n}\n\nfunction handleKeydown(event: KeyboardEvent, option: MultiSelectOption) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n toggleOption(option)\n }\n}\n\nconst selectedLabels = computed(() => {\n return props.modelValue\n .map(v => normalizedOptions.value.find(o => o.value === v)?.label)\n .filter(Boolean)\n})\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-multi-select',\n `mint-multi-select--${size}`,\n disabled ? 'mint-multi-select--disabled' : '',\n ]\"\n >\n <div\n v-if=\"modelValue.length === 0\"\n class=\"mint-multi-select__placeholder\"\n >\n {{ placeholder }}\n </div>\n\n <div class=\"mint-multi-select__options\" role=\"group\">\n <button\n v-for=\"option in normalizedOptions\"\n :key=\"String(option.value)\"\n type=\"button\"\n role=\"checkbox\"\n :aria-checked=\"isSelected(option.value)\"\n :disabled=\"disabled || option.disabled || (!isSelected(option.value) && !canSelectMore)\"\n :class=\"[\n 'mint-multi-select__chip',\n `mint-multi-select__chip--${size}`,\n isSelected(option.value) ? 'mint-multi-select__chip--active' : '',\n option.disabled ? 'mint-multi-select__chip--disabled' : '',\n !isSelected(option.value) && !canSelectMore ? 'mint-multi-select__chip--disabled' : '',\n ]\"\n @click=\"toggleOption(option)\"\n @keydown=\"handleKeydown($event, option)\"\n >\n <svg\n class=\"mint-multi-select__chip-check\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n <span class=\"mint-multi-select__chip-label\">{{ option.label }}</span>\n </button>\n </div>\n\n <div\n v-if=\"modelValue.length > 0\"\n class=\"mint-multi-select__summary\"\n >\n {{ selectedLabels.join(', ') }}\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Lets users select multiple options from a checkbox list with optional selection cap. */\nimport { computed } from 'vue'\nimport type { MultiSelectOption, MultiSelectOptionInput, MultiSelectSize } from '../types'\nimport { useListSelection } from '../composables/useListSelection'\nimport { normalizeOptionInput } from '../utils/options'\n\ninterface Props {\n modelValue: (string | number)[]\n options: MultiSelectOptionInput[]\n placeholder?: string\n disabled?: boolean\n maxSelections?: number\n size?: MultiSelectSize\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n placeholder: 'Select options...',\n disabled: false,\n size: 'md',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: (string | number)[]]\n}>()\n\nconst normalizedOptions = computed<MultiSelectOption[]>(() => props.options.map(normalizeOptionInput))\nconst optionSelection = useListSelection({\n selected: () => props.modelValue,\n items: normalizedOptions,\n getValue: option => option.value,\n disabled: () => props.disabled,\n max: () => props.maxSelections,\n})\nconst canSelectMore = optionSelection.canAddMore\n\nfunction isSelected(value: string | number): boolean {\n return optionSelection.isSelected(value)\n}\n\nfunction toggleOption(option: MultiSelectOption) {\n if (props.disabled || option.disabled) return\n\n if (isSelected(option.value) || canSelectMore.value) {\n emit('update:modelValue', optionSelection.toggleValue(option.value))\n }\n}\n\nfunction handleKeydown(event: KeyboardEvent, option: MultiSelectOption) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n toggleOption(option)\n }\n}\n\nconst selectedLabels = computed(() => {\n return props.modelValue\n .map(v => normalizedOptions.value.find(o => o.value === v)?.label)\n .filter(Boolean)\n})\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-multi-select',\n `mint-multi-select--${size}`,\n disabled ? 'mint-multi-select--disabled' : '',\n ]\"\n >\n <div\n v-if=\"modelValue.length === 0\"\n class=\"mint-multi-select__placeholder\"\n >\n {{ placeholder }}\n </div>\n\n <div class=\"mint-multi-select__options\" role=\"group\">\n <button\n v-for=\"option in normalizedOptions\"\n :key=\"String(option.value)\"\n type=\"button\"\n role=\"checkbox\"\n :aria-checked=\"isSelected(option.value)\"\n :disabled=\"disabled || option.disabled || (!isSelected(option.value) && !canSelectMore)\"\n :class=\"[\n 'mint-multi-select__chip',\n `mint-multi-select__chip--${size}`,\n isSelected(option.value) ? 'mint-multi-select__chip--active' : '',\n option.disabled ? 'mint-multi-select__chip--disabled' : '',\n !isSelected(option.value) && !canSelectMore ? 'mint-multi-select__chip--disabled' : '',\n ]\"\n @click=\"toggleOption(option)\"\n @keydown=\"handleKeydown($event, option)\"\n >\n <svg\n class=\"mint-multi-select__chip-check\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n <span class=\"mint-multi-select__chip-label\">{{ option.label }}</span>\n </button>\n </div>\n\n <div\n v-if=\"modelValue.length > 0\"\n class=\"mint-multi-select__summary\"\n >\n {{ selectedLabels.join(', ') }}\n </div>\n </div>\n</template>\n","import { computed, ref, type ComputedRef, type Ref } from 'vue'\n\nexport interface CalendarGridDay {\n date: Date\n isCurrentMonth: boolean\n isDisabled: boolean\n}\n\nexport interface UseCalendarGridOptions {\n min?: () => string | undefined\n max?: () => string | undefined\n locale?: () => string | undefined\n}\n\nexport interface UseCalendarGridReturn {\n currentMonth: Ref<Date>\n weekDays: readonly string[]\n monthYear: ComputedRef<string>\n calendarDays: ComputedRef<CalendarGridDay[]>\n isDateDisabled: (date: Date) => boolean\n isSameDay: (date: Date, other: Date | null | undefined) => boolean\n isToday: (date: Date) => boolean\n formatDateValue: (date: Date) => string\n setCurrentMonthFromDate: (date: Date) => void\n prevMonth: () => void\n nextMonth: () => void\n}\n\nconst WEEK_DAYS = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'] as const\n\n/** Shared calendar grid state for date and datetime pickers. */\nexport function useCalendarGrid(options: UseCalendarGridOptions = {}): UseCalendarGridReturn {\n const currentMonth = ref(new Date())\n\n const monthYear = computed(() => {\n return currentMonth.value.toLocaleDateString(options.locale?.() ?? 'en-US', {\n year: 'numeric',\n month: 'long',\n })\n })\n\n const calendarDays = computed<CalendarGridDay[]>(() => {\n const year = currentMonth.value.getFullYear()\n const month = currentMonth.value.getMonth()\n const firstDay = new Date(year, month, 1)\n const lastDay = new Date(year, month + 1, 0)\n const days: CalendarGridDay[] = []\n\n const startPadding = firstDay.getDay()\n for (let i = startPadding - 1; i >= 0; i--) {\n const date = new Date(year, month, -i)\n days.push({ date, isCurrentMonth: false, isDisabled: isDateDisabled(date) })\n }\n\n for (let i = 1; i <= lastDay.getDate(); i++) {\n const date = new Date(year, month, i)\n days.push({ date, isCurrentMonth: true, isDisabled: isDateDisabled(date) })\n }\n\n const endPadding = 42 - days.length\n for (let i = 1; i <= endPadding; i++) {\n const date = new Date(year, month + 1, i)\n days.push({ date, isCurrentMonth: false, isDisabled: isDateDisabled(date) })\n }\n\n return days\n })\n\n function isDateDisabled(date: Date): boolean {\n const minDate = parseBoundaryDate(options.min?.())\n if (minDate && startOfDay(date) < startOfDay(minDate)) return true\n\n const maxDate = parseBoundaryDate(options.max?.())\n if (maxDate && startOfDay(date) > startOfDay(maxDate)) return true\n\n return false\n }\n\n function isSameDay(date: Date, other: Date | null | undefined): boolean {\n if (!other) return false\n return date.toDateString() === other.toDateString()\n }\n\n function isToday(date: Date): boolean {\n return isSameDay(date, new Date())\n }\n\n function formatDateValue(date: Date): string {\n const year = date.getFullYear()\n const month = String(date.getMonth() + 1).padStart(2, '0')\n const day = String(date.getDate()).padStart(2, '0')\n return `${year}-${month}-${day}`\n }\n\n function setCurrentMonthFromDate(date: Date): void {\n currentMonth.value = new Date(date.getFullYear(), date.getMonth(), 1)\n }\n\n function prevMonth(): void {\n currentMonth.value = new Date(\n currentMonth.value.getFullYear(),\n currentMonth.value.getMonth() - 1,\n 1,\n )\n }\n\n function nextMonth(): void {\n currentMonth.value = new Date(\n currentMonth.value.getFullYear(),\n currentMonth.value.getMonth() + 1,\n 1,\n )\n }\n\n return {\n currentMonth,\n weekDays: WEEK_DAYS,\n monthYear,\n calendarDays,\n isDateDisabled,\n isSameDay,\n isToday,\n formatDateValue,\n setCurrentMonthFromDate,\n prevMonth,\n nextMonth,\n }\n}\n\nfunction parseBoundaryDate(value: string | undefined): Date | null {\n if (!value) return null\n const date = value.includes('T') ? new Date(value) : new Date(`${value}T00:00:00`)\n return Number.isNaN(date.getTime()) ? null : date\n}\n\nfunction startOfDay(date: Date): Date {\n const copy = new Date(date)\n copy.setHours(0, 0, 0, 0)\n return copy\n}\n","import { nextTick, ref, type Ref } from 'vue'\nimport { useEventListener } from './useEventListener'\n\nexport interface UseDropdownStateOptions {\n closeOnOutsideClick?: boolean\n closeOnEscape?: boolean\n /** Close the panel when the page scrolls or the viewport resizes. Default `false`. */\n closeOnScroll?: boolean\n insideRefs?: Array<Ref<HTMLElement | null>>\n /**\n * Element that counts as \"inside\" for outside-click closing, typically a\n * `useTemplateRef()`. Without one, bind the returned `rootRef` instead.\n */\n rootRef?: Ref<HTMLElement | null>\n /**\n * Element focus returns to when the panel closes with `close(true)` (Escape).\n * Pass one when the trigger lives outside `rootRef`; otherwise bind the\n * returned `triggerRef` to the trigger element.\n */\n triggerRef?: Ref<HTMLElement | null>\n onOpen?: () => void\n onClose?: () => void\n}\n\nexport interface UseDropdownStateReturn {\n isOpen: Ref<boolean>\n rootRef: Ref<HTMLElement | null>\n /** Bind to the trigger element so Escape can return focus to it. */\n triggerRef: Ref<HTMLElement | null>\n open: () => void\n /** Closes the panel; `returnFocus` moves focus back to `triggerRef`. */\n close: (returnFocus?: boolean) => void\n toggle: () => void\n handleClickOutside: (event: MouseEvent) => void\n handleKeydown: (event: KeyboardEvent) => void\n}\n\n/**\n * Shared disclosure state for dropdown-style SDK components: open/close state,\n * outside-click and Escape closing, optional scroll/resize closing, and focus\n * return to the trigger. `close(returnFocus)` mirrors `useMenuKeyboard`'s\n * contract, so the two compose directly.\n */\nexport function useDropdownState(options: UseDropdownStateOptions = {}): UseDropdownStateReturn {\n const isOpen = ref(false)\n const rootRef = options.rootRef ?? ref<HTMLElement | null>(null)\n const triggerRef = options.triggerRef ?? ref<HTMLElement | null>(null)\n const closeOnOutsideClick = options.closeOnOutsideClick ?? true\n const closeOnEscape = options.closeOnEscape ?? true\n const closeOnScroll = options.closeOnScroll ?? false\n\n function open(): void {\n if (isOpen.value) return\n isOpen.value = true\n options.onOpen?.()\n }\n\n function close(returnFocus = false): void {\n if (!isOpen.value) return\n isOpen.value = false\n options.onClose?.()\n if (returnFocus) {\n void nextTick(() => triggerRef.value?.focus())\n }\n }\n\n function toggle(): void {\n if (isOpen.value) {\n close()\n } else {\n open()\n }\n }\n\n function handleClickOutside(event: MouseEvent): void {\n if (!closeOnOutsideClick || !isOpen.value || !rootRef.value) return\n const target = event.target\n if (\n target instanceof Node &&\n !rootRef.value.contains(target) &&\n !options.insideRefs?.some(ref => ref.value?.contains(target))\n ) {\n close()\n }\n }\n\n function handleKeydown(event: KeyboardEvent): void {\n if (closeOnEscape && event.key === 'Escape') {\n close(true)\n }\n }\n\n function handleViewportChange(): void {\n if (isOpen.value) close()\n }\n\n if (closeOnOutsideClick) {\n useEventListener(() => document, 'click', handleClickOutside)\n }\n if (closeOnEscape) {\n useEventListener(() => document, 'keydown', handleKeydown)\n }\n if (closeOnScroll) {\n useEventListener(() => window, 'scroll', handleViewportChange, true)\n useEventListener(() => window, 'resize', handleViewportChange)\n }\n\n return {\n isOpen,\n rootRef,\n triggerRef,\n open,\n close,\n toggle,\n handleClickOutside,\n handleKeydown,\n }\n}\n","<script setup lang=\"ts\">\n/** Shared calendar grid panel used by date-oriented picker components. */\nimport type { CalendarGridDay } from '../../composables/useCalendarGrid'\n\ninterface Props {\n weekDays: readonly string[]\n monthYear: string\n days: CalendarGridDay[]\n selectedDate?: Date | null\n locale?: string\n previousLabel?: string\n nextLabel?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n selectedDate: null,\n locale: 'en-US',\n previousLabel: 'Previous month',\n nextLabel: 'Next month',\n})\n\nconst emit = defineEmits<{\n 'previous-month': []\n 'next-month': []\n select: [day: CalendarGridDay]\n}>()\n\nfunction isSameDay(date: Date, other: Date | null | undefined): boolean {\n if (!other) return false\n return date.toDateString() === other.toDateString()\n}\n\nfunction isToday(date: Date): boolean {\n return isSameDay(date, new Date())\n}\n\nfunction dayAriaLabel(date: Date): string {\n return date.toLocaleDateString(props.locale, {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n })\n}\n</script>\n\n<template>\n <div class=\"mint-calendar-grid-panel\">\n <div class=\"mint-date-picker__header\">\n <button\n type=\"button\"\n class=\"mint-date-picker__nav-btn\"\n :aria-label=\"previousLabel\"\n @click=\"emit('previous-month')\"\n >\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n </button>\n <span class=\"mint-date-picker__month-year\">{{ monthYear }}</span>\n <button\n type=\"button\"\n class=\"mint-date-picker__nav-btn\"\n :aria-label=\"nextLabel\"\n @click=\"emit('next-month')\"\n >\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n </button>\n </div>\n\n <div class=\"mint-date-picker__weekdays\">\n <div\n v-for=\"day in weekDays\"\n :key=\"day\"\n class=\"mint-date-picker__weekday\"\n >\n {{ day }}\n </div>\n </div>\n\n <div class=\"mint-date-picker__grid\">\n <button\n v-for=\"(day, index) in days\"\n :key=\"index\"\n type=\"button\"\n :disabled=\"day.isDisabled\"\n :aria-label=\"dayAriaLabel(day.date)\"\n :aria-selected=\"isSameDay(day.date, selectedDate)\"\n :class=\"[\n 'mint-date-picker__day',\n !day.isCurrentMonth ? 'mint-date-picker__day--other-month' : '',\n day.isDisabled ? 'mint-date-picker__day--disabled' : '',\n isSameDay(day.date, selectedDate) ? 'mint-date-picker__day--selected' : '',\n isToday(day.date) ? 'mint-date-picker__day--today' : '',\n ]\"\n @click=\"emit('select', day)\"\n >\n {{ day.date.getDate() }}\n </button>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Shared calendar grid panel used by date-oriented picker components. */\nimport type { CalendarGridDay } from '../../composables/useCalendarGrid'\n\ninterface Props {\n weekDays: readonly string[]\n monthYear: string\n days: CalendarGridDay[]\n selectedDate?: Date | null\n locale?: string\n previousLabel?: string\n nextLabel?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n selectedDate: null,\n locale: 'en-US',\n previousLabel: 'Previous month',\n nextLabel: 'Next month',\n})\n\nconst emit = defineEmits<{\n 'previous-month': []\n 'next-month': []\n select: [day: CalendarGridDay]\n}>()\n\nfunction isSameDay(date: Date, other: Date | null | undefined): boolean {\n if (!other) return false\n return date.toDateString() === other.toDateString()\n}\n\nfunction isToday(date: Date): boolean {\n return isSameDay(date, new Date())\n}\n\nfunction dayAriaLabel(date: Date): string {\n return date.toLocaleDateString(props.locale, {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n })\n}\n</script>\n\n<template>\n <div class=\"mint-calendar-grid-panel\">\n <div class=\"mint-date-picker__header\">\n <button\n type=\"button\"\n class=\"mint-date-picker__nav-btn\"\n :aria-label=\"previousLabel\"\n @click=\"emit('previous-month')\"\n >\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n </button>\n <span class=\"mint-date-picker__month-year\">{{ monthYear }}</span>\n <button\n type=\"button\"\n class=\"mint-date-picker__nav-btn\"\n :aria-label=\"nextLabel\"\n @click=\"emit('next-month')\"\n >\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n </button>\n </div>\n\n <div class=\"mint-date-picker__weekdays\">\n <div\n v-for=\"day in weekDays\"\n :key=\"day\"\n class=\"mint-date-picker__weekday\"\n >\n {{ day }}\n </div>\n </div>\n\n <div class=\"mint-date-picker__grid\">\n <button\n v-for=\"(day, index) in days\"\n :key=\"index\"\n type=\"button\"\n :disabled=\"day.isDisabled\"\n :aria-label=\"dayAriaLabel(day.date)\"\n :aria-selected=\"isSameDay(day.date, selectedDate)\"\n :class=\"[\n 'mint-date-picker__day',\n !day.isCurrentMonth ? 'mint-date-picker__day--other-month' : '',\n day.isDisabled ? 'mint-date-picker__day--disabled' : '',\n isSameDay(day.date, selectedDate) ? 'mint-date-picker__day--selected' : '',\n isToday(day.date) ? 'mint-date-picker__day--today' : '',\n ]\"\n @click=\"emit('select', day)\"\n >\n {{ day.date.getDate() }}\n </button>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Input that opens a calendar dropdown for selecting a single date, with clearable support. */\nimport { autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom'\nimport { ref, computed, nextTick, onBeforeUnmount, watch, useTemplateRef } from 'vue'\nimport { useCalendarGrid, type CalendarGridDay } from '../composables/useCalendarGrid'\nimport { useDropdownState } from '../composables/useDropdownState'\nimport { useFocusTrap } from '../composables/useFocusTrap'\nimport CalendarGridPanelInternal from './internal/CalendarGridPanelInternal.vue'\n\ninterface Props {\n modelValue?: string\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n min?: string\n max?: string\n clearable?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n disabled: false,\n error: false,\n size: 'md',\n clearable: true,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | undefined]\n}>()\n\nconst dropdownRef = ref<HTMLElement | null>(null)\nconst dropdownStyle = ref<Record<string, string>>({})\nconst { isOpen, triggerRef, open, close, toggle } = useDropdownState({\n rootRef: useTemplateRef<HTMLElement>('container'),\n insideRefs: [dropdownRef],\n})\n// The panel is a non-modal dialog: Tab cycles inside it while it is open, and\n// focus returns to the input when it closes.\nuseFocusTrap({ containerRef: dropdownRef, active: isOpen })\nconst {\n weekDays,\n monthYear,\n calendarDays,\n isDateDisabled,\n formatDateValue,\n setCurrentMonthFromDate,\n prevMonth,\n nextMonth,\n} = useCalendarGrid({\n min: () => props.min,\n max: () => props.max,\n})\n\nconst selectedDate = computed(() => {\n if (!props.modelValue) return null\n const date = new Date(props.modelValue + 'T00:00:00')\n return isNaN(date.getTime()) ? null : date\n})\n\nconst displayValue = computed(() => {\n if (!selectedDate.value) return ''\n return selectedDate.value.toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n })\n})\n\nfunction selectDate(day: CalendarGridDay) {\n if (day.isDisabled || props.disabled) return\n emit('update:modelValue', formatDateValue(day.date))\n close()\n}\n\nfunction goToToday() {\n const today = new Date()\n setCurrentMonthFromDate(today)\n if (!isDateDisabled(today)) {\n emit('update:modelValue', formatDateValue(today))\n close()\n }\n}\n\nfunction clear() {\n emit('update:modelValue', undefined)\n close()\n}\n\nfunction toggleCalendar() {\n if (props.disabled) return\n toggle()\n}\n\nfunction handleTriggerKeydown(event: KeyboardEvent) {\n if (props.disabled || isOpen.value) return\n if (event.key === 'Enter' || event.key === ' ' || event.key === 'ArrowDown') {\n event.preventDefault()\n open()\n }\n}\n\n// floating-ui keeps the panel anchored (flip/shift) while the page scrolls,\n// instead of the panel closing on every scroll or resize.\nlet stopAutoUpdate: (() => void) | null = null\n\nasync function updateDropdownPosition() {\n const trigger = triggerRef.value\n const panel = dropdownRef.value\n if (!trigger || !panel) return\n\n const { x, y } = await computePosition(trigger, panel, {\n placement: 'bottom-start',\n strategy: 'fixed',\n middleware: [offset(4), flip(), shift({ padding: 8 })],\n })\n dropdownStyle.value = {\n position: 'fixed',\n top: `${y}px`,\n left: `${x}px`,\n zIndex: '9999',\n }\n}\n\nfunction stopPositioning() {\n stopAutoUpdate?.()\n stopAutoUpdate = null\n}\n\nfunction startPositioning() {\n const trigger = triggerRef.value\n const panel = dropdownRef.value\n if (!trigger || !panel) return\n stopPositioning()\n stopAutoUpdate = autoUpdate(trigger, panel, () => void updateDropdownPosition())\n}\n\n/** Moves focus into the calendar grid: selected day, else today, else the first day. */\nfunction focusCalendar() {\n const panel = dropdownRef.value\n if (!panel) return\n const target =\n panel.querySelector<HTMLElement>('.mint-date-picker__day--selected') ??\n panel.querySelector<HTMLElement>('.mint-date-picker__day--today') ??\n panel.querySelector<HTMLElement>('.mint-date-picker__day:not([disabled])')\n target?.focus()\n}\n\nwatch(isOpen, async (opened) => {\n if (!opened) {\n stopPositioning()\n return\n }\n if (selectedDate.value) {\n setCurrentMonthFromDate(selectedDate.value)\n }\n await nextTick()\n startPositioning()\n // A second tick so this focus lands after the focus trap's initial focus.\n await nextTick()\n focusCalendar()\n})\n\nonBeforeUnmount(stopPositioning)\n</script>\n\n<template>\n <div ref=\"container\" class=\"mint-date-picker\">\n <div class=\"mint-date-picker__input-wrapper\">\n <input\n ref=\"triggerRef\"\n type=\"text\"\n readonly\n aria-haspopup=\"dialog\"\n :aria-expanded=\"isOpen\"\n :value=\"displayValue\"\n :placeholder=\"placeholder || 'Select date'\"\n :disabled=\"disabled\"\n :class=\"[\n 'mint-date-picker__input',\n `mint-date-picker__input--${size}`,\n error ? 'mint-date-picker__input--error' : '',\n disabled ? 'mint-date-picker__input--disabled' : '',\n ]\"\n @click=\"toggleCalendar\"\n @keydown=\"handleTriggerKeydown\"\n />\n <div class=\"mint-date-picker__icon\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M8 2v4\" /><path d=\"M16 2v4\" /><rect width=\"18\" height=\"18\" x=\"3\" y=\"4\" rx=\"2\" /><path d=\"M3 10h18\" />\n </svg>\n </div>\n </div>\n\n <Teleport to=\"body\">\n <Transition\n enter-active-class=\"mint-date-picker__dropdown-enter-active\"\n enter-from-class=\"mint-date-picker__dropdown-enter-from\"\n enter-to-class=\"mint-date-picker__dropdown-enter-to\"\n leave-active-class=\"mint-date-picker__dropdown-leave-active\"\n leave-from-class=\"mint-date-picker__dropdown-leave-from\"\n leave-to-class=\"mint-date-picker__dropdown-leave-to\"\n >\n <div\n v-if=\"isOpen\"\n ref=\"dropdownRef\"\n class=\"mint-popover mint-date-picker__dropdown\"\n :style=\"dropdownStyle\"\n role=\"dialog\"\n aria-label=\"Date picker\"\n >\n <CalendarGridPanelInternal\n :week-days=\"weekDays\"\n :month-year=\"monthYear\"\n :days=\"calendarDays\"\n :selected-date=\"selectedDate\"\n @previous-month=\"prevMonth\"\n @next-month=\"nextMonth\"\n @select=\"selectDate\"\n />\n\n <div class=\"mint-date-picker__footer\">\n <button\n type=\"button\"\n class=\"mint-date-picker__footer-btn mint-date-picker__today-btn\"\n @click=\"goToToday\"\n >\n Today\n </button>\n <button\n v-if=\"clearable && modelValue\"\n type=\"button\"\n class=\"mint-date-picker__footer-btn mint-date-picker__clear-btn\"\n @click=\"clear\"\n >\n Clear\n </button>\n </div>\n </div>\n </Transition>\n </Teleport>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Input that opens a calendar dropdown for selecting a single date, with clearable support. */\nimport { autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom'\nimport { ref, computed, nextTick, onBeforeUnmount, watch, useTemplateRef } from 'vue'\nimport { useCalendarGrid, type CalendarGridDay } from '../composables/useCalendarGrid'\nimport { useDropdownState } from '../composables/useDropdownState'\nimport { useFocusTrap } from '../composables/useFocusTrap'\nimport CalendarGridPanelInternal from './internal/CalendarGridPanelInternal.vue'\n\ninterface Props {\n modelValue?: string\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n min?: string\n max?: string\n clearable?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n disabled: false,\n error: false,\n size: 'md',\n clearable: true,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | undefined]\n}>()\n\nconst dropdownRef = ref<HTMLElement | null>(null)\nconst dropdownStyle = ref<Record<string, string>>({})\nconst { isOpen, triggerRef, open, close, toggle } = useDropdownState({\n rootRef: useTemplateRef<HTMLElement>('container'),\n insideRefs: [dropdownRef],\n})\n// The panel is a non-modal dialog: Tab cycles inside it while it is open, and\n// focus returns to the input when it closes.\nuseFocusTrap({ containerRef: dropdownRef, active: isOpen })\nconst {\n weekDays,\n monthYear,\n calendarDays,\n isDateDisabled,\n formatDateValue,\n setCurrentMonthFromDate,\n prevMonth,\n nextMonth,\n} = useCalendarGrid({\n min: () => props.min,\n max: () => props.max,\n})\n\nconst selectedDate = computed(() => {\n if (!props.modelValue) return null\n const date = new Date(props.modelValue + 'T00:00:00')\n return isNaN(date.getTime()) ? null : date\n})\n\nconst displayValue = computed(() => {\n if (!selectedDate.value) return ''\n return selectedDate.value.toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n })\n})\n\nfunction selectDate(day: CalendarGridDay) {\n if (day.isDisabled || props.disabled) return\n emit('update:modelValue', formatDateValue(day.date))\n close()\n}\n\nfunction goToToday() {\n const today = new Date()\n setCurrentMonthFromDate(today)\n if (!isDateDisabled(today)) {\n emit('update:modelValue', formatDateValue(today))\n close()\n }\n}\n\nfunction clear() {\n emit('update:modelValue', undefined)\n close()\n}\n\nfunction toggleCalendar() {\n if (props.disabled) return\n toggle()\n}\n\nfunction handleTriggerKeydown(event: KeyboardEvent) {\n if (props.disabled || isOpen.value) return\n if (event.key === 'Enter' || event.key === ' ' || event.key === 'ArrowDown') {\n event.preventDefault()\n open()\n }\n}\n\n// floating-ui keeps the panel anchored (flip/shift) while the page scrolls,\n// instead of the panel closing on every scroll or resize.\nlet stopAutoUpdate: (() => void) | null = null\n\nasync function updateDropdownPosition() {\n const trigger = triggerRef.value\n const panel = dropdownRef.value\n if (!trigger || !panel) return\n\n const { x, y } = await computePosition(trigger, panel, {\n placement: 'bottom-start',\n strategy: 'fixed',\n middleware: [offset(4), flip(), shift({ padding: 8 })],\n })\n dropdownStyle.value = {\n position: 'fixed',\n top: `${y}px`,\n left: `${x}px`,\n zIndex: '9999',\n }\n}\n\nfunction stopPositioning() {\n stopAutoUpdate?.()\n stopAutoUpdate = null\n}\n\nfunction startPositioning() {\n const trigger = triggerRef.value\n const panel = dropdownRef.value\n if (!trigger || !panel) return\n stopPositioning()\n stopAutoUpdate = autoUpdate(trigger, panel, () => void updateDropdownPosition())\n}\n\n/** Moves focus into the calendar grid: selected day, else today, else the first day. */\nfunction focusCalendar() {\n const panel = dropdownRef.value\n if (!panel) return\n const target =\n panel.querySelector<HTMLElement>('.mint-date-picker__day--selected') ??\n panel.querySelector<HTMLElement>('.mint-date-picker__day--today') ??\n panel.querySelector<HTMLElement>('.mint-date-picker__day:not([disabled])')\n target?.focus()\n}\n\nwatch(isOpen, async (opened) => {\n if (!opened) {\n stopPositioning()\n return\n }\n if (selectedDate.value) {\n setCurrentMonthFromDate(selectedDate.value)\n }\n await nextTick()\n startPositioning()\n // A second tick so this focus lands after the focus trap's initial focus.\n await nextTick()\n focusCalendar()\n})\n\nonBeforeUnmount(stopPositioning)\n</script>\n\n<template>\n <div ref=\"container\" class=\"mint-date-picker\">\n <div class=\"mint-date-picker__input-wrapper\">\n <input\n ref=\"triggerRef\"\n type=\"text\"\n readonly\n aria-haspopup=\"dialog\"\n :aria-expanded=\"isOpen\"\n :value=\"displayValue\"\n :placeholder=\"placeholder || 'Select date'\"\n :disabled=\"disabled\"\n :class=\"[\n 'mint-date-picker__input',\n `mint-date-picker__input--${size}`,\n error ? 'mint-date-picker__input--error' : '',\n disabled ? 'mint-date-picker__input--disabled' : '',\n ]\"\n @click=\"toggleCalendar\"\n @keydown=\"handleTriggerKeydown\"\n />\n <div class=\"mint-date-picker__icon\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M8 2v4\" /><path d=\"M16 2v4\" /><rect width=\"18\" height=\"18\" x=\"3\" y=\"4\" rx=\"2\" /><path d=\"M3 10h18\" />\n </svg>\n </div>\n </div>\n\n <Teleport to=\"body\">\n <Transition\n enter-active-class=\"mint-date-picker__dropdown-enter-active\"\n enter-from-class=\"mint-date-picker__dropdown-enter-from\"\n enter-to-class=\"mint-date-picker__dropdown-enter-to\"\n leave-active-class=\"mint-date-picker__dropdown-leave-active\"\n leave-from-class=\"mint-date-picker__dropdown-leave-from\"\n leave-to-class=\"mint-date-picker__dropdown-leave-to\"\n >\n <div\n v-if=\"isOpen\"\n ref=\"dropdownRef\"\n class=\"mint-popover mint-date-picker__dropdown\"\n :style=\"dropdownStyle\"\n role=\"dialog\"\n aria-label=\"Date picker\"\n >\n <CalendarGridPanelInternal\n :week-days=\"weekDays\"\n :month-year=\"monthYear\"\n :days=\"calendarDays\"\n :selected-date=\"selectedDate\"\n @previous-month=\"prevMonth\"\n @next-month=\"nextMonth\"\n @select=\"selectDate\"\n />\n\n <div class=\"mint-date-picker__footer\">\n <button\n type=\"button\"\n class=\"mint-date-picker__footer-btn mint-date-picker__today-btn\"\n @click=\"goToToday\"\n >\n Today\n </button>\n <button\n v-if=\"clearable && modelValue\"\n type=\"button\"\n class=\"mint-date-picker__footer-btn mint-date-picker__clear-btn\"\n @click=\"clear\"\n >\n Clear\n </button>\n </div>\n </div>\n </Transition>\n </Teleport>\n </div>\n</template>\n","import type { TimeRange } from '../types/components'\n\nexport function parseTime(time: string): { hour: number; minute: number } {\n const [h, m] = time.split(':').map(Number)\n return { hour: h, minute: m }\n}\n\nexport function formatTime(hour: number, minute: number, format: '12h' | '24h' = '24h'): string {\n if (format === '24h') {\n return `${String(hour).padStart(2, '0')}:${String(minute).padStart(2, '0')}`\n }\n const period = hour >= 12 ? 'PM' : 'AM'\n const h12 = hour === 0 ? 12 : hour > 12 ? hour - 12 : hour\n return `${h12}:${String(minute).padStart(2, '0')} ${period}`\n}\n\nexport function formatTimeSlot(time: string, format: '12h' | '24h' = '24h'): string {\n const { hour, minute } = parseTime(time)\n return formatTime(hour, minute, format)\n}\n\nexport function generateTimeSlots(start: string, end: string, stepMinutes: number): string[] {\n const slots: string[] = []\n const s = parseTime(start)\n const e = parseTime(end)\n const startMin = s.hour * 60 + s.minute\n const endMin = e.hour * 60 + e.minute\n\n for (let m = startMin; m <= endMin; m += stepMinutes) {\n const hour = Math.floor(m / 60)\n const minute = m % 60\n if (hour >= 24) break\n slots.push(formatTime(hour, minute))\n }\n return slots\n}\n\nexport function rangesOverlap(a: TimeRange, b: TimeRange): boolean {\n const aStart = toMinutes(a.start)\n const aEnd = toMinutes(a.end)\n const bStart = toMinutes(b.start)\n const bEnd = toMinutes(b.end)\n return aStart < bEnd && bStart < aEnd\n}\n\nexport function durationMinutes(start: string, end: string): number {\n return toMinutes(end) - toMinutes(start)\n}\n\nexport function formatDuration(minutes: number): string {\n if (minutes < 0) return '-' + formatDuration(-minutes)\n const h = Math.floor(minutes / 60)\n const m = minutes % 60\n if (h === 0) return `${m}m`\n if (m === 0) return `${h}h`\n return `${h}h ${m}m`\n}\n\nexport function isTimeInRange(time: string, start: string, end: string): boolean {\n const t = toMinutes(time)\n return t >= toMinutes(start) && t <= toMinutes(end)\n}\n\nexport function findAvailableSlots(\n dayStart: string,\n dayEnd: string,\n occupied: TimeRange[],\n minDuration: number,\n): TimeRange[] {\n const sorted = [...occupied].sort((a, b) => toMinutes(a.start) - toMinutes(b.start))\n const available: TimeRange[] = []\n let cursor = toMinutes(dayStart)\n const end = toMinutes(dayEnd)\n\n for (const slot of sorted) {\n const slotStart = toMinutes(slot.start)\n const slotEnd = toMinutes(slot.end)\n if (slotStart > cursor && slotStart - cursor >= minDuration) {\n available.push({ start: fromMinutes(cursor), end: fromMinutes(slotStart) })\n }\n cursor = Math.max(cursor, slotEnd)\n }\n\n if (end > cursor && end - cursor >= minDuration) {\n available.push({ start: fromMinutes(cursor), end: fromMinutes(end) })\n }\n\n return available\n}\n\nexport function snapToSlot(time: string, stepMinutes: number): string {\n const total = toMinutes(time)\n const snapped = Math.round(total / stepMinutes) * stepMinutes\n return fromMinutes(snapped)\n}\n\nexport function addMinutes(time: string, minutes: number): string {\n const total = toMinutes(time) + minutes\n return fromMinutes(Math.max(0, Math.min(total, 24 * 60 - 1)))\n}\n\nexport function compareTime(a: string, b: string): number {\n const ma = toMinutes(a)\n const mb = toMinutes(b)\n if (ma < mb) return -1\n if (ma > mb) return 1\n return 0\n}\n\nexport function findNearestTimeSlotIndex(time: string, slots: readonly string[]): number {\n if (slots.length === 0) return -1\n const target = toMinutes(time)\n let bestIndex = 0\n let bestDiff = Infinity\n for (let index = 0; index < slots.length; index++) {\n const diff = Math.abs(toMinutes(slots[index]) - target)\n if (diff < bestDiff) {\n bestDiff = diff\n bestIndex = index\n }\n }\n return bestIndex\n}\n\nexport function toMinutes(time: string): number {\n const { hour, minute } = parseTime(time)\n return hour * 60 + minute\n}\n\nexport function fromMinutes(total: number): string {\n const hour = Math.floor(total / 60) % 24\n const minute = total % 60\n return formatTime(hour, minute)\n}\n\n/** Time utility helpers for parsing, formatting, comparing, and snapping HH:MM strings. */\nexport function useTimeUtils() {\n return {\n parseTime,\n formatTime,\n formatTimeSlot,\n generateTimeSlots,\n rangesOverlap,\n durationMinutes,\n formatDuration,\n isTimeInRange,\n findAvailableSlots,\n snapToSlot,\n addMinutes,\n compareTime,\n findNearestTimeSlotIndex,\n toMinutes,\n fromMinutes,\n }\n}\n","<script setup lang=\"ts\">\n/** Input that opens a scrollable time-slot dropdown in 12h or 24h format, with min/max range and optional unavailable slots. */\nimport { ref, computed, watch, nextTick, useId, useTemplateRef } from 'vue'\nimport type { TimeSlotDisabledFn } from '../types'\nimport { useDropdownState } from '../composables/useDropdownState'\nimport {\n compareTime,\n findNearestTimeSlotIndex,\n formatTimeSlot,\n generateTimeSlots,\n} from '../composables/useTimeUtils'\n\ninterface Props {\n modelValue?: string\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n min?: string\n max?: string\n step?: number\n format?: '12h' | '24h'\n clearable?: boolean\n /** Marks slots unavailable; a returned string is shown inline as the reason. */\n disabledSlots?: TimeSlotDisabledFn\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n placeholder: 'Select time',\n disabled: false,\n error: false,\n size: 'md',\n step: 15,\n format: '24h',\n clearable: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | undefined]\n}>()\n\nconst listRef = ref<HTMLUListElement | null>(null)\nconst highlightedIndex = ref(-1)\nconst listboxId = `mint-time-picker-listbox-${useId().replace(/:/g, '')}`\nconst { isOpen, open, close, toggle } = useDropdownState({\n rootRef: useTemplateRef<HTMLElement>('root'),\n triggerRef: useTemplateRef<HTMLElement>('trigger'),\n})\n\n/** Id of the highlighted slot, published to the input as `aria-activedescendant`. */\nconst activeSlotId = computed(() =>\n isOpen.value && highlightedIndex.value >= 0\n ? `${listboxId}-option-${highlightedIndex.value}`\n : undefined,\n)\n\nconst slots = computed(() => {\n const start = props.min ?? '00:00'\n const end = props.max ?? '23:59'\n return generateTimeSlots(start, end, props.step)\n})\n\nconst displayValue = computed(() => {\n if (!props.modelValue) return ''\n return formatTimeSlot(props.modelValue, props.format)\n})\n\nfunction isSlotDisabled(slot: string): boolean {\n if (props.min && compareTime(slot, props.min) < 0) return true\n if (props.max && compareTime(slot, props.max) > 0) return true\n return !!props.disabledSlots?.(slot)\n}\n\nfunction slotReason(slot: string): string | undefined {\n const result = props.disabledSlots?.(slot)\n return typeof result === 'string' && result ? result : undefined\n}\n\nfunction selectSlot(slot: string) {\n if (isSlotDisabled(slot) || props.disabled) return\n emit('update:modelValue', slot)\n close()\n}\n\nfunction clear() {\n emit('update:modelValue', undefined)\n close()\n}\n\nfunction toggleDropdown() {\n if (props.disabled) return\n toggle()\n}\n\nfunction scrollToActiveSlot() {\n nextTick(() => {\n if (!listRef.value) return\n const activeEl = listRef.value.querySelector('.mint-time-picker__slot--active') as HTMLElement | null\n if (activeEl) {\n activeEl.scrollIntoView({ block: 'center' })\n } else if (props.modelValue) {\n // Scroll to nearest slot\n const nearestIndex = findNearestSlotIndex(props.modelValue)\n if (nearestIndex >= 0) {\n const children = listRef.value.children\n if (children[nearestIndex]) {\n (children[nearestIndex] as HTMLElement).scrollIntoView({ block: 'center' })\n }\n }\n }\n })\n}\n\nfunction findNearestSlotIndex(time: string): number {\n return findNearestTimeSlotIndex(time, slots.value)\n}\n\nfunction handleKeydown(event: KeyboardEvent) {\n if (!isOpen.value) {\n if (event.key === 'Enter' || event.key === ' ' || event.key === 'ArrowDown') {\n event.preventDefault()\n open()\n return\n }\n return\n }\n\n switch (event.key) {\n case 'ArrowDown': {\n event.preventDefault()\n let next = highlightedIndex.value + 1\n while (next < slots.value.length && isSlotDisabled(slots.value[next])) next++\n if (next < slots.value.length) {\n highlightedIndex.value = next\n scrollToHighlighted()\n }\n break\n }\n case 'ArrowUp': {\n event.preventDefault()\n let prev = highlightedIndex.value - 1\n while (prev >= 0 && isSlotDisabled(slots.value[prev])) prev--\n if (prev >= 0) {\n highlightedIndex.value = prev\n scrollToHighlighted()\n }\n break\n }\n case 'Enter': {\n event.preventDefault()\n if (highlightedIndex.value >= 0 && highlightedIndex.value < slots.value.length) {\n selectSlot(slots.value[highlightedIndex.value])\n }\n break\n }\n case 'Home': {\n event.preventDefault()\n const first = slots.value.findIndex(slot => !isSlotDisabled(slot))\n if (first >= 0) {\n highlightedIndex.value = first\n scrollToHighlighted()\n }\n break\n }\n case 'End': {\n event.preventDefault()\n for (let index = slots.value.length - 1; index >= 0; index--) {\n if (!isSlotDisabled(slots.value[index])) {\n highlightedIndex.value = index\n scrollToHighlighted()\n break\n }\n }\n break\n }\n case 'Escape': {\n event.preventDefault()\n close(true)\n break\n }\n }\n}\n\nfunction scrollToHighlighted() {\n nextTick(() => {\n if (!listRef.value) return\n const children = listRef.value.children\n if (children[highlightedIndex.value]) {\n (children[highlightedIndex.value] as HTMLElement).scrollIntoView({ block: 'nearest' })\n }\n })\n}\n\nwatch(isOpen, (open) => {\n if (open) {\n // Set highlighted index to current value or nearest slot\n if (props.modelValue) {\n const idx = slots.value.indexOf(props.modelValue)\n highlightedIndex.value = idx >= 0 ? idx : findNearestSlotIndex(props.modelValue)\n } else {\n highlightedIndex.value = 0\n }\n scrollToActiveSlot()\n } else {\n highlightedIndex.value = -1\n }\n})\n</script>\n\n<template>\n <div ref=\"root\" class=\"mint-time-picker\" @keydown=\"handleKeydown\">\n <div class=\"mint-time-picker__input-wrapper\">\n <input\n ref=\"trigger\"\n type=\"text\"\n readonly\n :value=\"displayValue\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :class=\"[\n 'mint-time-picker__input',\n `mint-time-picker__input--${size}`,\n error ? 'mint-time-picker__input--error' : '',\n disabled ? 'mint-time-picker__input--disabled' : '',\n ]\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n :aria-expanded=\"isOpen\"\n :aria-controls=\"isOpen ? listboxId : undefined\"\n :aria-activedescendant=\"activeSlotId\"\n @click=\"toggleDropdown\"\n />\n <button\n v-if=\"clearable && modelValue\"\n type=\"button\"\n class=\"mint-time-picker__clear-btn\"\n aria-label=\"Clear time\"\n @click.stop=\"clear\"\n >\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n <div class=\"mint-time-picker__icon\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"M12 6v6l4 2\" />\n </svg>\n </div>\n </div>\n\n <Transition\n enter-active-class=\"mint-time-picker__dropdown-enter-active\"\n enter-from-class=\"mint-time-picker__dropdown-enter-from\"\n enter-to-class=\"mint-time-picker__dropdown-enter-to\"\n leave-active-class=\"mint-time-picker__dropdown-leave-active\"\n leave-from-class=\"mint-time-picker__dropdown-leave-from\"\n leave-to-class=\"mint-time-picker__dropdown-leave-to\"\n >\n <div\n v-if=\"isOpen\"\n class=\"mint-popover mint-time-picker__dropdown\"\n >\n <ul\n :id=\"listboxId\"\n ref=\"listRef\"\n class=\"mint-time-picker__list\"\n role=\"listbox\"\n aria-label=\"Available times\"\n >\n <li\n v-for=\"(slot, index) in slots\"\n :id=\"`${listboxId}-option-${index}`\"\n :key=\"slot\"\n role=\"option\"\n :aria-selected=\"slot === modelValue\"\n :aria-disabled=\"isSlotDisabled(slot)\"\n :class=\"[\n 'mint-menu-item mint-time-picker__slot',\n slot === modelValue ? 'mint-menu-item--selected mint-time-picker__slot--active' : '',\n isSlotDisabled(slot) ? 'mint-time-picker__slot--disabled' : '',\n index === highlightedIndex && !isSlotDisabled(slot) ? 'mint-menu-item--active mint-time-picker__slot--highlighted' : '',\n ]\"\n @click=\"selectSlot(slot)\"\n >\n <span class=\"mint-time-picker__slot-time\">{{ formatTimeSlot(slot, format) }}</span>\n <span v-if=\"slotReason(slot)\" class=\"mint-time-picker__slot-reason\">{{ slotReason(slot) }}</span>\n <svg class=\"mint-menu-item__check\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M3.5 8.5l3 3 6-7\" />\n </svg>\n </li>\n </ul>\n </div>\n </Transition>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Input that opens a scrollable time-slot dropdown in 12h or 24h format, with min/max range and optional unavailable slots. */\nimport { ref, computed, watch, nextTick, useId, useTemplateRef } from 'vue'\nimport type { TimeSlotDisabledFn } from '../types'\nimport { useDropdownState } from '../composables/useDropdownState'\nimport {\n compareTime,\n findNearestTimeSlotIndex,\n formatTimeSlot,\n generateTimeSlots,\n} from '../composables/useTimeUtils'\n\ninterface Props {\n modelValue?: string\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n min?: string\n max?: string\n step?: number\n format?: '12h' | '24h'\n clearable?: boolean\n /** Marks slots unavailable; a returned string is shown inline as the reason. */\n disabledSlots?: TimeSlotDisabledFn\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n placeholder: 'Select time',\n disabled: false,\n error: false,\n size: 'md',\n step: 15,\n format: '24h',\n clearable: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | undefined]\n}>()\n\nconst listRef = ref<HTMLUListElement | null>(null)\nconst highlightedIndex = ref(-1)\nconst listboxId = `mint-time-picker-listbox-${useId().replace(/:/g, '')}`\nconst { isOpen, open, close, toggle } = useDropdownState({\n rootRef: useTemplateRef<HTMLElement>('root'),\n triggerRef: useTemplateRef<HTMLElement>('trigger'),\n})\n\n/** Id of the highlighted slot, published to the input as `aria-activedescendant`. */\nconst activeSlotId = computed(() =>\n isOpen.value && highlightedIndex.value >= 0\n ? `${listboxId}-option-${highlightedIndex.value}`\n : undefined,\n)\n\nconst slots = computed(() => {\n const start = props.min ?? '00:00'\n const end = props.max ?? '23:59'\n return generateTimeSlots(start, end, props.step)\n})\n\nconst displayValue = computed(() => {\n if (!props.modelValue) return ''\n return formatTimeSlot(props.modelValue, props.format)\n})\n\nfunction isSlotDisabled(slot: string): boolean {\n if (props.min && compareTime(slot, props.min) < 0) return true\n if (props.max && compareTime(slot, props.max) > 0) return true\n return !!props.disabledSlots?.(slot)\n}\n\nfunction slotReason(slot: string): string | undefined {\n const result = props.disabledSlots?.(slot)\n return typeof result === 'string' && result ? result : undefined\n}\n\nfunction selectSlot(slot: string) {\n if (isSlotDisabled(slot) || props.disabled) return\n emit('update:modelValue', slot)\n close()\n}\n\nfunction clear() {\n emit('update:modelValue', undefined)\n close()\n}\n\nfunction toggleDropdown() {\n if (props.disabled) return\n toggle()\n}\n\nfunction scrollToActiveSlot() {\n nextTick(() => {\n if (!listRef.value) return\n const activeEl = listRef.value.querySelector('.mint-time-picker__slot--active') as HTMLElement | null\n if (activeEl) {\n activeEl.scrollIntoView({ block: 'center' })\n } else if (props.modelValue) {\n // Scroll to nearest slot\n const nearestIndex = findNearestSlotIndex(props.modelValue)\n if (nearestIndex >= 0) {\n const children = listRef.value.children\n if (children[nearestIndex]) {\n (children[nearestIndex] as HTMLElement).scrollIntoView({ block: 'center' })\n }\n }\n }\n })\n}\n\nfunction findNearestSlotIndex(time: string): number {\n return findNearestTimeSlotIndex(time, slots.value)\n}\n\nfunction handleKeydown(event: KeyboardEvent) {\n if (!isOpen.value) {\n if (event.key === 'Enter' || event.key === ' ' || event.key === 'ArrowDown') {\n event.preventDefault()\n open()\n return\n }\n return\n }\n\n switch (event.key) {\n case 'ArrowDown': {\n event.preventDefault()\n let next = highlightedIndex.value + 1\n while (next < slots.value.length && isSlotDisabled(slots.value[next])) next++\n if (next < slots.value.length) {\n highlightedIndex.value = next\n scrollToHighlighted()\n }\n break\n }\n case 'ArrowUp': {\n event.preventDefault()\n let prev = highlightedIndex.value - 1\n while (prev >= 0 && isSlotDisabled(slots.value[prev])) prev--\n if (prev >= 0) {\n highlightedIndex.value = prev\n scrollToHighlighted()\n }\n break\n }\n case 'Enter': {\n event.preventDefault()\n if (highlightedIndex.value >= 0 && highlightedIndex.value < slots.value.length) {\n selectSlot(slots.value[highlightedIndex.value])\n }\n break\n }\n case 'Home': {\n event.preventDefault()\n const first = slots.value.findIndex(slot => !isSlotDisabled(slot))\n if (first >= 0) {\n highlightedIndex.value = first\n scrollToHighlighted()\n }\n break\n }\n case 'End': {\n event.preventDefault()\n for (let index = slots.value.length - 1; index >= 0; index--) {\n if (!isSlotDisabled(slots.value[index])) {\n highlightedIndex.value = index\n scrollToHighlighted()\n break\n }\n }\n break\n }\n case 'Escape': {\n event.preventDefault()\n close(true)\n break\n }\n }\n}\n\nfunction scrollToHighlighted() {\n nextTick(() => {\n if (!listRef.value) return\n const children = listRef.value.children\n if (children[highlightedIndex.value]) {\n (children[highlightedIndex.value] as HTMLElement).scrollIntoView({ block: 'nearest' })\n }\n })\n}\n\nwatch(isOpen, (open) => {\n if (open) {\n // Set highlighted index to current value or nearest slot\n if (props.modelValue) {\n const idx = slots.value.indexOf(props.modelValue)\n highlightedIndex.value = idx >= 0 ? idx : findNearestSlotIndex(props.modelValue)\n } else {\n highlightedIndex.value = 0\n }\n scrollToActiveSlot()\n } else {\n highlightedIndex.value = -1\n }\n})\n</script>\n\n<template>\n <div ref=\"root\" class=\"mint-time-picker\" @keydown=\"handleKeydown\">\n <div class=\"mint-time-picker__input-wrapper\">\n <input\n ref=\"trigger\"\n type=\"text\"\n readonly\n :value=\"displayValue\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :class=\"[\n 'mint-time-picker__input',\n `mint-time-picker__input--${size}`,\n error ? 'mint-time-picker__input--error' : '',\n disabled ? 'mint-time-picker__input--disabled' : '',\n ]\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n :aria-expanded=\"isOpen\"\n :aria-controls=\"isOpen ? listboxId : undefined\"\n :aria-activedescendant=\"activeSlotId\"\n @click=\"toggleDropdown\"\n />\n <button\n v-if=\"clearable && modelValue\"\n type=\"button\"\n class=\"mint-time-picker__clear-btn\"\n aria-label=\"Clear time\"\n @click.stop=\"clear\"\n >\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n <div class=\"mint-time-picker__icon\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"M12 6v6l4 2\" />\n </svg>\n </div>\n </div>\n\n <Transition\n enter-active-class=\"mint-time-picker__dropdown-enter-active\"\n enter-from-class=\"mint-time-picker__dropdown-enter-from\"\n enter-to-class=\"mint-time-picker__dropdown-enter-to\"\n leave-active-class=\"mint-time-picker__dropdown-leave-active\"\n leave-from-class=\"mint-time-picker__dropdown-leave-from\"\n leave-to-class=\"mint-time-picker__dropdown-leave-to\"\n >\n <div\n v-if=\"isOpen\"\n class=\"mint-popover mint-time-picker__dropdown\"\n >\n <ul\n :id=\"listboxId\"\n ref=\"listRef\"\n class=\"mint-time-picker__list\"\n role=\"listbox\"\n aria-label=\"Available times\"\n >\n <li\n v-for=\"(slot, index) in slots\"\n :id=\"`${listboxId}-option-${index}`\"\n :key=\"slot\"\n role=\"option\"\n :aria-selected=\"slot === modelValue\"\n :aria-disabled=\"isSlotDisabled(slot)\"\n :class=\"[\n 'mint-menu-item mint-time-picker__slot',\n slot === modelValue ? 'mint-menu-item--selected mint-time-picker__slot--active' : '',\n isSlotDisabled(slot) ? 'mint-time-picker__slot--disabled' : '',\n index === highlightedIndex && !isSlotDisabled(slot) ? 'mint-menu-item--active mint-time-picker__slot--highlighted' : '',\n ]\"\n @click=\"selectSlot(slot)\"\n >\n <span class=\"mint-time-picker__slot-time\">{{ formatTimeSlot(slot, format) }}</span>\n <span v-if=\"slotReason(slot)\" class=\"mint-time-picker__slot-reason\">{{ slotReason(slot) }}</span>\n <svg class=\"mint-menu-item__check\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M3.5 8.5l3 3 6-7\" />\n </svg>\n </li>\n </ul>\n </div>\n </Transition>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Lets users type and add tags with autocomplete suggestions, categories, and a max-tag cap. */\nimport { ref, computed, useTemplateRef } from 'vue'\nimport { useSelectionLimit } from '../composables/useSelectionLimit'\nimport { useDropdownState } from '../composables/useDropdownState'\n\ninterface TagSuggestion {\n value: string\n count?: number\n}\n\ninterface TagCategory {\n name: string\n prefix: string\n color?: 'primary' | 'success' | 'warning' | 'error' | 'info' | 'neutral'\n}\n\ninterface Props {\n modelValue?: string[]\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n maxTags?: number\n allowDuplicates?: boolean\n suggestions?: string[] | TagSuggestion[]\n categories?: TagCategory[]\n activeCategory?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: () => [],\n disabled: false,\n error: false,\n size: 'md',\n allowDuplicates: false,\n suggestions: () => [],\n categories: () => [],\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string[]]\n 'update:activeCategory': [prefix: string]\n}>()\n\nconst inputValue = ref('')\nconst highlightedIndex = ref(-1)\n// The text input doubles as the dropdown trigger, so focus restoration is the\n// composable's `triggerRef` rather than a component-local refocus helper.\nconst {\n isOpen: dropdownOpen,\n triggerRef: inputRef,\n open: openDropdown,\n close: closeDropdown,\n} = useDropdownState({\n rootRef: useTemplateRef<HTMLElement>('root'),\n onClose: () => {\n highlightedIndex.value = -1\n },\n})\n\nconst selectionLimit = useSelectionLimit({\n count: () => props.modelValue.length,\n max: () => props.maxTags,\n})\nconst canAddMore = selectionLimit.canAddMore\n\nconst normalizedSuggestions = computed<TagSuggestion[]>(() => {\n return props.suggestions.map(s => typeof s === 'string' ? { value: s } : s)\n})\n\nconst filteredSuggestions = computed<TagSuggestion[]>(() => {\n const q = inputValue.value.trim().toLowerCase()\n if (!q) return []\n return normalizedSuggestions.value\n .filter(s => s.value.toLowerCase().startsWith(q) && !props.modelValue.includes(s.value))\n .slice(0, 8)\n})\n\nfunction categoryFor(tag: string): TagCategory | undefined {\n const colonIdx = tag.indexOf(':')\n if (colonIdx === -1) return undefined\n const prefix = tag.slice(0, colonIdx)\n return props.categories.find(c => c.prefix === prefix)\n}\n\n// 3f: a category is shown by a group-color dot (3a palette), never a semantic tint.\nconst GROUP_COLORS = [\n 'var(--mint-sample-1)', 'var(--mint-sample-2)', 'var(--mint-sample-3)', 'var(--mint-sample-4)',\n 'var(--mint-sample-5)', 'var(--mint-sample-6)', 'var(--mint-sample-7)', 'var(--mint-sample-8)',\n]\n\nfunction groupColor(category: TagCategory): string {\n return GROUP_COLORS[props.categories.indexOf(category) % GROUP_COLORS.length]\n}\n\nfunction addTag(value: string) {\n const trimmed = value.trim()\n if (!trimmed) return\n if (!selectionLimit.canAdd()) return\n\n // If a category is active and user didn't already type a prefix, prepend it\n let final = trimmed\n if (props.activeCategory && !trimmed.includes(':')) {\n final = `${props.activeCategory}:${trimmed}`\n }\n\n if (!props.allowDuplicates && props.modelValue.includes(final)) return\n\n emit('update:modelValue', [...props.modelValue, final])\n inputValue.value = ''\n closeDropdown()\n}\n\nfunction removeTag(index: number) {\n if (props.disabled) return\n const newTags = [...props.modelValue]\n newTags.splice(index, 1)\n emit('update:modelValue', newTags)\n}\n\nfunction handleKeydown(event: KeyboardEvent) {\n if (event.key === 'ArrowDown' && filteredSuggestions.value.length) {\n event.preventDefault()\n highlightedIndex.value = Math.min(highlightedIndex.value + 1, filteredSuggestions.value.length - 1)\n openDropdown()\n return\n }\n if (event.key === 'ArrowUp' && filteredSuggestions.value.length) {\n event.preventDefault()\n highlightedIndex.value = Math.max(highlightedIndex.value - 1, 0)\n return\n }\n if (event.key === 'Enter' || event.key === ',') {\n event.preventDefault()\n if (highlightedIndex.value >= 0 && filteredSuggestions.value[highlightedIndex.value]) {\n addTag(filteredSuggestions.value[highlightedIndex.value].value)\n } else {\n addTag(inputValue.value)\n }\n return\n }\n if (event.key === 'Escape') {\n closeDropdown(true)\n return\n }\n if (event.key === 'Backspace' && !inputValue.value && props.modelValue.length > 0) {\n removeTag(props.modelValue.length - 1)\n }\n}\n\nfunction handleFocus() {\n if (filteredSuggestions.value.length) openDropdown()\n}\n\nfunction handleBlur() {\n // Delay so a click on a suggestion fires first\n setTimeout(() => {\n closeDropdown()\n }, 120)\n}\n\nfunction handlePaste(event: ClipboardEvent) {\n event.preventDefault()\n const text = event.clipboardData?.getData('text')\n if (!text) return\n\n const tags = text.split(/[,\\n]/).map(t => t.trim()).filter(Boolean)\n const newTags = [...props.modelValue]\n\n for (const tag of tags) {\n if (!selectionLimit.canAdd(1, newTags.length)) break\n if (!props.allowDuplicates && newTags.includes(tag)) continue\n newTags.push(tag)\n }\n\n emit('update:modelValue', newTags)\n}\n\nfunction focusInput() {\n inputRef.value?.focus()\n}\n\nfunction setCategory(prefix: string) {\n emit('update:activeCategory', prefix === props.activeCategory ? '' : prefix)\n}\n\nfunction onInputEvent() {\n if (filteredSuggestions.value.length > 0) {\n openDropdown()\n } else {\n closeDropdown()\n }\n highlightedIndex.value = -1\n}\n</script>\n\n<template>\n <div\n ref=\"root\"\n :class=\"[\n 'mint-tags-input',\n `mint-tags-input--${size}`,\n error ? 'mint-tags-input--error' : '',\n disabled ? 'mint-tags-input--disabled' : '',\n categories.length ? 'mint-tags-input--categorized' : '',\n ]\"\n >\n <!-- Category switcher (only if categories defined) -->\n <div v-if=\"categories.length\" class=\"mint-tags-input__categories\">\n <button\n v-for=\"cat in categories\"\n :key=\"cat.prefix\"\n type=\"button\"\n :class=\"[\n 'mint-tags-input__category',\n `mint-tags-input__category--${cat.color ?? 'neutral'}`,\n activeCategory === cat.prefix ? 'mint-tags-input__category--active' : '',\n ]\"\n :disabled=\"disabled\"\n @click=\"setCategory(cat.prefix)\"\n >\n <span class=\"mint-tags-input__tag-dot\" :style=\"{ background: groupColor(cat) }\" aria-hidden=\"true\" />\n {{ cat.name }}\n </button>\n </div>\n\n <div class=\"mint-tags-input__field\" @click=\"focusInput\">\n <span\n v-for=\"(tag, index) in modelValue\"\n :key=\"`${tag}-${index}`\"\n :class=\"[\n 'mint-tags-input__tag',\n `mint-tags-input__tag--${size}`,\n categoryFor(tag) ? `mint-tags-input__tag--${categoryFor(tag)?.color ?? 'neutral'}` : '',\n ]\"\n >\n <span\n v-if=\"categoryFor(tag)\"\n class=\"mint-tags-input__tag-dot\"\n :style=\"{ background: groupColor(categoryFor(tag)!) }\"\n aria-hidden=\"true\"\n />\n {{ tag }}\n <button\n v-if=\"!disabled\"\n type=\"button\"\n :aria-label=\"`Remove ${tag}`\"\n class=\"mint-tags-input__tag-remove\"\n @click.stop=\"removeTag(index)\"\n >\n <svg class=\"mint-tags-input__tag-remove-icon\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" viewBox=\"0 0 24 24\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </span>\n\n <input\n ref=\"inputRef\"\n v-model=\"inputValue\"\n type=\"text\"\n :placeholder=\"modelValue.length === 0 ? placeholder : ''\"\n :disabled=\"disabled || !canAddMore\"\n :class=\"['mint-tags-input__input', `mint-tags-input__input--${size}`]\"\n @keydown=\"handleKeydown\"\n @paste=\"handlePaste\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n @input=\"onInputEvent\"\n />\n\n <!-- Autocomplete dropdown -->\n <div\n v-if=\"dropdownOpen && filteredSuggestions.length\"\n class=\"mint-tags-input__dropdown\"\n >\n <button\n v-for=\"(sug, i) in filteredSuggestions\"\n :key=\"sug.value\"\n type=\"button\"\n :class=\"[\n 'mint-tags-input__dropdown-item',\n i === highlightedIndex ? 'mint-tags-input__dropdown-item--highlighted' : '',\n ]\"\n @mousedown.prevent=\"addTag(sug.value)\"\n >\n <span>{{ sug.value }}</span>\n <span v-if=\"sug.count !== undefined\" class=\"mint-tags-input__dropdown-count\">\n {{ sug.count }}\n </span>\n </button>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Lets users type and add tags with autocomplete suggestions, categories, and a max-tag cap. */\nimport { ref, computed, useTemplateRef } from 'vue'\nimport { useSelectionLimit } from '../composables/useSelectionLimit'\nimport { useDropdownState } from '../composables/useDropdownState'\n\ninterface TagSuggestion {\n value: string\n count?: number\n}\n\ninterface TagCategory {\n name: string\n prefix: string\n color?: 'primary' | 'success' | 'warning' | 'error' | 'info' | 'neutral'\n}\n\ninterface Props {\n modelValue?: string[]\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n maxTags?: number\n allowDuplicates?: boolean\n suggestions?: string[] | TagSuggestion[]\n categories?: TagCategory[]\n activeCategory?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: () => [],\n disabled: false,\n error: false,\n size: 'md',\n allowDuplicates: false,\n suggestions: () => [],\n categories: () => [],\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string[]]\n 'update:activeCategory': [prefix: string]\n}>()\n\nconst inputValue = ref('')\nconst highlightedIndex = ref(-1)\n// The text input doubles as the dropdown trigger, so focus restoration is the\n// composable's `triggerRef` rather than a component-local refocus helper.\nconst {\n isOpen: dropdownOpen,\n triggerRef: inputRef,\n open: openDropdown,\n close: closeDropdown,\n} = useDropdownState({\n rootRef: useTemplateRef<HTMLElement>('root'),\n onClose: () => {\n highlightedIndex.value = -1\n },\n})\n\nconst selectionLimit = useSelectionLimit({\n count: () => props.modelValue.length,\n max: () => props.maxTags,\n})\nconst canAddMore = selectionLimit.canAddMore\n\nconst normalizedSuggestions = computed<TagSuggestion[]>(() => {\n return props.suggestions.map(s => typeof s === 'string' ? { value: s } : s)\n})\n\nconst filteredSuggestions = computed<TagSuggestion[]>(() => {\n const q = inputValue.value.trim().toLowerCase()\n if (!q) return []\n return normalizedSuggestions.value\n .filter(s => s.value.toLowerCase().startsWith(q) && !props.modelValue.includes(s.value))\n .slice(0, 8)\n})\n\nfunction categoryFor(tag: string): TagCategory | undefined {\n const colonIdx = tag.indexOf(':')\n if (colonIdx === -1) return undefined\n const prefix = tag.slice(0, colonIdx)\n return props.categories.find(c => c.prefix === prefix)\n}\n\n// 3f: a category is shown by a group-color dot (3a palette), never a semantic tint.\nconst GROUP_COLORS = [\n 'var(--mint-sample-1)', 'var(--mint-sample-2)', 'var(--mint-sample-3)', 'var(--mint-sample-4)',\n 'var(--mint-sample-5)', 'var(--mint-sample-6)', 'var(--mint-sample-7)', 'var(--mint-sample-8)',\n]\n\nfunction groupColor(category: TagCategory): string {\n return GROUP_COLORS[props.categories.indexOf(category) % GROUP_COLORS.length]\n}\n\nfunction addTag(value: string) {\n const trimmed = value.trim()\n if (!trimmed) return\n if (!selectionLimit.canAdd()) return\n\n // If a category is active and user didn't already type a prefix, prepend it\n let final = trimmed\n if (props.activeCategory && !trimmed.includes(':')) {\n final = `${props.activeCategory}:${trimmed}`\n }\n\n if (!props.allowDuplicates && props.modelValue.includes(final)) return\n\n emit('update:modelValue', [...props.modelValue, final])\n inputValue.value = ''\n closeDropdown()\n}\n\nfunction removeTag(index: number) {\n if (props.disabled) return\n const newTags = [...props.modelValue]\n newTags.splice(index, 1)\n emit('update:modelValue', newTags)\n}\n\nfunction handleKeydown(event: KeyboardEvent) {\n if (event.key === 'ArrowDown' && filteredSuggestions.value.length) {\n event.preventDefault()\n highlightedIndex.value = Math.min(highlightedIndex.value + 1, filteredSuggestions.value.length - 1)\n openDropdown()\n return\n }\n if (event.key === 'ArrowUp' && filteredSuggestions.value.length) {\n event.preventDefault()\n highlightedIndex.value = Math.max(highlightedIndex.value - 1, 0)\n return\n }\n if (event.key === 'Enter' || event.key === ',') {\n event.preventDefault()\n if (highlightedIndex.value >= 0 && filteredSuggestions.value[highlightedIndex.value]) {\n addTag(filteredSuggestions.value[highlightedIndex.value].value)\n } else {\n addTag(inputValue.value)\n }\n return\n }\n if (event.key === 'Escape') {\n closeDropdown(true)\n return\n }\n if (event.key === 'Backspace' && !inputValue.value && props.modelValue.length > 0) {\n removeTag(props.modelValue.length - 1)\n }\n}\n\nfunction handleFocus() {\n if (filteredSuggestions.value.length) openDropdown()\n}\n\nfunction handleBlur() {\n // Delay so a click on a suggestion fires first\n setTimeout(() => {\n closeDropdown()\n }, 120)\n}\n\nfunction handlePaste(event: ClipboardEvent) {\n event.preventDefault()\n const text = event.clipboardData?.getData('text')\n if (!text) return\n\n const tags = text.split(/[,\\n]/).map(t => t.trim()).filter(Boolean)\n const newTags = [...props.modelValue]\n\n for (const tag of tags) {\n if (!selectionLimit.canAdd(1, newTags.length)) break\n if (!props.allowDuplicates && newTags.includes(tag)) continue\n newTags.push(tag)\n }\n\n emit('update:modelValue', newTags)\n}\n\nfunction focusInput() {\n inputRef.value?.focus()\n}\n\nfunction setCategory(prefix: string) {\n emit('update:activeCategory', prefix === props.activeCategory ? '' : prefix)\n}\n\nfunction onInputEvent() {\n if (filteredSuggestions.value.length > 0) {\n openDropdown()\n } else {\n closeDropdown()\n }\n highlightedIndex.value = -1\n}\n</script>\n\n<template>\n <div\n ref=\"root\"\n :class=\"[\n 'mint-tags-input',\n `mint-tags-input--${size}`,\n error ? 'mint-tags-input--error' : '',\n disabled ? 'mint-tags-input--disabled' : '',\n categories.length ? 'mint-tags-input--categorized' : '',\n ]\"\n >\n <!-- Category switcher (only if categories defined) -->\n <div v-if=\"categories.length\" class=\"mint-tags-input__categories\">\n <button\n v-for=\"cat in categories\"\n :key=\"cat.prefix\"\n type=\"button\"\n :class=\"[\n 'mint-tags-input__category',\n `mint-tags-input__category--${cat.color ?? 'neutral'}`,\n activeCategory === cat.prefix ? 'mint-tags-input__category--active' : '',\n ]\"\n :disabled=\"disabled\"\n @click=\"setCategory(cat.prefix)\"\n >\n <span class=\"mint-tags-input__tag-dot\" :style=\"{ background: groupColor(cat) }\" aria-hidden=\"true\" />\n {{ cat.name }}\n </button>\n </div>\n\n <div class=\"mint-tags-input__field\" @click=\"focusInput\">\n <span\n v-for=\"(tag, index) in modelValue\"\n :key=\"`${tag}-${index}`\"\n :class=\"[\n 'mint-tags-input__tag',\n `mint-tags-input__tag--${size}`,\n categoryFor(tag) ? `mint-tags-input__tag--${categoryFor(tag)?.color ?? 'neutral'}` : '',\n ]\"\n >\n <span\n v-if=\"categoryFor(tag)\"\n class=\"mint-tags-input__tag-dot\"\n :style=\"{ background: groupColor(categoryFor(tag)!) }\"\n aria-hidden=\"true\"\n />\n {{ tag }}\n <button\n v-if=\"!disabled\"\n type=\"button\"\n :aria-label=\"`Remove ${tag}`\"\n class=\"mint-tags-input__tag-remove\"\n @click.stop=\"removeTag(index)\"\n >\n <svg class=\"mint-tags-input__tag-remove-icon\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" viewBox=\"0 0 24 24\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </span>\n\n <input\n ref=\"inputRef\"\n v-model=\"inputValue\"\n type=\"text\"\n :placeholder=\"modelValue.length === 0 ? placeholder : ''\"\n :disabled=\"disabled || !canAddMore\"\n :class=\"['mint-tags-input__input', `mint-tags-input__input--${size}`]\"\n @keydown=\"handleKeydown\"\n @paste=\"handlePaste\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n @input=\"onInputEvent\"\n />\n\n <!-- Autocomplete dropdown -->\n <div\n v-if=\"dropdownOpen && filteredSuggestions.length\"\n class=\"mint-tags-input__dropdown\"\n >\n <button\n v-for=\"(sug, i) in filteredSuggestions\"\n :key=\"sug.value\"\n type=\"button\"\n :class=\"[\n 'mint-tags-input__dropdown-item',\n i === highlightedIndex ? 'mint-tags-input__dropdown-item--highlighted' : '',\n ]\"\n @mousedown.prevent=\"addTag(sug.value)\"\n >\n <span>{{ sug.value }}</span>\n <span v-if=\"sug.count !== undefined\" class=\"mint-tags-input__dropdown-count\">\n {{ sug.count }}\n </span>\n </button>\n </div>\n </div>\n </div>\n</template>\n","/**\n * Stable references for plugin secret settings.\n *\n * A settings response never carries a secret's value. Every secret leaf is a\n * marker instead:\n *\n * - `{ \"$secret\": \"sec_…\", \"set\": true }` — a stored secret, referenced by a\n * stable opaque id. Send the marker back unchanged to keep the stored value.\n * - `null` — nothing stored at that position.\n * - `{ \"$secret\": null, \"locked\": true }` — the effective value comes from the\n * environment and is never written back.\n *\n * On save each secret leaf accepts the reference, a plain string (a new value),\n * or `null` (clear). Payloads carry `secret_format: \"ref\"` so a `null` reads as\n * a deliberate clear rather than the deprecated \"unchanged\" placeholder.\n */\n\n/** Reserved marker key that references a stored secret. */\nexport const PLUGIN_SECRET_REF_KEY = '$secret'\n\n/** Reserved payload key declaring which secret wire format a client speaks. */\nexport const PLUGIN_SECRET_FORMAT_KEY = 'secret_format'\n\n/** Wire format published and understood by this SDK. */\nexport const PLUGIN_SECRET_FORMAT_REF = 'ref'\n\n/** One `$secret` marker as published by a settings response. */\nexport interface PluginSecretRef {\n $secret: string | null\n set?: boolean\n locked?: boolean\n}\n\n/** What a settings form should tell the user about one secret field. */\nexport type PluginSecretState = 'set' | 'unset' | 'environment'\n\nconst MARKER_KEYS = new Set([PLUGIN_SECRET_REF_KEY, 'set', 'locked'])\n\n/** Return whether one settings value is a `$secret` reference marker. */\nexport function isPluginSecretRef(value: unknown): value is PluginSecretRef {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return false\n const record = value as Record<string, unknown>\n if (!(PLUGIN_SECRET_REF_KEY in record)) return false\n return Object.keys(record).every(key => MARKER_KEYS.has(key))\n}\n\n/** Return the stored secret id behind a marker, or `null` when nothing is stored. */\nexport function pluginSecretId(value: unknown): string | null {\n if (!isPluginSecretRef(value)) return null\n return typeof value.$secret === 'string' ? value.$secret : null\n}\n\n/** Classify one secret field for display: stored, unset, or environment-provided. */\nexport function pluginSecretState(value: unknown): PluginSecretState {\n if (isPluginSecretRef(value)) {\n if (value.locked) return 'environment'\n return typeof value.$secret === 'string' ? 'set' : 'unset'\n }\n return typeof value === 'string' && value.length > 0 ? 'set' : 'unset'\n}\n\n/** Human label for one secret field's state. */\nexport function pluginSecretLabel(value: unknown): string {\n const state = pluginSecretState(value)\n if (state === 'environment') return 'Provided by environment'\n return state === 'set' ? 'Set' : 'Not set'\n}\n\n/** Whether a secret field is read-only because the environment supplies it. */\nexport function isPluginSecretLocked(value: unknown): boolean {\n return isPluginSecretRef(value) && value.locked === true\n}\n\n/**\n * Value to submit for an untouched secret field: the reference, unchanged.\n *\n * A locked marker round-trips too, which is how the platform keeps a stored\n * value that an environment variable currently hides.\n */\nexport function keepPluginSecret(current: unknown): PluginSecretRef | null {\n if (isPluginSecretRef(current)) return { ...current }\n return null\n}\n\n/** Value to submit when the user typed a new secret. */\nexport function setPluginSecret(value: string): string {\n return value\n}\n\n/** Value to submit when the user cleared a secret. */\nexport function clearPluginSecret(): null {\n return null\n}\n\n/** Whether a settings response declares the `$secret` reference wire format. */\nexport function usesPluginSecretReferences(response: unknown): boolean {\n if (!response || typeof response !== 'object') return false\n return (\n (response as Record<string, unknown>)[PLUGIN_SECRET_FORMAT_KEY]\n === PLUGIN_SECRET_FORMAT_REF\n )\n}\n","<script setup lang=\"ts\">\n/** Edits one plugin secret setting: shows set / not set / provided by environment, and submits a `$secret` reference, a new value, or `null`. */\nimport { computed, ref, watch } from 'vue'\nimport BaseInput from './BaseInput.vue'\nimport BaseButton from './BaseButton.vue'\nimport {\n clearPluginSecret,\n isPluginSecretLocked,\n isPluginSecretRef,\n keepPluginSecret,\n pluginSecretLabel,\n pluginSecretState,\n setPluginSecret,\n type PluginSecretRef,\n type PluginSecretState,\n} from '../utils/pluginSecrets'\n\ntype SecretValue = PluginSecretRef | string | null\n\ninterface Props {\n /** The `$secret` marker from the settings response, a typed string, or `null`. */\n modelValue?: SecretValue\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n /** Label on the control that starts entering a replacement value. */\n changeLabel?: string\n /** Label on the control that clears a stored secret. */\n clearLabel?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: null,\n placeholder: 'Enter a new value',\n disabled: false,\n error: false,\n size: 'md',\n changeLabel: 'Change',\n clearLabel: 'Clear',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: SecretValue]\n}>()\n\n/** The reference this field started from, so an abandoned edit can restore it. */\nconst storedReference = ref<PluginSecretRef | null>(keepPluginSecret(props.modelValue))\nconst isEditing = ref(typeof props.modelValue === 'string')\n\nwatch(\n () => props.modelValue,\n (value) => {\n if (isPluginSecretRef(value)) {\n storedReference.value = keepPluginSecret(value)\n isEditing.value = false\n }\n },\n)\n\nconst state = computed<PluginSecretState>(() => pluginSecretState(props.modelValue))\nconst locked = computed(() => isPluginSecretLocked(props.modelValue)\n || isPluginSecretLocked(storedReference.value))\nconst statusLabel = computed(() => isEditing.value\n ? 'New value'\n : pluginSecretLabel(props.modelValue))\nconst typedValue = computed(() => typeof props.modelValue === 'string' ? props.modelValue : '')\nconst canClear = computed(() => !locked.value && (state.value === 'set' || isEditing.value))\n\nfunction startEditing(): void {\n if (props.disabled || locked.value) return\n isEditing.value = true\n emit('update:modelValue', setPluginSecret(''))\n}\n\nfunction updateTyped(value: string | number | null): void {\n emit('update:modelValue', setPluginSecret(value == null ? '' : String(value)))\n}\n\nfunction cancelEditing(): void {\n isEditing.value = false\n emit('update:modelValue', storedReference.value ? { ...storedReference.value } : null)\n}\n\nfunction clear(): void {\n if (props.disabled || locked.value) return\n isEditing.value = false\n storedReference.value = null\n emit('update:modelValue', clearPluginSecret())\n}\n</script>\n\n<template>\n <div class=\"mint-secret-input\" :class=\"{ 'mint-secret-input--error': error }\">\n <div class=\"mint-secret-input__status\">\n <span\n class=\"mint-secret-input__badge\"\n :class=\"`mint-secret-input__badge--${isEditing ? 'pending' : state}`\"\n ><span class=\"mint-secret-input__dot\" aria-hidden=\"true\" />{{ statusLabel }}</span>\n <span v-if=\"locked\" class=\"mint-secret-input__hint\">\n This value comes from the environment and cannot be edited here.\n </span>\n </div>\n\n <BaseInput\n v-if=\"isEditing\"\n type=\"password\"\n autocomplete=\"new-password\"\n :model-value=\"typedValue\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :error=\"error\"\n :size=\"size\"\n @update:model-value=\"updateTyped\"\n />\n\n <div class=\"mint-secret-input__actions\">\n <BaseButton\n v-if=\"!isEditing\"\n type=\"button\"\n variant=\"secondary\"\n :size=\"size === 'lg' ? 'md' : 'sm'\"\n :disabled=\"disabled || locked\"\n @click=\"startEditing\"\n >\n {{ changeLabel }}\n </BaseButton>\n <BaseButton\n v-else\n type=\"button\"\n variant=\"ghost\"\n :size=\"size === 'lg' ? 'md' : 'sm'\"\n :disabled=\"disabled\"\n @click=\"cancelEditing\"\n >\n Cancel\n </BaseButton>\n <BaseButton\n v-if=\"canClear\"\n type=\"button\"\n variant=\"ghost\"\n :size=\"size === 'lg' ? 'md' : 'sm'\"\n :disabled=\"disabled\"\n @click=\"clear\"\n >\n {{ clearLabel }}\n </BaseButton>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Edits one plugin secret setting: shows set / not set / provided by environment, and submits a `$secret` reference, a new value, or `null`. */\nimport { computed, ref, watch } from 'vue'\nimport BaseInput from './BaseInput.vue'\nimport BaseButton from './BaseButton.vue'\nimport {\n clearPluginSecret,\n isPluginSecretLocked,\n isPluginSecretRef,\n keepPluginSecret,\n pluginSecretLabel,\n pluginSecretState,\n setPluginSecret,\n type PluginSecretRef,\n type PluginSecretState,\n} from '../utils/pluginSecrets'\n\ntype SecretValue = PluginSecretRef | string | null\n\ninterface Props {\n /** The `$secret` marker from the settings response, a typed string, or `null`. */\n modelValue?: SecretValue\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n /** Label on the control that starts entering a replacement value. */\n changeLabel?: string\n /** Label on the control that clears a stored secret. */\n clearLabel?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: null,\n placeholder: 'Enter a new value',\n disabled: false,\n error: false,\n size: 'md',\n changeLabel: 'Change',\n clearLabel: 'Clear',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: SecretValue]\n}>()\n\n/** The reference this field started from, so an abandoned edit can restore it. */\nconst storedReference = ref<PluginSecretRef | null>(keepPluginSecret(props.modelValue))\nconst isEditing = ref(typeof props.modelValue === 'string')\n\nwatch(\n () => props.modelValue,\n (value) => {\n if (isPluginSecretRef(value)) {\n storedReference.value = keepPluginSecret(value)\n isEditing.value = false\n }\n },\n)\n\nconst state = computed<PluginSecretState>(() => pluginSecretState(props.modelValue))\nconst locked = computed(() => isPluginSecretLocked(props.modelValue)\n || isPluginSecretLocked(storedReference.value))\nconst statusLabel = computed(() => isEditing.value\n ? 'New value'\n : pluginSecretLabel(props.modelValue))\nconst typedValue = computed(() => typeof props.modelValue === 'string' ? props.modelValue : '')\nconst canClear = computed(() => !locked.value && (state.value === 'set' || isEditing.value))\n\nfunction startEditing(): void {\n if (props.disabled || locked.value) return\n isEditing.value = true\n emit('update:modelValue', setPluginSecret(''))\n}\n\nfunction updateTyped(value: string | number | null): void {\n emit('update:modelValue', setPluginSecret(value == null ? '' : String(value)))\n}\n\nfunction cancelEditing(): void {\n isEditing.value = false\n emit('update:modelValue', storedReference.value ? { ...storedReference.value } : null)\n}\n\nfunction clear(): void {\n if (props.disabled || locked.value) return\n isEditing.value = false\n storedReference.value = null\n emit('update:modelValue', clearPluginSecret())\n}\n</script>\n\n<template>\n <div class=\"mint-secret-input\" :class=\"{ 'mint-secret-input--error': error }\">\n <div class=\"mint-secret-input__status\">\n <span\n class=\"mint-secret-input__badge\"\n :class=\"`mint-secret-input__badge--${isEditing ? 'pending' : state}`\"\n ><span class=\"mint-secret-input__dot\" aria-hidden=\"true\" />{{ statusLabel }}</span>\n <span v-if=\"locked\" class=\"mint-secret-input__hint\">\n This value comes from the environment and cannot be edited here.\n </span>\n </div>\n\n <BaseInput\n v-if=\"isEditing\"\n type=\"password\"\n autocomplete=\"new-password\"\n :model-value=\"typedValue\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :error=\"error\"\n :size=\"size\"\n @update:model-value=\"updateTyped\"\n />\n\n <div class=\"mint-secret-input__actions\">\n <BaseButton\n v-if=\"!isEditing\"\n type=\"button\"\n variant=\"secondary\"\n :size=\"size === 'lg' ? 'md' : 'sm'\"\n :disabled=\"disabled || locked\"\n @click=\"startEditing\"\n >\n {{ changeLabel }}\n </BaseButton>\n <BaseButton\n v-else\n type=\"button\"\n variant=\"ghost\"\n :size=\"size === 'lg' ? 'md' : 'sm'\"\n :disabled=\"disabled\"\n @click=\"cancelEditing\"\n >\n Cancel\n </BaseButton>\n <BaseButton\n v-if=\"canClear\"\n type=\"button\"\n variant=\"ghost\"\n :size=\"size === 'lg' ? 'md' : 'sm'\"\n :disabled=\"disabled\"\n @click=\"clear\"\n >\n {{ clearLabel }}\n </BaseButton>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Numeric input with always-visible steppers, optional unit label, and (with min+max) an in-field drag-to-scrub range fill. */\nimport { computed, onBeforeUnmount } from 'vue'\n\ninterface Props {\n modelValue?: number\n min?: number\n max?: number\n step?: number\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n placeholder?: string\n unit?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n step: 1,\n disabled: false,\n error: false,\n size: 'md',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: number | undefined]\n}>()\n\nconst isSliderMode = computed(() => props.min !== undefined && props.max !== undefined)\n\nconst sliderPercent = computed(() => {\n const min = props.min\n const max = props.max\n if (min === undefined || max === undefined || props.modelValue === undefined) return 0\n const range = max - min\n if (range === 0) return 0\n return Math.min(100, Math.max(0, ((props.modelValue - min) / range) * 100))\n})\n\nconst canDecrement = computed(() => {\n if (props.modelValue === undefined) return true\n if (props.min === undefined) return true\n return props.modelValue > props.min\n})\n\nconst canIncrement = computed(() => {\n if (props.modelValue === undefined) return true\n if (props.max === undefined) return true\n return props.modelValue < props.max\n})\n\nfunction clamp(value: number): number {\n let result = value\n if (props.min !== undefined && result < props.min) result = props.min\n if (props.max !== undefined && result > props.max) result = props.max\n return result\n}\n\n/** Clamp and trim float noise (0.1 + 0.2 → 0.3) without losing real precision. */\nfunction settle(value: number): number {\n return Number(clamp(value).toFixed(10))\n}\n\n/** Snap to the step grid anchored at `min`, for pointer scrubbing. */\nfunction snap(value: number): number {\n const origin = props.min ?? 0\n return settle(origin + Math.round((value - origin) / props.step) * props.step)\n}\n\nfunction handleInput(event: Event) {\n const target = event.target as HTMLInputElement\n const value = target.value === '' ? undefined : Number(target.value)\n if (value !== undefined && !isNaN(value)) {\n emit('update:modelValue', clamp(value))\n } else {\n emit('update:modelValue', undefined)\n }\n}\n\nfunction nudge(delta: number) {\n if (props.disabled) return\n if (delta < 0 && !canDecrement.value) return\n if (delta > 0 && !canIncrement.value) return\n const current = props.modelValue ?? (delta < 0 ? props.max ?? 0 : props.min ?? 0)\n emit('update:modelValue', settle(current + delta))\n}\n\nfunction decrement() {\n nudge(-props.step)\n}\n\nfunction increment() {\n nudge(props.step)\n}\n\n// Home/End only apply on the slider surface: inside the text input they must\n// keep moving the caret.\nfunction handleKeydown(event: KeyboardEvent, allowJump = false) {\n if (props.disabled) return\n switch (event.key) {\n case 'ArrowUp': increment(); break\n case 'ArrowDown': decrement(); break\n case 'PageUp': nudge(props.step * 10); break\n case 'PageDown': nudge(-props.step * 10); break\n case 'Home':\n if (!allowJump || props.min === undefined) return\n emit('update:modelValue', props.min)\n break\n case 'End':\n if (!allowJump || props.max === undefined) return\n emit('update:modelValue', props.max)\n break\n default:\n return\n }\n event.preventDefault()\n}\n\n// The surrounding range uses absolute position; dragging the number uses a\n// relative offset so grabbing it never jumps away from the current value.\nfunction scrubTo(clientX: number, area: HTMLElement) {\n const rect = area.getBoundingClientRect()\n if (rect.width === 0 || props.min === undefined || props.max === undefined) return\n const ratio = Math.min(1, Math.max(0, (clientX - rect.left) / rect.width))\n emit('update:modelValue', snap(props.min + ratio * (props.max - props.min)))\n}\n\nlet stopScrubbing: (() => void) | undefined\nonBeforeUnmount(() => stopScrubbing?.())\n\nfunction handleScrubStart(event: PointerEvent) {\n const target = event.target as HTMLElement\n const onNumber = target.tagName === 'INPUT'\n if (props.disabled || event.button !== 0 || (!onNumber && !isSliderMode.value)) return\n stopScrubbing?.()\n const area = event.currentTarget as HTMLElement\n const startValue = props.modelValue ?? props.min ?? 0\n const width = area.getBoundingClientRect().width\n const unitsPerPixel = isSliderMode.value && width > 0\n ? (props.max! - props.min!) / width\n : props.step / 8\n // Preserve ordinary clicks and double-clicks for caret placement and typing.\n if (!onNumber) {\n event.preventDefault()\n scrubTo(event.clientX, area)\n }\n target.setPointerCapture?.(event.pointerId)\n let dragging = false\n const move = (e: PointerEvent) => {\n if (e.pointerId !== event.pointerId) return\n if (props.disabled) { stop(); return }\n if (!onNumber) { scrubTo(e.clientX, area); return }\n const delta = e.clientX - event.clientX\n if (!dragging && Math.abs(delta) < 4) return\n dragging = true\n e.preventDefault()\n emit('update:modelValue', settle(startValue + Math.round(delta * unitsPerPixel / props.step) * props.step))\n }\n const stop = () => {\n area.removeEventListener('pointermove', move)\n area.removeEventListener('pointerup', stop)\n area.removeEventListener('pointercancel', stop)\n area.removeEventListener('lostpointercapture', stop)\n if (target.hasPointerCapture?.(event.pointerId)) target.releasePointerCapture(event.pointerId)\n stopScrubbing = undefined\n }\n stopScrubbing = stop\n area.addEventListener('pointermove', move)\n area.addEventListener('pointerup', stop)\n area.addEventListener('pointercancel', stop)\n area.addEventListener('lostpointercapture', stop)\n}\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-number-input',\n `mint-number-input--${size}`,\n isSliderMode ? 'mint-number-input--slider' : 'mint-number-input--stepper',\n error ? 'mint-number-input--error' : '',\n disabled ? 'mint-number-input--disabled' : '',\n ]\"\n >\n <div class=\"mint-number-input__field\">\n <div\n class=\"mint-number-input__scrub\"\n :style=\"isSliderMode ? { '--mint-number-input-fill': `${sliderPercent}%` } : undefined\"\n :role=\"isSliderMode ? 'slider' : undefined\"\n :tabindex=\"isSliderMode && !disabled ? 0 : undefined\"\n :aria-valuenow=\"isSliderMode ? modelValue : undefined\"\n :aria-valuemin=\"isSliderMode ? min : undefined\"\n :aria-valuemax=\"isSliderMode ? max : undefined\"\n :aria-orientation=\"isSliderMode ? 'horizontal' : undefined\"\n @pointerdown=\"handleScrubStart\"\n @keydown.self=\"isSliderMode && handleKeydown($event, true)\"\n >\n <template v-if=\"isSliderMode\">\n <span class=\"mint-number-input__wash\" aria-hidden=\"true\" />\n <span class=\"mint-number-input__rule\" aria-hidden=\"true\" />\n </template>\n <input\n type=\"number\"\n :value=\"modelValue\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :class=\"[\n 'mint-number-input__input',\n `mint-number-input__input--${size}`,\n ]\"\n @input=\"handleInput\"\n @keydown=\"handleKeydown\"\n />\n <span v-if=\"unit\" class=\"mint-number-input__unit\">{{ unit }}</span>\n </div>\n\n <div class=\"mint-number-input__steppers\" aria-hidden=\"true\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Decrease value\"\n :disabled=\"disabled || !canDecrement\"\n class=\"mint-number-input__stepper mint-number-input__stepper--down\"\n @click=\"decrement\"\n >\n <svg viewBox=\"0 0 10 10\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\">\n <path d=\"M2 5h6\" />\n </svg>\n </button>\n <button\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Increase value\"\n :disabled=\"disabled || !canIncrement\"\n class=\"mint-number-input__stepper mint-number-input__stepper--up\"\n @click=\"increment\"\n >\n <svg viewBox=\"0 0 10 10\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\">\n <path d=\"M5 2v6\" /><path d=\"M2 5h6\" />\n </svg>\n </button>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Numeric input with always-visible steppers, optional unit label, and (with min+max) an in-field drag-to-scrub range fill. */\nimport { computed, onBeforeUnmount } from 'vue'\n\ninterface Props {\n modelValue?: number\n min?: number\n max?: number\n step?: number\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n placeholder?: string\n unit?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n step: 1,\n disabled: false,\n error: false,\n size: 'md',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: number | undefined]\n}>()\n\nconst isSliderMode = computed(() => props.min !== undefined && props.max !== undefined)\n\nconst sliderPercent = computed(() => {\n const min = props.min\n const max = props.max\n if (min === undefined || max === undefined || props.modelValue === undefined) return 0\n const range = max - min\n if (range === 0) return 0\n return Math.min(100, Math.max(0, ((props.modelValue - min) / range) * 100))\n})\n\nconst canDecrement = computed(() => {\n if (props.modelValue === undefined) return true\n if (props.min === undefined) return true\n return props.modelValue > props.min\n})\n\nconst canIncrement = computed(() => {\n if (props.modelValue === undefined) return true\n if (props.max === undefined) return true\n return props.modelValue < props.max\n})\n\nfunction clamp(value: number): number {\n let result = value\n if (props.min !== undefined && result < props.min) result = props.min\n if (props.max !== undefined && result > props.max) result = props.max\n return result\n}\n\n/** Clamp and trim float noise (0.1 + 0.2 → 0.3) without losing real precision. */\nfunction settle(value: number): number {\n return Number(clamp(value).toFixed(10))\n}\n\n/** Snap to the step grid anchored at `min`, for pointer scrubbing. */\nfunction snap(value: number): number {\n const origin = props.min ?? 0\n return settle(origin + Math.round((value - origin) / props.step) * props.step)\n}\n\nfunction handleInput(event: Event) {\n const target = event.target as HTMLInputElement\n const value = target.value === '' ? undefined : Number(target.value)\n if (value !== undefined && !isNaN(value)) {\n emit('update:modelValue', clamp(value))\n } else {\n emit('update:modelValue', undefined)\n }\n}\n\nfunction nudge(delta: number) {\n if (props.disabled) return\n if (delta < 0 && !canDecrement.value) return\n if (delta > 0 && !canIncrement.value) return\n const current = props.modelValue ?? (delta < 0 ? props.max ?? 0 : props.min ?? 0)\n emit('update:modelValue', settle(current + delta))\n}\n\nfunction decrement() {\n nudge(-props.step)\n}\n\nfunction increment() {\n nudge(props.step)\n}\n\n// Home/End only apply on the slider surface: inside the text input they must\n// keep moving the caret.\nfunction handleKeydown(event: KeyboardEvent, allowJump = false) {\n if (props.disabled) return\n switch (event.key) {\n case 'ArrowUp': increment(); break\n case 'ArrowDown': decrement(); break\n case 'PageUp': nudge(props.step * 10); break\n case 'PageDown': nudge(-props.step * 10); break\n case 'Home':\n if (!allowJump || props.min === undefined) return\n emit('update:modelValue', props.min)\n break\n case 'End':\n if (!allowJump || props.max === undefined) return\n emit('update:modelValue', props.max)\n break\n default:\n return\n }\n event.preventDefault()\n}\n\n// The surrounding range uses absolute position; dragging the number uses a\n// relative offset so grabbing it never jumps away from the current value.\nfunction scrubTo(clientX: number, area: HTMLElement) {\n const rect = area.getBoundingClientRect()\n if (rect.width === 0 || props.min === undefined || props.max === undefined) return\n const ratio = Math.min(1, Math.max(0, (clientX - rect.left) / rect.width))\n emit('update:modelValue', snap(props.min + ratio * (props.max - props.min)))\n}\n\nlet stopScrubbing: (() => void) | undefined\nonBeforeUnmount(() => stopScrubbing?.())\n\nfunction handleScrubStart(event: PointerEvent) {\n const target = event.target as HTMLElement\n const onNumber = target.tagName === 'INPUT'\n if (props.disabled || event.button !== 0 || (!onNumber && !isSliderMode.value)) return\n stopScrubbing?.()\n const area = event.currentTarget as HTMLElement\n const startValue = props.modelValue ?? props.min ?? 0\n const width = area.getBoundingClientRect().width\n const unitsPerPixel = isSliderMode.value && width > 0\n ? (props.max! - props.min!) / width\n : props.step / 8\n // Preserve ordinary clicks and double-clicks for caret placement and typing.\n if (!onNumber) {\n event.preventDefault()\n scrubTo(event.clientX, area)\n }\n target.setPointerCapture?.(event.pointerId)\n let dragging = false\n const move = (e: PointerEvent) => {\n if (e.pointerId !== event.pointerId) return\n if (props.disabled) { stop(); return }\n if (!onNumber) { scrubTo(e.clientX, area); return }\n const delta = e.clientX - event.clientX\n if (!dragging && Math.abs(delta) < 4) return\n dragging = true\n e.preventDefault()\n emit('update:modelValue', settle(startValue + Math.round(delta * unitsPerPixel / props.step) * props.step))\n }\n const stop = () => {\n area.removeEventListener('pointermove', move)\n area.removeEventListener('pointerup', stop)\n area.removeEventListener('pointercancel', stop)\n area.removeEventListener('lostpointercapture', stop)\n if (target.hasPointerCapture?.(event.pointerId)) target.releasePointerCapture(event.pointerId)\n stopScrubbing = undefined\n }\n stopScrubbing = stop\n area.addEventListener('pointermove', move)\n area.addEventListener('pointerup', stop)\n area.addEventListener('pointercancel', stop)\n area.addEventListener('lostpointercapture', stop)\n}\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-number-input',\n `mint-number-input--${size}`,\n isSliderMode ? 'mint-number-input--slider' : 'mint-number-input--stepper',\n error ? 'mint-number-input--error' : '',\n disabled ? 'mint-number-input--disabled' : '',\n ]\"\n >\n <div class=\"mint-number-input__field\">\n <div\n class=\"mint-number-input__scrub\"\n :style=\"isSliderMode ? { '--mint-number-input-fill': `${sliderPercent}%` } : undefined\"\n :role=\"isSliderMode ? 'slider' : undefined\"\n :tabindex=\"isSliderMode && !disabled ? 0 : undefined\"\n :aria-valuenow=\"isSliderMode ? modelValue : undefined\"\n :aria-valuemin=\"isSliderMode ? min : undefined\"\n :aria-valuemax=\"isSliderMode ? max : undefined\"\n :aria-orientation=\"isSliderMode ? 'horizontal' : undefined\"\n @pointerdown=\"handleScrubStart\"\n @keydown.self=\"isSliderMode && handleKeydown($event, true)\"\n >\n <template v-if=\"isSliderMode\">\n <span class=\"mint-number-input__wash\" aria-hidden=\"true\" />\n <span class=\"mint-number-input__rule\" aria-hidden=\"true\" />\n </template>\n <input\n type=\"number\"\n :value=\"modelValue\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :class=\"[\n 'mint-number-input__input',\n `mint-number-input__input--${size}`,\n ]\"\n @input=\"handleInput\"\n @keydown=\"handleKeydown\"\n />\n <span v-if=\"unit\" class=\"mint-number-input__unit\">{{ unit }}</span>\n </div>\n\n <div class=\"mint-number-input__steppers\" aria-hidden=\"true\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Decrease value\"\n :disabled=\"disabled || !canDecrement\"\n class=\"mint-number-input__stepper mint-number-input__stepper--down\"\n @click=\"decrement\"\n >\n <svg viewBox=\"0 0 10 10\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\">\n <path d=\"M2 5h6\" />\n </svg>\n </button>\n <button\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Increase value\"\n :disabled=\"disabled || !canIncrement\"\n class=\"mint-number-input__stepper mint-number-input__stepper--up\"\n @click=\"increment\"\n >\n <svg viewBox=\"0 0 10 10\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\">\n <path d=\"M5 2v6\" /><path d=\"M2 5h6\" />\n </svg>\n </button>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Drag-and-drop file upload zone with type filtering, size validation, and folder mode. */\nimport { ref, computed, watch } from 'vue'\n\ninterface Props {\n accept?: string\n multiple?: boolean\n maxSize?: number\n disabled?: boolean\n size?: 'sm' | 'md' | 'lg'\n mode?: 'file' | 'folder' | 'file+folder'\n /** Hide the selection list when a parent presents the files itself. */\n showFiles?: boolean\n /** Restore selections owned by a parent form; omitted for internal selection state. */\n files?: File[]\n rootName?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n multiple: false,\n disabled: false,\n size: 'md',\n mode: 'file',\n showFiles: true,\n})\n\nconst emit = defineEmits<{\n upload: [files: File[], rootName?: string, relativePaths?: string[]]\n remove: [files: File[]]\n error: [message: string]\n}>()\n\nconst isDragOver = ref(false)\nconst inputRef = ref<HTMLInputElement>()\nconst selectedFiles = ref<File[]>([])\nconst folderName = ref<string | null>(null)\n\nwatch(() => [props.files, props.rootName] as const, ([files, rootName]) => {\n if (files === undefined) return\n selectedFiles.value = [...files]\n folderName.value = rootName ?? extractFolderName(files)\n}, { immediate: true })\n\nconst isFolder = computed(() => props.mode === 'folder')\nconst isMixed = computed(() => props.mode === 'file+folder')\n\nconst acceptLabel = computed(() => {\n if (!props.accept) return isFolder.value ? 'a folder' : 'any file'\n return props.accept.split(',').map(a => a.trim().replace('.', '').toUpperCase()).join(', ')\n})\n\nconst maxSizeLabel = computed(() => {\n if (!props.maxSize) return null\n if (props.maxSize >= 1024 * 1024 * 1024) {\n return `${(props.maxSize / (1024 * 1024 * 1024)).toFixed(1)} GB`\n }\n if (props.maxSize >= 1024 * 1024) {\n return `${(props.maxSize / (1024 * 1024)).toFixed(1)} MB`\n }\n if (props.maxSize >= 1024) {\n return `${(props.maxSize / 1024).toFixed(1)} KB`\n }\n return `${props.maxSize} bytes`\n})\n\nconst fileTypeMap: Record<string, { color: string; label: string }> = {\n csv: { color: '#10B981', label: 'CSV' },\n tsv: { color: '#10B981', label: 'TSV' },\n xlsx: { color: '#10B981', label: 'XLSX' },\n xls: { color: '#10B981', label: 'XLS' },\n pdf: { color: '#EF4444', label: 'PDF' },\n png: { color: '#8B5CF6', label: 'PNG' },\n jpg: { color: '#8B5CF6', label: 'JPG' },\n jpeg: { color: '#8B5CF6', label: 'JPEG' },\n gif: { color: '#8B5CF6', label: 'GIF' },\n svg: { color: '#8B5CF6', label: 'SVG' },\n webp: { color: '#8B5CF6', label: 'WEBP' },\n json: { color: '#F59E0B', label: 'JSON' },\n xml: { color: '#F59E0B', label: 'XML' },\n txt: { color: '#64748B', label: 'TXT' },\n zip: { color: '#6366F1', label: 'ZIP' },\n gz: { color: '#6366F1', label: 'GZ' },\n py: { color: '#3B82F6', label: 'PY' },\n js: { color: '#EAB308', label: 'JS' },\n ts: { color: '#3B82F6', label: 'TS' },\n fasta: { color: '#EC4899', label: 'FASTA' },\n fastq: { color: '#EC4899', label: 'FASTQ' },\n bam: { color: '#EC4899', label: 'BAM' },\n vcf: { color: '#EC4899', label: 'VCF' },\n}\n\nfunction getFileType(filename: string): { color: string; label: string } {\n const ext = filename.split('.').pop()?.toLowerCase() || ''\n return fileTypeMap[ext] || { color: '#94A3B8', label: ext.toUpperCase() || 'FILE' }\n}\n\nfunction validateFiles(files: FileList | File[]): File[] {\n const validFiles: File[] = []\n\n for (const file of Array.from(files)) {\n if (props.maxSize && file.size > props.maxSize) {\n emit('error', `File \"${file.name}\" exceeds maximum size of ${maxSizeLabel.value}`)\n continue\n }\n\n if (props.accept) {\n const acceptedTypes = props.accept.split(',').map(t => t.trim().toLowerCase())\n const fileExt = '.' + file.name.split('.').pop()?.toLowerCase()\n const fileType = file.type.toLowerCase()\n\n const isAccepted = acceptedTypes.some(type => {\n if (type.startsWith('.')) {\n return fileExt === type\n }\n if (type.endsWith('/*')) {\n return fileType.startsWith(type.replace('/*', '/'))\n }\n return fileType === type\n })\n\n if (!isAccepted) {\n emit('error', `File \"${file.name}\" is not an accepted file type`)\n continue\n }\n }\n\n validFiles.push(file)\n }\n\n return validFiles\n}\n\nfunction handleFiles(\n files: FileList | File[],\n folder?: string,\n explicitRelativePaths?: string[],\n) {\n const candidates = Array.from(files)\n const validFiles = validateFiles(files)\n if (validFiles.length === 0) return\n const relativePaths = validFiles.map((file) => {\n const candidateIndex = candidates.indexOf(file)\n return explicitRelativePaths?.[candidateIndex]\n || file.webkitRelativePath\n || (folder ? `${folder}/${file.name}` : file.name)\n })\n\n if (isFolder.value) {\n folderName.value = folder || extractFolderName(validFiles)\n selectedFiles.value = validFiles\n emit('upload', validFiles, folderName.value ?? undefined, relativePaths)\n } else if (!props.multiple) {\n selectedFiles.value = [validFiles[0]]\n emit('upload', [validFiles[0]], undefined, [relativePaths[0]])\n } else {\n selectedFiles.value = [...selectedFiles.value, ...validFiles]\n emit('upload', validFiles, undefined, relativePaths)\n }\n}\n\nfunction extractFolderName(files: File[]): string | null {\n if (files.length === 0) return null\n const firstPath = files[0].webkitRelativePath\n if (firstPath) {\n return firstPath.split('/')[0]\n }\n return null\n}\n\nasync function handleDrop(event: DragEvent) {\n event.preventDefault()\n isDragOver.value = false\n if (props.disabled) return\n\n try {\n if (props.mode !== 'file' && event.dataTransfer?.items?.length) {\n await handleFolderDrop(event.dataTransfer.items)\n } else if (event.dataTransfer?.files) {\n handleFiles(event.dataTransfer.files)\n }\n } catch (cause) {\n emit('error', cause instanceof Error ? cause.message : 'Could not read the dropped folder.')\n }\n}\n\nasync function handleFolderDrop(items: DataTransferItemList) {\n const files: File[] = []\n const relativePaths: string[] = []\n let folderNameFromDrop: string | undefined\n\n // Capture live drag data before awaiting: the browser protects it after the drop handler.\n const dropped = Array.from(items, (item) => {\n const entry = item.webkitGetAsEntry?.()\n return { entry, file: entry ? null : item.getAsFile?.() }\n })\n for (const { entry, file: droppedFile } of dropped) {\n if (entry?.isDirectory) {\n folderNameFromDrop = entry.name\n await readDirectory(\n entry as FileSystemDirectoryEntry,\n files,\n relativePaths,\n entry.name,\n )\n } else {\n const file = entry?.isFile\n ? await getFile(entry as FileSystemFileEntry)\n : droppedFile\n if (file) {\n files.push(file)\n relativePaths.push(file.name)\n }\n }\n }\n\n if (files.length > 0) {\n handleFiles(files, folderNameFromDrop, relativePaths)\n }\n}\n\nasync function readDirectory(\n directory: FileSystemDirectoryEntry,\n files: File[],\n relativePaths: string[],\n prefix: string,\n): Promise<void> {\n const reader = directory.createReader()\n // readEntries returns at most 100 entries per call per spec — must loop\n let batch: FileSystemEntry[]\n do {\n batch = await new Promise<FileSystemEntry[]>((resolve, reject) => {\n reader.readEntries(resolve, reject)\n })\n for (const entry of batch) {\n if (entry.isFile) {\n const file = await getFile(entry as FileSystemFileEntry)\n if (file) {\n files.push(file)\n relativePaths.push(`${prefix}/${file.name}`)\n }\n } else if (entry.isDirectory) {\n await readDirectory(\n entry as FileSystemDirectoryEntry,\n files,\n relativePaths,\n `${prefix}/${entry.name}`,\n )\n }\n }\n } while (batch.length > 0)\n}\n\nfunction getFile(entry: FileSystemFileEntry): Promise<File | null> {\n return new Promise((resolve) => {\n entry.file(resolve, () => resolve(null))\n })\n}\n\nfunction handleDragOver(event: DragEvent) {\n event.preventDefault()\n if (!props.disabled) {\n isDragOver.value = true\n }\n}\n\nfunction handleDragLeave() {\n isDragOver.value = false\n}\n\nfunction handleInputChange(event: Event) {\n const target = event.target as HTMLInputElement\n if (target.files) {\n handleFiles(target.files)\n }\n target.value = ''\n}\n\nfunction openFilePicker() {\n if (!props.disabled) {\n inputRef.value?.click()\n }\n}\n\nfunction removeFile(index: number) {\n const removed = selectedFiles.value[index]\n selectedFiles.value = selectedFiles.value.filter((_, i) => i !== index)\n if (isFolder.value && selectedFiles.value.length === 0) {\n folderName.value = null\n }\n if (removed) emit('remove', [removed])\n}\n\nfunction clearAll() {\n const removed = [...selectedFiles.value]\n selectedFiles.value = []\n folderName.value = null\n if (removed.length) emit('remove', removed)\n}\n\nfunction formatFileSize(bytes: number): string {\n if (bytes >= 1024 * 1024) {\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`\n }\n if (bytes >= 1024) {\n return `${(bytes / 1024).toFixed(1)} KB`\n }\n return `${bytes} bytes`\n}\n</script>\n\n<template>\n <div class=\"mint-file-uploader\">\n <!-- Dropzone -->\n <div\n role=\"button\"\n tabindex=\"0\"\n :aria-label=\"disabled\n ? 'File upload disabled'\n : isMixed\n ? 'Drop files or a folder, or click to choose files'\n : isFolder ? 'Click or drag a folder to upload' : 'Click or drag files to upload'\"\n :aria-disabled=\"disabled\"\n :class=\"[\n 'mint-file-uploader__dropzone',\n `mint-file-uploader__dropzone--${size}`,\n isDragOver ? 'mint-file-uploader__dropzone--dragover' : '',\n disabled ? 'mint-file-uploader__dropzone--disabled' : '',\n selectedFiles.length > 0 ? 'mint-file-uploader__dropzone--has-files' : '',\n ]\"\n @click=\"openFilePicker\"\n @keydown.enter=\"openFilePicker\"\n @keydown.space.prevent=\"openFilePicker\"\n @drop=\"handleDrop\"\n @dragover=\"handleDragOver\"\n @dragleave=\"handleDragLeave\"\n >\n <input\n ref=\"inputRef\"\n type=\"file\"\n :accept=\"accept\"\n :multiple=\"isFolder || multiple\"\n :disabled=\"disabled\"\n :webkitdirectory=\"isFolder || undefined\"\n class=\"mint-file-uploader__input\"\n @change=\"handleInputChange\"\n />\n\n <div class=\"mint-file-uploader__content\">\n <svg\n v-if=\"isFolder\"\n class=\"mint-file-uploader__icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z\" />\n </svg>\n <svg\n v-else\n class=\"mint-file-uploader__icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3\" /><path d=\"m16 16-4-4-4 4\" /><path d=\"M12 12v9\" />\n </svg>\n\n <p class=\"mint-file-uploader__text\">\n {{ isMixed ? 'Drop files or a folder, or click to choose files' : `Drop ${acceptLabel} or click` }}\n </p>\n </div>\n </div>\n\n <!-- Actions slot (e.g. template buttons) -->\n <div v-if=\"$slots.actions\" class=\"mint-file-uploader__actions\">\n <slot name=\"actions\" />\n </div>\n\n <!-- Folder summary display -->\n <div v-if=\"showFiles && isFolder && folderName && selectedFiles.length > 0\" class=\"mint-file-uploader__folder-summary\">\n <div class=\"mint-file-uploader__folder-info\">\n <div class=\"mint-file-uploader__folder-icon-wrapper\">\n <svg class=\"mint-file-uploader__folder-icon\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" viewBox=\"0 0 24 24\">\n <path d=\"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2\" />\n </svg>\n </div>\n <div class=\"mint-file-uploader__folder-details\">\n <span class=\"mint-file-uploader__folder-name\">{{ folderName }}</span>\n <span class=\"mint-file-uploader__folder-count\">{{ selectedFiles.length }} file{{ selectedFiles.length !== 1 ? 's' : '' }}</span>\n </div>\n </div>\n <button\n type=\"button\"\n aria-label=\"Clear folder\"\n class=\"mint-file-uploader__remove-btn\"\n @click.stop=\"clearAll\"\n >\n <svg class=\"mint-file-uploader__remove-icon\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" viewBox=\"0 0 24 24\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </div>\n\n <!-- File list display -->\n <TransitionGroup\n v-if=\"showFiles && !isFolder && selectedFiles.length > 0\"\n tag=\"ul\"\n name=\"mint-file-uploader-item\"\n class=\"mint-file-uploader__list\"\n >\n <li\n v-for=\"(file, index) in selectedFiles\"\n :key=\"`${file.name}-${file.size}-${index}`\"\n class=\"mint-file-uploader__file\"\n >\n <div class=\"mint-file-uploader__file-info\">\n <span\n class=\"mint-file-uploader__file-badge\"\n :style=\"{ '--badge-color': getFileType(file.name).color }\"\n >\n {{ getFileType(file.name).label }}\n </span>\n <div class=\"mint-file-uploader__file-meta\">\n <span class=\"mint-file-uploader__file-name\">{{ file.name }}</span>\n <span class=\"mint-file-uploader__file-size\">{{ formatFileSize(file.size) }}</span>\n </div>\n </div>\n <button\n type=\"button\"\n :aria-label=\"`Remove ${file.name}`\"\n class=\"mint-file-uploader__remove-btn\"\n @click.stop=\"removeFile(index)\"\n >\n <svg class=\"mint-file-uploader__remove-icon\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" viewBox=\"0 0 24 24\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </li>\n </TransitionGroup>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Drag-and-drop file upload zone with type filtering, size validation, and folder mode. */\nimport { ref, computed, watch } from 'vue'\n\ninterface Props {\n accept?: string\n multiple?: boolean\n maxSize?: number\n disabled?: boolean\n size?: 'sm' | 'md' | 'lg'\n mode?: 'file' | 'folder' | 'file+folder'\n /** Hide the selection list when a parent presents the files itself. */\n showFiles?: boolean\n /** Restore selections owned by a parent form; omitted for internal selection state. */\n files?: File[]\n rootName?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n multiple: false,\n disabled: false,\n size: 'md',\n mode: 'file',\n showFiles: true,\n})\n\nconst emit = defineEmits<{\n upload: [files: File[], rootName?: string, relativePaths?: string[]]\n remove: [files: File[]]\n error: [message: string]\n}>()\n\nconst isDragOver = ref(false)\nconst inputRef = ref<HTMLInputElement>()\nconst selectedFiles = ref<File[]>([])\nconst folderName = ref<string | null>(null)\n\nwatch(() => [props.files, props.rootName] as const, ([files, rootName]) => {\n if (files === undefined) return\n selectedFiles.value = [...files]\n folderName.value = rootName ?? extractFolderName(files)\n}, { immediate: true })\n\nconst isFolder = computed(() => props.mode === 'folder')\nconst isMixed = computed(() => props.mode === 'file+folder')\n\nconst acceptLabel = computed(() => {\n if (!props.accept) return isFolder.value ? 'a folder' : 'any file'\n return props.accept.split(',').map(a => a.trim().replace('.', '').toUpperCase()).join(', ')\n})\n\nconst maxSizeLabel = computed(() => {\n if (!props.maxSize) return null\n if (props.maxSize >= 1024 * 1024 * 1024) {\n return `${(props.maxSize / (1024 * 1024 * 1024)).toFixed(1)} GB`\n }\n if (props.maxSize >= 1024 * 1024) {\n return `${(props.maxSize / (1024 * 1024)).toFixed(1)} MB`\n }\n if (props.maxSize >= 1024) {\n return `${(props.maxSize / 1024).toFixed(1)} KB`\n }\n return `${props.maxSize} bytes`\n})\n\nconst fileTypeMap: Record<string, { color: string; label: string }> = {\n csv: { color: '#10B981', label: 'CSV' },\n tsv: { color: '#10B981', label: 'TSV' },\n xlsx: { color: '#10B981', label: 'XLSX' },\n xls: { color: '#10B981', label: 'XLS' },\n pdf: { color: '#EF4444', label: 'PDF' },\n png: { color: '#8B5CF6', label: 'PNG' },\n jpg: { color: '#8B5CF6', label: 'JPG' },\n jpeg: { color: '#8B5CF6', label: 'JPEG' },\n gif: { color: '#8B5CF6', label: 'GIF' },\n svg: { color: '#8B5CF6', label: 'SVG' },\n webp: { color: '#8B5CF6', label: 'WEBP' },\n json: { color: '#F59E0B', label: 'JSON' },\n xml: { color: '#F59E0B', label: 'XML' },\n txt: { color: '#64748B', label: 'TXT' },\n zip: { color: '#6366F1', label: 'ZIP' },\n gz: { color: '#6366F1', label: 'GZ' },\n py: { color: '#3B82F6', label: 'PY' },\n js: { color: '#EAB308', label: 'JS' },\n ts: { color: '#3B82F6', label: 'TS' },\n fasta: { color: '#EC4899', label: 'FASTA' },\n fastq: { color: '#EC4899', label: 'FASTQ' },\n bam: { color: '#EC4899', label: 'BAM' },\n vcf: { color: '#EC4899', label: 'VCF' },\n}\n\nfunction getFileType(filename: string): { color: string; label: string } {\n const ext = filename.split('.').pop()?.toLowerCase() || ''\n return fileTypeMap[ext] || { color: '#94A3B8', label: ext.toUpperCase() || 'FILE' }\n}\n\nfunction validateFiles(files: FileList | File[]): File[] {\n const validFiles: File[] = []\n\n for (const file of Array.from(files)) {\n if (props.maxSize && file.size > props.maxSize) {\n emit('error', `File \"${file.name}\" exceeds maximum size of ${maxSizeLabel.value}`)\n continue\n }\n\n if (props.accept) {\n const acceptedTypes = props.accept.split(',').map(t => t.trim().toLowerCase())\n const fileExt = '.' + file.name.split('.').pop()?.toLowerCase()\n const fileType = file.type.toLowerCase()\n\n const isAccepted = acceptedTypes.some(type => {\n if (type.startsWith('.')) {\n return fileExt === type\n }\n if (type.endsWith('/*')) {\n return fileType.startsWith(type.replace('/*', '/'))\n }\n return fileType === type\n })\n\n if (!isAccepted) {\n emit('error', `File \"${file.name}\" is not an accepted file type`)\n continue\n }\n }\n\n validFiles.push(file)\n }\n\n return validFiles\n}\n\nfunction handleFiles(\n files: FileList | File[],\n folder?: string,\n explicitRelativePaths?: string[],\n) {\n const candidates = Array.from(files)\n const validFiles = validateFiles(files)\n if (validFiles.length === 0) return\n const relativePaths = validFiles.map((file) => {\n const candidateIndex = candidates.indexOf(file)\n return explicitRelativePaths?.[candidateIndex]\n || file.webkitRelativePath\n || (folder ? `${folder}/${file.name}` : file.name)\n })\n\n if (isFolder.value) {\n folderName.value = folder || extractFolderName(validFiles)\n selectedFiles.value = validFiles\n emit('upload', validFiles, folderName.value ?? undefined, relativePaths)\n } else if (!props.multiple) {\n selectedFiles.value = [validFiles[0]]\n emit('upload', [validFiles[0]], undefined, [relativePaths[0]])\n } else {\n selectedFiles.value = [...selectedFiles.value, ...validFiles]\n emit('upload', validFiles, undefined, relativePaths)\n }\n}\n\nfunction extractFolderName(files: File[]): string | null {\n if (files.length === 0) return null\n const firstPath = files[0].webkitRelativePath\n if (firstPath) {\n return firstPath.split('/')[0]\n }\n return null\n}\n\nasync function handleDrop(event: DragEvent) {\n event.preventDefault()\n isDragOver.value = false\n if (props.disabled) return\n\n try {\n if (props.mode !== 'file' && event.dataTransfer?.items?.length) {\n await handleFolderDrop(event.dataTransfer.items)\n } else if (event.dataTransfer?.files) {\n handleFiles(event.dataTransfer.files)\n }\n } catch (cause) {\n emit('error', cause instanceof Error ? cause.message : 'Could not read the dropped folder.')\n }\n}\n\nasync function handleFolderDrop(items: DataTransferItemList) {\n const files: File[] = []\n const relativePaths: string[] = []\n let folderNameFromDrop: string | undefined\n\n // Capture live drag data before awaiting: the browser protects it after the drop handler.\n const dropped = Array.from(items, (item) => {\n const entry = item.webkitGetAsEntry?.()\n return { entry, file: entry ? null : item.getAsFile?.() }\n })\n for (const { entry, file: droppedFile } of dropped) {\n if (entry?.isDirectory) {\n folderNameFromDrop = entry.name\n await readDirectory(\n entry as FileSystemDirectoryEntry,\n files,\n relativePaths,\n entry.name,\n )\n } else {\n const file = entry?.isFile\n ? await getFile(entry as FileSystemFileEntry)\n : droppedFile\n if (file) {\n files.push(file)\n relativePaths.push(file.name)\n }\n }\n }\n\n if (files.length > 0) {\n handleFiles(files, folderNameFromDrop, relativePaths)\n }\n}\n\nasync function readDirectory(\n directory: FileSystemDirectoryEntry,\n files: File[],\n relativePaths: string[],\n prefix: string,\n): Promise<void> {\n const reader = directory.createReader()\n // readEntries returns at most 100 entries per call per spec — must loop\n let batch: FileSystemEntry[]\n do {\n batch = await new Promise<FileSystemEntry[]>((resolve, reject) => {\n reader.readEntries(resolve, reject)\n })\n for (const entry of batch) {\n if (entry.isFile) {\n const file = await getFile(entry as FileSystemFileEntry)\n if (file) {\n files.push(file)\n relativePaths.push(`${prefix}/${file.name}`)\n }\n } else if (entry.isDirectory) {\n await readDirectory(\n entry as FileSystemDirectoryEntry,\n files,\n relativePaths,\n `${prefix}/${entry.name}`,\n )\n }\n }\n } while (batch.length > 0)\n}\n\nfunction getFile(entry: FileSystemFileEntry): Promise<File | null> {\n return new Promise((resolve) => {\n entry.file(resolve, () => resolve(null))\n })\n}\n\nfunction handleDragOver(event: DragEvent) {\n event.preventDefault()\n if (!props.disabled) {\n isDragOver.value = true\n }\n}\n\nfunction handleDragLeave() {\n isDragOver.value = false\n}\n\nfunction handleInputChange(event: Event) {\n const target = event.target as HTMLInputElement\n if (target.files) {\n handleFiles(target.files)\n }\n target.value = ''\n}\n\nfunction openFilePicker() {\n if (!props.disabled) {\n inputRef.value?.click()\n }\n}\n\nfunction removeFile(index: number) {\n const removed = selectedFiles.value[index]\n selectedFiles.value = selectedFiles.value.filter((_, i) => i !== index)\n if (isFolder.value && selectedFiles.value.length === 0) {\n folderName.value = null\n }\n if (removed) emit('remove', [removed])\n}\n\nfunction clearAll() {\n const removed = [...selectedFiles.value]\n selectedFiles.value = []\n folderName.value = null\n if (removed.length) emit('remove', removed)\n}\n\nfunction formatFileSize(bytes: number): string {\n if (bytes >= 1024 * 1024) {\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`\n }\n if (bytes >= 1024) {\n return `${(bytes / 1024).toFixed(1)} KB`\n }\n return `${bytes} bytes`\n}\n</script>\n\n<template>\n <div class=\"mint-file-uploader\">\n <!-- Dropzone -->\n <div\n role=\"button\"\n tabindex=\"0\"\n :aria-label=\"disabled\n ? 'File upload disabled'\n : isMixed\n ? 'Drop files or a folder, or click to choose files'\n : isFolder ? 'Click or drag a folder to upload' : 'Click or drag files to upload'\"\n :aria-disabled=\"disabled\"\n :class=\"[\n 'mint-file-uploader__dropzone',\n `mint-file-uploader__dropzone--${size}`,\n isDragOver ? 'mint-file-uploader__dropzone--dragover' : '',\n disabled ? 'mint-file-uploader__dropzone--disabled' : '',\n selectedFiles.length > 0 ? 'mint-file-uploader__dropzone--has-files' : '',\n ]\"\n @click=\"openFilePicker\"\n @keydown.enter=\"openFilePicker\"\n @keydown.space.prevent=\"openFilePicker\"\n @drop=\"handleDrop\"\n @dragover=\"handleDragOver\"\n @dragleave=\"handleDragLeave\"\n >\n <input\n ref=\"inputRef\"\n type=\"file\"\n :accept=\"accept\"\n :multiple=\"isFolder || multiple\"\n :disabled=\"disabled\"\n :webkitdirectory=\"isFolder || undefined\"\n class=\"mint-file-uploader__input\"\n @change=\"handleInputChange\"\n />\n\n <div class=\"mint-file-uploader__content\">\n <svg\n v-if=\"isFolder\"\n class=\"mint-file-uploader__icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z\" />\n </svg>\n <svg\n v-else\n class=\"mint-file-uploader__icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3\" /><path d=\"m16 16-4-4-4 4\" /><path d=\"M12 12v9\" />\n </svg>\n\n <p class=\"mint-file-uploader__text\">\n {{ isMixed ? 'Drop files or a folder, or click to choose files' : `Drop ${acceptLabel} or click` }}\n </p>\n </div>\n </div>\n\n <!-- Actions slot (e.g. template buttons) -->\n <div v-if=\"$slots.actions\" class=\"mint-file-uploader__actions\">\n <slot name=\"actions\" />\n </div>\n\n <!-- Folder summary display -->\n <div v-if=\"showFiles && isFolder && folderName && selectedFiles.length > 0\" class=\"mint-file-uploader__folder-summary\">\n <div class=\"mint-file-uploader__folder-info\">\n <div class=\"mint-file-uploader__folder-icon-wrapper\">\n <svg class=\"mint-file-uploader__folder-icon\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" viewBox=\"0 0 24 24\">\n <path d=\"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2\" />\n </svg>\n </div>\n <div class=\"mint-file-uploader__folder-details\">\n <span class=\"mint-file-uploader__folder-name\">{{ folderName }}</span>\n <span class=\"mint-file-uploader__folder-count\">{{ selectedFiles.length }} file{{ selectedFiles.length !== 1 ? 's' : '' }}</span>\n </div>\n </div>\n <button\n type=\"button\"\n aria-label=\"Clear folder\"\n class=\"mint-file-uploader__remove-btn\"\n @click.stop=\"clearAll\"\n >\n <svg class=\"mint-file-uploader__remove-icon\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" viewBox=\"0 0 24 24\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </div>\n\n <!-- File list display -->\n <TransitionGroup\n v-if=\"showFiles && !isFolder && selectedFiles.length > 0\"\n tag=\"ul\"\n name=\"mint-file-uploader-item\"\n class=\"mint-file-uploader__list\"\n >\n <li\n v-for=\"(file, index) in selectedFiles\"\n :key=\"`${file.name}-${file.size}-${index}`\"\n class=\"mint-file-uploader__file\"\n >\n <div class=\"mint-file-uploader__file-info\">\n <span\n class=\"mint-file-uploader__file-badge\"\n :style=\"{ '--badge-color': getFileType(file.name).color }\"\n >\n {{ getFileType(file.name).label }}\n </span>\n <div class=\"mint-file-uploader__file-meta\">\n <span class=\"mint-file-uploader__file-name\">{{ file.name }}</span>\n <span class=\"mint-file-uploader__file-size\">{{ formatFileSize(file.size) }}</span>\n </div>\n </div>\n <button\n type=\"button\"\n :aria-label=\"`Remove ${file.name}`\"\n class=\"mint-file-uploader__remove-btn\"\n @click.stop=\"removeFile(index)\"\n >\n <svg class=\"mint-file-uploader__remove-icon\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" viewBox=\"0 0 24 24\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </li>\n </TransitionGroup>\n </div>\n</template>\n","import { nextTick } from 'vue'\n\nexport interface UseMenuKeyboardOptions {\n /** Returns the currently navigable items inside the open panel, in DOM order. */\n items: () => HTMLElement[]\n /** True while the panel is open. */\n isOpen: () => boolean\n /** Opens the panel. */\n open: () => void\n /** Closes the panel. When `returnFocus` is true, focus should return to the trigger. */\n close: (returnFocus?: boolean) => void\n}\n\nexport interface UseMenuKeyboardReturn {\n /**\n * Bind to the trigger's `@keydown`. ArrowDown/Enter/Space open the panel (when\n * closed) and focus its first item; ArrowUp opens it focused on the last item.\n */\n handleTriggerKeydown: (event: KeyboardEvent) => void\n /**\n * Bind to the open panel's `@keydown`. ArrowUp/ArrowDown cycle focus with\n * wraparound, Home/End jump to the first/last item, Escape closes, returns\n * focus to the trigger and stops propagating, and Tab closes without moving focus.\n */\n handlePanelKeydown: (event: KeyboardEvent) => void\n}\n\n/**\n * Shared keyboard contract for menu- and listbox-style disclosure panels (the\n * WAI-ARIA menu button pattern). Used by ActionMenu and AppAvatarMenu,\n * each pairing it with `useDropdownState` for the disclosure state itself.\n */\nexport function useMenuKeyboard(options: UseMenuKeyboardOptions): UseMenuKeyboardReturn {\n function focusItem(position: 'first' | 'last') {\n void nextTick(() => {\n const items = options.items()\n const target = position === 'first' ? items[0] : items[items.length - 1]\n target?.focus()\n })\n }\n\n function handleTriggerKeydown(event: KeyboardEvent) {\n if (options.isOpen()) return\n\n if (event.key === 'ArrowDown' || event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n options.open()\n focusItem('first')\n return\n }\n if (event.key === 'ArrowUp') {\n event.preventDefault()\n options.open()\n focusItem('last')\n }\n }\n\n function handlePanelKeydown(event: KeyboardEvent) {\n const items = options.items()\n const currentIndex = items.indexOf(document.activeElement as HTMLElement)\n\n if (event.key === 'Escape') {\n event.preventDefault()\n // The menu handles this Escape; an enclosing BaseModal must not close too.\n event.stopPropagation()\n options.close(true)\n return\n }\n if (event.key === 'Tab') {\n options.close()\n return\n }\n if (event.key === 'Home') {\n event.preventDefault()\n items[0]?.focus()\n return\n }\n if (event.key === 'End') {\n event.preventDefault()\n items[items.length - 1]?.focus()\n return\n }\n if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp') return\n\n event.preventDefault()\n const direction = event.key === 'ArrowDown' ? 1 : -1\n const nextIndex = (Math.max(currentIndex, 0) + direction + items.length) % items.length\n items[nextIndex]?.focus()\n }\n\n return { handleTriggerKeydown, handlePanelKeydown }\n}\n","/** Narrow an unknown value to a plain object (arrays and null excluded). */\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\n/** Narrow an unknown value to any non-null object, arrays included. */\nexport function isObjectLike(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null\n}\n","<script setup lang=\"ts\">\n/** Combined date and time picker with a dropdown calendar, time slots, and 12/24 h format support. */\nimport { computed, ref, watch, nextTick, useTemplateRef } from 'vue'\nimport { useCalendarGrid, type CalendarGridDay } from '../composables/useCalendarGrid'\nimport { useDropdownState } from '../composables/useDropdownState'\nimport { useFocusTrap } from '../composables/useFocusTrap'\nimport { formatTime, formatTimeSlot, generateTimeSlots, toMinutes } from '../composables/useTimeUtils'\nimport CalendarGridPanelInternal from './internal/CalendarGridPanelInternal.vue'\n\ninterface Props {\n modelValue?: string\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n min?: string\n max?: string\n timeStep?: number\n timeFormat?: '12h' | '24h'\n clearable?: boolean\n locale?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n placeholder: 'Select date & time',\n disabled: false,\n error: false,\n size: 'md',\n timeStep: 15,\n timeFormat: '24h',\n clearable: false,\n locale: 'en-US',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | undefined]\n}>()\n\nconst dropdownRef = ref<HTMLElement | null>(null)\nconst { isOpen, open, close, toggle } = useDropdownState({\n rootRef: useTemplateRef<HTMLElement>('root'),\n triggerRef: useTemplateRef<HTMLElement>('trigger'),\n})\n// Non-modal dialog: Tab stays inside the panel, focus returns to the input on close.\nuseFocusTrap({ containerRef: dropdownRef, active: isOpen })\nconst {\n weekDays,\n monthYear,\n calendarDays,\n formatDateValue,\n setCurrentMonthFromDate,\n prevMonth,\n nextMonth,\n} = useCalendarGrid({\n min: () => props.min,\n max: () => props.max,\n locale: () => props.locale,\n})\n\n// Parse model value into date and time parts\nconst selectedDate = computed(() => {\n if (!props.modelValue) return null\n const d = new Date(props.modelValue)\n return isNaN(d.getTime()) ? null : d\n})\n\nconst selectedDateStr = computed(() => {\n if (!selectedDate.value) return null\n return formatDateValue(selectedDate.value)\n})\n\nconst selectedTimeStr = computed(() => {\n if (!selectedDate.value) return null\n return formatTime(selectedDate.value.getHours(), selectedDate.value.getMinutes())\n})\n\nconst displayValue = computed(() => {\n if (!selectedDate.value) return ''\n const dateStr = selectedDate.value.toLocaleDateString(props.locale, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n })\n const timeStr = formatTime(\n selectedDate.value.getHours(),\n selectedDate.value.getMinutes(),\n props.timeFormat,\n )\n return `${dateStr} ${timeStr}`\n})\n\n// Time slots\nconst timeSlots = computed(() => {\n return generateTimeSlots('00:00', '23:59', props.timeStep)\n})\n\nfunction isTimeDisabled(time: string): boolean {\n if (!selectedDateStr.value) return false\n const timeMinutes = toMinutes(time)\n\n if (props.min) {\n const minDate = new Date(props.min)\n if (selectedDateStr.value === formatDateValue(minDate)) {\n const minMin = minDate.getHours() * 60 + minDate.getMinutes()\n if (timeMinutes < minMin) return true\n }\n }\n if (props.max) {\n const maxDate = new Date(props.max)\n if (selectedDateStr.value === formatDateValue(maxDate)) {\n const maxMin = maxDate.getHours() * 60 + maxDate.getMinutes()\n if (timeMinutes > maxMin) return true\n }\n }\n return false\n}\n\nfunction selectDate(day: CalendarGridDay) {\n if (day.isDisabled || props.disabled) return\n const dateStr = formatDateValue(day.date)\n const timeStr = selectedTimeStr.value || '09:00'\n emit('update:modelValue', `${dateStr}T${timeStr}`)\n}\n\nfunction selectTime(time: string) {\n if (isTimeDisabled(time)) return\n const dateStr = selectedDateStr.value || formatDateValue(new Date())\n emit('update:modelValue', `${dateStr}T${time}`)\n}\n\nfunction goToNow() {\n const now = new Date()\n setCurrentMonthFromDate(now)\n const dateStr = formatDateValue(now)\n const timeStr = formatTime(now.getHours(), now.getMinutes())\n emit('update:modelValue', `${dateStr}T${timeStr}`)\n close()\n}\n\nfunction goToToday() {\n const today = new Date()\n setCurrentMonthFromDate(today)\n const dateStr = formatDateValue(today)\n const timeStr = selectedTimeStr.value || '09:00'\n emit('update:modelValue', `${dateStr}T${timeStr}`)\n}\n\nfunction clear() {\n emit('update:modelValue', undefined)\n close()\n}\n\nfunction toggleDropdown() {\n if (props.disabled) return\n toggle()\n}\n\nfunction handleTriggerKeydown(event: KeyboardEvent) {\n if (props.disabled || isOpen.value) return\n if (event.key === 'Enter' || event.key === ' ' || event.key === 'ArrowDown') {\n event.preventDefault()\n open()\n }\n}\n\n/** Moves focus into the calendar grid: selected day, else today, else the first day. */\nfunction focusCalendar() {\n const panel = dropdownRef.value\n if (!panel) return\n const target =\n panel.querySelector<HTMLElement>('.mint-date-picker__day--selected') ??\n panel.querySelector<HTMLElement>('.mint-date-picker__day--today') ??\n panel.querySelector<HTMLElement>('.mint-date-picker__day:not([disabled])')\n target?.focus()\n}\n\nwatch(isOpen, async (opened) => {\n if (!opened) return\n if (selectedDate.value) {\n setCurrentMonthFromDate(selectedDate.value)\n }\n await nextTick()\n if (selectedDate.value) {\n // Scroll time grid to selected time\n const grid = dropdownRef.value?.querySelector('.mint-datetime-picker__time-grid')\n const active = dropdownRef.value?.querySelector('.mint-datetime-picker__time-chip--active')\n if (grid && active) {\n active.scrollIntoView({ block: 'center' })\n }\n }\n // A second tick so this focus lands after the focus trap's initial focus.\n await nextTick()\n focusCalendar()\n})\n</script>\n\n<template>\n <div ref=\"root\" class=\"mint-datetime-picker\">\n <div class=\"mint-datetime-picker__input-wrapper\">\n <div class=\"mint-datetime-picker__icon-calendar\">\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z\" />\n </svg>\n </div>\n <input\n ref=\"trigger\"\n type=\"text\"\n readonly\n aria-haspopup=\"dialog\"\n :aria-expanded=\"isOpen\"\n :value=\"displayValue\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :class=\"[\n 'mint-datetime-picker__input',\n `mint-datetime-picker__input--${size}`,\n error ? 'mint-datetime-picker__input--error' : '',\n disabled ? 'mint-datetime-picker__input--disabled' : '',\n ]\"\n aria-label=\"Select date and time\"\n @click=\"toggleDropdown\"\n @keydown=\"handleTriggerKeydown\"\n />\n <div class=\"mint-datetime-picker__icon-clock\">\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z\" />\n </svg>\n </div>\n </div>\n\n <Transition\n enter-active-class=\"mint-datetime-picker__dropdown-enter-active\"\n enter-from-class=\"mint-datetime-picker__dropdown-enter-from\"\n enter-to-class=\"mint-datetime-picker__dropdown-enter-to\"\n leave-active-class=\"mint-datetime-picker__dropdown-leave-active\"\n leave-from-class=\"mint-datetime-picker__dropdown-leave-from\"\n leave-to-class=\"mint-datetime-picker__dropdown-leave-to\"\n >\n <div\n v-if=\"isOpen\"\n ref=\"dropdownRef\"\n class=\"mint-popover mint-datetime-picker__dropdown\"\n role=\"dialog\"\n aria-label=\"Date and time picker\"\n >\n <!-- Calendar section -->\n <div class=\"mint-datetime-picker__calendar-section\">\n <CalendarGridPanelInternal\n :week-days=\"weekDays\"\n :month-year=\"monthYear\"\n :days=\"calendarDays\"\n :selected-date=\"selectedDate\"\n :locale=\"locale\"\n @previous-month=\"prevMonth\"\n @next-month=\"nextMonth\"\n @select=\"selectDate\"\n />\n </div>\n\n <!-- Divider -->\n <div class=\"mint-datetime-picker__divider\" />\n\n <!-- Time section -->\n <div class=\"mint-datetime-picker__time-section\">\n <div class=\"mint-datetime-picker__time-label\">Time</div>\n <div class=\"mint-datetime-picker__time-grid\">\n <button\n v-for=\"time in timeSlots\"\n :key=\"time\"\n type=\"button\"\n :disabled=\"isTimeDisabled(time)\"\n :class=\"[\n 'mint-datetime-picker__time-chip',\n selectedTimeStr === time ? 'mint-datetime-picker__time-chip--active' : '',\n isTimeDisabled(time) ? 'mint-datetime-picker__time-chip--disabled' : '',\n ]\"\n @click=\"selectTime(time)\"\n >\n {{ formatTimeSlot(time, timeFormat) }}\n </button>\n </div>\n </div>\n\n <!-- Footer -->\n <div class=\"mint-datetime-picker__footer\">\n <div>\n <button type=\"button\" class=\"mint-datetime-picker__footer-btn\" @click=\"goToToday\">Today</button>\n <button type=\"button\" class=\"mint-datetime-picker__footer-btn\" @click=\"goToNow\">Now</button>\n </div>\n <button\n v-if=\"clearable && modelValue\"\n type=\"button\"\n class=\"mint-datetime-picker__footer-btn mint-datetime-picker__footer-btn--muted\"\n @click=\"clear\"\n >\n Clear\n </button>\n </div>\n </div>\n </Transition>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Combined date and time picker with a dropdown calendar, time slots, and 12/24 h format support. */\nimport { computed, ref, watch, nextTick, useTemplateRef } from 'vue'\nimport { useCalendarGrid, type CalendarGridDay } from '../composables/useCalendarGrid'\nimport { useDropdownState } from '../composables/useDropdownState'\nimport { useFocusTrap } from '../composables/useFocusTrap'\nimport { formatTime, formatTimeSlot, generateTimeSlots, toMinutes } from '../composables/useTimeUtils'\nimport CalendarGridPanelInternal from './internal/CalendarGridPanelInternal.vue'\n\ninterface Props {\n modelValue?: string\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n min?: string\n max?: string\n timeStep?: number\n timeFormat?: '12h' | '24h'\n clearable?: boolean\n locale?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n placeholder: 'Select date & time',\n disabled: false,\n error: false,\n size: 'md',\n timeStep: 15,\n timeFormat: '24h',\n clearable: false,\n locale: 'en-US',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string | undefined]\n}>()\n\nconst dropdownRef = ref<HTMLElement | null>(null)\nconst { isOpen, open, close, toggle } = useDropdownState({\n rootRef: useTemplateRef<HTMLElement>('root'),\n triggerRef: useTemplateRef<HTMLElement>('trigger'),\n})\n// Non-modal dialog: Tab stays inside the panel, focus returns to the input on close.\nuseFocusTrap({ containerRef: dropdownRef, active: isOpen })\nconst {\n weekDays,\n monthYear,\n calendarDays,\n formatDateValue,\n setCurrentMonthFromDate,\n prevMonth,\n nextMonth,\n} = useCalendarGrid({\n min: () => props.min,\n max: () => props.max,\n locale: () => props.locale,\n})\n\n// Parse model value into date and time parts\nconst selectedDate = computed(() => {\n if (!props.modelValue) return null\n const d = new Date(props.modelValue)\n return isNaN(d.getTime()) ? null : d\n})\n\nconst selectedDateStr = computed(() => {\n if (!selectedDate.value) return null\n return formatDateValue(selectedDate.value)\n})\n\nconst selectedTimeStr = computed(() => {\n if (!selectedDate.value) return null\n return formatTime(selectedDate.value.getHours(), selectedDate.value.getMinutes())\n})\n\nconst displayValue = computed(() => {\n if (!selectedDate.value) return ''\n const dateStr = selectedDate.value.toLocaleDateString(props.locale, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n })\n const timeStr = formatTime(\n selectedDate.value.getHours(),\n selectedDate.value.getMinutes(),\n props.timeFormat,\n )\n return `${dateStr} ${timeStr}`\n})\n\n// Time slots\nconst timeSlots = computed(() => {\n return generateTimeSlots('00:00', '23:59', props.timeStep)\n})\n\nfunction isTimeDisabled(time: string): boolean {\n if (!selectedDateStr.value) return false\n const timeMinutes = toMinutes(time)\n\n if (props.min) {\n const minDate = new Date(props.min)\n if (selectedDateStr.value === formatDateValue(minDate)) {\n const minMin = minDate.getHours() * 60 + minDate.getMinutes()\n if (timeMinutes < minMin) return true\n }\n }\n if (props.max) {\n const maxDate = new Date(props.max)\n if (selectedDateStr.value === formatDateValue(maxDate)) {\n const maxMin = maxDate.getHours() * 60 + maxDate.getMinutes()\n if (timeMinutes > maxMin) return true\n }\n }\n return false\n}\n\nfunction selectDate(day: CalendarGridDay) {\n if (day.isDisabled || props.disabled) return\n const dateStr = formatDateValue(day.date)\n const timeStr = selectedTimeStr.value || '09:00'\n emit('update:modelValue', `${dateStr}T${timeStr}`)\n}\n\nfunction selectTime(time: string) {\n if (isTimeDisabled(time)) return\n const dateStr = selectedDateStr.value || formatDateValue(new Date())\n emit('update:modelValue', `${dateStr}T${time}`)\n}\n\nfunction goToNow() {\n const now = new Date()\n setCurrentMonthFromDate(now)\n const dateStr = formatDateValue(now)\n const timeStr = formatTime(now.getHours(), now.getMinutes())\n emit('update:modelValue', `${dateStr}T${timeStr}`)\n close()\n}\n\nfunction goToToday() {\n const today = new Date()\n setCurrentMonthFromDate(today)\n const dateStr = formatDateValue(today)\n const timeStr = selectedTimeStr.value || '09:00'\n emit('update:modelValue', `${dateStr}T${timeStr}`)\n}\n\nfunction clear() {\n emit('update:modelValue', undefined)\n close()\n}\n\nfunction toggleDropdown() {\n if (props.disabled) return\n toggle()\n}\n\nfunction handleTriggerKeydown(event: KeyboardEvent) {\n if (props.disabled || isOpen.value) return\n if (event.key === 'Enter' || event.key === ' ' || event.key === 'ArrowDown') {\n event.preventDefault()\n open()\n }\n}\n\n/** Moves focus into the calendar grid: selected day, else today, else the first day. */\nfunction focusCalendar() {\n const panel = dropdownRef.value\n if (!panel) return\n const target =\n panel.querySelector<HTMLElement>('.mint-date-picker__day--selected') ??\n panel.querySelector<HTMLElement>('.mint-date-picker__day--today') ??\n panel.querySelector<HTMLElement>('.mint-date-picker__day:not([disabled])')\n target?.focus()\n}\n\nwatch(isOpen, async (opened) => {\n if (!opened) return\n if (selectedDate.value) {\n setCurrentMonthFromDate(selectedDate.value)\n }\n await nextTick()\n if (selectedDate.value) {\n // Scroll time grid to selected time\n const grid = dropdownRef.value?.querySelector('.mint-datetime-picker__time-grid')\n const active = dropdownRef.value?.querySelector('.mint-datetime-picker__time-chip--active')\n if (grid && active) {\n active.scrollIntoView({ block: 'center' })\n }\n }\n // A second tick so this focus lands after the focus trap's initial focus.\n await nextTick()\n focusCalendar()\n})\n</script>\n\n<template>\n <div ref=\"root\" class=\"mint-datetime-picker\">\n <div class=\"mint-datetime-picker__input-wrapper\">\n <div class=\"mint-datetime-picker__icon-calendar\">\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z\" />\n </svg>\n </div>\n <input\n ref=\"trigger\"\n type=\"text\"\n readonly\n aria-haspopup=\"dialog\"\n :aria-expanded=\"isOpen\"\n :value=\"displayValue\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :class=\"[\n 'mint-datetime-picker__input',\n `mint-datetime-picker__input--${size}`,\n error ? 'mint-datetime-picker__input--error' : '',\n disabled ? 'mint-datetime-picker__input--disabled' : '',\n ]\"\n aria-label=\"Select date and time\"\n @click=\"toggleDropdown\"\n @keydown=\"handleTriggerKeydown\"\n />\n <div class=\"mint-datetime-picker__icon-clock\">\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z\" />\n </svg>\n </div>\n </div>\n\n <Transition\n enter-active-class=\"mint-datetime-picker__dropdown-enter-active\"\n enter-from-class=\"mint-datetime-picker__dropdown-enter-from\"\n enter-to-class=\"mint-datetime-picker__dropdown-enter-to\"\n leave-active-class=\"mint-datetime-picker__dropdown-leave-active\"\n leave-from-class=\"mint-datetime-picker__dropdown-leave-from\"\n leave-to-class=\"mint-datetime-picker__dropdown-leave-to\"\n >\n <div\n v-if=\"isOpen\"\n ref=\"dropdownRef\"\n class=\"mint-popover mint-datetime-picker__dropdown\"\n role=\"dialog\"\n aria-label=\"Date and time picker\"\n >\n <!-- Calendar section -->\n <div class=\"mint-datetime-picker__calendar-section\">\n <CalendarGridPanelInternal\n :week-days=\"weekDays\"\n :month-year=\"monthYear\"\n :days=\"calendarDays\"\n :selected-date=\"selectedDate\"\n :locale=\"locale\"\n @previous-month=\"prevMonth\"\n @next-month=\"nextMonth\"\n @select=\"selectDate\"\n />\n </div>\n\n <!-- Divider -->\n <div class=\"mint-datetime-picker__divider\" />\n\n <!-- Time section -->\n <div class=\"mint-datetime-picker__time-section\">\n <div class=\"mint-datetime-picker__time-label\">Time</div>\n <div class=\"mint-datetime-picker__time-grid\">\n <button\n v-for=\"time in timeSlots\"\n :key=\"time\"\n type=\"button\"\n :disabled=\"isTimeDisabled(time)\"\n :class=\"[\n 'mint-datetime-picker__time-chip',\n selectedTimeStr === time ? 'mint-datetime-picker__time-chip--active' : '',\n isTimeDisabled(time) ? 'mint-datetime-picker__time-chip--disabled' : '',\n ]\"\n @click=\"selectTime(time)\"\n >\n {{ formatTimeSlot(time, timeFormat) }}\n </button>\n </div>\n </div>\n\n <!-- Footer -->\n <div class=\"mint-datetime-picker__footer\">\n <div>\n <button type=\"button\" class=\"mint-datetime-picker__footer-btn\" @click=\"goToToday\">Today</button>\n <button type=\"button\" class=\"mint-datetime-picker__footer-btn\" @click=\"goToNow\">Now</button>\n </div>\n <button\n v-if=\"clearable && modelValue\"\n type=\"button\"\n class=\"mint-datetime-picker__footer-btn mint-datetime-picker__footer-btn--muted\"\n @click=\"clear\"\n >\n Clear\n </button>\n </div>\n </div>\n </Transition>\n </div>\n</template>\n","import {\n getCurrentInstance,\n getCurrentScope,\n onMounted,\n onScopeDispose,\n ref,\n shallowRef,\n type Ref,\n} from 'vue'\nimport { tryUseSettingsStore } from '../stores/settings'\n\nexport type EventStreamTransport = (\n input: RequestInfo | URL,\n init?: RequestInit,\n) => Promise<Response>\n\nexport interface EventStreamMessage<TData = string> {\n event: string\n data: TData\n id?: string\n retry?: number\n raw: string\n}\n\nexport interface EventStreamOptions<TData = string> {\n transport?: EventStreamTransport\n headers?: HeadersInit\n credentials?: RequestCredentials\n immediate?: boolean\n /**\n * Reconnect after a dropped stream. Left unset, it follows the platform's\n * `wsAutoReconnect` setting, defaulting to `true` without a settings store.\n */\n reconnect?: boolean\n /**\n * Delay before the first reconnect attempt. Left unset, it follows the\n * platform's `wsReconnectInterval` setting, defaulting to 2000 ms without a\n * settings store. A server-sent `retry:` field still overrides it.\n */\n reconnectDelayMs?: number\n parseJson?: boolean\n shouldReconnect?: (cause?: unknown) => boolean\n onOpen?: () => void\n onMessage?: (message: EventStreamMessage<TData>) => void\n onError?: (cause: unknown) => void\n onClose?: (cause?: unknown) => void\n errorLabel?: string\n}\n\nexport interface UseEventStreamReturn<TData = string> {\n isConnected: Ref<boolean>\n isConnecting: Ref<boolean>\n error: Ref<string | null>\n lastMessage: Ref<EventStreamMessage<TData> | null>\n lastEventId: Ref<string | null>\n start: () => void\n stop: () => void\n}\n\ninterface ParsedEventStreamBlock<TData> {\n message?: EventStreamMessage<TData>\n id?: string\n retry?: number\n}\n\nclass EventStreamResponseError extends Error {\n constructor(readonly response: Response, label: string) {\n super(`${label} failed with HTTP ${response.status}`)\n this.name = 'EventStreamResponseError'\n }\n}\n\n/** Parse one complete SSE block without owning connection policy. */\nexport function parseEventStreamBlock<TData>(\n block: string,\n parseJson: boolean,\n): ParsedEventStreamBlock<TData> | null {\n let event = 'message'\n let id: string | undefined\n let retry: number | undefined\n const dataLines: string[] = []\n\n for (const line of block.split(/\\r\\n|\\r|\\n/)) {\n if (!line || line.startsWith(':')) continue\n const separator = line.indexOf(':')\n const field = separator === -1 ? line : line.slice(0, separator)\n const value = separator === -1\n ? ''\n : line.slice(separator + 1).replace(/^ /, '')\n\n if (field === 'event') event = value || 'message'\n if (field === 'data') dataLines.push(value)\n if (field === 'id' && !value.includes('\\0')) id = value\n if (field === 'retry' && /^\\d+$/.test(value)) retry = Number(value)\n }\n\n if (!dataLines.length && id === undefined && retry === undefined) return null\n const data = dataLines.join('\\n')\n return {\n message: dataLines.length\n ? {\n event,\n data: (parseJson && data ? JSON.parse(data) : data) as TData,\n id,\n retry,\n raw: block,\n }\n : undefined,\n id,\n retry,\n }\n}\n\n/** Shared fetch-based SSE lifecycle with cancellation and reconnect safety. */\nexport function useEventStream<TData = string>(\n url: string | (() => string),\n options: EventStreamOptions<TData> = {},\n): UseEventStreamReturn<TData> {\n const isConnected = ref(false)\n const isConnecting = ref(false)\n const error = ref<string | null>(null)\n const lastMessage = shallowRef<EventStreamMessage<TData> | null>(null)\n const lastEventId = ref<string | null>(null)\n let controller: AbortController | null = null\n let reader: ReadableStreamDefaultReader<Uint8Array> | null = null\n let reconnectTimer: ReturnType<typeof setTimeout> | null = null\n const settings = tryUseSettingsStore()\n const reconnectEnabled = options.reconnect ?? settings?.wsAutoReconnect ?? true\n let reconnectDelayMs = options.reconnectDelayMs ?? settings?.wsReconnectInterval ?? 2_000\n let stopped = true\n let generation = 0\n\n function clearReconnectTimer(): void {\n if (reconnectTimer === null) return\n clearTimeout(reconnectTimer)\n reconnectTimer = null\n }\n\n function ownsConnection(\n connectionGeneration: number,\n connectionController: AbortController,\n ): boolean {\n return !stopped\n && generation === connectionGeneration\n && controller === connectionController\n }\n\n function scheduleReconnect(connectionGeneration: number, cause?: unknown): void {\n if (stopped || generation !== connectionGeneration) return\n if (!reconnectEnabled || options.shouldReconnect?.(cause) === false) {\n stopped = true\n return\n }\n clearReconnectTimer()\n reconnectTimer = setTimeout(() => {\n reconnectTimer = null\n if (stopped || generation !== connectionGeneration) return\n void connect(connectionGeneration)\n }, reconnectDelayMs)\n }\n\n function dispatchBlock(\n block: string,\n connectionGeneration: number,\n connectionController: AbortController,\n ): void {\n const parsed = parseEventStreamBlock<TData>(block, options.parseJson ?? false)\n if (!parsed || !ownsConnection(connectionGeneration, connectionController)) return\n if (parsed.id !== undefined) {\n lastEventId.value = parsed.id\n if (!ownsConnection(connectionGeneration, connectionController)) return\n }\n if (parsed.retry !== undefined) reconnectDelayMs = parsed.retry\n const message = parsed.message\n if (!message || !ownsConnection(connectionGeneration, connectionController)) return\n lastMessage.value = message\n if (!ownsConnection(connectionGeneration, connectionController)) return\n options.onMessage?.(message)\n }\n\n async function consume(\n body: ReadableStream<Uint8Array>,\n connectionGeneration: number,\n connectionController: AbortController,\n ): Promise<void> {\n const connectionReader = body.getReader()\n reader = connectionReader\n const decoder = new TextDecoder()\n let buffer = ''\n try {\n for (;;) {\n const { value, done } = await connectionReader.read()\n if (!ownsConnection(connectionGeneration, connectionController)) return\n buffer += decoder.decode(value, { stream: !done })\n\n let boundary = /(?:\\r\\n|\\r|\\n){2}/.exec(buffer)\n while (boundary?.index !== undefined) {\n const block = buffer.slice(0, boundary.index)\n buffer = buffer.slice(boundary.index + boundary[0].length)\n dispatchBlock(block, connectionGeneration, connectionController)\n if (!ownsConnection(connectionGeneration, connectionController)) return\n boundary = /(?:\\r\\n|\\r|\\n){2}/.exec(buffer)\n }\n\n if (!done) continue\n if (buffer) dispatchBlock(buffer, connectionGeneration, connectionController)\n return\n }\n } finally {\n if (reader === connectionReader) reader = null\n connectionReader.releaseLock()\n }\n }\n\n async function connect(connectionGeneration: number): Promise<void> {\n if (stopped || generation !== connectionGeneration) return\n controller?.abort()\n const connectionController = new AbortController()\n controller = connectionController\n isConnecting.value = true\n if (!ownsConnection(connectionGeneration, connectionController)) return\n error.value = null\n if (!ownsConnection(connectionGeneration, connectionController)) return\n\n let cause: unknown\n try {\n const headers = new Headers(options.headers)\n headers.set('Accept', 'text/event-stream')\n if (lastEventId.value && !headers.has('Last-Event-ID')) {\n headers.set('Last-Event-ID', lastEventId.value)\n }\n const transport = options.transport ?? globalThis.fetch?.bind(globalThis)\n if (!transport) throw new Error('[MINT SDK] fetch is required for event streams.')\n const response = await transport(typeof url === 'function' ? url() : url, {\n method: 'GET',\n headers,\n credentials: options.credentials ?? 'same-origin',\n signal: connectionController.signal,\n })\n if (!ownsConnection(connectionGeneration, connectionController)) return\n if (!response.ok) {\n throw new EventStreamResponseError(response, options.errorLabel ?? 'Event stream')\n }\n if (!response.body) {\n throw new Error(`${options.errorLabel ?? 'Event stream'} response did not include a readable body.`)\n }\n\n isConnected.value = true\n if (!ownsConnection(connectionGeneration, connectionController)) return\n isConnecting.value = false\n if (!ownsConnection(connectionGeneration, connectionController)) return\n options.onOpen?.()\n if (!ownsConnection(connectionGeneration, connectionController)) return\n await consume(response.body, connectionGeneration, connectionController)\n } catch (errorCause) {\n cause = errorCause\n if (\n ownsConnection(connectionGeneration, connectionController)\n && !isAbortError(errorCause)\n ) {\n error.value = errorCause instanceof Error\n ? errorCause.message\n : `${options.errorLabel ?? 'Event stream'} failed`\n if (ownsConnection(connectionGeneration, connectionController)) {\n options.onError?.(errorCause)\n }\n }\n } finally {\n if (ownsConnection(connectionGeneration, connectionController)) {\n isConnecting.value = false\n if (!ownsConnection(connectionGeneration, connectionController)) return\n isConnected.value = false\n if (!ownsConnection(connectionGeneration, connectionController)) return\n controller = null\n options.onClose?.(cause)\n if (!stopped && generation === connectionGeneration) {\n scheduleReconnect(connectionGeneration, cause)\n }\n }\n }\n }\n\n function start(): void {\n if (!stopped) return\n stopped = false\n clearReconnectTimer()\n generation += 1\n void connect(generation)\n }\n\n function stop(): void {\n if (stopped) return\n stopped = true\n generation += 1\n clearReconnectTimer()\n controller?.abort()\n controller = null\n if (reader) void reader.cancel().catch(() => undefined)\n reader = null\n isConnecting.value = false\n isConnected.value = false\n }\n\n const currentInstance = getCurrentInstance()\n if (currentInstance && options.immediate !== false && typeof window === 'undefined') {\n onMounted(start)\n }\n if (getCurrentScope()) onScopeDispose(stop)\n if (options.immediate !== false && (typeof window !== 'undefined' || !currentInstance)) {\n start()\n }\n\n return {\n isConnected,\n isConnecting,\n error,\n lastMessage,\n lastEventId,\n start,\n stop,\n }\n}\n\nfunction isAbortError(cause: unknown): boolean {\n return cause instanceof DOMException && cause.name === 'AbortError'\n}\n","import type { JobState, JobStateInput, JobStatus } from './types/jobs'\n\nconst ACTIVE_JOB_STATUSES = new Set<JobStatus>([\n 'awaiting_input',\n 'queued',\n 'running',\n])\nconst TERMINAL_JOB_STATUSES = new Set<JobStatus>([\n 'completed',\n 'failed',\n 'cancelled',\n])\n\nexport interface JobCapabilityInput {\n status: string\n can_cancel?: boolean | null\n can_delete?: boolean | null\n}\n\nexport interface JobCapabilities {\n can_cancel: boolean\n can_delete: boolean\n}\n\n/** Resolve action support while retaining one-cycle legacy status inference. */\nexport function resolveJobCapabilities(job: JobCapabilityInput): JobCapabilities {\n const legacyCanCancel = job.status === 'queued' || job.status === 'running'\n const legacyCanDelete = TERMINAL_JOB_STATUSES.has(job.status as JobStatus)\n return {\n can_cancel: typeof job.can_cancel === 'boolean' ? job.can_cancel : legacyCanCancel,\n can_delete: typeof job.can_delete === 'boolean' ? job.can_delete : legacyCanDelete,\n }\n}\n\n/** Clamp invalid or out-of-range progress values for safe display. */\nexport function normalizeJobPercent(value: number): number {\n if (!Number.isFinite(value)) return 0\n return Math.min(100, Math.max(0, value))\n}\n\n/** Create a detached canonical state without changing the transport input. */\nexport function normalizeJobState(job: JobStateInput): JobState {\n const capabilities = resolveJobCapabilities(job)\n return {\n ...job,\n definition_id: job.definition_id\n ?? (typeof job.metadata.definition_id === 'string' ? job.metadata.definition_id : null),\n result_status: job.result_status\n ?? (job.status === 'completed' && job.metadata.has_result === true ? 'available' : 'none'),\n result_expires_at: job.result_expires_at ?? null,\n progress: {\n ...job.progress,\n percent: normalizeJobPercent(job.progress.percent),\n },\n warnings: [...job.warnings],\n folders: [...job.folders],\n metadata: { ...job.metadata },\n ...capabilities,\n }\n}\n\nexport function isActiveJobStatus(status: JobStatus): boolean {\n return ACTIVE_JOB_STATUSES.has(status)\n}\n\nexport function isTerminalJobStatus(status: JobStatus): boolean {\n return TERMINAL_JOB_STATUSES.has(status)\n}\n\nexport function jobStatusLabel(status: JobStatus): string {\n const labels: Record<JobStatus, string> = {\n awaiting_input: 'Waiting for input',\n queued: 'Queued',\n running: 'Running',\n completed: 'Completed',\n failed: 'Failed',\n cancelled: 'Cancelled',\n }\n return labels[status]\n}\n","import {\n computed,\n onScopeDispose,\n ref,\n shallowRef,\n type ComputedRef,\n type Ref,\n type ShallowRef,\n} from 'vue'\n\nimport type {\n JobsStatusTrayAdapter,\n PluginJobCenterSource,\n} from './useJobsStatusTray'\nimport { useEventStream, type EventStreamMessage } from './useEventStream'\nimport { isActiveJobStatus, normalizeJobState } from '../jobs'\nimport { MintApiError, mintApiErrorFromResponse } from '../apiErrors'\nimport type {\n GeneratedAnalysisJob,\n GeneratedAnalysisJobInput,\n GeneratedAnalysisResult,\n GeneratedSession,\n GeneratedAnalysisManifest,\n PluginJobArtifactPathInput,\n PluginJobPathInput,\n PluginJobPathUpload,\n PluginJobStagedPartInput,\n PluginJobStagedPartUploadResult,\n PluginJobStaging,\n PluginJobStagingPagination,\n} from '../types/generated-ui'\n\nexport type GeneratedAnalysisTransport = (\n input: RequestInfo | URL,\n init?: RequestInit,\n) => Promise<Response>\n\nexport interface GeneratedAnalysisTransportOptions {\n fetcher?: typeof fetch\n getAccessToken?: () => string | null | undefined\n}\n\nexport interface UsePluginJobsOptions {\n baseUrl: string\n transport?: GeneratedAnalysisTransport\n storage?: Storage\n createId?: () => string\n pollInterval?: number\n stream?: boolean\n streamReconnectDelay?: number\n immediate?: boolean\n}\n\nexport type GeneratedAnalysisOptions = UsePluginJobsOptions\n\nexport interface PluginJobWaitOptions {\n signal?: AbortSignal\n rejectOnFailure?: boolean\n}\n\nexport interface PluginJobRequestOptions {\n signal?: AbortSignal\n}\n\ninterface GeneratedSessionStorage {\n getItem: (key: string) => string | null\n setItem: (key: string, value: string) => void\n}\n\nexport interface UsePluginJobsReturn extends PluginJobCenterSource {\n manifest: ShallowRef<GeneratedAnalysisManifest | null>\n session: ShallowRef<GeneratedSession | null>\n jobs: ShallowRef<GeneratedAnalysisJob[]>\n latestResult: ComputedRef<GeneratedAnalysisResult | null>\n isLoading: Ref<boolean>\n isSubmitting: Ref<boolean>\n error: ShallowRef<string | null>\n status: ShallowRef<'idle' | 'initializing' | 'ready' | 'paused' | 'error' | 'disposed'>\n initialize: () => Promise<void>\n ready: () => Promise<void>\n uploadPath: (\n input: PluginJobPathInput,\n definitionId?: string,\n ) => Promise<PluginJobPathUpload>\n uploadStagedPart: <Metadata>(\n input: PluginJobStagedPartInput<Metadata>,\n ) => Promise<PluginJobStagedPartUploadResult<Metadata>>\n getJobStaging: <Metadata = unknown>(\n job: GeneratedAnalysisJob | string,\n pagination?: PluginJobStagingPagination,\n ) => Promise<PluginJobStaging<Metadata>>\n sealJob: (job: GeneratedAnalysisJob | string) => Promise<GeneratedAnalysisJob>\n submit: (definitionId: string, inputs: Record<string, unknown>) => Promise<GeneratedAnalysisJob>\n loadResult: (job: GeneratedAnalysisJob) => Promise<GeneratedAnalysisResult | null>\n resultForJob: (jobId: string) => GeneratedAnalysisResult | null\n refreshJobs: () => Promise<GeneratedAnalysisJob[]>\n refresh: () => Promise<GeneratedAnalysisJob[]>\n getJob: (jobId: string, options?: PluginJobRequestOptions) => Promise<GeneratedAnalysisJob>\n waitForJob: (\n job: GeneratedAnalysisJob | string,\n options?: PluginJobWaitOptions,\n ) => Promise<GeneratedAnalysisJob>\n jobsFor: (definitionId: string) => GeneratedAnalysisJob[]\n cancelJob: (job: GeneratedAnalysisJob | string) => Promise<GeneratedAnalysisJob>\n deleteJob: (job: GeneratedAnalysisJob | string) => Promise<boolean>\n clearFinishedJobs: (definitionId?: string) => Promise<number>\n pause: () => void\n resume: () => void\n dispose: () => void\n /** @deprecated Pass the runtime itself to SDK job UI as its source. */\n jobsAdapter: JobsStatusTrayAdapter\n}\n\nexport type UseGeneratedAnalysisReturn = UsePluginJobsReturn\n\nconst AUTH_TOKEN_KEY = 'mint-auth-token'\nconst SESSION_NOT_FOUND_DETAIL = 'Session not found'\nconst MAX_RESULT_CACHE_ENTRIES = 32\nconst MAX_RESULT_RETRIES = 3\nconst DOWNLOAD_URL_REFRESH_SKEW_MS = 30_000\n\ninterface PluginJobWaiter {\n resolve: (job: GeneratedAnalysisJob) => void\n reject: (cause: unknown) => void\n rejectOnFailure: boolean\n signal?: AbortSignal\n abort?: () => void\n}\n\ntype PluginJobStreamData = GeneratedAnalysisJobInput | {\n jobs: GeneratedAnalysisJobInput[]\n}\n\nexport function createGeneratedAnalysisTransport(\n options: GeneratedAnalysisTransportOptions = {},\n): GeneratedAnalysisTransport {\n const fetcher = options.fetcher ?? globalThis.fetch.bind(globalThis)\n const getAccessToken = options.getAccessToken ?? readStoredAccessToken\n\n return async (input, init = {}) => {\n const headers = new Headers(init.headers)\n const accessToken = getAccessToken()\n if (accessToken && !headers.has('Authorization')) {\n headers.set('Authorization', `Bearer ${accessToken}`)\n }\n return await fetcher(input, {\n credentials: 'same-origin',\n ...init,\n headers,\n })\n }\n}\n\nexport function useGeneratedAnalysis(\n options: GeneratedAnalysisOptions,\n): UseGeneratedAnalysisReturn {\n return createPluginJobs(options, '/generated/manifest')\n}\n\n/**\n * Connect a custom plugin frontend to the SDK-owned job lifecycle.\n *\n * @example Recommended\n * ```ts\n * const jobs = usePluginJobs({ baseUrl: '/api/leaf/jobs' })\n * await jobs.initialize()\n * ```\n */\nexport function usePluginJobs(\n options: UsePluginJobsOptions,\n): UsePluginJobsReturn {\n return createPluginJobs(options)\n}\n\nfunction createPluginJobs(\n options: UsePluginJobsOptions,\n manifestPath?: string,\n): UsePluginJobsReturn {\n const baseUrl = options.baseUrl.replace(/\\/$/, '')\n const transport = options.transport ?? createGeneratedAnalysisTransport()\n const storage = createGeneratedSessionStorage(options.storage)\n const createId = options.createId ?? (() => globalThis.crypto.randomUUID())\n const pollInterval = options.pollInterval ?? 750\n const streamEnabled = options.stream ?? true\n const streamReconnectDelay = options.streamReconnectDelay ?? 1_500\n const tabKey = `mint:generated:${baseUrl}:tab`\n const sessionKey = `mint:generated:${baseUrl}:session`\n const manifest = shallowRef<GeneratedAnalysisManifest | null>(null)\n const session = shallowRef<GeneratedSession | null>(null)\n const jobs = shallowRef<GeneratedAnalysisJob[]>([])\n const jobRevisions = new Map<string, number>()\n const pendingJobOperations = new Map<string, number>()\n const resultCache = shallowRef<Record<string, GeneratedAnalysisResult>>({})\n const isLoading = ref(false)\n const isSubmitting = ref(false)\n const error = shallowRef<string | null>(null)\n const status = shallowRef<'idle' | 'initializing' | 'ready' | 'paused' | 'error' | 'disposed'>('idle')\n let pollTimer: ReturnType<typeof setTimeout> | undefined\n let disposed = false\n let paused = false\n let initialized = false\n let initializePromise: Promise<void> | undefined\n let refreshPromise: Promise<GeneratedAnalysisJob[]> | undefined\n let initializeRefreshPromise: Promise<GeneratedAnalysisJob[]> | undefined\n let jobsRevision = 0\n let resultCacheOrder: string[] = []\n const resultRequests = new Map<string, Promise<GeneratedAnalysisResult | null>>()\n const jobWaiters = new Map<string, Set<PluginJobWaiter>>()\n const resultRetryAttempts = new Map<string, number>()\n const resultRetryTimers = new Map<string, ReturnType<typeof setTimeout>>()\n const downloadRefreshTimers = new Map<string, ReturnType<typeof setTimeout>>()\n const jobStream = useEventStream<PluginJobStreamData>(`${baseUrl}/jobs/events`, {\n transport,\n immediate: false,\n reconnectDelayMs: streamReconnectDelay,\n parseJson: true,\n errorLabel: 'Job stream',\n onOpen: clearPoll,\n onMessage: applyJobStreamMessage,\n onError: schedulePollForActiveJobs,\n onClose: schedulePollForActiveJobs,\n })\n\n const latestResult = computed<GeneratedAnalysisResult | null>(() => {\n const job = currentCompletedJob()\n return job ? resultForJob(job.job_id) : null\n })\n\n function initialize(): Promise<void> {\n if (disposed) return Promise.reject(new Error('Plugin jobs runtime is disposed'))\n if (initialized) return Promise.resolve()\n if (initializePromise) return initializePromise\n isLoading.value = true\n error.value = null\n status.value = 'initializing'\n const pending = (async () => {\n if (manifestPath) {\n const loadedManifest = await request<GeneratedAnalysisManifest>(manifestPath, { method: 'GET' })\n if (!disposed) manifest.value = loadedManifest\n }\n const resolvedSession = await resolveSession()\n if (disposed) return\n session.value = resolvedSession\n await refreshJobs()\n if (disposed) return\n initialized = true\n status.value = paused ? 'paused' : 'ready'\n if (streamEnabled && !paused) jobStream.start()\n })().catch((cause: unknown) => {\n if (!disposed) {\n error.value = errorMessage(cause, 'Failed to initialize generated analysis')\n status.value = 'error'\n }\n throw cause\n }).finally(() => {\n if (initializePromise === pending) initializePromise = undefined\n if (!disposed) isLoading.value = false\n })\n initializePromise = pending\n return pending\n }\n\n async function resolveSession(): Promise<GeneratedSession> {\n let tabId = storage.getItem(tabKey)\n if (!tabId) {\n tabId = createId()\n storage.setItem(tabKey, tabId)\n }\n const storedSessionId = storage.getItem(sessionKey)\n const payload = await request<{ sessions: GeneratedSession[] }>('/jobs/sessions', { method: 'GET' })\n const existing = payload.sessions.find(candidate => (\n candidate.id === storedSessionId && candidate.tab_id === tabId\n ))\n if (existing) return existing\n const created = await request<GeneratedSession>('/jobs/sessions', {\n method: 'POST',\n body: JSON.stringify({ tab_id: tabId }),\n })\n storage.setItem(sessionKey, created.id)\n return created\n }\n\n async function submit(\n definitionId: string,\n inputs: Record<string, unknown>,\n ): Promise<GeneratedAnalysisJob> {\n if (!session.value) throw new Error('Generated analysis session is not initialized')\n const clientRequestId = createId()\n isSubmitting.value = true\n error.value = null\n try {\n let jobInput: GeneratedAnalysisJobInput\n try {\n jobInput = await submitToSession(\n session.value.id,\n clientRequestId,\n await stagePathInputs(inputs, session.value.id, definitionId),\n )\n } catch (cause) {\n if (!isSessionNotFoundError(cause)) throw cause\n session.value = await resolveSession()\n jobInput = await submitToSession(\n session.value.id,\n clientRequestId,\n await stagePathInputs(inputs, session.value.id, definitionId),\n )\n }\n const job = upsertJob(jobInput, definitionId)\n if (!jobStream.isConnected.value) schedulePoll()\n return job\n } catch (cause) {\n error.value = errorMessage(cause, 'Failed to submit analysis')\n throw cause\n } finally {\n isSubmitting.value = false\n }\n\n function submitToSession(\n sessionId: string,\n requestId: string,\n stagedInputs: Record<string, unknown>,\n ): Promise<GeneratedAnalysisJobInput> {\n return request<GeneratedAnalysisJobInput>('/jobs', {\n method: 'POST',\n body: JSON.stringify({\n definition_id: definitionId,\n inputs: stagedInputs,\n session_id: sessionId,\n client_request_id: requestId,\n }),\n })\n }\n }\n\n async function uploadPath(\n input: PluginJobPathInput,\n definitionId?: string,\n ): Promise<PluginJobPathUpload> {\n if (!session.value) throw new Error('Generated analysis session is not initialized')\n return uploadPathForSession(input, session.value.id, definitionId)\n }\n\n async function uploadStagedPart<Metadata>(\n input: PluginJobStagedPartInput<Metadata>,\n ): Promise<PluginJobStagedPartUploadResult<Metadata>> {\n const jobId = jobIdFromReference(input.job)\n const body = new FormData()\n body.append('file', input.file)\n body.append('metadata', JSON.stringify(input.metadata))\n if (input.expectedSize !== undefined) {\n body.append('expected_size', String(input.expectedSize))\n }\n if (input.expectedSha256 !== undefined) {\n body.append('expected_sha256', input.expectedSha256)\n }\n return request<PluginJobStagedPartUploadResult<Metadata>>(\n `/jobs/${encodeURIComponent(jobId)}/parts/${encodeStagedPartKey(input.key)}`,\n { method: 'PUT', body, signal: input.signal },\n )\n }\n\n function getJobStaging<Metadata = unknown>(\n job: GeneratedAnalysisJob | string,\n pagination: PluginJobStagingPagination = {},\n ): Promise<PluginJobStaging<Metadata>> {\n const jobId = jobIdFromReference(job)\n const query = new URLSearchParams()\n if (pagination.offset !== undefined) query.set('offset', String(pagination.offset))\n if (pagination.limit !== undefined) query.set('limit', String(pagination.limit))\n const suffix = query.size > 0 ? `?${query}` : ''\n return request<PluginJobStaging<Metadata>>(\n `/jobs/${encodeURIComponent(jobId)}/staging${suffix}`,\n { method: 'GET' },\n )\n }\n\n async function sealJob(\n job: GeneratedAnalysisJob | string,\n ): Promise<GeneratedAnalysisJob> {\n const jobId = jobIdFromReference(job)\n const revision = beginJobOperation(jobId)\n try {\n const updated = await request<GeneratedAnalysisJobInput>(\n `/jobs/${encodeURIComponent(jobId)}/seal`,\n { method: 'POST' },\n )\n return mergeJobResponse(updated, revision)\n } finally {\n finishJobOperation(jobId)\n }\n }\n\n async function uploadPathForSession(\n input: PluginJobPathInput,\n sessionId: string,\n definitionId?: string,\n ): Promise<PluginJobPathUpload> {\n if (!input.files.length || input.files.length !== input.relativePaths.length) {\n throw new Error('Path upload requires one relative path for each file')\n }\n const body = new FormData()\n body.append('session_id', sessionId)\n if (input.rootName) body.append('root_name', input.rootName)\n for (let index = 0; index < input.files.length; index += 1) {\n body.append('files', input.files[index]!)\n body.append('relative_paths', input.relativePaths[index]!)\n }\n const headers: Record<string, string> = {\n 'X-Mint-Job-Session': sessionId,\n }\n if (definitionId) headers['X-Mint-Job-Definition'] = definitionId\n return request<PluginJobPathUpload>('/jobs/uploads', {\n method: 'POST',\n body,\n signal: input.signal,\n headers,\n })\n }\n\n async function stageArtifactPathForSession(\n input: PluginJobArtifactPathInput,\n sessionId: string,\n definitionId: string,\n ): Promise<PluginJobPathUpload> {\n return request<PluginJobPathUpload>('/jobs/artifacts', {\n method: 'POST',\n body: JSON.stringify({\n experiment_id: input.experimentId,\n artifact_id: input.artifactId,\n session_id: sessionId,\n }),\n signal: input.signal,\n headers: {\n 'X-Mint-Job-Session': sessionId,\n 'X-Mint-Job-Definition': definitionId,\n },\n })\n }\n\n async function stagePathInputs(\n inputs: Record<string, unknown>,\n sessionId: string,\n definitionId: string,\n ): Promise<Record<string, unknown>> {\n return await stagePathValue(inputs, sessionId, definitionId) as Record<string, unknown>\n }\n\n async function stagePathValue(\n value: unknown,\n sessionId: string,\n definitionId: string,\n ): Promise<unknown> {\n if (typeof File !== 'undefined' && value instanceof File) {\n const upload = await uploadPathForSession({\n kind: 'path',\n files: [value],\n relativePaths: [value.name],\n }, sessionId, definitionId)\n return { token: upload.token }\n }\n if (isPluginJobPathInput(value)) {\n const upload = await uploadPathForSession(value, sessionId, definitionId)\n return { token: upload.token }\n }\n if (isPluginJobArtifactPathInput(value)) {\n const upload = await stageArtifactPathForSession(value, sessionId, definitionId)\n return { token: upload.token }\n }\n if (Array.isArray(value)) {\n return await Promise.all(value.map(\n item => stagePathValue(item, sessionId, definitionId),\n ))\n }\n if (value && typeof value === 'object') {\n const entries = await Promise.all(Object.entries(value).map(async ([key, child]) => (\n [key, await stagePathValue(child, sessionId, definitionId)] as const\n )))\n return Object.fromEntries(entries)\n }\n return value\n }\n\n function refreshJobs(): Promise<GeneratedAnalysisJob[]> {\n if (disposed) return Promise.resolve(jobs.value)\n if (refreshPromise) return refreshPromise\n const revision = jobsRevision\n const pending = request<{ jobs: GeneratedAnalysisJobInput[] }>('/jobs', { method: 'GET' })\n .then((payload) => {\n if (disposed) return jobs.value\n if (revision !== jobsRevision) {\n if (jobs.value.some(job => isActiveJobStatus(job.status))) schedulePoll()\n return jobs.value\n }\n replaceJobs(payload.jobs)\n error.value = null\n if (!paused && !jobStream.isConnected.value && jobs.value.some(job => isActiveJobStatus(job.status))) {\n schedulePoll()\n }\n return jobs.value\n }).finally(() => {\n if (refreshPromise === pending) refreshPromise = undefined\n })\n refreshPromise = pending\n return pending\n }\n\n function refresh(): Promise<GeneratedAnalysisJob[]> {\n if (disposed) return Promise.resolve(jobs.value)\n if (initialized) return refreshJobs()\n if (initializeRefreshPromise) return initializeRefreshPromise\n const pending = initialize()\n .then(() => jobs.value)\n .finally(() => {\n if (initializeRefreshPromise === pending) initializeRefreshPromise = undefined\n })\n initializeRefreshPromise = pending\n return pending\n }\n\n async function getJob(\n jobId: string,\n options: PluginJobRequestOptions = {},\n ): Promise<GeneratedAnalysisJob> {\n const revision = beginJobOperation(jobId)\n try {\n const job = await request<GeneratedAnalysisJobInput>(\n `/jobs/${encodeURIComponent(jobId)}`,\n { method: 'GET', signal: options.signal },\n )\n return mergeJobResponse(job, revision)\n } finally {\n finishJobOperation(jobId)\n }\n }\n\n function waitForJob(\n job: GeneratedAnalysisJob | string,\n options: PluginJobWaitOptions = {},\n ): Promise<GeneratedAnalysisJob> {\n if (disposed) return Promise.reject(new Error('Plugin jobs runtime is disposed'))\n if (options.signal?.aborted) {\n return Promise.reject(pluginJobWaitAbort(options.signal))\n }\n const jobId = jobIdFromReference(job)\n const current = typeof job === 'string'\n ? jobs.value.find(candidate => candidate.job_id === jobId)\n : jobs.value.find(candidate => candidate.job_id === jobId) ?? job\n if (current && !isActiveJobStatus(current.status)) {\n return terminalWaitResult(current, options.rejectOnFailure === true)\n }\n if (paused) return Promise.reject(new Error('Plugin jobs runtime is paused'))\n return new Promise<GeneratedAnalysisJob>((resolve, reject) => {\n const waiter: PluginJobWaiter = {\n resolve,\n reject,\n rejectOnFailure: options.rejectOnFailure === true,\n signal: options.signal,\n }\n if (options.signal) {\n waiter.abort = () => {\n removeJobWaiter(jobId, waiter)\n reject(pluginJobWaitAbort(options.signal!))\n }\n options.signal.addEventListener('abort', waiter.abort, { once: true })\n }\n const waiting = jobWaiters.get(jobId) ?? new Set<PluginJobWaiter>()\n waiting.add(waiter)\n jobWaiters.set(jobId, waiting)\n if (!paused) {\n if (streamEnabled) jobStream.start()\n if (!jobStream.isConnected.value) schedulePoll()\n }\n void getJob(jobId, { signal: options.signal }).catch((cause: unknown) => {\n if (current && isRetryableJobLookupError(cause)) {\n if (!jobStream.isConnected.value) schedulePoll()\n return\n }\n removeJobWaiter(jobId, waiter)\n reject(cause)\n })\n })\n }\n\n function settleJobWaiters(job: GeneratedAnalysisJob): void {\n if (isActiveJobStatus(job.status)) return\n const waiting = jobWaiters.get(job.job_id)\n if (!waiting) return\n jobWaiters.delete(job.job_id)\n for (const waiter of waiting) {\n if (waiter.abort && waiter.signal) {\n waiter.signal.removeEventListener('abort', waiter.abort)\n }\n void terminalWaitResult(job, waiter.rejectOnFailure).then(\n waiter.resolve,\n waiter.reject,\n )\n }\n }\n\n function rejectJobWaiters(jobId: string, cause: unknown): void {\n const waiting = jobWaiters.get(jobId)\n if (!waiting) return\n jobWaiters.delete(jobId)\n for (const waiter of waiting) {\n if (waiter.abort && waiter.signal) {\n waiter.signal.removeEventListener('abort', waiter.abort)\n }\n waiter.reject(cause)\n }\n }\n\n function removeJobWaiter(jobId: string, waiter: PluginJobWaiter): void {\n const waiting = jobWaiters.get(jobId)\n if (!waiting) return\n waiting.delete(waiter)\n if (waiting.size === 0) jobWaiters.delete(jobId)\n if (waiter.abort && waiter.signal) {\n waiter.signal.removeEventListener('abort', waiter.abort)\n }\n }\n\n function jobsFor(definitionId: string): GeneratedAnalysisJob[] {\n return jobs.value.filter(job => job.definition_id === definitionId)\n }\n\n function canonicalJob(\n input: GeneratedAnalysisJobInput,\n fallbackDefinitionId?: string,\n ): GeneratedAnalysisJob {\n const normalized = normalizeJobState(input)\n const definitionId = normalized.definition_id ?? fallbackDefinitionId ?? null\n return {\n ...normalized,\n definition_id: definitionId,\n metadata: definitionId\n ? { ...normalized.metadata, definition_id: definitionId }\n : normalized.metadata,\n }\n }\n\n function recordJobsMutation(jobIds: Iterable<string>): void {\n jobsRevision += 1\n for (const jobId of jobIds) {\n jobRevisions.set(jobId, (jobRevisions.get(jobId) ?? 0) + 1)\n }\n }\n\n function beginJobOperation(jobId: string): number {\n pendingJobOperations.set(jobId, (pendingJobOperations.get(jobId) ?? 0) + 1)\n return jobRevisions.get(jobId) ?? 0\n }\n\n function finishJobOperation(jobId: string): void {\n const remaining = (pendingJobOperations.get(jobId) ?? 1) - 1\n if (remaining > 0) pendingJobOperations.set(jobId, remaining)\n else pendingJobOperations.delete(jobId)\n pruneJobRevisions()\n }\n\n function pruneJobRevisions(): void {\n const retained = new Set([\n ...jobs.value.map(job => job.job_id),\n ...pendingJobOperations.keys(),\n ])\n for (const jobId of jobRevisions.keys()) {\n if (!retained.has(jobId)) jobRevisions.delete(jobId)\n }\n }\n\n function replaceJobs(inputs: readonly GeneratedAnalysisJobInput[]): GeneratedAnalysisJob[] {\n const previousJobs = new Map(jobs.value.map(job => [job.job_id, job]))\n const previousJobIds = new Set(jobs.value.map(job => job.job_id))\n const nextJobs = inputs.map((input) => {\n const incoming = canonicalJob(input)\n const current = previousJobs.get(incoming.job_id)\n return current && shouldPreserveJobLifecycle(current, incoming) ? current : incoming\n })\n const nextJobIds = new Set(nextJobs.map(job => job.job_id))\n recordJobsMutation(new Set([\n ...previousJobIds,\n ...nextJobIds,\n ]))\n jobs.value = nextJobs\n for (const job of nextJobs) settleJobWaiters(job)\n for (const jobId of previousJobIds) {\n if (!nextJobIds.has(jobId)) {\n rejectJobWaiters(jobId, new Error(`Job ${jobId} is no longer available`))\n }\n }\n pruneResultState()\n pruneJobRevisions()\n return nextJobs\n }\n\n function upsertJob(\n input: GeneratedAnalysisJobInput,\n fallbackDefinitionId?: string,\n ): GeneratedAnalysisJob {\n const incoming = canonicalJob(input, fallbackDefinitionId)\n const current = jobs.value.find(candidate => candidate.job_id === incoming.job_id)\n const job = current && shouldPreserveJobLifecycle(current, incoming)\n ? current\n : incoming\n if (job === current) {\n settleJobWaiters(job)\n pruneResultState()\n pruneJobRevisions()\n return job\n }\n jobs.value = [job, ...jobs.value.filter(candidate => candidate.job_id !== job.job_id)]\n recordJobsMutation([job.job_id])\n settleJobWaiters(job)\n pruneResultState()\n pruneJobRevisions()\n return job\n }\n\n function mergeJobResponse(\n input: GeneratedAnalysisJobInput,\n expectedRevision: number,\n ): GeneratedAnalysisJob {\n const incoming = canonicalJob(input)\n const current = jobs.value.find(candidate => candidate.job_id === incoming.job_id)\n if (disposed) return current ?? incoming\n if (current && shouldPreserveJobLifecycle(current, incoming)) return current\n if (expectedRevision === (jobRevisions.get(incoming.job_id) ?? 0)) {\n return upsertJob(incoming)\n }\n if (current && jobLifecycleRank(incoming.status) > jobLifecycleRank(current.status)) {\n return upsertJob(incoming)\n }\n return current ?? incoming\n }\n\n function currentCompletedJob(): GeneratedAnalysisJob | undefined {\n const activeSessionId = session.value?.id\n return jobs.value.find(candidate => (\n candidate.session_id === activeSessionId\n && candidate.status === 'completed'\n && candidate.result_status === 'available'\n ))\n }\n\n function resultForJob(jobId: string): GeneratedAnalysisResult | null {\n return resultCache.value[jobId] ?? null\n }\n\n function loadResult(job: GeneratedAnalysisJob): Promise<GeneratedAnalysisResult | null> {\n return loadResultInternal(job)\n }\n\n function loadResultInternal(\n job: GeneratedAnalysisJob,\n forceRefresh = false,\n ): Promise<GeneratedAnalysisResult | null> {\n if (\n disposed\n || !isLoadableResultJob(job)\n ) return Promise.resolve(null)\n\n const cached = resultForJob(job.job_id)\n if (cached && !forceRefresh && !managedDownloadNeedsRefresh(cached)) {\n return Promise.resolve(cached)\n }\n const pending = resultRequests.get(job.job_id)\n if (pending) return pending\n\n const requestResult = request<GeneratedAnalysisResult>(\n `/jobs/${encodeURIComponent(job.job_id)}/result`,\n { method: 'GET' },\n ).then((result) => {\n if (!disposed && isCurrentResultJob(job.job_id)) {\n cacheResult(job.job_id, result)\n clearResultRetry(job.job_id)\n error.value = null\n }\n return result\n }).catch((cause: unknown) => {\n if (!disposed && isCurrentResultJob(job.job_id)) {\n error.value = errorMessage(cause, 'Failed to load analysis result')\n if (cached && isManagedDownloadResult(cached)) {\n handleManagedDownloadRefreshFailure(job, cause)\n } else {\n scheduleResultRetry(job, cause)\n }\n }\n return null\n }).finally(() => {\n resultRequests.delete(job.job_id)\n })\n resultRequests.set(job.job_id, requestResult)\n return requestResult\n }\n\n function cacheResult(jobId: string, result: GeneratedAnalysisResult): void {\n resultCacheOrder = [jobId, ...resultCacheOrder.filter(candidate => candidate !== jobId)]\n .slice(0, MAX_RESULT_CACHE_ENTRIES)\n const retained = new Set(resultCacheOrder)\n resultCache.value = Object.fromEntries([\n ...Object.entries(resultCache.value)\n .filter(([candidate]) => retained.has(candidate) && candidate !== jobId),\n [jobId, result],\n ])\n for (const candidate of downloadRefreshTimers.keys()) {\n if (!retained.has(candidate)) clearManagedDownloadRefresh(candidate)\n }\n scheduleManagedDownloadRefresh(jobId, managedDownloadRefreshDelay(result))\n }\n\n function pruneResultState(): void {\n const loadableJobIds = new Set(jobs.value\n .filter(job => isLoadableResultJob(job))\n .map(job => job.job_id))\n resultCacheOrder = resultCacheOrder\n .filter(jobId => loadableJobIds.has(jobId))\n .slice(0, MAX_RESULT_CACHE_ENTRIES)\n const retained = new Set(resultCacheOrder)\n resultCache.value = Object.fromEntries(\n Object.entries(resultCache.value).filter(([jobId]) => retained.has(jobId)),\n )\n for (const jobId of resultRetryTimers.keys()) {\n if (!loadableJobIds.has(jobId)) clearResultRetry(jobId)\n }\n for (const jobId of resultRetryAttempts.keys()) {\n if (!loadableJobIds.has(jobId)) clearResultRetry(jobId)\n }\n for (const jobId of downloadRefreshTimers.keys()) {\n if (!loadableJobIds.has(jobId) || !retained.has(jobId)) {\n clearManagedDownloadRefresh(jobId)\n }\n }\n }\n\n function scheduleManagedDownloadRefresh(jobId: string, delay: number | null): void {\n clearManagedDownloadRefresh(jobId)\n if (delay === null || disposed || paused) return\n downloadRefreshTimers.set(jobId, setTimeout(() => {\n downloadRefreshTimers.delete(jobId)\n if (disposed || paused) return\n const current = jobs.value.find(candidate => candidate.job_id === jobId)\n if (current && isLoadableResultJob(current)) {\n void loadResultInternal(current, true)\n }\n }, Math.max(0, delay)))\n }\n\n function clearManagedDownloadRefresh(jobId: string): void {\n const timer = downloadRefreshTimers.get(jobId)\n if (timer !== undefined) clearTimeout(timer)\n downloadRefreshTimers.delete(jobId)\n }\n\n function handleManagedDownloadRefreshFailure(\n job: GeneratedAnalysisJob,\n cause: unknown,\n ): void {\n if (cause instanceof MintApiError) {\n if (cause.status === 404 || cause.status === 410) {\n discardCachedResult(job.job_id)\n jobs.value = jobs.value.map(candidate => (\n candidate.job_id === job.job_id\n ? { ...candidate, result_status: 'expired' }\n : candidate\n ))\n recordJobsMutation([job.job_id])\n return\n }\n if (cause.status === 401 || cause.status === 403) {\n discardCachedResult(job.job_id)\n return\n }\n }\n scheduleResultRetry(job, cause, true)\n }\n\n function discardCachedResult(jobId: string): void {\n clearResultRetry(jobId)\n clearManagedDownloadRefresh(jobId)\n resultCacheOrder = resultCacheOrder.filter(candidate => candidate !== jobId)\n const retainedResults = { ...resultCache.value }\n delete retainedResults[jobId]\n resultCache.value = retainedResults\n }\n\n function isLoadableResultJob(job: GeneratedAnalysisJob): boolean {\n return job.status === 'completed'\n && job.result_status === 'available'\n }\n\n function isCurrentResultJob(jobId: string): boolean {\n const job = jobs.value.find(candidate => candidate.job_id === jobId)\n return job !== undefined && isLoadableResultJob(job)\n }\n\n function scheduleResultRetry(\n job: GeneratedAnalysisJob,\n cause: unknown,\n forceRefresh = false,\n ): void {\n if (\n paused\n || !isRetryableResultError(cause)\n || resultRetryTimers.has(job.job_id)\n ) return\n const attempt = resultRetryAttempts.get(job.job_id) ?? 0\n if (attempt >= MAX_RESULT_RETRIES) return\n resultRetryAttempts.set(job.job_id, attempt + 1)\n resultRetryTimers.set(job.job_id, setTimeout(() => {\n resultRetryTimers.delete(job.job_id)\n const current = jobs.value.find(candidate => candidate.job_id === job.job_id)\n if (!paused && current && isLoadableResultJob(current)) {\n void loadResultInternal(current, forceRefresh)\n }\n }, pollInterval * (2 ** attempt)))\n }\n\n function clearResultRetry(jobId: string): void {\n const timer = resultRetryTimers.get(jobId)\n if (timer !== undefined) clearTimeout(timer)\n resultRetryTimers.delete(jobId)\n resultRetryAttempts.delete(jobId)\n }\n\n function schedulePoll(): void {\n if (disposed || paused || jobStream.isConnected.value || pollTimer !== undefined) return\n pollTimer = setTimeout(async () => {\n pollTimer = undefined\n if (disposed) return\n try {\n await refreshJobs()\n } catch (cause) {\n error.value = errorMessage(cause, 'Failed to refresh analysis jobs')\n if (jobs.value.some(job => isActiveJobStatus(job.status))) schedulePoll()\n }\n }, pollInterval)\n }\n\n function clearPoll(): void {\n if (pollTimer === undefined) return\n clearTimeout(pollTimer)\n pollTimer = undefined\n }\n\n function schedulePollForActiveJobs(): void {\n if (jobs.value.some(job => isActiveJobStatus(job.status))) schedulePoll()\n }\n\n function applyJobStreamMessage(message: EventStreamMessage<PluginJobStreamData>): void {\n if (message.event === 'snapshot' && 'jobs' in message.data) {\n const payload = message.data\n replaceJobs(payload.jobs)\n } else if (message.event === 'job' || message.event === 'terminal') {\n upsertJob(message.data as GeneratedAnalysisJobInput)\n }\n error.value = null\n }\n\n async function cancelJob(job: GeneratedAnalysisJob | string): Promise<GeneratedAnalysisJob> {\n const jobId = typeof job === 'string' ? job : job.job_id\n const revision = beginJobOperation(jobId)\n try {\n const updated = await request<GeneratedAnalysisJobInput>(\n `/jobs/${encodeURIComponent(jobId)}/cancel`,\n { method: 'POST' },\n )\n return mergeJobResponse(updated, revision)\n } finally {\n finishJobOperation(jobId)\n }\n }\n\n async function deleteJob(job: GeneratedAnalysisJob | string): Promise<boolean> {\n const jobId = typeof job === 'string' ? job : job.job_id\n await request<{ status: 'deleted' }>(\n `/jobs/${encodeURIComponent(jobId)}`,\n { method: 'DELETE' },\n )\n jobs.value = jobs.value.filter(candidate => candidate.job_id !== jobId)\n recordJobsMutation([jobId])\n rejectJobWaiters(jobId, new Error(`Job ${jobId} was deleted`))\n discardCachedResult(jobId)\n pruneJobRevisions()\n return true\n }\n\n async function clearFinishedJobs(definitionId?: string): Promise<number> {\n const query = definitionId === undefined\n ? ''\n : `?definition_id=${encodeURIComponent(definitionId)}`\n const payload = await request<{ deleted: number }>(`/jobs${query}`, { method: 'DELETE' })\n if (payload.deleted > 0) await refreshJobs()\n return payload.deleted\n }\n\n const jobsAdapter: JobsStatusTrayAdapter = {\n listJobs: async () => ({ jobs: await refreshJobs() }),\n cancelJob: async job => cancelJob(job as GeneratedAnalysisJob),\n deleteJob: async job => deleteJob(job as GeneratedAnalysisJob),\n clearFinishedJobs: async () => clearFinishedJobs(),\n }\n\n function pause(): void {\n if (disposed || paused) return\n paused = true\n status.value = 'paused'\n clearPoll()\n for (const jobId of resultRetryTimers.keys()) clearResultRetry(jobId)\n for (const jobId of downloadRefreshTimers.keys()) {\n clearManagedDownloadRefresh(jobId)\n }\n jobStream.stop()\n }\n\n function resume(): void {\n if (disposed || !paused) return\n paused = false\n status.value = initialized ? 'ready' : 'idle'\n if (!initialized) return\n for (const [jobId, result] of Object.entries(resultCache.value)) {\n scheduleManagedDownloadRefresh(jobId, managedDownloadRefreshDelay(result))\n }\n if (streamEnabled) jobStream.start()\n else if (jobs.value.some(job => isActiveJobStatus(job.status))) schedulePoll()\n }\n\n function dispose(): void {\n if (disposed) return\n disposed = true\n paused = true\n status.value = 'disposed'\n clearPoll()\n for (const timer of resultRetryTimers.values()) clearTimeout(timer)\n resultRetryTimers.clear()\n resultRetryAttempts.clear()\n for (const timer of downloadRefreshTimers.values()) clearTimeout(timer)\n downloadRefreshTimers.clear()\n const cause = new Error('Plugin jobs runtime is disposed')\n for (const jobId of jobWaiters.keys()) rejectJobWaiters(jobId, cause)\n jobRevisions.clear()\n pendingJobOperations.clear()\n jobStream.stop()\n }\n\n async function request<T>(path: string, init: RequestInit): Promise<T> {\n const response = await transport(`${baseUrl}${path}`, {\n ...init,\n headers: {\n Accept: 'application/json',\n ...(init.body && !(init.body instanceof FormData)\n ? { 'Content-Type': 'application/json' }\n : {}),\n ...init.headers,\n },\n })\n if (!response.ok) {\n const payload: unknown = await response.json().catch(() => null)\n throw mintApiErrorFromResponse(response.status, payload, {\n requestId: response.headers.get('X-Request-ID'),\n })\n }\n return await response.json() as T\n }\n\n onScopeDispose(dispose)\n\n if (options.immediate) void initialize().catch(() => undefined)\n\n return {\n manifest,\n session,\n jobs,\n latestResult,\n isLoading,\n isSubmitting,\n error,\n status,\n initialize,\n ready: initialize,\n uploadPath,\n uploadStagedPart,\n getJobStaging,\n sealJob,\n submit,\n loadResult,\n resultForJob,\n refreshJobs,\n refresh,\n getJob,\n waitForJob,\n jobsFor,\n cancelJob,\n deleteJob,\n clearFinishedJobs,\n pause,\n resume,\n dispose,\n jobsAdapter,\n }\n}\n\nfunction jobIdFromReference(job: GeneratedAnalysisJob | string): string {\n return typeof job === 'string' ? job : job.job_id\n}\n\nfunction encodeStagedPartKey(key: string): string {\n return key.split('/').map(segment => encodeURIComponent(segment)).join('/')\n}\n\nfunction jobLifecycleRank(status: GeneratedAnalysisJob['status']): number {\n if (status === 'awaiting_input') return 0\n if (status === 'queued') return 1\n if (status === 'running') return 2\n return 3\n}\n\nfunction shouldPreserveJobLifecycle(\n current: GeneratedAnalysisJob,\n incoming: GeneratedAnalysisJob,\n): boolean {\n const currentRank = jobLifecycleRank(current.status)\n const incomingRank = jobLifecycleRank(incoming.status)\n return incomingRank < currentRank\n || (currentRank === 3 && incomingRank === 3 && current.status !== incoming.status)\n}\n\nfunction terminalWaitResult(\n job: GeneratedAnalysisJob,\n rejectOnFailure: boolean,\n): Promise<GeneratedAnalysisJob> {\n if (rejectOnFailure && (job.status === 'failed' || job.status === 'cancelled')) {\n return Promise.reject(new Error(job.error ?? `Job ${job.job_id} ${job.status}`))\n }\n return Promise.resolve(job)\n}\n\nfunction pluginJobWaitAbort(signal: AbortSignal): unknown {\n if (signal.reason !== undefined) return signal.reason\n const cause = new Error('Waiting for job was aborted')\n cause.name = 'AbortError'\n return cause\n}\n\nfunction isPluginJobArtifactPathInput(value: unknown): value is PluginJobArtifactPathInput {\n return Boolean(\n value\n && typeof value === 'object'\n && 'kind' in value\n && value.kind === 'artifact-path'\n && 'experimentId' in value\n && Number.isInteger(value.experimentId)\n && 'artifactId' in value\n && Number.isInteger(value.artifactId),\n )\n}\n\nfunction isPluginJobPathInput(value: unknown): value is PluginJobPathInput {\n return Boolean(\n value\n && typeof value === 'object'\n && 'kind' in value\n && value.kind === 'path'\n && 'files' in value\n && Array.isArray(value.files)\n && 'relativePaths' in value\n && Array.isArray(value.relativePaths),\n )\n}\n\nfunction readStoredAccessToken(): string | null {\n try {\n return globalThis.localStorage?.getItem(AUTH_TOKEN_KEY) ?? null\n } catch {\n return null\n }\n}\n\nfunction createGeneratedSessionStorage(candidate?: Storage): GeneratedSessionStorage {\n const fallback = new Map<string, string>()\n let delegate: Storage | undefined\n let available = true\n try {\n delegate = candidate ?? globalThis.sessionStorage\n } catch {\n available = false\n }\n return {\n getItem(key) {\n if (available && delegate) {\n try {\n return delegate.getItem(key) ?? fallback.get(key) ?? null\n } catch {\n available = false\n }\n }\n return fallback.get(key) ?? null\n },\n setItem(key, value) {\n fallback.set(key, value)\n if (available && delegate) {\n try {\n delegate.setItem(key, value)\n } catch {\n available = false\n }\n }\n },\n }\n}\n\nfunction isSessionNotFoundError(error: unknown): boolean {\n return error instanceof MintApiError\n && error.status === 404\n && (error.detail === SESSION_NOT_FOUND_DETAIL || error.message === SESSION_NOT_FOUND_DETAIL)\n}\n\nfunction isRetryableResultError(error: unknown): boolean {\n return !(error instanceof MintApiError)\n || error.status === 409\n || error.status === 429\n || error.status >= 500\n}\n\nfunction isRetryableJobLookupError(error: unknown): boolean {\n return !(error instanceof MintApiError)\n || error.status === 408\n || error.status === 429\n || error.status >= 500\n}\n\nfunction isManagedDownloadResult(\n result: GeneratedAnalysisResult,\n): result is Extract<GeneratedAnalysisResult, { kind: 'artifact' }> {\n return result.kind === 'artifact' && result.managed === true\n}\n\nfunction managedDownloadNeedsRefresh(result: GeneratedAnalysisResult): boolean {\n if (!isManagedDownloadResult(result)) return false\n if (!result.download_url || !result.download_expires_at) return true\n const expiresAt = Date.parse(result.download_expires_at)\n return !Number.isFinite(expiresAt)\n || expiresAt <= Date.now() + DOWNLOAD_URL_REFRESH_SKEW_MS\n}\n\nfunction managedDownloadRefreshDelay(result: GeneratedAnalysisResult): number | null {\n if (!isManagedDownloadResult(result)) return null\n if (!result.download_url || !result.download_expires_at) return null\n const expiresAt = Date.parse(result.download_expires_at)\n if (!Number.isFinite(expiresAt)) return null\n const remaining = expiresAt - Date.now()\n return remaining <= DOWNLOAD_URL_REFRESH_SKEW_MS\n ? remaining\n : remaining - DOWNLOAD_URL_REFRESH_SKEW_MS\n}\n\nfunction errorMessage(error: unknown, fallback: string): string {\n return error instanceof Error ? error.message : fallback\n}\n","import type { PlatformContext } from '../types'\n\nexport type ExperimentAwarePlatformContext = PlatformContext & {\n currentExperiment?: unknown\n currentExperimentId?: unknown\n experiment?: unknown\n experimentId?: unknown\n}\n\nexport function getInjectedPlatformContext(): PlatformContext | undefined {\n if (typeof window === 'undefined') return undefined\n return (window as unknown as { __MINT_PLATFORM__?: PlatformContext }).__MINT_PLATFORM__\n}\n\n/** Return the platform's canonical plugin identity for the mounted frontend. */\nexport function resolveCurrentPluginId(): string | undefined {\n const pluginId = getInjectedPlatformContext()?.plugin?.id\n return typeof pluginId === 'string' && pluginId ? pluginId : undefined\n}\n\nexport function getInjectedExperimentContext(): ExperimentAwarePlatformContext | undefined {\n return getInjectedPlatformContext() as ExperimentAwarePlatformContext | undefined\n}\n\nexport function currentExperimentFromContext<TExperiment>(\n context: ExperimentAwarePlatformContext | undefined = getInjectedExperimentContext(),\n): TExperiment | undefined {\n const candidate = context?.currentExperiment ?? context?.experiment\n return candidate && typeof candidate === 'object'\n ? candidate as TExperiment\n : undefined\n}\n\nexport function currentExperimentIdFromContext(\n context: ExperimentAwarePlatformContext | undefined = getInjectedExperimentContext(),\n): number | undefined {\n return parseExperimentId(\n context?.currentExperimentId ??\n context?.experimentId ??\n context?.currentExperiment ??\n context?.experiment,\n )\n}\n\nexport function currentExperimentIdFromUrl(): number | undefined {\n if (typeof window === 'undefined') return undefined\n const location = window.location\n const params = new URLSearchParams(location?.search ?? '')\n return parseExperimentId(params.get('experimentId') ?? params.get('experiment_id'))\n ?? experimentIdFromPath(location?.pathname ?? '')\n ?? experimentIdFromPath((location?.hash ?? '').replace(/^#\\/?/, '/'))\n}\n\nexport function resolveCurrentExperimentId(\n context: ExperimentAwarePlatformContext | undefined = getInjectedExperimentContext(),\n): number | undefined {\n return currentExperimentIdFromContext(context) ?? currentExperimentIdFromUrl()\n}\n\nexport function parseExperimentId(value: unknown): number | undefined {\n if (typeof value === 'number' && Number.isFinite(value)) return value\n if (typeof value === 'string' && value.trim()) {\n const parsed = Number(value)\n return Number.isFinite(parsed) ? parsed : undefined\n }\n if (value && typeof value === 'object' && 'id' in value) {\n return parseExperimentId((value as { id?: unknown }).id)\n }\n return undefined\n}\n\nfunction experimentIdFromPath(path: string): number | undefined {\n const segments = path.split('/').filter(Boolean)\n for (let index = 0; index < segments.length - 1; index += 1) {\n const segment = segments[index]?.toLowerCase()\n if (segment === 'experiment' || segment === 'experiments') {\n return parseExperimentId(decodeURIComponent(segments[index + 1] ?? ''))\n }\n }\n return undefined\n}\n","import type { InjectionKey } from 'vue'\n\nimport type { GeneratedAnalysisTransport } from '../../composables/useGeneratedAnalysis'\n\n/** The plugin jobs API a generated workspace talks to, for fields that need it. */\nexport interface GeneratedJobsApi {\n baseUrl: string\n /** Defaults to the authenticated SDK transport. */\n transport?: GeneratedAnalysisTransport\n}\n\nexport const GENERATED_JOBS_API_KEY: InjectionKey<GeneratedJobsApi> = Symbol('mint-generated-jobs-api')\n","<script setup lang=\"ts\">\nimport { computed, inject, ref, watch } from 'vue'\n\nimport { mintApiErrorFromResponse } from '../apiErrors'\nimport { formatExperimentDate } from '../composables/experiment-utils'\nimport { createGeneratedAnalysisTransport } from '../composables/useGeneratedAnalysis'\nimport {\n getInjectedPlatformContext,\n resolveCurrentExperimentId,\n} from '../composables/platformContextHelpers'\nimport type { AnalysisArtifactSummary } from '../types/analysisArtifactTypes'\nimport type {\n PluginJobArtifactPathInput,\n PluginJobPathInput,\n PluginJobPathSelection,\n} from '../types/generated-ui'\nimport BaseButton from './BaseButton.vue'\nimport BaseModal from './BaseModal.vue'\nimport FileUploader from './FileUploader.vue'\nimport { GENERATED_JOBS_API_KEY } from './internal/generatedJobsApi'\nimport ResourcePickerListInternal from './internal/ResourcePickerListInternal.vue'\n\n/** A file artifact the plugin's jobs API says this Path input may use. */\ninterface ReadableArtifact extends AnalysisArtifactSummary {\n filename: string\n}\n\nconst props = defineProps<{\n modelValue?: PluginJobPathSelection | PluginJobPathSelection[] | null\n disabled?: boolean\n multiple?: boolean\n}>()\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: PluginJobPathSelection | PluginJobPathSelection[] | null]\n}>()\n\nconst mode = ref<'file' | 'folder'>('file')\nconst selections = computed(() => Array.isArray(props.modelValue)\n ? props.modelValue\n : props.modelValue ? [props.modelValue] : [])\nconst uploads = computed(() => selections.value.filter(\n (selection): selection is PluginJobPathInput => selection.kind === 'path',\n))\nconst artifacts = computed(() => selections.value.filter(\n (selection): selection is PluginJobArtifactPathInput => selection.kind === 'artifact-path',\n))\nconst selectedFiles = computed(() => uploads.value.flatMap(selection => selection.files))\nwatch(uploads, (current) => {\n if (current.length) mode.value = current.every(selection => selection.rootName) ? 'folder' : 'file'\n}, { immediate: true })\nconst artifactOpen = ref(false)\nconst artifactSearch = ref('')\nconst artifactRows = ref<ReadableArtifact[]>([])\nconst artifactLoading = ref(false)\nconst artifactError = ref<string | null>(null)\nconst platform = getInjectedPlatformContext()\nconst experimentId = resolveCurrentExperimentId(platform)\nconst jobsApi = inject(GENERATED_JOBS_API_KEY, null)\nconst canSelectArtifact = computed(() => Boolean(platform?.isIntegrated && experimentId && jobsApi))\nconst visibleArtifactRows = computed(() => {\n const query = artifactSearch.value.trim().toLowerCase()\n return query\n ? artifactRows.value.filter(row => [row.display_name, row.artifact_key, row.filename, row.plugin_id]\n .some(text => text.toLowerCase().includes(query)))\n : artifactRows.value\n})\n\nfunction selectMode(nextMode: 'file' | 'folder'): void {\n mode.value = nextMode\n emit('update:modelValue', null)\n}\n\nfunction selectFiles(\n files: File[],\n rootName?: string,\n relativePaths?: string[],\n): void {\n const paths = relativePaths ?? files.map(file => file.name)\n const added: PluginJobPathInput[] = props.multiple && !rootName\n ? files.map((file, index) => ({\n kind: 'path',\n files: [file],\n relativePaths: [paths[index] ?? file.name],\n }))\n : [{\n kind: 'path',\n files,\n relativePaths: paths,\n ...(rootName ? { rootName } : {}),\n }]\n emitSelections(props.multiple ? [...selections.value, ...added] : added)\n}\n\nfunction removeFiles(files: File[]): void {\n const removed = new Set(files)\n emitSelections(selections.value.flatMap((selection): PluginJobPathSelection[] => {\n if (selection.kind !== 'path') return [selection]\n const indexes = selection.files\n .map((file, index) => removed.has(file) ? -1 : index)\n .filter(index => index >= 0)\n if (!indexes.length) return []\n return [{\n ...selection,\n files: indexes.map(index => selection.files[index]!),\n relativePaths: indexes.map(index => selection.relativePaths[index]!),\n }]\n }))\n}\n\nfunction removeArtifact(artifact: PluginJobArtifactPathInput): void {\n emitSelections(selections.value.filter(selection => selection !== artifact))\n}\n\nfunction emitSelections(next: PluginJobPathSelection[]): void {\n emit('update:modelValue', props.multiple ? next : next[0] ?? null)\n}\n\n// The plugin lists exactly the artifacts its staging route accepts (same\n// readers and visibility rule), so a pick never fails later with a 404.\nlet artifactRequest = 0\n\nasync function openArtifactPicker(): Promise<void> {\n if (!jobsApi || !experimentId) return\n const request = ++artifactRequest\n artifactOpen.value = true\n artifactSearch.value = ''\n artifactLoading.value = true\n artifactError.value = null\n let rows: ReadableArtifact[] = []\n let error: string | null = null\n try {\n const transport = jobsApi.transport ?? createGeneratedAnalysisTransport()\n const baseUrl = jobsApi.baseUrl.replace(/\\/$/, '')\n const response = await transport(\n `${baseUrl}/jobs/artifacts?experiment_id=${encodeURIComponent(experimentId)}`,\n { headers: { Accept: 'application/json' } },\n )\n const payload: unknown = await response.json().catch(() => null)\n if (!response.ok) throw mintApiErrorFromResponse(response.status, payload)\n rows = (payload as { artifacts?: ReadableArtifact[] } | null)?.artifacts ?? []\n } catch (cause) {\n error = cause instanceof Error ? cause.message : 'Failed to load artifacts'\n }\n // A reopened picker owns the list; an earlier, slower answer is dropped.\n if (request !== artifactRequest) return\n artifactRows.value = rows\n artifactError.value = error\n artifactLoading.value = false\n}\n\nfunction describeArtifact(row: ReadableArtifact) {\n const date = row.updated_at ?? row.created_at\n return {\n code: row.artifact_key,\n title: row.display_name,\n meta: [row.filename, row.plugin_id],\n date: date ? formatExperimentDate(date) : '',\n }\n}\n\n// Only the database ids are kept: the plugin re-authorizes and copies the\n// file when the job is submitted, so the browser never downloads it.\nfunction selectArtifact(row: ReadableArtifact): void {\n const selection: PluginJobArtifactPathInput = {\n kind: 'artifact-path',\n experimentId: row.experiment_id,\n artifactId: row.id,\n name: row.filename,\n }\n emitSelections(props.multiple ? [...selections.value, selection] : [selection])\n artifactOpen.value = false\n}\n</script>\n\n<template>\n <div class=\"mint-generated-path-input\">\n <div class=\"mint-generated-path-input__modes\" role=\"group\" aria-label=\"Path type\">\n <BaseButton\n size=\"sm\"\n :variant=\"mode === 'file' ? 'primary' : 'secondary'\"\n :disabled=\"disabled\"\n @click=\"selectMode('file')\"\n >\n File\n </BaseButton>\n <BaseButton\n size=\"sm\"\n :variant=\"mode === 'folder' ? 'primary' : 'secondary'\"\n :disabled=\"disabled\"\n @click=\"selectMode('folder')\"\n >\n Folder\n </BaseButton>\n <BaseButton\n v-if=\"canSelectArtifact\"\n size=\"sm\"\n variant=\"secondary\"\n :disabled=\"disabled\"\n @click=\"openArtifactPicker\"\n >\n Existing artifact\n </BaseButton>\n </div>\n\n <FileUploader\n :key=\"mode\"\n :mode=\"mode\"\n :files=\"selectedFiles\"\n :root-name=\"uploads[0]?.rootName\"\n :multiple=\"multiple && mode === 'file'\"\n :disabled=\"disabled\"\n @upload=\"selectFiles\"\n @remove=\"removeFiles\"\n />\n\n <ul v-if=\"artifacts.length\" class=\"mint-file-uploader__list\">\n <li\n v-for=\"artifact in artifacts\"\n :key=\"`${artifact.experimentId}:${artifact.artifactId}`\"\n class=\"mint-file-uploader__file mint-generated-path-input__artifact\"\n >\n <div class=\"mint-file-uploader__file-info\">\n <span class=\"mint-file-uploader__file-badge mint-generated-path-input__artifact-badge\">ART</span>\n <div class=\"mint-file-uploader__file-meta\">\n <span class=\"mint-file-uploader__file-name\">{{ artifact.name }}</span>\n <span class=\"mint-file-uploader__file-size\">Existing artifact · experiment {{ artifact.experimentId }}</span>\n </div>\n </div>\n <button\n type=\"button\"\n :aria-label=\"`Remove ${artifact.name}`\"\n class=\"mint-file-uploader__remove-btn\"\n :disabled=\"disabled\"\n @click.stop=\"removeArtifact(artifact)\"\n >\n <svg class=\"mint-file-uploader__remove-icon\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" viewBox=\"0 0 24 24\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </li>\n </ul>\n\n <BaseModal\n v-if=\"canSelectArtifact\"\n v-model=\"artifactOpen\"\n title=\"Select a file artifact\"\n size=\"lg\"\n >\n <ResourcePickerListInternal\n v-model:search=\"artifactSearch\"\n label=\"File artifacts\"\n placeholder=\"Search file artifacts…\"\n :items=\"visibleArtifactRows\"\n :item-key=\"(row) => row.id\"\n :describe=\"describeArtifact\"\n :loading=\"artifactLoading\"\n :error=\"artifactError\"\n :empty-title=\"artifactRows.length ? 'No matching file artifacts' : 'No file artifacts this plugin can read'\"\n :empty-description=\"artifactRows.length\n ? 'Try a different search.'\n : 'Only active file artifacts saved by this plugin, or by the plugins it declares as readers, can be used as a path.'\"\n @select=\"selectArtifact\"\n />\n </BaseModal>\n </div>\n</template>\n\n<style scoped>\n.mint-generated-path-input {\n display: grid;\n gap: 0.75rem;\n}\n\n.mint-generated-path-input__modes {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem;\n}\n\n.mint-generated-path-input__artifact-badge {\n --badge-color: var(--color-primary);\n}\n\n.mint-generated-path-input__artifact .mint-file-uploader__remove-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n color: var(--text-muted);\n background: transparent;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, inject, ref, watch } from 'vue'\n\nimport { mintApiErrorFromResponse } from '../apiErrors'\nimport { formatExperimentDate } from '../composables/experiment-utils'\nimport { createGeneratedAnalysisTransport } from '../composables/useGeneratedAnalysis'\nimport {\n getInjectedPlatformContext,\n resolveCurrentExperimentId,\n} from '../composables/platformContextHelpers'\nimport type { AnalysisArtifactSummary } from '../types/analysisArtifactTypes'\nimport type {\n PluginJobArtifactPathInput,\n PluginJobPathInput,\n PluginJobPathSelection,\n} from '../types/generated-ui'\nimport BaseButton from './BaseButton.vue'\nimport BaseModal from './BaseModal.vue'\nimport FileUploader from './FileUploader.vue'\nimport { GENERATED_JOBS_API_KEY } from './internal/generatedJobsApi'\nimport ResourcePickerListInternal from './internal/ResourcePickerListInternal.vue'\n\n/** A file artifact the plugin's jobs API says this Path input may use. */\ninterface ReadableArtifact extends AnalysisArtifactSummary {\n filename: string\n}\n\nconst props = defineProps<{\n modelValue?: PluginJobPathSelection | PluginJobPathSelection[] | null\n disabled?: boolean\n multiple?: boolean\n}>()\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: PluginJobPathSelection | PluginJobPathSelection[] | null]\n}>()\n\nconst mode = ref<'file' | 'folder'>('file')\nconst selections = computed(() => Array.isArray(props.modelValue)\n ? props.modelValue\n : props.modelValue ? [props.modelValue] : [])\nconst uploads = computed(() => selections.value.filter(\n (selection): selection is PluginJobPathInput => selection.kind === 'path',\n))\nconst artifacts = computed(() => selections.value.filter(\n (selection): selection is PluginJobArtifactPathInput => selection.kind === 'artifact-path',\n))\nconst selectedFiles = computed(() => uploads.value.flatMap(selection => selection.files))\nwatch(uploads, (current) => {\n if (current.length) mode.value = current.every(selection => selection.rootName) ? 'folder' : 'file'\n}, { immediate: true })\nconst artifactOpen = ref(false)\nconst artifactSearch = ref('')\nconst artifactRows = ref<ReadableArtifact[]>([])\nconst artifactLoading = ref(false)\nconst artifactError = ref<string | null>(null)\nconst platform = getInjectedPlatformContext()\nconst experimentId = resolveCurrentExperimentId(platform)\nconst jobsApi = inject(GENERATED_JOBS_API_KEY, null)\nconst canSelectArtifact = computed(() => Boolean(platform?.isIntegrated && experimentId && jobsApi))\nconst visibleArtifactRows = computed(() => {\n const query = artifactSearch.value.trim().toLowerCase()\n return query\n ? artifactRows.value.filter(row => [row.display_name, row.artifact_key, row.filename, row.plugin_id]\n .some(text => text.toLowerCase().includes(query)))\n : artifactRows.value\n})\n\nfunction selectMode(nextMode: 'file' | 'folder'): void {\n mode.value = nextMode\n emit('update:modelValue', null)\n}\n\nfunction selectFiles(\n files: File[],\n rootName?: string,\n relativePaths?: string[],\n): void {\n const paths = relativePaths ?? files.map(file => file.name)\n const added: PluginJobPathInput[] = props.multiple && !rootName\n ? files.map((file, index) => ({\n kind: 'path',\n files: [file],\n relativePaths: [paths[index] ?? file.name],\n }))\n : [{\n kind: 'path',\n files,\n relativePaths: paths,\n ...(rootName ? { rootName } : {}),\n }]\n emitSelections(props.multiple ? [...selections.value, ...added] : added)\n}\n\nfunction removeFiles(files: File[]): void {\n const removed = new Set(files)\n emitSelections(selections.value.flatMap((selection): PluginJobPathSelection[] => {\n if (selection.kind !== 'path') return [selection]\n const indexes = selection.files\n .map((file, index) => removed.has(file) ? -1 : index)\n .filter(index => index >= 0)\n if (!indexes.length) return []\n return [{\n ...selection,\n files: indexes.map(index => selection.files[index]!),\n relativePaths: indexes.map(index => selection.relativePaths[index]!),\n }]\n }))\n}\n\nfunction removeArtifact(artifact: PluginJobArtifactPathInput): void {\n emitSelections(selections.value.filter(selection => selection !== artifact))\n}\n\nfunction emitSelections(next: PluginJobPathSelection[]): void {\n emit('update:modelValue', props.multiple ? next : next[0] ?? null)\n}\n\n// The plugin lists exactly the artifacts its staging route accepts (same\n// readers and visibility rule), so a pick never fails later with a 404.\nlet artifactRequest = 0\n\nasync function openArtifactPicker(): Promise<void> {\n if (!jobsApi || !experimentId) return\n const request = ++artifactRequest\n artifactOpen.value = true\n artifactSearch.value = ''\n artifactLoading.value = true\n artifactError.value = null\n let rows: ReadableArtifact[] = []\n let error: string | null = null\n try {\n const transport = jobsApi.transport ?? createGeneratedAnalysisTransport()\n const baseUrl = jobsApi.baseUrl.replace(/\\/$/, '')\n const response = await transport(\n `${baseUrl}/jobs/artifacts?experiment_id=${encodeURIComponent(experimentId)}`,\n { headers: { Accept: 'application/json' } },\n )\n const payload: unknown = await response.json().catch(() => null)\n if (!response.ok) throw mintApiErrorFromResponse(response.status, payload)\n rows = (payload as { artifacts?: ReadableArtifact[] } | null)?.artifacts ?? []\n } catch (cause) {\n error = cause instanceof Error ? cause.message : 'Failed to load artifacts'\n }\n // A reopened picker owns the list; an earlier, slower answer is dropped.\n if (request !== artifactRequest) return\n artifactRows.value = rows\n artifactError.value = error\n artifactLoading.value = false\n}\n\nfunction describeArtifact(row: ReadableArtifact) {\n const date = row.updated_at ?? row.created_at\n return {\n code: row.artifact_key,\n title: row.display_name,\n meta: [row.filename, row.plugin_id],\n date: date ? formatExperimentDate(date) : '',\n }\n}\n\n// Only the database ids are kept: the plugin re-authorizes and copies the\n// file when the job is submitted, so the browser never downloads it.\nfunction selectArtifact(row: ReadableArtifact): void {\n const selection: PluginJobArtifactPathInput = {\n kind: 'artifact-path',\n experimentId: row.experiment_id,\n artifactId: row.id,\n name: row.filename,\n }\n emitSelections(props.multiple ? [...selections.value, selection] : [selection])\n artifactOpen.value = false\n}\n</script>\n\n<template>\n <div class=\"mint-generated-path-input\">\n <div class=\"mint-generated-path-input__modes\" role=\"group\" aria-label=\"Path type\">\n <BaseButton\n size=\"sm\"\n :variant=\"mode === 'file' ? 'primary' : 'secondary'\"\n :disabled=\"disabled\"\n @click=\"selectMode('file')\"\n >\n File\n </BaseButton>\n <BaseButton\n size=\"sm\"\n :variant=\"mode === 'folder' ? 'primary' : 'secondary'\"\n :disabled=\"disabled\"\n @click=\"selectMode('folder')\"\n >\n Folder\n </BaseButton>\n <BaseButton\n v-if=\"canSelectArtifact\"\n size=\"sm\"\n variant=\"secondary\"\n :disabled=\"disabled\"\n @click=\"openArtifactPicker\"\n >\n Existing artifact\n </BaseButton>\n </div>\n\n <FileUploader\n :key=\"mode\"\n :mode=\"mode\"\n :files=\"selectedFiles\"\n :root-name=\"uploads[0]?.rootName\"\n :multiple=\"multiple && mode === 'file'\"\n :disabled=\"disabled\"\n @upload=\"selectFiles\"\n @remove=\"removeFiles\"\n />\n\n <ul v-if=\"artifacts.length\" class=\"mint-file-uploader__list\">\n <li\n v-for=\"artifact in artifacts\"\n :key=\"`${artifact.experimentId}:${artifact.artifactId}`\"\n class=\"mint-file-uploader__file mint-generated-path-input__artifact\"\n >\n <div class=\"mint-file-uploader__file-info\">\n <span class=\"mint-file-uploader__file-badge mint-generated-path-input__artifact-badge\">ART</span>\n <div class=\"mint-file-uploader__file-meta\">\n <span class=\"mint-file-uploader__file-name\">{{ artifact.name }}</span>\n <span class=\"mint-file-uploader__file-size\">Existing artifact · experiment {{ artifact.experimentId }}</span>\n </div>\n </div>\n <button\n type=\"button\"\n :aria-label=\"`Remove ${artifact.name}`\"\n class=\"mint-file-uploader__remove-btn\"\n :disabled=\"disabled\"\n @click.stop=\"removeArtifact(artifact)\"\n >\n <svg class=\"mint-file-uploader__remove-icon\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" viewBox=\"0 0 24 24\">\n <path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </li>\n </ul>\n\n <BaseModal\n v-if=\"canSelectArtifact\"\n v-model=\"artifactOpen\"\n title=\"Select a file artifact\"\n size=\"lg\"\n >\n <ResourcePickerListInternal\n v-model:search=\"artifactSearch\"\n label=\"File artifacts\"\n placeholder=\"Search file artifacts…\"\n :items=\"visibleArtifactRows\"\n :item-key=\"(row) => row.id\"\n :describe=\"describeArtifact\"\n :loading=\"artifactLoading\"\n :error=\"artifactError\"\n :empty-title=\"artifactRows.length ? 'No matching file artifacts' : 'No file artifacts this plugin can read'\"\n :empty-description=\"artifactRows.length\n ? 'Try a different search.'\n : 'Only active file artifacts saved by this plugin, or by the plugins it declares as readers, can be used as a path.'\"\n @select=\"selectArtifact\"\n />\n </BaseModal>\n </div>\n</template>\n\n<style scoped>\n.mint-generated-path-input {\n display: grid;\n gap: 0.75rem;\n}\n\n.mint-generated-path-input__modes {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem;\n}\n\n.mint-generated-path-input__artifact-badge {\n --badge-color: var(--color-primary);\n}\n\n.mint-generated-path-input__artifact .mint-file-uploader__remove-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n color: var(--text-muted);\n background: transparent;\n}\n</style>\n","// Types\nexport interface ParsedElement {\n symbol: string\n count: number\n}\n\nexport interface FormulaParseResult {\n elements: Record<string, number>\n valid: boolean\n error?: string\n}\n\n/** `coefficient` is a full-size multiplier at the start of a hydrate segment (the 5 in CuSO4·5H2O). */\nexport type FormulaPartType = 'element' | 'subscript' | 'superscript' | 'paren' | 'dot' | 'charge' | 'coefficient'\n\nexport interface FormulaPart {\n type: FormulaPartType\n text: string\n}\n\n// Every element with its standard atomic weight (mass number of the most stable isotope when none is defined)\nexport const ATOMIC_WEIGHTS: Record<string, number> = {\n H: 1.008, He: 4.003, Li: 6.941, Be: 9.012, B: 10.81,\n C: 12.011, N: 14.007, O: 15.999, F: 18.998, Ne: 20.180,\n Na: 22.990, Mg: 24.305, Al: 26.982, Si: 28.086, P: 30.974,\n S: 32.065, Cl: 35.453, Ar: 39.948, K: 39.098, Ca: 40.078,\n Sc: 44.956, Ti: 47.867, V: 50.942, Cr: 51.996,\n Mn: 54.938, Fe: 55.845, Co: 58.933, Ni: 58.693, Cu: 63.546,\n Zn: 65.38, Ga: 69.723, Ge: 72.630, As: 74.922, Se: 78.971,\n Br: 79.904, Kr: 83.798, Rb: 85.468, Sr: 87.62, Y: 88.906,\n Zr: 91.224, Nb: 92.906, Mo: 95.95, Tc: 98, Ru: 101.07,\n Rh: 102.906, Pd: 106.42, Ag: 107.868, Cd: 112.414, In: 114.818,\n Sn: 118.710, Sb: 121.760, Te: 127.60, I: 126.904, Xe: 131.293,\n Cs: 132.905, Ba: 137.327, La: 138.905, Ce: 140.116, Pr: 140.908,\n Nd: 144.242, Pm: 145, Sm: 150.36, Eu: 151.964, Gd: 157.25,\n Tb: 158.925, Dy: 162.500, Ho: 164.930, Er: 167.259, Tm: 168.934,\n Yb: 173.045, Lu: 174.967, Hf: 178.49, Ta: 180.948, W: 183.84,\n Re: 186.207, Os: 190.23, Ir: 192.217, Pt: 195.084, Au: 196.967,\n Hg: 200.592, Tl: 204.38, Pb: 207.2, Bi: 208.980, Po: 209,\n At: 210, Rn: 222, Fr: 223, Ra: 226, Ac: 227,\n Th: 232.038, Pa: 231.036, U: 238.029, Np: 237, Pu: 244,\n Am: 243, Cm: 247, Bk: 247, Cf: 251, Es: 252,\n Fm: 257, Md: 258, No: 259, Lr: 266, Rf: 267,\n Db: 268, Sg: 269, Bh: 270, Hs: 277, Mt: 278,\n Ds: 281, Rg: 282, Cn: 285, Nh: 286, Fl: 289,\n Mc: 290, Lv: 293, Ts: 294, Og: 294,\n}\n\nfunction parseFormulaSegment(formula: string): FormulaParseResult {\n const elements: Record<string, number> = {}\n const stack: Record<string, number>[] = [{}]\n let i = 0\n\n while (i < formula.length) {\n const ch = formula[i]\n\n if (ch === '(') {\n stack.push({})\n i++\n } else if (ch === ')') {\n if (stack.length < 2) {\n return { elements: {}, valid: false, error: 'Unmatched closing parenthesis' }\n }\n i++\n // Read multiplier after closing paren\n let numStr = ''\n while (i < formula.length && /\\d/.test(formula[i])) {\n numStr += formula[i]\n i++\n }\n const multiplier = numStr ? parseInt(numStr, 10) : 1\n const top = stack.pop()!\n const current = stack[stack.length - 1]\n for (const [el, count] of Object.entries(top)) {\n current[el] = (current[el] || 0) + count * multiplier\n }\n } else if (/[A-Z]/.test(ch)) {\n // Element symbol: uppercase letter optionally followed by lowercase\n let symbol = ch\n i++\n while (i < formula.length && /[a-z]/.test(formula[i])) {\n symbol += formula[i]\n i++\n }\n // Validate element\n if (!(symbol in ATOMIC_WEIGHTS)) {\n return { elements: {}, valid: false, error: `Unknown element: ${symbol}` }\n }\n // Read count\n let numStr = ''\n while (i < formula.length && /\\d/.test(formula[i])) {\n numStr += formula[i]\n i++\n }\n const count = numStr ? parseInt(numStr, 10) : 1\n const current = stack[stack.length - 1]\n current[symbol] = (current[symbol] || 0) + count\n } else {\n return { elements: {}, valid: false, error: `Unexpected character: ${ch}` }\n }\n }\n\n if (stack.length !== 1) {\n return { elements: {}, valid: false, error: 'Unmatched opening parenthesis' }\n }\n\n Object.assign(elements, stack[0])\n return { elements, valid: true }\n}\n\n/** Parses and renders chemical formulas, computes molecular weight, and generates rich-text formula parts. */\nexport function useChemicalFormula() {\n function parseFormula(formula: string): FormulaParseResult {\n const trimmed = formula.trim()\n if (!trimmed) {\n return { elements: {}, valid: false, error: 'Empty formula' }\n }\n\n // A trailing charge (SO4^2-, Fe2+, NH4+) does not change the composition. Like renderFormulaParts,\n // digits before a bare sign are the charge only on a lone element (Fe2+); otherwise they are a\n // subscript and the sign a unit charge (NH4+). Write Hg2^2+ for any other multiple charge.\n const body = trimmed.replace(/^([A-Z][a-z]?)\\d*[+-]$/, '$1').replace(/(\\^\\d*)?[+-]$/, '')\n if (!body) {\n return { elements: {}, valid: false, error: 'Empty formula' }\n }\n // Split on hydrate separator (·, . or *)\n const parts = body.split(/[·.*]/)\n const combined: Record<string, number> = {}\n\n for (const part of parts) {\n const segment = part.trim()\n if (!segment) continue\n\n // Check for leading coefficient (e.g., 5H2O)\n let coefficient = 1\n let formulaStr = segment\n const coeffMatch = segment.match(/^(\\d+)([A-Z].*)$/)\n if (coeffMatch) {\n coefficient = parseInt(coeffMatch[1], 10)\n formulaStr = coeffMatch[2]\n }\n\n const result = parseFormulaSegment(formulaStr)\n if (!result.valid) {\n return result\n }\n\n for (const [el, count] of Object.entries(result.elements)) {\n combined[el] = (combined[el] || 0) + count * coefficient\n }\n }\n\n return { elements: combined, valid: true }\n }\n\n function calculateMW(elements: Record<string, number>): number {\n let mw = 0\n for (const [el, count] of Object.entries(elements)) {\n const weight = ATOMIC_WEIGHTS[el]\n if (weight !== undefined) {\n mw += weight * count\n }\n }\n return Math.round(mw * 1000) / 1000\n }\n\n function renderFormulaParts(formula: string): FormulaPart[] {\n const parts: FormulaPart[] = []\n const trimmed = formula.trim()\n let i = 0\n\n while (i < trimmed.length) {\n const ch = trimmed[i]\n\n // Hydrate dot separator\n if (ch === '·' || (ch === '.' && i > 0 && /\\d/.test(trimmed[i - 1]) && i + 1 < trimmed.length && /\\d/.test(trimmed[i + 1]))) {\n // Disambiguate: '.' as hydrate separator only if followed by a digit then uppercase\n // For simplicity, treat '·' always as dot\n if (ch === '·') {\n parts.push({ type: 'dot', text: '·' })\n i++\n continue\n }\n }\n\n // Parentheses\n if (ch === '(' || ch === ')') {\n parts.push({ type: 'paren', text: ch })\n i++\n // After ')' check for subscript number\n if (ch === ')' && i < trimmed.length && /\\d/.test(trimmed[i])) {\n let numStr = ''\n while (i < trimmed.length && /\\d/.test(trimmed[i])) {\n numStr += trimmed[i]\n i++\n }\n parts.push({ type: 'subscript', text: numStr })\n }\n continue\n }\n\n // Charge notation: ^2+, ^2-, 2+, 2- at end, or +, -\n if (ch === '^') {\n i++\n let chargeStr = ''\n while (i < trimmed.length && /[\\d+\\-]/.test(trimmed[i])) {\n chargeStr += trimmed[i]\n i++\n }\n if (chargeStr) {\n parts.push({ type: 'charge', text: chargeStr })\n }\n continue\n }\n\n // Element symbol: uppercase followed by optional lowercase\n if (/[A-Z]/.test(ch)) {\n let symbol = ch\n i++\n while (i < trimmed.length && /[a-z]/.test(trimmed[i])) {\n symbol += trimmed[i]\n i++\n }\n parts.push({ type: 'element', text: symbol })\n\n // Check for subscript number after element\n if (i < trimmed.length && /\\d/.test(trimmed[i])) {\n let numStr = ''\n while (i < trimmed.length && /\\d/.test(trimmed[i])) {\n numStr += trimmed[i]\n i++\n }\n parts.push({ type: 'subscript', text: numStr })\n\n // On a lone element the digits before a trailing sign are the charge (Fe2+);\n // elsewhere they stay a subscript and the sign renders as a unit charge (NH4+).\n if (parts.length === 2 && i === trimmed.length - 1 && (trimmed[i] === '+' || trimmed[i] === '-')) {\n parts.push({ type: 'charge', text: numStr + trimmed[i] })\n parts.splice(parts.length - 2, 1) // Remove the subscript\n i++\n continue\n }\n }\n continue\n }\n\n // Leading digit (hydrate coefficient like 5H2O)\n if (/\\d/.test(ch)) {\n let numStr = ''\n while (i < trimmed.length && /\\d/.test(trimmed[i])) {\n numStr += trimmed[i]\n i++\n }\n // Could be a subscript or coefficient depending on context\n // If next char is uppercase, it's a coefficient (render as element-like text)\n // If at end or followed by +/-, it's a charge component\n const prev = parts[parts.length - 1]\n if (i < trimmed.length && (trimmed[i] === '+' || trimmed[i] === '-')) {\n parts.push({ type: 'charge', text: numStr + trimmed[i] })\n i++\n } else if (!prev || prev.type === 'dot') {\n parts.push({ type: 'coefficient', text: numStr })\n } else {\n parts.push({ type: 'subscript', text: numStr })\n }\n continue\n }\n\n // Standalone + or - (charge)\n if (ch === '+' || ch === '-') {\n parts.push({ type: 'charge', text: ch })\n i++\n continue\n }\n\n // Dot or asterisk as hydrate separator\n if (ch === '.' || ch === '*') {\n parts.push({ type: 'dot', text: '·' })\n i++\n continue\n }\n\n // Skip whitespace\n if (/\\s/.test(ch)) {\n i++\n continue\n }\n\n // Unknown character, skip\n i++\n }\n\n return parts\n }\n\n return {\n parseFormula,\n calculateMW,\n renderFormulaParts,\n }\n}\n","<script setup lang=\"ts\">\n/**\n * Text input for chemical formulas (e.g. Ca(OH)2, CuSO4·5H2O). Blurred, the field shows the rendered\n * formula; focused, the raw text. A fixed segment shows the molecular weight; an unknown symbol puts\n * the field in the error state and names the symbol.\n */\nimport { computed, ref } from 'vue'\nimport { useChemicalFormula } from '../composables/useChemicalFormula'\n\ninterface Props {\n modelValue?: string\n showPreview?: boolean\n showMW?: boolean\n placeholder?: string\n error?: boolean\n disabled?: boolean\n size?: 'sm' | 'md' | 'lg'\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: '',\n showPreview: true,\n showMW: true,\n placeholder: 'e.g. Ca(OH)2',\n error: false,\n disabled: false,\n size: 'md',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n 'mw': [mw: number | null]\n}>()\n\nconst { parseFormula, calculateMW, renderFormulaParts } = useChemicalFormula()\n\nconst focused = ref(false)\n\nfunction analyse(value: string) {\n if (!value.trim()) return { mw: null, error: null }\n const result = parseFormula(value)\n if (!result.valid) return { mw: null, error: result.error || 'Invalid formula' }\n return { mw: calculateMW(result.elements), error: null }\n}\n\nconst analysis = computed(() => analyse(props.modelValue))\nconst parts = computed(() => renderFormulaParts(props.modelValue))\nconst showRendered = computed(() =>\n props.showPreview && !focused.value && Boolean(props.modelValue.trim()) && !analysis.value.error,\n)\nconst mwText = computed(() => (analysis.value.mw === null ? '—' : analysis.value.mw.toFixed(2)))\n\nfunction handleInput(event: Event) {\n const value = (event.target as HTMLInputElement).value\n emit('update:modelValue', value)\n emit('mw', analyse(value).mw)\n}\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-formula-input',\n error || analysis.error ? 'mint-formula-input--error' : '',\n disabled ? 'mint-formula-input--disabled' : '',\n ]\"\n >\n <div :class=\"['mint-formula-input__field', `mint-formula-input__field--${size}`]\">\n <div class=\"mint-formula-input__entry\">\n <input\n type=\"text\"\n :value=\"modelValue\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :aria-invalid=\"error || Boolean(analysis.error) || undefined\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n :class=\"['mint-formula-input__input', showRendered ? 'mint-formula-input__input--masked' : '']\"\n aria-label=\"Chemical formula\"\n @input=\"handleInput\"\n @focus=\"focused = true\"\n @blur=\"focused = false\"\n />\n <span v-if=\"showRendered\" class=\"mint-formula-input__rendered\" aria-hidden=\"true\">\n <template v-for=\"(part, i) in parts\" :key=\"i\">\n <span v-if=\"part.type === 'subscript'\" class=\"mint-formula-input__sub\">{{ part.text }}</span>\n <span v-else-if=\"part.type === 'superscript' || part.type === 'charge'\" class=\"mint-formula-input__sup\">{{ part.text }}</span>\n <span v-else-if=\"part.type === 'dot'\" class=\"mint-formula-input__dot\">{{ part.text }}</span>\n <span v-else>{{ part.text }}</span>\n </template>\n </span>\n </div>\n <span v-if=\"showMW\" class=\"mint-formula-input__mw\"><span class=\"mint-formula-input__mw-label\">MW</span> <span class=\"mint-formula-input__mw-value\">{{ mwText }}</span> <span class=\"mint-formula-input__mw-unit\">g/mol</span></span>\n </div>\n\n <div v-if=\"analysis.error\" class=\"mint-formula-input__error-text\">\n {{ analysis.error }}\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * Text input for chemical formulas (e.g. Ca(OH)2, CuSO4·5H2O). Blurred, the field shows the rendered\n * formula; focused, the raw text. A fixed segment shows the molecular weight; an unknown symbol puts\n * the field in the error state and names the symbol.\n */\nimport { computed, ref } from 'vue'\nimport { useChemicalFormula } from '../composables/useChemicalFormula'\n\ninterface Props {\n modelValue?: string\n showPreview?: boolean\n showMW?: boolean\n placeholder?: string\n error?: boolean\n disabled?: boolean\n size?: 'sm' | 'md' | 'lg'\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: '',\n showPreview: true,\n showMW: true,\n placeholder: 'e.g. Ca(OH)2',\n error: false,\n disabled: false,\n size: 'md',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n 'mw': [mw: number | null]\n}>()\n\nconst { parseFormula, calculateMW, renderFormulaParts } = useChemicalFormula()\n\nconst focused = ref(false)\n\nfunction analyse(value: string) {\n if (!value.trim()) return { mw: null, error: null }\n const result = parseFormula(value)\n if (!result.valid) return { mw: null, error: result.error || 'Invalid formula' }\n return { mw: calculateMW(result.elements), error: null }\n}\n\nconst analysis = computed(() => analyse(props.modelValue))\nconst parts = computed(() => renderFormulaParts(props.modelValue))\nconst showRendered = computed(() =>\n props.showPreview && !focused.value && Boolean(props.modelValue.trim()) && !analysis.value.error,\n)\nconst mwText = computed(() => (analysis.value.mw === null ? '—' : analysis.value.mw.toFixed(2)))\n\nfunction handleInput(event: Event) {\n const value = (event.target as HTMLInputElement).value\n emit('update:modelValue', value)\n emit('mw', analyse(value).mw)\n}\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-formula-input',\n error || analysis.error ? 'mint-formula-input--error' : '',\n disabled ? 'mint-formula-input--disabled' : '',\n ]\"\n >\n <div :class=\"['mint-formula-input__field', `mint-formula-input__field--${size}`]\">\n <div class=\"mint-formula-input__entry\">\n <input\n type=\"text\"\n :value=\"modelValue\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :aria-invalid=\"error || Boolean(analysis.error) || undefined\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n :class=\"['mint-formula-input__input', showRendered ? 'mint-formula-input__input--masked' : '']\"\n aria-label=\"Chemical formula\"\n @input=\"handleInput\"\n @focus=\"focused = true\"\n @blur=\"focused = false\"\n />\n <span v-if=\"showRendered\" class=\"mint-formula-input__rendered\" aria-hidden=\"true\">\n <template v-for=\"(part, i) in parts\" :key=\"i\">\n <span v-if=\"part.type === 'subscript'\" class=\"mint-formula-input__sub\">{{ part.text }}</span>\n <span v-else-if=\"part.type === 'superscript' || part.type === 'charge'\" class=\"mint-formula-input__sup\">{{ part.text }}</span>\n <span v-else-if=\"part.type === 'dot'\" class=\"mint-formula-input__dot\">{{ part.text }}</span>\n <span v-else>{{ part.text }}</span>\n </template>\n </span>\n </div>\n <span v-if=\"showMW\" class=\"mint-formula-input__mw\"><span class=\"mint-formula-input__mw-label\">MW</span> <span class=\"mint-formula-input__mw-value\">{{ mwText }}</span> <span class=\"mint-formula-input__mw-unit\">g/mol</span></span>\n </div>\n\n <div v-if=\"analysis.error\" class=\"mint-formula-input__error-text\">\n {{ analysis.error }}\n </div>\n </div>\n</template>\n","export type SequenceType = 'dna' | 'rna' | 'protein' | 'auto'\n\nexport interface SequenceStats {\n length: number\n gcPercent?: number\n molecularWeight?: number\n}\n\n/** What `validateSequence` would strip or flag, so a field can report it instead. */\nexport interface SequenceProblems {\n /** Ambiguous `N` bases (DNA/RNA only; `N` is asparagine in protein). */\n ambiguousBases: number\n /** Unique characters outside the alphabet, upper-cased, in order of appearance. Whitespace is ignored. */\n invalidCharacters: string[]\n}\n\nconst DNA_CHARS = /[^ATCGNatcgn]/g\nconst RNA_CHARS = /[^AUCGNaucgn]/g\nconst PROTEIN_CHARS = /[^ACDEFGHIKLMNPQRSTVWYacdefghiklmnpqrstvwy]/g\n\nconst DNA_COMPLEMENT: Record<string, string> = {\n A: 'T', T: 'A', C: 'G', G: 'C', N: 'N',\n a: 't', t: 'a', c: 'g', g: 'c', n: 'n',\n}\n\nconst RNA_COMPLEMENT: Record<string, string> = {\n A: 'U', U: 'A', C: 'G', G: 'C', N: 'N',\n a: 'u', u: 'a', c: 'g', g: 'c', n: 'n',\n}\n\n// Average molecular weights per residue\nconst MW_DNA_NT = 330 // Da per nucleotide (average)\nconst MW_RNA_NT = 340 // Da per nucleotide (average)\nconst MW_PROTEIN_AA = 110 // Da per amino acid (average)\n\n/** Detects, validates, cleans, and computes stats (GC%, MW) for DNA, RNA, and protein sequences. */\nexport function useSequenceUtils() {\n function detectSequenceType(seq: string): 'dna' | 'rna' | 'protein' {\n const upper = seq.toUpperCase()\n\n // If contains U but not T, it's RNA\n if (upper.includes('U') && !upper.includes('T')) {\n return 'rna'\n }\n\n // If its letters are only ATCGN, it's DNA (line breaks, spaces and digits don't count)\n if (/^[ATCGN]+$/i.test(seq.replace(/[^a-z]/gi, ''))) {\n return 'dna'\n }\n\n return 'protein'\n }\n\n function validateSequence(seq: string, type: SequenceType): string {\n const effectiveType = type === 'auto' ? detectSequenceType(seq) : type\n\n switch (effectiveType) {\n case 'dna':\n return seq.replace(DNA_CHARS, '')\n case 'rna':\n return seq.replace(RNA_CHARS, '')\n case 'protein':\n return seq.replace(PROTEIN_CHARS, '')\n default:\n return seq\n }\n }\n\n function findSequenceProblems(seq: string, type: 'dna' | 'rna' | 'protein'): SequenceProblems {\n const alphabet = { dna: DNA_CHARS, rna: RNA_CHARS, protein: PROTEIN_CHARS }[type]\n const invalid = seq.replace(/\\s/g, '').match(alphabet) ?? []\n return {\n ambiguousBases: type === 'protein' ? 0 : (seq.match(/n/gi) ?? []).length,\n invalidCharacters: [...new Set(invalid.map(ch => ch.toUpperCase()))],\n }\n }\n\n function reverseComplement(seq: string, type: 'dna' | 'rna'): string {\n const complementMap = type === 'dna' ? DNA_COMPLEMENT : RNA_COMPLEMENT\n\n return seq\n .split('')\n .reverse()\n .map(ch => complementMap[ch] ?? ch)\n .join('')\n }\n\n function calculateStats(seq: string, type: 'dna' | 'rna' | 'protein'): SequenceStats {\n const length = seq.length\n const stats: SequenceStats = { length }\n\n if (type === 'dna' || type === 'rna') {\n const upper = seq.toUpperCase()\n let gcCount = 0\n for (const ch of upper) {\n if (ch === 'G' || ch === 'C') gcCount++\n }\n stats.gcPercent = length > 0 ? Math.round((gcCount / length) * 10000) / 100 : 0\n stats.molecularWeight = length * (type === 'dna' ? MW_DNA_NT : MW_RNA_NT)\n } else {\n stats.molecularWeight = length * MW_PROTEIN_AA\n }\n\n return stats\n }\n\n function formatFasta(seq: string, lineWidth: number = 60): string {\n const lines: string[] = []\n for (let i = 0; i < seq.length; i += lineWidth) {\n lines.push(seq.slice(i, i + lineWidth))\n }\n return lines.join('\\n')\n }\n\n return {\n detectSequenceType,\n validateSequence,\n findSequenceProblems,\n reverseComplement,\n calculateStats,\n formatFasta,\n }\n}\n","<script setup lang=\"ts\">\n/** Textarea for DNA/RNA/protein sequences with auto-detection, validation, GC-content stats, reverse-complement, and FASTA formatting tools. */\nimport { computed, ref, watch } from 'vue'\nimport { useSequenceUtils, type SequenceType, type SequenceStats } from '../composables/useSequenceUtils'\n\ninterface Props {\n modelValue?: string\n type?: SequenceType\n readonly?: boolean\n showStats?: boolean\n showTools?: boolean\n maxLength?: number\n placeholder?: string\n rows?: number\n error?: boolean\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: '',\n type: 'auto',\n readonly: false,\n showStats: true,\n showTools: true,\n rows: 6,\n placeholder: 'Paste or type sequence...',\n error: false,\n disabled: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\ndefineSlots<{\n tools?(props: { sequence: string; type: 'dna' | 'rna' | 'protein'; stats: SequenceStats }): unknown\n}>()\n\nconst { detectSequenceType, validateSequence, findSequenceProblems, reverseComplement, calculateStats, formatFasta } = useSequenceUtils()\n\n// The field shows what was typed; `modelValue` stays the sanitised sequence and\n// the stripped characters are reported below the field instead of vanishing (9c).\nconst draft = ref(props.modelValue)\nlet lastEmitted = props.modelValue\nwatch(() => props.modelValue, (value) => {\n if (value === lastEmitted) return\n draft.value = value\n lastEmitted = value\n})\n\n// Detected from what was typed, so residues the sanitised value would drop still count.\nconst resolvedType = computed<'dna' | 'rna' | 'protein'>(() => {\n if (props.type !== 'auto') return props.type as 'dna' | 'rna' | 'protein'\n if (!draft.value) return 'dna'\n return detectSequenceType(draft.value)\n})\n\nconst TYPE_LABELS = { dna: 'DNA', rna: 'RNA', protein: 'Protein' } as const\n\nconst stats = computed<SequenceStats>(() => {\n if (!props.modelValue) return { length: 0 }\n return calculateStats(props.modelValue, resolvedType.value)\n})\n\nconst problems = computed(() => findSequenceProblems(draft.value, resolvedType.value))\nconst hasInvalid = computed(() => problems.value.invalidCharacters.length > 0)\n\nconst viewerLines = computed(() => {\n if (!props.modelValue) return []\n const formatted = formatFasta(props.modelValue, 60)\n return formatted.split('\\n').filter(l => l.length > 0)\n})\n\nfunction handleInput(event: Event) {\n const target = event.target as HTMLTextAreaElement\n draft.value = target.value\n // maxLength counts sequence characters, so the cut falls after the last one that fits.\n const value = capToMaxLength(target.value, resolvedType.value)\n if (value !== target.value) {\n draft.value = value\n target.value = value\n }\n lastEmitted = validateSequence(value, resolvedType.value)\n emit('update:modelValue', lastEmitted)\n}\n\nfunction capToMaxLength(text: string, type: 'dna' | 'rna' | 'protein'): string {\n if (!props.maxLength) return text\n let kept = 0\n for (let i = 0; i < text.length; i++) {\n kept += validateSequence(text[i], type).length\n if (kept > props.maxLength) return text.slice(0, i)\n }\n return text\n}\n\nfunction doReverseComplement() {\n if (!props.modelValue || resolvedType.value === 'protein') return\n emit('update:modelValue', reverseComplement(props.modelValue, resolvedType.value as 'dna' | 'rna'))\n}\n\nfunction doUppercase() {\n if (!props.modelValue) return\n emit('update:modelValue', props.modelValue.toUpperCase())\n}\n\nfunction doClear() {\n draft.value = ''\n emit('update:modelValue', '')\n}\n\nfunction doCopy() {\n if (!props.modelValue) return\n navigator.clipboard.writeText(props.modelValue)\n}\n\nfunction getBaseClass(char: string): string {\n const c = char.toLowerCase()\n if (c === 'a') return 'mint-sequence-input__base--a'\n if (c === 't') return 'mint-sequence-input__base--t'\n if (c === 'u') return 'mint-sequence-input__base--u'\n if (c === 'g') return 'mint-sequence-input__base--g'\n if (c === 'c') return 'mint-sequence-input__base--c'\n if (c === 'n') return 'mint-sequence-input__base--n'\n return ''\n}\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-sequence-input',\n error || hasInvalid ? 'mint-sequence-input--error' : '',\n disabled ? 'mint-sequence-input--disabled' : '',\n ]\"\n >\n <!-- Toolbar -->\n <div v-if=\"showTools && !readonly\" class=\"mint-sequence-input__toolbar\">\n <span class=\"mint-sequence-input__type-badge\">{{ TYPE_LABELS[resolvedType] }}</span>\n <div class=\"mint-sequence-input__tool-sep\" />\n <slot name=\"tools\" :sequence=\"modelValue || ''\" :type=\"resolvedType\" :stats=\"stats\">\n <button\n v-if=\"resolvedType !== 'protein'\"\n type=\"button\"\n class=\"mint-sequence-input__tool-btn\"\n :disabled=\"!modelValue || disabled\"\n @click=\"doReverseComplement\"\n >\n Rev Comp\n </button>\n <button\n type=\"button\"\n class=\"mint-sequence-input__tool-btn\"\n :disabled=\"!modelValue || disabled\"\n @click=\"doUppercase\"\n >\n Uppercase\n </button>\n <div class=\"mint-sequence-input__tool-sep\" />\n <button\n type=\"button\"\n class=\"mint-sequence-input__tool-btn\"\n :disabled=\"!modelValue || disabled\"\n @click=\"doCopy\"\n >\n Copy\n </button>\n <button\n type=\"button\"\n class=\"mint-sequence-input__tool-btn\"\n :disabled=\"!draft || disabled\"\n @click=\"doClear\"\n >\n Clear\n </button>\n </slot>\n </div>\n\n <!-- Editor (input mode) -->\n <div v-if=\"!readonly\" class=\"mint-sequence-input__editor\">\n <textarea\n :value=\"draft\"\n :rows=\"rows\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n class=\"mint-sequence-input__textarea\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n @input=\"handleInput\"\n />\n </div>\n\n <!-- Viewer (readonly mode) -->\n <div v-else class=\"mint-sequence-input__viewer\">\n <div\n v-for=\"(line, lineIdx) in viewerLines\"\n :key=\"lineIdx\"\n class=\"mint-sequence-input__viewer-line\"\n >\n <span class=\"mint-sequence-input__line-number\">{{ lineIdx * 60 + 1 }}</span>\n <span class=\"mint-sequence-input__line-content\">\n <span\n v-for=\"(char, charIdx) in line.split('')\"\n :key=\"charIdx\"\n :class=\"getBaseClass(char)\"\n >{{ char }}</span>\n </span>\n </div>\n <div v-if=\"!modelValue\" class=\"mint-sequence-input__viewer-line\">\n <span class=\"mint-sequence-input__line-number\" />\n <span class=\"mint-sequence-input__line-content\" style=\"color: var(--text-muted);\">No sequence</span>\n </div>\n </div>\n\n <!-- Stats and problems -->\n <div\n v-if=\"(showStats && modelValue) || problems.ambiguousBases || hasInvalid\"\n class=\"mint-sequence-input__stats\"\n >\n <template v-if=\"showStats && modelValue\">\n <span>\n <span class=\"mint-sequence-input__stat-label\">Length:</span>\n <span class=\"mint-sequence-input__stat-value\">{{ stats.length }}</span>\n </span>\n <span v-if=\"stats.gcPercent !== undefined\">\n <span class=\"mint-sequence-input__stat-label\">GC:</span>\n <span class=\"mint-sequence-input__stat-value\">{{ stats.gcPercent.toFixed(1) }}%</span>\n </span>\n <span v-if=\"stats.molecularWeight !== undefined\">\n <span class=\"mint-sequence-input__stat-label\">MW:</span>\n <span class=\"mint-sequence-input__stat-value\">~{{ (stats.molecularWeight / 1000).toFixed(1) }} kDa</span>\n </span>\n </template>\n <span v-if=\"problems.ambiguousBases\" class=\"mint-sequence-input__problem mint-sequence-input__problem--warning\">\n <svg class=\"mint-sequence-input__problem-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path class=\"mint-sequence-input__problem-shape\" d=\"M8 1.5l7 12.5H1z\" />\n <path class=\"mint-sequence-input__problem-mark\" d=\"M8 6v3.5M8 11.5v.01\" />\n </svg>\n {{ problems.ambiguousBases }} ambiguous bases (N)\n </span>\n <span v-if=\"hasInvalid\" role=\"alert\" class=\"mint-sequence-input__problem mint-sequence-input__problem--error\">\n <svg class=\"mint-sequence-input__problem-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <circle class=\"mint-sequence-input__problem-shape\" cx=\"8\" cy=\"8\" r=\"7\" />\n <path class=\"mint-sequence-input__problem-mark\" d=\"M8 4.5v4M8 11.5v.01\" />\n </svg>\n Invalid characters: {{ problems.invalidCharacters.join(' ') }}\n </span>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Textarea for DNA/RNA/protein sequences with auto-detection, validation, GC-content stats, reverse-complement, and FASTA formatting tools. */\nimport { computed, ref, watch } from 'vue'\nimport { useSequenceUtils, type SequenceType, type SequenceStats } from '../composables/useSequenceUtils'\n\ninterface Props {\n modelValue?: string\n type?: SequenceType\n readonly?: boolean\n showStats?: boolean\n showTools?: boolean\n maxLength?: number\n placeholder?: string\n rows?: number\n error?: boolean\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: '',\n type: 'auto',\n readonly: false,\n showStats: true,\n showTools: true,\n rows: 6,\n placeholder: 'Paste or type sequence...',\n error: false,\n disabled: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\ndefineSlots<{\n tools?(props: { sequence: string; type: 'dna' | 'rna' | 'protein'; stats: SequenceStats }): unknown\n}>()\n\nconst { detectSequenceType, validateSequence, findSequenceProblems, reverseComplement, calculateStats, formatFasta } = useSequenceUtils()\n\n// The field shows what was typed; `modelValue` stays the sanitised sequence and\n// the stripped characters are reported below the field instead of vanishing (9c).\nconst draft = ref(props.modelValue)\nlet lastEmitted = props.modelValue\nwatch(() => props.modelValue, (value) => {\n if (value === lastEmitted) return\n draft.value = value\n lastEmitted = value\n})\n\n// Detected from what was typed, so residues the sanitised value would drop still count.\nconst resolvedType = computed<'dna' | 'rna' | 'protein'>(() => {\n if (props.type !== 'auto') return props.type as 'dna' | 'rna' | 'protein'\n if (!draft.value) return 'dna'\n return detectSequenceType(draft.value)\n})\n\nconst TYPE_LABELS = { dna: 'DNA', rna: 'RNA', protein: 'Protein' } as const\n\nconst stats = computed<SequenceStats>(() => {\n if (!props.modelValue) return { length: 0 }\n return calculateStats(props.modelValue, resolvedType.value)\n})\n\nconst problems = computed(() => findSequenceProblems(draft.value, resolvedType.value))\nconst hasInvalid = computed(() => problems.value.invalidCharacters.length > 0)\n\nconst viewerLines = computed(() => {\n if (!props.modelValue) return []\n const formatted = formatFasta(props.modelValue, 60)\n return formatted.split('\\n').filter(l => l.length > 0)\n})\n\nfunction handleInput(event: Event) {\n const target = event.target as HTMLTextAreaElement\n draft.value = target.value\n // maxLength counts sequence characters, so the cut falls after the last one that fits.\n const value = capToMaxLength(target.value, resolvedType.value)\n if (value !== target.value) {\n draft.value = value\n target.value = value\n }\n lastEmitted = validateSequence(value, resolvedType.value)\n emit('update:modelValue', lastEmitted)\n}\n\nfunction capToMaxLength(text: string, type: 'dna' | 'rna' | 'protein'): string {\n if (!props.maxLength) return text\n let kept = 0\n for (let i = 0; i < text.length; i++) {\n kept += validateSequence(text[i], type).length\n if (kept > props.maxLength) return text.slice(0, i)\n }\n return text\n}\n\nfunction doReverseComplement() {\n if (!props.modelValue || resolvedType.value === 'protein') return\n emit('update:modelValue', reverseComplement(props.modelValue, resolvedType.value as 'dna' | 'rna'))\n}\n\nfunction doUppercase() {\n if (!props.modelValue) return\n emit('update:modelValue', props.modelValue.toUpperCase())\n}\n\nfunction doClear() {\n draft.value = ''\n emit('update:modelValue', '')\n}\n\nfunction doCopy() {\n if (!props.modelValue) return\n navigator.clipboard.writeText(props.modelValue)\n}\n\nfunction getBaseClass(char: string): string {\n const c = char.toLowerCase()\n if (c === 'a') return 'mint-sequence-input__base--a'\n if (c === 't') return 'mint-sequence-input__base--t'\n if (c === 'u') return 'mint-sequence-input__base--u'\n if (c === 'g') return 'mint-sequence-input__base--g'\n if (c === 'c') return 'mint-sequence-input__base--c'\n if (c === 'n') return 'mint-sequence-input__base--n'\n return ''\n}\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-sequence-input',\n error || hasInvalid ? 'mint-sequence-input--error' : '',\n disabled ? 'mint-sequence-input--disabled' : '',\n ]\"\n >\n <!-- Toolbar -->\n <div v-if=\"showTools && !readonly\" class=\"mint-sequence-input__toolbar\">\n <span class=\"mint-sequence-input__type-badge\">{{ TYPE_LABELS[resolvedType] }}</span>\n <div class=\"mint-sequence-input__tool-sep\" />\n <slot name=\"tools\" :sequence=\"modelValue || ''\" :type=\"resolvedType\" :stats=\"stats\">\n <button\n v-if=\"resolvedType !== 'protein'\"\n type=\"button\"\n class=\"mint-sequence-input__tool-btn\"\n :disabled=\"!modelValue || disabled\"\n @click=\"doReverseComplement\"\n >\n Rev Comp\n </button>\n <button\n type=\"button\"\n class=\"mint-sequence-input__tool-btn\"\n :disabled=\"!modelValue || disabled\"\n @click=\"doUppercase\"\n >\n Uppercase\n </button>\n <div class=\"mint-sequence-input__tool-sep\" />\n <button\n type=\"button\"\n class=\"mint-sequence-input__tool-btn\"\n :disabled=\"!modelValue || disabled\"\n @click=\"doCopy\"\n >\n Copy\n </button>\n <button\n type=\"button\"\n class=\"mint-sequence-input__tool-btn\"\n :disabled=\"!draft || disabled\"\n @click=\"doClear\"\n >\n Clear\n </button>\n </slot>\n </div>\n\n <!-- Editor (input mode) -->\n <div v-if=\"!readonly\" class=\"mint-sequence-input__editor\">\n <textarea\n :value=\"draft\"\n :rows=\"rows\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n class=\"mint-sequence-input__textarea\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n @input=\"handleInput\"\n />\n </div>\n\n <!-- Viewer (readonly mode) -->\n <div v-else class=\"mint-sequence-input__viewer\">\n <div\n v-for=\"(line, lineIdx) in viewerLines\"\n :key=\"lineIdx\"\n class=\"mint-sequence-input__viewer-line\"\n >\n <span class=\"mint-sequence-input__line-number\">{{ lineIdx * 60 + 1 }}</span>\n <span class=\"mint-sequence-input__line-content\">\n <span\n v-for=\"(char, charIdx) in line.split('')\"\n :key=\"charIdx\"\n :class=\"getBaseClass(char)\"\n >{{ char }}</span>\n </span>\n </div>\n <div v-if=\"!modelValue\" class=\"mint-sequence-input__viewer-line\">\n <span class=\"mint-sequence-input__line-number\" />\n <span class=\"mint-sequence-input__line-content\" style=\"color: var(--text-muted);\">No sequence</span>\n </div>\n </div>\n\n <!-- Stats and problems -->\n <div\n v-if=\"(showStats && modelValue) || problems.ambiguousBases || hasInvalid\"\n class=\"mint-sequence-input__stats\"\n >\n <template v-if=\"showStats && modelValue\">\n <span>\n <span class=\"mint-sequence-input__stat-label\">Length:</span>\n <span class=\"mint-sequence-input__stat-value\">{{ stats.length }}</span>\n </span>\n <span v-if=\"stats.gcPercent !== undefined\">\n <span class=\"mint-sequence-input__stat-label\">GC:</span>\n <span class=\"mint-sequence-input__stat-value\">{{ stats.gcPercent.toFixed(1) }}%</span>\n </span>\n <span v-if=\"stats.molecularWeight !== undefined\">\n <span class=\"mint-sequence-input__stat-label\">MW:</span>\n <span class=\"mint-sequence-input__stat-value\">~{{ (stats.molecularWeight / 1000).toFixed(1) }} kDa</span>\n </span>\n </template>\n <span v-if=\"problems.ambiguousBases\" class=\"mint-sequence-input__problem mint-sequence-input__problem--warning\">\n <svg class=\"mint-sequence-input__problem-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path class=\"mint-sequence-input__problem-shape\" d=\"M8 1.5l7 12.5H1z\" />\n <path class=\"mint-sequence-input__problem-mark\" d=\"M8 6v3.5M8 11.5v.01\" />\n </svg>\n {{ problems.ambiguousBases }} ambiguous bases (N)\n </span>\n <span v-if=\"hasInvalid\" role=\"alert\" class=\"mint-sequence-input__problem mint-sequence-input__problem--error\">\n <svg class=\"mint-sequence-input__problem-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <circle class=\"mint-sequence-input__problem-shape\" cx=\"8\" cy=\"8\" r=\"7\" />\n <path class=\"mint-sequence-input__problem-mark\" d=\"M8 4.5v4M8 11.5v.01\" />\n </svg>\n Invalid characters: {{ problems.invalidCharacters.join(' ') }}\n </span>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Interactive chemical structure editor powered by JSME, emitting SMILES strings for compound registration in experiment design. */\nimport { ref, computed, onMounted, onUnmounted, watch, nextTick } from 'vue'\nimport type { MoleculeData } from '../types'\n\ninterface Props {\n modelValue?: MoleculeData\n disabled?: boolean\n readonly?: boolean\n height?: number\n showSmiles?: boolean\n placeholder?: string\n error?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n disabled: false,\n readonly: false,\n height: 300,\n showSmiles: true,\n placeholder: 'Draw a chemical structure',\n error: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [data: MoleculeData | undefined]\n 'error': [message: string]\n}>()\n\n// State\nconst containerRef = ref<HTMLDivElement | null>(null)\nconst jsmeInstance = ref<unknown>(null)\nconst isLoading = ref(true)\nconst loadError = ref<string | null>(null)\nconst debounceTimer = ref<ReturnType<typeof setTimeout> | null>(null)\n\n// Computed\nconst hasStructure = computed(() => {\n return props.modelValue?.smiles && props.modelValue.smiles.length > 0\n})\n\n// Use window-level state to persist across component instances and hot-reloads\ninterface JSMEGlobalState {\n __jsmeCallbacks__?: Array<() => void>\n __jsmeLoading__?: boolean\n __jsmeLoaded__?: boolean\n __jsmeLoadPromise__?: Promise<void>\n JSApplet?: { JSME?: new (id: string, width: string, height: string, options?: object) => unknown }\n jsmeOnLoad?: () => void\n}\n\nfunction getJSMEState(): JSMEGlobalState {\n const win = window as unknown as JSMEGlobalState\n if (!win.__jsmeCallbacks__) {\n win.__jsmeCallbacks__ = []\n }\n return win\n}\n\nfunction waitForJSME(): Promise<void> {\n const win = getJSMEState()\n\n // Already loaded\n if (win.JSApplet?.JSME) {\n return Promise.resolve()\n }\n\n // Reuse existing promise if loading\n if (win.__jsmeLoadPromise__) {\n return win.__jsmeLoadPromise__\n }\n\n win.__jsmeLoadPromise__ = new Promise((resolve, reject) => {\n // Double-check after promise creation\n if (win.JSApplet?.JSME) {\n resolve()\n return\n }\n\n // Set up global callback FIRST (before checking for existing script)\n const originalOnLoad = win.jsmeOnLoad\n win.jsmeOnLoad = () => {\n win.__jsmeLoaded__ = true\n originalOnLoad?.()\n win.__jsmeCallbacks__?.forEach(cb => cb())\n win.__jsmeCallbacks__ = []\n resolve()\n }\n\n // Add to callback queue\n win.__jsmeCallbacks__?.push(resolve)\n\n // Drop a failed script and the cached promise so a later mount retries from scratch.\n const fail = (script: Element, message: string) => {\n if (!script.isConnected) return // already failed (timeout, then a late error)\n win.__jsmeLoading__ = false\n win.__jsmeLoadPromise__ = undefined\n script.remove()\n reject(new Error(message))\n }\n\n // Check if script already exists\n const existingScript = document.querySelector('script[data-jsme]')\n if (existingScript) {\n // Script exists, poll for JSApplet.JSME (in case jsmeOnLoad already fired)\n const checkReady = setInterval(() => {\n if (win.JSApplet?.JSME) {\n clearInterval(checkReady)\n win.__jsmeLoaded__ = true\n win.__jsmeCallbacks__?.forEach(cb => cb())\n win.__jsmeCallbacks__ = []\n resolve()\n }\n }, 100)\n\n setTimeout(() => {\n clearInterval(checkReady)\n if (!win.__jsmeLoaded__ && !win.JSApplet?.JSME) {\n fail(existingScript, 'JSME initialization timeout')\n }\n }, 15000)\n return\n }\n\n // Load the script\n win.__jsmeLoading__ = true\n const script = document.createElement('script')\n script.src = 'https://jsme-editor.github.io/dist/jsme/jsme.nocache.js'\n script.integrity = 'sha384-l6tNzsc/eAJ7uql0dGAcHYI5ANVEV7DrJYjzXp3t13L+3OzLnfpzJO0Uio7mUSjY'\n script.crossOrigin = 'anonymous'\n script.async = true\n script.setAttribute('data-jsme', 'true')\n\n script.onerror = () => fail(script, 'Failed to load JSME script')\n\n // Timeout\n setTimeout(() => {\n if (!win.__jsmeLoaded__ && !win.JSApplet?.JSME) {\n fail(script, 'JSME initialization timeout')\n }\n }, 15000)\n\n document.head.appendChild(script)\n })\n\n return win.__jsmeLoadPromise__\n}\n\n// Wait for the browser to complete a paint cycle\nfunction waitForPaint(): Promise<void> {\n return new Promise(resolve => {\n requestAnimationFrame(() => requestAnimationFrame(() => resolve()))\n })\n}\n\n// JSME initialization — two phases:\n// 1. Load the script (no DOM needed)\n// 2. Reveal the editor div, wait for paint, then mount JSME with explicit px dimensions\nasync function initJSME() {\n if (props.readonly) return\n\n try {\n isLoading.value = true\n loadError.value = null\n\n // Phase 1: load the JSME script (independent of DOM)\n await waitForJSME()\n\n const win = getJSMEState()\n if (!win.JSApplet?.JSME) {\n throw new Error('JSME library not available after loading')\n }\n\n // Phase 2: reveal the editor div by clearing the loading state\n isLoading.value = false\n await nextTick()\n\n if (!containerRef.value) return\n\n // Wait for a full paint cycle so GWT can measure the container\n await waitForPaint()\n\n if (!containerRef.value) return\n\n // Use explicit pixel width — GWT cannot resolve percentage widths reliably\n const rect = containerRef.value.getBoundingClientRect()\n const width = Math.floor(rect.width) || 400\n\n // Mount JSME into the now-painted container\n const editorId = `jsme-${Date.now()}`\n containerRef.value.id = editorId\n\n const instance = new win.JSApplet.JSME(\n editorId,\n `${width}px`,\n `${props.height}px`,\n {\n options: 'query,hydrogens,paste',\n }\n )\n\n jsmeInstance.value = instance\n\n // Set initial value if provided\n if (props.modelValue?.molfile) {\n (instance as { readMolFile: (mol: string) => void }).readMolFile(props.modelValue.molfile)\n }\n\n // Set up change callback\n (instance as { setCallBack: (event: string, callback: () => void) => void }).setCallBack('AfterStructureModified', handleStructureChange)\n } catch (err) {\n const message = err instanceof Error ? err.message : 'Failed to load molecule editor'\n loadError.value = message\n emit('error', message)\n isLoading.value = false\n }\n}\n\nfunction handleStructureChange() {\n // Debounce the change event\n if (debounceTimer.value) {\n clearTimeout(debounceTimer.value)\n }\n\n debounceTimer.value = setTimeout(() => {\n if (!jsmeInstance.value) return\n\n const instance = jsmeInstance.value as {\n smiles: () => string\n molFile: () => string\n }\n\n const smiles = instance.smiles()\n const molfile = instance.molFile()\n\n if (!smiles || smiles.length === 0) {\n emit('update:modelValue', undefined)\n } else {\n emit('update:modelValue', { smiles, molfile })\n }\n }, 300)\n}\n\nfunction clearStructure() {\n if (jsmeInstance.value) {\n (jsmeInstance.value as { reset: () => void }).reset()\n }\n emit('update:modelValue', undefined)\n}\n\n// Watch for external value changes\nwatch(() => props.modelValue, (newValue) => {\n if (!jsmeInstance.value) return\n\n const instance = jsmeInstance.value as {\n smiles: () => string\n readMolFile: (mol: string) => void\n reset: () => void\n }\n\n // Only update if the external value differs from current\n const currentSmiles = instance.smiles()\n if (newValue?.smiles !== currentSmiles) {\n if (newValue?.molfile) {\n instance.readMolFile(newValue.molfile)\n } else {\n instance.reset()\n }\n }\n})\n\n// Lifecycle\nonMounted(() => {\n if (!props.readonly) {\n initJSME()\n } else {\n isLoading.value = false\n }\n})\n\nonUnmounted(() => {\n if (debounceTimer.value) {\n clearTimeout(debounceTimer.value)\n }\n jsmeInstance.value = null\n})\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-molecule-input',\n disabled ? 'mint-molecule-input--disabled' : '',\n readonly ? 'mint-molecule-input--readonly' : '',\n error ? 'mint-molecule-input--error' : '',\n ]\"\n >\n <!-- Loading state -->\n <div\n v-if=\"isLoading && !readonly\"\n class=\"mint-molecule-input__skeleton\"\n :style=\"{ height: `${height}px` }\"\n >\n <svg\n class=\"mint-molecule-input__skeleton-icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z\"\n />\n </svg>\n <span class=\"mint-molecule-input__skeleton-text\">Loading molecule editor...</span>\n </div>\n\n <!-- Error state -->\n <div\n v-else-if=\"loadError\"\n class=\"mint-molecule-input__error\"\n >\n <svg\n class=\"mint-molecule-input__error-icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\"\n />\n </svg>\n {{ loadError }}\n </div>\n\n <!-- Readonly mode - show empty or placeholder -->\n <template v-else-if=\"readonly\">\n <div\n v-if=\"hasStructure\"\n class=\"mint-molecule-input__readonly\"\n :style=\"{ height: `${height}px` }\"\n >\n <!-- In readonly mode, we just display a placeholder since we don't have SVG rendering -->\n <div class=\"mint-molecule-input__empty\">\n <svg\n class=\"mint-molecule-input__empty-icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z\"\n />\n </svg>\n <span class=\"mint-molecule-input__empty-text\">Structure defined (readonly)</span>\n </div>\n </div>\n <div\n v-else\n class=\"mint-molecule-input__empty\"\n :style=\"{ height: `${height}px` }\"\n >\n <svg\n class=\"mint-molecule-input__empty-icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z\"\n />\n </svg>\n <span class=\"mint-molecule-input__empty-text\">No structure</span>\n </div>\n </template>\n\n <!-- Editor mode -->\n <template v-else>\n <div\n ref=\"containerRef\"\n class=\"mint-molecule-input__editor\"\n :style=\"{ height: `${height}px` }\"\n role=\"application\"\n aria-label=\"Molecule structure editor\"\n />\n\n <!-- Actions toolbar -->\n <div class=\"mint-molecule-input__actions\">\n <button\n type=\"button\"\n class=\"mint-molecule-input__action-btn\"\n :disabled=\"!hasStructure || disabled\"\n aria-label=\"Clear structure\"\n @click=\"clearStructure\"\n >\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16\" />\n </svg>\n </button>\n </div>\n </template>\n\n <!-- SMILES display -->\n <div\n v-if=\"showSmiles && hasStructure && !loadError\"\n class=\"mint-molecule-input__smiles\"\n >\n <span class=\"mint-molecule-input__smiles-label\">SMILES:</span>\n {{ modelValue?.smiles }}\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Interactive chemical structure editor powered by JSME, emitting SMILES strings for compound registration in experiment design. */\nimport { ref, computed, onMounted, onUnmounted, watch, nextTick } from 'vue'\nimport type { MoleculeData } from '../types'\n\ninterface Props {\n modelValue?: MoleculeData\n disabled?: boolean\n readonly?: boolean\n height?: number\n showSmiles?: boolean\n placeholder?: string\n error?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n disabled: false,\n readonly: false,\n height: 300,\n showSmiles: true,\n placeholder: 'Draw a chemical structure',\n error: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [data: MoleculeData | undefined]\n 'error': [message: string]\n}>()\n\n// State\nconst containerRef = ref<HTMLDivElement | null>(null)\nconst jsmeInstance = ref<unknown>(null)\nconst isLoading = ref(true)\nconst loadError = ref<string | null>(null)\nconst debounceTimer = ref<ReturnType<typeof setTimeout> | null>(null)\n\n// Computed\nconst hasStructure = computed(() => {\n return props.modelValue?.smiles && props.modelValue.smiles.length > 0\n})\n\n// Use window-level state to persist across component instances and hot-reloads\ninterface JSMEGlobalState {\n __jsmeCallbacks__?: Array<() => void>\n __jsmeLoading__?: boolean\n __jsmeLoaded__?: boolean\n __jsmeLoadPromise__?: Promise<void>\n JSApplet?: { JSME?: new (id: string, width: string, height: string, options?: object) => unknown }\n jsmeOnLoad?: () => void\n}\n\nfunction getJSMEState(): JSMEGlobalState {\n const win = window as unknown as JSMEGlobalState\n if (!win.__jsmeCallbacks__) {\n win.__jsmeCallbacks__ = []\n }\n return win\n}\n\nfunction waitForJSME(): Promise<void> {\n const win = getJSMEState()\n\n // Already loaded\n if (win.JSApplet?.JSME) {\n return Promise.resolve()\n }\n\n // Reuse existing promise if loading\n if (win.__jsmeLoadPromise__) {\n return win.__jsmeLoadPromise__\n }\n\n win.__jsmeLoadPromise__ = new Promise((resolve, reject) => {\n // Double-check after promise creation\n if (win.JSApplet?.JSME) {\n resolve()\n return\n }\n\n // Set up global callback FIRST (before checking for existing script)\n const originalOnLoad = win.jsmeOnLoad\n win.jsmeOnLoad = () => {\n win.__jsmeLoaded__ = true\n originalOnLoad?.()\n win.__jsmeCallbacks__?.forEach(cb => cb())\n win.__jsmeCallbacks__ = []\n resolve()\n }\n\n // Add to callback queue\n win.__jsmeCallbacks__?.push(resolve)\n\n // Drop a failed script and the cached promise so a later mount retries from scratch.\n const fail = (script: Element, message: string) => {\n if (!script.isConnected) return // already failed (timeout, then a late error)\n win.__jsmeLoading__ = false\n win.__jsmeLoadPromise__ = undefined\n script.remove()\n reject(new Error(message))\n }\n\n // Check if script already exists\n const existingScript = document.querySelector('script[data-jsme]')\n if (existingScript) {\n // Script exists, poll for JSApplet.JSME (in case jsmeOnLoad already fired)\n const checkReady = setInterval(() => {\n if (win.JSApplet?.JSME) {\n clearInterval(checkReady)\n win.__jsmeLoaded__ = true\n win.__jsmeCallbacks__?.forEach(cb => cb())\n win.__jsmeCallbacks__ = []\n resolve()\n }\n }, 100)\n\n setTimeout(() => {\n clearInterval(checkReady)\n if (!win.__jsmeLoaded__ && !win.JSApplet?.JSME) {\n fail(existingScript, 'JSME initialization timeout')\n }\n }, 15000)\n return\n }\n\n // Load the script\n win.__jsmeLoading__ = true\n const script = document.createElement('script')\n script.src = 'https://jsme-editor.github.io/dist/jsme/jsme.nocache.js'\n script.integrity = 'sha384-l6tNzsc/eAJ7uql0dGAcHYI5ANVEV7DrJYjzXp3t13L+3OzLnfpzJO0Uio7mUSjY'\n script.crossOrigin = 'anonymous'\n script.async = true\n script.setAttribute('data-jsme', 'true')\n\n script.onerror = () => fail(script, 'Failed to load JSME script')\n\n // Timeout\n setTimeout(() => {\n if (!win.__jsmeLoaded__ && !win.JSApplet?.JSME) {\n fail(script, 'JSME initialization timeout')\n }\n }, 15000)\n\n document.head.appendChild(script)\n })\n\n return win.__jsmeLoadPromise__\n}\n\n// Wait for the browser to complete a paint cycle\nfunction waitForPaint(): Promise<void> {\n return new Promise(resolve => {\n requestAnimationFrame(() => requestAnimationFrame(() => resolve()))\n })\n}\n\n// JSME initialization — two phases:\n// 1. Load the script (no DOM needed)\n// 2. Reveal the editor div, wait for paint, then mount JSME with explicit px dimensions\nasync function initJSME() {\n if (props.readonly) return\n\n try {\n isLoading.value = true\n loadError.value = null\n\n // Phase 1: load the JSME script (independent of DOM)\n await waitForJSME()\n\n const win = getJSMEState()\n if (!win.JSApplet?.JSME) {\n throw new Error('JSME library not available after loading')\n }\n\n // Phase 2: reveal the editor div by clearing the loading state\n isLoading.value = false\n await nextTick()\n\n if (!containerRef.value) return\n\n // Wait for a full paint cycle so GWT can measure the container\n await waitForPaint()\n\n if (!containerRef.value) return\n\n // Use explicit pixel width — GWT cannot resolve percentage widths reliably\n const rect = containerRef.value.getBoundingClientRect()\n const width = Math.floor(rect.width) || 400\n\n // Mount JSME into the now-painted container\n const editorId = `jsme-${Date.now()}`\n containerRef.value.id = editorId\n\n const instance = new win.JSApplet.JSME(\n editorId,\n `${width}px`,\n `${props.height}px`,\n {\n options: 'query,hydrogens,paste',\n }\n )\n\n jsmeInstance.value = instance\n\n // Set initial value if provided\n if (props.modelValue?.molfile) {\n (instance as { readMolFile: (mol: string) => void }).readMolFile(props.modelValue.molfile)\n }\n\n // Set up change callback\n (instance as { setCallBack: (event: string, callback: () => void) => void }).setCallBack('AfterStructureModified', handleStructureChange)\n } catch (err) {\n const message = err instanceof Error ? err.message : 'Failed to load molecule editor'\n loadError.value = message\n emit('error', message)\n isLoading.value = false\n }\n}\n\nfunction handleStructureChange() {\n // Debounce the change event\n if (debounceTimer.value) {\n clearTimeout(debounceTimer.value)\n }\n\n debounceTimer.value = setTimeout(() => {\n if (!jsmeInstance.value) return\n\n const instance = jsmeInstance.value as {\n smiles: () => string\n molFile: () => string\n }\n\n const smiles = instance.smiles()\n const molfile = instance.molFile()\n\n if (!smiles || smiles.length === 0) {\n emit('update:modelValue', undefined)\n } else {\n emit('update:modelValue', { smiles, molfile })\n }\n }, 300)\n}\n\nfunction clearStructure() {\n if (jsmeInstance.value) {\n (jsmeInstance.value as { reset: () => void }).reset()\n }\n emit('update:modelValue', undefined)\n}\n\n// Watch for external value changes\nwatch(() => props.modelValue, (newValue) => {\n if (!jsmeInstance.value) return\n\n const instance = jsmeInstance.value as {\n smiles: () => string\n readMolFile: (mol: string) => void\n reset: () => void\n }\n\n // Only update if the external value differs from current\n const currentSmiles = instance.smiles()\n if (newValue?.smiles !== currentSmiles) {\n if (newValue?.molfile) {\n instance.readMolFile(newValue.molfile)\n } else {\n instance.reset()\n }\n }\n})\n\n// Lifecycle\nonMounted(() => {\n if (!props.readonly) {\n initJSME()\n } else {\n isLoading.value = false\n }\n})\n\nonUnmounted(() => {\n if (debounceTimer.value) {\n clearTimeout(debounceTimer.value)\n }\n jsmeInstance.value = null\n})\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-molecule-input',\n disabled ? 'mint-molecule-input--disabled' : '',\n readonly ? 'mint-molecule-input--readonly' : '',\n error ? 'mint-molecule-input--error' : '',\n ]\"\n >\n <!-- Loading state -->\n <div\n v-if=\"isLoading && !readonly\"\n class=\"mint-molecule-input__skeleton\"\n :style=\"{ height: `${height}px` }\"\n >\n <svg\n class=\"mint-molecule-input__skeleton-icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z\"\n />\n </svg>\n <span class=\"mint-molecule-input__skeleton-text\">Loading molecule editor...</span>\n </div>\n\n <!-- Error state -->\n <div\n v-else-if=\"loadError\"\n class=\"mint-molecule-input__error\"\n >\n <svg\n class=\"mint-molecule-input__error-icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\"\n />\n </svg>\n {{ loadError }}\n </div>\n\n <!-- Readonly mode - show empty or placeholder -->\n <template v-else-if=\"readonly\">\n <div\n v-if=\"hasStructure\"\n class=\"mint-molecule-input__readonly\"\n :style=\"{ height: `${height}px` }\"\n >\n <!-- In readonly mode, we just display a placeholder since we don't have SVG rendering -->\n <div class=\"mint-molecule-input__empty\">\n <svg\n class=\"mint-molecule-input__empty-icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z\"\n />\n </svg>\n <span class=\"mint-molecule-input__empty-text\">Structure defined (readonly)</span>\n </div>\n </div>\n <div\n v-else\n class=\"mint-molecule-input__empty\"\n :style=\"{ height: `${height}px` }\"\n >\n <svg\n class=\"mint-molecule-input__empty-icon\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z\"\n />\n </svg>\n <span class=\"mint-molecule-input__empty-text\">No structure</span>\n </div>\n </template>\n\n <!-- Editor mode -->\n <template v-else>\n <div\n ref=\"containerRef\"\n class=\"mint-molecule-input__editor\"\n :style=\"{ height: `${height}px` }\"\n role=\"application\"\n aria-label=\"Molecule structure editor\"\n />\n\n <!-- Actions toolbar -->\n <div class=\"mint-molecule-input__actions\">\n <button\n type=\"button\"\n class=\"mint-molecule-input__action-btn\"\n :disabled=\"!hasStructure || disabled\"\n aria-label=\"Clear structure\"\n @click=\"clearStructure\"\n >\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16\" />\n </svg>\n </button>\n </div>\n </template>\n\n <!-- SMILES display -->\n <div\n v-if=\"showSmiles && hasStructure && !loadError\"\n class=\"mint-molecule-input__smiles\"\n >\n <span class=\"mint-molecule-input__smiles-label\">SMILES:</span>\n {{ modelValue?.smiles }}\n </div>\n </div>\n</template>\n","import { computed, type ComputedRef } from 'vue'\n\n// Concentration unit types\nexport type MolarityUnit = 'pM' | 'nM' | 'µM' | 'mM' | 'M'\nexport type MassVolumeUnit = 'pg/mL' | 'ng/mL' | 'µg/mL' | 'mg/mL' | 'g/mL'\nexport type PercentageUnit = '% v/v' | '% w/v' | '% w/w'\nexport type ConcentrationUnit = MolarityUnit | MassVolumeUnit | PercentageUnit | string\n\nexport interface ConcentrationValue {\n value: number\n unit: ConcentrationUnit\n}\n\nexport interface UnitCategory {\n label: string\n units: ConcentrationUnit[]\n}\n\nexport interface UseConcentrationUnitsReturn {\n unitCategories: ComputedRef<UnitCategory[]>\n molarityUnits: MolarityUnit[]\n massVolumeUnits: MassVolumeUnit[]\n percentageUnits: PercentageUnit[]\n convert: (value: number, from: ConcentrationUnit, to: ConcentrationUnit, mw?: number) => number | null\n formatWithUnit: (concentration: ConcentrationValue, precision?: number) => string\n parseConcentration: (input: string) => ConcentrationValue | null\n getBaseUnit: (unit: ConcentrationUnit) => ConcentrationUnit\n getConversionHint: (concentration: ConcentrationValue) => string | null\n isMolarity: (unit: ConcentrationUnit) => boolean\n isMassVolume: (unit: ConcentrationUnit) => boolean\n isPercentage: (unit: ConcentrationUnit) => boolean\n}\n\n// Conversion factors to base unit (M for molarity, g/mL for mass/volume)\nconst MOLARITY_FACTORS: Record<MolarityUnit, number> = {\n 'pM': 1e-12,\n 'nM': 1e-9,\n 'µM': 1e-6,\n 'mM': 1e-3,\n 'M': 1,\n}\n\nconst MASS_VOLUME_FACTORS: Record<MassVolumeUnit, number> = {\n 'pg/mL': 1e-12,\n 'ng/mL': 1e-9,\n 'µg/mL': 1e-6,\n 'mg/mL': 1e-3,\n 'g/mL': 1,\n}\n\n// Percentage conversion factors (for potential future use)\n// const PERCENTAGE_FACTORS: Record<PercentageUnit, number> = {\n// '% v/v': 0.01,\n// '% w/v': 0.01,\n// '% w/w': 0.01,\n// }\n\nconst MOLARITY_UNITS: MolarityUnit[] = ['pM', 'nM', 'µM', 'mM', 'M']\nconst MASS_VOLUME_UNITS: MassVolumeUnit[] = ['pg/mL', 'ng/mL', 'µg/mL', 'mg/mL', 'g/mL']\nconst PERCENTAGE_UNITS: PercentageUnit[] = ['% v/v', '% w/v', '% w/w']\n\n/** Converts between molarity, mass/volume, and percentage concentration units with formatting helpers. */\nexport function useConcentrationUnits(): UseConcentrationUnitsReturn {\n const unitCategories = computed<UnitCategory[]>(() => [\n { label: 'Molarity', units: MOLARITY_UNITS },\n { label: 'Mass/Volume', units: MASS_VOLUME_UNITS },\n { label: 'Percentage', units: PERCENTAGE_UNITS },\n ])\n\n function isMolarity(unit: ConcentrationUnit): unit is MolarityUnit {\n return MOLARITY_UNITS.includes(unit as MolarityUnit)\n }\n\n function isMassVolume(unit: ConcentrationUnit): unit is MassVolumeUnit {\n return MASS_VOLUME_UNITS.includes(unit as MassVolumeUnit)\n }\n\n function isPercentage(unit: ConcentrationUnit): unit is PercentageUnit {\n return PERCENTAGE_UNITS.includes(unit as PercentageUnit)\n }\n\n function getBaseUnit(unit: ConcentrationUnit): ConcentrationUnit {\n if (isMolarity(unit)) return 'M'\n if (isMassVolume(unit)) return 'g/mL'\n if (isPercentage(unit)) return '% w/v'\n return unit\n }\n\n function convert(\n value: number,\n from: ConcentrationUnit,\n to: ConcentrationUnit,\n mw?: number\n ): number | null {\n if (from === to) return value\n if (value === 0) return 0\n\n // Same category conversion\n if (isMolarity(from) && isMolarity(to)) {\n const baseValue = value * MOLARITY_FACTORS[from]\n return baseValue / MOLARITY_FACTORS[to]\n }\n\n if (isMassVolume(from) && isMassVolume(to)) {\n const baseValue = value * MASS_VOLUME_FACTORS[from]\n return baseValue / MASS_VOLUME_FACTORS[to]\n }\n\n if (isPercentage(from) && isPercentage(to)) {\n // Percentage conversions within same category are direct\n return value\n }\n\n // Cross-category conversion (requires molecular weight)\n if (mw && mw > 0) {\n // Molarity to Mass/Volume\n if (isMolarity(from) && isMassVolume(to)) {\n // Convert to M, then to g/mL using MW, then to target unit\n const molarConc = value * MOLARITY_FACTORS[from]\n const massConc = molarConc * mw // g/mL (MW in g/mol, concentration in mol/L = g/L)\n return massConc / MASS_VOLUME_FACTORS[to]\n }\n\n // Mass/Volume to Molarity\n if (isMassVolume(from) && isMolarity(to)) {\n // Convert to g/mL, then to M using MW, then to target unit\n const massConc = value * MASS_VOLUME_FACTORS[from]\n const molarConc = massConc / mw // M (g/mL / g/mol = mol/L)\n return molarConc / MOLARITY_FACTORS[to]\n }\n }\n\n return null // Cannot convert without MW or between incompatible units\n }\n\n function formatWithUnit(concentration: ConcentrationValue, precision: number = 3): string {\n const { value, unit } = concentration\n if (value === 0) return `0 ${unit}`\n\n // Use appropriate precision based on value magnitude\n let formattedValue: string\n if (Math.abs(value) >= 1000) {\n formattedValue = value.toExponential(precision - 1)\n } else if (Math.abs(value) < 0.001) {\n formattedValue = value.toExponential(precision - 1)\n } else {\n formattedValue = value.toPrecision(precision)\n }\n\n // Remove trailing zeros after decimal point\n formattedValue = formattedValue.replace(/\\.?0+$/, '')\n formattedValue = formattedValue.replace(/\\.?0+e/, 'e')\n\n return `${formattedValue} ${unit}`\n }\n\n function parseConcentration(input: string): ConcentrationValue | null {\n const trimmed = input.trim()\n if (!trimmed) return null\n\n // Match number followed by optional unit\n const match = trimmed.match(/^([-+]?\\d*\\.?\\d+(?:[eE][-+]?\\d+)?)\\s*(.*)$/)\n if (!match) return null\n\n const value = parseFloat(match[1])\n if (isNaN(value)) return null\n\n let unit = match[2].trim()\n if (!unit) {\n return null // Unit is required\n }\n\n // Normalize common variations\n unit = unit\n .replace(/uM/i, 'µM')\n .replace(/um/i, 'µM')\n .replace(/ug\\/ml/i, 'µg/mL')\n .replace(/ng\\/ml/i, 'ng/mL')\n .replace(/mg\\/ml/i, 'mg/mL')\n .replace(/pg\\/ml/i, 'pg/mL')\n .replace(/g\\/ml/i, 'g/mL')\n\n return { value, unit }\n }\n\n function getConversionHint(concentration: ConcentrationValue): string | null {\n const { value, unit } = concentration\n if (value === 0) return null\n\n // Find adjacent unit for conversion hint\n if (isMolarity(unit)) {\n const index = MOLARITY_UNITS.indexOf(unit)\n // If value is large, suggest next higher unit\n if (value >= 1000 && index < MOLARITY_UNITS.length - 1) {\n const nextUnit = MOLARITY_UNITS[index + 1]\n const converted = convert(value, unit, nextUnit)\n if (converted !== null) {\n return formatWithUnit({ value: converted, unit: nextUnit })\n }\n }\n // If value is small, suggest next lower unit\n if (value < 1 && index > 0) {\n const prevUnit = MOLARITY_UNITS[index - 1]\n const converted = convert(value, unit, prevUnit)\n if (converted !== null) {\n return formatWithUnit({ value: converted, unit: prevUnit })\n }\n }\n }\n\n if (isMassVolume(unit)) {\n const index = MASS_VOLUME_UNITS.indexOf(unit)\n if (value >= 1000 && index < MASS_VOLUME_UNITS.length - 1) {\n const nextUnit = MASS_VOLUME_UNITS[index + 1]\n const converted = convert(value, unit, nextUnit)\n if (converted !== null) {\n return formatWithUnit({ value: converted, unit: nextUnit })\n }\n }\n if (value < 1 && index > 0) {\n const prevUnit = MASS_VOLUME_UNITS[index - 1]\n const converted = convert(value, unit, prevUnit)\n if (converted !== null) {\n return formatWithUnit({ value: converted, unit: prevUnit })\n }\n }\n }\n\n return null\n }\n\n return {\n unitCategories,\n molarityUnits: MOLARITY_UNITS,\n massVolumeUnits: MASS_VOLUME_UNITS,\n percentageUnits: PERCENTAGE_UNITS,\n convert,\n formatWithUnit,\n parseConcentration,\n getBaseUnit,\n getConversionHint,\n isMolarity,\n isMassVolume,\n isPercentage,\n }\n}\n","<script setup lang=\"ts\">\n/**\n * Numeric input with a unit segment. Several units open a menu that previews the value in each\n * unit; units with a `factor` also get a hint in the neighbour unit nearest to 1–1000.\n */\nimport { computePosition, flip, offset, shift } from '@floating-ui/dom'\nimport { computed, nextTick, ref, useTemplateRef, watch } from 'vue'\nimport { useDropdownState } from '../composables/useDropdownState'\nimport { useMenuKeyboard } from '../composables/useMenuKeyboard'\nimport type { UnitOption } from '../types'\n\ninterface Props {\n modelValue?: number\n unit?: string\n units: UnitOption[]\n precision?: number\n min?: number\n max?: number\n step?: number\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n convertOnUnitChange?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n precision: undefined,\n step: undefined,\n placeholder: 'Enter value',\n disabled: false,\n error: false,\n size: 'md',\n convertOnUnitChange: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: number | undefined]\n 'update:unit': [unit: string]\n 'change': [data: { value: number | undefined; unit: string }]\n}>()\n\nconst currentUnit = computed(() => props.unit || (props.units.length > 0 ? props.units[0].value : ''))\nconst currentOption = computed(() => findUnit(currentUnit.value))\nconst selectable = computed(() => props.units.length > 1)\n\n/** Menu rows: ungrouped units first, then one labelled block per group. */\nconst menuSections = computed(() => {\n const sections = new Map<string, UnitOption[]>()\n for (const u of props.units) {\n const key = u.group ?? ''\n sections.set(key, [...(sections.get(key) ?? []), u])\n }\n return [...sections].map(([label, units]) => ({ label, units }))\n .sort((a, b) => Number(a.label !== '') - Number(b.label !== ''))\n})\n\nfunction findUnit(value: string): UnitOption | undefined {\n return props.units.find(u => u.value === value)\n}\n\nfunction roundToPrecision(value: number): number {\n if (props.precision === undefined) return value\n const factor = Math.pow(10, props.precision)\n return Math.round(value * factor) / factor\n}\n\nfunction clamp(value: number): number {\n let result = value\n if (props.min !== undefined && result < props.min) result = props.min\n if (props.max !== undefined && result > props.max) result = props.max\n return result\n}\n\n/** 4 significant digits; exponent form outside 1e-3 … 1e6. */\nfunction formatNumber(value: number): string {\n const abs = Math.abs(value)\n if (abs !== 0 && (abs >= 1e6 || abs < 1e-3)) return value.toExponential(2)\n return String(parseFloat(value.toPrecision(4)))\n}\n\n/** The current value in `target`; null without factors or across unit groups (M vs mg/mL). */\nfunction convertTo(target: UnitOption): number | null {\n const current = currentOption.value\n if (props.modelValue === undefined || current?.factor === undefined || !target.factor) return null\n if (target.group !== current.group) return null\n return props.modelValue * current.factor / target.factor\n}\n\nfunction preview(target: UnitOption): string {\n const converted = convertTo(target)\n return converted === null ? '' : formatNumber(converted)\n}\n\n/** Log distance of |value| from the 1–1000 window (0 inside it). */\nfunction distanceFromReadable(value: number): number {\n const exp = Math.log10(Math.abs(value))\n return exp < 0 ? -exp : Math.max(0, exp - 3)\n}\n\nconst conversionHint = computed(() => {\n const current = currentOption.value\n if (!props.modelValue || current?.factor === undefined) return null\n const scale = props.units\n .filter(u => u.factor !== undefined && u.group === current.group)\n .sort((a, b) => a.factor! - b.factor!)\n const index = scale.indexOf(current)\n let best: { unit: UnitOption; value: number } | null = null\n for (const neighbour of [scale[index + 1], scale[index - 1]]) {\n const value = neighbour && convertTo(neighbour)\n if (!value) continue\n if (!best || distanceFromReadable(value) < distanceFromReadable(best.value)) best = { unit: neighbour, value }\n }\n return best && `${formatNumber(best.value)} ${best.unit.label}`\n})\n\nfunction handleValueInput(event: Event) {\n const target = event.target as HTMLInputElement\n const value = target.value === '' ? undefined : Number(target.value)\n\n if (value === undefined || isNaN(value)) {\n emit('update:modelValue', undefined)\n emit('change', { value: undefined, unit: currentUnit.value })\n return\n }\n\n const clamped = clamp(value)\n emit('update:modelValue', clamped)\n emit('change', { value: clamped, unit: currentUnit.value })\n}\n\nfunction selectUnit(newUnitValue: string) {\n close(true)\n if (newUnitValue === currentUnit.value) return\n\n let newValue = props.modelValue\n if (props.convertOnUnitChange && newValue !== undefined) {\n const oldUnit = currentOption.value\n const newUnit = findUnit(newUnitValue)\n if (oldUnit?.factor !== undefined && newUnit?.factor !== undefined && newUnit.factor !== 0) {\n newValue = clamp(roundToPrecision(newValue * (oldUnit.factor / newUnit.factor)))\n emit('update:modelValue', newValue)\n }\n }\n\n emit('update:unit', newUnitValue)\n emit('change', { value: newValue, unit: newUnitValue })\n}\n\n// ---- Unit menu (disclosure + WAI-ARIA keyboard, shared with ActionMenu) ----\nconst menuRef = ref<HTMLElement | null>(null)\n// Transparent (not visibility:hidden) until placed, so the open-time focus can land on an option.\nconst menuStyle = ref<Record<string, string>>({ opacity: '0' })\nconst { isOpen, rootRef, open, close } = useDropdownState({\n triggerRef: useTemplateRef<HTMLElement>('trigger'),\n closeOnScroll: true,\n insideRefs: [menuRef],\n onOpen: () => { menuStyle.value = { opacity: '0' } },\n})\n\n/** Teleported + fixed like ActionMenu, so overflow:hidden/auto ancestors never clip the menu. */\nwatch(isOpen, async (opened) => {\n if (!opened) return\n await nextTick()\n if (!rootRef.value || !menuRef.value) return\n const { x, y } = await computePosition(rootRef.value, menuRef.value, {\n placement: 'bottom-end',\n strategy: 'fixed',\n middleware: [offset(4), flip(), shift({ padding: 8 })],\n })\n menuStyle.value = { left: `${x}px`, top: `${y}px` }\n})\n\nfunction menuItems(): HTMLElement[] {\n return menuRef.value ? Array.from(menuRef.value.querySelectorAll<HTMLElement>('[role=\"option\"]')) : []\n}\n\nfunction openMenu(focusSelected = true) {\n if (props.disabled || !selectable.value) return\n open()\n if (focusSelected) {\n void nextTick(() => (menuItems().find(el => el.getAttribute('aria-selected') === 'true') ?? menuItems()[0])?.focus())\n }\n}\n\nfunction toggleMenu() {\n if (isOpen.value) close()\n else openMenu()\n}\n\nconst { handleTriggerKeydown, handlePanelKeydown } = useMenuKeyboard({\n items: menuItems,\n isOpen: () => isOpen.value,\n open: () => openMenu(false),\n close,\n})\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-unit-input',\n error ? 'mint-unit-input--error' : '',\n disabled ? 'mint-unit-input--disabled' : '',\n ]\"\n >\n <div ref=\"rootRef\" class=\"mint-unit-input__field\">\n <div :class=\"['mint-unit-input__controls', `mint-unit-input__controls--${size}`]\">\n <input\n type=\"number\"\n :value=\"modelValue\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :aria-invalid=\"error || undefined\"\n :class=\"[\n 'mint-unit-input__value',\n `mint-unit-input__value--${size}`,\n disabled ? 'mint-unit-input__value--disabled' : '',\n ]\"\n aria-label=\"Value\"\n @input=\"handleValueInput\"\n />\n\n <button\n v-if=\"selectable\"\n ref=\"trigger\"\n type=\"button\"\n :class=\"['mint-unit-input__unit', { 'mint-unit-input__unit--open': isOpen }]\"\n :disabled=\"disabled\"\n aria-haspopup=\"listbox\"\n :aria-expanded=\"isOpen\"\n :aria-label=\"`Unit: ${currentOption?.label ?? currentUnit}`\"\n @click=\"toggleMenu\"\n @keydown=\"handleTriggerKeydown\"\n >\n {{ currentOption?.label ?? currentUnit }}\n <svg class=\"mint-unit-input__chevron\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <path d=\"M4 6l4 4 4-4\" />\n </svg>\n </button>\n <span v-else class=\"mint-unit-input__unit\">{{ currentOption?.label ?? currentUnit }}</span>\n </div>\n\n </div>\n\n <Teleport to=\"body\">\n <div\n v-if=\"isOpen\"\n ref=\"menuRef\"\n class=\"mint-popover mint-unit-input__menu\"\n :style=\"menuStyle\"\n role=\"listbox\"\n aria-label=\"Unit\"\n @keydown=\"handlePanelKeydown\"\n >\n <template v-for=\"section in menuSections\" :key=\"section.label\">\n <div v-if=\"section.label\" class=\"mint-unit-input__menu-group\" role=\"presentation\">{{ section.label }}</div>\n <button\n v-for=\"u in section.units\"\n :key=\"u.value\"\n type=\"button\"\n role=\"option\"\n :aria-selected=\"u.value === currentUnit\"\n :class=\"['mint-menu-item', { 'mint-menu-item--selected': u.value === currentUnit }]\"\n @click=\"selectUnit(u.value)\"\n >\n <span class=\"mint-menu-item__text\"><span class=\"mint-menu-item__label\">{{ u.label }}</span></span>\n <span v-if=\"preview(u)\" class=\"mint-menu-item__meta\">{{ preview(u) }}</span>\n </button>\n </template>\n </div>\n </Teleport>\n\n <div v-if=\"conversionHint\" class=\"mint-unit-input__hint\">≈ {{ conversionHint }}</div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * Numeric input with a unit segment. Several units open a menu that previews the value in each\n * unit; units with a `factor` also get a hint in the neighbour unit nearest to 1–1000.\n */\nimport { computePosition, flip, offset, shift } from '@floating-ui/dom'\nimport { computed, nextTick, ref, useTemplateRef, watch } from 'vue'\nimport { useDropdownState } from '../composables/useDropdownState'\nimport { useMenuKeyboard } from '../composables/useMenuKeyboard'\nimport type { UnitOption } from '../types'\n\ninterface Props {\n modelValue?: number\n unit?: string\n units: UnitOption[]\n precision?: number\n min?: number\n max?: number\n step?: number\n placeholder?: string\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n convertOnUnitChange?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n precision: undefined,\n step: undefined,\n placeholder: 'Enter value',\n disabled: false,\n error: false,\n size: 'md',\n convertOnUnitChange: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: number | undefined]\n 'update:unit': [unit: string]\n 'change': [data: { value: number | undefined; unit: string }]\n}>()\n\nconst currentUnit = computed(() => props.unit || (props.units.length > 0 ? props.units[0].value : ''))\nconst currentOption = computed(() => findUnit(currentUnit.value))\nconst selectable = computed(() => props.units.length > 1)\n\n/** Menu rows: ungrouped units first, then one labelled block per group. */\nconst menuSections = computed(() => {\n const sections = new Map<string, UnitOption[]>()\n for (const u of props.units) {\n const key = u.group ?? ''\n sections.set(key, [...(sections.get(key) ?? []), u])\n }\n return [...sections].map(([label, units]) => ({ label, units }))\n .sort((a, b) => Number(a.label !== '') - Number(b.label !== ''))\n})\n\nfunction findUnit(value: string): UnitOption | undefined {\n return props.units.find(u => u.value === value)\n}\n\nfunction roundToPrecision(value: number): number {\n if (props.precision === undefined) return value\n const factor = Math.pow(10, props.precision)\n return Math.round(value * factor) / factor\n}\n\nfunction clamp(value: number): number {\n let result = value\n if (props.min !== undefined && result < props.min) result = props.min\n if (props.max !== undefined && result > props.max) result = props.max\n return result\n}\n\n/** 4 significant digits; exponent form outside 1e-3 … 1e6. */\nfunction formatNumber(value: number): string {\n const abs = Math.abs(value)\n if (abs !== 0 && (abs >= 1e6 || abs < 1e-3)) return value.toExponential(2)\n return String(parseFloat(value.toPrecision(4)))\n}\n\n/** The current value in `target`; null without factors or across unit groups (M vs mg/mL). */\nfunction convertTo(target: UnitOption): number | null {\n const current = currentOption.value\n if (props.modelValue === undefined || current?.factor === undefined || !target.factor) return null\n if (target.group !== current.group) return null\n return props.modelValue * current.factor / target.factor\n}\n\nfunction preview(target: UnitOption): string {\n const converted = convertTo(target)\n return converted === null ? '' : formatNumber(converted)\n}\n\n/** Log distance of |value| from the 1–1000 window (0 inside it). */\nfunction distanceFromReadable(value: number): number {\n const exp = Math.log10(Math.abs(value))\n return exp < 0 ? -exp : Math.max(0, exp - 3)\n}\n\nconst conversionHint = computed(() => {\n const current = currentOption.value\n if (!props.modelValue || current?.factor === undefined) return null\n const scale = props.units\n .filter(u => u.factor !== undefined && u.group === current.group)\n .sort((a, b) => a.factor! - b.factor!)\n const index = scale.indexOf(current)\n let best: { unit: UnitOption; value: number } | null = null\n for (const neighbour of [scale[index + 1], scale[index - 1]]) {\n const value = neighbour && convertTo(neighbour)\n if (!value) continue\n if (!best || distanceFromReadable(value) < distanceFromReadable(best.value)) best = { unit: neighbour, value }\n }\n return best && `${formatNumber(best.value)} ${best.unit.label}`\n})\n\nfunction handleValueInput(event: Event) {\n const target = event.target as HTMLInputElement\n const value = target.value === '' ? undefined : Number(target.value)\n\n if (value === undefined || isNaN(value)) {\n emit('update:modelValue', undefined)\n emit('change', { value: undefined, unit: currentUnit.value })\n return\n }\n\n const clamped = clamp(value)\n emit('update:modelValue', clamped)\n emit('change', { value: clamped, unit: currentUnit.value })\n}\n\nfunction selectUnit(newUnitValue: string) {\n close(true)\n if (newUnitValue === currentUnit.value) return\n\n let newValue = props.modelValue\n if (props.convertOnUnitChange && newValue !== undefined) {\n const oldUnit = currentOption.value\n const newUnit = findUnit(newUnitValue)\n if (oldUnit?.factor !== undefined && newUnit?.factor !== undefined && newUnit.factor !== 0) {\n newValue = clamp(roundToPrecision(newValue * (oldUnit.factor / newUnit.factor)))\n emit('update:modelValue', newValue)\n }\n }\n\n emit('update:unit', newUnitValue)\n emit('change', { value: newValue, unit: newUnitValue })\n}\n\n// ---- Unit menu (disclosure + WAI-ARIA keyboard, shared with ActionMenu) ----\nconst menuRef = ref<HTMLElement | null>(null)\n// Transparent (not visibility:hidden) until placed, so the open-time focus can land on an option.\nconst menuStyle = ref<Record<string, string>>({ opacity: '0' })\nconst { isOpen, rootRef, open, close } = useDropdownState({\n triggerRef: useTemplateRef<HTMLElement>('trigger'),\n closeOnScroll: true,\n insideRefs: [menuRef],\n onOpen: () => { menuStyle.value = { opacity: '0' } },\n})\n\n/** Teleported + fixed like ActionMenu, so overflow:hidden/auto ancestors never clip the menu. */\nwatch(isOpen, async (opened) => {\n if (!opened) return\n await nextTick()\n if (!rootRef.value || !menuRef.value) return\n const { x, y } = await computePosition(rootRef.value, menuRef.value, {\n placement: 'bottom-end',\n strategy: 'fixed',\n middleware: [offset(4), flip(), shift({ padding: 8 })],\n })\n menuStyle.value = { left: `${x}px`, top: `${y}px` }\n})\n\nfunction menuItems(): HTMLElement[] {\n return menuRef.value ? Array.from(menuRef.value.querySelectorAll<HTMLElement>('[role=\"option\"]')) : []\n}\n\nfunction openMenu(focusSelected = true) {\n if (props.disabled || !selectable.value) return\n open()\n if (focusSelected) {\n void nextTick(() => (menuItems().find(el => el.getAttribute('aria-selected') === 'true') ?? menuItems()[0])?.focus())\n }\n}\n\nfunction toggleMenu() {\n if (isOpen.value) close()\n else openMenu()\n}\n\nconst { handleTriggerKeydown, handlePanelKeydown } = useMenuKeyboard({\n items: menuItems,\n isOpen: () => isOpen.value,\n open: () => openMenu(false),\n close,\n})\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-unit-input',\n error ? 'mint-unit-input--error' : '',\n disabled ? 'mint-unit-input--disabled' : '',\n ]\"\n >\n <div ref=\"rootRef\" class=\"mint-unit-input__field\">\n <div :class=\"['mint-unit-input__controls', `mint-unit-input__controls--${size}`]\">\n <input\n type=\"number\"\n :value=\"modelValue\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :aria-invalid=\"error || undefined\"\n :class=\"[\n 'mint-unit-input__value',\n `mint-unit-input__value--${size}`,\n disabled ? 'mint-unit-input__value--disabled' : '',\n ]\"\n aria-label=\"Value\"\n @input=\"handleValueInput\"\n />\n\n <button\n v-if=\"selectable\"\n ref=\"trigger\"\n type=\"button\"\n :class=\"['mint-unit-input__unit', { 'mint-unit-input__unit--open': isOpen }]\"\n :disabled=\"disabled\"\n aria-haspopup=\"listbox\"\n :aria-expanded=\"isOpen\"\n :aria-label=\"`Unit: ${currentOption?.label ?? currentUnit}`\"\n @click=\"toggleMenu\"\n @keydown=\"handleTriggerKeydown\"\n >\n {{ currentOption?.label ?? currentUnit }}\n <svg class=\"mint-unit-input__chevron\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <path d=\"M4 6l4 4 4-4\" />\n </svg>\n </button>\n <span v-else class=\"mint-unit-input__unit\">{{ currentOption?.label ?? currentUnit }}</span>\n </div>\n\n </div>\n\n <Teleport to=\"body\">\n <div\n v-if=\"isOpen\"\n ref=\"menuRef\"\n class=\"mint-popover mint-unit-input__menu\"\n :style=\"menuStyle\"\n role=\"listbox\"\n aria-label=\"Unit\"\n @keydown=\"handlePanelKeydown\"\n >\n <template v-for=\"section in menuSections\" :key=\"section.label\">\n <div v-if=\"section.label\" class=\"mint-unit-input__menu-group\" role=\"presentation\">{{ section.label }}</div>\n <button\n v-for=\"u in section.units\"\n :key=\"u.value\"\n type=\"button\"\n role=\"option\"\n :aria-selected=\"u.value === currentUnit\"\n :class=\"['mint-menu-item', { 'mint-menu-item--selected': u.value === currentUnit }]\"\n @click=\"selectUnit(u.value)\"\n >\n <span class=\"mint-menu-item__text\"><span class=\"mint-menu-item__label\">{{ u.label }}</span></span>\n <span v-if=\"preview(u)\" class=\"mint-menu-item__meta\">{{ preview(u) }}</span>\n </button>\n </template>\n </div>\n </Teleport>\n\n <div v-if=\"conversionHint\" class=\"mint-unit-input__hint\">≈ {{ conversionHint }}</div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Paired numeric + unit input for reagent concentrations (pM–M, mg/mL, etc.) with optional molar-mass conversion hint. */\nimport { computed, watch } from 'vue'\nimport {\n useConcentrationUnits,\n type ConcentrationValue,\n type ConcentrationUnit,\n} from '../composables/useConcentrationUnits'\nimport UnitInput from './UnitInput.vue'\n\ninterface Props {\n modelValue?: ConcentrationValue\n allowedUnits?: ConcentrationUnit[]\n showConversion?: boolean\n molecularWeight?: number\n min?: number\n max?: number\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n placeholder?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n showConversion: true,\n disabled: false,\n error: false,\n size: 'md',\n placeholder: 'Enter value',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: ConcentrationValue | undefined]\n}>()\n\nconst { unitCategories, convert, getBaseUnit, isMolarity, isMassVolume } = useConcentrationUnits()\n\n/** Scale factor to the category base unit; UnitInput uses it for menu previews and the nearest-unit hint. */\nfunction factorOf(unit: ConcentrationUnit): number | undefined {\n if (!props.showConversion || !(isMolarity(unit) || isMassVolume(unit))) return undefined\n return convert(1, unit, getBaseUnit(unit)) ?? undefined\n}\n\n// Filter categories based on allowedUnits\nconst filteredCategories = computed(() => {\n const allowedUnits = props.allowedUnits\n if (!allowedUnits || allowedUnits.length === 0) {\n return unitCategories.value\n }\n return unitCategories.value\n .map(cat => ({\n label: cat.label,\n units: cat.units.filter(u => allowedUnits.includes(u)),\n }))\n .filter(cat => cat.units.length > 0)\n})\n\n// Flatten all available units\nconst availableUnits = computed(() => {\n return filteredCategories.value.flatMap(cat => cat.units)\n})\n\nconst unitOptions = computed(() =>\n filteredCategories.value.flatMap(category =>\n category.units.map(unit => ({\n value: unit,\n label: unit,\n group: filteredCategories.value.length > 1 ? category.label : undefined,\n factor: factorOf(unit),\n }))\n )\n)\n\n// Current value and unit\nconst currentValue = computed(() => props.modelValue?.value)\nconst currentUnit = computed(() => props.modelValue?.unit || availableUnits.value[0] || 'µM')\n\nfunction handleValueUpdate(value: number | undefined) {\n if (value === undefined || isNaN(value)) {\n emit('update:modelValue', undefined)\n return\n }\n\n // Apply min/max constraints\n let clampedValue = value\n if (props.min !== undefined && clampedValue < props.min) {\n clampedValue = props.min\n }\n if (props.max !== undefined && clampedValue > props.max) {\n clampedValue = props.max\n }\n\n emit('update:modelValue', {\n value: clampedValue,\n unit: currentUnit.value,\n })\n}\n\nfunction handleUnitUpdate(unit: string) {\n emit('update:modelValue', {\n value: currentValue.value ?? 0,\n unit: unit as ConcentrationUnit,\n })\n}\n\n// Ensure modelValue always has a valid unit\nwatch(availableUnits, (units) => {\n if (props.modelValue && !units.includes(props.modelValue.unit)) {\n emit('update:modelValue', {\n value: props.modelValue.value,\n unit: units[0] || 'µM',\n })\n }\n}, { immediate: true })\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-concentration-input',\n error ? 'mint-concentration-input--error' : '',\n disabled ? 'mint-concentration-input--disabled' : '',\n ]\"\n >\n <UnitInput\n :model-value=\"currentValue\"\n :unit=\"currentUnit\"\n :units=\"unitOptions\"\n :min=\"min\"\n :max=\"max\"\n :disabled=\"disabled\"\n :error=\"error\"\n :size=\"size\"\n :placeholder=\"placeholder\"\n @update:model-value=\"handleValueUpdate\"\n @update:unit=\"handleUnitUpdate\"\n />\n </div>\n</template>\n","<script setup lang=\"ts\">\n/** Paired numeric + unit input for reagent concentrations (pM–M, mg/mL, etc.) with optional molar-mass conversion hint. */\nimport { computed, watch } from 'vue'\nimport {\n useConcentrationUnits,\n type ConcentrationValue,\n type ConcentrationUnit,\n} from '../composables/useConcentrationUnits'\nimport UnitInput from './UnitInput.vue'\n\ninterface Props {\n modelValue?: ConcentrationValue\n allowedUnits?: ConcentrationUnit[]\n showConversion?: boolean\n molecularWeight?: number\n min?: number\n max?: number\n disabled?: boolean\n error?: boolean\n size?: 'sm' | 'md' | 'lg'\n placeholder?: string\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n showConversion: true,\n disabled: false,\n error: false,\n size: 'md',\n placeholder: 'Enter value',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: ConcentrationValue | undefined]\n}>()\n\nconst { unitCategories, convert, getBaseUnit, isMolarity, isMassVolume } = useConcentrationUnits()\n\n/** Scale factor to the category base unit; UnitInput uses it for menu previews and the nearest-unit hint. */\nfunction factorOf(unit: ConcentrationUnit): number | undefined {\n if (!props.showConversion || !(isMolarity(unit) || isMassVolume(unit))) return undefined\n return convert(1, unit, getBaseUnit(unit)) ?? undefined\n}\n\n// Filter categories based on allowedUnits\nconst filteredCategories = computed(() => {\n const allowedUnits = props.allowedUnits\n if (!allowedUnits || allowedUnits.length === 0) {\n return unitCategories.value\n }\n return unitCategories.value\n .map(cat => ({\n label: cat.label,\n units: cat.units.filter(u => allowedUnits.includes(u)),\n }))\n .filter(cat => cat.units.length > 0)\n})\n\n// Flatten all available units\nconst availableUnits = computed(() => {\n return filteredCategories.value.flatMap(cat => cat.units)\n})\n\nconst unitOptions = computed(() =>\n filteredCategories.value.flatMap(category =>\n category.units.map(unit => ({\n value: unit,\n label: unit,\n group: filteredCategories.value.length > 1 ? category.label : undefined,\n factor: factorOf(unit),\n }))\n )\n)\n\n// Current value and unit\nconst currentValue = computed(() => props.modelValue?.value)\nconst currentUnit = computed(() => props.modelValue?.unit || availableUnits.value[0] || 'µM')\n\nfunction handleValueUpdate(value: number | undefined) {\n if (value === undefined || isNaN(value)) {\n emit('update:modelValue', undefined)\n return\n }\n\n // Apply min/max constraints\n let clampedValue = value\n if (props.min !== undefined && clampedValue < props.min) {\n clampedValue = props.min\n }\n if (props.max !== undefined && clampedValue > props.max) {\n clampedValue = props.max\n }\n\n emit('update:modelValue', {\n value: clampedValue,\n unit: currentUnit.value,\n })\n}\n\nfunction handleUnitUpdate(unit: string) {\n emit('update:modelValue', {\n value: currentValue.value ?? 0,\n unit: unit as ConcentrationUnit,\n })\n}\n\n// Ensure modelValue always has a valid unit\nwatch(availableUnits, (units) => {\n if (props.modelValue && !units.includes(props.modelValue.unit)) {\n emit('update:modelValue', {\n value: props.modelValue.value,\n unit: units[0] || 'µM',\n })\n }\n}, { immediate: true })\n</script>\n\n<template>\n <div\n :class=\"[\n 'mint-concentration-input',\n error ? 'mint-concentration-input--error' : '',\n disabled ? 'mint-concentration-input--disabled' : '',\n ]\"\n >\n <UnitInput\n :model-value=\"currentValue\"\n :unit=\"currentUnit\"\n :units=\"unitOptions\"\n :min=\"min\"\n :max=\"max\"\n :disabled=\"disabled\"\n :error=\"error\"\n :size=\"size\"\n :placeholder=\"placeholder\"\n @update:model-value=\"handleValueUpdate\"\n @update:unit=\"handleUnitUpdate\"\n />\n </div>\n</template>\n","import type { Component } from 'vue'\nimport type { FormFieldType } from '../types/form-builder'\n\nimport BaseInput from '../components/BaseInput.vue'\nimport SecretInput from '../components/SecretInput.vue'\nimport BaseTextarea from '../components/BaseTextarea.vue'\nimport BaseSelect from '../components/BaseSelect.vue'\nimport MultiSelect from '../components/MultiSelect.vue'\nimport BaseCheckbox from '../components/BaseCheckbox.vue'\nimport BaseToggle from '../components/BaseToggle.vue'\nimport BaseRadioGroup from '../components/BaseRadioGroup.vue'\nimport BaseSlider from '../components/BaseSlider.vue'\nimport TagsInput from '../components/TagsInput.vue'\nimport NumberInput from '../components/NumberInput.vue'\nimport DatePicker from '../components/DatePicker.vue'\nimport TimePicker from '../components/TimePicker.vue'\nimport DateTimePicker from '../components/DateTimePicker.vue'\nimport FileUploader from '../components/FileUploader.vue'\nimport GeneratedPathInput from '../components/GeneratedPathInput.vue'\nimport FormulaInput from '../components/FormulaInput.vue'\nimport SequenceInput from '../components/SequenceInput.vue'\nimport MoleculeInput from '../components/MoleculeInput.vue'\nimport ConcentrationInput from '../components/ConcentrationInput.vue'\nimport UnitInput from '../components/UnitInput.vue'\n\nexport interface RegistryEntry {\n component: Component\n /** Default props applied to the component. */\n defaults: Record<string, unknown>\n /** Whether the component uses v-model (false for event-only components like FileUploader). */\n vModel: boolean\n}\n\nconst registry: Record<FormFieldType, RegistryEntry> = {\n text: { component: BaseInput, defaults: { type: 'text' }, vModel: true },\n email: { component: BaseInput, defaults: { type: 'email' }, vModel: true },\n password: { component: BaseInput, defaults: { type: 'password' }, vModel: true },\n secret: { component: SecretInput, defaults: {}, vModel: true },\n tel: { component: BaseInput, defaults: { type: 'tel' }, vModel: true },\n url: { component: BaseInput, defaults: { type: 'url' }, vModel: true },\n search: { component: BaseInput, defaults: { type: 'search' }, vModel: true },\n number: { component: NumberInput, defaults: {}, vModel: true },\n textarea: { component: BaseTextarea, defaults: {}, vModel: true },\n select: { component: BaseSelect, defaults: {}, vModel: true },\n multiselect: { component: MultiSelect, defaults: {}, vModel: true },\n checkbox: { component: BaseCheckbox, defaults: {}, vModel: true },\n toggle: { component: BaseToggle, defaults: {}, vModel: true },\n radio: { component: BaseRadioGroup, defaults: {}, vModel: true },\n slider: { component: BaseSlider, defaults: {}, vModel: true },\n tags: { component: TagsInput, defaults: {}, vModel: true },\n date: { component: DatePicker, defaults: {}, vModel: true },\n time: { component: TimePicker, defaults: {}, vModel: true },\n datetime: { component: DateTimePicker, defaults: {}, vModel: true },\n file: { component: FileUploader, defaults: {}, vModel: false },\n path: { component: GeneratedPathInput, defaults: {}, vModel: true },\n formula: { component: FormulaInput, defaults: {}, vModel: true },\n sequence: { component: SequenceInput, defaults: {}, vModel: true },\n molecule: { component: MoleculeInput, defaults: {}, vModel: true },\n concentration: { component: ConcentrationInput, defaults: {}, vModel: true },\n unit: { component: UnitInput, defaults: {}, vModel: true },\n}\n\n/** Return the registry entry for a given field type. Throws if the type is unregistered. */\nexport function getFieldRegistryEntry(type: FormFieldType): RegistryEntry {\n return registry[type]\n}\n\n/** Get the default empty value for a given field type. */\nexport function getTypeDefault(type: FormFieldType): unknown {\n switch (type) {\n case 'checkbox':\n case 'toggle':\n return false\n case 'number':\n case 'slider':\n return undefined\n case 'multiselect':\n case 'tags':\n return []\n case 'secret':\n // A secret field has no empty string state: `null` means \"not stored\".\n return null\n default:\n return ''\n }\n}\n","export function recordValue(value: unknown): Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n ? value as Record<string, unknown>\n : {}\n}\n\nexport function numericValue(value: number | { value: number; message: string }): number {\n return typeof value === 'number' ? value : value.value\n}\n\nexport function orderedUnique(values: string[]): string[] {\n return [...new Set(values)]\n}\n\nexport function replaceRecord(target: Record<string, unknown>, values: Record<string, unknown>) {\n for (const key of Object.keys(target)) {\n delete target[key]\n }\n Object.assign(target, values)\n}\n\nexport function omitUndefined<T extends object>(record: T): T {\n const next: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(record as Record<string, unknown>)) {\n if (value !== undefined) next[key] = value\n }\n return next as T\n}\n\nexport function humanize(value: string): string {\n return value\n .replace(/[_-]+/g, ' ')\n .replace(/([a-z])([A-Z])/g, '$1 $2')\n .trim()\n .replace(/\\w\\S*/g, word => word.charAt(0).toUpperCase() + word.slice(1))\n}\n","import type {\n SelectOption,\n} from '../types'\nimport type {\n FormFieldType,\n} from '../types/form-builder'\nimport {\n getTypeDefault,\n} from './formBuilderRegistry'\nimport {\n humanize,\n} from './controlSchemaUtils'\nimport type {\n ControlDefinition,\n ControlInput,\n ControlOption,\n ControlOptionValue,\n ControlSchema,\n ControlSchemaOptions,\n} from './controlSchemaTypes'\n\nexport interface NormalizedControl {\n name: string\n definition: ControlDefinition\n type: FormFieldType\n sectionId: string\n viewId: string\n order: number\n}\n\nexport function normalizeControls(\n controls: ControlSchema,\n options: ControlSchemaOptions = {},\n): NormalizedControl[] {\n return Object.entries(controls)\n .map(([name, input], index): NormalizedControl => {\n const definition = normalizeControlDefinition(input)\n const type = definition.type ?? inferControlType(definition)\n return {\n name,\n definition,\n type,\n sectionId: definition.section ?? options.section ?? 'controls',\n viewId: definition.view ?? options.view ?? 'default',\n order: definition.order ?? index,\n }\n })\n .sort((a, b) => a.order - b.order)\n}\n\nexport function normalizeControlDefinition(input: ControlInput): ControlDefinition {\n if (isControlOptionArray(input)) {\n if (input.length === 0) return { type: 'tags', default: [] }\n return {\n default: optionValue(input[0]),\n options: input,\n }\n }\n\n if (typeof input === 'string' || typeof input === 'number' || typeof input === 'boolean') {\n return { default: input }\n }\n\n return input\n}\n\nexport function defaultValueForControl(definition: ControlDefinition, type: FormFieldType): unknown {\n if (definition.default !== undefined) return definition.default\n if (definition.defaultValue !== undefined) return definition.defaultValue\n return getTypeDefault(type)\n}\n\nexport function normalizeOption(option: ControlOption): SelectOption<unknown> {\n if (typeof option === 'object' && option !== null && 'label' in option) {\n return option\n }\n return {\n value: option,\n label: humanize(String(option)),\n }\n}\n\nfunction isControlOptionArray(input: ControlInput): input is readonly ControlOption[] {\n return Array.isArray(input)\n}\n\nfunction inferControlType(definition: ControlDefinition): FormFieldType {\n const value = definition.default ?? definition.defaultValue\n if (definition.options?.length) return Array.isArray(value) ? 'multiselect' : 'select'\n if (typeof value === 'boolean') return 'toggle'\n if (typeof value === 'number') return 'number'\n if (Array.isArray(value)) return 'tags'\n return 'text'\n}\n\nfunction optionValue(option: ControlOption): ControlOptionValue | unknown {\n if (typeof option === 'object' && option !== null && 'value' in option) {\n return option.value\n }\n return option\n}\n","import type {\n FieldValidation,\n FormFieldSchema,\n} from '../types/form-builder'\nimport {\n defaultValueForControl,\n normalizeOption,\n type NormalizedControl,\n} from './controlSchemaNormalize'\nimport {\n humanize,\n numericValue,\n} from './controlSchemaUtils'\nimport type {\n ControlDefinition,\n} from './controlSchemaTypes'\n\nexport function controlToFormField(control: NormalizedControl): FormFieldSchema {\n const { name, definition, type } = control\n const props = fieldProps(definition)\n return {\n name,\n label: definition.label ?? humanize(name),\n type,\n defaultValue: defaultValueForControl(definition, type),\n placeholder: definition.placeholder,\n hint: definition.hint,\n icon: definition.icon,\n iconColor: definition.iconColor,\n iconBg: definition.iconBg,\n size: definition.size,\n disabled: definition.disabled,\n readonly: definition.readonly,\n validation: validationForControl(definition),\n condition: definition.condition,\n access: definition.access,\n colSpan: definition.colSpan,\n props,\n }\n}\n\nfunction fieldProps(definition: ControlDefinition): Record<string, unknown> {\n const props: Record<string, unknown> = {}\n if (definition.min !== undefined) props.min = numericValue(definition.min)\n if (definition.max !== undefined) props.max = numericValue(definition.max)\n if (definition.options) props.options = definition.options.map(normalizeOption)\n return { ...props, ...(definition.props ?? {}) }\n}\n\nfunction validationForControl(definition: ControlDefinition): FieldValidation | undefined {\n const validation: FieldValidation = { ...(definition.validation ?? {}) }\n if (definition.required !== undefined) validation.required = definition.required\n if (definition.min !== undefined) validation.min = definition.min\n if (definition.max !== undefined) validation.max = definition.max\n if (definition.minLength !== undefined) validation.minLength = definition.minLength\n if (definition.maxLength !== undefined) validation.maxLength = definition.maxLength\n if (definition.email !== undefined) validation.email = definition.email\n if (definition.pattern !== undefined) validation.pattern = definition.pattern\n return Object.keys(validation).length > 0 ? validation : undefined\n}\n","import type {\n PillNavItem,\n} from '../types'\nimport type {\n NormalizedControl,\n} from './controlSchemaNormalize'\nimport {\n humanize,\n} from './controlSchemaUtils'\nimport type {\n ControlDefinition,\n ControlSchemaOptions,\n ControlSectionConfig,\n ControlSidebarConfig,\n} from './controlSchemaTypes'\n\nexport function sectionConfig(\n sectionId: string,\n controls: NormalizedControl[],\n options: ControlSchemaOptions,\n): ControlSectionConfig {\n const configured = options.sections?.[sectionId]\n const first = controls[0]?.definition\n return {\n ...configured,\n id: sectionId,\n label: configured?.label ?? first?.sectionLabel,\n title: configured?.title ?? first?.sectionLabel,\n description: configured?.description ?? first?.sectionDescription,\n subtitle: configured?.subtitle ?? first?.sectionSubtitle,\n }\n}\n\nexport function firstSidebarConfig(controls: NormalizedControl[]): ControlSidebarConfig | undefined {\n for (const control of controls) {\n const sidebar = control.definition.sidebar\n if (sidebar && typeof sidebar === 'object' && sidebar.enabled !== false) return sidebar\n }\n return undefined\n}\n\nexport function isSidebarEnabled(sidebar: ControlDefinition['sidebar']): boolean {\n if (sidebar === false) return false\n if (sidebar && typeof sidebar === 'object') return sidebar.enabled !== false\n return true\n}\n\nexport function controlViewItem(viewId: string, options: ControlSchemaOptions): PillNavItem {\n const config = options.views?.[viewId]\n return {\n id: viewId,\n label: config?.label ?? humanize(viewId),\n ...(config?.icon !== undefined ? { icon: config.icon } : {}),\n ...(config?.to !== undefined ? { to: config.to } : {}),\n ...(config?.href !== undefined ? { href: config.href } : {}),\n ...(config?.disabled !== undefined ? { disabled: config.disabled } : {}),\n ...(config?.children !== undefined ? { children: config.children } : {}),\n }\n}\n","import type {\n PillNavItem,\n SidebarToolSection,\n SettingsModalSchema,\n TopBarSettingsConfig,\n} from '../types'\nimport type {\n FormSectionSchema,\n} from '../types/form-builder'\nimport {\n controlToFormField,\n} from './controlSchemaFormFields'\nimport {\n controlViewItem,\n firstSidebarConfig,\n isSidebarEnabled,\n sectionConfig,\n} from './controlSchemaLayout'\nimport {\n normalizeControls,\n} from './controlSchemaNormalize'\nimport {\n humanize,\n orderedUnique,\n} from './controlSchemaUtils'\nimport type {\n ControlFormSchema,\n ControlSchema,\n ControlSchemaOptions,\n} from './controlSchemaTypes'\n\n/** Convert a compact control schema into a FormBuilder schema. */\nexport function controlsToFormSchema(\n controls: ControlSchema,\n options: ControlSchemaOptions = {},\n): ControlFormSchema {\n const normalized = normalizeControls(controls, options)\n const sectionIds = orderedUnique(normalized.map(control => control.sectionId))\n const sections = sectionIds.map((sectionId): FormSectionSchema => {\n const sectionControls = normalized.filter(control => control.sectionId === sectionId)\n const config = sectionConfig(sectionId, sectionControls, options)\n return {\n id: sectionId,\n title: config.title ?? config.label ?? humanize(sectionId),\n description: config.description,\n columns: config.columns ?? options.columns ?? 1,\n defaultOpen: config.defaultOpen,\n condition: config.condition,\n fields: sectionControls.map(controlToFormField),\n }\n })\n\n return {\n sections,\n submitLabel: options.submitLabel,\n cancelLabel: options.cancelLabel,\n showCancel: options.showCancel,\n }\n}\n\n/** Convert controls into AppSidebar panels grouped by view and section. */\nexport function controlsToSidebarPanels(\n controls: ControlSchema,\n options: ControlSchemaOptions = {},\n): Record<string, SidebarToolSection[]> {\n const normalized = normalizeControls(controls, options)\n .filter(control => isSidebarEnabled(control.definition.sidebar))\n const viewIds = orderedUnique(normalized.map(control => control.viewId))\n const panels: Record<string, SidebarToolSection[]> = {}\n\n for (const viewId of viewIds) {\n const viewControls = normalized.filter(control => control.viewId === viewId)\n const sectionIds = orderedUnique(viewControls.map(control => control.sectionId))\n panels[viewId] = sectionIds.map((sectionId): SidebarToolSection => {\n const sectionControls = viewControls.filter(control => control.sectionId === sectionId)\n const config = sectionConfig(sectionId, sectionControls, options)\n const sidebarConfig = firstSidebarConfig(sectionControls)\n return {\n id: sectionId,\n label: sidebarConfig?.label ?? config.label ?? config.title ?? humanize(sectionId),\n subtitle: sidebarConfig?.subtitle ?? config.subtitle,\n icon: sidebarConfig?.icon ?? config.icon,\n iconColor: sidebarConfig?.iconColor ?? config.iconColor,\n iconBg: sidebarConfig?.iconBg ?? config.iconBg,\n badge: sidebarConfig?.badge ?? config.badge,\n badgeTone: sidebarConfig?.badgeTone ?? config.badgeTone,\n actions: sidebarConfig?.actions ?? config.actions,\n defaultOpen: sidebarConfig?.defaultOpen ?? config.defaultOpen,\n showToggle: sidebarConfig?.showToggle ?? config.showToggle,\n }\n })\n }\n\n return panels\n}\n\n/** Convert controls into a SettingsModal schema grouped by the same sections. */\nexport function controlsToSettingsSchema(\n controls: ControlSchema,\n options: ControlSchemaOptions = {},\n): SettingsModalSchema {\n const normalized = normalizeControls(controls, options)\n const sectionIds = orderedUnique(normalized.map(control => control.sectionId))\n\n return {\n groups: sectionIds.map((sectionId) => {\n const sectionControls = normalized.filter(control => control.sectionId === sectionId)\n const config = sectionConfig(sectionId, sectionControls, options)\n return {\n id: sectionId,\n label: config.label ?? config.title ?? humanize(sectionId),\n description: config.description ?? config.subtitle,\n icon: typeof config.icon === 'string' ? config.icon : undefined,\n fields: sectionControls.map(controlToFormField),\n columns: config.columns ?? options.columns ?? 1,\n condition: config.condition,\n access: config.access,\n }\n }),\n }\n}\n\n/** Convert controls into an AppTopBar settingsConfig object that passes compact controls through to SettingsModal. */\nexport function controlsToTopBarSettingsConfig(\n controls: ControlSchema,\n options: ControlSchemaOptions = {},\n config: Omit<TopBarSettingsConfig, 'schema' | 'controls' | 'controlOptions'> = {},\n): TopBarSettingsConfig {\n return {\n ...config,\n controls,\n controlOptions: options,\n }\n}\n\n/** Return generated control view IDs that have at least one sidebar panel. */\nexport function controlsToViewIds(\n controls: ControlSchema,\n options: ControlSchemaOptions = {},\n): string[] {\n return controlsToViewItems(controls, options).map(item => item.id)\n}\n\n/** Return AppTopBar pillNav-compatible view items for switching generated control sidebars. */\nexport function controlsToViewItems(\n controls: ControlSchema,\n options: ControlSchemaOptions = {},\n): PillNavItem[] {\n return Object.entries(controlsToSidebarPanels(controls, options))\n .filter(([, sections]) => sections.length > 0)\n .map(([id]) => controlViewItem(id, options))\n}\n\n/** Return the first generated sidebar view ID, or an empty string when controls render no sidebar panels. */\nexport function getDefaultControlView(\n controls: ControlSchema,\n options: ControlSchemaOptions = {},\n): string {\n return controlsToViewIds(controls, options)[0] ?? ''\n}\n\n/** Return a headerless single-section FormBuilder schema for rendering inside an AppSidebar section slot. */\nexport function controlsToSectionFormSchema(\n controls: ControlSchema,\n sectionId: string,\n options: ControlSchemaOptions = {},\n): ControlFormSchema {\n const schema = controlsToFormSchema(controls, options)\n return {\n sections: schema.sections\n .filter(section => section.id === sectionId)\n .map(section => ({ ...section, title: '', description: undefined })),\n submitLabel: schema.submitLabel,\n cancelLabel: schema.cancelLabel,\n showCancel: schema.showCancel,\n }\n}\n\n/** Return headerless FormBuilder schemas keyed by section ID for AppSidebar auto-rendering. */\nexport function controlsToSectionFormSchemas(\n controls: ControlSchema,\n options: ControlSchemaOptions = {},\n): Record<string, ControlFormSchema> {\n const schema = controlsToFormSchema(controls, options)\n const schemas: Record<string, ControlFormSchema> = {}\n for (const section of schema.sections) {\n schemas[section.id] = {\n sections: [{ ...section, title: '', description: undefined }],\n submitLabel: schema.submitLabel,\n cancelLabel: schema.cancelLabel,\n showCancel: schema.showCancel,\n }\n }\n return schemas\n}\n","import {\n defaultValueForControl,\n normalizeControls,\n} from './controlSchemaNormalize'\nimport {\n controlToFormField,\n} from './controlSchemaFormFields'\nimport {\n controlsToFormSchema,\n controlsToSectionFormSchema,\n controlsToSectionFormSchemas,\n controlsToSettingsSchema,\n controlsToSidebarPanels,\n controlsToTopBarSettingsConfig,\n controlsToViewItems,\n} from './controlSchemaAdapters'\nimport type {\n ControlComponentBindingsConfig,\n ControlSchema,\n ControlSchemaOptions,\n ControlValues,\n UseControlSchemaReturn,\n} from './controlSchemaTypes'\n\nexport type * from './controlSchemaTypes'\n\nexport {\n mergeControlWorkspaceOptions,\n} from './controlWorkspaceOptions'\n\nexport {\n useControlWorkspace,\n} from './useControlWorkspace'\n\nexport {\n controlValuesToComponentBindings,\n controlValuesToComponentBindingsById,\n controlValuesToComponentProps,\n} from './controlComponentBindings'\n\nexport {\n controlsToFormSchema,\n controlsToSectionFormSchema,\n controlsToSectionFormSchemas,\n controlsToSettingsSchema,\n controlsToSidebarPanels,\n controlsToTopBarSettingsConfig,\n controlsToViewIds,\n controlsToViewItems,\n getDefaultControlView,\n} from './controlSchemaAdapters'\n\nexport {\n defineControlModel,\n isControlModelBinding,\n resolveControlModel,\n} from './controlSchemaModel'\n\nexport {\n defineDoseCalculatorControlProps,\n defineDoseDesignControlModel,\n defineWellPlateControlProps,\n defineWellPlateDoseComponentBindings,\n defineWellPlateDoseControlProps,\n} from './controlSchemaDoseDesign'\n\n/** Preserve literal control keys while marking an object as a MINT control schema. */\nexport function defineControls<TControls extends ControlSchema>(controls: TControls): TControls {\n return controls\n}\n\n/** Preserve literal SDK component binding ids while marking an object as generated workspace component bindings. */\nexport function defineControlComponentBindings<TBindings extends ControlComponentBindingsConfig>(\n bindings: TBindings,\n): TBindings {\n return bindings\n}\n\n/** Build default values for a control schema, matching FormBuilder field defaults. */\nexport function getControlDefaults<TControls extends ControlSchema>(\n controls: TControls,\n): ControlValues<TControls> {\n const values: Record<string, unknown> = {}\n for (const control of normalizeControls(controls)) {\n values[control.name] = defaultValueForControl(control.definition, control.type)\n }\n return values as ControlValues<TControls>\n}\n\n/** Prepare FormBuilder, SettingsModal, AppTopBar settings, AppSidebar, and initial values from one compact control model. */\nexport function useControlSchema<TControls extends ControlSchema>(\n controls: TControls,\n options: ControlSchemaOptions = {},\n): UseControlSchemaReturn<TControls> {\n const formSchema = controlsToFormSchema(controls, options)\n const settingsSchema = controlsToSettingsSchema(controls, options)\n const topBarSettingsConfig = controlsToTopBarSettingsConfig(controls, options)\n const sidebarPanels = controlsToSidebarPanels(controls, options)\n const viewItems = controlsToViewItems(controls, options)\n const viewIds = viewItems.map(item => item.id)\n const defaultView = viewIds[0] ?? ''\n const sectionSchemas = controlsToSectionFormSchemas(controls, options)\n\n return {\n controls,\n fields: normalizeControls(controls, options).map(controlToFormField),\n formSchema,\n form: {\n schema: formSchema,\n },\n settingsSchema,\n settings: {\n schema: settingsSchema,\n },\n topBarSettingsConfig,\n topBarSettings: {\n showSettings: true,\n settingsConfig: topBarSettingsConfig,\n },\n sidebarPanels,\n viewIds,\n viewItems,\n defaultView,\n sectionSchemas,\n sidebar: {\n panels: sidebarPanels,\n forms: sectionSchemas,\n viewIds,\n viewItems,\n defaultView,\n },\n initialValues: getControlDefaults(controls),\n sectionSchema: (sectionId: string) => controlsToSectionFormSchema(controls, sectionId, options),\n }\n}\n","/**\n * Shared color scales and color math for the MINT SDK.\n *\n * ## Why the exported values are hex, not `var(--…)`\n *\n * Every scale below is mirrored by a CSS custom property in\n * `styles/variables.css` (`--mint-sample-1…9`, `--mint-slot-r/g/b/y`), so\n * stylesheets and `:style` bindings can stay theme-aware by referencing the\n * token. The JavaScript constants deliberately carry the plain hex **fallback**\n * for the same slot, because these values are also\n *\n * - persisted into experiment design data (`SampleType.color`), where a\n * `var(--…)` string would be meaningless outside the browser, and\n * - handed to canvas / SVG / export code paths, which cannot resolve CSS\n * custom properties.\n *\n * Keep the two in sync: a change here must be mirrored in `variables.css`.\n */\n\nimport type { SlotPosition } from '../types/componentLabTypes'\n\n/**\n * Canonical categorical scale for sample types, plate maps, dose-response\n * series and legends. Mirrors `--mint-sample-1` … `--mint-sample-9`.\n */\nexport const SAMPLE_COLOR_SCALE: readonly string[] = [\n '#3B82F6', // blue\n '#10B981', // green\n '#EF4444', // red\n '#F59E0B', // amber\n '#8B5CF6', // purple\n '#F97316', // orange\n '#06B6D4', // cyan\n '#14B8A6', // teal\n '#6B7280', // gray\n]\n\n/**\n * Group palette as CSS tokens (3a): groups always take `--mint-sample-1` …\n * `--mint-sample-8`; the 9th (gray) stays out of the group cycle.\n */\nexport const SAMPLE_GROUP_TOKENS: readonly string[] = [\n 'var(--mint-sample-1)',\n 'var(--mint-sample-2)',\n 'var(--mint-sample-3)',\n 'var(--mint-sample-4)',\n 'var(--mint-sample-5)',\n 'var(--mint-sample-6)',\n 'var(--mint-sample-7)',\n 'var(--mint-sample-8)',\n]\n\n/**\n * Slot-position colors (R/G/B/Y rack positions).\n * Mirrors `--mint-slot-r`, `--mint-slot-g`, `--mint-slot-b`, `--mint-slot-y`.\n */\nexport const SLOT_COLORS: Record<SlotPosition, string> = {\n R: '#ef4444', // red\n G: '#22c55e', // green\n B: '#3b82f6', // blue\n Y: '#eab308', // yellow\n}\n\n/** Slot positions in their canonical display order. */\nexport const SLOT_ORDER: readonly SlotPosition[] = ['R', 'G', 'B', 'Y']\n\n/**\n * Color utilities for deriving same-hue-family shades.\n *\n * Used by SampleSelector and other group/legend UIs where a parent color\n * needs to seed a gradient of related shades for its children.\n */\n\nexport interface Hsl {\n h: number // 0–360\n s: number // 0–100\n l: number // 0–100\n}\n\nconst HEX_RE = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i\n\nfunction clamp(n: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, n))\n}\n\nexport function hexToHsl(hex: string): Hsl {\n const match = HEX_RE.exec(hex.trim())\n if (!match) return { h: 0, s: 0, l: 50 }\n\n let raw = match[1]\n if (raw.length === 3) raw = raw.split('').map(c => c + c).join('')\n\n const r = parseInt(raw.slice(0, 2), 16) / 255\n const g = parseInt(raw.slice(2, 4), 16) / 255\n const b = parseInt(raw.slice(4, 6), 16) / 255\n\n const max = Math.max(r, g, b)\n const min = Math.min(r, g, b)\n const delta = max - min\n\n let h = 0\n if (delta !== 0) {\n if (max === r) h = ((g - b) / delta) % 6\n else if (max === g) h = (b - r) / delta + 2\n else h = (r - g) / delta + 4\n }\n h = (h * 60 + 360) % 360\n\n const l = (max + min) / 2\n const s = delta === 0 ? 0 : delta / (1 - Math.abs(2 * l - 1))\n\n return { h, s: s * 100, l: l * 100 }\n}\n\nexport function hslToHex(h: number, s: number, l: number): string {\n const sNorm = clamp(s, 0, 100) / 100\n const lNorm = clamp(l, 0, 100) / 100\n const hNorm = ((h % 360) + 360) % 360\n\n const c = (1 - Math.abs(2 * lNorm - 1)) * sNorm\n const x = c * (1 - Math.abs(((hNorm / 60) % 2) - 1))\n const m = lNorm - c / 2\n\n let r = 0, g = 0, b = 0\n if (hNorm < 60) [r, g, b] = [c, x, 0]\n else if (hNorm < 120) [r, g, b] = [x, c, 0]\n else if (hNorm < 180) [r, g, b] = [0, c, x]\n else if (hNorm < 240) [r, g, b] = [0, x, c]\n else if (hNorm < 300) [r, g, b] = [x, 0, c]\n else [r, g, b] = [c, 0, x]\n\n const toHex = (n: number) => Math.round((n + m) * 255).toString(16).padStart(2, '0')\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`\n}\n\n/**\n * Derive a same-hue-family shade of `parentHex` for child at `index` of `total`.\n *\n * Lightness is distributed evenly within [35, 75] so all children remain\n * readable on light/dark backgrounds. Hue and saturation are inherited from\n * the parent. With `total <= 1`, returns the parent unchanged.\n *\n * Children are ordered light → dark by index, so index 0 is the brightest\n * sibling and index `total - 1` is the darkest.\n */\nexport function deriveShade(parentHex: string, index: number, total: number): string {\n if (total <= 1) return parentHex\n const { h, s, l } = hexToHsl(parentHex)\n\n const L_MIN = 35\n const L_MAX = 75\n const spread = Math.min(L_MAX - L_MIN, 40)\n const center = clamp(l, L_MIN + spread / 2, L_MAX - spread / 2)\n\n const top = center + spread / 2\n const bot = center - spread / 2\n const t = total === 1 ? 0.5 : index / (total - 1)\n const childL = top - t * (top - bot)\n\n const childS = clamp(s, 35, 100)\n return hslToHex(h, childS, childL)\n}\n","import type { Well, WellPlateFormat, WellPlateSize } from '../types'\n\nexport interface WellPlateConfig {\n rows: number\n cols: number\n}\n\nexport interface WellPlateCoordinate {\n row: number\n col: number\n}\n\nexport interface WellPlateSizeConfig {\n cellWidth: string\n cellHeight: string\n headerWidth: string\n headerHeight: string\n fontSize: string\n gap: string\n}\n\nexport const PLATE_CONFIGS: Record<WellPlateFormat, WellPlateConfig> = {\n 6: { rows: 2, cols: 3 },\n 12: { rows: 3, cols: 4 },\n 24: { rows: 4, cols: 6 },\n 48: { rows: 6, cols: 8 },\n 54: { rows: 6, cols: 9 },\n 96: { rows: 8, cols: 12 },\n 384: { rows: 16, cols: 24 },\n}\n\nexport const WELL_PLATE_SIZE_CONFIGS: Record<WellPlateSize, WellPlateSizeConfig> = {\n // Compact square wells (PlateEditor, 7a): room for the Q / i glyph, not a sample name.\n xs: { cellWidth: '26px', cellHeight: '26px', headerWidth: '20px', headerHeight: '20px', fontSize: '0.6875rem', gap: '6px' },\n sm: { cellWidth: '40px', cellHeight: '40px', headerWidth: '32px', headerHeight: '32px', fontSize: '0.625rem', gap: '2px' },\n md: { cellWidth: '56px', cellHeight: '32px', headerWidth: '32px', headerHeight: '24px', fontSize: '0.75rem', gap: '3px' },\n lg: { cellWidth: '80px', cellHeight: '40px', headerWidth: '40px', headerHeight: '32px', fontSize: '0.875rem', gap: '4px' },\n xl: { cellWidth: '96px', cellHeight: '48px', headerWidth: '48px', headerHeight: '40px', fontSize: '1rem', gap: '4px' },\n fill: { cellWidth: '100%', cellHeight: '32px', headerWidth: '32px', headerHeight: '24px', fontSize: '0.75rem', gap: '2px' },\n}\n\n/**\n * Spreadsheet-style row label for a zero-based row index: A…Z, then AA, AB, …\n *\n * This is the single row-label generator for the SDK — plate grids, rack\n * grids, well-id parsing and the template builders all go through it.\n */\nexport function rowLabel(index: number): string {\n let label = ''\n let current = index\n for (;;) {\n label = String.fromCharCode(65 + (current % 26)) + label\n current = Math.floor(current / 26) - 1\n if (current < 0) return label\n }\n}\n\n/** Inverse of {@link rowLabel}: 'A' → 0, 'Z' → 25, 'AA' → 26. */\nexport function rowIndex(label: string): number {\n return [...label].reduce((value, char) => value * 26 + char.charCodeAt(0) - 64, 0) - 1\n}\n\nexport function createPlateRowLabels(config: WellPlateConfig): string[] {\n return Array.from({ length: config.rows }, (_, index) => rowLabel(index))\n}\n\nfunction plateConfigOrThrow(format: number): WellPlateConfig {\n const config = PLATE_CONFIGS[format as WellPlateFormat]\n if (!config) throw new Error(`Unsupported plate format '${format}'.`)\n return config\n}\n\n/** Every well id of a plate, row-major (A1, A2, … B1, …). */\nexport function wellIdsForFormat(format: number): string[] {\n const { rows, cols } = plateConfigOrThrow(format)\n return Array.from({ length: rows }, (_, row) =>\n Array.from({ length: cols }, (_col, col) => `${rowLabel(row)}${col + 1}`)\n ).flat()\n}\n\n/** Throw unless `wellId` names a well that exists on a `format`-well plate. */\nexport function assertWellInFormat(wellId: string, format: number): void {\n const { rows, cols } = plateConfigOrThrow(format)\n const match = /^([A-Z]+)([1-9][0-9]*)$/.exec(wellId.toUpperCase())\n if (!match) {\n throw new Error(`Invalid well id '${wellId}'.`)\n }\n const row = rowIndex(match[1])\n const col = Number(match[2]) - 1\n if (row < 0 || col < 0 || row >= rows || col >= cols) {\n throw new Error(`Well '${wellId}' is outside a ${format}-well plate.`)\n }\n}\n\n/** Coerce an unknown value to a supported plate format, else `fallback`. */\nexport function readPlateFormat(value: unknown, fallback: WellPlateFormat): WellPlateFormat {\n const parsed = typeof value === 'number'\n ? value\n : typeof value === 'string'\n ? Number(value)\n : Number.NaN\n return parsed in PLATE_CONFIGS ? (parsed as WellPlateFormat) : fallback\n}\n\nexport function createPlateColumnLabels(config: WellPlateConfig): number[] {\n return Array.from({ length: config.cols }, (_, index) => index + 1)\n}\n\nexport function createWellGrid(\n config: WellPlateConfig,\n rowLabels: string[],\n wells: Record<string, Partial<Well>>,\n): Well[][] {\n const grid: Well[][] = []\n for (let row = 0; row < config.rows; row++) {\n const rowWells: Well[] = []\n for (let col = 0; col < config.cols; col++) {\n const id = `${rowLabels[row]}${col + 1}`\n const wellData = wells[id] || {}\n rowWells.push({\n id,\n row,\n col,\n state: wellData.state || 'empty',\n sampleType: wellData.sampleType,\n group: wellData.group,\n value: wellData.value,\n metadata: wellData.metadata,\n })\n }\n grid.push(rowWells)\n }\n return grid\n}\n\nexport function getRectangleWellIds(\n start: WellPlateCoordinate,\n end: WellPlateCoordinate,\n rowLabels: string[],\n): Set<string> {\n const minRow = Math.min(start.row, end.row)\n const maxRow = Math.max(start.row, end.row)\n const minCol = Math.min(start.col, end.col)\n const maxCol = Math.max(start.col, end.col)\n\n const wells = new Set<string>()\n for (let row = minRow; row <= maxRow; row++) {\n for (let col = minCol; col <= maxCol; col++) {\n wells.add(`${rowLabels[row]}${col + 1}`)\n }\n }\n return wells\n}\n","export { isRecord } from '../utils/records'\n\nexport function readStringList(value: unknown, fallback: string[]): string[] {\n if (Array.isArray(value)) {\n const items = value.map(item => String(item).trim()).filter(Boolean)\n return items.length ? items : fallback\n }\n if (typeof value === 'string') {\n const items = value.split(',').map(item => item.trim()).filter(Boolean)\n return items.length ? items : fallback\n }\n return fallback\n}\n\nexport function readNumberList(value: unknown, fallback: number[]): number[] {\n const rawItems = Array.isArray(value)\n ? value\n : typeof value === 'string'\n ? value.split(',')\n : []\n const items = rawItems\n .map(item => Number(String(item).trim()))\n .filter(item => Number.isFinite(item))\n return items.length ? items : fallback\n}\n\nexport function readString(value: unknown, fallback: string): string {\n return typeof value === 'string' && value.trim() ? value.trim() : fallback\n}\n\nexport function readOptionalString(value: unknown): string | undefined {\n return typeof value === 'string' && value.trim() ? value.trim() : undefined\n}\n\nexport function readInteger(value: unknown, fallback: number): number {\n const parsed = typeof value === 'number'\n ? value\n : typeof value === 'string'\n ? Number(value)\n : Number.NaN\n return Number.isFinite(parsed) ? Math.max(1, Math.round(parsed)) : fallback\n}\n\nexport function readNumber(value: unknown, fallback: number): number {\n const parsed = typeof value === 'number'\n ? value\n : typeof value === 'string'\n ? Number(value)\n : Number.NaN\n return Number.isFinite(parsed) ? parsed : fallback\n}\n\nexport function readBoolean(value: unknown, fallback: boolean): boolean {\n return typeof value === 'boolean' ? value : fallback\n}\n","import type {\n BioTemplateEnvelope,\n TemplateCollection,\n TemplateCollectionEnvelope,\n TemplateId,\n} from './types'\nimport { isRecord } from './builderReadUtils'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport const TEMPLATE_COLLECTION_KEY = 'templates'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createTemplateEnvelope<TData>(\n templateId: TemplateId,\n data: TData,\n metadata: Record<string, unknown> = {},\n templateVersion = '1.0'\n): BioTemplateEnvelope<TData> {\n return {\n template_id: templateId,\n template_version: templateVersion,\n kind: 'experiment-design',\n data,\n metadata,\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createTemplateCollection(\n templates: Array<BioTemplateEnvelope<unknown>>,\n metadata?: Record<string, unknown>\n): TemplateCollectionEnvelope {\n const collection: TemplateCollection = {}\n for (const template of templates) {\n assertGenericTemplateEnvelope(template)\n const templateId = template.template_id\n if (collection[templateId]) {\n throw new Error(`Duplicate template_id '${templateId}' in template collection.`)\n }\n collection[templateId] = template\n }\n\n return metadata === undefined\n ? { [TEMPLATE_COLLECTION_KEY]: collection }\n : { [TEMPLATE_COLLECTION_KEY]: collection, metadata }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function extractTemplateCollection(value: unknown): TemplateCollection {\n if (isEnvelope<unknown>(value)) {\n assertGenericTemplateEnvelope(value)\n return { [value.template_id]: value }\n }\n if (!isRecord(value)) {\n throw new Error('Template collection payload must be an object.')\n }\n\n const rawCollection = value[TEMPLATE_COLLECTION_KEY]\n if (rawCollection === undefined) {\n return {}\n }\n if (!isRecord(rawCollection)) {\n throw new Error('Template collection must be an object.')\n }\n\n const collection: TemplateCollection = {}\n for (const [templateId, template] of Object.entries(rawCollection)) {\n assertGenericTemplateEnvelope(template)\n if (template.template_id !== templateId) {\n throw new Error(\n `Template collection key '${templateId}' does not match envelope template_id '${template.template_id}'.`\n )\n }\n collection[templateId] = template\n }\n return collection\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function ensureTemplateFromCollection<TTemplate extends BioTemplateEnvelope<unknown>>(\n value: unknown,\n templateId: TemplateId | string\n): TTemplate {\n const collection = extractTemplateCollection(value)\n const template = collection[templateId]\n if (!template) {\n throw new Error(`Template '${templateId}' was not found in template collection.`)\n }\n assertTemplateEnvelope(template, templateId)\n return template as TTemplate\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function assertTemplateEnvelope<TData>(\n value: unknown,\n templateId: TemplateId | string\n): asserts value is BioTemplateEnvelope<TData> {\n assertGenericTemplateEnvelope(value)\n if (value.template_id !== templateId) {\n throw new Error(`Expected template_id '${templateId}', got '${String(value.template_id)}'.`)\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function ensureTemplateEnvelope<TTemplate extends BioTemplateEnvelope<unknown>>(\n value: unknown,\n templateId: TemplateId | string\n): TTemplate {\n assertTemplateEnvelope(value, templateId)\n return value as TTemplate\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function getTemplateData<TData>(\n template: BioTemplateEnvelope<TData> | TData,\n templateId?: TemplateId | string\n): TData {\n if (isEnvelope<TData>(template)) {\n if (templateId) assertTemplateEnvelope<TData>(template, templateId)\n return template.data\n }\n return template\n}\n\nfunction assertGenericTemplateEnvelope(value: unknown): asserts value is BioTemplateEnvelope<unknown> {\n if (!isRecord(value)) {\n throw new Error('Template envelope must be an object.')\n }\n if (typeof value.template_id !== 'string' || value.template_id.length === 0) {\n throw new Error('Template envelope requires a template_id string.')\n }\n if (typeof value.template_version !== 'string' || value.template_version.length === 0) {\n throw new Error('Template envelope requires a template_version string.')\n }\n if (!isRecord(value.data)) {\n throw new Error('Template envelope data must be an object.')\n }\n if ('metadata' in value && !isRecord(value.metadata)) {\n throw new Error('Template envelope metadata must be an object.')\n }\n}\n\nfunction isEnvelope<TData>(value: unknown): value is BioTemplateEnvelope<TData> {\n return isRecord(value) && 'template_id' in value && 'data' in value\n}\n","/** Normalize human-facing template lookup terms so spaces, hyphens, and underscores behave the same. */\nexport function normalizeTemplateLookupKey(value: string): string {\n return value.trim().toLowerCase().replace(/[\\s_-]+/g, '-')\n}\n\nexport function templateIdentifierMatches(query: string, identifiers: readonly string[]): boolean {\n const normalizedQuery = normalizeTemplateLookupKey(query)\n return identifiers.some(value => normalizeTemplateLookupKey(value) === normalizedQuery)\n}\n\nexport function templateSearchMatches(query: string, values: readonly string[]): boolean {\n const lowerQuery = query.trim().toLowerCase()\n const normalizedQuery = normalizeTemplateLookupKey(query)\n return values.some(value =>\n value.toLowerCase().includes(lowerQuery)\n || normalizeTemplateLookupKey(value).includes(normalizedQuery),\n )\n}\n","import type { TemplateId } from './types'\n\nimport { templateIdentifierMatches, templateSearchMatches } from './lookup'\n\nexport interface BioTemplateCatalogEntry {\n name: TemplateId\n template_id: TemplateId\n template_version: string\n label: string\n category: 'bio-data'\n purpose: string\n aliases: readonly string[]\n python_import: string\n python_example: string\n frontend_import: string\n frontend_adapters: readonly string[]\n components: readonly string[]\n add_command: string\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport const bioTemplateCatalog = [\n {\n name: 'plate-map',\n template_id: 'plate-map',\n template_version: '1.0',\n label: 'Plate map',\n category: 'bio-data',\n purpose: 'Plate layout, wells, sample assignments, and sample legend data.',\n aliases: ['wellplate', 'well-plate', 'plate layout', 'plate-map editor'],\n python_import: 'from mint_sdk.templates import PlateMapTemplate, save_template',\n python_example: 'PlateMapTemplate.create_96_well(name=\"Plate 1\", samples=[\"Control\", \"Treatment\"])',\n frontend_import: \"import { toPlateMapEditorState, toWellPlateWells } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toPlateMapEditorState', 'toWellPlateWells'],\n components: ['PlateEditor', 'WellPlate', 'SampleLegend'],\n add_command: 'mint add data-template plate-map --page',\n },\n {\n name: 'sample-sheet',\n template_id: 'sample-sheet',\n template_version: '1.0',\n label: 'Sample sheet',\n category: 'bio-data',\n purpose: 'Tabular sample metadata, display columns, and group definitions.',\n aliases: ['sample metadata', 'sample table', 'metadata sheet', 'csv samples'],\n python_import: 'from mint_sdk.templates import SampleSheetTemplate, save_template',\n python_example: 'SampleSheetTemplate.from_rows([{\"sample_id\": \"S001\", \"name\": \"Control 1\", \"group\": \"Control\"}])',\n frontend_import: \"import { toTemplateDataFrame, toSampleOptions } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toSampleDataFrame', 'toSampleRows', 'toSampleColumns', 'toSampleOptions'],\n components: ['DataFrame', 'SampleSelector', 'GroupAssigner'],\n add_command: 'mint add data-template sample-sheet --page',\n },\n {\n name: 'sample-prep',\n template_id: 'sample-prep',\n template_version: '1.0',\n label: 'Sample prep',\n category: 'bio-data',\n purpose: 'Extraction, dilution, normalization, transfer, source/destination, volume, reagent, and status steps.',\n aliases: ['sample preparation', 'extraction', 'dilution', 'normalization', 'prep steps'],\n python_import: 'from mint_sdk.templates import SamplePrepTemplate, save_template',\n python_example: 'SamplePrepTemplate.create([\"S001\", \"S002\"], prep_type=\"extraction\", output_volume=50)',\n frontend_import: \"import { toSamplePrepDataFrame, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toSamplePrepDataFrame', 'toSamplePrepRows', 'toSamplePrepColumns'],\n components: ['DataFrame', 'ProtocolStepEditor', 'SampleSelector', 'WellPlate'],\n add_command: 'mint add data-template sample-prep --page',\n },\n {\n name: 'dose-response',\n template_id: 'dose-response',\n template_version: '1.0',\n label: 'Dose response',\n category: 'bio-data',\n purpose: 'Compounds, concentration series, controls, replicates, and optional plate layout.',\n aliases: [\n 'drug response',\n 'concentration series',\n 'dose curve',\n 'dose design',\n 'dose planner',\n 'dose calculator',\n 'drp',\n ],\n python_import: 'from mint_sdk.templates import ControlDefinition, DoseResponseTemplate, save_template',\n python_example: 'DoseResponseTemplate.create({\"Compound A\": [10, 1, 0.1]}, unit=\"uM\", replicates=3)',\n frontend_import: \"import { toDoseConditions, toDoseLayoutState } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toDoseConditions', 'toDoseLayoutState'],\n components: ['DoseCalculator', 'ReagentEditor', 'WellPlate'],\n add_command: 'mint add data-template dose-response --page',\n },\n {\n name: 'calibration-curve',\n template_id: 'calibration-curve',\n template_version: '1.0',\n label: 'Calibration curve',\n category: 'bio-data',\n purpose: 'Standard curves, blank/QC points, fitted model settings, and acceptance thresholds.',\n aliases: ['standard curve', 'calibration', 'quantitation', 'qc acceptance', 'calibrator'],\n python_import: 'from mint_sdk.templates import CalibrationCurveTemplate, save_template',\n python_example: 'CalibrationCurveTemplate.create([0.1, 1, 10, 100], analyte=\"Glucose\", unit=\"uM\")',\n frontend_import: \"import { toCalibrationCurveDataFrame, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toCalibrationCurveDataFrame', 'toCalibrationCurveRows', 'toCalibrationCurveColumns'],\n components: ['DataFrame', 'FitPanel', 'ChartContainer'],\n add_command: 'mint add data-template calibration-curve --page',\n },\n {\n name: 'time-course',\n template_id: 'time-course',\n template_version: '1.0',\n label: 'Time course',\n category: 'bio-data',\n purpose: 'Longitudinal time points, conditions, replicates, and scheduled samples.',\n aliases: ['longitudinal', 'time series', 'sampling schedule', 'kinetics'],\n python_import: 'from mint_sdk.templates import TimeCourseTemplate, save_template',\n python_example: 'TimeCourseTemplate.create([0, 6, 24], unit=\"hour\", conditions=[\"Control\", \"Treatment\"], replicates=3)',\n frontend_import: \"import { toTemplateDataFrame, toTimeCourseSteps } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toTimeCourseDataFrame', 'toTimeCourseRows', 'toTimeCourseSteps', 'toTimeCourseColumns'],\n components: ['ExperimentTimeline', 'DataFrame', 'ScheduleCalendar'],\n add_command: 'mint add data-template time-course --page',\n },\n {\n name: 'protocol-steps',\n template_id: 'protocol-steps',\n template_version: '1.0',\n label: 'Protocol steps',\n category: 'bio-data',\n purpose: 'Ordered experiment protocol steps, durations, statuses, and run-sheet parameters.',\n aliases: ['protocol', 'run sheet', 'workflow', 'method steps', 'sop'],\n python_import: 'from mint_sdk.templates import ProtocolStepsTemplate, save_template',\n python_example: 'ProtocolStepsTemplate.create([\"Seed cells\", \"Add treatment\", \"Measure viability\"])',\n frontend_import: \"import { toProtocolSteps, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toProtocolSteps', 'toProtocolDataFrame'],\n components: ['ExperimentTimeline', 'ProtocolStepEditor', 'DataFrame'],\n add_command: 'mint add data-template protocol-steps --page',\n },\n {\n name: 'assay-matrix',\n template_id: 'assay-matrix',\n template_version: '1.0',\n label: 'Assay matrix',\n category: 'bio-data',\n purpose: 'Sample-by-feature measurement matrices for omics, plate-reader, and marker assays.',\n aliases: ['omics matrix', 'measurement matrix', 'readout matrix', 'feature table'],\n python_import: 'from mint_sdk.templates import AssayMatrixTemplate, save_template',\n python_example: 'AssayMatrixTemplate.create(samples=[\"S001\", \"S002\"], features=[\"Lactate\", \"Glucose\"])',\n frontend_import: \"import { toAssayMatrixSampleOptions, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toAssayMatrixDataFrame', 'toAssayMatrixRows', 'toAssayMatrixColumns', 'toAssayMatrixSampleOptions'],\n components: ['DataFrame', 'ChartContainer', 'SampleSelector'],\n add_command: 'mint add data-template assay-matrix --page',\n },\n {\n name: 'reagent-list',\n template_id: 'reagent-list',\n template_version: '1.0',\n label: 'Reagent list',\n category: 'bio-data',\n purpose: 'Experiment reagents, catalog numbers, lots, storage, locations, and stock status.',\n aliases: ['reagents', 'inventory', 'antibodies', 'primers', 'compound stocks'],\n python_import: 'from mint_sdk.templates import ReagentListTemplate, save_template',\n python_example: 'ReagentListTemplate.create([\"DMSO\", \"Compound A\", \"Anti-HA antibody\"])',\n frontend_import: \"import { toReagentListItems, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toReagentDataFrame', 'toReagentListItems'],\n components: ['ReagentList', 'DataFrame', 'ReagentEditor'],\n add_command: 'mint add data-template reagent-list --page',\n },\n {\n name: 'flow-cytometry-panel',\n template_id: 'flow-cytometry-panel',\n template_version: '1.0',\n label: 'Flow cytometry panel',\n category: 'bio-data',\n purpose: 'Flow-cytometry markers, fluorophores, detectors, compensation controls, and panel metadata.',\n aliases: ['flow panel', 'facs panel', 'cytometry panel', 'antibody panel'],\n python_import: 'from mint_sdk.templates import FlowCytometryPanelTemplate, save_template',\n python_example: 'FlowCytometryPanelTemplate.create([\"CD3\", \"CD4\", \"CD8\"], instrument=\"BD LSRFortessa\")',\n frontend_import: \"import { toFlowPanelDataFrame, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toFlowPanelDataFrame', 'toFlowPanelRows', 'toFlowPanelColumns'],\n components: ['DataFrame', 'ReagentList', 'SampleSelector'],\n add_command: 'mint add data-template flow-cytometry-panel --page',\n },\n {\n name: 'instrument-run',\n template_id: 'instrument-run',\n template_version: '1.0',\n label: 'Instrument run',\n category: 'bio-data',\n purpose: 'Instrument sequence tables, sample queues, methods, QC, blanks, and acquisition status.',\n aliases: ['run queue', 'sequence table', 'sample queue', 'lcms run', 'instrument sequence', 'batch run'],\n python_import: 'from mint_sdk.templates import InstrumentRunTemplate, save_template',\n python_example: 'InstrumentRunTemplate.create([\"S001\", \"S002\"], instrument=\"LC-MS\")',\n frontend_import: \"import { toInstrumentRunDataFrame, toInstrumentRunScheduleEvents, toInstrumentRunSteps, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toInstrumentRunDataFrame', 'toInstrumentRunRows', 'toInstrumentRunColumns', 'toInstrumentRunSteps', 'toInstrumentRunScheduleEvents'],\n components: ['DataFrame', 'ExperimentTimeline', 'ScheduleCalendar', 'SampleSelector'],\n add_command: 'mint add data-template instrument-run --page',\n },\n {\n name: 'qpcr-plate',\n template_id: 'qpcr-plate',\n template_version: '1.0',\n label: 'qPCR plate',\n category: 'bio-data',\n purpose: 'qPCR/ddPCR plate layouts, samples, targets, replicate reactions, controls, and Cq fields.',\n aliases: ['qpcr', 'qPCR', 'ddpcr', 'rt-qpcr', 'gene expression', 'primer plate'],\n python_import: 'from mint_sdk.templates import QpcrPlateTemplate, save_template',\n python_example: 'QpcrPlateTemplate.create(samples=[\"Control\", \"Treatment\"], targets=[\"ACTB\", \"GAPDH\"], replicates=3)',\n frontend_import: \"import { toQpcrDataFrame, toQpcrWellPlateWells, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toQpcrDataFrame', 'toQpcrRows', 'toQpcrColumns', 'toQpcrWellPlateWells'],\n components: ['DataFrame', 'WellPlate', 'SampleSelector'],\n add_command: 'mint add data-template qpcr-plate --page',\n },\n] as const satisfies readonly BioTemplateCatalogEntry[]\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function listBioTemplateCatalog(): readonly BioTemplateCatalogEntry[] {\n return bioTemplateCatalog\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function getBioTemplateInfo(name: string): BioTemplateCatalogEntry | undefined {\n return bioTemplateCatalog.find(entry => {\n const identifiers = [\n entry.name,\n entry.template_id,\n entry.label,\n ...entry.aliases,\n ]\n return templateIdentifierMatches(name, identifiers)\n })\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function searchBioTemplateCatalog(query: string): readonly BioTemplateCatalogEntry[] {\n const normalized = query.trim().toLowerCase()\n if (!normalized) return bioTemplateCatalog\n\n return bioTemplateCatalog.filter(entry => templateSearchMatches(normalized, [\n entry.name,\n entry.template_id,\n entry.label,\n entry.purpose,\n entry.python_import,\n entry.python_example,\n entry.frontend_import,\n entry.add_command,\n ...entry.aliases,\n ...entry.frontend_adapters,\n ...entry.components,\n ]))\n}\n","import { bioTemplateCatalog } from './catalog'\nimport type { TemplateId, TemplatePackId } from './types'\n\nimport { templateIdentifierMatches, templateSearchMatches } from './lookup'\n\nexport interface BioTemplatePackEntry {\n name: TemplatePackId\n label: string\n category: 'bio-template-pack'\n purpose: string\n templates: readonly TemplateId[]\n aliases: readonly string[]\n frontend_adapters: readonly string[]\n components: readonly string[]\n add_command: string\n docs_command: string\n}\n\ninterface BioTemplatePackDefinition {\n name: TemplatePackId\n label: string\n purpose: string\n templates: readonly TemplateId[]\n aliases: readonly string[]\n}\n\nconst templateInfoById = new Map(\n bioTemplateCatalog.map(entry => [entry.template_id, entry]),\n)\n\nfunction collectTemplateField(\n templateIds: readonly TemplateId[],\n field: 'frontend_adapters' | 'components',\n): readonly string[] {\n const values: string[] = []\n for (const templateId of templateIds) {\n const entry = templateInfoById.get(templateId)\n if (!entry) {\n throw new Error(`Unknown bio template in pack catalog: ${templateId}`)\n }\n for (const value of entry[field]) {\n if (!values.includes(value)) {\n values.push(value)\n }\n }\n }\n return values\n}\n\nfunction createPack(definition: BioTemplatePackDefinition): BioTemplatePackEntry {\n return {\n ...definition,\n category: 'bio-template-pack',\n frontend_adapters: collectTemplateField(definition.templates, 'frontend_adapters'),\n components: collectTemplateField(definition.templates, 'components'),\n add_command: `mint add data-template-pack ${definition.name} --page`,\n docs_command: `mint docs template-pack ${definition.name}`,\n }\n}\n\nconst bioTemplatePackDefinitions = [\n {\n name: 'cell-culture-screen',\n label: 'Cell culture screen',\n purpose: 'Plate layout, sample metadata, sample prep, reagents, protocol, dose-response, and flow-panel setup.',\n templates: [\n 'sample-sheet',\n 'sample-prep',\n 'plate-map',\n 'reagent-list',\n 'protocol-steps',\n 'dose-response',\n 'flow-cytometry-panel',\n ],\n aliases: ['cell culture', 'screen', 'drug screen', 'plate screen'],\n },\n {\n name: 'omics-assay',\n label: 'Omics assay',\n purpose: 'Sample metadata, sample prep, reagents, protocol, instrument run queue, calibration curve, and measurement matrix.',\n templates: [\n 'sample-sheet',\n 'sample-prep',\n 'reagent-list',\n 'protocol-steps',\n 'instrument-run',\n 'calibration-curve',\n 'assay-matrix',\n ],\n aliases: [\n 'omics',\n 'metabolomics',\n 'metabolism',\n 'metabolite profiling',\n 'proteomics',\n 'assay matrix',\n 'lcms',\n 'standard curve',\n ],\n },\n {\n name: 'longitudinal-study',\n label: 'Longitudinal study',\n purpose: 'Sample metadata, time-course schedule, protocol, and measurement matrix.',\n templates: [\n 'sample-sheet',\n 'time-course',\n 'protocol-steps',\n 'assay-matrix',\n ],\n aliases: ['time series', 'time-course study', 'kinetics', 'longitudinal'],\n },\n {\n name: 'molecular-assay',\n label: 'Molecular assay',\n purpose: 'Sample metadata, sample prep, reagents, protocol, instrument run queue, calibration curve, and qPCR/ddPCR plate setup.',\n templates: [\n 'sample-sheet',\n 'sample-prep',\n 'reagent-list',\n 'protocol-steps',\n 'instrument-run',\n 'calibration-curve',\n 'qpcr-plate',\n ],\n aliases: ['molecular', 'qpcr', 'qPCR', 'gene expression', 'rt-qpcr', 'ddpcr'],\n },\n] as const satisfies readonly BioTemplatePackDefinition[]\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport const bioTemplatePacks = bioTemplatePackDefinitions.map(createPack) as readonly BioTemplatePackEntry[]\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function listBioTemplatePacks(): readonly BioTemplatePackEntry[] {\n return bioTemplatePacks\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function getBioTemplatePackInfo(name: string): BioTemplatePackEntry | undefined {\n return bioTemplatePacks.find(entry => {\n const identifiers = [\n entry.name,\n entry.label,\n ...entry.aliases,\n ]\n return templateIdentifierMatches(name, identifiers)\n })\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function searchBioTemplatePacks(query: string): readonly BioTemplatePackEntry[] {\n const normalized = query.trim().toLowerCase()\n if (!normalized) return bioTemplatePacks\n\n return bioTemplatePacks.filter(entry => templateSearchMatches(normalized, [\n entry.name,\n entry.label,\n entry.purpose,\n entry.add_command,\n entry.docs_command,\n ...entry.templates,\n ...entry.aliases,\n ...entry.frontend_adapters,\n ...entry.components,\n ]))\n}\n","import type { TemplateId, TemplatePresetId } from './types'\n\nimport { templateIdentifierMatches, templateSearchMatches } from './lookup'\n\nexport interface BioTemplatePresetEntry {\n name: TemplatePresetId\n label: string\n category: 'bio-template-preset'\n purpose: string\n templates: readonly TemplateId[]\n aliases: readonly string[]\n python_import: string\n python_example: string\n frontend_import: string\n frontend_adapters: readonly string[]\n components: readonly string[]\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport const bioTemplatePresets = [\n {\n name: 'wellplate-screen',\n label: 'Well-plate screen',\n category: 'bio-template-preset',\n purpose: 'Plate map, sample sheet, and dose-response payloads for plate-based screening assays.',\n templates: ['plate-map', 'sample-sheet', 'dose-response'],\n aliases: [\n 'wellplate',\n 'well-plate screen',\n 'drug screen',\n 'plate screen',\n 'dose response plate',\n 'dose design',\n 'dose planner',\n ],\n python_import: 'from mint_sdk.templates import create_wellplate_screen_collection, save_template_collection',\n python_example: 'create_wellplate_screen_collection(samples=[\"Control\", \"Treatment\"], compounds={\"Drug A\": [10, 1, 0.1]}, unit=\"uM\")',\n frontend_import: \"import { createWellPlateScreenCollection, toPlateMapEditorState, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toPlateMapEditorState', 'toTemplateDataFrame', 'toDoseConditions'],\n components: ['PlateEditor', 'WellPlate', 'DataFrame', 'DoseCalculator'],\n },\n {\n name: 'qpcr-expression',\n label: 'qPCR expression',\n category: 'bio-template-preset',\n purpose: 'Sample metadata and qPCR/ddPCR plate layout for target-expression assays.',\n templates: ['sample-sheet', 'qpcr-plate'],\n aliases: ['qpcr', 'qPCR', 'rt-qpcr', 'ddpcr', 'gene expression', 'primer plate'],\n python_import: 'from mint_sdk.templates import create_qpcr_expression_collection, save_template_collection',\n python_example: 'create_qpcr_expression_collection(samples=[\"Control\", \"Treatment\"], targets=[\"ACTB\", \"GAPDH\"], replicates=3)',\n frontend_import: \"import { createQpcrExpressionCollection, toQpcrWellPlateWells, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toQpcrDataFrame', 'toQpcrWellPlateWells'],\n components: ['DataFrame', 'WellPlate', 'SampleSelector'],\n },\n {\n name: 'lcms-batch',\n label: 'LC-MS batch',\n category: 'bio-template-preset',\n purpose: 'Sample metadata, instrument queue, and assay matrix payloads for omics acquisition batches.',\n templates: ['sample-sheet', 'instrument-run', 'assay-matrix'],\n aliases: [\n 'lcms',\n 'lc-ms',\n 'mass spec batch',\n 'omics batch',\n 'metabolomics',\n 'metabolism',\n 'metabolite profiling',\n 'run queue',\n 'sequence table',\n ],\n python_import: 'from mint_sdk.templates import create_lcms_batch_collection, save_template_collection',\n python_example: 'create_lcms_batch_collection(samples=[\"S001\", \"S002\"], features=[\"Glucose\", \"Lactate\"], instrument=\"LC-MS\")',\n frontend_import: \"import { createLcmsBatchCollection, toAssayMatrixSampleOptions, toInstrumentRunDataFrame, toInstrumentRunScheduleEvents, toInstrumentRunSteps, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toInstrumentRunDataFrame', 'toInstrumentRunSteps', 'toInstrumentRunScheduleEvents', 'toAssayMatrixDataFrame', 'toAssayMatrixSampleOptions'],\n components: ['DataFrame', 'ExperimentTimeline', 'ScheduleCalendar', 'ChartContainer', 'SampleSelector'],\n },\n {\n name: 'targeted-metabolomics',\n label: 'Targeted metabolomics',\n category: 'bio-template-preset',\n purpose: 'Sample metadata, extraction prep, internal standards, LC/GC-MS sequence, calibration curve, and metabolite readout matrix for quantitative metabolomics.',\n templates: ['sample-sheet', 'sample-prep', 'reagent-list', 'instrument-run', 'calibration-curve', 'assay-matrix'],\n aliases: [\n 'targeted metabolomics',\n 'quantitative metabolomics',\n 'lc-ms metabolomics',\n 'gc-ms metabolomics',\n 'targeted lcms',\n 'metabolite quantitation',\n 'mass spec quantitation',\n 'internal standards',\n 'peak area ratio',\n ],\n python_import: 'from mint_sdk.templates import create_targeted_metabolomics_collection, save_template_collection',\n python_example: 'create_targeted_metabolomics_collection(samples=[\"S001\", \"S002\"], metabolites=[\"Glucose\", \"Lactate\"], internal_standards=[\"13C Glucose\"], instrument=\"LC-MS\")',\n frontend_import: \"import { createTargetedMetabolomicsCollection, toInstrumentRunDataFrame, toCalibrationCurveDataFrame, toAssayMatrixDataFrame, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toSamplePrepDataFrame', 'toReagentDataFrame', 'toInstrumentRunDataFrame', 'toInstrumentRunSteps', 'toInstrumentRunScheduleEvents', 'toCalibrationCurveDataFrame', 'toAssayMatrixDataFrame', 'toAssayMatrixSampleOptions'],\n components: ['DataFrame', 'ReagentList', 'ExperimentTimeline', 'ScheduleCalendar', 'FitPanel', 'ChartContainer', 'SampleSelector'],\n },\n {\n name: 'elisa-assay',\n label: 'ELISA assay',\n category: 'bio-template-preset',\n purpose: 'Plate layout, sample metadata, standard curve, and readout matrix for ELISA and plate-reader assays.',\n templates: ['plate-map', 'sample-sheet', 'calibration-curve', 'assay-matrix'],\n aliases: ['elisa', 'plate reader assay', 'standard curve plate', 'absorbance assay', 'immunoassay'],\n python_import: 'from mint_sdk.templates import create_elisa_assay_collection, save_template_collection',\n python_example: 'create_elisa_assay_collection(samples=[\"Control\", \"Treatment\"], analyte=\"IL-6\", standard_concentrations=[1000, 100, 10, 1], unit=\"pg/mL\")',\n frontend_import: \"import { createElisaAssayCollection, toPlateMapEditorState, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toPlateMapEditorState', 'toTemplateDataFrame', 'toCalibrationCurveDataFrame'],\n components: ['PlateEditor', 'WellPlate', 'DataFrame', 'FitPanel', 'ChartContainer'],\n },\n {\n name: 'flow-cytometry-assay',\n label: 'Flow cytometry assay',\n category: 'bio-template-preset',\n purpose: 'Sample metadata, antibody marker panel, compensation controls, and readout matrix for flow-cytometry assays.',\n templates: ['sample-sheet', 'flow-cytometry-panel', 'assay-matrix'],\n aliases: [\n 'flow cytometry',\n 'facs',\n 'facs panel',\n 'flow panel',\n 'immune phenotyping',\n 'immunophenotyping',\n ],\n python_import: 'from mint_sdk.templates import create_flow_cytometry_assay_collection, save_template_collection',\n python_example: 'create_flow_cytometry_assay_collection(samples=[\"Control\", \"Treatment\"], markers=[\"CD3\", \"CD4\", \"CD8\"], instrument=\"BD LSRFortessa\")',\n frontend_import: \"import { createFlowCytometryAssayCollection, toFlowPanelDataFrame, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toFlowPanelDataFrame', 'toAssayMatrixDataFrame'],\n components: ['DataFrame', 'SampleSelector', 'ChartContainer'],\n },\n {\n name: 'western-blot-assay',\n label: 'Western blot assay',\n category: 'bio-template-preset',\n purpose: 'Sample metadata, antibody/reagent list, protocol steps, and normalized protein readout matrix for Western blot assays.',\n templates: ['sample-sheet', 'reagent-list', 'protocol-steps', 'assay-matrix'],\n aliases: ['western blot', 'western-blot', 'immunoblot', 'protein blot', 'protein expression'],\n python_import: 'from mint_sdk.templates import create_western_blot_assay_collection, save_template_collection',\n python_example: 'create_western_blot_assay_collection(samples=[\"Control\", \"Treatment\"], targets=[\"pERK\", \"ERK\"], loading_control=\"ACTB\")',\n frontend_import: \"import { createWesternBlotAssayCollection, toReagentDataFrame, toProtocolDataFrame, toTemplateDataFrame } from '@morscherlab/mint-sdk/templates'\",\n frontend_adapters: ['toTemplateDataFrame', 'toReagentDataFrame', 'toProtocolDataFrame'],\n components: ['DataFrame', 'ReagentList', 'ExperimentTimeline', 'SampleSelector'],\n },\n] as const satisfies readonly BioTemplatePresetEntry[]\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function listBioTemplatePresets(): readonly BioTemplatePresetEntry[] {\n return bioTemplatePresets\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function getBioTemplatePresetInfo(name: string): BioTemplatePresetEntry | undefined {\n return bioTemplatePresets.find(entry => {\n const identifiers = [\n entry.name,\n entry.label,\n ...entry.aliases,\n ]\n return templateIdentifierMatches(name, identifiers)\n })\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function searchBioTemplatePresets(query: string): readonly BioTemplatePresetEntry[] {\n const normalized = query.trim().toLowerCase()\n if (!normalized) return bioTemplatePresets\n\n return bioTemplatePresets.filter(entry => templateSearchMatches(normalized, [\n entry.name,\n entry.label,\n entry.purpose,\n entry.python_import,\n entry.python_example,\n entry.frontend_import,\n ...entry.templates,\n ...entry.aliases,\n ...entry.frontend_adapters,\n ...entry.components,\n ]))\n}\n","import { isObjectLike as isRecord } from '../utils/records'\nimport { extractTemplateCollection } from './templateEnvelopes'\nimport { getBioTemplateInfo } from './catalog'\nimport { getBioTemplatePackInfo } from './packs'\nimport { getBioTemplatePresetInfo } from './presets'\nimport type {\n BioTemplateEnvelope,\n TemplateCollectionEnvelope,\n TemplateId,\n TemplatePackId,\n TemplatePresetId,\n} from './types'\n\ntype BioTemplateComponentTarget =\n | TemplateId\n | TemplatePackId\n | TemplatePresetId\n | string\n | BioTemplateEnvelope<unknown>\n | TemplateCollectionEnvelope\n\nexport function resolveComponentTemplateIds(target: BioTemplateComponentTarget): TemplateId[] {\n if (typeof target === 'string') {\n const preset = getBioTemplatePresetInfo(target)\n if (preset) return [...preset.templates]\n const pack = getBioTemplatePackInfo(target)\n if (pack) return [...pack.templates]\n const template = getBioTemplateInfo(target)\n return template ? [template.template_id] : []\n }\n\n if (isTemplateEnvelope(target)) {\n const template = getBioTemplateInfo(target.template_id)\n return template ? [template.template_id] : []\n }\n\n const presetName = collectionPresetName(target)\n if (presetName) {\n const preset = getBioTemplatePresetInfo(presetName)\n if (preset) return [...preset.templates]\n }\n\n const packName = collectionPackName(target)\n if (packName) {\n const pack = getBioTemplatePackInfo(packName)\n if (pack) return [...pack.templates]\n }\n\n return Object.keys(extractTemplateCollection(target))\n .map(templateId => getBioTemplateInfo(templateId)?.template_id)\n .filter((templateId): templateId is TemplateId => templateId !== undefined)\n}\n\nexport function isTemplateEnvelope(value: unknown): value is BioTemplateEnvelope<unknown> {\n return isRecord(value) && typeof value.template_id === 'string' && 'data' in value\n}\n\nfunction collectionPresetName(value: unknown): string | undefined {\n if (!isRecord(value) || !isRecord(value.metadata)) return undefined\n return typeof value.metadata.preset === 'string' ? value.metadata.preset : undefined\n}\n\nfunction collectionPackName(value: unknown): string | undefined {\n if (!isRecord(value) || !isRecord(value.metadata)) return undefined\n return typeof value.metadata.pack === 'string' ? value.metadata.pack : undefined\n}\n\n","interface CloneableComponentBinding {\n adapters: readonly string[]\n props: readonly string[]\n}\n\ninterface NamedComponentBinding {\n template_id: string\n component: string\n}\n\ninterface ComponentImportStatement {\n statement: string\n}\n\nexport function cloneBindingMap<TName extends string, TBinding extends CloneableComponentBinding>(\n bindings: Record<TName, readonly TBinding[]>\n): Record<TName, TBinding[]> {\n const result = {} as Record<TName, TBinding[]>\n for (const name of Object.keys(bindings) as TName[]) {\n result[name] = cloneBindings(bindings[name])\n }\n return result\n}\n\nexport function cloneBindings<TBinding extends CloneableComponentBinding>(\n bindings: readonly TBinding[]\n): TBinding[] {\n return bindings.map(cloneBinding)\n}\n\nexport function cloneBinding<TBinding extends CloneableComponentBinding>(binding: TBinding): TBinding {\n return {\n ...binding,\n adapters: [...binding.adapters],\n props: [...binding.props],\n }\n}\n\nexport function uniquePropsName(\n binding: NamedComponentBinding,\n usedNames: Map<string, number>\n): string {\n const base = toCamelIdentifier(`${binding.template_id} ${binding.component} props`)\n const count = usedNames.get(base) ?? 0\n usedNames.set(base, count + 1)\n return count === 0 ? base : `${base}${count + 1}`\n}\n\nfunction toCamelIdentifier(value: string): string {\n const words = value\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .split(/[^A-Za-z0-9]+/)\n .filter(Boolean)\n\n if (words.length === 0) return 'componentProps'\n\n return words\n .map((word, index) => {\n const lower = word.toLowerCase()\n return index === 0 ? lower : lower.charAt(0).toUpperCase() + lower.slice(1)\n })\n .join('')\n}\n\nexport function toVueSfc(\n imports: readonly ComponentImportStatement[],\n setupLines: readonly string[],\n template: string,\n includeTargetTypeImport: boolean\n): string {\n const importLines = [\n ...imports.map(item => item.statement),\n \"import { toBioTemplateComponentProps } from '@morscherlab/mint-sdk/templates'\",\n ...(includeTargetTypeImport\n ? [\"import type { BioTemplateEnvelope, TemplateCollectionEnvelope } from '@morscherlab/mint-sdk/templates'\"]\n : []),\n ]\n const templateLines = template\n ? template.split('\\n').map(line => ` ${line}`).join('\\n')\n : ''\n\n return [\n '<script setup lang=\"ts\">',\n ...importLines,\n '',\n ...setupLines,\n '</script>',\n '',\n '<template>',\n templateLines,\n '</template>',\n ].join('\\n')\n}\n","import type { TemplateId } from './types'\n\ninterface ComponentBinding {\n id: string\n template_id: TemplateId\n component: string\n adapters: readonly string[]\n props: readonly string[]\n description: string\n importPath: '@morscherlab/mint-sdk'\n}\n\nexport const templateComponentBindings = {\n 'plate-map': [\n binding('plate-map', 'PlateEditor', ['toPlateMapEditorState', 'racksFromPlateState'], ['modelValue', 'activeRackId', 'groups', 'formats', 'wellFields'], 'Edit plate layouts and assign sample groups from plate-map template data.'),\n binding('plate-map', 'WellPlate', ['toWellPlateWells'], ['format', 'wells', 'sampleColors', 'legendItems'], 'Render the active plate as a well grid.'),\n ],\n 'sample-sheet': [\n binding('sample-sheet', 'DataFrame', ['toTemplateDataFrame'], ['data', 'columns', 'rowKey'], 'Render sample metadata as a sortable table.'),\n binding('sample-sheet', 'SampleSelector', ['toSampleOptions'], ['samples', 'modelValue'], 'Select samples from sample-sheet records.'),\n ],\n 'sample-prep': [\n binding('sample-prep', 'DataFrame', ['toTemplateDataFrame'], ['data', 'columns', 'rowKey'], 'Render preparation steps as a table.'),\n ],\n 'dose-response': [\n binding('dose-response', 'DoseCalculator', ['toDoseConditions'], ['mode', 'targetWells'], 'Configure serial dilution and apply concentrations to wells.'),\n binding('dose-response', 'WellPlate', ['toDoseLayoutState'], ['format', 'wells', 'sampleColors', 'legendItems'], 'Render the optional dose-response plate layout.'),\n ],\n 'calibration-curve': [\n binding('calibration-curve', 'DataFrame', ['toTemplateDataFrame'], ['data', 'columns', 'rowKey'], 'Render standards, QC, blanks, and response values.'),\n ],\n 'time-course': [\n binding('time-course', 'ExperimentTimeline', ['toTimeCourseSteps'], ['modelValue', 'orientation'], 'Render time points as an ordered timeline.'),\n binding('time-course', 'DataFrame', ['toTemplateDataFrame'], ['data', 'columns', 'rowKey'], 'Render longitudinal samples as a table.'),\n ],\n 'protocol-steps': [\n binding('protocol-steps', 'ExperimentTimeline', ['toProtocolSteps'], ['modelValue', 'orientation', 'editable'], 'Render protocol steps as an editable timeline.'),\n binding('protocol-steps', 'DataFrame', ['toTemplateDataFrame'], ['data', 'columns', 'rowKey'], 'Render protocol steps as a table.'),\n ],\n 'assay-matrix': [\n binding('assay-matrix', 'DataFrame', ['toTemplateDataFrame'], ['data', 'columns', 'rowKey'], 'Render sample-by-feature measurements.'),\n binding('assay-matrix', 'SampleSelector', ['toAssayMatrixSampleOptions'], ['samples', 'modelValue'], 'Select samples from assay-matrix records.'),\n ],\n 'reagent-list': [\n binding('reagent-list', 'ReagentList', ['toReagentListItems'], ['modelValue'], 'Render reagents with lot, storage, and stock metadata.'),\n binding('reagent-list', 'DataFrame', ['toTemplateDataFrame'], ['data', 'columns', 'rowKey'], 'Render reagents as a table.'),\n ],\n 'flow-cytometry-panel': [\n binding('flow-cytometry-panel', 'DataFrame', ['toTemplateDataFrame'], ['data', 'columns', 'rowKey'], 'Render markers, fluorophores, detectors, and controls.'),\n ],\n 'instrument-run': [\n binding('instrument-run', 'DataFrame', ['toTemplateDataFrame'], ['data', 'columns', 'rowKey'], 'Render acquisition queues, methods, QC, and run status.'),\n binding(\n 'instrument-run',\n 'ScheduleCalendar',\n ['toInstrumentRunScheduleEvents'],\n ['modelValue', 'events', 'view', 'readonly', 'showNavigation', 'showViewToggle'],\n 'Render acquisition queues as a scheduled run calendar.',\n ),\n binding(\n 'instrument-run',\n 'ExperimentTimeline',\n ['toInstrumentRunSteps'],\n ['modelValue', 'orientation', 'showDuration', 'editable'],\n 'Render acquisition queues as an ordered run timeline.',\n ),\n ],\n 'qpcr-plate': [\n binding('qpcr-plate', 'WellPlate', ['toQpcrWellPlateWells'], ['format', 'wells', 'sampleColors', 'legendItems'], 'Render qPCR reactions on a well plate.'),\n binding('qpcr-plate', 'DataFrame', ['toTemplateDataFrame'], ['data', 'columns', 'rowKey'], 'Render qPCR reactions, targets, controls, and Cq values.'),\n ],\n} satisfies Record<TemplateId, readonly ComponentBinding[]>\n\nfunction binding(\n templateId: TemplateId,\n component: string,\n adapters: readonly string[],\n props: readonly string[],\n description: string\n): ComponentBinding {\n return {\n id: `${templateId}:${component}`,\n template_id: templateId,\n component,\n adapters,\n props,\n description,\n importPath: '@morscherlab/mint-sdk',\n }\n}\n","import type {\n AssayMatrixTemplateData,\n CalibrationCurveTemplateData,\n DoseResponseTemplateData,\n FlowCytometryPanelTemplateData,\n InstrumentRunTemplateData,\n PlateMapTemplateData,\n ProtocolStepsTemplateData,\n QpcrPlateTemplateData,\n ReagentListTemplateData,\n SamplePrepTemplateData,\n SampleSheetTemplateData,\n TimeCourseTemplateData,\n} from './types'\nimport { assertWellInFormat } from '../components/WellPlate.geometry'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validatePlateMapData(data: PlateMapTemplateData): void {\n if (!Array.isArray(data.plates) || data.plates.length === 0) {\n throw new Error('Plate-map template requires at least one plate.')\n }\n const sampleIds = new Set(data.samples.map(sample => sample.id))\n if (sampleIds.size !== data.samples.length) {\n throw new Error('Plate-map sample ids must be unique.')\n }\n for (const plate of data.plates) {\n for (const [wellId, well] of Object.entries(plate.wells)) {\n if (well.id !== wellId) {\n throw new Error(`Well key '${wellId}' does not match well id '${well.id}'.`)\n }\n if (well.sampleType && !sampleIds.has(well.sampleType)) {\n throw new Error(`Well '${well.id}' references unknown sample '${well.sampleType}'.`)\n }\n }\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateSampleSheetData(data: SampleSheetTemplateData): void {\n if (!Array.isArray(data.samples) || data.samples.length === 0) {\n throw new Error('Sample-sheet template requires at least one sample.')\n }\n const sampleIds = new Set(data.samples.map(sample => sample.sampleId))\n if (sampleIds.size !== data.samples.length) {\n throw new Error('Sample-sheet sample ids must be unique.')\n }\n for (const group of data.groups) {\n for (const sampleId of group.samples) {\n if (!sampleIds.has(sampleId)) {\n throw new Error(`Group '${group.name}' references unknown sample '${sampleId}'.`)\n }\n }\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateSamplePrepData(data: SamplePrepTemplateData): void {\n if (!data.protocolName) {\n throw new Error('Sample-prep template requires protocolName.')\n }\n if (!Array.isArray(data.steps) || data.steps.length === 0) {\n throw new Error('Sample-prep template requires at least one step.')\n }\n const stepIds = new Set(data.steps.map(step => step.id))\n if (stepIds.size !== data.steps.length) {\n throw new Error('Sample-prep step ids must be unique.')\n }\n const orders = new Set(data.steps.map(step => step.order))\n if (orders.size !== data.steps.length) {\n throw new Error('Sample-prep step orders must be unique.')\n }\n for (const step of data.steps) {\n if (!step.id || !step.name) {\n throw new Error('Sample-prep steps require id and name.')\n }\n if (step.order < 0) {\n throw new Error(`Sample-prep step '${step.id}' has a negative order.`)\n }\n if (!step.volumeUnit) {\n throw new Error(`Sample-prep step '${step.id}' requires volumeUnit.`)\n }\n if (step.inputVolume !== undefined && step.inputVolume < 0) {\n throw new Error(`Sample-prep step '${step.id}' has a negative input volume.`)\n }\n if (step.outputVolume !== undefined && step.outputVolume < 0) {\n throw new Error(`Sample-prep step '${step.id}' has a negative output volume.`)\n }\n if (step.durationMin !== undefined && step.durationMin < 0) {\n throw new Error(`Sample-prep step '${step.id}' has a negative duration.`)\n }\n if (!step.sourceSampleId && !step.destinationSampleId && !step.reagentId) {\n throw new Error(`Sample-prep step '${step.id}' requires a source, destination, or reagent.`)\n }\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateDoseResponseData(data: DoseResponseTemplateData): void {\n if (!Array.isArray(data.compounds) || data.compounds.length === 0) {\n throw new Error('Dose-response template requires at least one compound.')\n }\n if (!data.unit) {\n throw new Error('Dose-response template requires a unit.')\n }\n if (data.replicates < 1) {\n throw new Error('Dose-response replicates must be at least 1.')\n }\n for (const compound of data.compounds) {\n if (compound.concentrations.length === 0) {\n throw new Error(`Compound '${compound.name}' requires at least one concentration.`)\n }\n if (compound.concentrations.some(value => value < 0)) {\n throw new Error(`Compound '${compound.name}' has a negative concentration.`)\n }\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateCalibrationCurveData(data: CalibrationCurveTemplateData): void {\n if (!data.analyte) {\n throw new Error('Calibration-curve template requires an analyte.')\n }\n if (!data.xUnit) {\n throw new Error('Calibration-curve template requires xUnit.')\n }\n if (!data.responseUnit) {\n throw new Error('Calibration-curve template requires responseUnit.')\n }\n if (!Array.isArray(data.points) || data.points.length === 0) {\n throw new Error('Calibration-curve template requires at least one point.')\n }\n if (data.acceptance.minRSquared < 0 || data.acceptance.minRSquared > 1) {\n throw new Error('Calibration-curve minRSquared must be between 0 and 1.')\n }\n if (data.acceptance.standardTolerancePercent < 0 || data.acceptance.qcTolerancePercent < 0) {\n throw new Error('Calibration-curve tolerances cannot be negative.')\n }\n\n const pointIds = new Set(data.points.map(point => point.id))\n if (pointIds.size !== data.points.length) {\n throw new Error('Calibration-curve point ids must be unique.')\n }\n const orders = new Set(data.points.map(point => point.order))\n if (orders.size !== data.points.length) {\n throw new Error('Calibration-curve point orders must be unique.')\n }\n\n let standards = 0\n for (const point of data.points) {\n if (!point.id || !point.level) {\n throw new Error('Calibration-curve points require id and level.')\n }\n if (!point.unit) {\n throw new Error(`Calibration-curve point '${point.id}' requires unit.`)\n }\n if (point.order < 0) {\n throw new Error(`Calibration-curve point '${point.id}' has a negative order.`)\n }\n if (point.concentration < 0) {\n throw new Error(`Calibration-curve point '${point.id}' has a negative concentration.`)\n }\n if ((point.role === 'standard' || point.role === 'qc') && point.concentration <= 0) {\n throw new Error(`Calibration-curve point '${point.id}' requires positive concentration.`)\n }\n if (point.replicate < 1) {\n throw new Error(`Calibration-curve point '${point.id}' replicate must be at least 1.`)\n }\n if (point.role === 'standard' && point.include) {\n standards += 1\n }\n }\n\n if (standards < 2) {\n throw new Error('Calibration-curve template requires at least two included standards.')\n }\n if (data.acceptance.requireBlank && !data.points.some(point => point.role === 'blank')) {\n throw new Error('Calibration-curve template requires a blank point when requireBlank is true.')\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateTimeCourseData(data: TimeCourseTemplateData): void {\n if (!Array.isArray(data.timepoints) || data.timepoints.length === 0) {\n throw new Error('Time-course template requires at least one time point.')\n }\n if (!Array.isArray(data.conditions) || data.conditions.length === 0) {\n throw new Error('Time-course template requires at least one condition.')\n }\n const timepointIds = new Set(data.timepoints.map(timepoint => timepoint.id))\n if (timepointIds.size !== data.timepoints.length) {\n throw new Error('Time-course time point ids must be unique.')\n }\n const conditionIds = new Set(data.conditions.map(condition => condition.id))\n if (conditionIds.size !== data.conditions.length) {\n throw new Error('Time-course condition ids must be unique.')\n }\n const sampleIds = new Set(data.samples.map(sample => sample.sampleId))\n if (sampleIds.size !== data.samples.length) {\n throw new Error('Time-course sample ids must be unique.')\n }\n for (const sample of data.samples) {\n if (!timepointIds.has(sample.timepointId)) {\n throw new Error(`Sample '${sample.sampleId}' references unknown time point.`)\n }\n if (!conditionIds.has(sample.conditionId)) {\n throw new Error(`Sample '${sample.sampleId}' references unknown condition.`)\n }\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateProtocolStepsData(data: ProtocolStepsTemplateData): void {\n if (!Array.isArray(data.steps) || data.steps.length === 0) {\n throw new Error('Protocol-steps template requires at least one step.')\n }\n const stepIds = new Set(data.steps.map(step => step.id))\n if (stepIds.size !== data.steps.length) {\n throw new Error('Protocol-steps ids must be unique.')\n }\n const orders = new Set(data.steps.map(step => step.order))\n if (orders.size !== data.steps.length) {\n throw new Error('Protocol-steps orders must be unique.')\n }\n for (const step of data.steps) {\n if (!step.id) {\n throw new Error('Protocol step id is required.')\n }\n if (!step.name) {\n throw new Error(`Protocol step '${step.id}' requires a name.`)\n }\n if (step.duration !== undefined && step.duration < 0) {\n throw new Error(`Protocol step '${step.id}' has a negative duration.`)\n }\n if (step.order < 0) {\n throw new Error(`Protocol step '${step.id}' has a negative order.`)\n }\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateAssayMatrixData(data: AssayMatrixTemplateData): void {\n if (!Array.isArray(data.samples) || data.samples.length === 0) {\n throw new Error('Assay-matrix template requires at least one sample.')\n }\n if (!Array.isArray(data.features) || data.features.length === 0) {\n throw new Error('Assay-matrix template requires at least one feature.')\n }\n const sampleIds = new Set(data.samples.map(sample => sample.sampleId))\n if (sampleIds.size !== data.samples.length) {\n throw new Error('Assay-matrix sample ids must be unique.')\n }\n const featureIds = new Set(data.features.map(feature => feature.id))\n if (featureIds.size !== data.features.length) {\n throw new Error('Assay-matrix feature ids must be unique.')\n }\n const measurementIds = new Set<string>()\n for (const measurement of data.measurements) {\n const key = `${measurement.sampleId}:${measurement.featureId}`\n if (measurementIds.has(key)) {\n throw new Error(`Duplicate assay measurement for '${key}'.`)\n }\n measurementIds.add(key)\n if (!sampleIds.has(measurement.sampleId)) {\n throw new Error(`Measurement references unknown sample '${measurement.sampleId}'.`)\n }\n if (!featureIds.has(measurement.featureId)) {\n throw new Error(`Measurement references unknown feature '${measurement.featureId}'.`)\n }\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateReagentListData(data: ReagentListTemplateData): void {\n if (!Array.isArray(data.reagents) || data.reagents.length === 0) {\n throw new Error('Reagent-list template requires at least one reagent.')\n }\n const reagentIds = new Set(data.reagents.map(reagent => reagent.id))\n if (reagentIds.size !== data.reagents.length) {\n throw new Error('Reagent-list reagent ids must be unique.')\n }\n for (const reagent of data.reagents) {\n if (!reagent.id) {\n throw new Error('Reagent-list reagent id is required.')\n }\n if (!reagent.name) {\n throw new Error(`Reagent '${reagent.id}' requires a name.`)\n }\n if (reagent.stockLevel !== undefined && reagent.stockLevel < 0) {\n throw new Error(`Reagent '${reagent.id}' has a negative stock level.`)\n }\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateFlowCytometryPanelData(data: FlowCytometryPanelTemplateData): void {\n if (!Array.isArray(data.markers) || data.markers.length === 0) {\n throw new Error('Flow-cytometry panel template requires at least one marker.')\n }\n const markerIds = new Set(data.markers.map(marker => marker.id))\n if (markerIds.size !== data.markers.length) {\n throw new Error('Flow-cytometry panel marker ids must be unique.')\n }\n const controlIds = new Set(data.controls.map(control => control.id))\n if (controlIds.size !== data.controls.length) {\n throw new Error('Flow-cytometry panel control ids must be unique.')\n }\n for (const marker of data.markers) {\n if (!marker.id) {\n throw new Error('Flow-cytometry panel marker id is required.')\n }\n if (!marker.marker) {\n throw new Error(`Flow-cytometry panel marker '${marker.id}' requires a marker name.`)\n }\n }\n for (const control of data.controls) {\n if (!control.id) {\n throw new Error('Flow-cytometry panel control id is required.')\n }\n if (!control.name) {\n throw new Error(`Flow-cytometry panel control '${control.id}' requires a name.`)\n }\n if (control.markerId && !markerIds.has(control.markerId)) {\n throw new Error(`Flow-cytometry panel control '${control.id}' references unknown marker '${control.markerId}'.`)\n }\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateInstrumentRunData(data: InstrumentRunTemplateData): void {\n if (!Array.isArray(data.methods) || data.methods.length === 0) {\n throw new Error('Instrument-run template requires at least one method.')\n }\n if (!Array.isArray(data.items) || data.items.length === 0) {\n throw new Error('Instrument-run template requires at least one run item.')\n }\n const methodIds = new Set(data.methods.map(method => method.id))\n if (methodIds.size !== data.methods.length) {\n throw new Error('Instrument-run method ids must be unique.')\n }\n for (const method of data.methods) {\n if (!method.id || !method.name) {\n throw new Error('Instrument-run methods require id and name.')\n }\n }\n const itemIds = new Set(data.items.map(item => item.id))\n if (itemIds.size !== data.items.length) {\n throw new Error('Instrument-run item ids must be unique.')\n }\n const orders = new Set(data.items.map(item => item.order))\n if (orders.size !== data.items.length) {\n throw new Error('Instrument-run item orders must be unique.')\n }\n for (const item of data.items) {\n if (!item.id) {\n throw new Error('Instrument-run items require id.')\n }\n if (!methodIds.has(item.methodId)) {\n throw new Error(`Instrument-run item '${item.id}' references unknown method '${item.methodId}'.`)\n }\n if (item.kind === 'sample' && !item.sampleId) {\n throw new Error(`Instrument-run sample item '${item.id}' requires sampleId.`)\n }\n if (item.order < 0) {\n throw new Error(`Instrument-run item '${item.id}' has a negative order.`)\n }\n if (item.injectionVolume !== undefined && item.injectionVolume < 0) {\n throw new Error(`Instrument-run item '${item.id}' has a negative injection volume.`)\n }\n if (item.expectedDurationMin !== undefined && item.expectedDurationMin < 0) {\n throw new Error(`Instrument-run item '${item.id}' has a negative expected duration.`)\n }\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function validateQpcrPlateData(data: QpcrPlateTemplateData): void {\n if (!Array.isArray(data.samples) || data.samples.length === 0) {\n throw new Error('qPCR plate template requires at least one sample.')\n }\n if (!Array.isArray(data.targets) || data.targets.length === 0) {\n throw new Error('qPCR plate template requires at least one target.')\n }\n if (!Array.isArray(data.reactions) || data.reactions.length === 0) {\n throw new Error('qPCR plate template requires at least one reaction.')\n }\n const sampleIds = new Set(data.samples.map(sample => sample.sampleId))\n if (sampleIds.size !== data.samples.length) {\n throw new Error('qPCR plate sample ids must be unique.')\n }\n const targetIds = new Set(data.targets.map(target => target.id))\n if (targetIds.size !== data.targets.length) {\n throw new Error('qPCR plate target ids must be unique.')\n }\n const reactionIds = new Set(data.reactions.map(reaction => reaction.id))\n if (reactionIds.size !== data.reactions.length) {\n throw new Error('qPCR plate reaction ids must be unique.')\n }\n const wellIds = new Set(data.reactions.map(reaction => reaction.wellId))\n if (wellIds.size !== data.reactions.length) {\n throw new Error('qPCR plate reaction wells must be unique.')\n }\n for (const reaction of data.reactions) {\n assertWellInFormat(reaction.wellId, data.format)\n if (!reaction.id) {\n throw new Error('qPCR reaction id is required.')\n }\n if (!reaction.targetId || !targetIds.has(reaction.targetId)) {\n throw new Error(`qPCR reaction '${reaction.id}' references unknown target '${reaction.targetId}'.`)\n }\n if (reaction.sampleId && !sampleIds.has(reaction.sampleId)) {\n throw new Error(`qPCR reaction '${reaction.id}' references unknown sample '${reaction.sampleId}'.`)\n }\n if (reaction.controlKind === 'sample' && !reaction.sampleId) {\n throw new Error(`qPCR sample reaction '${reaction.id}' requires sampleId.`)\n }\n if (reaction.replicate < 1) {\n throw new Error(`qPCR reaction '${reaction.id}' replicate must be at least 1.`)\n }\n if (reaction.cq !== undefined && reaction.cq !== null && reaction.cq < 0) {\n throw new Error(`qPCR reaction '${reaction.id}' has a negative Cq.`)\n }\n if (reaction.quantity !== undefined && reaction.quantity !== null && reaction.quantity < 0) {\n throw new Error(`qPCR reaction '${reaction.id}' has a negative quantity.`)\n }\n }\n}\n","import type { SelectOption } from '../types'\nimport { getTemplateData } from './templateEnvelopes'\nimport { validateAssayMatrixData } from './templateValidators'\nimport type {\n AssayMatrixColumnsAdapterResult,\n AssayMatrixDataFrameAdapterResult,\n AssayMatrixRowsAdapterResult,\n AssayMatrixSampleOptionsAdapterResult,\n AssayMatrixTemplate,\n AssayMatrixTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toAssayMatrixRows(\n template: AssayMatrixTemplate | AssayMatrixTemplateData\n): AssayMatrixRowsAdapterResult {\n const data = getTemplateData(template, 'assay-matrix')\n validateAssayMatrixData(data)\n const measurements = new Map(\n data.measurements.map(measurement => [\n `${measurement.sampleId}:${measurement.featureId}`,\n measurement.value ?? null,\n ])\n )\n\n return data.samples.map(sample => {\n const row: Record<string, unknown> = {\n sampleId: sample.sampleId,\n name: sample.name,\n group: sample.group,\n ...(sample.metadata ?? {}),\n }\n for (const feature of data.features) {\n row[feature.id] = measurements.get(`${sample.sampleId}:${feature.id}`) ?? null\n }\n return row\n })\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toAssayMatrixColumns(\n template: AssayMatrixTemplate | AssayMatrixTemplateData\n): AssayMatrixColumnsAdapterResult {\n const data = getTemplateData(template, 'assay-matrix')\n validateAssayMatrixData(data)\n return [\n { key: 'sampleId', label: 'Sample ID', sortable: true },\n { key: 'name', label: 'Name', sortable: true },\n { key: 'group', label: 'Group', sortable: true },\n ...data.features.map(feature => ({\n key: feature.id,\n label: feature.unit ? `${feature.name} (${feature.unit})` : feature.name,\n sortable: true,\n align: 'right' as const,\n })),\n ]\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toAssayMatrixDataFrame(\n template: AssayMatrixTemplate | AssayMatrixTemplateData\n): AssayMatrixDataFrameAdapterResult {\n return {\n data: toAssayMatrixRows(template),\n columns: toAssayMatrixColumns(template),\n rowKey: 'sampleId',\n }\n}\n\n/**\n * Convert an assay-matrix template into SampleSelector options derived from assay samples.\n *\n * @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins.\n */\nexport function toAssayMatrixSampleOptions(\n template: AssayMatrixTemplate | AssayMatrixTemplateData\n): AssayMatrixSampleOptionsAdapterResult {\n const data = getTemplateData(template, 'assay-matrix')\n validateAssayMatrixData(data)\n return data.samples.map((sample): SelectOption<string> => ({\n value: sample.sampleId,\n label: sample.name ?? sample.sampleId,\n description: sample.group,\n }))\n}\n","import { getTemplateData } from './templateEnvelopes'\nimport { validateCalibrationCurveData } from './templateValidators'\nimport type {\n CalibrationCurveColumnsAdapterResult,\n CalibrationCurveDataFrameAdapterResult,\n CalibrationCurveRowsAdapterResult,\n CalibrationCurveTemplate,\n CalibrationCurveTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toCalibrationCurveRows(\n template: CalibrationCurveTemplate | CalibrationCurveTemplateData\n): CalibrationCurveRowsAdapterResult {\n const data = getTemplateData(template, 'calibration-curve')\n validateCalibrationCurveData(data)\n return [...data.points]\n .sort((a, b) => a.order - b.order)\n .map(point => ({\n id: point.id,\n order: point.order,\n role: point.role,\n level: point.level,\n concentration: point.concentration,\n unit: point.unit,\n expectedResponse: point.expectedResponse,\n response: point.response,\n replicate: point.replicate,\n include: point.include,\n status: point.status,\n analyte: data.analyte,\n model: data.model,\n ...(point.metadata ?? {}),\n }))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toCalibrationCurveColumns(): CalibrationCurveColumnsAdapterResult {\n return [\n { key: 'order', label: 'Order', sortable: true, align: 'right' },\n { key: 'role', label: 'Role', sortable: true },\n { key: 'level', label: 'Level', sortable: true },\n { key: 'concentration', label: 'Concentration', sortable: true, align: 'right' },\n { key: 'unit', label: 'Unit', sortable: true },\n { key: 'expectedResponse', label: 'Expected', sortable: true, align: 'right' },\n { key: 'response', label: 'Response', sortable: true, align: 'right' },\n { key: 'replicate', label: 'Replicate', sortable: true, align: 'right' },\n { key: 'include', label: 'Include', sortable: true },\n { key: 'status', label: 'Status', sortable: true },\n ]\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toCalibrationCurveDataFrame(\n template: CalibrationCurveTemplate | CalibrationCurveTemplateData\n): CalibrationCurveDataFrameAdapterResult {\n return {\n data: toCalibrationCurveRows(template),\n columns: toCalibrationCurveColumns(),\n rowKey: 'id',\n }\n}\n","import { getTemplateData } from './templateEnvelopes'\nimport { validateFlowCytometryPanelData } from './templateValidators'\nimport type {\n FlowCytometryPanelTemplate,\n FlowCytometryPanelTemplateData,\n FlowPanelColumnsAdapterResult,\n FlowPanelDataFrameAdapterResult,\n FlowPanelRowsAdapterResult,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toFlowPanelRows(\n template: FlowCytometryPanelTemplate | FlowCytometryPanelTemplateData\n): FlowPanelRowsAdapterResult {\n const data = getTemplateData(template, 'flow-cytometry-panel')\n validateFlowCytometryPanelData(data)\n return data.markers.map(marker => {\n const markerControls = data.controls\n .filter(control => control.markerId === marker.id)\n .map(control => control.name)\n .join(', ')\n return {\n id: marker.id,\n marker: marker.marker,\n fluorophore: marker.fluorophore,\n detector: marker.detector,\n clone: marker.clone,\n reagentId: marker.reagentId,\n purpose: marker.purpose,\n compensationRequired: marker.compensationRequired,\n controls: markerControls,\n instrument: data.instrument,\n ...(marker.metadata ?? {}),\n }\n })\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toFlowPanelColumns(): FlowPanelColumnsAdapterResult {\n return [\n { key: 'marker', label: 'Marker', sortable: true },\n { key: 'fluorophore', label: 'Fluorophore', sortable: true },\n { key: 'detector', label: 'Detector', sortable: true },\n { key: 'clone', label: 'Clone', sortable: true },\n { key: 'purpose', label: 'Purpose', sortable: true },\n { key: 'compensationRequired', label: 'Compensation', sortable: true },\n { key: 'controls', label: 'Controls' },\n { key: 'instrument', label: 'Instrument', sortable: true },\n ]\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toFlowPanelDataFrame(\n template: FlowCytometryPanelTemplate | FlowCytometryPanelTemplateData\n): FlowPanelDataFrameAdapterResult {\n return {\n data: toFlowPanelRows(template),\n columns: toFlowPanelColumns(),\n rowKey: 'id',\n }\n}\n","import type {\n ProtocolStepStatus,\n ProtocolStepType,\n ScheduleEventStatus,\n} from '../types'\nimport type {\n InstrumentRunItem,\n InstrumentRunItemKind,\n InstrumentRunStatus,\n} from './types'\n\nexport function instrumentRunStepType(kind: InstrumentRunItemKind): ProtocolStepType {\n switch (kind) {\n case 'wash':\n return 'wash'\n case 'blank':\n case 'qc':\n case 'standard':\n case 'calibration':\n case 'sample':\n return 'measurement'\n default:\n return 'custom'\n }\n}\n\nexport function instrumentRunStepStatus(status: InstrumentRunStatus): ProtocolStepStatus {\n switch (status) {\n case 'running':\n return 'in_progress'\n case 'completed':\n return 'completed'\n case 'failed':\n return 'failed'\n case 'skipped':\n return 'skipped'\n case 'planned':\n case 'queued':\n default:\n return 'pending'\n }\n}\n\nexport function instrumentRunScheduleStatus(status: InstrumentRunStatus): ScheduleEventStatus {\n switch (status) {\n case 'running':\n return 'in-progress'\n case 'completed':\n return 'confirmed'\n case 'failed':\n case 'skipped':\n return 'cancelled'\n case 'planned':\n case 'queued':\n default:\n return 'pending'\n }\n}\n\nexport function instrumentRunScheduleColor(kind: InstrumentRunItem['kind']): string {\n switch (kind) {\n case 'blank':\n return '#64748b'\n case 'qc':\n return '#8b5cf6'\n case 'standard':\n case 'calibration':\n return '#f59e0b'\n case 'wash':\n return '#06b6d4'\n case 'sample':\n return '#2563eb'\n default:\n return '#475569'\n }\n}\n\nexport function dateFromMetadata(\n metadata: Record<string, unknown> | undefined,\n keys: readonly string[]\n): Date | undefined {\n if (!metadata) return undefined\n for (const key of keys) {\n const value = metadata[key]\n if (!(typeof value === 'string' || value instanceof Date)) continue\n const date = new Date(value)\n if (!Number.isNaN(date.getTime())) return date\n }\n return undefined\n}\n\nexport function addMinutes(date: Date, minutes: number): Date {\n return new Date(date.getTime() + minutes * 60_000)\n}\n","import type {\n ProtocolStep,\n ScheduleEvent,\n} from '../types'\nimport { getTemplateData } from './templateEnvelopes'\nimport { validateInstrumentRunData } from './templateValidators'\nimport type {\n InstrumentRunColumnsAdapterResult,\n InstrumentRunDataFrameAdapterResult,\n InstrumentRunRowsAdapterResult,\n InstrumentRunScheduleEventsAdapterResult,\n InstrumentRunStepsAdapterResult,\n InstrumentRunTemplate,\n InstrumentRunTemplateData,\n} from './types'\nimport {\n addMinutes,\n dateFromMetadata,\n instrumentRunScheduleColor,\n instrumentRunScheduleStatus,\n instrumentRunStepStatus,\n instrumentRunStepType,\n} from './instrumentRunAdapterHelpers'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toInstrumentRunRows(\n template: InstrumentRunTemplate | InstrumentRunTemplateData\n): InstrumentRunRowsAdapterResult {\n const data = getTemplateData(template, 'instrument-run')\n validateInstrumentRunData(data)\n const methods = new Map(data.methods.map(method => [method.id, method]))\n return [...data.items]\n .sort((a, b) => a.order - b.order)\n .map(item => {\n const method = methods.get(item.methodId)\n return {\n id: item.id,\n order: item.order,\n kind: item.kind,\n sampleId: item.sampleId,\n name: item.name ?? item.sampleId ?? item.kind,\n method: method?.name ?? item.methodId,\n vial: item.vial,\n plateId: item.plateId,\n wellId: item.wellId,\n injectionVolume: item.injectionVolume,\n expectedDurationMin: item.expectedDurationMin,\n status: item.status,\n instrument: data.instrument ?? method?.instrument,\n ...(item.metadata ?? {}),\n }\n })\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toInstrumentRunColumns(): InstrumentRunColumnsAdapterResult {\n return [\n { key: 'order', label: 'Order', sortable: true, align: 'right' },\n { key: 'kind', label: 'Kind', sortable: true },\n { key: 'sampleId', label: 'Sample ID', sortable: true },\n { key: 'name', label: 'Name', sortable: true },\n { key: 'method', label: 'Method', sortable: true },\n { key: 'vial', label: 'Vial', sortable: true },\n { key: 'wellId', label: 'Well', sortable: true },\n { key: 'injectionVolume', label: 'Injection', sortable: true, align: 'right' },\n { key: 'expectedDurationMin', label: 'Duration', sortable: true, align: 'right' },\n { key: 'status', label: 'Status', sortable: true },\n { key: 'instrument', label: 'Instrument', sortable: true },\n ]\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toInstrumentRunDataFrame(\n template: InstrumentRunTemplate | InstrumentRunTemplateData\n): InstrumentRunDataFrameAdapterResult {\n return {\n data: toInstrumentRunRows(template),\n columns: toInstrumentRunColumns(),\n rowKey: 'id',\n }\n}\n\n/**\n * Convert an instrument-run template into ExperimentTimeline protocol steps for acquisition queue previews.\n *\n * @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins.\n */\nexport function toInstrumentRunSteps(\n template: InstrumentRunTemplate | InstrumentRunTemplateData\n): InstrumentRunStepsAdapterResult {\n const data = getTemplateData(template, 'instrument-run')\n validateInstrumentRunData(data)\n const methods = new Map(data.methods.map(method => [method.id, method]))\n return [...data.items]\n .sort((a, b) => a.order - b.order)\n .map((item): ProtocolStep => {\n const method = methods.get(item.methodId)\n const name = item.name ?? item.sampleId ?? item.kind\n return {\n id: item.id,\n type: instrumentRunStepType(item.kind),\n name,\n description: [\n item.kind,\n method?.name,\n item.vial ? `Vial ${item.vial}` : undefined,\n item.wellId ? `Well ${item.wellId}` : undefined,\n ]\n .filter(Boolean)\n .join(' / '),\n duration: item.expectedDurationMin,\n status: instrumentRunStepStatus(item.status),\n parameters: {\n kind: item.kind,\n sampleId: item.sampleId,\n methodId: item.methodId,\n method: method?.name,\n vial: item.vial,\n plateId: item.plateId,\n wellId: item.wellId,\n injectionVolume: item.injectionVolume,\n instrument: data.instrument ?? method?.instrument,\n },\n order: item.order,\n }\n })\n}\n\n/**\n * Convert an instrument-run template into readonly ScheduleCalendar events ordered by run queue timing.\n *\n * @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins.\n */\nexport function toInstrumentRunScheduleEvents(\n template: InstrumentRunTemplate | InstrumentRunTemplateData\n): InstrumentRunScheduleEventsAdapterResult {\n const data = getTemplateData(template, 'instrument-run')\n validateInstrumentRunData(data)\n const methods = new Map(data.methods.map(method => [method.id, method]))\n let cursor = dateFromMetadata(data.metadata, ['scheduledStart', 'runStart', 'start', 'startedAt'])\n ?? new Date('2024-01-01T08:00:00.000Z')\n\n return [...data.items]\n .sort((a, b) => a.order - b.order)\n .map((item): ScheduleEvent => {\n const method = methods.get(item.methodId)\n const start = dateFromMetadata(item.metadata, ['scheduledStart', 'start', 'startedAt']) ?? cursor\n const end = dateFromMetadata(item.metadata, ['scheduledEnd', 'end', 'completedAt'])\n ?? addMinutes(start, Math.max(item.expectedDurationMin ?? 10, 1))\n cursor = end\n\n return {\n id: item.id,\n title: item.name ?? item.sampleId ?? item.kind,\n start: start.toISOString(),\n end: end.toISOString(),\n color: instrumentRunScheduleColor(item.kind),\n status: instrumentRunScheduleStatus(item.status),\n draggable: false,\n resizable: false,\n metadata: {\n kind: item.kind,\n sampleId: item.sampleId,\n methodId: item.methodId,\n method: method?.name,\n vial: item.vial,\n plateId: item.plateId,\n wellId: item.wellId,\n injectionVolume: item.injectionVolume,\n instrument: data.instrument ?? method?.instrument,\n },\n }\n })\n}\n","import { getTemplateData } from './templateEnvelopes'\nimport { validateProtocolStepsData } from './templateValidators'\nimport type {\n ProtocolColumnsAdapterResult,\n ProtocolDataFrameAdapterResult,\n ProtocolRowsAdapterResult,\n ProtocolStepsAdapterResult,\n ProtocolStepsTemplate,\n ProtocolStepsTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toProtocolSteps(\n template: ProtocolStepsTemplate | ProtocolStepsTemplateData\n): ProtocolStepsAdapterResult {\n const data = getTemplateData(template, 'protocol-steps')\n validateProtocolStepsData(data)\n return [...data.steps]\n .sort((a, b) => a.order - b.order)\n .map(step => ({\n id: step.id,\n type: step.type,\n name: step.name,\n description: step.description,\n duration: step.duration,\n status: step.status,\n parameters: step.parameters,\n order: step.order,\n }))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toProtocolRows(\n template: ProtocolStepsTemplate | ProtocolStepsTemplateData\n): ProtocolRowsAdapterResult {\n const data = getTemplateData(template, 'protocol-steps')\n validateProtocolStepsData(data)\n return [...data.steps]\n .sort((a, b) => a.order - b.order)\n .map(step => ({\n id: step.id,\n order: step.order,\n type: step.type,\n name: step.name,\n description: step.description,\n duration: step.duration,\n status: step.status,\n ...(step.metadata ?? {}),\n }))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toProtocolColumns(): ProtocolColumnsAdapterResult {\n return [\n { key: 'order', label: 'Order', sortable: true, align: 'right' },\n { key: 'name', label: 'Name', sortable: true },\n { key: 'type', label: 'Type', sortable: true },\n { key: 'duration', label: 'Duration', sortable: true, align: 'right' },\n { key: 'status', label: 'Status', sortable: true },\n { key: 'description', label: 'Description', sortable: true },\n ]\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toProtocolDataFrame(\n template: ProtocolStepsTemplate | ProtocolStepsTemplateData\n): ProtocolDataFrameAdapterResult {\n return {\n data: toProtocolRows(template),\n columns: toProtocolColumns(),\n rowKey: 'id',\n }\n}\n","import type { Well } from '../types'\nimport { getTemplateData } from './templateEnvelopes'\nimport { validateQpcrPlateData } from './templateValidators'\nimport type {\n QpcrColumnsAdapterResult,\n QpcrDataFrameAdapterResult,\n QpcrPlateTemplate,\n QpcrPlateTemplateData,\n QpcrRowsAdapterResult,\n QpcrWellMapAdapterResult,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toQpcrRows(\n template: QpcrPlateTemplate | QpcrPlateTemplateData\n): QpcrRowsAdapterResult {\n const data = getTemplateData(template, 'qpcr-plate')\n validateQpcrPlateData(data)\n const samples = new Map(data.samples.map(sample => [sample.sampleId, sample]))\n const targets = new Map(data.targets.map(target => [target.id, target]))\n\n return data.reactions.map(reaction => {\n const sample = reaction.sampleId ? samples.get(reaction.sampleId) : undefined\n const target = targets.get(reaction.targetId)\n return {\n id: reaction.id,\n wellId: reaction.wellId,\n sampleId: reaction.sampleId,\n sample: sample?.name ?? reaction.sampleId ?? reaction.controlKind,\n group: sample?.group,\n targetId: reaction.targetId,\n target: target?.name ?? reaction.targetId,\n replicate: reaction.replicate,\n controlKind: reaction.controlKind,\n cq: reaction.cq ?? null,\n quantity: reaction.quantity ?? null,\n flags: reaction.flags.join(', '),\n instrument: data.instrument,\n chemistry: data.chemistry,\n ...(reaction.metadata ?? {}),\n }\n })\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toQpcrColumns(): QpcrColumnsAdapterResult {\n return [\n { key: 'wellId', label: 'Well', sortable: true },\n { key: 'sample', label: 'Sample', sortable: true },\n { key: 'group', label: 'Group', sortable: true },\n { key: 'target', label: 'Target', sortable: true },\n { key: 'replicate', label: 'Replicate', sortable: true, align: 'right' },\n { key: 'controlKind', label: 'Control', sortable: true },\n { key: 'cq', label: 'Cq', sortable: true, align: 'right' },\n { key: 'quantity', label: 'Quantity', sortable: true, align: 'right' },\n { key: 'flags', label: 'Flags' },\n ]\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toQpcrDataFrame(\n template: QpcrPlateTemplate | QpcrPlateTemplateData\n): QpcrDataFrameAdapterResult {\n return {\n data: toQpcrRows(template),\n columns: toQpcrColumns(),\n rowKey: 'id',\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toQpcrWellPlateWells(\n template: QpcrPlateTemplate | QpcrPlateTemplateData\n): QpcrWellMapAdapterResult {\n const data = getTemplateData(template, 'qpcr-plate')\n validateQpcrPlateData(data)\n return Object.fromEntries(data.reactions.map(reaction => {\n const [row, col] = wellPositionFromId(reaction.wellId)\n return [\n reaction.wellId,\n {\n id: reaction.wellId,\n row,\n col,\n state: 'filled' as const,\n sampleType: reaction.sampleId ?? reaction.controlKind,\n value: reaction.cq ?? undefined,\n metadata: {\n reactionId: reaction.id,\n sampleId: reaction.sampleId,\n targetId: reaction.targetId,\n replicate: reaction.replicate,\n controlKind: reaction.controlKind,\n },\n } satisfies Well,\n ]\n }))\n}\n\nfunction wellPositionFromId(wellId: string): [number, number] {\n const match = /^([A-Z]+)([1-9][0-9]*)$/.exec(wellId.toUpperCase())\n if (!match) {\n throw new Error(`Invalid well id '${wellId}'.`)\n }\n const row = [...match[1]].reduce((value, char) => value * 26 + char.charCodeAt(0) - 64, 0) - 1\n const col = Number(match[2]) - 1\n return [row, col]\n}\n","import { getTemplateData } from './templateEnvelopes'\nimport { validateReagentListData } from './templateValidators'\nimport type {\n ReagentColumnsAdapterResult,\n ReagentDataFrameAdapterResult,\n ReagentListItemsAdapterResult,\n ReagentListTemplate,\n ReagentListTemplateData,\n ReagentRowsAdapterResult,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toReagentListItems(\n template: ReagentListTemplate | ReagentListTemplateData\n): ReagentListItemsAdapterResult {\n const data = getTemplateData(template, 'reagent-list')\n validateReagentListData(data)\n return data.reagents.map(reagent => ({\n id: reagent.id,\n name: reagent.name,\n catalogNumber: reagent.catalogNumber,\n lotNumber: reagent.lotNumber,\n expiryDate: reagent.expiryDate,\n storageCondition: reagent.storageCondition,\n location: reagent.location,\n stockLevel: reagent.stockLevel,\n stockUnit: reagent.stockUnit,\n supplier: reagent.supplier,\n url: reagent.url,\n }))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toReagentRows(\n template: ReagentListTemplate | ReagentListTemplateData\n): ReagentRowsAdapterResult {\n const data = getTemplateData(template, 'reagent-list')\n validateReagentListData(data)\n return data.reagents.map(reagent => ({\n id: reagent.id,\n name: reagent.name,\n kind: reagent.kind,\n catalogNumber: reagent.catalogNumber,\n lotNumber: reagent.lotNumber,\n expiryDate: reagent.expiryDate,\n storageCondition: reagent.storageCondition,\n location: reagent.location,\n stockLevel: reagent.stockLevel,\n stockUnit: reagent.stockUnit,\n supplier: reagent.supplier,\n concentration: reagent.concentration,\n ...(reagent.metadata ?? {}),\n }))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toReagentColumns(): ReagentColumnsAdapterResult {\n return [\n { key: 'name', label: 'Name', sortable: true },\n { key: 'kind', label: 'Kind', sortable: true },\n { key: 'catalogNumber', label: 'Catalog', sortable: true },\n { key: 'lotNumber', label: 'Lot', sortable: true },\n { key: 'expiryDate', label: 'Expiry', sortable: true },\n { key: 'storageCondition', label: 'Storage', sortable: true },\n { key: 'location', label: 'Location', sortable: true },\n { key: 'stockLevel', label: 'Stock', sortable: true, align: 'right' },\n { key: 'stockUnit', label: 'Unit', sortable: true },\n { key: 'supplier', label: 'Supplier', sortable: true },\n ]\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toReagentDataFrame(\n template: ReagentListTemplate | ReagentListTemplateData\n): ReagentDataFrameAdapterResult {\n return {\n data: toReagentRows(template),\n columns: toReagentColumns(),\n rowKey: 'id',\n }\n}\n","import { getTemplateData } from './templateEnvelopes'\nimport { validateSamplePrepData } from './templateValidators'\nimport type {\n SamplePrepColumnsAdapterResult,\n SamplePrepDataFrameAdapterResult,\n SamplePrepRowsAdapterResult,\n SamplePrepTemplate,\n SamplePrepTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toSamplePrepRows(\n template: SamplePrepTemplate | SamplePrepTemplateData\n): SamplePrepRowsAdapterResult {\n const data = getTemplateData(template, 'sample-prep')\n validateSamplePrepData(data)\n return [...data.steps]\n .sort((a, b) => a.order - b.order)\n .map(step => ({\n id: step.id,\n order: step.order,\n type: step.type,\n name: step.name,\n sourceSampleId: step.sourceSampleId,\n sourceWellId: step.sourceWellId,\n destinationSampleId: step.destinationSampleId,\n destinationWellId: step.destinationWellId,\n reagentId: step.reagentId,\n inputVolume: step.inputVolume,\n outputVolume: step.outputVolume,\n volumeUnit: step.volumeUnit,\n durationMin: step.durationMin,\n status: step.status,\n protocolName: data.protocolName,\n ...(step.metadata ?? {}),\n }))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toSamplePrepColumns(): SamplePrepColumnsAdapterResult {\n return [\n { key: 'order', label: 'Order', sortable: true, align: 'right' },\n { key: 'type', label: 'Type', sortable: true },\n { key: 'name', label: 'Step', sortable: true },\n { key: 'sourceSampleId', label: 'Source', sortable: true },\n { key: 'sourceWellId', label: 'Source well', sortable: true },\n { key: 'destinationSampleId', label: 'Destination', sortable: true },\n { key: 'destinationWellId', label: 'Destination well', sortable: true },\n { key: 'reagentId', label: 'Reagent', sortable: true },\n { key: 'inputVolume', label: 'Input', sortable: true, align: 'right' },\n { key: 'outputVolume', label: 'Output', sortable: true, align: 'right' },\n { key: 'volumeUnit', label: 'Unit', sortable: true },\n { key: 'status', label: 'Status', sortable: true },\n ]\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toSamplePrepDataFrame(\n template: SamplePrepTemplate | SamplePrepTemplateData\n): SamplePrepDataFrameAdapterResult {\n return {\n data: toSamplePrepRows(template),\n columns: toSamplePrepColumns(),\n rowKey: 'id',\n }\n}\n","import type {\n DataFrameColumn,\n SelectOption,\n} from '../types'\nimport { getTemplateData } from './templateEnvelopes'\nimport { validateSampleSheetData } from './templateValidators'\nimport type {\n SampleColumnsAdapterResult,\n SampleDataFrameAdapterResult,\n SampleOptionsAdapterResult,\n SampleRowsAdapterResult,\n SampleSheetTemplate,\n SampleSheetTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toSampleRows(\n template: SampleSheetTemplate | SampleSheetTemplateData\n): SampleRowsAdapterResult {\n const data = getTemplateData(template, 'sample-sheet')\n validateSampleSheetData(data)\n return data.samples.map(sample => ({\n sampleId: sample.sampleId,\n name: sample.name,\n group: sample.group,\n batch: sample.batch,\n replicate: sample.replicate,\n plateId: sample.plateId,\n wellId: sample.wellId,\n ...(sample.metadata ?? {}),\n }))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toSampleColumns(\n template: SampleSheetTemplate | SampleSheetTemplateData\n): SampleColumnsAdapterResult {\n const data = getTemplateData(template, 'sample-sheet')\n validateSampleSheetData(data)\n return data.columns.map((column): DataFrameColumn<Record<string, unknown>> => ({\n key: sampleColumnKey(column.id),\n label: column.label,\n sortable: true,\n align: column.type === 'number' || column.type === 'integer' ? 'right' : 'left',\n }))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toSampleDataFrame(\n template: SampleSheetTemplate | SampleSheetTemplateData\n): SampleDataFrameAdapterResult {\n return {\n data: toSampleRows(template),\n columns: toSampleColumns(template),\n rowKey: 'sampleId',\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toSampleOptions(\n template: SampleSheetTemplate | SampleSheetTemplateData\n): SampleOptionsAdapterResult {\n const data = getTemplateData(template, 'sample-sheet')\n validateSampleSheetData(data)\n return data.samples.map((sample): SelectOption<string> => ({\n value: sample.sampleId,\n label: sample.name ?? sample.sampleId,\n description: [sample.group, sample.batch].filter(Boolean).join(' / ') || undefined,\n }))\n}\n\nfunction sampleColumnKey(columnId: string): string {\n const aliases: Record<string, string> = {\n sample_id: 'sampleId',\n plate_id: 'plateId',\n well_id: 'wellId',\n }\n return aliases[columnId] ?? columnId\n}\n","import { getTemplateData } from './templateEnvelopes'\nimport { validateTimeCourseData } from './templateValidators'\nimport type {\n TimeCourseColumnsAdapterResult,\n TimeCourseDataFrameAdapterResult,\n TimeCourseRowsAdapterResult,\n TimeCourseStepsAdapterResult,\n TimeCourseTemplate,\n TimeCourseTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toTimeCourseRows(\n template: TimeCourseTemplate | TimeCourseTemplateData\n): TimeCourseRowsAdapterResult {\n const data = getTemplateData(template, 'time-course')\n validateTimeCourseData(data)\n const timepoints = new Map(data.timepoints.map(timepoint => [timepoint.id, timepoint]))\n const conditions = new Map(data.conditions.map(condition => [condition.id, condition]))\n\n return data.samples.map(sample => {\n const timepoint = timepoints.get(sample.timepointId)\n const condition = conditions.get(sample.conditionId)\n return {\n sampleId: sample.sampleId,\n condition: condition?.name ?? sample.conditionId,\n timepoint: timepoint?.label ?? sample.timepointId,\n value: timepoint?.value,\n unit: timepoint?.unit,\n replicate: sample.replicate,\n ...(sample.metadata ?? {}),\n }\n })\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toTimeCourseColumns(): TimeCourseColumnsAdapterResult {\n return [\n { key: 'sampleId', label: 'Sample ID', sortable: true },\n { key: 'condition', label: 'Condition', sortable: true },\n { key: 'timepoint', label: 'Time Point', sortable: true },\n { key: 'value', label: 'Value', sortable: true, align: 'right' },\n { key: 'unit', label: 'Unit', sortable: true },\n { key: 'replicate', label: 'Replicate', sortable: true, align: 'right' },\n ]\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toTimeCourseDataFrame(\n template: TimeCourseTemplate | TimeCourseTemplateData\n): TimeCourseDataFrameAdapterResult {\n return {\n data: toTimeCourseRows(template),\n columns: toTimeCourseColumns(),\n rowKey: 'sampleId',\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toTimeCourseSteps(\n template: TimeCourseTemplate | TimeCourseTemplateData\n): TimeCourseStepsAdapterResult {\n const data = getTemplateData(template, 'time-course')\n validateTimeCourseData(data)\n return data.timepoints.map((timepoint, index) => ({\n id: timepoint.id,\n type: 'measurement',\n name: timepoint.label,\n description: `${data.conditions.length} condition${data.conditions.length === 1 ? '' : 's'}`,\n status: 'pending',\n order: index,\n parameters: {\n value: timepoint.value,\n unit: timepoint.unit,\n },\n }))\n}\n","import type {\n PlateMapEditorState,\n} from '../types'\nimport { getTemplateData } from './templateEnvelopes'\nimport { validatePlateMapData } from './templateValidators'\nimport type {\n PlateMapEditorAdapterResult,\n PlateMapTemplate,\n PlateMapTemplateData,\n WellMapAdapterResult,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toPlateMapEditorState(\n template: PlateMapTemplate | PlateMapTemplateData\n): PlateMapEditorAdapterResult {\n const data = getTemplateData(template, 'plate-map')\n validatePlateMapData(data)\n const activePlateId = data.activePlateId ?? data.plates[0].id\n return {\n plates: data.plates,\n activePlateId,\n samples: data.samples,\n selectedWells: data.selectedWells ?? [],\n activeSampleId: data.activeSampleId,\n } satisfies PlateMapEditorState\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toWellPlateWells(\n template: PlateMapTemplate | PlateMapTemplateData,\n plateId?: string\n): WellMapAdapterResult {\n const state = toPlateMapEditorState(template)\n const plate = state.plates.find(candidate => candidate.id === (plateId ?? state.activePlateId))\n ?? state.plates[0]\n return plate.wells\n}\n","import type {\n PlateCondition,\n PlateMapEditorState,\n} from '../types'\nimport { SAMPLE_COLOR_SCALE } from '../utils/color'\nimport { toPlateMapEditorState } from './plateMapAdapters'\nimport { getTemplateData } from './templateEnvelopes'\nimport { validateDoseResponseData } from './templateValidators'\nimport type {\n DoseConditionsAdapterResult,\n DoseResponseTemplate,\n DoseResponseTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toDoseConditions(\n template: DoseResponseTemplate | DoseResponseTemplateData\n): DoseConditionsAdapterResult {\n const data = getTemplateData(template, 'dose-response')\n validateDoseResponseData(data)\n return data.compounds.map((compound, index): PlateCondition => ({\n label: compound.name,\n color: String(compound.metadata?.color ?? SAMPLE_COLOR_SCALE[index % SAMPLE_COLOR_SCALE.length]),\n concentrations: compound.concentrations,\n unit: data.unit,\n }))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toDoseLayoutState(\n template: DoseResponseTemplate | DoseResponseTemplateData\n): PlateMapEditorState | undefined {\n const data = getTemplateData(template, 'dose-response')\n validateDoseResponseData(data)\n return data.layout ? toPlateMapEditorState(data.layout) : undefined\n}\n","import type {\n PlateMapEditorState,\n Rack,\n Well,\n WellLegendItem,\n} from '../types'\nimport { SAMPLE_COLOR_SCALE, SLOT_ORDER } from '../utils/color'\n\nexport function activePlateFromState(state: PlateMapEditorState) {\n return state.plates.find(plate => plate.id === state.activePlateId) ?? state.plates[0]\n}\n\nexport function sampleColorsFromPlateState(state: PlateMapEditorState): Record<string, string> {\n return Object.fromEntries(\n state.samples\n .filter(sample => sample.color)\n .map(sample => [sample.id, sample.color as string])\n )\n}\n\nexport function legendItemsFromPlateState(state: PlateMapEditorState): WellLegendItem[] {\n return state.samples.map((sample, index) => ({\n type: sample.id,\n label: sample.name,\n color: sample.color ?? colorForIndex(index),\n }))\n}\n\nexport function colorForIndex(index: number): string {\n // The gray tail of the scale is reserved for \"other\"; component plates cycle the eight hues.\n const colors = SAMPLE_COLOR_SCALE.slice(0, 8)\n return colors[index % colors.length]\n}\n\n/**\n * Plates as PlateEditor racks: slots assigned in order, a well's sample id moved to its group (the stored\n * plate map keeps it in `sampleType`). Plate maps carry no injection volume.\n * @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins.\n */\nexport function racksFromPlateState(state: PlateMapEditorState): Rack[] {\n const sampleIds = new Set(state.samples.map(sample => sample.id))\n const asRackWell = (well: Well): Partial<Well> =>\n well.sampleType && sampleIds.has(well.sampleType) ? { ...well, sampleType: 'sample', group: well.sampleType } : well\n return state.plates.map((plate, index) => ({\n id: plate.id,\n name: plate.name,\n format: plate.format,\n slot: SLOT_ORDER[index % SLOT_ORDER.length],\n injectionVolume: 0,\n wells: Object.fromEntries(Object.entries(plate.wells).map(([id, well]) => [id, asRackWell(well)])),\n }))\n}\n","import type { Well } from '../types'\nimport type {\n AssayMatrixTemplate,\n BioTemplateEnvelope,\n CalibrationCurveTemplate,\n DataFrameTemplate,\n FlowCytometryPanelTemplate,\n InstrumentRunTemplate,\n ProtocolStepsTemplate,\n QpcrPlateTemplate,\n ReagentListTemplate,\n SamplePrepTemplate,\n SampleSheetTemplate,\n TimeCourseTemplate,\n TemplateDataFrameAdapterResult,\n} from './types'\nimport { toAssayMatrixDataFrame } from './assayMatrixAdapters'\nimport { toCalibrationCurveDataFrame } from './calibrationCurveAdapters'\nimport { toFlowPanelDataFrame } from './flowPanelAdapters'\nimport { toInstrumentRunDataFrame } from './instrumentRunAdapters'\nimport { toProtocolDataFrame } from './protocolAdapters'\nimport { toQpcrDataFrame } from './qpcrAdapters'\nimport { toReagentDataFrame } from './reagentAdapters'\nimport { toSamplePrepDataFrame } from './samplePrepAdapters'\nimport { toSampleDataFrame } from './sampleSheetAdapters'\nimport { toTimeCourseDataFrame } from './timeCourseAdapters'\n\nexport {\n toAssayMatrixColumns,\n toAssayMatrixDataFrame,\n toAssayMatrixRows,\n toAssayMatrixSampleOptions,\n} from './assayMatrixAdapters'\n\nexport {\n toCalibrationCurveColumns,\n toCalibrationCurveDataFrame,\n toCalibrationCurveRows,\n} from './calibrationCurveAdapters'\n\nexport {\n toDoseConditions,\n toDoseLayoutState,\n} from './doseResponseAdapters'\n\nexport {\n toFlowPanelColumns,\n toFlowPanelDataFrame,\n toFlowPanelRows,\n} from './flowPanelAdapters'\n\nexport {\n toInstrumentRunColumns,\n toInstrumentRunDataFrame,\n toInstrumentRunRows,\n toInstrumentRunScheduleEvents,\n toInstrumentRunSteps,\n} from './instrumentRunAdapters'\n\nexport {\n toPlateMapEditorState,\n toWellPlateWells,\n} from './plateMapAdapters'\n\nexport { racksFromPlateState } from './componentPlateHelpers'\n\nexport {\n toProtocolColumns,\n toProtocolDataFrame,\n toProtocolRows,\n toProtocolSteps,\n} from './protocolAdapters'\n\nexport {\n toQpcrColumns,\n toQpcrDataFrame,\n toQpcrRows,\n toQpcrWellPlateWells,\n} from './qpcrAdapters'\n\nexport {\n toReagentColumns,\n toReagentDataFrame,\n toReagentListItems,\n toReagentRows,\n} from './reagentAdapters'\n\nexport {\n toSamplePrepColumns,\n toSamplePrepDataFrame,\n toSamplePrepRows,\n} from './samplePrepAdapters'\n\nexport {\n toSampleColumns,\n toSampleDataFrame,\n toSampleOptions,\n toSampleRows,\n} from './sampleSheetAdapters'\n\nexport {\n toTimeCourseColumns,\n toTimeCourseDataFrame,\n toTimeCourseRows,\n toTimeCourseSteps,\n} from './timeCourseAdapters'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toTemplateDataFrame(\n template: DataFrameTemplate | BioTemplateEnvelope<unknown>\n): TemplateDataFrameAdapterResult {\n switch (template.template_id) {\n case 'sample-sheet':\n return toSampleDataFrame(template as SampleSheetTemplate)\n case 'sample-prep':\n return toSamplePrepDataFrame(template as SamplePrepTemplate)\n case 'calibration-curve':\n return toCalibrationCurveDataFrame(template as CalibrationCurveTemplate)\n case 'time-course':\n return toTimeCourseDataFrame(template as TimeCourseTemplate)\n case 'protocol-steps':\n return toProtocolDataFrame(template as ProtocolStepsTemplate)\n case 'assay-matrix':\n return toAssayMatrixDataFrame(template as AssayMatrixTemplate)\n case 'reagent-list':\n return toReagentDataFrame(template as ReagentListTemplate)\n case 'flow-cytometry-panel':\n return toFlowPanelDataFrame(template as FlowCytometryPanelTemplate)\n case 'instrument-run':\n return toInstrumentRunDataFrame(template as InstrumentRunTemplate)\n case 'qpcr-plate':\n return toQpcrDataFrame(template as QpcrPlateTemplate)\n default:\n throw new Error(`Template '${String(template.template_id)}' does not expose a DataFrame adapter.`)\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toWellMapArray(wells: Record<string, Well>): Well[] {\n return Object.values(wells)\n}\n","import { cloneBinding } from './componentBindingHelpers'\nimport { templateComponentBindings } from './componentBindingCatalog'\nimport type {\n BioTemplateComponentPropsBinding,\n} from './componentBindings'\nimport type { TemplateId } from './types'\n\nexport function propsBinding(\n templateId: TemplateId,\n component: string,\n propsObject: Record<string, unknown>\n): BioTemplateComponentPropsBinding {\n const matched = templateComponentBindings[templateId].find(binding => binding.component === component)\n if (!matched) {\n throw new Error(`No component binding registered for '${templateId}' and '${component}'.`)\n }\n return {\n ...cloneBinding(matched),\n propsObject,\n }\n}\n","import {\n toDoseConditions,\n toDoseLayoutState,\n} from './adapters'\nimport {\n activePlateFromState,\n sampleColorsFromPlateState,\n} from './componentPlateHelpers'\nimport { propsBinding } from './componentPropsFactory'\nimport type { BioTemplateComponentPropsBinding } from './componentBindings'\nimport type { DoseResponseTemplate } from './types'\n\nexport function doseResponseProps(template: DoseResponseTemplate): BioTemplateComponentPropsBinding[] {\n const conditions = toDoseConditions(template)\n const layout = toDoseLayoutState(template)\n const targetWells = layout ? Object.keys(activePlateFromState(layout).wells) : []\n const props = [\n propsBinding('dose-response', 'DoseCalculator', {\n mode: 'serial',\n targetWells,\n disabled: conditions.length === 0,\n }),\n ]\n\n if (layout) {\n const plate = activePlateFromState(layout)\n props.push(propsBinding('dose-response', 'WellPlate', {\n format: plate.format,\n wells: plate.wells,\n sampleColors: sampleColorsFromPlateState(layout),\n legendItems: conditions.map(condition => ({\n type: condition.label,\n label: condition.label,\n color: condition.color,\n })),\n showLegend: true,\n }))\n }\n\n return props\n}\n","import {\n toAssayMatrixSampleOptions,\n toInstrumentRunScheduleEvents,\n toReagentListItems,\n toSampleOptions,\n toTemplateDataFrame,\n} from './adapters'\nimport { propsBinding } from './componentPropsFactory'\nimport type { BioTemplateComponentPropsBinding } from './componentBindings'\nimport type {\n AssayMatrixTemplate,\n DataFrameTemplate,\n InstrumentRunTemplate,\n ProtocolStepsTemplate,\n ReagentListTemplate,\n SampleSheetTemplate,\n TemplateId,\n TimeCourseTemplate,\n} from './types'\n\nexport function dataFrameProps(template: DataFrameTemplate): BioTemplateComponentPropsBinding {\n const frame = toTemplateDataFrame(template)\n return propsBinding(template.template_id as TemplateId, 'DataFrame', {\n ...frame,\n searchable: true,\n sortable: true,\n size: 'sm',\n })\n}\n\nexport function sampleSelectorProps(template: SampleSheetTemplate): BioTemplateComponentPropsBinding {\n const options = toSampleOptions(template)\n return propsBinding('sample-sheet', 'SampleSelector', {\n samples: options.map(option => option.label),\n modelValue: [],\n })\n}\n\nexport function assayMatrixSampleSelectorProps(template: AssayMatrixTemplate): BioTemplateComponentPropsBinding {\n const options = toAssayMatrixSampleOptions(template)\n return propsBinding('assay-matrix', 'SampleSelector', {\n samples: options.map(option => option.label),\n modelValue: [],\n })\n}\n\nexport function timelineProps(\n template: TimeCourseTemplate | ProtocolStepsTemplate | InstrumentRunTemplate,\n steps: unknown[],\n editable = false\n): BioTemplateComponentPropsBinding {\n return propsBinding(template.template_id as TemplateId, 'ExperimentTimeline', {\n modelValue: steps,\n orientation: 'vertical',\n editable,\n })\n}\n\nexport function scheduleCalendarProps(template: InstrumentRunTemplate): BioTemplateComponentPropsBinding {\n const events = toInstrumentRunScheduleEvents(template)\n return propsBinding('instrument-run', 'ScheduleCalendar', {\n modelValue: events[0]?.start,\n events,\n view: 'day',\n readonly: true,\n showNavigation: false,\n showViewToggle: false,\n })\n}\n\nexport function reagentListProps(template: ReagentListTemplate): BioTemplateComponentPropsBinding {\n return propsBinding('reagent-list', 'ReagentList', {\n modelValue: toReagentListItems(template),\n searchable: true,\n sortable: true,\n })\n}\n","import {\n toPlateMapEditorState,\n toWellPlateWells,\n} from './adapters'\nimport {\n activePlateFromState,\n legendItemsFromPlateState,\n racksFromPlateState,\n sampleColorsFromPlateState,\n} from './componentPlateHelpers'\nimport { propsBinding } from './componentPropsFactory'\nimport type { BioTemplateComponentPropsBinding } from './componentBindings'\nimport type { PlateMapTemplate } from './types'\n\nexport function plateMapProps(template: PlateMapTemplate): BioTemplateComponentPropsBinding[] {\n const state = toPlateMapEditorState(template)\n const plate = activePlateFromState(state)\n return [\n propsBinding('plate-map', 'PlateEditor', {\n modelValue: racksFromPlateState(state),\n activeRackId: plate.id,\n groups: state.samples,\n formats: [plate.format],\n wellFields: false,\n }),\n propsBinding('plate-map', 'WellPlate', {\n format: plate.format,\n wells: toWellPlateWells(template),\n sampleColors: sampleColorsFromPlateState(state),\n legendItems: legendItemsFromPlateState(state),\n showLegend: true,\n }),\n ]\n}\n","import type { WellLegendItem } from '../types'\nimport { toQpcrWellPlateWells } from './adapters'\nimport { colorForIndex } from './componentPlateHelpers'\nimport { getTemplateData } from './templateEnvelopes'\nimport { dataFrameProps } from './componentGenericProps'\nimport { propsBinding } from './componentPropsFactory'\nimport type { BioTemplateComponentPropsBinding } from './componentBindings'\nimport type { QpcrPlateTemplate } from './types'\n\nexport function qpcrPlateProps(template: QpcrPlateTemplate): BioTemplateComponentPropsBinding[] {\n const data = getTemplateData(template, 'qpcr-plate')\n const frame = dataFrameProps(template)\n return [\n propsBinding('qpcr-plate', 'WellPlate', {\n format: data.format,\n wells: toQpcrWellPlateWells(template),\n sampleColors: Object.fromEntries(data.samples.map((sample, index) => [sample.sampleId, colorForIndex(index)])),\n legendItems: data.samples.map((sample, index): WellLegendItem => ({\n type: sample.sampleId,\n label: sample.name ?? sample.sampleId,\n color: colorForIndex(index),\n })),\n showLegend: true,\n }),\n frame,\n ]\n}\n","import {\n toInstrumentRunSteps,\n toProtocolSteps,\n toTimeCourseSteps,\n} from './adapters'\nimport { doseResponseProps } from './componentDoseResponseProps'\nimport {\n assayMatrixSampleSelectorProps,\n dataFrameProps,\n reagentListProps,\n sampleSelectorProps,\n scheduleCalendarProps,\n timelineProps,\n} from './componentGenericProps'\nimport { plateMapProps } from './componentPlateMapProps'\nimport { qpcrPlateProps } from './componentQpcrPlateProps'\nimport type { BioTemplateComponentPropsBinding } from './componentBindings'\nimport type {\n AssayMatrixTemplate,\n BioTemplateEnvelope,\n DataFrameTemplate,\n DoseResponseTemplate,\n InstrumentRunTemplate,\n PlateMapTemplate,\n ProtocolStepsTemplate,\n QpcrPlateTemplate,\n ReagentListTemplate,\n SampleSheetTemplate,\n TimeCourseTemplate,\n} from './types'\n\nexport function propsForTemplate(template: BioTemplateEnvelope<unknown>): BioTemplateComponentPropsBinding[] {\n switch (template.template_id) {\n case 'plate-map':\n return plateMapProps(template as PlateMapTemplate)\n case 'sample-sheet':\n return [\n dataFrameProps(template as DataFrameTemplate),\n sampleSelectorProps(template as SampleSheetTemplate),\n ]\n case 'sample-prep':\n case 'calibration-curve':\n case 'flow-cytometry-panel':\n return [dataFrameProps(template as DataFrameTemplate)]\n case 'assay-matrix':\n return [\n dataFrameProps(template as DataFrameTemplate),\n assayMatrixSampleSelectorProps(template as AssayMatrixTemplate),\n ]\n case 'instrument-run':\n return [\n dataFrameProps(template as DataFrameTemplate),\n scheduleCalendarProps(template as InstrumentRunTemplate),\n timelineProps(template as InstrumentRunTemplate, toInstrumentRunSteps(template as InstrumentRunTemplate)),\n ]\n case 'dose-response':\n return doseResponseProps(template as DoseResponseTemplate)\n case 'time-course':\n return [\n timelineProps(template as TimeCourseTemplate, toTimeCourseSteps(template as TimeCourseTemplate)),\n dataFrameProps(template as DataFrameTemplate),\n ]\n case 'protocol-steps':\n return [\n timelineProps(template as ProtocolStepsTemplate, toProtocolSteps(template as ProtocolStepsTemplate), true),\n dataFrameProps(template as DataFrameTemplate),\n ]\n case 'reagent-list':\n return [\n reagentListProps(template as ReagentListTemplate),\n dataFrameProps(template as DataFrameTemplate),\n ]\n case 'qpcr-plate':\n return qpcrPlateProps(template as QpcrPlateTemplate)\n default:\n return []\n }\n}\n","import { extractTemplateCollection } from './templateEnvelopes'\nimport {\n isTemplateEnvelope,\n resolveComponentTemplateIds,\n} from './componentTargetResolvers'\nimport {\n cloneBinding,\n cloneBindingMap,\n cloneBindings,\n toVueSfc,\n uniquePropsName,\n} from './componentBindingHelpers'\nimport { templateComponentBindings } from './componentBindingCatalog'\nimport { propsForTemplate } from './componentTemplateProps'\nimport type {\n BioTemplateEnvelope,\n TemplateCollectionEnvelope,\n TemplateId,\n TemplatePackId,\n TemplatePresetId,\n} from './types'\n\nexport type BioTemplateComponentTarget =\n | TemplateId\n | TemplatePackId\n | TemplatePresetId\n | string\n | BioTemplateEnvelope<unknown>\n | TemplateCollectionEnvelope\n\nexport interface BioTemplateComponentBinding {\n id: string\n template_id: TemplateId\n component: string\n adapters: readonly string[]\n props: readonly string[]\n description: string\n importPath: '@morscherlab/mint-sdk'\n}\n\nexport interface BioTemplateComponentPropsBinding extends BioTemplateComponentBinding {\n propsObject: Record<string, unknown>\n}\n\nexport interface BioTemplateResolvedComponentBinding extends Omit<BioTemplateComponentBinding, 'props'> {\n /** Prop names advertised by the static template/component compatibility catalog. */\n propNames: readonly string[]\n /** Concrete props ready for direct `v-bind=\"componentBindingsById[id].props\"` use. */\n props: Record<string, unknown>\n /** Backward-compatible alias for callers that already consume componentProps entries. */\n propsObject: Record<string, unknown>\n}\n\nexport type BioTemplateComponentBindingsById = Record<string, BioTemplateResolvedComponentBinding>\nexport type BioTemplateComponentPropsById = Record<string, Record<string, unknown>>\nexport type BioTemplateComponentPropsByComponent = Record<string, Record<string, unknown>[]>\n\nexport interface BioTemplateComponentPropsLookupOptions {\n templateId?: TemplateId\n id?: string\n}\n\nexport interface BioTemplateComponentImport {\n importPath: BioTemplateComponentBinding['importPath']\n components: string[]\n statement: string\n}\n\nexport interface BioTemplateComponentSnippet extends BioTemplateComponentBinding {\n propsName: string\n propsExpression: string\n template: string\n}\n\nexport interface BioTemplateComponentSnippetOptions {\n propsVariable?: string\n}\n\nexport interface BioTemplateComponentUsageOptions extends BioTemplateComponentSnippetOptions {\n targetExpression?: string\n targetPropName?: string\n}\n\nexport interface BioTemplateComponentUsage {\n imports: BioTemplateComponentImport[]\n componentProps: BioTemplateComponentPropsBinding[]\n snippets: BioTemplateComponentSnippet[]\n propsDeclarations: string[]\n scriptSetup: string\n template: string\n sfc: string\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function listBioTemplateComponentBindings(): Record<TemplateId, BioTemplateComponentBinding[]> {\n return cloneBindingMap(templateComponentBindings)\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function getBioTemplateComponentBindings(\n target: BioTemplateComponentTarget\n): BioTemplateComponentBinding[] {\n const templateIds = resolveComponentTemplateIds(target)\n return templateIds.flatMap(templateId => cloneBindings(templateComponentBindings[templateId]))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toBioTemplateComponentProps(\n target: BioTemplateEnvelope<unknown> | TemplateCollectionEnvelope\n): BioTemplateComponentPropsBinding[] {\n if (isTemplateEnvelope(target)) {\n return propsForTemplate(target)\n }\n\n const collection = extractTemplateCollection(target)\n return Object.values(collection).flatMap(template => propsForTemplate(template))\n}\n\n/**\n * Return resolved component bindings with concrete props for direct slot rendering.\n *\n * @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins.\n */\nexport function toBioTemplateComponentBindings(\n target: BioTemplateEnvelope<unknown> | TemplateCollectionEnvelope,\n): BioTemplateResolvedComponentBinding[] {\n return toBioTemplateComponentProps(target).map(toResolvedComponentBinding)\n}\n\n/**\n * Return resolved component bindings keyed by stable template component id.\n *\n * @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins.\n */\nexport function toBioTemplateComponentBindingsById(\n target: BioTemplateEnvelope<unknown> | TemplateCollectionEnvelope,\n): BioTemplateComponentBindingsById {\n return Object.fromEntries(\n toBioTemplateComponentBindings(target).map(binding => [binding.id, binding]),\n )\n}\n\n/**\n * Return component props keyed by stable binding id for direct `v-bind=\"componentPropsById[id]\"` use.\n *\n * @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins.\n */\nexport function toBioTemplateComponentPropsById(\n target: BioTemplateEnvelope<unknown> | TemplateCollectionEnvelope,\n): BioTemplateComponentPropsById {\n return Object.fromEntries(\n toBioTemplateComponentProps(target).map(binding => [binding.id, binding.propsObject]),\n )\n}\n\n/**\n * Return component props grouped by SDK component name for direct WellPlate/DoseCalculator binding.\n *\n * @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins.\n */\nexport function toBioTemplateComponentPropsByComponent(\n target: BioTemplateEnvelope<unknown> | TemplateCollectionEnvelope,\n): BioTemplateComponentPropsByComponent {\n const grouped: BioTemplateComponentPropsByComponent = {}\n for (const binding of toBioTemplateComponentProps(target)) {\n const props = grouped[binding.component] ?? []\n props.push(binding.propsObject)\n grouped[binding.component] = props\n }\n return grouped\n}\n\n/**\n * Return the first props object for an SDK component, optionally restricted by template id or binding id.\n *\n * @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins.\n */\nexport function getBioTemplateComponentProps(\n target: BioTemplateEnvelope<unknown> | TemplateCollectionEnvelope,\n component: string,\n options: BioTemplateComponentPropsLookupOptions = {},\n): Record<string, unknown> | undefined {\n return toBioTemplateComponentProps(target).find((binding) => {\n if (binding.component !== component) return false\n if (options.id !== undefined && binding.id !== options.id) return false\n if (options.templateId !== undefined && binding.template_id !== options.templateId) return false\n return true\n })?.propsObject\n}\n\nfunction toResolvedComponentBinding(\n binding: BioTemplateComponentPropsBinding,\n): BioTemplateResolvedComponentBinding {\n const { props: propNames, propsObject, ...rest } = binding\n return {\n ...rest,\n propNames,\n props: propsObject,\n propsObject,\n }\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toBioTemplateComponentImports(\n target: BioTemplateComponentTarget\n): BioTemplateComponentImport[] {\n const groups = new Map<BioTemplateComponentBinding['importPath'], string[]>()\n\n for (const binding of getBioTemplateComponentBindings(target)) {\n const components = groups.get(binding.importPath) ?? []\n if (!components.includes(binding.component)) components.push(binding.component)\n groups.set(binding.importPath, components)\n }\n\n return Array.from(groups.entries()).map(([importPath, components]) => ({\n importPath,\n components,\n statement: `import { ${components.join(', ')} } from '${importPath}'`,\n }))\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toBioTemplateComponentSnippets(\n target: BioTemplateEnvelope<unknown> | TemplateCollectionEnvelope,\n options: BioTemplateComponentSnippetOptions = {}\n): BioTemplateComponentSnippet[] {\n const propsVariable = options.propsVariable ?? 'componentProps'\n const usedNames = new Map<string, number>()\n\n return toBioTemplateComponentProps(target).map((binding, index) => {\n const propsName = uniquePropsName(binding, usedNames)\n const propsExpression = `${propsVariable}[${index}].propsObject`\n return {\n ...cloneBinding(binding),\n propsName,\n propsExpression,\n template: `<${binding.component} v-bind=\"${propsExpression}\" />`,\n }\n })\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function toBioTemplateComponentUsage(\n target: BioTemplateEnvelope<unknown> | TemplateCollectionEnvelope,\n options: BioTemplateComponentUsageOptions = {}\n): BioTemplateComponentUsage {\n const propsVariable = options.propsVariable ?? 'componentProps'\n const usesGeneratedTargetProp = options.targetExpression === undefined\n const targetPropName = options.targetPropName ?? 'templateCollection'\n const targetExpression = options.targetExpression ?? `props.${targetPropName}`\n const componentProps = toBioTemplateComponentProps(target)\n const snippets = toBioTemplateComponentSnippets(target, { propsVariable }).map(snippet => ({\n ...snippet,\n propsExpression: snippet.propsName,\n template: `<${snippet.component} v-bind=\"${snippet.propsName}\" />`,\n }))\n const propsDeclarations = snippets.map(\n (snippet, index) => `const ${snippet.propsName} = ${propsVariable}[${index}].propsObject`\n )\n const setupLines = [\n ...(usesGeneratedTargetProp\n ? [`const props = defineProps<{ ${targetPropName}: BioTemplateEnvelope<unknown> | TemplateCollectionEnvelope }>()`]\n : []),\n `const ${propsVariable} = toBioTemplateComponentProps(${targetExpression})`,\n ...propsDeclarations,\n ]\n const imports = toBioTemplateComponentImports(target)\n const template = snippets.map(snippet => snippet.template).join('\\n')\n\n return {\n imports,\n componentProps,\n snippets,\n propsDeclarations,\n scriptSetup: setupLines.join('\\n'),\n template,\n sfc: toVueSfc(imports, setupLines, template, usesGeneratedTargetProp),\n }\n}\n","import {\n readBoolean,\n readInteger,\n readNumber,\n readNumberList,\n readOptionalString,\n readString,\n readStringList,\n} from './builderReadUtils'\nimport { readPlateFormat } from '../components/WellPlate.geometry'\nimport { getBioTemplatePresetInfo } from './presets'\nimport type {\n CreateElisaAssayCollectionOptions,\n CreateFlowCytometryAssayCollectionOptions,\n CreateLcmsBatchCollectionOptions,\n CreateQpcrExpressionCollectionOptions,\n CreateQpcrPlateTemplateOptions,\n CreateSamplePrepTemplateOptions,\n CreateTargetedMetabolomicsCollectionOptions,\n CreateWellPlateScreenCollectionOptions,\n CreateWesternBlotAssayCollectionOptions,\n TemplatePresetId,\n} from './types'\n\nexport type BioTemplateControlValues = Record<string, unknown>\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function bioTemplatePresetControlValuesToOptions(\n name: 'wellplate-screen',\n values: BioTemplateControlValues\n): CreateWellPlateScreenCollectionOptions\nexport function bioTemplatePresetControlValuesToOptions(\n name: 'qpcr-expression',\n values: BioTemplateControlValues\n): CreateQpcrExpressionCollectionOptions\nexport function bioTemplatePresetControlValuesToOptions(\n name: 'lcms-batch',\n values: BioTemplateControlValues\n): CreateLcmsBatchCollectionOptions\nexport function bioTemplatePresetControlValuesToOptions(\n name: 'targeted-metabolomics',\n values: BioTemplateControlValues\n): CreateTargetedMetabolomicsCollectionOptions\nexport function bioTemplatePresetControlValuesToOptions(\n name: 'elisa-assay',\n values: BioTemplateControlValues\n): CreateElisaAssayCollectionOptions\nexport function bioTemplatePresetControlValuesToOptions(\n name: 'flow-cytometry-assay',\n values: BioTemplateControlValues\n): CreateFlowCytometryAssayCollectionOptions\nexport function bioTemplatePresetControlValuesToOptions(\n name: 'western-blot-assay',\n values: BioTemplateControlValues\n): CreateWesternBlotAssayCollectionOptions\nexport function bioTemplatePresetControlValuesToOptions(\n name: TemplatePresetId | string,\n values: BioTemplateControlValues\n):\n | CreateWellPlateScreenCollectionOptions\n | CreateQpcrExpressionCollectionOptions\n | CreateLcmsBatchCollectionOptions\n | CreateTargetedMetabolomicsCollectionOptions\n | CreateElisaAssayCollectionOptions\n | CreateFlowCytometryAssayCollectionOptions\n | CreateWesternBlotAssayCollectionOptions\nexport function bioTemplatePresetControlValuesToOptions(\n name: TemplatePresetId | string,\n values: BioTemplateControlValues\n):\n | CreateWellPlateScreenCollectionOptions\n | CreateQpcrExpressionCollectionOptions\n | CreateLcmsBatchCollectionOptions\n | CreateTargetedMetabolomicsCollectionOptions\n | CreateElisaAssayCollectionOptions\n | CreateFlowCytometryAssayCollectionOptions\n | CreateWesternBlotAssayCollectionOptions {\n const preset = getBioTemplatePresetInfo(name)\n if (!preset) {\n throw new Error(`Unknown template preset '${name}'.`)\n }\n\n if (preset.name === 'wellplate-screen') {\n return {\n samples: readStringList(values.sampleNames, ['Control', 'Treatment']),\n plateName: readString(values.plateName, 'Screen plate'),\n plateFormat: readPlateFormat(values.plateFormat, 96),\n unit: readString(values.unit, 'uM'),\n replicates: readInteger(values.replicates, 3),\n }\n }\n\n if (preset.name === 'qpcr-expression') {\n return {\n samples: readStringList(values.sampleNames, ['Control', 'Treatment']),\n targets: readStringList(values.targets, ['ACTB', 'GAPDH']),\n chemistry: readString(values.chemistry, 'sybr') as CreateQpcrPlateTemplateOptions['chemistry'],\n format: readPlateFormat(values.plateFormat, 96),\n includeNoTemplateControls: readBoolean(values.includeNoTemplateControls, true),\n replicates: readInteger(values.replicates, 3),\n instrument: readOptionalString(values.instrument),\n }\n }\n\n if (preset.name === 'lcms-batch') {\n return {\n samples: readStringList(values.sampleNames, ['S001', 'S002']),\n features: readStringList(values.featureNames, ['Glucose', 'Lactate']),\n instrument: readString(values.instrument, 'LC-MS'),\n method: readString(values.method, 'Default method'),\n includeQc: readBoolean(values.includeQc, true),\n }\n }\n\n if (preset.name === 'targeted-metabolomics') {\n return {\n samples: readStringList(values.sampleNames, ['S001', 'S002']),\n metabolites: readStringList(values.metaboliteNames, ['Glucose', 'Lactate', 'Pyruvate']),\n internalStandards: readStringList(\n values.internalStandards,\n ['Stable isotope internal standard mix'],\n ),\n standardConcentrations: readNumberList(values.standardConcentrations, [0.1, 1, 10, 100]),\n concentrationUnit: readString(values.concentrationUnit, 'uM'),\n responseUnit: readString(values.responseUnit, 'peak area ratio'),\n calibrationAnalyte: readOptionalString(values.calibrationAnalyte),\n instrument: readString(values.instrument, 'LC-MS'),\n method: readString(values.method, 'Targeted metabolomics'),\n prepType: readString(values.prepType, 'extraction') as CreateSamplePrepTemplateOptions['prepType'],\n outputVolume: readNumber(values.outputVolume, 50),\n includeQc: readBoolean(values.includeQc, true),\n }\n }\n\n if (preset.name === 'elisa-assay') {\n return {\n samples: readStringList(values.sampleNames, ['Control', 'Treatment']),\n analyte: readString(values.analyte, 'Analyte'),\n standardConcentrations: readNumberList(values.standardConcentrations, [1000, 100, 10, 1]),\n unit: readString(values.unit, 'pg/mL'),\n responseUnit: readString(values.responseUnit, 'OD450'),\n plateName: readString(values.plateName, 'ELISA plate'),\n plateFormat: readPlateFormat(values.plateFormat, 96),\n }\n }\n\n if (preset.name === 'flow-cytometry-assay') {\n return {\n samples: readStringList(values.sampleNames, ['Control', 'Treatment']),\n markers: readStringList(values.markers, ['CD3', 'CD4', 'CD8']),\n features: readStringList(values.featureNames, ['CD3+ cells', 'CD4+ cells', 'CD8+ cells']),\n instrument: readString(values.instrument, 'Flow cytometer'),\n includeDefaultControls: readBoolean(values.includeDefaultControls, true),\n }\n }\n\n if (preset.name === 'western-blot-assay') {\n return {\n samples: readStringList(values.sampleNames, ['Control', 'Treatment']),\n targets: readStringList(values.targets, ['Target protein']),\n loadingControl: readString(values.loadingControl, 'ACTB'),\n }\n }\n\n throw new Error(`Unknown template preset '${name}'.`)\n}\n","export function sampleIdFromName(name: string, index: number): string {\n return idFromName(name, `sample-${index + 1}`)\n}\n\nexport function compoundIdFromName(name: string, index: number): string {\n return idFromName(name, `compound-${index + 1}`)\n}\n\nexport function idFromName(name: string, fallback: string): string {\n const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '')\n return slug || fallback\n}\n\nexport function timepointId(value: number, unit: string, index: number): string {\n const raw = Number.isInteger(value)\n ? String(value)\n : String(value).replace(/0+$/, '').replace(/\\.$/, '')\n const token = raw.replace('.', 'p')\n return token ? `t${token}-${unit}` : `timepoint-${index + 1}`\n}\n","import { SAMPLE_COLOR_SCALE } from '../utils/color'\nimport { sampleIdFromName } from './builderIdUtils'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport type {\n CreatePlateMapTemplateOptions,\n PlateMapTemplate,\n TemplateSample,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createPlateMapTemplate(\n options: CreatePlateMapTemplateOptions = {}\n): PlateMapTemplate {\n const {\n id = 'plate-1',\n name = 'Plate 1',\n format = 96,\n samples = [],\n metadata = {},\n } = options\n\n const sampleDefinitions = samples.map((sample, index): TemplateSample => {\n if (typeof sample !== 'string') return sample\n return {\n id: sampleIdFromName(sample, index),\n name: sample,\n color: SAMPLE_COLOR_SCALE[index % SAMPLE_COLOR_SCALE.length],\n }\n })\n\n return createTemplateEnvelope('plate-map', {\n plates: [\n {\n id,\n name,\n format,\n wells: {},\n },\n ],\n samples: sampleDefinitions,\n activePlateId: id,\n selectedWells: [],\n }, metadata)\n}\n","import type {\n SamplePrepStep,\n SamplePrepStepInput,\n SampleRecord,\n} from './types'\nimport {\n idFromName,\n sampleIdFromName,\n} from './builderIdUtils'\n\nexport function normalizeSampleRecord(sample: SampleRecord): SampleRecord {\n return {\n ...sample,\n metadata: sample.metadata ?? {},\n }\n}\n\nexport function presetSampleRecords(samples: Array<string | SampleRecord>): SampleRecord[] {\n return samples.map((sample, index) => {\n if (typeof sample !== 'string') return normalizeSampleRecord(sample)\n return {\n sampleId: sampleIdFromName(sample, index),\n name: sample,\n metadata: {},\n }\n })\n}\n\nexport function normalizeSamplePrepStep(\n step: SamplePrepStepInput,\n prepType: SamplePrepStep['type'],\n volumeUnit: string,\n order: number,\n index: number\n): SamplePrepStep {\n const type = step.type ?? prepType\n const sourceSampleId = step.sourceSampleId\n const name = step.name || `Prepare ${sourceSampleId ?? index + 1}`\n return {\n id: step.id || idFromName(name, `${type}-${index + 1}`),\n order: step.order ?? order,\n type,\n name,\n sourceSampleId,\n sourcePlateId: step.sourcePlateId,\n sourceWellId: step.sourceWellId,\n destinationSampleId: step.destinationSampleId,\n destinationPlateId: step.destinationPlateId,\n destinationWellId: step.destinationWellId,\n reagentId: step.reagentId,\n inputVolume: step.inputVolume,\n outputVolume: step.outputVolume,\n volumeUnit: step.volumeUnit || volumeUnit,\n durationMin: step.durationMin,\n status: step.status ?? 'planned',\n metadata: step.metadata ?? {},\n }\n}\n","import { normalizeSampleRecord } from './sampleNormalizers'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport { validateSampleSheetData } from './templateValidators'\nimport type {\n CreateSampleSheetTemplateOptions,\n SampleSheetTemplate,\n SampleSheetTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createSampleSheetTemplate(\n options: CreateSampleSheetTemplateOptions\n): SampleSheetTemplate {\n const data: SampleSheetTemplateData = {\n samples: options.samples.map(normalizeSampleRecord),\n columns: options.columns ?? [\n { id: 'sampleId', label: 'Sample ID', type: 'string', required: true, groupable: false },\n { id: 'name', label: 'Name', type: 'string', required: false, groupable: false },\n ],\n groups: options.groups ?? [],\n }\n validateSampleSheetData(data)\n return createTemplateEnvelope('sample-sheet', data, options.metadata ?? {})\n}\n","import { idFromName } from './builderIdUtils'\nimport { normalizeSamplePrepStep } from './sampleNormalizers'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport { validateSamplePrepData } from './templateValidators'\nimport type {\n CreateSamplePrepTemplateOptions,\n SamplePrepStep,\n SamplePrepTemplate,\n SamplePrepTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createSamplePrepTemplate(\n options: CreateSamplePrepTemplateOptions\n): SamplePrepTemplate {\n const prepType = options.prepType ?? 'extraction'\n const volumeUnit = options.volumeUnit ?? 'uL'\n const steps: SamplePrepStep[] = []\n let order = 1\n\n for (const [index, sample] of options.samples.entries()) {\n if (typeof sample !== 'string') {\n const step = normalizeSamplePrepStep(sample, prepType, volumeUnit, order, index)\n steps.push(step)\n order = Math.max(order, step.order + 1)\n continue\n }\n const sourceSampleId = idFromName(sample, `sample-${index + 1}`)\n steps.push({\n id: `${sourceSampleId}-prep`,\n order,\n type: prepType,\n name: `Prepare ${sample}`,\n sourceSampleId,\n destinationSampleId: `${sourceSampleId}-prepared`,\n inputVolume: options.inputVolume,\n outputVolume: options.outputVolume,\n volumeUnit,\n status: 'planned',\n metadata: {},\n })\n order += 1\n }\n\n const data: SamplePrepTemplateData = {\n protocolName: options.protocolName ?? 'Sample preparation',\n steps,\n metadata: options.metadata ?? {},\n }\n validateSamplePrepData(data)\n return createTemplateEnvelope('sample-prep', data, options.metadata ?? {})\n}\n","import type {\n CalibrationAcceptance,\n CalibrationPoint,\n CalibrationPointInput,\n CompoundDoseSeries,\n ControlDefinition,\n} from './types'\nimport { idFromName } from './builderIdUtils'\n\nexport function normalizeCompound(compound: CompoundDoseSeries): CompoundDoseSeries {\n return {\n ...compound,\n concentrations: [...compound.concentrations].sort((a, b) => b - a),\n metadata: compound.metadata ?? {},\n }\n}\n\nexport function normalizeCalibrationAcceptance(\n acceptance?: Partial<CalibrationAcceptance>,\n requireBlank = true\n): CalibrationAcceptance {\n return {\n minRSquared: acceptance?.minRSquared ?? 0.99,\n standardTolerancePercent: acceptance?.standardTolerancePercent ?? 15,\n qcTolerancePercent: acceptance?.qcTolerancePercent ?? 20,\n requireBlank: acceptance?.requireBlank ?? requireBlank,\n metadata: acceptance?.metadata ?? {},\n }\n}\n\nexport function normalizeCalibrationPoint(\n point: CalibrationPointInput,\n unit: string,\n order: number,\n index: number\n): CalibrationPoint {\n const role = point.role ?? 'standard'\n const level = point.level || `${role.charAt(0).toUpperCase()}${role.slice(1)} ${index + 1}`\n return {\n id: point.id || idFromName(level, `${role}-${index + 1}`),\n order: point.order ?? order,\n role,\n level,\n concentration: point.concentration ?? 0,\n unit: point.unit || unit,\n expectedResponse: point.expectedResponse,\n response: point.response,\n replicate: point.replicate ?? 1,\n include: point.include ?? true,\n status: point.status ?? 'planned',\n metadata: point.metadata ?? {},\n }\n}\n\nexport function normalizeControl(control: ControlDefinition): ControlDefinition {\n return {\n ...control,\n metadata: control.metadata ?? {},\n }\n}\n","import { compoundIdFromName } from './builderIdUtils'\nimport {\n normalizeCompound,\n normalizeControl,\n} from './calibrationNormalizers'\nimport {\n createTemplateEnvelope,\n getTemplateData,\n} from './templateEnvelopes'\nimport { validateDoseResponseData } from './templateValidators'\nimport type {\n CreateDoseResponseTemplateOptions,\n DoseResponseTemplate,\n DoseResponseTemplateData,\n PlateMapTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createDoseResponseTemplate(\n options: CreateDoseResponseTemplateOptions\n): DoseResponseTemplate {\n const compounds = Array.isArray(options.compounds)\n ? options.compounds.map(normalizeCompound)\n : Object.entries(options.compounds).map(([name, concentrations], index) => normalizeCompound({\n id: compoundIdFromName(name, index),\n name,\n concentrations,\n metadata: {},\n }))\n\n const layout = options.layout\n ? getTemplateData<PlateMapTemplateData>(options.layout)\n : undefined\n\n const data: DoseResponseTemplateData = {\n compounds,\n unit: options.unit,\n replicates: options.replicates ?? 1,\n controls: (options.controls ?? []).map(normalizeControl),\n layout,\n metadata: options.metadata ?? {},\n }\n validateDoseResponseData(data)\n return createTemplateEnvelope('dose-response', data, options.metadata ?? {})\n}\n","import { idFromName } from './builderIdUtils'\nimport {\n normalizeCalibrationAcceptance,\n normalizeCalibrationPoint,\n} from './calibrationNormalizers'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport { validateCalibrationCurveData } from './templateValidators'\nimport type {\n CalibrationCurveTemplate,\n CalibrationCurveTemplateData,\n CalibrationPoint,\n CreateCalibrationCurveTemplateOptions,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createCalibrationCurveTemplate(\n options: CreateCalibrationCurveTemplateOptions\n): CalibrationCurveTemplate {\n const unit = options.unit ?? 'uM'\n const points: CalibrationPoint[] = []\n let order = 1\n\n if (options.includeBlank !== false) {\n points.push({\n id: 'blank',\n order,\n role: 'blank',\n level: 'Blank',\n concentration: 0,\n unit,\n replicate: 1,\n include: true,\n status: 'planned',\n metadata: {},\n })\n order += 1\n }\n\n const standardValues: number[] = []\n for (const [index, concentration] of options.concentrations.entries()) {\n if (typeof concentration !== 'number') {\n const point = normalizeCalibrationPoint(concentration, unit, order, index)\n points.push(point)\n if (point.role === 'standard') standardValues.push(point.concentration)\n order = Math.max(order, point.order + 1)\n continue\n }\n standardValues.push(concentration)\n points.push({\n id: `std-${index + 1}`,\n order,\n role: 'standard',\n level: `Standard ${index + 1}`,\n concentration,\n unit,\n replicate: 1,\n include: true,\n status: 'planned',\n metadata: {},\n })\n order += 1\n }\n\n if (options.includeQc !== false) {\n const positiveValues = [...standardValues].filter(value => value > 0).sort((a, b) => a - b)\n const qcValues = positiveValues.length === 0\n ? []\n : positiveValues[0] === positiveValues[positiveValues.length - 1]\n ? [positiveValues[0]]\n : [positiveValues[0], positiveValues[positiveValues.length - 1]]\n for (const [index, concentration] of qcValues.entries()) {\n const level = index === 0 ? 'QC low' : 'QC high'\n points.push({\n id: idFromName(level, `qc-${index + 1}`),\n order,\n role: 'qc',\n level,\n concentration,\n unit,\n replicate: 1,\n include: true,\n status: 'planned',\n metadata: {},\n })\n order += 1\n }\n }\n\n const data: CalibrationCurveTemplateData = {\n analyte: options.analyte ?? 'Analyte',\n model: options.model ?? 'linear',\n xUnit: unit,\n responseUnit: options.responseUnit ?? 'response',\n points,\n acceptance: normalizeCalibrationAcceptance(options.acceptance, options.includeBlank !== false),\n metadata: options.metadata ?? {},\n }\n validateCalibrationCurveData(data)\n return createTemplateEnvelope('calibration-curve', data, options.metadata ?? {})\n}\n","import type {\n ProtocolStepRecord,\n TimeCourseCondition,\n TimePoint,\n} from './types'\nimport { idFromName } from './builderIdUtils'\n\nexport function normalizeTimePoint(timepoint: TimePoint): TimePoint {\n return {\n ...timepoint,\n metadata: timepoint.metadata ?? {},\n }\n}\n\nexport function normalizeCondition(condition: TimeCourseCondition): TimeCourseCondition {\n return {\n ...condition,\n metadata: condition.metadata ?? {},\n }\n}\n\nexport function normalizeProtocolStep(\n step: Partial<ProtocolStepRecord> & { name: string },\n index: number\n): ProtocolStepRecord {\n return {\n id: step.id ?? idFromName(step.name, `step-${index + 1}`),\n type: step.type ?? 'custom',\n name: step.name,\n description: step.description,\n duration: step.duration,\n status: step.status ?? 'pending',\n parameters: step.parameters ?? {},\n order: step.order ?? index,\n metadata: step.metadata ?? {},\n }\n}\n","import { SAMPLE_COLOR_SCALE } from '../utils/color'\nimport {\n idFromName,\n timepointId,\n} from './builderIdUtils'\nimport {\n normalizeCondition,\n normalizeTimePoint,\n} from './protocolNormalizers'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport { validateTimeCourseData } from './templateValidators'\nimport type {\n CreateTimeCourseTemplateOptions,\n TimeCourseCondition,\n TimeCourseTemplate,\n TimeCourseTemplateData,\n TimePoint,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createTimeCourseTemplate(\n options: CreateTimeCourseTemplateOptions\n): TimeCourseTemplate {\n const timepoints = options.timepoints.map((timepoint, index): TimePoint => {\n if (typeof timepoint !== 'number') return normalizeTimePoint(timepoint)\n return {\n id: timepointId(timepoint, options.unit, index),\n label: `${timepoint} ${options.unit}`,\n value: timepoint,\n unit: options.unit,\n metadata: {},\n }\n }).sort((a, b) => a.value - b.value)\n\n const conditions = options.conditions.map((condition, index): TimeCourseCondition => {\n if (typeof condition !== 'string') return normalizeCondition(condition)\n return {\n id: idFromName(condition, `condition-${index + 1}`),\n name: condition,\n color: SAMPLE_COLOR_SCALE[index % SAMPLE_COLOR_SCALE.length],\n metadata: {},\n }\n })\n\n const samples = conditions.flatMap(condition =>\n timepoints.flatMap(timepoint =>\n Array.from({ length: options.replicates ?? 1 }, (_, index) => ({\n sampleId: `${condition.id}-${timepoint.id}-r${index + 1}`,\n conditionId: condition.id,\n timepointId: timepoint.id,\n replicate: index + 1,\n metadata: {},\n }))\n )\n )\n\n const data: TimeCourseTemplateData = {\n timepoints,\n conditions,\n samples,\n metadata: options.metadata ?? {},\n }\n validateTimeCourseData(data)\n return createTemplateEnvelope('time-course', data, options.metadata ?? {})\n}\n","import { idFromName } from './builderIdUtils'\nimport { normalizeProtocolStep } from './protocolNormalizers'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport { validateProtocolStepsData } from './templateValidators'\nimport type {\n CreateProtocolStepsTemplateOptions,\n ProtocolStepRecord,\n ProtocolStepsTemplate,\n ProtocolStepsTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createProtocolStepsTemplate(\n options: CreateProtocolStepsTemplateOptions\n): ProtocolStepsTemplate {\n const steps = options.steps.map((step, index): ProtocolStepRecord => {\n if (typeof step === 'string') {\n return {\n id: idFromName(step, `step-${index + 1}`),\n type: 'custom',\n name: step,\n status: 'pending',\n parameters: {},\n order: index,\n metadata: {},\n }\n }\n return normalizeProtocolStep(step, index)\n }).sort((a, b) => a.order - b.order)\n\n const data: ProtocolStepsTemplateData = {\n steps,\n metadata: options.metadata ?? {},\n }\n validateProtocolStepsData(data)\n return createTemplateEnvelope('protocol-steps', data, options.metadata ?? {})\n}\n","import type {\n AssayFeature,\n AssaySample,\n} from './types'\nimport { idFromName } from './builderIdUtils'\n\nexport function createAssaySampleLookup(samples: AssaySample[]): Map<string, string> {\n const lookup = new Map<string, string>()\n for (const sample of samples) {\n addLookupAlias(lookup, sample.sampleId, sample.sampleId)\n if (sample.name) {\n addLookupAlias(lookup, sample.name, sample.sampleId)\n addLookupAlias(lookup, idFromName(sample.name, sample.sampleId), sample.sampleId)\n }\n }\n return lookup\n}\n\nexport function createAssayFeatureLookup(features: AssayFeature[]): Map<string, string> {\n const lookup = new Map<string, string>()\n for (const feature of features) {\n addLookupAlias(lookup, feature.id, feature.id)\n addLookupAlias(lookup, feature.name, feature.id)\n addLookupAlias(lookup, idFromName(feature.name, feature.id), feature.id)\n }\n return lookup\n}\n\nfunction addLookupAlias(lookup: Map<string, string>, alias: string, value: string): void {\n if (!lookup.has(alias)) {\n lookup.set(alias, value)\n }\n}\n","import type {\n AssayFeature,\n AssaySample,\n ReagentRecord,\n ReagentTemplateInput,\n} from './types'\n\nexport function normalizeAssaySample(sample: AssaySample): AssaySample {\n return {\n ...sample,\n metadata: sample.metadata ?? {},\n }\n}\n\nexport function normalizeAssayFeature(feature: AssayFeature): AssayFeature {\n return {\n ...feature,\n metadata: feature.metadata ?? {},\n }\n}\n\nexport function normalizeReagent(reagent: ReagentTemplateInput): ReagentRecord {\n return {\n ...reagent,\n expiryDate: normalizeDateString(reagent.expiryDate),\n kind: reagent.kind ?? 'reagent',\n metadata: reagent.metadata ?? {},\n }\n}\n\nfunction normalizeDateString(value: Date | string | null | undefined): string | undefined {\n if (value === undefined || value === null) return undefined\n return value instanceof Date ? value.toISOString() : value\n}\n","import {\n createAssayFeatureLookup,\n createAssaySampleLookup,\n} from './assayLookups'\nimport {\n normalizeAssayFeature,\n normalizeAssaySample,\n} from './assayNormalizers'\nimport { idFromName } from './builderIdUtils'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport { validateAssayMatrixData } from './templateValidators'\nimport type {\n AssayFeature,\n AssayMatrixTemplate,\n AssayMatrixTemplateData,\n AssaySample,\n CreateAssayMatrixTemplateOptions,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createAssayMatrixTemplate(\n options: CreateAssayMatrixTemplateOptions\n): AssayMatrixTemplate {\n const samples = options.samples.map((sample, index): AssaySample => {\n if (typeof sample !== 'string') return normalizeAssaySample(sample)\n return {\n sampleId: idFromName(sample, `sample-${index + 1}`),\n name: sample,\n metadata: {},\n }\n })\n const features = options.features.map((feature, index): AssayFeature => {\n if (typeof feature !== 'string') return normalizeAssayFeature(feature)\n return {\n id: idFromName(feature, `feature-${index + 1}`),\n name: feature,\n type: 'readout',\n metadata: {},\n }\n })\n const sampleLookup = createAssaySampleLookup(samples)\n const featureLookup = createAssayFeatureLookup(features)\n const measurements = Object.entries(options.values ?? {}).flatMap(([sampleId, featureValues]) =>\n Object.entries(featureValues).map(([featureId, value]) => ({\n sampleId: sampleLookup.get(sampleId) ?? sampleId,\n featureId: featureLookup.get(featureId) ?? featureId,\n value,\n metadata: {},\n }))\n )\n\n const data: AssayMatrixTemplateData = {\n samples,\n features,\n measurements,\n metadata: options.metadata ?? {},\n }\n validateAssayMatrixData(data)\n return createTemplateEnvelope('assay-matrix', data, options.metadata ?? {})\n}\n","import { normalizeReagent } from './assayNormalizers'\nimport { idFromName } from './builderIdUtils'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport { validateReagentListData } from './templateValidators'\nimport type {\n CreateReagentListTemplateOptions,\n ReagentListTemplate,\n ReagentListTemplateData,\n ReagentRecord,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createReagentListTemplate(\n options: CreateReagentListTemplateOptions\n): ReagentListTemplate {\n const reagents = options.reagents.map((reagent, index): ReagentRecord => {\n if (typeof reagent !== 'string') return normalizeReagent(reagent)\n return {\n id: idFromName(reagent, `reagent-${index + 1}`),\n name: reagent,\n kind: 'reagent',\n metadata: {},\n }\n })\n const data: ReagentListTemplateData = {\n reagents,\n metadata: options.metadata ?? {},\n }\n validateReagentListData(data)\n return createTemplateEnvelope('reagent-list', data, options.metadata ?? {})\n}\n","import type {\n FlowPanelControl,\n FlowPanelMarker,\n} from './types'\nimport { idFromName } from './builderIdUtils'\n\nexport function normalizeFlowMarker(\n marker: Partial<FlowPanelMarker> & { marker: string },\n index: number\n): FlowPanelMarker {\n return {\n id: marker.id ?? idFromName(marker.marker, `marker-${index + 1}`),\n marker: marker.marker,\n fluorophore: marker.fluorophore ?? 'unassigned',\n detector: marker.detector,\n clone: marker.clone,\n reagentId: marker.reagentId,\n purpose: marker.purpose ?? 'phenotype',\n compensationRequired: marker.compensationRequired ?? true,\n metadata: marker.metadata ?? {},\n }\n}\n\nexport function normalizeFlowControl(\n control: Partial<FlowPanelControl> & { name: string },\n index: number\n): FlowPanelControl {\n return {\n id: control.id ?? idFromName(control.name, `control-${index + 1}`),\n name: control.name,\n kind: control.kind ?? 'other',\n markerId: control.markerId,\n required: control.required ?? true,\n metadata: control.metadata ?? {},\n }\n}\n\nexport function defaultFlowControls(markers: FlowPanelMarker[]): FlowPanelControl[] {\n return [\n {\n id: 'unstained',\n name: 'Unstained',\n kind: 'unstained',\n required: true,\n metadata: {},\n },\n ...markers\n .filter(marker => marker.compensationRequired)\n .map(marker => ({\n id: `${marker.id}-single-stain`,\n name: `${marker.marker} single stain`,\n kind: 'single-stain' as const,\n markerId: marker.id,\n required: true,\n metadata: {},\n })),\n ]\n}\n","import { idFromName } from './builderIdUtils'\nimport {\n defaultFlowControls,\n normalizeFlowControl,\n normalizeFlowMarker,\n} from './flowNormalizers'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport { validateFlowCytometryPanelData } from './templateValidators'\nimport type {\n CreateFlowCytometryPanelTemplateOptions,\n FlowCytometryPanelTemplate,\n FlowCytometryPanelTemplateData,\n FlowPanelControl,\n FlowPanelMarker,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createFlowCytometryPanelTemplate(\n options: CreateFlowCytometryPanelTemplateOptions\n): FlowCytometryPanelTemplate {\n const markers = options.markers.map((marker, index): FlowPanelMarker => {\n if (typeof marker !== 'string') return normalizeFlowMarker(marker, index)\n return {\n id: idFromName(marker, `marker-${index + 1}`),\n marker,\n fluorophore: 'unassigned',\n purpose: 'phenotype',\n compensationRequired: true,\n metadata: {},\n }\n })\n const controls = options.controls === undefined\n ? options.includeDefaultControls === false\n ? []\n : defaultFlowControls(markers)\n : options.controls.map((control, index): FlowPanelControl => {\n if (typeof control !== 'string') return normalizeFlowControl(control, index)\n return {\n id: idFromName(control, `control-${index + 1}`),\n name: control,\n kind: 'other',\n required: true,\n metadata: {},\n }\n })\n const data: FlowCytometryPanelTemplateData = {\n markers,\n controls,\n instrument: options.instrument,\n metadata: options.metadata ?? {},\n }\n validateFlowCytometryPanelData(data)\n return createTemplateEnvelope('flow-cytometry-panel', data, options.metadata ?? {})\n}\n","import type {\n InstrumentMethod,\n InstrumentRunItem,\n QpcrSample,\n QpcrTarget,\n} from './types'\nimport { idFromName } from './builderIdUtils'\n\nexport function normalizeInstrumentMethod(\n method: Partial<InstrumentMethod> & { name?: string },\n fallbackInstrument?: string\n): InstrumentMethod {\n const name = method.name || method.id || 'Default method'\n return {\n id: method.id || idFromName(name, 'method-1'),\n name,\n instrument: method.instrument ?? fallbackInstrument,\n acquisitionMode: method.acquisitionMode,\n metadata: method.metadata ?? {},\n }\n}\n\nexport function normalizeInstrumentRunItem(\n item: Partial<InstrumentRunItem> & { name?: string; sampleId?: string },\n defaultMethodId: string,\n fallbackOrder: number,\n index: number\n): InstrumentRunItem {\n const kind = item.kind ?? 'sample'\n const sampleId = item.sampleId || (kind === 'sample'\n ? idFromName(item.name ?? `Sample ${index + 1}`, `sample-${index + 1}`)\n : undefined)\n const label = item.name ?? sampleId ?? kind\n return {\n id: item.id || idFromName(label, `${kind}-${index + 1}`),\n order: item.order ?? fallbackOrder,\n kind,\n sampleId,\n name: item.name,\n methodId: item.methodId || defaultMethodId,\n vial: item.vial,\n plateId: item.plateId,\n wellId: item.wellId,\n injectionVolume: item.injectionVolume,\n expectedDurationMin: item.expectedDurationMin,\n status: item.status ?? 'planned',\n metadata: item.metadata ?? {},\n }\n}\n\nexport function normalizeQpcrSample(sample: QpcrSample): QpcrSample {\n return {\n ...sample,\n metadata: sample.metadata ?? {},\n }\n}\n\nexport function normalizeQpcrTarget(target: QpcrTarget): QpcrTarget {\n return {\n ...target,\n metadata: target.metadata ?? {},\n }\n}\n","import { idFromName } from './builderIdUtils'\nimport {\n normalizeInstrumentMethod,\n normalizeInstrumentRunItem,\n} from './runNormalizers'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport { validateInstrumentRunData } from './templateValidators'\nimport type {\n CreateInstrumentRunTemplateOptions,\n InstrumentRunItem,\n InstrumentRunTemplate,\n InstrumentRunTemplateData,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createInstrumentRunTemplate(\n options: CreateInstrumentRunTemplateOptions\n): InstrumentRunTemplate {\n const method = typeof options.method === 'string' || options.method === undefined\n ? {\n id: idFromName(options.method ?? 'Default method', 'method-1'),\n name: options.method ?? 'Default method',\n instrument: options.instrument,\n metadata: {},\n }\n : normalizeInstrumentMethod(options.method, options.instrument)\n const items: InstrumentRunItem[] = []\n let order = 1\n\n if (options.includeBlanks !== false) {\n items.push({\n id: 'blank-start',\n order,\n kind: 'blank',\n name: 'Blank start',\n methodId: method.id,\n status: 'planned',\n metadata: {},\n })\n order += 1\n }\n\n if (options.includeQc !== false) {\n items.push({\n id: 'qc-start',\n order,\n kind: 'qc',\n name: 'QC start',\n methodId: method.id,\n status: 'planned',\n metadata: {},\n })\n order += 1\n }\n\n for (const [index, item] of options.items.entries()) {\n if (typeof item !== 'string') {\n const normalized = normalizeInstrumentRunItem(item, method.id, order, index)\n items.push(normalized)\n order = Math.max(order, normalized.order + 1)\n continue\n }\n const sampleId = idFromName(item, `sample-${index + 1}`)\n items.push({\n id: `${sampleId}-run`,\n order,\n kind: 'sample',\n sampleId,\n name: item,\n methodId: method.id,\n status: 'planned',\n metadata: {},\n })\n order += 1\n }\n\n if (options.includeQc !== false) {\n items.push({\n id: 'qc-end',\n order,\n kind: 'qc',\n name: 'QC end',\n methodId: method.id,\n status: 'planned',\n metadata: {},\n })\n }\n\n const data: InstrumentRunTemplateData = {\n runId: 'run-1',\n instrument: options.instrument,\n methods: [method],\n items,\n metadata: options.metadata ?? {},\n }\n validateInstrumentRunData(data)\n return createTemplateEnvelope('instrument-run', data, options.metadata ?? {})\n}\n","import { idFromName } from './builderIdUtils'\nimport { wellIdsForFormat } from '../components/WellPlate.geometry'\nimport {\n normalizeQpcrSample,\n normalizeQpcrTarget,\n} from './runNormalizers'\nimport { createTemplateEnvelope } from './templateEnvelopes'\nimport { validateQpcrPlateData } from './templateValidators'\nimport type {\n CreateQpcrPlateTemplateOptions,\n QpcrPlateTemplate,\n QpcrPlateTemplateData,\n QpcrReaction,\n QpcrSample,\n QpcrTarget,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createQpcrPlateTemplate(\n options: CreateQpcrPlateTemplateOptions\n): QpcrPlateTemplate {\n const format = options.format ?? 96\n const replicates = options.replicates ?? 3\n if (replicates < 1) {\n throw new Error('qPCR replicates must be at least 1.')\n }\n\n const samples = options.samples.map((sample, index): QpcrSample => {\n if (typeof sample !== 'string') return normalizeQpcrSample(sample)\n return {\n sampleId: idFromName(sample, `sample-${index + 1}`),\n name: sample,\n metadata: {},\n }\n })\n const targets = options.targets.map((target, index): QpcrTarget => {\n if (typeof target !== 'string') return normalizeQpcrTarget(target)\n return {\n id: idFromName(target, `target-${index + 1}`),\n name: target,\n metadata: {},\n }\n })\n const wells = wellIdsForFormat(format)\n let wellIndex = 0\n const reactions: QpcrReaction[] = []\n\n for (const sample of samples) {\n for (const target of targets) {\n for (let replicate = 1; replicate <= replicates; replicate += 1) {\n const wellId = wells[wellIndex]\n if (!wellId) throw new Error(`qPCR plate format ${format} does not have enough wells.`)\n reactions.push({\n id: `${sample.sampleId}-${target.id}-r${replicate}`,\n wellId,\n sampleId: sample.sampleId,\n targetId: target.id,\n replicate,\n controlKind: 'sample',\n flags: [],\n metadata: {},\n })\n wellIndex += 1\n }\n }\n }\n\n if (options.includeNoTemplateControls !== false) {\n for (const target of targets) {\n const wellId = wells[wellIndex]\n if (!wellId) throw new Error(`qPCR plate format ${format} does not have enough wells.`)\n reactions.push({\n id: `ntc-${target.id}`,\n wellId,\n targetId: target.id,\n replicate: 1,\n controlKind: 'no-template',\n flags: [],\n metadata: {},\n })\n wellIndex += 1\n }\n }\n\n const data: QpcrPlateTemplateData = {\n plateId: 'qpcr-plate-1',\n format,\n samples,\n targets,\n reactions,\n instrument: options.instrument,\n chemistry: options.chemistry ?? 'sybr',\n metadata: options.metadata ?? {},\n }\n validateQpcrPlateData(data)\n return createTemplateEnvelope('qpcr-plate', data, options.metadata ?? {})\n}\n","import { createQpcrPlateTemplate } from './qpcrPlateBuilder'\nimport { createSampleSheetTemplate } from './sampleSheetBuilder'\nimport { presetSampleRecords } from './sampleNormalizers'\nimport { createTemplateCollection } from './templateEnvelopes'\nimport type {\n CreateQpcrExpressionCollectionOptions,\n TemplateCollectionEnvelope,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createQpcrExpressionCollection(\n options: CreateQpcrExpressionCollectionOptions = {}\n): TemplateCollectionEnvelope {\n const sampleRecords = presetSampleRecords(options.samples ?? ['Control', 'Treatment'])\n const sampleSheet = createSampleSheetTemplate({ samples: sampleRecords })\n const qpcr = createQpcrPlateTemplate({\n samples: sampleRecords.map(sample => ({\n sampleId: sample.sampleId,\n name: sample.name,\n group: sample.group,\n metadata: sample.metadata ?? {},\n })),\n targets: options.targets ?? ['ACTB', 'GAPDH'],\n chemistry: options.chemistry,\n format: options.format,\n includeNoTemplateControls: options.includeNoTemplateControls,\n replicates: options.replicates ?? 3,\n instrument: options.instrument,\n })\n return createTemplateCollection(\n [sampleSheet, qpcr],\n { preset: 'qpcr-expression', ...(options.metadata ?? {}) }\n )\n}\n","import { createAssayMatrixTemplate } from './assayMatrixBuilder'\nimport { createInstrumentRunTemplate } from './instrumentRunBuilder'\nimport { createSampleSheetTemplate } from './sampleSheetBuilder'\nimport { presetSampleRecords } from './sampleNormalizers'\nimport { createTemplateCollection } from './templateEnvelopes'\nimport type {\n CreateLcmsBatchCollectionOptions,\n TemplateCollectionEnvelope,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createLcmsBatchCollection(\n options: CreateLcmsBatchCollectionOptions = {}\n): TemplateCollectionEnvelope {\n const sampleRecords = presetSampleRecords(options.samples ?? ['S001', 'S002'])\n const sampleSheet = createSampleSheetTemplate({ samples: sampleRecords })\n const instrumentRun = createInstrumentRunTemplate({\n items: sampleRecords.map(sample => ({\n sampleId: sample.sampleId,\n name: sample.name ?? sample.sampleId,\n })),\n method: options.method ?? 'Default method',\n instrument: options.instrument ?? 'LC-MS',\n includeQc: options.includeQc,\n })\n const assayMatrix = createAssayMatrixTemplate({\n samples: sampleRecords.map(sample => ({\n sampleId: sample.sampleId,\n name: sample.name,\n group: sample.group,\n metadata: sample.metadata ?? {},\n })),\n features: options.features ?? ['Glucose', 'Lactate'],\n })\n return createTemplateCollection(\n [sampleSheet, instrumentRun, assayMatrix],\n { preset: 'lcms-batch', ...(options.metadata ?? {}) }\n )\n}\n","import type {\n AssayFeature,\n CalibrationPoint,\n InstrumentRunItemInput,\n ReagentTemplateInput,\n SampleRecord,\n} from './types'\nimport {\n normalizeAssayFeature,\n normalizeReagent,\n} from './assayNormalizers'\nimport { idFromName } from './builderIdUtils'\n\nexport function normalizeMetaboliteFeatures(\n metabolites: Array<string | AssayFeature>,\n responseUnit: string,\n): AssayFeature[] {\n return metabolites.map((metabolite, index) => {\n if (typeof metabolite === 'string') {\n return {\n id: idFromName(metabolite, `metabolite-${index + 1}`),\n name: metabolite,\n type: 'metabolite',\n unit: responseUnit,\n metadata: { quantitation: 'targeted' },\n }\n }\n\n const feature = normalizeAssayFeature(metabolite)\n return {\n ...feature,\n type: feature.type ?? 'metabolite',\n unit: feature.unit ?? responseUnit,\n metadata: {\n quantitation: 'targeted',\n ...feature.metadata,\n },\n }\n })\n}\n\nexport function normalizeInternalStandardReagents(\n internalStandards: Array<string | ReagentTemplateInput>,\n): ReagentTemplateInput[] {\n return internalStandards.map((standard, index) => {\n if (typeof standard === 'string') {\n return {\n id: idFromName(standard, `internal-standard-${index + 1}`),\n name: standard,\n kind: 'compound',\n metadata: { role: 'internal-standard' },\n }\n }\n\n const reagent = normalizeReagent(standard)\n return {\n ...reagent,\n kind: standard.kind ?? 'compound',\n metadata: {\n role: 'internal-standard',\n ...reagent.metadata,\n },\n }\n })\n}\n\nexport function targetedMetabolomicsRunItems(\n samples: SampleRecord[],\n calibrationPoints: CalibrationPoint[],\n includeQc: boolean,\n): InstrumentRunItemInput[] {\n const calibrationItems = calibrationPoints\n .filter(point => point.role !== 'qc' || includeQc)\n .filter(point => point.role === 'blank' || point.role === 'standard' || point.role === 'qc')\n .map((point): InstrumentRunItemInput => ({\n id: `${point.id}-run`,\n kind: calibrationRunItemKind(point.role),\n name: point.level,\n metadata: {\n concentration: point.concentration,\n unit: point.unit,\n role: point.role,\n },\n }))\n\n const sampleItems = samples.map((sample): InstrumentRunItemInput => ({\n sampleId: sample.sampleId,\n name: sample.name ?? sample.sampleId,\n kind: 'sample',\n }))\n\n return [...calibrationItems, ...sampleItems]\n}\n\nexport function firstFeatureName(features: AssayFeature[], fallback: string): string {\n return features.find(feature => feature.name)?.name ?? fallback\n}\n\nfunction calibrationRunItemKind(role: CalibrationPoint['role']): 'blank' | 'standard' | 'qc' {\n if (role === 'blank' || role === 'standard' || role === 'qc') return role\n return 'standard'\n}\n","import { createAssayMatrixTemplate } from './assayMatrixBuilder'\nimport { createCalibrationCurveTemplate } from './calibrationCurveBuilder'\nimport { createInstrumentRunTemplate } from './instrumentRunBuilder'\nimport { createReagentListTemplate } from './reagentListBuilder'\nimport { createSamplePrepTemplate } from './samplePrepBuilder'\nimport { createSampleSheetTemplate } from './sampleSheetBuilder'\nimport { presetSampleRecords } from './sampleNormalizers'\nimport {\n firstFeatureName,\n normalizeInternalStandardReagents,\n normalizeMetaboliteFeatures,\n targetedMetabolomicsRunItems,\n} from './targetedMetabolomicsHelpers'\nimport { createTemplateCollection } from './templateEnvelopes'\nimport type {\n CreateTargetedMetabolomicsCollectionOptions,\n TemplateCollectionEnvelope,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createTargetedMetabolomicsCollection(\n options: CreateTargetedMetabolomicsCollectionOptions = {}\n): TemplateCollectionEnvelope {\n const sampleRecords = presetSampleRecords(options.samples ?? ['S001', 'S002'])\n const responseUnit = options.responseUnit ?? 'peak area ratio'\n const concentrationUnit = options.concentrationUnit ?? 'uM'\n const metaboliteFeatures = normalizeMetaboliteFeatures(\n options.metabolites ?? ['Glucose', 'Lactate', 'Pyruvate'],\n responseUnit,\n )\n const sampleSheet = createSampleSheetTemplate({ samples: sampleRecords })\n const samplePrep = createSamplePrepTemplate({\n samples: sampleRecords.map(sample => sample.sampleId),\n prepType: options.prepType ?? 'extraction',\n protocolName: 'Metabolomics sample preparation',\n outputVolume: options.outputVolume ?? 50,\n metadata: { assay: 'targeted-metabolomics' },\n })\n const reagents = createReagentListTemplate({\n reagents: normalizeInternalStandardReagents(\n options.internalStandards ?? ['Stable isotope internal standard mix'],\n ),\n metadata: { assay: 'targeted-metabolomics' },\n })\n const calibrationCurve = createCalibrationCurveTemplate({\n concentrations: options.standardConcentrations ?? [0.1, 1, 10, 100],\n analyte: options.calibrationAnalyte ?? firstFeatureName(metaboliteFeatures, 'Metabolite panel'),\n unit: concentrationUnit,\n responseUnit,\n model: 'linear-weighted-1-x',\n includeQc: options.includeQc,\n metadata: { assay: 'targeted-metabolomics' },\n })\n const instrumentRun = createInstrumentRunTemplate({\n items: targetedMetabolomicsRunItems(\n sampleRecords,\n calibrationCurve.data.points,\n options.includeQc !== false,\n ),\n method: options.method ?? 'Targeted metabolomics',\n instrument: options.instrument ?? 'LC-MS',\n includeBlanks: false,\n includeQc: false,\n metadata: { assay: 'targeted-metabolomics' },\n })\n const assayMatrix = createAssayMatrixTemplate({\n samples: sampleRecords.map(sample => ({\n sampleId: sample.sampleId,\n name: sample.name,\n group: sample.group,\n metadata: sample.metadata ?? {},\n })),\n features: metaboliteFeatures,\n metadata: { assay: 'targeted-metabolomics', responseUnit },\n })\n return createTemplateCollection(\n [sampleSheet, samplePrep, reagents, instrumentRun, calibrationCurve, assayMatrix],\n { preset: 'targeted-metabolomics', ...(options.metadata ?? {}) }\n )\n}\n","import { createAssayMatrixTemplate } from './assayMatrixBuilder'\nimport { SAMPLE_COLOR_SCALE } from '../utils/color'\nimport { idFromName } from './builderIdUtils'\nimport { createCalibrationCurveTemplate } from './calibrationCurveBuilder'\nimport { createPlateMapTemplate } from './plateMapBuilder'\nimport { createSampleSheetTemplate } from './sampleSheetBuilder'\nimport { presetSampleRecords } from './sampleNormalizers'\nimport { createTemplateCollection } from './templateEnvelopes'\nimport type {\n CreateElisaAssayCollectionOptions,\n TemplateCollectionEnvelope,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createElisaAssayCollection(\n options: CreateElisaAssayCollectionOptions = {}\n): TemplateCollectionEnvelope {\n const sampleRecords = presetSampleRecords(options.samples ?? ['Control', 'Treatment'])\n const analyte = options.analyte ?? 'Analyte'\n const responseUnit = options.responseUnit ?? 'OD450'\n const plate = createPlateMapTemplate({\n name: options.plateName ?? 'ELISA plate',\n format: options.plateFormat ?? 96,\n samples: [\n { id: 'blank', name: 'Blank' },\n { id: 'standard', name: 'Standards' },\n { id: 'qc', name: 'QC' },\n ...sampleRecords.map((sample, index) => ({\n id: sample.sampleId,\n name: sample.name ?? sample.sampleId,\n color: SAMPLE_COLOR_SCALE[index % SAMPLE_COLOR_SCALE.length],\n })),\n ],\n })\n const sampleSheet = createSampleSheetTemplate({ samples: sampleRecords })\n const calibrationCurve = createCalibrationCurveTemplate({\n concentrations: options.standardConcentrations ?? [1000, 100, 10, 1],\n analyte,\n unit: options.unit ?? 'pg/mL',\n responseUnit,\n model: 'four-parameter-logistic',\n })\n const assayMatrix = createAssayMatrixTemplate({\n samples: sampleRecords.map(sample => ({\n sampleId: sample.sampleId,\n name: sample.name,\n group: sample.group,\n metadata: sample.metadata ?? {},\n })),\n features: [{\n id: idFromName(analyte, 'analyte'),\n name: analyte,\n type: 'protein',\n unit: responseUnit,\n metadata: {},\n }],\n metadata: { analyte, responseUnit },\n })\n return createTemplateCollection(\n [plate, sampleSheet, calibrationCurve, assayMatrix],\n { preset: 'elisa-assay', ...(options.metadata ?? {}) }\n )\n}\n","import { createAssayMatrixTemplate } from './assayMatrixBuilder'\nimport { createFlowCytometryPanelTemplate } from './flowCytometryPanelBuilder'\nimport { createSampleSheetTemplate } from './sampleSheetBuilder'\nimport { presetSampleRecords } from './sampleNormalizers'\nimport { createTemplateCollection } from './templateEnvelopes'\nimport type {\n CreateFlowCytometryAssayCollectionOptions,\n TemplateCollectionEnvelope,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createFlowCytometryAssayCollection(\n options: CreateFlowCytometryAssayCollectionOptions = {}\n): TemplateCollectionEnvelope {\n const sampleRecords = presetSampleRecords(options.samples ?? ['Control', 'Treatment'])\n const markers = options.markers ?? ['CD3', 'CD4', 'CD8']\n const sampleSheet = createSampleSheetTemplate({ samples: sampleRecords })\n const flowPanel = createFlowCytometryPanelTemplate({\n markers,\n instrument: options.instrument ?? 'Flow cytometer',\n includeDefaultControls: options.includeDefaultControls,\n })\n const assayMatrix = createAssayMatrixTemplate({\n samples: sampleRecords.map(sample => ({\n sampleId: sample.sampleId,\n name: sample.name,\n group: sample.group,\n metadata: sample.metadata ?? {},\n })),\n features: options.features ?? flowPanel.data.markers.map(marker => ({\n id: marker.id,\n name: `${marker.marker}+ cells`,\n type: 'cell',\n unit: '%',\n metadata: { marker: marker.marker, fluorophore: marker.fluorophore },\n })),\n })\n return createTemplateCollection(\n [sampleSheet, flowPanel, assayMatrix],\n { preset: 'flow-cytometry-assay', ...(options.metadata ?? {}) }\n )\n}\n","import { createAssayMatrixTemplate } from './assayMatrixBuilder'\nimport { idFromName } from './builderIdUtils'\nimport { createProtocolStepsTemplate } from './protocolStepsBuilder'\nimport { createReagentListTemplate } from './reagentListBuilder'\nimport { createSampleSheetTemplate } from './sampleSheetBuilder'\nimport { presetSampleRecords } from './sampleNormalizers'\nimport { createTemplateCollection } from './templateEnvelopes'\nimport type {\n CreateWesternBlotAssayCollectionOptions,\n TemplateCollectionEnvelope,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createWesternBlotAssayCollection(\n options: CreateWesternBlotAssayCollectionOptions = {}\n): TemplateCollectionEnvelope {\n const sampleRecords = presetSampleRecords(options.samples ?? ['Control', 'Treatment'])\n const loadingControl = options.loadingControl ?? 'ACTB'\n const targetNames = (options.targets ?? ['Target protein']).map(target =>\n typeof target === 'string' ? target : target.name ?? target.id\n )\n const featureNames = loadingControl && !targetNames.includes(loadingControl)\n ? [...targetNames, loadingControl]\n : targetNames\n const sampleSheet = createSampleSheetTemplate({ samples: sampleRecords })\n const reagentList = createReagentListTemplate({\n reagents: [\n { id: 'primary-antibody', name: 'Primary antibody', kind: 'antibody', storageCondition: '4C' },\n { id: 'secondary-antibody', name: 'Secondary antibody', kind: 'antibody', storageCondition: '4C' },\n { id: 'lysis-buffer', name: 'Lysis buffer', kind: 'buffer', storageCondition: '4C' },\n { id: 'blocking-buffer', name: 'Blocking buffer', kind: 'buffer', storageCondition: '4C' },\n { id: 'wash-buffer', name: 'TBST wash buffer', kind: 'buffer', storageCondition: 'RT' },\n { id: 'substrate', name: 'Detection substrate', kind: 'reagent', storageCondition: '4C' },\n ],\n metadata: { assay: 'western-blot' },\n })\n const protocol = createProtocolStepsTemplate({\n steps: [\n { id: 'lyse-samples', type: 'addition', name: 'Lyse samples', duration: 30 },\n { id: 'run-gel', type: 'custom', name: 'Run SDS-PAGE', duration: 90 },\n { id: 'transfer', type: 'transfer', name: 'Transfer to membrane', duration: 60 },\n { id: 'block', type: 'incubation', name: 'Block membrane', duration: 60 },\n { id: 'primary-antibody', type: 'incubation', name: 'Primary antibody incubation', duration: 960 },\n { id: 'secondary-antibody', type: 'incubation', name: 'Secondary antibody incubation', duration: 60 },\n { id: 'detect', type: 'measurement', name: 'Detect and quantify bands', duration: 30 },\n ],\n metadata: { assay: 'western-blot' },\n })\n const assayMatrix = createAssayMatrixTemplate({\n samples: sampleRecords.map(sample => ({\n sampleId: sample.sampleId,\n name: sample.name,\n group: sample.group,\n metadata: sample.metadata ?? {},\n })),\n features: featureNames.map((feature, index) => ({\n id: idFromName(feature, `feature-${index + 1}`),\n name: feature,\n type: 'protein',\n unit: 'relative intensity',\n metadata: { loadingControl: feature === loadingControl },\n })),\n metadata: { assay: 'western-blot', loadingControl },\n })\n return createTemplateCollection(\n [sampleSheet, reagentList, protocol, assayMatrix],\n { preset: 'western-blot-assay', ...(options.metadata ?? {}) }\n )\n}\n","import { getBioTemplateInfo } from './catalog'\nimport { createAssayMatrixTemplate } from './assayMatrixBuilder'\nimport { createCalibrationCurveTemplate } from './calibrationCurveBuilder'\nimport { createDoseResponseTemplate } from './doseResponseBuilder'\nimport { createFlowCytometryPanelTemplate } from './flowCytometryPanelBuilder'\nimport { createInstrumentRunTemplate } from './instrumentRunBuilder'\nimport { createPlateMapTemplate } from './plateMapBuilder'\nimport { createProtocolStepsTemplate } from './protocolStepsBuilder'\nimport { createQpcrPlateTemplate } from './qpcrPlateBuilder'\nimport { createReagentListTemplate } from './reagentListBuilder'\nimport { createSamplePrepTemplate } from './samplePrepBuilder'\nimport { createSampleSheetTemplate } from './sampleSheetBuilder'\nimport { createTimeCourseTemplate } from './timeCourseBuilder'\nimport type {\n BioTemplateEnvelope,\n TemplateId,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createDefaultBioTemplate(templateId: TemplateId | string): BioTemplateEnvelope<unknown> {\n const template = getBioTemplateInfo(templateId)\n if (!template) {\n throw new Error(`Unknown bio template '${templateId}'.`)\n }\n\n switch (template.template_id) {\n case 'plate-map':\n return createPlateMapTemplate({\n name: 'Plate 1',\n samples: ['Control', 'Treatment'],\n })\n case 'sample-sheet':\n return createSampleSheetTemplate({\n samples: [\n { sampleId: 'S001', name: 'Control 1', group: 'Control' },\n { sampleId: 'S002', name: 'Treatment 1', group: 'Treatment' },\n ],\n })\n case 'sample-prep':\n return createSamplePrepTemplate({\n samples: ['S001', 'S002'],\n prepType: 'extraction',\n outputVolume: 50,\n })\n case 'dose-response':\n return createDoseResponseTemplate({\n compounds: {\n 'Compound A': [10, 1, 0.1],\n },\n unit: 'uM',\n replicates: 3,\n })\n case 'calibration-curve':\n return createCalibrationCurveTemplate({\n concentrations: [0.1, 1, 10, 100],\n analyte: 'Analyte',\n unit: 'uM',\n })\n case 'time-course':\n return createTimeCourseTemplate({\n timepoints: [0, 6, 24],\n unit: 'hour',\n conditions: ['Control', 'Treatment'],\n replicates: 3,\n })\n case 'protocol-steps':\n return createProtocolStepsTemplate({\n steps: [\n {\n id: 'seed-cells',\n type: 'addition',\n name: 'Seed cells',\n description: 'Add cells to wells or culture vessels.',\n duration: 15,\n },\n {\n id: 'incubate-overnight',\n type: 'incubation',\n name: 'Incubate overnight',\n duration: 960,\n parameters: { temperature: '37 C', co2: '5%' },\n },\n {\n id: 'measure-readout',\n type: 'measurement',\n name: 'Measure readout',\n duration: 45,\n },\n ],\n })\n case 'assay-matrix':\n return createAssayMatrixTemplate({\n samples: ['S001', 'S002'],\n features: ['Lactate', 'Glucose'],\n values: {\n s001: { lactate: 1.2, glucose: 5.4 },\n s002: { lactate: 2.1, glucose: 4.8 },\n },\n })\n case 'reagent-list':\n return createReagentListTemplate({\n reagents: ['DMSO', 'Compound A', 'Anti-HA antibody'],\n })\n case 'flow-cytometry-panel':\n return createFlowCytometryPanelTemplate({\n markers: ['CD3', 'CD4', 'CD8'],\n instrument: 'BD LSRFortessa',\n })\n case 'instrument-run':\n return createInstrumentRunTemplate({\n items: ['S001', 'S002'],\n instrument: 'LC-MS',\n method: 'Default method',\n })\n case 'qpcr-plate':\n return createQpcrPlateTemplate({\n samples: ['Control', 'Treatment'],\n targets: ['ACTB', 'GAPDH'],\n replicates: 3,\n instrument: 'QuantStudio',\n })\n default:\n throw new Error(`Unknown bio template '${templateId}'.`)\n }\n}\n","import { getBioTemplatePackInfo } from './packs'\nimport { createDefaultBioTemplate } from './defaultBioTemplateBuilder'\nimport { createTemplateCollection } from './templateEnvelopes'\nimport type {\n CreateBioTemplatePackCollectionOptions,\n TemplateCollectionEnvelope,\n TemplatePackId,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createBioTemplatePackCollection(\n name: TemplatePackId | string,\n options: CreateBioTemplatePackCollectionOptions = {},\n): TemplateCollectionEnvelope {\n const pack = getBioTemplatePackInfo(name)\n if (!pack) {\n throw new Error(`Unknown template pack '${name}'.`)\n }\n\n return createTemplateCollection(\n pack.templates.map(templateId => createDefaultBioTemplate(templateId)),\n { pack: pack.name, ...(options.metadata ?? {}) },\n )\n}\n","import { SAMPLE_COLOR_SCALE } from '../utils/color'\nimport { createDoseResponseTemplate } from './doseResponseBuilder'\nimport { createPlateMapTemplate } from './plateMapBuilder'\nimport { createSampleSheetTemplate } from './sampleSheetBuilder'\nimport { presetSampleRecords } from './sampleNormalizers'\nimport { createTemplateCollection } from './templateEnvelopes'\nimport type {\n CreateWellPlateScreenCollectionOptions,\n TemplateCollectionEnvelope,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createWellPlateScreenCollection(\n options: CreateWellPlateScreenCollectionOptions = {}\n): TemplateCollectionEnvelope {\n const sampleRecords = presetSampleRecords(options.samples ?? ['Control', 'Treatment'])\n const plate = createPlateMapTemplate({\n name: options.plateName ?? 'Screen plate',\n format: options.plateFormat ?? 96,\n samples: sampleRecords.map((sample, index) => ({\n id: sample.sampleId,\n name: sample.name ?? sample.sampleId,\n color: SAMPLE_COLOR_SCALE[index % SAMPLE_COLOR_SCALE.length],\n })),\n })\n const sampleSheet = createSampleSheetTemplate({ samples: sampleRecords })\n const doseResponse = createDoseResponseTemplate({\n compounds: options.compounds ?? { 'Compound A': [10, 1, 0.1] },\n unit: options.unit ?? 'uM',\n replicates: options.replicates ?? 3,\n layout: plate,\n })\n return createTemplateCollection(\n [plate, sampleSheet, doseResponse],\n { preset: 'wellplate-screen', ...(options.metadata ?? {}) }\n )\n}\n","import { bioTemplatePresetControlValuesToOptions } from './builderPresetControls'\nimport type { BioTemplateControlValues } from './builderPresetControls'\nimport { createElisaAssayCollection } from './elisaAssayCollectionBuilder'\nimport { createFlowCytometryAssayCollection } from './flowCytometryAssayCollectionBuilder'\nimport { createLcmsBatchCollection } from './lcmsBatchCollectionBuilder'\nimport { getBioTemplatePresetInfo } from './presets'\nimport { createQpcrExpressionCollection } from './qpcrExpressionCollectionBuilder'\nimport { createTargetedMetabolomicsCollection } from './targetedMetabolomicsCollectionBuilder'\nimport { createWellPlateScreenCollection } from './wellPlateScreenCollectionBuilder'\nimport { createWesternBlotAssayCollection } from './westernBlotAssayCollectionBuilder'\nimport type {\n CreateElisaAssayCollectionOptions,\n CreateFlowCytometryAssayCollectionOptions,\n CreateLcmsBatchCollectionOptions,\n CreateQpcrExpressionCollectionOptions,\n CreateTargetedMetabolomicsCollectionOptions,\n CreateWellPlateScreenCollectionOptions,\n CreateWesternBlotAssayCollectionOptions,\n TemplateCollectionEnvelope,\n TemplatePresetId,\n} from './types'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createBioTemplatePresetCollection(\n name: 'wellplate-screen',\n options?: CreateWellPlateScreenCollectionOptions\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollection(\n name: 'qpcr-expression',\n options?: CreateQpcrExpressionCollectionOptions\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollection(\n name: 'lcms-batch',\n options?: CreateLcmsBatchCollectionOptions\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollection(\n name: 'targeted-metabolomics',\n options?: CreateTargetedMetabolomicsCollectionOptions\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollection(\n name: 'elisa-assay',\n options?: CreateElisaAssayCollectionOptions\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollection(\n name: 'flow-cytometry-assay',\n options?: CreateFlowCytometryAssayCollectionOptions\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollection(\n name: 'western-blot-assay',\n options?: CreateWesternBlotAssayCollectionOptions\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollection(\n name: string,\n options?:\n | CreateWellPlateScreenCollectionOptions\n | CreateQpcrExpressionCollectionOptions\n | CreateLcmsBatchCollectionOptions\n | CreateTargetedMetabolomicsCollectionOptions\n | CreateElisaAssayCollectionOptions\n | CreateFlowCytometryAssayCollectionOptions\n | CreateWesternBlotAssayCollectionOptions\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollection(\n name: TemplatePresetId | string,\n options:\n | CreateWellPlateScreenCollectionOptions\n | CreateQpcrExpressionCollectionOptions\n | CreateLcmsBatchCollectionOptions\n | CreateTargetedMetabolomicsCollectionOptions\n | CreateElisaAssayCollectionOptions\n | CreateFlowCytometryAssayCollectionOptions\n | CreateWesternBlotAssayCollectionOptions = {}\n): TemplateCollectionEnvelope {\n const preset = getBioTemplatePresetInfo(name)\n if (!preset) {\n throw new Error(`Unknown template preset '${name}'.`)\n }\n if (preset.name === 'wellplate-screen') {\n return createWellPlateScreenCollection(options as CreateWellPlateScreenCollectionOptions)\n }\n if (preset.name === 'qpcr-expression') {\n return createQpcrExpressionCollection(options as CreateQpcrExpressionCollectionOptions)\n }\n if (preset.name === 'lcms-batch') {\n return createLcmsBatchCollection(options as CreateLcmsBatchCollectionOptions)\n }\n if (preset.name === 'targeted-metabolomics') {\n return createTargetedMetabolomicsCollection(options as CreateTargetedMetabolomicsCollectionOptions)\n }\n if (preset.name === 'elisa-assay') {\n return createElisaAssayCollection(options as CreateElisaAssayCollectionOptions)\n }\n if (preset.name === 'flow-cytometry-assay') {\n return createFlowCytometryAssayCollection(options as CreateFlowCytometryAssayCollectionOptions)\n }\n if (preset.name === 'western-blot-assay') {\n return createWesternBlotAssayCollection(options as CreateWesternBlotAssayCollectionOptions)\n }\n throw new Error(`Unknown template preset '${name}'.`)\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createBioTemplatePresetCollectionFromControls(\n name: 'wellplate-screen',\n values: BioTemplateControlValues\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollectionFromControls(\n name: 'qpcr-expression',\n values: BioTemplateControlValues\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollectionFromControls(\n name: 'lcms-batch',\n values: BioTemplateControlValues\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollectionFromControls(\n name: 'targeted-metabolomics',\n values: BioTemplateControlValues\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollectionFromControls(\n name: 'elisa-assay',\n values: BioTemplateControlValues\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollectionFromControls(\n name: 'flow-cytometry-assay',\n values: BioTemplateControlValues\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollectionFromControls(\n name: 'western-blot-assay',\n values: BioTemplateControlValues\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollectionFromControls(\n name: TemplatePresetId | string,\n values: BioTemplateControlValues\n): TemplateCollectionEnvelope\nexport function createBioTemplatePresetCollectionFromControls(\n name: TemplatePresetId | string,\n values: BioTemplateControlValues\n): TemplateCollectionEnvelope {\n const options = bioTemplatePresetControlValuesToOptions(name, values)\n return createBioTemplatePresetCollection(name, options)\n}\n","import type {\n BioTemplateControlSchema,\n} from './controlSchemaTypes'\n\nexport function cloneSchemaMap<TName extends string>(\n schemas: Record<TName, BioTemplateControlSchema>\n): Record<TName, BioTemplateControlSchema> {\n const result = {} as Record<TName, BioTemplateControlSchema>\n for (const name of Object.keys(schemas) as TName[]) {\n result[name] = cloneControlSchema(schemas[name])\n }\n return result\n}\n\nexport function cloneControlSchema(schema: BioTemplateControlSchema): BioTemplateControlSchema {\n return Object.fromEntries(\n Object.entries(schema).map(([name, definition]) => [name, cloneControlDefinition(definition)])\n )\n}\n\nexport function cloneControlDefinition(\n definition: BioTemplateControlSchema[string]\n): BioTemplateControlSchema[string] {\n return {\n ...definition,\n options: definition.options ? [...definition.options] : undefined,\n props: definition.props ? { ...definition.props } : undefined,\n sidebar: typeof definition.sidebar === 'object' && definition.sidebar !== null\n ? { ...definition.sidebar }\n : definition.sidebar,\n }\n}\n","import {\n getBioTemplateInfo,\n} from './catalog'\nimport {\n cloneControlDefinition,\n} from './controlSchemaClone'\nimport type {\n BioTemplateControlSchema,\n} from './controlSchemaTypes'\nimport type {\n TemplateId,\n} from './types'\n\nexport function mergeTemplateControlSchemas(\n templateIds: TemplateId[],\n templateSchemas: Record<TemplateId, BioTemplateControlSchema>\n): BioTemplateControlSchema {\n const merged: BioTemplateControlSchema = {}\n for (const templateId of templateIds) {\n const schema = templateSchemas[templateId]\n const template = getBioTemplateInfo(templateId)\n for (const [name, definition] of Object.entries(schema)) {\n const key = `${camelize(templateId)}${capitalize(name)}`\n merged[key] = {\n ...cloneControlDefinition(definition),\n section: definition.section ?? templateId,\n sectionLabel: definition.sectionLabel ?? template?.label ?? templateId,\n }\n }\n }\n return merged\n}\n\nfunction camelize(value: string): string {\n return value.replace(/-([a-z0-9])/g, (_, char: string) => char.toUpperCase())\n}\n\nfunction capitalize(value: string): string {\n return value.charAt(0).toUpperCase() + value.slice(1)\n}\n","import { isObjectLike as isRecord } from '../utils/records'\nimport {\n getBioTemplateInfo,\n} from './catalog'\nimport {\n getBioTemplatePackInfo,\n} from './packs'\nimport {\n getBioTemplatePresetInfo,\n} from './presets'\nimport {\n extractTemplateCollection,\n} from './templateEnvelopes'\nimport type {\n BioTemplateEnvelope,\n TemplateId,\n TemplatePresetId,\n} from './types'\nimport type {\n BioTemplateControlTarget,\n} from './controlSchemaTypes'\n\nexport type ControlSchemaResolvedTarget =\n | { kind: 'template'; name: TemplateId }\n | { kind: 'pack'; templates: TemplateId[] }\n | { kind: 'preset'; name: TemplatePresetId }\n | { kind: 'collection'; templates: TemplateId[] }\n\nexport function resolveControlSchemaTarget(\n target: BioTemplateControlTarget\n): ControlSchemaResolvedTarget | undefined {\n if (typeof target === 'string') {\n const preset = getBioTemplatePresetInfo(target)\n if (preset) return { kind: 'preset', name: preset.name }\n const pack = getBioTemplatePackInfo(target)\n if (pack) return { kind: 'pack', templates: [...pack.templates] }\n const template = getBioTemplateInfo(target)\n if (template) return { kind: 'template', name: template.template_id }\n return undefined\n }\n\n if (isTemplateEnvelope(target)) {\n const template = getBioTemplateInfo(target.template_id)\n return template ? { kind: 'template', name: template.template_id } : undefined\n }\n\n const presetName = collectionPresetName(target)\n if (presetName) {\n const preset = getBioTemplatePresetInfo(presetName)\n if (preset) return { kind: 'preset', name: preset.name }\n }\n\n const packName = collectionPackName(target)\n if (packName) {\n const pack = getBioTemplatePackInfo(packName)\n if (pack) return { kind: 'pack', templates: [...pack.templates] }\n }\n\n const collection = extractTemplateCollection(target)\n const templateIds = Object.keys(collection)\n .map(id => getBioTemplateInfo(id)?.template_id)\n .filter((id): id is TemplateId => id !== undefined)\n return templateIds.length > 0 ? { kind: 'collection', templates: templateIds } : undefined\n}\n\nexport function describeControlTarget(target: BioTemplateControlTarget): string {\n if (typeof target === 'string') return target\n if (isTemplateEnvelope(target)) return target.template_id\n return collectionPresetName(target) ?? collectionPackName(target) ?? 'template collection'\n}\n\nfunction isTemplateEnvelope(value: unknown): value is BioTemplateEnvelope<unknown> {\n return isRecord(value) && typeof value.template_id === 'string' && 'data' in value\n}\n\nfunction collectionPresetName(value: unknown): string | undefined {\n if (!isRecord(value) || !isRecord(value.metadata)) return undefined\n return typeof value.metadata.preset === 'string' ? value.metadata.preset : undefined\n}\n\nfunction collectionPackName(value: unknown): string | undefined {\n if (!isRecord(value) || !isRecord(value.metadata)) return undefined\n return typeof value.metadata.pack === 'string' ? value.metadata.pack : undefined\n}\n\n","export const ICONS = {\n plate: ['M4 4h16v16H4z', 'M8 4v16', 'M12 4v16', 'M16 4v16', 'M4 8h16', 'M4 12h16', 'M4 16h16'],\n samples: ['M16 21v-2a4 4 0 0 0-8 0v2', 'M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8'],\n dose: ['M10 2v8L4 20h16l-6-10V2', 'M8 2h8', 'M7 14h10'],\n table: ['M3 5h18', 'M3 12h18', 'M3 19h18', 'M8 5v14', 'M16 5v14'],\n run: ['M4 17l6-6 4 4 6-8', 'M4 21h16'],\n settings: ['M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8', 'M4 12h2', 'M18 12h2', 'M12 4v2', 'M12 18v2'],\n}\n\nexport const PLATE_FORMAT_OPTIONS = [6, 12, 24, 48, 96, 384] as const\nexport const CONCENTRATION_UNITS = ['nM', 'uM', 'mM', 'ug/mL', 'mg/mL'] as const\n","import {\n CONCENTRATION_UNITS,\n ICONS,\n PLATE_FORMAT_OPTIONS,\n} from './controlSchemaConstants'\nimport type {\n BioTemplateControlSchema,\n} from './controlSchemaTypes'\nimport type {\n TemplateId,\n} from './types'\n\nexport const templateControlSchemas = {\n 'plate-map': {\n plateName: {\n label: 'Plate name',\n default: 'Plate 1',\n section: 'layout',\n sectionLabel: 'Layout',\n sectionSubtitle: 'Plate geometry',\n view: 'design',\n sidebar: { icon: ICONS.plate, iconColor: '#0d9488', iconBg: '#ccfbf1' },\n },\n plateFormat: {\n label: 'Format',\n default: 96,\n options: PLATE_FORMAT_OPTIONS,\n section: 'layout',\n view: 'design',\n },\n sampleNames: {\n type: 'tags',\n label: 'Samples',\n default: ['Control', 'Treatment'],\n section: 'samples',\n sectionLabel: 'Samples',\n sectionSubtitle: 'Groups and legend',\n view: 'design',\n sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },\n },\n },\n 'sample-sheet': {\n sampleCount: {\n type: 'number',\n label: 'Sample count',\n default: 2,\n min: 1,\n max: 10000,\n section: 'samples',\n sectionLabel: 'Samples',\n sectionSubtitle: 'Metadata table',\n view: 'design',\n sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },\n },\n includeGroups: {\n label: 'Include groups',\n default: true,\n section: 'samples',\n view: 'design',\n },\n includeBatch: {\n label: 'Include batch',\n default: false,\n section: 'columns',\n sectionLabel: 'Columns',\n view: 'design',\n sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },\n },\n },\n 'sample-prep': {\n prepType: {\n label: 'Prep type',\n default: 'extraction',\n options: ['extraction', 'dilution', 'normalization', 'transfer', 'quench', 'custom'],\n section: 'protocol',\n sectionLabel: 'Protocol',\n sectionSubtitle: 'Prep workflow',\n view: 'design',\n sidebar: { icon: ICONS.run, iconColor: '#f97316', iconBg: '#ffedd5' },\n },\n volumeUnit: {\n label: 'Volume unit',\n default: 'uL',\n options: ['uL', 'mL'],\n section: 'protocol',\n view: 'design',\n },\n outputVolume: {\n type: 'number',\n label: 'Output volume',\n default: 50,\n min: 0,\n section: 'protocol',\n view: 'design',\n },\n },\n 'dose-response': {\n unit: {\n label: 'Dose unit',\n default: 'uM',\n options: CONCENTRATION_UNITS,\n section: 'dose',\n sectionLabel: 'Dose Design',\n sectionSubtitle: 'Concentration series',\n view: 'design',\n sidebar: { icon: ICONS.dose, iconColor: '#8b5cf6', iconBg: '#ede9fe' },\n },\n replicates: {\n type: 'number',\n label: 'Replicates',\n default: 3,\n min: 1,\n max: 24,\n section: 'dose',\n view: 'design',\n },\n includePlateLayout: {\n label: 'Create plate layout',\n default: true,\n section: 'layout',\n sectionLabel: 'Layout',\n sectionSubtitle: 'Well assignment',\n view: 'design',\n sidebar: { icon: ICONS.plate, iconColor: '#0d9488', iconBg: '#ccfbf1', defaultOpen: false },\n },\n },\n 'calibration-curve': {\n analyte: {\n label: 'Analyte',\n default: 'Analyte',\n section: 'standards',\n sectionLabel: 'Standards',\n sectionSubtitle: 'Curve setup',\n view: 'analysis',\n sidebar: { icon: ICONS.dose, iconColor: '#8b5cf6', iconBg: '#ede9fe' },\n },\n model: {\n label: 'Model',\n default: 'linear',\n options: ['linear', 'linear-weighted-1-x', 'linear-weighted-1-x2', 'quadratic', 'four-parameter-logistic'],\n section: 'fit',\n sectionLabel: 'Fit',\n view: 'analysis',\n sidebar: { icon: ICONS.settings, iconColor: '#0d9488', iconBg: '#ccfbf1' },\n },\n minRSquared: {\n type: 'number',\n label: 'Minimum R squared',\n default: 0.99,\n min: 0,\n max: 1,\n props: { step: 0.001 },\n section: 'fit',\n view: 'analysis',\n },\n },\n 'time-course': {\n timeUnit: {\n label: 'Time unit',\n default: 'hour',\n options: ['second', 'minute', 'hour', 'day', 'week'],\n section: 'schedule',\n sectionLabel: 'Schedule',\n sectionSubtitle: 'Sampling timeline',\n view: 'design',\n sidebar: { icon: ICONS.run, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },\n },\n replicates: {\n type: 'number',\n label: 'Replicates',\n default: 3,\n min: 1,\n max: 24,\n section: 'samples',\n sectionLabel: 'Samples',\n view: 'design',\n sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },\n },\n },\n 'protocol-steps': {\n defaultDuration: {\n type: 'number',\n label: 'Default duration',\n default: 30,\n min: 0,\n section: 'protocol',\n sectionLabel: 'Protocol',\n sectionSubtitle: 'Step defaults',\n view: 'design',\n sidebar: { icon: ICONS.run, iconColor: '#f97316', iconBg: '#ffedd5' },\n props: { suffix: 'min' },\n },\n editable: {\n label: 'Editable timeline',\n default: true,\n section: 'protocol',\n view: 'design',\n },\n },\n 'assay-matrix': {\n featureType: {\n label: 'Feature type',\n default: 'metabolite',\n options: ['metabolite', 'protein', 'gene', 'cell', 'compound', 'readout', 'other'],\n section: 'features',\n sectionLabel: 'Features',\n sectionSubtitle: 'Measurement matrix',\n view: 'analysis',\n sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },\n },\n normalizeValues: {\n label: 'Normalize values',\n default: false,\n section: 'analysis',\n sectionLabel: 'Analysis',\n view: 'analysis',\n sidebar: { icon: ICONS.settings, iconColor: '#0d9488', iconBg: '#ccfbf1', defaultOpen: false },\n },\n },\n 'reagent-list': {\n reagentKind: {\n label: 'Reagent kind',\n default: 'reagent',\n options: ['compound', 'antibody', 'primer', 'enzyme', 'buffer', 'media', 'kit', 'reagent', 'other'],\n section: 'inventory',\n sectionLabel: 'Inventory',\n sectionSubtitle: 'Reagent metadata',\n view: 'design',\n sidebar: { icon: ICONS.table, iconColor: '#10b981', iconBg: '#d1fae5' },\n },\n trackStock: {\n label: 'Track stock level',\n default: true,\n section: 'inventory',\n view: 'design',\n },\n },\n 'flow-cytometry-panel': {\n markers: {\n type: 'tags',\n label: 'Markers',\n default: ['CD3', 'CD4', 'CD8'],\n section: 'panel',\n sectionLabel: 'Panel',\n sectionSubtitle: 'Markers and controls',\n view: 'design',\n sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },\n },\n instrument: {\n label: 'Instrument',\n default: 'Flow cytometer',\n section: 'panel',\n sectionLabel: 'Panel',\n sectionSubtitle: 'Markers and controls',\n view: 'design',\n sidebar: { icon: ICONS.settings, iconColor: '#0d9488', iconBg: '#ccfbf1' },\n },\n includeDefaultControls: {\n label: 'Default controls',\n default: true,\n section: 'panel',\n view: 'design',\n },\n },\n 'instrument-run': {\n instrument: {\n label: 'Instrument',\n default: 'LC-MS',\n options: ['LC-MS', 'GC-MS', 'Orbitrap', 'Triple quadrupole', 'Plate reader', 'Other'],\n section: 'acquisition',\n sectionLabel: 'Acquisition',\n sectionSubtitle: 'Run queue',\n view: 'run',\n sidebar: { icon: ICONS.run, iconColor: '#ef4444', iconBg: '#fee2e2' },\n },\n method: {\n label: 'Method',\n default: 'Default method',\n section: 'acquisition',\n view: 'run',\n },\n includeQc: {\n label: 'Include QC',\n default: true,\n section: 'quality',\n sectionLabel: 'Quality Control',\n view: 'run',\n sidebar: { icon: ICONS.settings, iconColor: '#0d9488', iconBg: '#ccfbf1', defaultOpen: false },\n },\n },\n 'qpcr-plate': {\n chemistry: {\n label: 'Chemistry',\n default: 'sybr',\n options: ['sybr', 'taqman', 'probe', 'evagreen', 'other'],\n section: 'assay',\n sectionLabel: 'Assay',\n sectionSubtitle: 'qPCR setup',\n view: 'design',\n sidebar: { icon: ICONS.plate, iconColor: '#0d9488', iconBg: '#ccfbf1' },\n },\n replicates: {\n type: 'number',\n label: 'Replicates',\n default: 3,\n min: 1,\n max: 12,\n section: 'assay',\n view: 'design',\n },\n includeNoTemplateControls: {\n label: 'No-template controls',\n default: true,\n section: 'controls',\n sectionLabel: 'Controls',\n view: 'design',\n sidebar: { icon: ICONS.settings, iconColor: '#8b5cf6', iconBg: '#ede9fe', defaultOpen: false },\n },\n },\n} satisfies Record<TemplateId, BioTemplateControlSchema>\n","import {\n CONCENTRATION_UNITS,\n ICONS,\n PLATE_FORMAT_OPTIONS,\n} from './controlSchemaConstants'\nimport type {\n BioTemplateControlSchema,\n} from './controlSchemaTypes'\nimport {\n templateControlSchemas,\n} from './templateControlSchemas'\nimport type {\n TemplatePresetId,\n} from './types'\n\nexport const presetControlSchemas = {\n 'wellplate-screen': {\n ...templateControlSchemas['plate-map'],\n ...templateControlSchemas['dose-response'],\n sampleNames: {\n ...templateControlSchemas['plate-map'].sampleNames,\n default: ['Control', 'Treatment'],\n },\n },\n 'qpcr-expression': {\n sampleNames: {\n type: 'tags',\n label: 'Samples',\n default: ['Control', 'Treatment'],\n section: 'samples',\n sectionLabel: 'Samples',\n sectionSubtitle: 'Expression groups',\n view: 'design',\n sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },\n },\n targets: {\n type: 'tags',\n label: 'Targets',\n default: ['ACTB', 'GAPDH'],\n section: 'assay',\n sectionLabel: 'Assay',\n view: 'design',\n sidebar: { icon: ICONS.plate, iconColor: '#0d9488', iconBg: '#ccfbf1' },\n },\n ...templateControlSchemas['qpcr-plate'],\n },\n 'lcms-batch': {\n sampleNames: {\n type: 'tags',\n label: 'Samples',\n default: ['S001', 'S002'],\n section: 'samples',\n sectionLabel: 'Samples',\n sectionSubtitle: 'Batch samples',\n view: 'run',\n sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },\n },\n featureNames: {\n type: 'tags',\n label: 'Features',\n default: ['Glucose', 'Lactate'],\n section: 'features',\n sectionLabel: 'Features',\n view: 'analysis',\n sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },\n },\n ...templateControlSchemas['instrument-run'],\n ...templateControlSchemas['assay-matrix'],\n },\n 'targeted-metabolomics': {\n sampleNames: {\n type: 'tags',\n label: 'Samples',\n default: ['S001', 'S002'],\n section: 'samples',\n sectionLabel: 'Samples',\n sectionSubtitle: 'Unknowns and QC pool',\n view: 'run',\n sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },\n },\n metaboliteNames: {\n type: 'tags',\n label: 'Metabolites',\n default: ['Glucose', 'Lactate', 'Pyruvate'],\n section: 'features',\n sectionLabel: 'Metabolites',\n sectionSubtitle: 'Quantitation panel',\n view: 'analysis',\n sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },\n },\n internalStandards: {\n type: 'tags',\n label: 'Internal standards',\n default: ['Stable isotope internal standard mix'],\n section: 'standards',\n sectionLabel: 'Standards',\n sectionSubtitle: 'Calibration and internal standards',\n view: 'analysis',\n sidebar: { icon: ICONS.dose, iconColor: '#8b5cf6', iconBg: '#ede9fe' },\n },\n standardConcentrations: {\n type: 'tags',\n label: 'Calibration levels',\n default: ['0.1', '1', '10', '100'],\n section: 'standards',\n view: 'analysis',\n },\n concentrationUnit: {\n label: 'Concentration unit',\n default: 'uM',\n options: CONCENTRATION_UNITS,\n section: 'standards',\n view: 'analysis',\n },\n responseUnit: {\n label: 'Response unit',\n default: 'peak area ratio',\n section: 'readout',\n sectionLabel: 'Readout',\n view: 'analysis',\n sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },\n },\n instrument: {\n ...templateControlSchemas['instrument-run'].instrument,\n default: 'LC-MS',\n },\n method: {\n ...templateControlSchemas['instrument-run'].method,\n default: 'Targeted metabolomics',\n },\n prepType: {\n ...templateControlSchemas['sample-prep'].prepType,\n default: 'extraction',\n },\n outputVolume: templateControlSchemas['sample-prep'].outputVolume,\n includeQc: templateControlSchemas['instrument-run'].includeQc,\n },\n 'elisa-assay': {\n sampleNames: {\n type: 'tags',\n label: 'Samples',\n default: ['Control', 'Treatment'],\n section: 'samples',\n sectionLabel: 'Samples',\n sectionSubtitle: 'Unknowns and controls',\n view: 'design',\n sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },\n },\n analyte: {\n label: 'Analyte',\n default: 'Analyte',\n section: 'standards',\n sectionLabel: 'Standards',\n sectionSubtitle: 'Calibration setup',\n view: 'analysis',\n sidebar: { icon: ICONS.dose, iconColor: '#8b5cf6', iconBg: '#ede9fe' },\n },\n standardConcentrations: {\n type: 'tags',\n label: 'Standards',\n default: ['1000', '100', '10', '1'],\n section: 'standards',\n view: 'analysis',\n },\n unit: {\n label: 'Concentration unit',\n default: 'pg/mL',\n options: ['pg/mL', 'ng/mL', 'ug/mL', 'nM', 'uM'],\n section: 'standards',\n view: 'analysis',\n },\n responseUnit: {\n label: 'Response unit',\n default: 'OD450',\n section: 'readout',\n sectionLabel: 'Readout',\n view: 'analysis',\n sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },\n },\n plateName: {\n label: 'Plate name',\n default: 'ELISA plate',\n section: 'layout',\n sectionLabel: 'Layout',\n sectionSubtitle: 'Plate geometry',\n view: 'design',\n sidebar: { icon: ICONS.plate, iconColor: '#0d9488', iconBg: '#ccfbf1' },\n },\n plateFormat: {\n label: 'Format',\n default: 96,\n options: PLATE_FORMAT_OPTIONS,\n section: 'layout',\n view: 'design',\n },\n },\n 'flow-cytometry-assay': {\n sampleNames: {\n type: 'tags',\n label: 'Samples',\n default: ['Control', 'Treatment'],\n section: 'samples',\n sectionLabel: 'Samples',\n sectionSubtitle: 'Assay groups',\n view: 'design',\n sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },\n },\n markers: {\n ...templateControlSchemas['flow-cytometry-panel'].markers,\n default: ['CD3', 'CD4', 'CD8'],\n },\n featureNames: {\n type: 'tags',\n label: 'Readouts',\n default: ['CD3+ cells', 'CD4+ cells', 'CD8+ cells'],\n section: 'features',\n sectionLabel: 'Readouts',\n sectionSubtitle: 'Assay matrix columns',\n view: 'analysis',\n sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },\n },\n instrument: {\n ...templateControlSchemas['flow-cytometry-panel'].instrument,\n default: 'Flow cytometer',\n },\n includeDefaultControls: templateControlSchemas['flow-cytometry-panel'].includeDefaultControls,\n },\n 'western-blot-assay': {\n sampleNames: {\n type: 'tags',\n label: 'Samples',\n default: ['Control', 'Treatment'],\n section: 'samples',\n sectionLabel: 'Samples',\n sectionSubtitle: 'Blot lanes and groups',\n view: 'design',\n sidebar: { icon: ICONS.samples, iconColor: '#10b981', iconBg: '#d1fae5' },\n },\n targets: {\n type: 'tags',\n label: 'Targets',\n default: ['Target protein'],\n section: 'assay',\n sectionLabel: 'Assay',\n sectionSubtitle: 'Protein targets',\n view: 'design',\n sidebar: { icon: ICONS.table, iconColor: '#0ea5e9', iconBg: '#e0f2fe' },\n },\n loadingControl: {\n label: 'Loading control',\n default: 'ACTB',\n section: 'normalization',\n sectionLabel: 'Normalization',\n view: 'analysis',\n sidebar: { icon: ICONS.settings, iconColor: '#0d9488', iconBg: '#ccfbf1' },\n },\n },\n} satisfies Record<TemplatePresetId, BioTemplateControlSchema>\n","import {\n controlsToFormSchema,\n controlsToSectionFormSchemas,\n controlsToSidebarPanels,\n getControlDefaults,\n useControlSchema,\n type ControlSchemaOptions,\n type UseControlSchemaReturn,\n} from '../composables/useControlSchema'\nimport {\n cloneControlSchema,\n cloneSchemaMap,\n} from './controlSchemaClone'\nimport {\n mergeTemplateControlSchemas,\n} from './controlSchemaMerge'\nimport {\n describeControlTarget,\n resolveControlSchemaTarget,\n} from './controlSchemaTargets'\nimport {\n presetControlSchemas,\n} from './presetControlSchemas'\nimport {\n templateControlSchemas,\n} from './templateControlSchemas'\nimport type {\n TemplateId,\n TemplatePresetId,\n} from './types'\nimport type {\n BioTemplateControlSchema,\n BioTemplateControlTarget,\n} from './controlSchemaTypes'\n\nexport type {\n BioTemplateControlSchema,\n BioTemplateControlTarget,\n} from './controlSchemaTypes'\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function listBioTemplateControlSchemas(): Record<TemplateId, BioTemplateControlSchema> {\n return cloneSchemaMap(templateControlSchemas)\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function listBioTemplatePresetControlSchemas(): Record<TemplatePresetId, BioTemplateControlSchema> {\n return cloneSchemaMap(presetControlSchemas)\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function getBioTemplateControlSchema(\n target: BioTemplateControlTarget\n): BioTemplateControlSchema | undefined {\n const resolved = resolveControlSchemaTarget(target)\n if (!resolved) return undefined\n\n if (resolved.kind === 'template') {\n return cloneControlSchema(templateControlSchemas[resolved.name])\n }\n if (resolved.kind === 'preset') {\n return cloneControlSchema(presetControlSchemas[resolved.name])\n }\n return mergeTemplateControlSchemas(resolved.templates, templateControlSchemas)\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function requireBioTemplateControlSchema(\n target: BioTemplateControlTarget\n): BioTemplateControlSchema {\n const schema = getBioTemplateControlSchema(target)\n if (!schema) {\n throw new Error(`No built-in control schema found for '${describeControlTarget(target)}'.`)\n }\n return schema\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function createBioTemplateControlToolkit(\n target: BioTemplateControlTarget,\n options: ControlSchemaOptions = {}\n): UseControlSchemaReturn<BioTemplateControlSchema> {\n return useControlSchema(requireBioTemplateControlSchema(target), options)\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function bioTemplateControlsToFormSchema(\n target: BioTemplateControlTarget,\n options: ControlSchemaOptions = {}\n) {\n return controlsToFormSchema(requireBioTemplateControlSchema(target), options)\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function bioTemplateControlsToSidebarPanels(\n target: BioTemplateControlTarget,\n options: ControlSchemaOptions = {}\n) {\n return controlsToSidebarPanels(requireBioTemplateControlSchema(target), options)\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function bioTemplateControlsToSectionFormSchemas(\n target: BioTemplateControlTarget,\n options: ControlSchemaOptions = {}\n) {\n return controlsToSectionFormSchemas(requireBioTemplateControlSchema(target), options)\n}\n\n/** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */\nexport function getBioTemplateControlDefaults(target: BioTemplateControlTarget) {\n return getControlDefaults(requireBioTemplateControlSchema(target))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAeA,MAAM,QAAQ;EASd,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